I just knew by theory how two host communicate through a port and a protocol, and i always thought that they must be using the same port number aat both ends to communicate, but looking at the network traffic(using iftop on unix) on my computer confuses me abit. As you can see there was an https request(port 443) but on my side it uses several different unknown ports why is that ?       <=>             0b    419Kb   105Kb       <=>            0b   53.8Kb  13.5Kb       <=>           0b   41.7Kb  10.4Kb       <=>            0b   41.4Kb  10.4Kb       <=>           0b   39.0Kb  9.76Kb 
  • 1
    Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can post and accept your own answer.
    – Ron Maupin
    Commented Jan 5, 2021 at 18:04

1 Answer 1


Source ports are randomly generated from the unregistered port range.

The source/destination port works similar to your IP. The port you send from, is the port the service will reply too. For instance; a website is simply a server listening for connections on port 80 (or 443).

When you attempt to load a website you generate a free port from the unregistered range and send the request from (Source port selected) your browser then sends the request to (IP is an example) as the server is listening on this port.

Much like your IP, when the server replies to you it sets the destination IP AND port In the packets header to the source IP / Port it received the request on. This enables you to run multiple webpages at once.

If you had 4 webpages open, all sending and receiving on port 80, it would not know where the response traffic is meant to be directed. This is why the source port is used.

Here is an article which might help you understand it a bit better;


This video may be of interest as well :):


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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