How does the Transport Layer construct the Pseudo-Header for TCP checksum?
up vote
2
down vote
favorite
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?
tcp protocol-theory layer3 transport-protocol checksum
New contributor
add a comment |
up vote
2
down vote
favorite
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?
tcp protocol-theory layer3 transport-protocol checksum
New contributor
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
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?
tcp protocol-theory layer3 transport-protocol checksum
New contributor
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?
tcp protocol-theory layer3 transport-protocol checksum
tcp protocol-theory layer3 transport-protocol checksum
New contributor
New contributor
edited Nov 15 at 10:52
jonathanjo
8,4081629
8,4081629
New contributor
asked Nov 15 at 10:25
Ajitesh
112
112
New contributor
New contributor
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
2
down vote
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".
add a comment |
up vote
2
down vote
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 pseudo header's length. Some given implementation might actually store the length in that position, if that optimises the code a little.
If you want an up to date standard, look at RFC 8200.
– kasperd
Nov 15 at 13:48
Thanks, yes the IPv6 method is essentially identical, certainly from the conceptual point of view about layers.
– jonathanjo
Nov 15 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 at 14:01
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
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".
add a comment |
up vote
2
down vote
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".
add a comment |
up vote
2
down vote
up vote
2
down vote
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".
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".
answered Nov 15 at 10:37
Zac67
23.6k21251
23.6k21251
add a comment |
add a comment |
up vote
2
down vote
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 pseudo header's length. Some given implementation might actually store the length in that position, if that optimises the code a little.
If you want an up to date standard, look at RFC 8200.
– kasperd
Nov 15 at 13:48
Thanks, yes the IPv6 method is essentially identical, certainly from the conceptual point of view about layers.
– jonathanjo
Nov 15 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 at 14:01
add a comment |
up vote
2
down vote
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 pseudo header's length. Some given implementation might actually store the length in that position, if that optimises the code a little.
If you want an up to date standard, look at RFC 8200.
– kasperd
Nov 15 at 13:48
Thanks, yes the IPv6 method is essentially identical, certainly from the conceptual point of view about layers.
– jonathanjo
Nov 15 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 at 14:01
add a comment |
up vote
2
down vote
up vote
2
down vote
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 pseudo header's length. Some given implementation might actually store the length in that position, if that optimises the code a little.
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 pseudo header's length. Some given implementation might actually store the length in that position, if that optimises the code a little.
edited Nov 15 at 10:45
answered Nov 15 at 10:34
jonathanjo
8,4081629
8,4081629
If you want an up to date standard, look at RFC 8200.
– kasperd
Nov 15 at 13:48
Thanks, yes the IPv6 method is essentially identical, certainly from the conceptual point of view about layers.
– jonathanjo
Nov 15 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 at 14:01
add a comment |
If you want an up to date standard, look at RFC 8200.
– kasperd
Nov 15 at 13:48
Thanks, yes the IPv6 method is essentially identical, certainly from the conceptual point of view about layers.
– jonathanjo
Nov 15 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 at 14:01
If you want an up to date standard, look at RFC 8200.
– kasperd
Nov 15 at 13:48
If you want an up to date standard, look at RFC 8200.
– kasperd
Nov 15 at 13:48
Thanks, yes the IPv6 method is essentially identical, certainly from the conceptual point of view about layers.
– jonathanjo
Nov 15 at 13:53
Thanks, yes the IPv6 method is essentially identical, certainly from the conceptual point of view about layers.
– jonathanjo
Nov 15 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 at 14:01
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 at 14:01
add a comment |
Ajitesh is a new contributor. Be nice, and check out our Code of Conduct.
Ajitesh is a new contributor. Be nice, and check out our Code of Conduct.
Ajitesh is a new contributor. Be nice, and check out our Code of Conduct.
Ajitesh is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fnetworkengineering.stackexchange.com%2fquestions%2f54727%2fhow-does-the-transport-layer-construct-the-pseudo-header-for-tcp-checksum%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown