Receiving from UDP socket with static IP address in C# .Net 3.5


  • I am supporting a device which is a transparent ethernet bridge.  It has no IP address nor any capability to reply to ARP "whois" packets, PING or other ICMP protocols.  In an attempt to gain more functionality from this device, I have implemented the interception of traffic on a particular socket and generate responses on the same socket pair.  This is as a lower cost alternative to implementing the full functionality of an IP node.  The C# GUI application, on initialisation, supplies an IP address for the bridge to use. It then opens a socket (1564).  Initially this didn't work because the PC sends an ARP "whois" and waits forever for a reply.  I tried using ARP.EXE to set up a static IPaddress, mapping the IP address to a MAC address known to the device.  This allowed the PC to open the socket and successfully send packets to the device for interception.  This is working well. 

    As indicated earlier, it is also required that the device responds, using the same IP address and MAC address pairs as in the outgoing packets, but with sources and destinations reversed.   These packets are captured using Wireshark, on the PC's ethernet segment, and appear to be correct.  However, the PC does not see any of this traffic.  The asych receive routine never receives any data.   The simple conclusion is, "I'm not doing it correctly", but  I have built an emulator to respond to the packets in the same way as the bridge device does.  Thiis emulator works perfectly in conjucntion with the C# GUI, so the only difference in ethernet traffic between working and non-workng systems appears to be the static IP address.  This is not required for the emulator (which is another PC), since it will generate its own genuine IP address and MAC address.  The emulator proves the socket is capable of receiving returned data.  So my queston is, "Is it possible to have 2 way UDP packet exchanges using a static IP address to identify the remote system.  I could include listings and Wireshark captures if required.

    Monday, March 04, 2013 3:47 PM