🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Routed IP:port

Started by
0 comments, last by frob 8 years, 3 months ago

I wonder if I connect to some public point twice, over TCP/IP, what will this public point see for those two connections of mine, considering I am behind my router that is public point of mine:

will it see

- PUBLICIPOFMYROUTER:portA and PUBLICIPOFMYROUTER:portA

or

- PUBLICIPOFMYROUTER:portA and PUBLICIPOFMYROUTER:portB

The question is wheather the port will be the same or different for server observed endpoint of my two conections.

[EDIT] I forgot to mention both connections come out from the same local IP that routes to the router.

Advertisement
It will see two different ports.

Every connection has a unique 4-tuple of { Source IP, Source Port, Dest IP, Dest Port}

If it is a different connection, the values must be different. Since the destination IP and destination port are fixed, and your box's ip is fixed, the only variable that changes is your machine's port.

By default your source port is assigned by the system automatically to an unused port.

This topic is closed to new replies.

Advertisement