4

THE TCP Psuedo Header needs sender and destination IP Address and protocol type. All of this informations is present in the network layer/IP header. Since the transport layer cannot access the data present in the network layer, how does it construct the Pseudo-Header?

0

2 Answers 2

3

The TCP pseudo header has only information which was used to create the original connection (source and destination IP addresses), a length (which is available to the upper level) and a well-known constant, the protocol (TCP is Internet Protocol number 6.)

From RFC 793, p17.

+--------+--------+--------+--------+
|           Source Address          |
+--------+--------+--------+--------+
|         Destination Address       |
+--------+--------+--------+--------+
|  zero  |  PTCL  |    TCP Length   |
+--------+--------+--------+--------+

This means that the process of wrapping a sequence of data bytes into a segment and then into a packet uses only information which the upper layer has. Indeed, you will see that for a given connection, all except the length are constant, which means they the checksum up to this point can be computed at connection-open and stored. The computation per packet can start with the length field in the pseudo header. Some particular implementation might actually store the length in that position, if that optimises the code a little.

3
  • If you want an up to date standard, look at RFC 8200.
    – kasperd
    Nov 15, 2018 at 13:48
  • Thanks, yes the IPv6 method is essentially identical, certainly from the conceptual point of view about layers.
    – jonathanjo
    Nov 15, 2018 at 13:53
  • They are indeed very similar, in particular with the checksum algorithm used by TCP and UDP. That similarity turns out to be convenient when converting packets between IPv4 and IPv6. Biggest differences are that ICMPv6 includes the pseudoheader, which ICMP didn't, and UDP checksums are mandatory on IPv6.
    – kasperd
    Nov 15, 2018 at 14:01
3

The pseudo-header doesn't really exist - it is only temporarily created to calculate the checksum.

Within the IP stack, the network layer passes the L3 information upward to the transport layer - likewise, the transport layer passes L3 and L4 information upward to the application layer. Information isn't passed as the original packet but through data fields to/from the API functions. There is no IETF standard for these API functions but most OSes use BSD-style "sockets".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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