cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
cancel
839
Views
5
Helpful
3
Replies

What does PAT do if a dynamic port is already registered to another IP?

Viscid
Level 1
Level 1

Hi all,

What does a router do if it receives a packet attempting to access a public IP with a source port that has already been mapped to another private IP address? I was also wondering what happens in the unlikely event that a router runs out of ports to use for PAT, theoretically at least.

Thanks for your time.

1 Accepted Solution

Accepted Solutions

Peter Paluch
Cisco Employee
Cisco Employee

Hi,

What does a router do if it receives a packet attempting to access a public IP with a source port that has already been mapped to another private IP address?

If the source port is already used for another existing translation, the router will choose another free port and will rewrite both the source IP and the source port. Cisco routers split the source ports into three subsets: 0-511, 512-1023, 1024-65535, and depending on where the original source port falls into, they will try to allocate the first free port from the corresponding group.

I was also wondering what happens in the unlikely event that a router runs out of ports to use for PAT, theoretically at least.

Cisco routers will drop the packets that were intended to be subject to PAT but for which there was no free port left.

Best regards,
Peter

View solution in original post

3 Replies 3

Peter Paluch
Cisco Employee
Cisco Employee

Hi,

What does a router do if it receives a packet attempting to access a public IP with a source port that has already been mapped to another private IP address?

If the source port is already used for another existing translation, the router will choose another free port and will rewrite both the source IP and the source port. Cisco routers split the source ports into three subsets: 0-511, 512-1023, 1024-65535, and depending on where the original source port falls into, they will try to allocate the first free port from the corresponding group.

I was also wondering what happens in the unlikely event that a router runs out of ports to use for PAT, theoretically at least.

Cisco routers will drop the packets that were intended to be subject to PAT but for which there was no free port left.

Best regards,
Peter

If the source port is already used for another existing translation, the router will choose another free port and will rewrite both the source IP and the source port.

So the router stores these changes and then upon receiving a packet back with the modified source port and source IP translates them back to their original values?

Hi,

So the router stores these changes and then upon receiving a packet back with the modified source port and source IP translates them back to their original values?

Yes, that's correct - but keep in mind that upon receiving a packet back, it is the destination IP address and port that will get rewritten to the original private IP address and the original port (remember, a response coming back has the addressing information reversed).

Best regards,
Peter

Review Cisco Networking for a $25 gift card