From: Joseph M. Newcomer on 23 Oct 2009 07:00 Also note that the illlusion that UDP doesn't drop packets is just that; even on a private subnet, the network stack itself is free to drop packets, and will, under heavy load conditions. I've seen it happen. joe On Thu, 22 Oct 2009 11:41:20 -0500, TomChapman <TomChapman12(a)gmail.com> wrote: >Stephen Myers > wrote: >> TomChapman wrote: >>> By a closed network I mean: The customer has several computers that >>> talk to each other through a single router. There are no router >>> connections except for this small cluster of computers. It is closed >>> to the outside world. There is no connection, for instance, to the >>> companies normal office network. This is done for security reasons. >>> And also for control. The company that developed this system is in >>> total control of what is being sent on the interconnecting network. >>> There is no outside influence. >>> >>> My client has three of these clusters. >>> >>> To gain access to the data I will plug into each router. You may say I >>> am breaking their "closed network security", but that is what they >>> want me to do. >>> >>> I have ZERO control over the fact that the data is being provided >>> using UDP. That has already been determined. One of the servers in >>> each of the networks sends out these UDP packets that several of the >>> other computers in the cluster utilize. My program will simply be a >>> new receiver of the same data that is already being sent. What is also >>> different is that my computer will connect to all three clusters and >>> receive data from all three. >>> >>> >>> The customer tells me... When UDP is used in a small closed network >>> where there is only one router and only one route between computers >>> and when all of the computers are within a few feet of each other >>> using reliable cabling, that UDP serves their purpose perfectly. >>> >>> They assure me that I will receive every message. They will be in >>> proper order. And nothing will be duplicated. >>> >>> >>> >>> Joseph M. Newcomer wrote: >>>> On Thu, 22 Oct 2009 09:41:37 -0500, TomChapman >>>> <TomChapman12(a)gmail.com> wrote: >>>> >>>>> I am using Visual C++ version 6. >>>>> >>>>> My next project is to write an application that receives data from >>>>> three UDP data streams. Each data stream will originate from a >>>>> different computer. Each of the three computers will be in its own >>>>> closed network. >>>> **** >>>> What is a "closed network"? **** >>>>> In addition, my program also needs to act as a TCP server on the >>>>> regular (open) network at the customer site. (I will also write a >>>>> small TCP client application that will connect to my TCP server >>>>> program.) >>>>> >>>>> I have worked with TCP many times, but never UDP. I have never >>>>> worked with closed networks. I have questions. Please help me. >>>> **** >>>> UDP is generally considered a Really Bad Idea Most Of The Time. It >>>> has severe >>>> limitations, including the fact that messages may be dropped >>>> arbitrarily, truncated >>>> silently, you can receive two copies of the same message, and >>>> messages can be received in >>>> a different order than the order in which they were sent. >>>> >>>> I fail to see why "open" or "closed" (whatever they might mean!) have >>>> any relevance. >>>> Either you get the message or you don't, and how it gets there is not >>>> your problem. >>>> **** >>>>> >>>>> I assume the computer for my application will need 4 network >>>>> connections. One to each closed network and one to the regular network. >>>>> Question: Is this correct? If my 4 network card plan is not correct. >>>>> Please tell me how to implement this situation. >>>> **** >>>> If a "closed" network means that it has to have a separate path to >>>> your computer, then >>>> yes, you need a connection. This is part of the network topology >>>> problem, not one of >>>> programming. All networks need a path to your computer; how they get >>>> it is not a >>>> programming issue. >>>> **** >>>>> >>>>> Several years ago I wrote my networking classes which are based on >>>>> MFC CAsyncSocket. When I open a socket to receive one UDP socket >>>>> stream do I somehow have to stipulate which network to use? Or does >>>>> this magically work? >>>> **** >>>> Try it. Note that UDP is *not* a "stream" protocol, but a *message* >>>> protocol, and the >>>> concept of streams does not exist. A message is sent. I might get >>>> there, it might not, >>>> you will never know. You will not know if someone has sent you a >>>> message if it does not >>>> arrive. The message may be truncated to a maximum of 536 bytes >>>> (including headers). **** >>>>> When I open my TCP server socket, how do I stipulate which network >>>>> is to be used? >>>> **** >>>> As far as I know, this is all magic handled in the network stacks. >>>> Note that if the >>>> "closed" networks have disjoint IP address ranges, you might be able >>>> to specify a >>>> restricted range of IP addresses to use. **** >>>>> I have looked at CAsyncSocket and I see nothing about network >>>>> connection selection. How will this work? >>>> **** >>>> The network stacks are supposed to sort this mess out. WinSock does >>>> not support any >>>> concept of knowing what "adapter" is being used. >>>> joe >>>> **** >>>> Joseph M. Newcomer [MVP] >>>> email: newcomer(a)flounder.com >>>> Web: http://www.flounder.com >>>> MVP Tips: http://www.flounder.com/mvp_tips.htm >> >> I'd be worried that the routers are not configured to be on separate >> subnets. If that's the case you've got major headaches trying to talk >> to the networks from a single machine. The TCP/IP stack won't have >> anyway of determining the NIC to use for a particular message or >> connection. >> >> Steve > >Steve, >I also thought about this issue. I will find the answer out from my >customer. I hope that each cluster is not using some standard IP scheme >where each cluster's IPs are identical. > >Thank you, Joseph M. Newcomer [MVP] email: newcomer(a)flounder.com Web: http://www.flounder.com MVP Tips: http://www.flounder.com/mvp_tips.htm |