Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Why does a web server listening on port 80 not get confused with many packets coming from different hosts. Why does it not confuse packets coming from the same host when different browsers access the server simultaneously?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Because the packets have a source IP-address and a Source port - together these uniquely identify each connection

When your two browsers on one PC want to fetch a URL they ask the operating system (OS) to set up a connection, The OS chooses a random source-port address for each connection.

share|improve this answer
    
...known as sockets (en.wikipedia.org/wiki/Network_socket). –  user142485 Oct 1 '12 at 16:53
    
so source port and port are different things here. Like httpserver runs on port 80. but it can still receive things on different source ports. –  Muhammad Umer Mar 5 '13 at 4:26
    
@Muhammad: A port can act as either a source port (sending packets) or a destination-port (receiving them). A TCP connection has source-ports and destination-ports. A server receives requests on destination ports. Each service on the server binds to and listens on one or more pre-specified destination-ports. Each destination-port that is in use is allocated to a single specific service. When the server replies (through an established TCP connection) the port roles are reversed. –  RedGrittyBrick Mar 5 '13 at 9:41
    
THANKS A LOTTTTTTTTTTT –  Muhammad Umer Mar 5 '13 at 20:11
    
@RedGrittyBrick I think the Source port in IP packet is the port assigned by NAT Router, not the OS –  onmyway133 Mar 21 '13 at 4:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.