IP routing within one (Win32) PC

By RobMeades ·
I have a bunch of (protocol) SW sitting behind a virtual Ethernet adapter on a PC which I want to thrash-test with traffic. The SW is setup to echo whatever traffic it receives (that is directly copy the same packet back out of the virtual Ethernet adapter without modification, not a Ping-type echo) and I want to test it on a single PC. I have a UDP client pushing packets into the virtual Ethernet adapter (which is on fixed IP address, subnet by sending them to, port 5000.

I have a UDP server listening on port 5000 but no packets ever arrive there, presumably because when they emerge from the virtual Ethernet adapter Windows doesn't know how to route them.

Is there a way to get the client/server arrangement to work on a single PC with this echo device between them? Or is there a better way to do the testing I desire?


This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

That's a good explanation of TCP/UDP ports and sockets

by RobMeades In reply to TCP/UDP Ports Explained

That's a good explanation of TCP/UDP ports and sockets. I suppose it clarifies that what I'm trying to do won't work - a UDP packet sent to will be routed into my virtual Ethernet adapter as I want it to but, when echoed out from the virtual Ethernet adapter, will reappear in Windows and go nowhere 'cos Windows has no idea what to do with it.

Is it possible to send a packet directly into an Ethernet adapter from within Windows and grab the output directly? Or am I barking up the wrong tree entirely here...


Collapse -

how are your virtual ethernet adapters addressed?

by CG IT In reply to That's a good explanation ...

subnets of the physical address? or simply another address on the same subnet?

Collapse -

Addressing of virtual Ethernet adapters

by RobMeades In reply to how are your virtual ethe ...

All my Ethernet adapters are on different subnets. I have three, the virtual one I want to test on 192.168.48.x, one at 192.168.30.x for public internet, and another at 10.130.100.x for LAN.

All I really want to do is poke packets into a virtual Ethernet adapter and catch the same packet reflected back out but the Windows IP stack is between me and the virtual Ethernet adapter. Need to fool it somehow, or get it out of the way.


Collapse -

This gives you a run down on "UDP Features" in Windows..

by Peconet Tietokoneet In reply to Addressing of virtual Eth ...

The User Datagram Protocol (UDP) provides a connectionless, unreliable transport service. Connectionless means that a communication session between hosts is not established before exchanging data. UDP is often used for communications that use broadcast or multicast Internet Protocol (IP) packets. The UDP connectionless packet delivery service is unreliable because it does not guarantee data packet delivery or send a notification if a packet is not delivered. However, if a packet is delivered, a checksum is computed over the received data and matched against the checksum transmitted in the packet. If these checksums do not match, the received UDP packet is not handed up the stack to the next protocol layer on the receiving side.

Because delivery of UDP packets is not guaranteed, applications that use this protocol must supply their own mechanisms for reliability if necessary. Although UDP appears to have some limitations, it is useful in certain situations. Microsoft networking components use UDP for logon, browsing, and name resolution. Unlike Transmission Control Protocol (TCP), UDP also can be used to carry IP multicast and broadcast streams. UDP is efficient because of its low overhead.
UDP and Name Resolution

UDP is used for NetBIOS name resolution by unicast to a NetBIOS name server or broadcast to subnets. UDP is also used for resolving Domain Name System (DNS) host names to IP addresses.

NetBIOS name resolution is accomplished over UDP port 137. DNS queries use UDP port 53.

Because UDP itself does not guarantee delivery of packets, both NetBIOS and DNS use their own retransmission schemes if they receive no answer to queries. Broadcast UDP packets are usually not forwarded over IP routers, so NetBIOS name resolution in a routed environment requires a name server of some type or the use of static database files.
Mail Slot Messaging over UDP

Many NetBIOS applications use mail slot messaging. A second-class mail slot is a simple mechanism for sending a message from one NetBIOS name to another over UDP. Mail slot messages can be broadcast on a subnet or directed to the remote host. To direct a mail slot message to another host, some method of NetBIOS name resolution must be available. Microsoft provides the Windows Internet Name Service (WINS) for this purpose.

Collapse -

you have to route between subnets

by CG IT In reply to Addressing of virtual Eth ...

So you need a layer 3 device [router]to route between the subnets.

can't really "fool" the windows box that packets it send out on one subnet should come back in on a different subnet.

Collapse -

Yup, I think I need an NDIS driver

by RobMeades In reply to you have to route between ...

Thanks - you have confirmed the conclusion I came to over the weekend, that I need to write a littul NDIS driver of which Microsoft has a sample here:

Looks like fun... :-)


Related Discussions

Related Forums