Given a NAT where multiple PCs are sharing one IP address, how is NAT able to know where to send the incoming data to. Does it translate th SYN-ACK ids?
Given a NAT where multiple PCs are sharing one IP address, how is NAT able to know where to send the incoming data to. Does it translate th SYN-ACK ids?
When a device connects to a server on the other side of the router, it uses a source port in its ephemeral port range. This is typically a port between 49152 and 65535 and it is randomly assigned. The NAT router records this port number as well as the destination IP address in a NAT translation table. When data starts coming back in from the server, it looks up where it goes from this table.
By not being programmed with alheimer as model. Basically it has a memory - about which internal ports / ip addresses map to whiche external target port / ip, so it can do the translation. For TCP that is simple, for UDP the internal program better regularly sends packets outside (so that NAT refreshes the routing table).
No, proper NAT is not following the TCP protocol. THis is to make sure that TCP does not work.
Joke aside - NATURALLY it has to do translations when needed, otherwise it would break the implementation. NAT has to be trnasparent, so it has to make all translations necessary.