Sign in to follow this  
CoolGames

Multiple networks on one PC

Recommended Posts

CoolGames    103
Hi guys! I have one or maybe two understanding questions about Windows network programming: 1) Say I have a computer with an internet and a LAN network. When I use UDP and send to a specific IP address data, is it right that the data is sent over both networks? So, in fact that would mean if Im sending a big file for example over LAN to another PC by using UDP, the big file is also sent over the internet-provider and blocking it this way? Does the same happen with TCP when I already got a connection to a LAN PC and send data. Will it go over internet-provider too? Is there any way to choose which network to use? For UDP and TCP in this case? 2) Say I have a computer with two internet connections. Is there any difference between point 1) and point 2)? Is UDP data sent over both internet-providers then? And how to choose which one I want to send and receive data? Thanks in advance!!

Share this post


Link to post
Share on other sites
Pxtl    354
Shouldn't your LAN addresses be in the 192.168.* space? That would mean that LAN addys wouldn't have a corresponding internet address, and no worries then.

Share this post


Link to post
Share on other sites
CoolGames    103
@Pxtl
Yes they are. BUT does that mean that the internet-network driver on everyones Windows PC filters automatically EVERY 192.168.* pakets and deletes them before they are uploaded to the internet-provider??

Share this post


Link to post
Share on other sites
Telastyn    3777
[I've a sneaky suspicion there's an image here my browser's not displaying, but]

Your OS will pick the correct network to send it on. Packets should not be sent out both interfaces. [but could be sent on alternating interfaces under some circumstances (ie, packet 1,2, and 5 might go out interface #1, packets 3 and 4 might go out interface #2, but the 5 packets won't go out both interfaces)]

Running 'route print' from a win2k/XP command line will list the windows routing table.

Routing tables are very common, and [google] can give you a great more detail than I could regarding their actual implimentation.

Share this post


Link to post
Share on other sites
CoolGames    103
Ok thanks!

But my point 2) is then a bit more complicated I think.

If I have two internet connections, one modem and one DSL for example, there won't help a simple IP filtering. So in this case data is sent over both providers right? And how to get it sent then to the right one?

Thanks again!

Share this post


Link to post
Share on other sites
Ra    1062
The packets will be sent out on the default interface (determined by the metric).

Really, Google does have the answers to your questions.

Share this post


Link to post
Share on other sites
Telastyn    3777
Indeed, the routing table metric will indicate which is preferred if there are two [or more] routes. bind() should pick which IP to use should your machine have multiple IPs.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this