Proboematic TCP/IP connections with different subnets! - TCP-IP

This is a discussion on Proboematic TCP/IP connections with different subnets! - TCP-IP ; Hi - I'm trying to connect a PC with 2 NIC ports to a couple of boards. The PC NIC ports must be on seperate subnets. The end-result should be that the Boards connected to the PC should be on ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: Proboematic TCP/IP connections with different subnets!

  1. Proboematic TCP/IP connections with different subnets!

    Hi -

    I'm trying to connect a PC with 2 NIC ports to a couple of boards. The
    PC NIC ports must be on seperate subnets. The end-result should be
    that the Boards connected to the PC should be on the same subnet as
    the PC NIC port. Here is the topology:

    PC NIC 1 ----> Board 1
    PC NIC 1 static IP: 192.168.178.253
    PC NIC 1 netmask: 255.255.255.0
    PC NIC 1 gateway: empty
    Board 1 static IP: 192.168.176.1 (initially hardcoded except for last
    octet read from hardware pin)
    Board 1 netmask: 255.255.255.0
    Board 1 gateway: 192.168.0.1


    PC NIC 2 ----> Board 2
    PC NIC 2 static IP: 192.168.179.253
    PC NIC 2 netmask: 255.255.255.0
    PC NIC 2 gateway: empty
    Board 2 static IP: 192.168.176.2 (initially hardcoded except for last
    octet read from hardware pin)
    Board 2 netmask: 255.255.255.0
    Board 2 gateway: 192.168.0.1

    I have openTCP running on the boards. Let's pick Board 1 for example.
    When the board comes up it determines an initial IP for itself on
    subnet 192.168.176 which is clearly different from that of the PC
    port. What I do is step through possible subnets attemtping to connect
    to the PC until I should connect to 192.168.176.253. If I connect, I
    should compare the subnets if they are different. In this case, they
    would be. 192.168.176 against 192.168.178 so I go ahead and update the
    board's IP from 192.168.176.1 ---> 192.168.178.1
    Then what I'll do is disconnect, then reconnect again. Well, I'm not
    able to reconnect.

    What am I doing wrong? am I using the correct netmasks on the PC? on
    the board? how about the gateway values on the PC and the board?

    Same problems happen on Board 2.

    Thanks for any input you can give me


  2. Re: Proboematic TCP/IP connections with different subnets!

    On Jul 9, 12:14 pm, CLiJC wrote:
    > Hi -
    >
    > I'm trying to connect a PC with 2 NIC ports to a couple of boards. The
    > PC NIC ports must be on seperate subnets. The end-result should be
    > that the Boards connected to the PC should be on the same subnet as
    > the PC NIC port. Here is the topology:
    >
    > PC NIC 1 ----> Board 1
    > PC NIC 1 static IP: 192.168.178.253
    > PC NIC 1 netmask: 255.255.255.0
    > PC NIC 1 gateway: empty
    > Board 1 static IP: 192.168.176.1 (initially hardcoded except for last
    > octet read from hardware pin)
    > Board 1 netmask: 255.255.255.0
    > Board 1 gateway: 192.168.0.1
    >
    > PC NIC 2 ----> Board 2
    > PC NIC 2 static IP: 192.168.179.253
    > PC NIC 2 netmask: 255.255.255.0
    > PC NIC 2 gateway: empty
    > Board 2 static IP: 192.168.176.2 (initially hardcoded except for last
    > octet read from hardware pin)
    > Board 2 netmask: 255.255.255.0
    > Board 2 gateway: 192.168.0.1
    >
    > I have openTCP running on the boards. Let's pick Board 1 for example.
    > When the board comes up it determines an initial IP for itself on
    > subnet 192.168.176 which is clearly different from that of the PC
    > port. What I do is step through possible subnets attemtping to connect
    > to the PC until I should connect to 192.168.176.253. If I connect, I
    > should compare the subnets if they are different. In this case, they
    > would be. 192.168.176 against 192.168.178 so I go ahead and update the
    > board's IP from 192.168.176.1 ---> 192.168.178.1
    > Then what I'll do is disconnect, then reconnect again. Well, I'm not
    > able to reconnect.
    >
    > What am I doing wrong? am I using the correct netmasks on the PC? on
    > the board? how about the gateway values on the PC and the board?
    >
    > Same problems happen on Board 2.
    >
    > Thanks for any input you can give me


    CORRECTION:
    ......What I do is step through possible subnets attemtping to connect
    to the PC until I should connect to 192.168.178.253. If I connect....


  3. Re: Proboematic TCP/IP connections with different subnets!

    On Jul 9, 9:14 am, CLiJC wrote:

    > port. What I do is step through possible subnets attemtping to connect
    > to the PC until I should connect to 192.168.176.253. If I connect, I
    > should compare the subnets if they are different. In this case, they
    > would be. 192.168.176 against 192.168.178 so I go ahead and update the
    > board's IP from 192.168.176.1 ---> 192.168.178.1
    > Then what I'll do is disconnect, then reconnect again. Well, I'm not
    > able to reconnect.


    What you're saying doesn't seem to make any sense. The board has an IP
    address that cannot conceivably talk to the PC's address. The PC would
    have no reason to send a packet bound for the board's address over
    that interface. So what does "attempting to connect" mean?

    If the board has an IP address of 192.168.176.1/24 and tries to
    connect to 192.168.178.253, it will fail for many reasons. First, how
    would it even know to send the packet over its ethernet link? If the
    PC got the packet, how would it know to send the reply packet over its
    ethernet link?

    DS


  4. Re: Proboematic TCP/IP connections with different subnets!

    On Jul 9, 1:01 pm, David Schwartz wrote:
    > On Jul 9, 9:14 am, CLiJC wrote:
    >
    > > port. What I do is step through possible subnets attemtping to connect
    > > to the PC until I should connect to 192.168.176.253. If I connect, I
    > > should compare the subnets if they are different. In this case, they
    > > would be. 192.168.176 against 192.168.178 so I go ahead and update the
    > > board's IP from 192.168.176.1 ---> 192.168.178.1
    > > Then what I'll do is disconnect, then reconnect again. Well, I'm not
    > > able to reconnect.

    >
    > What you're saying doesn't seem to make any sense. The board has an IP
    > address that cannot conceivably talk to the PC's address. The PC would
    > have no reason to send a packet bound for the board's address over
    > that interface. So what does "attempting to connect" mean?
    >
    > If the board has an IP address of 192.168.176.1/24 and tries to
    > connect to 192.168.178.253, it will fail for many reasons. First, how
    > would it even know to send the packet over its ethernet link? If the
    > PC got the packet, how would it know to send the reply packet over its
    > ethernet link?
    >
    > DS


    David - so you're saying that the board and the PC must be on the same
    subnet for them to communicate? will modifying the netmask help
    resolve the issue?


  5. Re: Proboematic TCP/IP connections with different subnets!

    CLiJC writes:

    > I'm trying to connect a PC with 2 NIC ports to a couple of boards. The
    > PC NIC ports must be on seperate subnets. The end-result should be
    > that the Boards connected to the PC should be on the same subnet as
    > the PC NIC port.


    Use DHCP. I don't know openTCP, but it is quite common for a protocol
    stack to have trouble switching its IP address, especially if it is a
    simple stack not intended for complex, non-stop operations.

    On the other hand, most stacks (and simple stacks, in particular) are
    normally designed to handle the pre-address DHCP mechanism to find an
    address dynamically. Even if you don't use DHCP anywhere else, it
    would probably be much easier to set it up on the PC to handle just
    these two boards rather than using your address search method.

    -don

  6. Re: Proboematic TCP/IP connections with different subnets!

    On Jul 9, 1:37 pm, don provan wrote:
    > CLiJC writes:
    > > I'm trying to connect a PC with 2 NIC ports to a couple of boards. The
    > > PC NIC ports must be on seperate subnets. The end-result should be
    > > that the Boards connected to the PC should be on the same subnet as
    > > the PC NIC port.

    >
    > Use DHCP. I don't know openTCP, but it is quite common for a protocol
    > stack to have trouble switching its IP address, especially if it is a
    > simple stack not intended for complex, non-stop operations.
    >
    > On the other hand, most stacks (and simple stacks, in particular) are
    > normally designed to handle the pre-address DHCP mechanism to find an
    > address dynamically. Even if you don't use DHCP anywhere else, it
    > would probably be much easier to set it up on the PC to handle just
    > these two boards rather than using your address search method.
    >
    > -don


    Don - I know what you mean about DHCP. The only thing is that there is
    a requirement not to use DHCP and use those specific static subnets.


  7. Re: Proboematic TCP/IP connections with different subnets!

    On Jul 9, 2:08 pm, CLiJC wrote:
    > On Jul 9, 1:37 pm, don provan wrote:
    >
    >
    >
    >
    >
    > > CLiJC writes:
    > > > I'm trying to connect a PC with 2 NIC ports to a couple of boards. The
    > > > PC NIC ports must be on seperate subnets. The end-result should be
    > > > that the Boards connected to the PC should be on the same subnet as
    > > > the PC NIC port.

    >
    > > Use DHCP. I don't know openTCP, but it is quite common for a protocol
    > > stack to have trouble switching its IP address, especially if it is a
    > > simple stack not intended for complex, non-stop operations.

    >
    > > On the other hand, most stacks (and simple stacks, in particular) are
    > > normally designed to handle the pre-address DHCP mechanism to find an
    > > address dynamically. Even if you don't use DHCP anywhere else, it
    > > would probably be much easier to set it up on the PC to handle just
    > > these two boards rather than using your address search method.

    >
    > > -don

    >
    > Don - I know what you mean about DHCP. The only thing is that there is
    > a requirement not to use DHCP and use those specific static subnets.- Hide quoted text -
    >
    > - Show quoted text -


    any more ideas ?


  8. Re: Proboematic TCP/IP connections with different subnets!

    On Jul 9, 10:18 am, CLiJC wrote:

    > David - so you're saying that the board and the PC must be on the same
    > subnet for them to communicate?


    Not necessarily, but if they're not, some routing is required. You
    have neither set up any routing nor put them on the same subnet.

    > will modifying the netmask help
    > resolve the issue?


    Yes, if you do it on both ends, because then they'd be on the same
    subnet.

    DS


  9. Re: Proboematic TCP/IP connections with different subnets!

    On Jul 9, 11:08 am, CLiJC wrote:

    > Don - I know what you mean about DHCP. The only thing is that there is
    > a requirement not to use DHCP and use those specific static subnets.


    Your requirement is incoherent. What does it mean to "use those
    specific static subnets" if nothing in the world knows how to reach
    those static subnets?

    It's like saying you plan to have a company in Germany but have a
    requirement that mail to the company must be addressed to Switzerland.
    Well, then it's not going to get there.

    If the device is on subnet X, it must be addressed in subnet X,
    otherwise nobody else will know how to reach it. Again, unless you
    implement some kind of routing.

    DS


+ Reply to Thread