Since the TCP header doesn't indicate the length of the packet, how does the underlying IP layer in the transmitter know the length of a TCP packet, and in the receiver, how does the TCP layer know the length of the received packet? Does TCP exchange such information with IP as additional information?
Although TCP is a streaming protocol, the data is sent in segments whose length could be any value between 1 and the maximum segment size. IP needs to know this length information for encapsulation. Should TCP tell IP the length? In the receiver, the length information is abandoned after IP deencapsulation. Does IP pass it to TCP (length=total length-IP header length)?