Question about TCP/IP

5 views
Skip to first unread message

St�phane

unread,
Nov 5, 2009, 5:26:22 AM11/5/09
to
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

unread,
Nov 5, 2009, 8:17:39 AM11/5/09
to
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

unread,
Nov 5, 2009, 1:13:13 PM11/5/09
to

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

unread,
Nov 5, 2009, 2:45:28 PM11/5/09
to
On Thu, 05 Nov 2009 10:13:13 -0800, Geoff <ge...@invalid.invalid>
wrote:

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.

St�phane

unread,
Nov 5, 2009, 4:05:42 PM11/5/09
to
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


"Geoff" <ge...@invalid.invalid> a �crit dans le message de news:
gma6f5dhkelhfu7qi...@4ax.com...

Noah Davids

unread,
Nov 6, 2009, 8:18:33 AM11/6/09
to
Geoff wrote:
>
> 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

unread,
Nov 6, 2009, 11:54:19 AM11/6/09
to
On Fri, 06 Nov 2009 06:18:33 -0700, Noah Davids <nd...@cox.net> wrote:

>Geoff wrote:
>>
>> 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.



>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.

>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.

St�phane

unread,
Nov 9, 2009, 8:38:10 AM11/9/09
to
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


"Geoff" <ge...@invalid.invalid> a �crit dans le message de news:

5cj8f55688c6raoro...@4ax.com...

Reply all
Reply to author
Forward
0 new messages