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?










share|improve this question









New contributor




Ajitesh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
























    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?










    share|improve this question









    New contributor




    Ajitesh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      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?










      share|improve this question









      New contributor




      Ajitesh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      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






      share|improve this question









      New contributor




      Ajitesh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Ajitesh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited Nov 15 at 10:52









      jonathanjo

      8,4081629




      8,4081629






      New contributor




      Ajitesh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked Nov 15 at 10:25









      Ajitesh

      112




      112




      New contributor




      Ajitesh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Ajitesh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Ajitesh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          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".






          share|improve this answer




























            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.






            share|improve this answer























            • 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











            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "496"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            noCode: true, onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });






            Ajitesh is a new contributor. Be nice, and check out our Code of Conduct.










             

            draft saved


            draft discarded


















            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

























            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".






            share|improve this answer

























              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".






              share|improve this answer























                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".






                share|improve this answer












                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".







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 15 at 10:37









                Zac67

                23.6k21251




                23.6k21251






















                    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.






                    share|improve this answer























                    • 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















                    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.






                    share|improve this answer























                    • 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













                    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.






                    share|improve this answer














                    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.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    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


















                    • 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










                    Ajitesh is a new contributor. Be nice, and check out our Code of Conduct.










                     

                    draft saved


                    draft discarded


















                    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.















                     


                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Quarter-circle Tiles

                    build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

                    Mont Emei