as far as I can understand your question....
since in TCP we don't have any field saying total length of the segment. And we know that TCP segment is encapsulated in Ip datagram so we use IP information(total length-header length) to find the length of TCP segment.