Is it possible for two hosts to use the same source port ?
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is it possible for two hosts to use the same source port ?
Hi
I was reading about data communication on the net and i got a little confused. There are 65535 available port numbers and the port numbers from 1-1024 are reserved for applications and such. That leaves 64511 ports available. My question is, when a web server has a number of connections from users which are larger than the amount of ports available, how can it handle more connections ? Every host that connects to the web server needs a source port, can several hosts share the same port numbers (and then the connections would be differentiated with the TCP ACK field and sequence numbers for example) ?
A connection in the internet (a TCP connection) is always identified by two couples of numbers: (source address, source port), (destination address, destination port)
So, two different source addresses can have the same source port, as this results in two different connection identifiers.
A book about connections should absolutely explain this thing! If not, try complementing that book with some other source
If your webserver runs out of available ports to use for connections, it doesn't accept more until one becomes free. Typically this is called a Denial of Service (DoS).
Source ports are specific to the local machine. A single computer can't use the same source port for multiple applications at the same time, as the port would be already bound and reported as in-use to the OS. However, multiple computers connecting to the same destination could use the same source port.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.