Jan Danielsson
2012-04-20 12:57:11 UTC
Hello,
Is it entirely up to the routing to determine which interface/wire to
send out a packet on?
Say we have the following network configuration:
bge0: 192.168.1.42
bge1: 10.0.0.13
(No route between the networks)
.. and a program which sets up sockets:
s1 = socket()
s2 = socket()
bind(s1, 192.168.1.42)
bind(s2, 10.0.0.13)
.. and later does:
sendto(s1, "Hello", 10.0.0.17)
Can one assume that this packet will leave through bge1, even though
it's is "bound" to the "name" of bge0?
I must admit that I would have guessed that bind():ing would have
some kind of bearing on outbound interface, but from what I'm reading,
sendto() simply chucks the packet further down the network stack and
then it's up to the routing code to sort out where to pass it on
(ignoring the actual socket handle from which it came). So bind is
essentially only used to stamp the source-field (in the case of sending)
before pushing packets out the door?
Is it entirely up to the routing to determine which interface/wire to
send out a packet on?
Say we have the following network configuration:
bge0: 192.168.1.42
bge1: 10.0.0.13
(No route between the networks)
.. and a program which sets up sockets:
s1 = socket()
s2 = socket()
bind(s1, 192.168.1.42)
bind(s2, 10.0.0.13)
.. and later does:
sendto(s1, "Hello", 10.0.0.17)
Can one assume that this packet will leave through bge1, even though
it's is "bound" to the "name" of bge0?
I must admit that I would have guessed that bind():ing would have
some kind of bearing on outbound interface, but from what I'm reading,
sendto() simply chucks the packet further down the network stack and
then it's up to the routing code to sort out where to pass it on
(ignoring the actual socket handle from which it came). So bind is
essentially only used to stamp the source-field (in the case of sending)
before pushing packets out the door?
--
Kind regards,
Jan Danielsson
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Kind regards,
Jan Danielsson
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de