2: Comparing IPv4 and IPv6 Rick Graziani Cabrillo College Rick.Graziani@cabrillo.edu For more information please check out my Cisco Press book and video series: IPv6 Fundamentals: A Straightforward Approach to Understanding IPv6 • By Rick Graziani • ISBN-10: 1-58714-313-5 IPv6 Fundamentals LiveLessons: A Straightforward Approach to Understanding IPv6 • By Rick Graziani • ISBN-10: 1-58720-457-6 © 2.1: Comparing the IPv4 and IPv6 Headers Let’s Begin with the IPv6 Header Similar fields • Understanding IPv6 begins with the IPv4 IPv6 header. • IPv6 takes advantage of 64-bit CPUs. • Several differences between IPv4 64-bit memory word IPv6IPv6 headers. • and Simpler header. IPv6 • Fixed 40 byte IPv6 header. • Lets look at the differences… © IPv6 Version • • • • IPv4 Version contains 4. IPv6 Version contains 6. Version 5? Internet Stream Protocol (ST2) IPv4 IPv6 © IPv4 Internet Header Length • IPv4 Internet Header Length (IHL) • Length of IPv4 header in 32-bit words including any Options or Padding. • IPv6 • IHL for IPv6 is not needed. • IPv6 header is fixed at 40 bytes. IPv4 1 2 3 4 5 ? IPv6 8 bytes 8 bytes 40 bytes = 8 bytes 8 bytes 8 bytes © IPv6 Traffic Class • IPv4 Type of Service • IPv6 Traffic Class • Not mandated by any IPv6 RFCs. • Same functionality as IPv4. • Uses same Differentiated Services technique (RFC 2474) as IPv4. IPv4 IPv6 7 6 5 IP Precedence 4 3 2 1 0 Unsused DiffServ Code Point (DSCP) IP ECN © IPv6 Flow Label • • • • IPv4 New field in IPv6 – not part of IPv4. Flow label is used to identify the packets in a common stream or flow. Traffic from source to destination share a common flow label. RFC 6437 IPv6 Flow Label Specification 11001011000101100 10110010111000111 IPv6 © IPv6 Payload Length IPv4 Header • IPv4 Total Length – Number of bytes of the IPv4 header (options) + data. • IPv6 Payload Length – Number of bytes of the payload. • Does not include the main IPv6 header. • Includes extension headers + data Data (Payload) IPv4 IPv6 Payload IPv6 Header IPv6 Extension Header (Optional) Data © IPv4 Fragmentation • IPv4 fields used for fragmentation and reassembly. • Intermediate devices such as IPv6 routers do not perform fragmentation. • Any fragmentation needed will be handled by the source using an extension header. IPv4 IPv6 © IPv6 Next Header • IPv4 Protocol IPv4 • IPv6 Next Header • For both protocols, the field indicates the type of header following the IP header. • Common values: • 6 = TCP IPv6 • 17 = UDP • 58 = ICMPv6 IPv6 Next • 88 = EIGRP Header Header • 89 = OSPF Data (Protocol: TCP, UDP, ICMPv6, etc.) © IPv6 Hop Limit • IPv4 TTL (Time to Live) • IPv6 Hop Limit • Renamed to more accurately reflect process. • Set by source, every router in path decrements hop limit by 1. • When 0, IPv6 drop packet. IPv4 © IPv6 Source and Destination Addresses • IPv6 Source and Destination addresses have the same basic functionality as IPv4. • IPv4 – 32-bit addresses. • IPv6 – 128-bit addresses. • Some significant changes in IPv6. IPv4 IPv6 © IPv4 Header Checksum • IPv4 Header Checksum • Not used in IPv6. • Upper-layer protocols generally have a checksum (UDP and TCP). • So, in IPv4 the UDP checksum is optional. • Because it’s not in IPv6, IPv6 the UDP checksum is now mandatory. IPv4 © IPv4 Options and Padding • • • • IPv4 Options and Padding Not used in IPv6. Variable length, optional. IPv4 Options are handled using extension headers in IPv6. • Padding makes sure IPv4 options fall on a 32-bit IPv6 boundary. • IPv6 header is fixed at 40 bytes. IPv4 40 bytes = © IPv6 Extension Header • Next Header identifies: • The protocol carried in the data portion of the packet. • The presence of an extension header. • Extension headers are optional and follow the main IPv6 header. • Provide flexibility and features to the main IPv6 header for future enhancements without having to redesign the entire protocol. • Allows the main IPv6 header to have a fixed size for more efficient processing. IPv6 Main Header Next Header Extension Header Next Header Data (Protocol: TCP, UDP, ICMPv6, etc.) © IPv6 Extension Header Next Header Value (Decimal) Extension Header Name Extension Header Description 0 Hop-by-Hop Options Used to carry optional information, which must be examined by every router along the path of the packet. 43 Routing Allows the source of the packet to specify the path to the destination. 44 Fragment Used to fragment IPv6 packets. 50 Encapsulating Security Payload (ESP) Used to provide authentication, integrity, and encryption. 51 Authentication Header (AH) Used to provide authentication and integrity. 60 Destination Options Used to carry optional information that only needs to be examined by a packet’s destination node(s). IPv6 Main Header Next Header 0 Hop-by-Hop Extension Header Next Header 51 AH Extension Header Next Header 6 TCP Header Data © 2.2: A Brief Look at IPv6 Address Types More details in Lessons 3, 4, 5 & 6 IPv6 Address Types IPv6 Addresses Unicast Multicast Assigned FF00::/8 Anycast Solicited Node FF02::1:FF00:0000/104 Global Unicast Link-Local Loopback Unspecified Unique Local Embedded IPv4 2000::/3 FE80::/10 ::1/128 ::/128 FC00::/7 ::/80 © 2.3: A Brief Look at ICMPv6 Neighbor Discovery ICMPv6 Internet Control Message Protocol for IPv6 • ICMPv6 is defined in RFC 4443. • Similar to ICMPv4, describes two types of messages: • Informational • Error • ICMPv6 Neighbor Discovery is described in RFC 4861. • Much more robust than ICMP for IPv4. • Contains new functionality and improvements. • More than just “messaging” but “how IPv6 conducts business”. Next IPv6 Main All ICMPv6 messages Header Header 58 ICMPv6 Header Data © ICMPv6 Neighbor Discover Protocol ICMPv6 Neighbor Discovery defines 5 different packet types: • Router Solicitation Message • Router Advertisement Message Used with dynamic address allocation • Neighbor Solicitation Message • Neighbor Advertisement Message Used with address resolution (IPv4 ARP) Router-Device Messaging Device-Device Messaging • Redirect Message Similar to ICMPv4 redirect message Router-to-Device messaging © Router Solicitation & Router Advertisement Messages ICMPv6 Neighbor Discovery defines 5 different packet types: • Router Solicitation Message • Router Advertisement Message Used with dynamic address allocation • Neighbor Solicitation Message • Neighbor Advertisement Message Used with address resolution (IPv4 ARP) Router-Device Messaging Device-Device Messaging • Redirect Message Similar to ICMPv4 redirect message Router-to-Device messaging © Dynamic Address Allocation in IPv4 DHCPv4 Server 1 2 I need IPv4 addressing information. Here is everything you need. © Dynamic Address Allocation in IPv6 To all IPv6 routers: I need IPv6 address information. I might not be needed. ICMPv6 Router Solicitation DHCPv6 Server To all IPv6 devices: Let me tell you how to do this … ICMPv6 Router Advertisement 1. SLAAC 2. SLAAC with Stateless DHCPv6 SLAAC (Stateless Address Autoconfiguration) Router Solicitations Router Advertisements 3. Stateful DHCPv6 © Neighbor Solicitation & Neighbor Advertisement Messages ICMPv6 Neighbor Discovery defines 5 different packet types: • Router Solicitation Message • Router Advertisement Message Used with dynamic address allocation • Neighbor Solicitation Message • Neighbor Advertisement Message Used with address resolution (IPv4 ARP) Router-Device Messaging Device-Device Messaging • Redirect Message Similar to ICMPv4 redirect message Router-to-Device messaging © Address Resolution: IPv4 and IPv6 ARP Request: Broadcast IPv4: ARP over Ethernet Ethernet ARP Request/Reply ARP Cache My IPv4! Here is the MAC? PCB 2 1 ARP Reply ARP Request 1 2 My IPv6! Here is the MAC? Neighbor Solicitation Neighbor Advertisement IPv6: ICMPv6 over IPv6 over Ethernet NS: Multicast NS: Solicited Node Multicast Ethernet IPv6 Header PCA Neighbor Cache Know IPv4, what is the MAC? Know IPv6, what is the MAC? Neighbor Solicitations Neighbor Advertisements ICMPv6: Neighbor Solicitation/Advertisement © Redirect Message ICMPv6 Neighbor Discovery defines 5 different packet types: • Router Solicitation Message • Router Advertisement Message Used with dynamic address allocation • Neighbor Solicitation Message • Neighbor Advertisement Message Used with address resolution (IPv4 ARP) Router-Device Messaging Device-Device Messaging • Redirect Message Similar to ICMPv4 redirect message Router-to-Device messaging © ICMPv6 Redirect Network X R1 R2 Destination: Network PCB X Host IPv6 Network A PCA • • • PCB IPv6 Network B Similar functionality as ICMPv4. Like IPv4, a router informs an originating host of the IP address of a router that is on the local link and is closer to the destination. Unlike IPv4, a router informs an originating host that the destination host (on a different prefix/network) is on the same link as itself. © ICMPv6 Neighbor Discover Protocol ICMPv6 Neighbor Discovery defines 5 different packet types: • Router Solicitation Message • Router Advertisement Message Used with dynamic address allocation • Neighbor Solicitation Message • Neighbor Advertisement Message Used with address resolution (IPv4 ARP) • Redirect Message Similar to ICMPv4 redirect message Router-to-Device messaging Router-Device Messaging Device-Device Messaging More details in Lessons 7, 8 & 10 © For more information please check out my Cisco Press book and video series: IPv6 Fundamentals: A Straightforward Approach to Understanding IPv6 • By Rick Graziani • ISBN-10: 1-58714-313-5 IPv6 Fundamentals LiveLessons: A Straightforward Approach to Understanding IPv6 • By Rick Graziani • ISBN-10: 1-58720-457-6 © 2: Comparing IPv4 and IPv6 Rick Graziani Cabrillo College Rick.Graziani@cabrillo.edu