Which first 8 bytes of the IP datagram are included in ICMP message?











up vote
1
down vote

favorite












The definition of ICMP message says that it has a type, a code and the first 8 bytes of IP datagram causing error.



Question: Which first 8 bytes of IP datagram are included in the ICMP datagram?



My understanding: The portion marked by the red box in the figure below.



enter image description here










share|improve this question


























    up vote
    1
    down vote

    favorite












    The definition of ICMP message says that it has a type, a code and the first 8 bytes of IP datagram causing error.



    Question: Which first 8 bytes of IP datagram are included in the ICMP datagram?



    My understanding: The portion marked by the red box in the figure below.



    enter image description here










    share|improve this question
























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      The definition of ICMP message says that it has a type, a code and the first 8 bytes of IP datagram causing error.



      Question: Which first 8 bytes of IP datagram are included in the ICMP datagram?



      My understanding: The portion marked by the red box in the figure below.



      enter image description here










      share|improve this question













      The definition of ICMP message says that it has a type, a code and the first 8 bytes of IP datagram causing error.



      Question: Which first 8 bytes of IP datagram are included in the ICMP datagram?



      My understanding: The portion marked by the red box in the figure below.



      enter image description here







      icmp






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 days ago









      Banghua Zhao

      20210




      20210






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          Well, the sender might like to know which ones of its packets the ICMP message refers to. For that, the entire IP header plus (at least) the first eight bytes of the IP payload are appended to the ICMP header for error messages.






          share|improve this answer






























            up vote
            0
            down vote













            I am not sure what definition you are referring to (source?), but it probably meant a 8 bit.



            An ICMP packet is 8 bytes total[1], the first 16 bits are type and code bytes(eight bits in a byte); the type byte is given a number from 0 to 255[2], a different number representing a different type of sub-code.



            As Zac67 stated the sender usually likes to know where the ICMP packet comes from, so it encapsulates it in an IP header, that IP header contains a field called 'protocol' when an ICMP packet is carried in the payload the protocol field is set[3] to 1 (0x01 in hex or 00000001 in binary), the protocol field is also bits (1 byte) long.



            Below is some useful resources and sources.
            Hope this helps.



            https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol



            http://slideplayer.com/slide/3602717/



            http://www.enterprisenetworkingplanet.com/netsp/article.php/3584166/Networking-101-Understanding-and-Using-ICMP.htm



            http://www.pearsonitcertification.com/articles/article.aspx?p=1804873



            [1] - http://www.keyboardbanger.com/wp-content/uploads/2015/07/ICMP-header.png



            [2] - https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol#Control_messages



            [3] - https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers






            share|improve this answer








            New contributor




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














            • 2




              The real definition of ICMP is RFC 792, Internet Control Message Protocol. An ICMP message can certainly be longer than eight total bytes. In fact, it will include the IP header (20 bytes for IPv4) and the first 64 bits (eight bytes) of the IP payload: "The internet header plus the first 64 bits of the original datagram's data." That is enough to include the source and destination addresses of protocols like TCP or UDP.
              – Ron Maupin
              yesterday











            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
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fnetworkengineering.stackexchange.com%2fquestions%2f55303%2fwhich-first-8-bytes-of-the-ip-datagram-are-included-in-icmp-message%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



            accepted










            Well, the sender might like to know which ones of its packets the ICMP message refers to. For that, the entire IP header plus (at least) the first eight bytes of the IP payload are appended to the ICMP header for error messages.






            share|improve this answer



























              up vote
              2
              down vote



              accepted










              Well, the sender might like to know which ones of its packets the ICMP message refers to. For that, the entire IP header plus (at least) the first eight bytes of the IP payload are appended to the ICMP header for error messages.






              share|improve this answer

























                up vote
                2
                down vote



                accepted







                up vote
                2
                down vote



                accepted






                Well, the sender might like to know which ones of its packets the ICMP message refers to. For that, the entire IP header plus (at least) the first eight bytes of the IP payload are appended to the ICMP header for error messages.






                share|improve this answer














                Well, the sender might like to know which ones of its packets the ICMP message refers to. For that, the entire IP header plus (at least) the first eight bytes of the IP payload are appended to the ICMP header for error messages.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited yesterday

























                answered 2 days ago









                Zac67

                24.7k21252




                24.7k21252






















                    up vote
                    0
                    down vote













                    I am not sure what definition you are referring to (source?), but it probably meant a 8 bit.



                    An ICMP packet is 8 bytes total[1], the first 16 bits are type and code bytes(eight bits in a byte); the type byte is given a number from 0 to 255[2], a different number representing a different type of sub-code.



                    As Zac67 stated the sender usually likes to know where the ICMP packet comes from, so it encapsulates it in an IP header, that IP header contains a field called 'protocol' when an ICMP packet is carried in the payload the protocol field is set[3] to 1 (0x01 in hex or 00000001 in binary), the protocol field is also bits (1 byte) long.



                    Below is some useful resources and sources.
                    Hope this helps.



                    https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol



                    http://slideplayer.com/slide/3602717/



                    http://www.enterprisenetworkingplanet.com/netsp/article.php/3584166/Networking-101-Understanding-and-Using-ICMP.htm



                    http://www.pearsonitcertification.com/articles/article.aspx?p=1804873



                    [1] - http://www.keyboardbanger.com/wp-content/uploads/2015/07/ICMP-header.png



                    [2] - https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol#Control_messages



                    [3] - https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers






                    share|improve this answer








                    New contributor




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














                    • 2




                      The real definition of ICMP is RFC 792, Internet Control Message Protocol. An ICMP message can certainly be longer than eight total bytes. In fact, it will include the IP header (20 bytes for IPv4) and the first 64 bits (eight bytes) of the IP payload: "The internet header plus the first 64 bits of the original datagram's data." That is enough to include the source and destination addresses of protocols like TCP or UDP.
                      – Ron Maupin
                      yesterday















                    up vote
                    0
                    down vote













                    I am not sure what definition you are referring to (source?), but it probably meant a 8 bit.



                    An ICMP packet is 8 bytes total[1], the first 16 bits are type and code bytes(eight bits in a byte); the type byte is given a number from 0 to 255[2], a different number representing a different type of sub-code.



                    As Zac67 stated the sender usually likes to know where the ICMP packet comes from, so it encapsulates it in an IP header, that IP header contains a field called 'protocol' when an ICMP packet is carried in the payload the protocol field is set[3] to 1 (0x01 in hex or 00000001 in binary), the protocol field is also bits (1 byte) long.



                    Below is some useful resources and sources.
                    Hope this helps.



                    https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol



                    http://slideplayer.com/slide/3602717/



                    http://www.enterprisenetworkingplanet.com/netsp/article.php/3584166/Networking-101-Understanding-and-Using-ICMP.htm



                    http://www.pearsonitcertification.com/articles/article.aspx?p=1804873



                    [1] - http://www.keyboardbanger.com/wp-content/uploads/2015/07/ICMP-header.png



                    [2] - https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol#Control_messages



                    [3] - https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers






                    share|improve this answer








                    New contributor




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














                    • 2




                      The real definition of ICMP is RFC 792, Internet Control Message Protocol. An ICMP message can certainly be longer than eight total bytes. In fact, it will include the IP header (20 bytes for IPv4) and the first 64 bits (eight bytes) of the IP payload: "The internet header plus the first 64 bits of the original datagram's data." That is enough to include the source and destination addresses of protocols like TCP or UDP.
                      – Ron Maupin
                      yesterday













                    up vote
                    0
                    down vote










                    up vote
                    0
                    down vote









                    I am not sure what definition you are referring to (source?), but it probably meant a 8 bit.



                    An ICMP packet is 8 bytes total[1], the first 16 bits are type and code bytes(eight bits in a byte); the type byte is given a number from 0 to 255[2], a different number representing a different type of sub-code.



                    As Zac67 stated the sender usually likes to know where the ICMP packet comes from, so it encapsulates it in an IP header, that IP header contains a field called 'protocol' when an ICMP packet is carried in the payload the protocol field is set[3] to 1 (0x01 in hex or 00000001 in binary), the protocol field is also bits (1 byte) long.



                    Below is some useful resources and sources.
                    Hope this helps.



                    https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol



                    http://slideplayer.com/slide/3602717/



                    http://www.enterprisenetworkingplanet.com/netsp/article.php/3584166/Networking-101-Understanding-and-Using-ICMP.htm



                    http://www.pearsonitcertification.com/articles/article.aspx?p=1804873



                    [1] - http://www.keyboardbanger.com/wp-content/uploads/2015/07/ICMP-header.png



                    [2] - https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol#Control_messages



                    [3] - https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers






                    share|improve this answer








                    New contributor




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









                    I am not sure what definition you are referring to (source?), but it probably meant a 8 bit.



                    An ICMP packet is 8 bytes total[1], the first 16 bits are type and code bytes(eight bits in a byte); the type byte is given a number from 0 to 255[2], a different number representing a different type of sub-code.



                    As Zac67 stated the sender usually likes to know where the ICMP packet comes from, so it encapsulates it in an IP header, that IP header contains a field called 'protocol' when an ICMP packet is carried in the payload the protocol field is set[3] to 1 (0x01 in hex or 00000001 in binary), the protocol field is also bits (1 byte) long.



                    Below is some useful resources and sources.
                    Hope this helps.



                    https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol



                    http://slideplayer.com/slide/3602717/



                    http://www.enterprisenetworkingplanet.com/netsp/article.php/3584166/Networking-101-Understanding-and-Using-ICMP.htm



                    http://www.pearsonitcertification.com/articles/article.aspx?p=1804873



                    [1] - http://www.keyboardbanger.com/wp-content/uploads/2015/07/ICMP-header.png



                    [2] - https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol#Control_messages



                    [3] - https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers







                    share|improve this answer








                    New contributor




                    Xuebit 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 answer



                    share|improve this answer






                    New contributor




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









                    answered yesterday









                    Xuebit

                    1




                    1




                    New contributor




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





                    New contributor





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






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








                    • 2




                      The real definition of ICMP is RFC 792, Internet Control Message Protocol. An ICMP message can certainly be longer than eight total bytes. In fact, it will include the IP header (20 bytes for IPv4) and the first 64 bits (eight bytes) of the IP payload: "The internet header plus the first 64 bits of the original datagram's data." That is enough to include the source and destination addresses of protocols like TCP or UDP.
                      – Ron Maupin
                      yesterday














                    • 2




                      The real definition of ICMP is RFC 792, Internet Control Message Protocol. An ICMP message can certainly be longer than eight total bytes. In fact, it will include the IP header (20 bytes for IPv4) and the first 64 bits (eight bytes) of the IP payload: "The internet header plus the first 64 bits of the original datagram's data." That is enough to include the source and destination addresses of protocols like TCP or UDP.
                      – Ron Maupin
                      yesterday








                    2




                    2




                    The real definition of ICMP is RFC 792, Internet Control Message Protocol. An ICMP message can certainly be longer than eight total bytes. In fact, it will include the IP header (20 bytes for IPv4) and the first 64 bits (eight bytes) of the IP payload: "The internet header plus the first 64 bits of the original datagram's data." That is enough to include the source and destination addresses of protocols like TCP or UDP.
                    – Ron Maupin
                    yesterday




                    The real definition of ICMP is RFC 792, Internet Control Message Protocol. An ICMP message can certainly be longer than eight total bytes. In fact, it will include the IP header (20 bytes for IPv4) and the first 64 bits (eight bytes) of the IP payload: "The internet header plus the first 64 bits of the original datagram's data." That is enough to include the source and destination addresses of protocols like TCP or UDP.
                    – Ron Maupin
                    yesterday


















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Network Engineering Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fnetworkengineering.stackexchange.com%2fquestions%2f55303%2fwhich-first-8-bytes-of-the-ip-datagram-are-included-in-icmp-message%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

                    Plaza Victoria

                    Puebla de Zaragoza

                    Musa