C# – Forward UDP packets to several IPs maintaining the original source address

cpcap.netPROXYudpwinpcap

I have a working system that receives data via UDP packets sent to a fixed IP:Port and I want to use a program (some kind of proxy?) to send a copy of those packets to a new IP:Port (or a list of IP:Ports, but all inside the same LAN as the program).

Not as easy as it seems, because I need the copied packets to have the same Source IP address as the original ones.

In my research, I have found PCap.Net (WinPCap .NET wrapper) to be useful, because it can build a Packet from scratch and it supports modifying all the address fields. I have managed to capture the packets and build them. But somewhat they are not arriving at the desired destination (!?). Should I use a different PacketCommunicator to receive and send them?

Anyway, the question is not fully related to PCap.Net but to know alternative ways to achieve my desired goal. Via a free application? commercial application? Open source sample? Any other library to use?

My systems are Windows based (no Linux available here). And I have C# (.NET) experience (I can not use a C++ library, if NET bindings are not available).

Many thanks for your help

Best Answer

I know it's an old question, but this is the answer:

http://code.google.com/p/samplicator/

Listens for UDP and forwards it to one or more other IP addresses, optionally spoofing (the original) source IP address.

Used for forwarding netflow/sflow/syslog etc. packets.

Related Topic