开发者

How do you write a UDP port forwarder?

As UDP is a connectionless protocol, once the forwarder gets a packet and sends it to a target ip, and the target ip respo开发者_StackOverflownds with data, how can the forwarder know what ip to send the packet to?


If you are talking about a standard gateway, it knows where to send it because the packet has a destination IP address and port.

If you are talking about NAT, then the router must remember what it has recently sent out and accept corresponding incoming packets. The router maintains a session internally, which will stay alive for some configured period.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜