Serial/HDLC
The following table shows several representation formats:
header 1 | Header 2 | Header 3 |
---|---|---|
row 1, cell 1 | row 1, cell 2 | row 1, cell 3 |
row 2, cell 1 | row 2, cell 2 | row 2, cell3 |
Dotted decimal | 192.0.2.235 | N/A |
Dotted hexadecimal | 0xC0.0x00.0x02.0xEB | Each octet is individually converted to hexadecimal form |
Dotted octal | 0300.0000.0002.0353 | Each octet is individually converted into octal |
Hexadecimal | 0xC00002EB | Concatenation of the octets from the dotted hexadecimal |
Decimal | 3221226219 | The 32-bit number expressed in decimal |
Octal | 030000001353 | The 32-bit number expressed in octal |
Offsets | Octet | 0 | 1 | 2 | 3 | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Octet | Bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
0 | 0 | Version | IHL | DSCP | ECN | Total Length | |||||||||||||||||||||||||||
4 | 32 | Identification | Flags | Fragment Offset | |||||||||||||||||||||||||||||
8 | 64 | Time To Live | Protocol | Header Checksum | |||||||||||||||||||||||||||||
12 | 96 | Source IP Address | |||||||||||||||||||||||||||||||
16 | 128 | Destination IP Address | |||||||||||||||||||||||||||||||
20 | 160 | Options (if IHL > 5) |
- Version
- The first header field in an IP packet is the four-bit version field. For IPv4, this has a value of 4 (hence the name IPv4).
- Internet Header Length (IHL)
- The second field (4 bits) is the Internet Header Length (IHL), which is the number of 32-bit words in the header. Since an IPv4 header may contain a variable number of options, this field specifies the size of the header (this also coincides with the offset to the data). The minimum value for this field is 5 (RFC 791), which is a length of 5×32 = 160 bits = 20 bytes. Being a 4-bit value, the maximum length is 15 words (15×32 bits) or 480 bits = 60 bytes.
- Differentiated Services Code Point (DSCP)
- Originally defined as the Type of Service field, this field is now defined by RFC 2474 for Differentiated services (DiffServ). New technologies are emerging that require real-time data streaming and therefore make use of the DSCP field. An example is Voice over IP (VoIP), which is used for interactive data voice exchange.