What is the need for content-length when we already know the length of payload using transport primitives?
A. A tranport primitive like ‘recv’ is a system call implemented by operating system and is transparent to the application layer. A typical OS (like linux) can have the ‘recv’ return all the pending buffer in the network queue. This will result, for e.g., in two SIP messages being received simultaneosly in a single call to recv. Thus, we have content-length, so we can appropriately mark the sentinels of a SIP message. In another case we can have the same message split up into two different recv calls in which case, reassembly is needed.