UDP - client behind NAT, server behind NAT question

Feb 25, 2006 2 Replies

Hello group,



I'm trying to set up a UDP link between a mobile client on a GPRS network, and a base server, both behind NAT.



Currently I'm getting the client-> server leg OK, and I'm replying to the translated address on the client's network, but I've just realised that I need to deal with the source of the server's reply.



So if the server is listening on, say 85.1.1.66 : 7000 , it's no good me replying from an internal private address, as this will get NATted as the packets leave the server system.



I have to make sure my return message originates with 85.1.1.66 : 7000 don't I? Currently port 7000 is being forwarded to my private address inside the server's firewall. Maybe I just need to send my reply on port 7000. Does that work in the reverse direction (can't try it til Monday)?



Sorry if this is a horribly newbie question, but I'm an applications programmer whose been chucked off the UDP cliff :-)



If this is not the likely problem, could someone just suggest how addresses etc affect the passed messages in the client NAT / NAT server scenario.


cheers, Jim



Yup, that made me think, and clearly that's what I have to do, when I reply on port 7000 say, the IP address gets rewritten to be that of the forwarder, and so will look valid to the originating NAT.

Thanks for being "cardboard programmers" guys...

Jim

UDP is connectionless.

You should implement NAT traversal yourself in your application layer protocol.

Yours, VB.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required