[Winpcap-users] Sending preformed UDP Packets to Localhost

Chris Beattie cbeattie at yahoo.com
Mon Aug 27 15:34:37 PDT 2012

Hoping to get some help from the experts here.  I have a service, "Listener", that is listing on  I have another application, "Agent" that receives fully-formed UDP/IP packets via a proprietary interface.  

I would like to preserve the UDP/IP packet in its entirety (do not want to perform any NAT) and somehow get it from the Agent to the Listener.

Current setup:
Physical NIC with address /
Microsoft Loopback Adapter with address /
IP Forwarding enabled via Registry Edit (Windows XP / 7)

The IP packet that the Agent has received is addressed to (Virtual NIC).  

What I can get to work:
Using WinPcap and WinPcap::SendPacket, I can attach to the Physical NIC and send the packet to that NIC.  The packet is then forwarded to the Virtual NIC (I assume) and received by the Listener.  

Problem: My target system does not have a Physical NIC

I tried installing a 2nd Microsoft Loopback Adapter, mimicking the addresses of the Physical NIC, attaching WinPcap to the 2nd Loopback Adapter, and sending the packet to it, just like I did with the Physical NIC, and... nothing.  I've also tried experimenting with sending it to a Raw Socket, with no results (not sure if I'm doing something wrong, have never used raw sockets before).

So, I'm hoping someone can point me in the right direction.  End goal is to get the pre-formed packet from the Agent to the Listener, and I really don't care what the mechanism is (WinPcap, Raw Sockets, something simple I'm too ignorant to know about, anything else), so long as the Listener receives the packet and the IP/UDP headers and Data payload are unmolested.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winpcap.org/pipermail/winpcap-users/attachments/20120827/62829125/attachment.html>

More information about the Winpcap-users mailing list