142k views
0 votes
A NAT router has two IP addresses: 192.128.135.1 and 170.8.224.69. To assign ports to the datagrams going toward the Internet from inside the network, the formula (x + 36629) mod 65536 is used, where x is the original port number. A TCP segment with the source IP 192.128.135.178, destination IP 33.75.185.202, source port 54033 and destination port 18201 is received and forwarded by the router. When the acknowledgement segment arrives at the router, what will be its source IP, destination IP, source port and destination port?

User Weiqure
by
9.0k points

1 Answer

2 votes

Final answer:

The acknowledgement segment will have a source IP of 33.75.185.202, destination IP of 192.128.135.178, source port of 18201, and the original destination port, which requires reversing the NAT translation formula.

Step-by-step explanation:

The correct answer is as follows: Since NAT (Network Address Translation) is used to modify network address information in TCP/IP packets, the acknowledgment segment received by the router will have its source and destination addresses and ports translated back relative to the inside network.

The original TCP segment details before translation were a source IP of 192.128.135.178, destination IP of 33.75.185.202, source port of 54033, and destination port of 18201.

The source IP of the acknowledgment will be the destination IP of the outgoing segment, which is 33.75.185.202. The destination IP will be the internal IP that sent the original segment, which is 192.128.135.178.

The source port will be the destination port the router initially sent to, which is 18201. To find out the destination port on the inside network, we apply the reverse operation of the formula given: if y = (x + 36629) mod 65536 and y is the translated port, then the original port can be derived by reversing the operation.

Since the acknowledgment's destination is determined by the router's translation, it will replace the source port in the original segment with the port calculated after the inverse translation procedure, which means we need the inverse of our x in the original formula which is 54033.

User Aaron Greenwald
by
7.7k points