Presentation on theme: "2: Comparing IPv4 and IPv6 Rick Graziani Cabrillo College"— Presentation transcript:
12: Comparing IPv4 and IPv6 Rick Graziani Cabrillo College
2For more information please check out my Cisco Press book and video series: IPv6 Fundamentals: A Straightforward Approach to Understanding IPv6By Rick GrazianiISBN-10:IPv6 Fundamentals LiveLessons: A Straightforward Approach to Understanding IPv6By Rick GrazianiISBN-10:
4Let’s Begin with the IPv6 Header Similar fieldsUnderstanding IPv6 begins with the IPv6 header.IPv6 takes advantage of 64-bit CPUs.Several differences between IPv4 and IPv6 headers.IPv4Simpler IPv6 header.Fixed 40 byte IPv6 header.Lets look at the differences…64-bit memory wordIPv6Understanding IPv6 all begins with the IPv6 header. When we think about IPv6 we usually think of the header’s IPv6 address but as we will see there are many changes. Understanding the IPv6 header will help us understand some of the other functionality of IPv6.Drawn as 64 bits wide, unlike IPv4 which is typically shown as a 32 bit wide header.Designers of IPv6 decided to take advantage of 64-bit processing although back then 64-bit CPUs were not common.We will explore these similarities and differences throughout this lesson.64-bit CPUs can read one 64-bit wide memory word at a time, so to take advantage of this processing IPv6 fields start at an even 64-bit boundary or a multiple of 64.32-bit CPUs aren’t negatively affected because a 64-bit boundary is also a 32-bit boundary.We will examine the changes between these two headers.IPv4 header – lighter shaded fields have a field in IPv6 with the same or similar functionality. The darker shaded fields are ones that are not included in IPv6.IPv6 is simpler and is fixed length. We’ll talk more about this in a moment.
5IPv6 Version IPv4 Version contains 4. IPv6 Version contains 6. Internet Stream Protocol (ST2)IPv6As mentioned in Lesson 1, in 1990 the Experimental Internet Stream Protocol (ST2) used the value of 5 for its IP protocol Version.Although it was never known as IPv5, when encapsulated in IP, it used the value of 5 for the IP Protocol version.
6IPv4 Internet Header Length IPv4 Internet Header Length (IHL)Length of IPv4 header in 32-bit words including any Options or Padding.IPv6IHL for IPv6 is not needed.IPv6 header is fixed at 40 bytes.12345?IPv68 bytes8 bytes40 bytes =8 bytes8 bytesIPv4 IHL:This is the length of the IP header in 32-bit words, including any optional fields.This points to where the IP header ends and the data or payload begins.The minimum value is 5 (5 32-bit words or 160 bits or 20 bytes.This is equal to the minimum size of an IPv4 header, excluding any options or padding.The IPv6 header is fixed at 40 bytes which allows for faster processing by routers.8 bytes
7DiffServ Code Point (DSCP) IPv6 Traffic ClassIPv4 Type of ServiceIPv6 Traffic ClassNot mandated by any IPv6 RFCs.Same functionality as IPv4.Uses same Differentiated Services technique (RFC 2474) as IPv4.IPv4IPv67654321IP PrecedenceUnsusedDiffServ Code Point (DSCP)IP ECN<Afer IPv6 Traffic Class>This field specifies what type of treatment the packet should receive from routers.The ToS information helps provide quality of service (QoS) features by offering different degrees of precedence.<After Uses same Differentiated Services technique….>Original terminology of the IPv4 Type of Service has been superseded by the diffserv terminology used in RFC 2474IPv6 uses the Differentiated Services technique specified in RFC 2474RFC 2474 defines a technique called Differentiated Services (DS) Differentiated Services Code Point (DSCP) – most routers ignore this field but if you’re implementing QoS its good idea to be come familiar with it. (Kind of strange but kind of cool. Beyond this video though. )
8IPv6 Flow Label 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 SpecificationIPv4IPv6<After: Flow label is used to identify…>The idea is…Tag a stream or flow of IPv6packets sent from a source to one or more destination nodes.<After: Traffic from source to destination share a …>The Flow Label field is used to help identify all the packets within the same flow to ensure that all the packets receive the same type of handling by the IPv6 routers.Currently, there aren’t a lot of implementations that look at the flow label.However, many systems do set the flow label for packets that belong to different TCP sessions.A flow label of 0 means the flow label for that session is either not supported or not desired.Note to self: RFC: However, a flow is not necessarily 1:1 mapped to a transportconnection…. As a general practice, packet flows should not be reordered, and theuse of the Flow Label field does not affect this. In particular, aFlow label value of zero does not imply that reordering isacceptable.
9IPv6 Extension Header (Optional) IPv6 Payload LengthIPv4 HeaderData (Payload)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 + dataIPv4IPv6PayloadIPv6 HeaderIPv6 Extension Header (Optional)DataWe will talk more about the extension header in a moment.IPv6 Payload length – The number bytes of the payloadThe data following the main IPv6 headerIf the IPv6 packet has one or more extension headers, they are included in the number of bytes contained in the Payload Length field.Extension headers are considered part of the payload.IPv4 header can vary in length because of Padding and Options fieldsIPv6 header is fixed at 40 bytes so the length of the entire IPv6 packet can easily be determined by add the 40 bytes.Extension headers will be introduced later in this lesson.These are headers which are optional and in addition to the main IPv6 header.Notice that Payload Length field is 16 bits, allowing a maximum payload size of 65,355 byes.IPv6 has a Jumbogram extension header to support larger packet sizes if needed.RFC 2675, IPv6 Jumbograms, specifies an additional 32-bit field to allow the transmission of IPv6 packets with payloads between 65,536 and 4,294,967,295 bytes.Because the Payload Length does not include the 40-byte IPv6 header there is a small efficiency gain.The receiving host or router does not have to check whether the packet is large enough to hold the IP header in the first place
10IPv4 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.IPv4IPv6
11IPv4 FragmentationMTU of outgoing link smaller than packet size – fragment IPv4 packet.It is my job to reassemble the packet fragments.Link with smaller MTUPCAPCBR1R2R3DestinationSource123IPv4 PacketIPv4 PacketIPv4 PacketIPv4 PacketIPv4 PacketIPv4 requires that every link have a minimum MTU of 68 bytes.Every internet destination must be able to receive a packet of 576 bytes either in one piece or in fragments to be reassembled.IPv4 PacketIPv4 PacketIPv4 PacketRFC791:Every internet module must be able to forward a datagram of 68 octets without further fragmentation. This is because an internet header may be up to 60 octets, and the minimum fragment is 8 octets.Every internet destination must be able to receive a datagram of 576 octets either in one piece or in fragments to be reassembled.
12IPv6 No FragmentationMTU of outgoing link smaller than packet size. Drop packet. Send ICMPv6 Packet Too Big message, use MTU 1350.Packet received. No reassembly required.I will use MTU of the interface.MTU = 1500MTU = 1500MTU = 1350MTU = 1500PCAPCBR1R2Link with smaller MTUR3DestinationSource1IPv6 requires that every link have a minimum MTU of 1280 bytes, with a recommended MTU of 1500 bytes.Path MTU Discovery uses this same process.Because intermediate devices do not fragment packets, Path MTU Discovery is used when their links are greater than 1280.IPv6 Packet – MTU 15002ICMPv6 Packet Too BigUse MTU 13503RFC2460:IPv6 requires that every link in the internet have an MTU of 1280 octets or greater. On any link that cannot convey a 1280-octet packet in one piece, link-specific fragmentation and reassembly must be provided at a layer below IPv6.Path MTU discovery is discussed in the lesson XXX.RFC 1981IPv6 nodes SHOULD implement Path MTU Discovery in order to discoverand take advantage of paths with PMTU greater than the IPv6 minimumlink MTU [IPv6-SPEC]. A minimal IPv6 implementation (e.g., in a bootROM) may choose to omit implementation of Path MTU Discovery.Sending hosts discover the path MTU through the following process:The sending host assumes that the path MTU is the link MTU of the interface on which the traffic is being forwarded.The sending host sends IPv6 datagrams at the path MTU size.If a router on the path is unable to forward the packet over a link because the packet is larger than the link MTU, the router sends an ICMPv6 Packet Too Big message back to the sending host and discards the packet. PAThe Packet Too Big message contains the MTU of the link on which the forwarding failed.The sending host sets the path MTU for packets being sent to the destination to the value of the MTU field in the Packet Too Big message.IPv6 PacketMTU 1350
13(Protocol: TCP, UDP, ICMPv6, etc.) IPv6 Next HeaderIPv4 ProtocolIPv6 Next HeaderFor both protocols, the field indicates the type of header following the IP header.IPv4Common values:6 = TCP17 = UDP58 = ICMPv688 = EIGRP89 = OSPFIPv6IPv6 HeaderNextHeaderData(Protocol: TCP, UDP, ICMPv6, etc.)The same values used in the IPv4 Protocol field are used in the IPv6 Next Header field along with additional values.IPv6 Next Header has additional values including for an extension header.
14IPv6 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.IPv4When 0, drop packet.IPv6Hop Limit makes sure packets are not roaming around the network forever – routing loop.This field is initialized with a suitable value at the origin of a packet and decremented by each router along the way.When the field reaches zero, the packet is dropped.Originally in IPv4 the idea was that the router should decrement, in seconds, that a packet is buffered in a router.But keeping track of how long packets are buffered was too difficult to implement so the number of routers was used instead.
15IPv6 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.IPv4IPv6Much more in later lessons
16IPv4 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.IPv4Because it’s not in IPv6, the UDP checksum is now mandatory.IPv6
17IPv4 Options and Padding Not used in IPv6.Variable length, optional.IPv4 Options are handled using extension headers in IPv6.IPv4Padding makes sure IPv4 options fall on a 32-bit boundary.IPv6 header is fixed at 40 bytes.IPv640 bytes =Fixed 40-byte header so padding is not needed.IPv4– Options are rarely used- Do not really help and are blocked my many routers and fireswalls
18(Protocol: TCP, UDP, ICMPv6, etc.) IPv6 Extension HeaderNext 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 HeaderNextHeaderExtension HeaderNextHeaderData(Protocol: TCP, UDP, ICMPv6, etc.)We won’t go into the details of extension headers here, but they can be used to provide:Fragementation by the source
19Hop-by-Hop Extension Header IPv6 Extension HeaderNext Header Value (Decimal)Extension Header NameExtension Header DescriptionHop-by-Hop OptionsUsed to carry optional information, which must be examined by every router along the path of the packet.43RoutingAllows the source of the packet to specify the path to the destination.44FragmentUsed to fragment IPv6 packets.50Encapsulating Security Payload (ESP)Used to provide authentication, integrity, and encryption.51Authentication Header (AH)Used to provide authentication and integrity.60Destination OptionsUsed to carry optional information that only needs to be examined by a packet’s destination node(s).IPv6 Main HeaderNext HeaderHop-by-Hop Extension HeaderNext Header51AH Extension HeaderNext Header6TCP HeaderDataImmediately followingthe mandatory main IPv6 header, there can be zero, one, or several extension headers.A field common in all extension headers is another Next Hop field, which indicateswhether another extension header is to follow, or the protocol of the data (payload) like aTCP segment. Therefore, the last extension header will always specify which protocol isencapsulated as the data or payload—again, similar to the Protocol field in IPv4.
23Internet Control Message Protocol for IPv6 ICMPv6Internet Control Message Protocol for IPv6ICMPv6 is defined in RFC 4443.Similar to ICMPv4, describes two types of messages:InformationalErrorICMPv6 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”.IPv6 Main HeaderNext Header58ICMPv6 HeaderDataAll ICMPv6 messages
24ICMPv6 Neighbor Discover Protocol ICMPv6 Neighbor Discovery defines 5 different packet types:Router Solicitation MessageRouter Advertisement MessageUsed with dynamic address allocationNeighbor Solicitation MessageNeighbor Advertisement MessageUsed with address resolution (IPv4 ARP)Redirect MessageSimilar to ICMPv4 redirect messageRouter-to-Device messagingRouter-Device MessagingDevice-Device MessagingWe will see this slides several times in other lessons as we discuss these messages types.
25Router Solicitation & Router Advertisement Messages ICMPv6 Neighbor Discovery defines 5 different packet types:Router Solicitation MessageRouter Advertisement MessageUsed with dynamic address allocationNeighbor Solicitation MessageNeighbor Advertisement MessageUsed with address resolution (IPv4 ARP)Redirect MessageSimilar to ICMPv4 redirect messageRouter-to-Device messagingRouter-Device MessagingDevice-Device Messaging
26Dynamic Address Allocation in IPv4 DHCPv4 Server12I need IPv4 addressing information.Here is everything you need.DHCPv4 server is a stateful server.
27Dynamic Address Allocation in IPv6 To all IPv6 routers: I need IPv6 address information.I might not be needed.ICMPv6 Router SolicitationDHCPv6 ServerICMPv6 Router AdvertisementTo all IPv6 devices:Let me tell you how to do this …1. SLAACSLAAC(Stateless Address Autoconfiguration)2. SLAAC withStateless DHCPv6Router SolicitationsRouter AdvertisementsThe Router Advertisement (RA) tells hosts how it will receive IPv6 Address Information.Sent periodically by an IPv6 router or…… when the router receives a Router Solicitation (RS) message from a host.More options for devices to get addressing.The device doesn’t need to access a DHCPv6 server for addressing.It’s router, its default gateway is its way out of the network and everything it needs for addressing.Much more in lesson XXX3. Stateful DHCPv6
28Neighbor Solicitation & Neighbor Advertisement Messages ICMPv6 Neighbor Discovery defines 5 different packet types:Router Solicitation MessageRouter Advertisement MessageUsed with dynamic address allocationNeighbor Solicitation MessageNeighbor Advertisement MessageUsed with address resolution (IPv4 ARP)Redirect MessageSimilar to ICMPv4 redirect messageRouter-to-Device messagingRouter-Device MessagingDevice-Device MessagingDescribed in RFC 4443Much more robust than ICMP for IPv4Contains new functionality and improvements.More than just “messaging” but “how IPv6 conducts business”.General message similar to ICMP for IPv4 (Type and Code fields)
29Address Resolution: IPv4 and IPv6 ARP Request: BroadcastIPv4: ARP over EthernetEthernetARP Request/ReplyARP CacheKnow IPv4, what is the MAC?My IPv4! Here is the MAC?21ARP ReplyPCBARP RequestPCA1My IPv6! Here is the MAC?2Know IPv6, what is the MAC?Neighbor AdvertisementNeighbor SolicitationNeighbor CacheIPv6: ICMPv6 over IPv6 over EthernetNeighbor SolicitationsNeighbor AdvertisementsNS: MulticastNS: Solicited Node MulticastEthernetMore about address resolution in Lesson X. More about Solicited Node Multicast in Lesson X and Y.IPv6 HeaderICMPv6: Neighbor Solicitation/Advertisement
30Router-Device Messaging Device-Device Messaging Redirect MessageICMPv6 Neighbor Discovery defines 5 different packet types:Router Solicitation MessageRouter Advertisement MessageUsed with dynamic address allocationNeighbor Solicitation MessageNeighbor Advertisement MessageUsed with address resolution (IPv4 ARP)Redirect MessageSimilar to ICMPv4 redirect messageRouter-to-Device messagingRouter-Device MessagingDevice-Device MessagingDescribed in RFC 4443Much more robust than ICMP for IPv4Contains new functionality and improvements.More than just “messaging” but “how IPv6 conducts business”.General message similar to ICMP for IPv4 (Type and Code fields)
31ICMPv6 Redirect Network X Similar functionality as ICMPv4. Destination:PCBDestination:Network X HostIPv6 Network AIPv6 Network BPCAPCBSimilar 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.Redirect FunctionRouters use the redirect function to inform originating hosts of a better first-hop neighbor to which traffic should be forwarded for a specific destination. Routers use the redirect function for two purposes:A router informs an originating host of the IP address of a router available on the local link that is closer to the destination. The term closer is a routing metric function used to reach the destination network segment. This condition can occur when multiple routers are on a network segment, the originating host chooses a default router, and it is not the best one to use to reach the destination.A router informs an originating host that the destination is a neighbor (it is on the same link as the originating host). This condition can occur when the prefix list of a host does not include the prefix of the destination. Because the destination does not match a prefix in the list, the originating host forwards the packet to its default router.The following steps occur in the IPv6 redirect process:The originating host sends a unicast packet to its default router.The router processes the packet and notes that the address of the originating host is a neighbor. Additionally, the router notes that both the originating host and the next-hop are on the same link.The router forwards the packet to the appropriate next-hop address.The router sends the originating host a Redirect message. In the Target Address field of the Redirect message is the next-hop address of the node to which the originating host should send packets addressed to the destination.For packets redirected to a router, the Target Address field is set to the link-local address of the router. For packets redirected to a host, the Target Address field is set to the destination address of the packet originally sent.The Redirect message includes the Redirected Header option. The message might also include the Target Link-Layer Address option.5. Upon receiving the Redirect message, the originating host updates the destination address entry in the destination cache with the address in the Target Address field. If the Redirect message includes the Target Link-Layer Address option, its contents are used to create or update the corresponding entry in the neighbor cache.Only the first router in the path between the originating host and the destination sends redirect messages, and (like ICMPv6 error messages) they are rate limited. Hosts never send Redirect messages, and routers never update routing tables based on the receipt of a Redirect message.
32ICMPv6 Neighbor Discover Protocol ICMPv6 Neighbor Discovery defines 5 different packet types:Router Solicitation MessageRouter Advertisement MessageUsed with dynamic address allocationNeighbor Solicitation MessageNeighbor Advertisement MessageUsed with address resolution (IPv4 ARP)Redirect MessageSimilar to ICMPv4 redirect messageRouter-to-Device messagingRouter-Device MessagingDevice-Device MessagingMore details in Lessons 7, 8 & 10More in Lesson X and other lessons.
33For more information please check out my Cisco Press book and video series: IPv6 Fundamentals: A Straightforward Approach to Understanding IPv6By Rick GrazianiISBN-10:IPv6 Fundamentals LiveLessons: A Straightforward Approach to Understanding IPv6By Rick GrazianiISBN-10:
342: Comparing IPv4 and IPv6 Rick Graziani Cabrillo College