170 likes | 310 Vues
This document provides a comprehensive overview of the Internet Protocol (IP) header as defined in RFC 791. It details essential fields including IP version, Internet Header Length (IHL), Type of Service (ToS), total length, identification, flags, fragment offset, Time to Live (TTL), protocol, and checksum information. Additionally, it covers various options such as source routing and the implications of TTL in packet travel and network traces. Understanding these details is crucial for networks and protocols in operation across the internet.
E N D
IP Protocol Details Yen-Cheng Chen ycchen@ncnu.edu.tw
IP Header RFC 791
IP Version, IHL • Version: 4 bits • Indicates the format of the internet header. • IHL: 4 bits • The length of the internet header in 32 bit words, and thus points to the beginning of the data. • Note that the minimum value for a correct header is 5.
Precedence D T R Type of Service • Provides an indication of the abstract parameters of the quality of service desired. • Bits 0-2: Precedence. • Bit 3: 0 = Normal Delay, 1 = Low Delay. • Bits 4: 0 = Normal Throughput, 1 = High Throughput. • Bits 5: 0 = Normal Relibility, 1 = High Relibility. • Bit 6-7: Reserved for Future Use. 0 1 2 3 4 5 6 7
Total Length, Identification • Total Length: 16 bits • Total Length is the length of the datagram, measured in octets, including internet header and data. • Identification: 16 bits • An identifying value assigned by the sender to aid in assembling the fragments of a datagram.
0 DF MF Flags, Fragment Offset • Flags: 3 bits • Various Control Flags. • Bit 0: reserved, must be zero • Bit 1: (DF) • 0 = May Fragment, 1 = Don't Fragment. • Bit 2: (MF) • 0 = Last Fragment, 1 = More Fragments. • Fragment Offset: 13bits • This field indicates where in the datagram this fragment belongs. The fragment offset is measured in units of 8 octets (64 bits).
Time To Live (TTL) • Time to Live: 8 bits • Indicates the maximum time the datagram is allowed to remain in the internet system. • If this field contains the value zero, then the datagram must be destroyed. • This field is modified in internet header processing. • Measured in units of seconds, but since every module that processes a datagram must decrease the TTL by at least one even if it process the datagram in less than a second. • To bound the maximum datagram lifetime.
Traceroute RFC 1393 • To provide a trace of the path the packet took to reach the destination. • Operates by first sending out a packet with a Time To Live (TTL) of 1. The first hop then sends back an ICMP error message indicating that the packet could not be forwarded because the TTL expired. • The packet is then resent with a TTL of 2, and the second hop returns the TTL expired. This process continues until the destination is reached. • Record the source of each ICMP TTL exceeded message http://www.visualroute.com/
Protocol • Protocol: 8 bits http://www.iana.org/assignments/protocol-numbers http://www.iana.org/assignments/protocol-numbers
Header Checksum • Header Checksum: 16 bits • A checksum on the header only. • Since some header fields change (e.g., time to live), this is recomputed and verified at each point that the internet header is processed.
0 1 2 3 4 5 6 7 Copy Class Option Number Options • There may be zero or more options. • Each option can be • a 8-bit Option-Type • Option-Type + Option-Length + Option-Data • Option-Type
Option-Type: Copy • Copy: 1 bit • The copied flag indicates that this option is copied into all fragments on fragmentation. • 0 = not copied • 1 = copied 0 1 2 3 4 5 6 7 Copy Class Option Number
Option-Type: Class • 0 (00) = control • 1 (01) = reserved for future use • 2 (10) = debugging and measurement • 3 (11) = reserved for future use 0 1 2 3 4 5 6 7 Copy Class Option Number
Option-Type: Option Number • Option Number: 5 bits • 0 = Endof Option list • 1 = No Option • 2 = Security • 3 = Loose Source Routing • 4 = Timestamp • 7 = Record Route • 8 = Stream ID • 9 = Strict Source Routing 0 1 2 3 4 5 6 7 Copy Class Option Number
Source Routing • The sender of a packet can specify the route that a packet should take through the network. • Loose Source (Record) Route (LSRR) • Sender gives one or more hops that the packet must go through. • Strict Source Routing • Sender specifies the exactroute the packet must take.