One socket per interface, then how to select the correct socket ? - TCP-IP

This is a discussion on One socket per interface, then how to select the correct socket ? - TCP-IP ; On Aug 5, 6:38*am, "Skybuck Flying" wrote: > Both lan adapters are in the operational state, one is for internet, the > other for lan. > > So this can't be used to tell which one is connected to the ...

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 21 to 22 of 22

Thread: One socket per interface, then how to select the correct socket ?

  1. Re: One socket per interface, then how to select the correct socket ?

    On Aug 5, 6:38*am, "Skybuck Flying" wrote:

    > Both lan adapters are in the operational state, one is for internet, the
    > other for lan.
    >
    > So this can't be used to tell which one is connected to the internet.


    There is no reason the application can or should care.

    > This leaves the dhcp as a possible indication, however lan's could have
    > dhcp's too.


    Indication of what?

    1) This computer is connected to the LAN.

    2) This computer is connected to the Internet.

    3) Therefore the LAN is connected to the Internet.

    So it doesn't matter which interface is chosen or used. It is
    perfectly legal to choose the LAN source address for an Internet
    connection. That's why LANs that are gatewayed to the Internet have a
    gateway that does NAT.

    DS

  2. Re: One socket per interface, then how to select the correct socket ?

    On Aug 5, 7:41*am, "Skybuck Flying" wrote:

    > Another explanation could be the stack simply sends the replies back out the
    > wrong interface.


    Impossible.

    > Somehow it could select the wrong interface.


    Impossible.

    You are really confused. I'll try one more time to straighten you out.

    1) If the machine is not a gateway, it is perfectly reasonable to send
    this packet over the LAN interface so that it will get to the Internet
    through the gateway.

    2) If this machine is a gateway, the mistake would be not NATting the
    packet even though it has a LAN source address and an Internet
    destination address. That would have nothing to do choosing the wrong
    interface but be a completely different problem.

    3) If there is no gateway on the LAN and the machine is not the
    gateway, then it should be impossible for it to send the packet on the
    LAN interface. There would be no route pointing that way.

    So you are trying to solve a problem that cannot exist.

    DS

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2