Ch 20. Internet Protocol (IP)
20.1 Internetworking
• PHY and data link layers operate “locally”
Need Routing
• Network layer is responsible for host-to-host delivery and packets routing
Internetworking in the Internet
• Functionality of network layer– Create a packet from data– Add logical addresses of the source and destination– Check routing table to find the interface that the
packet should go– If the packet is too large, it is fragmented
• Internet as a Connectionless Network– Connection-oriented service. Packets sent on the same path
in sequential order. Connection is terminated at the end of transmission.
– Connectionless service. Path can be different for each packet.
20.2 IPv4
• The Internet– Is a packet-switched network, in particular, a
datagram network– Provides a connectionless service
• Best-effort service– No retransmission for error control – No flow control– No guarantee of packet delivery
IPv4 Datagram Format
Length of data = total length – header length
Max total length is 65535, fragmentation might be need
Time to live is the maximum number of hops. Needed because routing table can become corrupted.
Value Protocol
1 ICMP
2 IGMP
6 TCP
7 UDP
89 OSPF
Examples
• In an IPv4 packet, the value of HLEN is 1000 in binary. How many bytes of options are being carried by this packet?– The HLEN value is 8, which means the total number of bytes in
the header is 8 x 4, 32 byes. The first 20 bytes are the base header, the next 12 are the options.
• In an IPv4 packet, the value of HLEN is 5, and the value of the total length field is 0x0028. How many bytes of data are being carried by this packet?– The HLEN value is 5, which means the total number of bytes in
the header is 5 x 4, or 20 bytes (no options). The total length is 40 bytes, which means the packet is carrying 20 bytes of data (40 -20)
Fragmentation• IPv4 can have a datagram of
length up to 65,535 bytes– Each data link layer has its own
maximum frame length Maximum Transfer Unit (MTU)
• Fragmentation– To fit in MTU– Most of the IP header is copied– Use identification, flags, offset
fields in the header
identification, flags, offset• Identification is a 16 bit field that identifies a datagram. To
guarantee uniqueness the IPv4 protocol uses a counter to label the datagrams. When a datagram is fragmented, the value in the identification field is copied to all fragments.
• Flags is a 3-bit field. The first bit is reserved. The second bit is called the do not fragment bit. The third bit is called the more fragment bit. If it values i1, it means the datagram is not the last fragment .
• Fragmentation offset. This 13-bit field shows the relative position of this fragment with respect to the whole datagram. It is the offset of the data in the original datagram measured in units of 8 bytes.
Example
Checksum • Cover only the
header
Options
20.3 IPv6
• Main issues– Address depletion– Real-time traffic support– Security
• Advantages over IPv4– Larger address space from 128-bit address– Better header format– Support for resource allocation– Support for security– Potential extension and more options
IPv6 Datagram Format
Changes from IPv4
Extension Header
Transition From IPv4 To IPv6
• Three main strategies– Dual stack, tunneling, header translation
• Dual stack (at host)
• Tunneling
• Header translation
Homework
• Exercises– 11– 12– 13– 24