Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Tuesday, April 15, 2008

Q & A on TCP Segment Lengths.

Q: I have a couple of quick questions regarding the TCP protocol.

1. When I checked the TCP segment format, as shown in fig 22.6 of your Computer Networks and Internets book, I did not find any field in the header to indicate the segment length. And the question is: - How does the IP protocol in the same host know the length of the segment?

A: The length is not stored in the header. However, when TCP manufactures a segment, it passes the length (and other information) to IP along with the segment.

Q: - Also, how does the TCP protocol in the other side know the length of the segment?

A: When IP receives a datagram carrying TCP, IP computes the length of the segment (from the IP header length and total datagram length), and then passes the length to TCP along with the segment.

Q: 2. As far as I know, a TCP segment will be sent to IP to transfer it to the other side. The TCP header only has DESTINATION PORT in its header, which is just 16 bits. From where the IP protocol will know the IP address of the destination/source?

A: The IP destination address is among the additional information that TCP must pass to IP along with an outgoing segment.

Q: As far as I know, the application layer knows about the ``connection'' and its two endpoints. However, there is no direct link between the application layer and the IP layer. That is why, I am asking my question.

A: There must be an Application Program Interface (API) that allows the application to specify details such as the IP address and protocol port number of a remote site. Once the information has been specified, protocol software has access to it.

No comments:

Archives