6 Replies Latest reply: Aug 3, 2016 1:22 PM by Craig A RSS

    Packet Header

    mohammad_mozamel

      Dear Friends!

       

      There is some confusion on packets header for me

      1. what dose header size means ?

      2. dose some information is stored in header like IP, multicast, destination ?

      3. is it possible to change header size of some packet ?

      4. dose it takes more bandwidth to carry a data with huge size of header size ?

       

      Thanks !

        • 1. Re: Packet Header
          Craig A

          Headers are used to provide information to what the data in the payload relates to. Header is a generic term - which headers do you mean specifically, or do you mean generally?


          I'll assume an IP header as you used the term packet header, and briefly answer your questions.

           

          1. Header size is the number of bytes of the header only, disregarding the payload. For IPv4, this is 20 bytes without options.

          2. The header is only used to store information - source/destination address, upper layer protocol, header size, flags, checksum etc. All are used in order for a device to correctly process the packet, whether to forward it on or to send it to an upper layer for further processing.

          3. Header size changes if options are present, For IPv4 it cannot be less than 20 bytes and must be in multiples of 4 bytes.

          4. Each byte of the header must be transmitted the same as the data contained in the payload. As the header does not contain application data and are required on every packet, small packets have lower throughput than large packets.

           

          For further info, check this link IPv4 - Wikipedia, the free encyclopedia

          • 2. Re: Packet Header
            Sergey

            Mohammad,

             

            Simply put, header is the service information about the packet. Different protocols at different layers of the OSI model use different types of headers.

             

            For example, when a PC pings another PC on the same Ethernet LAN segment, two headers are used: at data link layer Ethernet header is used and at network layer IP header is used. Both headers contain information about the source and destination address for the relevant layer. IP header also contains the information about the IP protocol number. In this case there is no transport header, as ICMP works at network layer. But if same two PCs initiated a telnet session, another header would be added - transport layer TCP header. That header would not contain the information about the source and destination addresses, but would contain information about the source and destination ports. Of course there is a lot more information that is required in each of mentioned headers, but generally this is it. The header has service information that is needed to deliver the packets and make sure all the intermediate devices as well as the end device knows how to treat the packet.

             

            Have a look here

            TCP/IP Reference

             

            There are a couple of header formats for different protocols. Google is your friend in finding the headers for pretty much every protocol you interested in.

            • 3. Re: Packet Header
              Craig A

              Sergey wrote:

               

               

              For example, when a PC pings another PC on the same Ethernet LAN segment, two headers are used

               

              There would also be an ICMP header, so three in total for a ping.

               

              The ICMP header carries the codes - echo request, echo reply, unreachable etc.

              • 4. Re: Packet Header
                Sergey

                Yes, thanks for correcting  Totally forgot about that. You see, I've lost my header

                • 5. Re: Packet Header
                  sarah
                  The ICMP header carries the codes - echo request, echo reply, unreachable etc.

                  Good point Craig. But you listed ICMP types and not codes. They are information messages, types 8 and 0. Destination unreachable are error messages (Type 3). The ICMP messages can use different values in the code field to be further specific about the meaning of the message. So Type 3, Code 1 would be host unreachable, Code 2 would be protocol unreachable and so on.

                  • 6. Re: Packet Header
                    Craig A

                    A little pedantic but I'll allow it!

                     

                    The header does in fact carry both type and code, so technically I'm not wrong