1

When we enter a URL (for example https://some-url.com) in the address bar of the browser and press Enter, then (simplified version):

  • when the browser establishes a TCP connection, it sends a SYN packet with a randomly chosen source port number and a destination port of 443. The server responds with a SYN-ACK packet with a source port of 443 and the destination port being the source port used in the SYN packet. The browser then sends an ACK packet with the same source port number and a destination port of 443.

Did I get the concept (including the port numbers) correctly?

I understand that my question might sound silly but I have already spent 20+ hours trying to understand how all this works and didn't find a reliable source that fully explains it.

1
  • Removed the parts about the off-topic (above OSI layer-4) protocols.
    – Ron Maupin
    Jan 25, 2023 at 0:20

1 Answer 1

2

When an application, e.g. browser, requests a TCP connection, it may specify a source port, but more commonly requests the OS to assign an ephemeral port.

The destination port will be for the service the application requests. For HTTP is will by default be port 80, although that could be specifically requested to be a different port, as long as the other end is listening on the port. For HTTPS, the default port is 443, but, again, it could be any that the destination is listening on.


We can answer questions about protocol theory up to OSI layer 4 (transport layer), but host/server OSes, applications, and application-layer protocols are off-topic here.

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.