Provides best effort, connectionless packet delivery
motivated by need to keep routers simple and by adaptibility to failure of network elements
packets may be lost, out of order, or even duplicated(复制)
higher layer protocols must deal with these, if necessary
IP also includes:
Internet Control Message Protocol (ICMP)
Internet Group Management Protocol (IGMP)
IP Packet Header
Minimum 20 bytes
Up to 40 bytes in options fields
Version: current IP version is 4.
Internet header length (IHL): length of the header in 32-bit words.
Type of service (TOS): traditionally priority of packet at each router. Recent Differentiated Services redefines TOS field to include other services besides best effort.
Total length: number of bytes of the IP packet including header and data
Identification, Flags, and Fragment Offset: for fragmentation and reassembly.
Time to live (TTL): number of hops packet is allowed to traverse(穿过) in network.
Each router along the path to the destination decrements this value by one.
If the value reaches zero before the packet reaches the destination, the router discards the packet and sends an error message back to the source.
Protocol: specifies upper-layer protocol that is to receive IP data at the destination. Examples include TCP (protocol = 6), UDP (protocol = 17), and ICMP (protocol = 1).
Header checksum(校验和): verifies the integrity of the IP header.
Source IP address and destination IP address: contain the addresses of the source and destination hosts.
Options: Variable length field, allows packet to request special features such as security level, route to be taken by the packet, and timestamp at each router. Detailed descriptions of these options can be found in [RFC 791].
Padding: This field is used to make the header a multiple of 32-bit words.
IP Header Processing
Compute header checksum(校验和) for correctness and check that fields in header (e.g. version and total length) contain valid values
Consult routing table to determine next hop
Change fields that require updating (TTL, header checksum)