RE: UDP question.




My two adapters has two different IP address, and I bind one IP
on one socket,
do you mean that I alloc two socket and bind different IP is not
helpful?

Correct. You are still sending all the packets *to* the same place.

In fact, all the packet sent from two socket is go out by one
network adapter?

Yes, of course. Why would the kernel send traffic to a destination out an
interface that doesn't go to that destination?

Suppose you have two interfaces, 1.2.3.4/8 and 10.2.3.4/8, if you are
sending a packet *to* 1.2.4.5, it will go out the first interface. This
applies whether the source address is 1.2.3.4 or 10.2.3.4.

By default, the kernel routes traffic based on where it is going, not which
interface address it came from.

DS


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [patch 4/10] s390: network driver.
    ... but it seems someone is complaining about some behavior changing? ... network driver discard packets on link-down. ... However this approach doesnt play well if the socket can ... be blocked completely because of /one/ interface having its link ...
    (Linux-Kernel)
  • Re: SO_BINDTODEVICE
    ...     in the passed interface name. ...     processed by the socket. ... does not mean that if you bind to an Ethernet interface, only packets ...
    (comp.os.linux.networking)
  • Re: python libpcap equivalent
    ... socket to send them out again on whatever interface you want. ... under Linux you can also capture packets using a raw-mode ... user-space app to "pretend" to be an Ethernet interface in the ...
    (comp.lang.python)
  • raw sockets and blocking
    ... cable of one interface has been pulled? ... which uses a single raw, AF_INET/OSPF socket and manages it's own IP ... to send/receive OSPF packets to/from a number of interfaces. ...
    (Linux-Kernel)
  • Re: AIX Dropping Packets Network Woes
    ... Out of four packets, it always drops ... 713584 broadcast/multicast datagrams dropped due to no socket ... is this an Etherchannel interface? ...
    (comp.unix.aix)