0
votes

I have a UDP server running on my private network.I have a device which is beyond NAT which sends UDP packets to my server through public IP. I am able to receive the UDP packets, parse them and I can view the pay load, src and dest port. Now I need to send an ACK message to that device so I have captured the ip and port numbers and sending a UDP packet to it. But I could not able to view any UDP packets in that device.

My question is as my Device is beyond NAT the IP address and port number I am getting is NAT's or the actual device's ?

How to send the UDP packet to that device through NAT ?

1
IMHO, the question is off-topic here. It fits better in networkengineering.stackexchange.comSourav Ghosh

1 Answers

1
votes

My question is as my Device is beyond NAT the IP address and port number I am getting is NAT's or the actual device's ?

The IP and Port you identify from the packet are those which the NAT created a mapping for the client. In simple words, it is the IP and Port of the NAT to which the device is connected.

How to send the UDP packet to that device through NAT ?

You need to reply on the IP and port detected by the server from the packet it received from client. More clearly you need to implement UDP Holepunching.

I guess you should first understand the networking issues regarding connection to devices working under a NAT. Various RFCs are available for NAT Traversal and UDP Punching.

Here are some sources:

http://en.wikipedia.org/wiki/Network_address_translation

http://en.wikipedia.org/wiki/UDP_hole_punching

http://tools.ietf.org/html/rfc4787

https://tools.ietf.org/html/rfc5128