0

My understand of NAT table is

  1. NAT table maps only (Private IP:Port) -> (Public IP:Port)
  2. It doesn't care about protocol or socket connection

In this manner, I thought TCP hole punching could done by reusing local port.

  1. Host A behind NAT connect to server S, NAT of host A maps its pair

    Host A(192.0.0.1:100)            ->            NAT            ->            Server
                                 (192.0.0.1:100 -> 121.0.0.1:200) MAPPED
    
  2. Host A closes that socket and open new listening socket on same local port(100)

    Host A(listening 192.0.0.1:100)   ->            NAT            ->            Server
                                 (192.0.0.1:100 -> 121.0.0.1:200) MAPPED
    
  3. Then, I thought any client can connect to Host A (get 121.0.0.1:200 from server) by using already mapped pair (192.0.0.1:100 -> 121.0.0.1:200)
    Because NAT table only considers dest IP and port not source IP and port.

But this doens't work! I found other complex implementation, but I curious what is problem in this way.

JokyDandy
  • 59
  • 1
  • 8

1 Answers1

0

Okay if anyone reaches here, read "Methods of translation" part in https://en.wikipedia.org/wiki/Network_address_translation

JokyDandy
  • 59
  • 1
  • 8