NAT and keepaliveopen connection over TCP
- From: "semedao" <semedao@xxxxxxxxxxxxxxxx>
- Date: Tue, 14 Nov 2006 21:42:59 +0200
Hi,
I have a TCP server that listening to tcp clients, this server can accept incoming tcp requests.
Some of the clients are behind NAT.
The client makes connection, and then I set keepalive on both sides (server & client)
in some Nat's it's work fine , and in others the client suddenly after work correctly send the packets with other port (external - Nat port) to the server , even if I use the same already opened socket !
For ex.
Client A (192.168.1.1) is behind NAT B (60.78.95.144) make connection to Server S (87.170.65.132) on that listening on port 1000.
The NAT will change the port number from 1000 to 2000
The connection established.
Then
When the connection is still established the client try to send let say 30 bytes to the server
In the server we have connection to 60.78.95.144:2000 and we try to read from it.
But the packet from the NAT will come from 60.78.95.144:3000
What cause it?
There is some specific Nat that make it?
How can I identify that Nat will act like this (in the program c#)
How to correct it?
Maybe I should avoid the keepalive and use my "keep alive" by sending packets to the server every X interval? (And if yes, how to know what is the interval)
Or maybe the server should send to the client?
Thanks
- Follow-Ups:
- Re: NAT and keepaliveopen connection over TCP
- From: Alexander Nickolov
- Re: NAT and keepaliveopen connection over TCP
- Prev by Date: Re: recv how to
- Next by Date: Re: Hardware Firewall with Dynamic port
- Previous by thread: Cannot recieve UDP packets that are broadcast on inter - network.
- Next by thread: Re: NAT and keepaliveopen connection over TCP
- Index(es):
Relevant Pages
|