1

I am learning how TCP and application communicate with each other. I am not sure if my understanding is correct, I will use below example to illustrate my understanding and want to ask some questions.

When I do a request using the a browser to a website, the website url is resolved to an IP and port number (eg, 80). Then through the network, it reach the hosting machine of the website. In TCP layer, it reads the port number from the packet, and find the application bind to this port number.

Is my understanding correct?

1

In TCP layer, it reads the port number from the packet, and find the application bind to this port number.

TCP really doesn't look at the packets, and the packets do not contain port numbers. The TCP segment headers have the source and destination port numbers (TCP addresses). The IP packets have the source and destination IP addresses, but the TCP segments are the payload of the IP packets, and IP really has no idea what is in the payload.

Each network layer has source and destination addresses for that layer. Ethernet has source and destination data-link-layer addresses (other data-link protocols have other addressing), IP has source and destination network-layer addresses (other network protocols have other addressing), TCP has source and destination transport-layer addresses (other transport protocols have other addressing).

This answer goes through an example, as does this answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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