Discussion:
Question about TCP/IP
(too old to reply)
unknown
2009-11-05 10:26:22 UTC
Permalink
Hello,

On a computer (called C1) I have two network cards.
The first network card has IP 192.168.0.10 and the subnet mask is
255.255.255.0.
The second network card has IP 192.168.1.10 and the subnet mask is
255.255.255.0.

On this computer, I have made a program witch connect with two computers
(called C2 and C3) using Socket in MS VB .Net 2008 Express.
C2 has IP 192.168.0.11 and the subnet mask is 255.255.255.0.
C3 has IP 192.168.1.11 and the subnet mask is 255.255.255.0.

My question is :
When I send datas using the socket connexion with C2, does the operating
system send those datas only on the good network card ? or it send on both
network cards (in this case, the frame will reach the destination witch the
network card for C2, and never reach the destination for C3 but this network
is polluted with datas witch does not belong to it) ?

Regards,
Stéphane

PS :
I'm french, so excuse me for my english
PPS :
If the word "witch" is not the good word, you can try with the word "that"
Noah Davids
2009-11-05 13:17:39 UTC
Permalink
Post by unknown
Hello,
On a computer (called C1) I have two network cards.
The first network card has IP 192.168.0.10 and the subnet mask is
255.255.255.0.
The second network card has IP 192.168.1.10 and the subnet mask is
255.255.255.0.
On this computer, I have made a program witch connect with two computers
(called C2 and C3) using Socket in MS VB .Net 2008 Express.
C2 has IP 192.168.0.11 and the subnet mask is 255.255.255.0.
C3 has IP 192.168.1.11 and the subnet mask is 255.255.255.0.
When I send datas using the socket connexion with C2, does the operating
system send those datas only on the good network card ? or it send on both
network cards (in this case, the frame will reach the destination witch the
network card for C2, and never reach the destination for C3 but this network
is polluted with datas witch does not belong to it) ?
Regards,
Stéphane
I'm french, so excuse me for my english
If the word "witch" is not the good word, you can try with the word "that"
You speak better English than I speak French.

The system should send data to C2 only out of the 192.168.0.10 interface
and data to C3 only out of the 192.168.1.10 interface. In other words
there will be no "pollution" of the networks with data that does not belong.
Geoff
2009-11-05 18:13:13 UTC
Permalink
Post by unknown
Hello,
On a computer (called C1) I have two network cards.
The first network card has IP 192.168.0.10 and the subnet mask is
255.255.255.0.
The second network card has IP 192.168.1.10 and the subnet mask is
255.255.255.0.
On this computer, I have made a program witch connect with two computers
(called C2 and C3) using Socket in MS VB .Net 2008 Express.
C2 has IP 192.168.0.11 and the subnet mask is 255.255.255.0.
C3 has IP 192.168.1.11 and the subnet mask is 255.255.255.0.
When I send datas using the socket connexion with C2, does the operating
system send those datas only on the good network card ? or it send on both
network cards (in this case, the frame will reach the destination witch the
network card for C2, and never reach the destination for C3 but this network
is polluted with datas witch does not belong to it) ?
Regards,
Stéphane
I'm french, so excuse me for my english
If the word "witch" is not the good word, you can try with the word "that"
Bon jour.

The correct spelling is "which", not witch. Witches are hags that
haunt us on Halloween. Which witch is the good witch? I don't know
that. :)

The TCP/IP stack will examine the address of the destination host and
use the netmask to determine which network card to use for that
destination.

Traffic destined for 192.168.1.x will go out on C3.
Traffic destined for 192.168.0.x will go out on C2.

However, traffic destined for any other hosts, such as 74.125.67.100
(google.com) will go out on C2 or C3 depending on which of them has
the lowest metric. The metric is the measure of the cost of the route
on that hop, the lower the metric the lower the cost. You can display
the metrics for each network interface by typing "route print" in the
cmd console.

The card with the lowest metric is the preferred route for traffic
that is not destined for addresses on the particular LAN subnets for
all the cards in the system.
Geoff
2009-11-05 19:45:28 UTC
Permalink
Post by Geoff
Post by unknown
Hello,
On a computer (called C1) I have two network cards.
The first network card has IP 192.168.0.10 and the subnet mask is
255.255.255.0.
The second network card has IP 192.168.1.10 and the subnet mask is
255.255.255.0.
On this computer, I have made a program witch connect with two computers
(called C2 and C3) using Socket in MS VB .Net 2008 Express.
C2 has IP 192.168.0.11 and the subnet mask is 255.255.255.0.
C3 has IP 192.168.1.11 and the subnet mask is 255.255.255.0.
When I send datas using the socket connexion with C2, does the operating
system send those datas only on the good network card ? or it send on both
network cards (in this case, the frame will reach the destination witch the
network card for C2, and never reach the destination for C3 but this network
is polluted with datas witch does not belong to it) ?
Regards,
Stéphane
I'm french, so excuse me for my english
If the word "witch" is not the good word, you can try with the word "that"
Bon jour.
The correct spelling is "which", not witch. Witches are hags that
haunt us on Halloween. Which witch is the good witch? I don't know
that. :)
The TCP/IP stack will examine the address of the destination host and
use the netmask to determine which network card to use for that
destination.
Traffic destined for 192.168.1.x will go out on C3.
Traffic destined for 192.168.0.x will go out on C2.
However, traffic destined for any other hosts, such as 74.125.67.100
(google.com) will go out on C2 or C3 depending on which of them has
the lowest metric. The metric is the measure of the cost of the route
on that hop, the lower the metric the lower the cost. You can display
the metrics for each network interface by typing "route print" in the
cmd console.
The card with the lowest metric is the preferred route for traffic
that is not destined for addresses on the particular LAN subnets for
all the cards in the system.
Amendment:
Traffic destined for 192.168.1.x will go out on the NIC on that net.
Traffic destined for 192.168.0.x will go out on the NIC on that net.
unknown
2009-11-05 21:05:42 UTC
Permalink
Thanks a lot Geoff !

Like I said to Noah, all is OK !!!

I knew something was wrong with that witch ! Let's burn it !!! :) (and I
just saw Eastwick !)

Stéphane
Post by Geoff
Post by Geoff
Post by unknown
Hello,
On a computer (called C1) I have two network cards.
The first network card has IP 192.168.0.10 and the subnet mask is
255.255.255.0.
The second network card has IP 192.168.1.10 and the subnet mask is
255.255.255.0.
On this computer, I have made a program witch connect with two computers
(called C2 and C3) using Socket in MS VB .Net 2008 Express.
C2 has IP 192.168.0.11 and the subnet mask is 255.255.255.0.
C3 has IP 192.168.1.11 and the subnet mask is 255.255.255.0.
When I send datas using the socket connexion with C2, does the operating
system send those datas only on the good network card ? or it send on both
network cards (in this case, the frame will reach the destination witch the
network card for C2, and never reach the destination for C3 but this network
is polluted with datas witch does not belong to it) ?
Regards,
Stéphane
I'm french, so excuse me for my english
If the word "witch" is not the good word, you can try with the word "that"
Bon jour.
The correct spelling is "which", not witch. Witches are hags that
haunt us on Halloween. Which witch is the good witch? I don't know
that. :)
The TCP/IP stack will examine the address of the destination host and
use the netmask to determine which network card to use for that
destination.
Traffic destined for 192.168.1.x will go out on C3.
Traffic destined for 192.168.0.x will go out on C2.
However, traffic destined for any other hosts, such as 74.125.67.100
(google.com) will go out on C2 or C3 depending on which of them has
the lowest metric. The metric is the measure of the cost of the route
on that hop, the lower the metric the lower the cost. You can display
the metrics for each network interface by typing "route print" in the
cmd console.
The card with the lowest metric is the preferred route for traffic
that is not destined for addresses on the particular LAN subnets for
all the cards in the system.
Traffic destined for 192.168.1.x will go out on the NIC on that net.
Traffic destined for 192.168.0.x will go out on the NIC on that net.
Noah Davids
2009-11-06 13:18:33 UTC
Permalink
Post by Geoff
However, traffic destined for any other hosts, such as 74.125.67.100
(google.com) will go out on C2 or C3 depending on which of them has
the lowest metric. The metric is the measure of the cost of the route
on that hop, the lower the metric the lower the cost. You can display
the metrics for each network interface by typing "route print" in the
cmd console.
The card with the lowest metric is the preferred route for traffic
that is not destined for addresses on the particular LAN subnets for
all the cards in the system.
Wouldn't it depend on how the route to 74.125.67.100 was defined? I
could define it either way, or not define at all. There is also no
requirement that there be a default route. If there is no host, network
to the destination and default route isn't the traffic just dropped
without being sent?
Geoff
2009-11-06 16:54:19 UTC
Permalink
Post by Noah Davids
Post by Geoff
However, traffic destined for any other hosts, such as 74.125.67.100
(google.com) will go out on C2 or C3 depending on which of them has
the lowest metric. The metric is the measure of the cost of the route
on that hop, the lower the metric the lower the cost. You can display
the metrics for each network interface by typing "route print" in the
cmd console.
The card with the lowest metric is the preferred route for traffic
that is not destined for addresses on the particular LAN subnets for
all the cards in the system.
Wouldn't it depend on how the route to 74.125.67.100 was defined?
By default, Windows doesn't assign routes to specific IPs. I am
assuming Stéphane has not set any routes other than defaults. One
would have to add routes with the /p switch to get Windows to retain
specific routes. If manually adding routes, leaving out the metric
would make it default to automatic.
Post by Noah Davids
I could define it either way, or not define at all. There is also no
requirement that there be a default route.
Most NICs are bound to TCP/IP with default gateways. Certainly,
inspection of route print output would show the necessary information
about both interfaces to confirm this.
Post by Noah Davids
If there is no host, network
to the destination and default route isn't the traffic just dropped
without being sent?
Probably, either with WSAENETUNREACH or WSAEHOSTUNREACH. If it was
specified by name DNS or WINS would attempt resolution, if IP only,
then the stack would attempt to connect via the least cost route.

If there are no routes, then attempts to connect to _any_ host would
fail and this symptom was not described in the original post.

Multi-homing definitely requires careful consideration of routes and
metrics. Manual configuration is an option, as is RIP but these seemed
out of scope for this discussion.
unknown
2009-11-09 13:38:10 UTC
Permalink
Hi all,

By the way, the two networks don't have access to other networks or even
Internet.

But it was usefull to know more !

Thanks again both of you.
Stéphane
Post by Geoff
Post by Noah Davids
Post by Geoff
However, traffic destined for any other hosts, such as 74.125.67.100
(google.com) will go out on C2 or C3 depending on which of them has
the lowest metric. The metric is the measure of the cost of the route
on that hop, the lower the metric the lower the cost. You can display
the metrics for each network interface by typing "route print" in the
cmd console.
The card with the lowest metric is the preferred route for traffic
that is not destined for addresses on the particular LAN subnets for
all the cards in the system.
Wouldn't it depend on how the route to 74.125.67.100 was defined?
By default, Windows doesn't assign routes to specific IPs. I am
assuming Stéphane has not set any routes other than defaults. One
would have to add routes with the /p switch to get Windows to retain
specific routes. If manually adding routes, leaving out the metric
would make it default to automatic.
Post by Noah Davids
I could define it either way, or not define at all. There is also no
requirement that there be a default route.
Most NICs are bound to TCP/IP with default gateways. Certainly,
inspection of route print output would show the necessary information
about both interfaces to confirm this.
Post by Noah Davids
If there is no host, network
to the destination and default route isn't the traffic just dropped
without being sent?
Probably, either with WSAENETUNREACH or WSAEHOSTUNREACH. If it was
specified by name DNS or WINS would attempt resolution, if IP only,
then the stack would attempt to connect via the least cost route.
If there are no routes, then attempts to connect to _any_ host would
fail and this symptom was not described in the original post.
Multi-homing definitely requires careful consideration of routes and
metrics. Manual configuration is an option, as is RIP but these seemed
out of scope for this discussion.
Loading...