RFC 2460
Internet Protocol, Version 6 (IPv6) Specification
RFC 2460: Internet Protocol, Version 6 (IPv6) Specification π¦
okay bestie, this is the big one π RFC 2460 is the spec for IPv6, also called IP Next Generation or IPng β¨. It's the successor to IPv4 and was written by Steve Deering of Cisco and Robert Hinden of Nokia π«Ά. It's a Standards Track document dated December 1998, and it obsoletes RFC 1883 (the older IPv6 spec) π. It's giving "the sequel everyone was waiting for" π
Here's the full front matter, so nothing gets lost:
Status of This Memo π
This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited.
Copyright Notice Β©οΈ
Copyright (C) The Internet Society (1998). All Rights Reserved.
Abstract πΈ
This document specifies version 6 of the Internet Protocol (IPv6), also sometimes referred to as IP Next Generation or IPng.
Table of Contents ποΈ
1. Introduction..................................................2
2. Terminology...................................................3
3. IPv6 Header Format............................................4
4. IPv6 Extension Headers........................................6
4.1 Extension Header Order...................................7
4.2 Options..................................................9
4.3 Hop-by-Hop Options Header...............................11
4.4 Routing Header..........................................12
4.5 Fragment Header.........................................18
4.6 Destination Options Header..............................23
4.7 No Next Header..........................................24
5. Packet Size Issues...........................................24
6. Flow Labels..................................................25
7. Traffic Classes..............................................25
8. Upper-Layer Protocol Issues..................................27
8.1 Upper-Layer Checksums...................................27
8.2 Maximum Packet Lifetime.................................28
8.3 Maximum Upper-Layer Payload Size........................28
8.4 Responding to Packets Carrying Routing Headers..........29
Appendix A. Semantics and Usage of the Flow Label Field.........30
Appendix B. Formatting Guidelines for Options...................32
Security Considerations.........................................35
Acknowledgments.................................................35
Authors' Addresses..............................................35
References......................................................35
Changes Since RFC-1883..........................................36
Full Copyright Statement........................................39
1. Introduction β¨
IP version 6 (IPv6) is a brand-new version of the Internet Protocol, built as the successor to IP version 4 (IPv4) [RFC-791] π. The changes from IPv4 to IPv6 fall mainly into these categories:
- Expanded Addressing Capabilities π IPv6 bumps the IP address size from 32 bits to 128 bits. That gives us more levels of addressing hierarchy, a way bigger number of addressable nodes, and simpler auto-configuration of addresses. The scalability of multicast routing is improved by adding a "scope" field to multicast addresses. And there's a new kind of address called an "anycast address", which is used to send a packet to any one of a group of nodes. Iconic π«Ά
- Header Format Simplification π§Ή Some IPv4 header fields have been dropped or made optional. The goal is to cut the common-case processing cost of packet handling and to limit the bandwidth cost of the IPv6 header. Clean girl era π
- Improved Support for Extensions and Options π§© The new way IP header options are encoded allows for more efficient forwarding, less strict limits on the length of options, and more flexibility for adding new options down the line π¦
- Flow Labeling Capability π·οΈ There's a new capability that lets packets belonging to particular traffic "flows" get labeled. The sender can request special handling for these, such as non-default quality of service or "real-time" service β
- Authentication and Privacy Capabilities π Extensions to support authentication, data integrity, and (optional) data confidentiality are specified for IPv6. Main character energy π
This document specifies the basic IPv6 header, plus the initially-defined IPv6 extension headers and options. It also talks about packet size issues, the semantics of flow labels and traffic classes, and the effects of IPv6 on upper-layer protocols. The format and semantics of IPv6 addresses are specified separately in [ADDRARCH]. The IPv6 version of ICMP, which all IPv6 implementations are required to include, is specified in [ICMPv6] π§
2. Terminology π
Here's the vocab you need before we go any further, bestie π
nodemeans a device that implements IPv6.routermeans a node that forwards IPv6 packets not explicitly addressed to itself. [See Note below].hostmeans any node that is not a router. [See Note below].upper layermeans a protocol layer sitting immediately above IPv6. Examples include transport protocols like TCP and UDP, control protocols like ICMP, and routing protocols like OSPF. It also includes internet or lower-layer protocols that are being "tunneled" over (meaning encapsulated in) IPv6, such as IPX, AppleTalk, or IPv6 itself πΈlinkmeans a communication facility or medium that nodes can use to talk at the link layer, which is the layer immediately below IPv6. Examples are Ethernets (simple or bridged), PPP links, X.25, Frame Relay, or ATM networks, and internet (or higher) layer "tunnels", like tunnels over IPv4 or IPv6 itself π€οΈneighborsmeans nodes attached to the same link π«interfacemeans a node's attachment to a link πaddressmeans an IPv6-layer identifier for an interface or a set of interfaces πͺͺpacketmeans an IPv6 header plus payload π¦link MTUmeans the maximum transmission unit, which is the maximum packet size in octets that can be conveyed over a link πpath MTUmeans the minimum link MTU of all the links in a path between a source node and a destination node π£οΈ
Note: it's possible (though unusual!) for a device with multiple interfaces to be set up to forward non-self-destined packets that arrive from some set of its interfaces (fewer than all of them), while discarding non-self-destined packets that arrive from its other interfaces. A device like this must obey the protocol requirements for routers when it receives packets from, and interacts with neighbors over, the forwarding interfaces. It must obey the protocol requirements for hosts when it receives packets from, and interacts with neighbors over, the non-forwarding interfaces. Two hats, one device π©
3. IPv6 Header Format π
Let's look at the header, bestie. Here's the layout:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| Traffic Class | Flow Label |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Payload Length | Next Header | Hop Limit |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Source Address +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Destination Address +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Now the fields, one by one π
- Version β¬οΈ is a 4-bit Internet Protocol version number, and for IPv6 it's
6. - Traffic Class π¦ is an 8-bit traffic class field. Check section 7 for the details.
- Flow Label π·οΈ is a 20-bit flow label. Check section 6 for the details.
- Payload Length π is a 16-bit unsigned integer. It's the length of the IPv6 payload, meaning the rest of the packet following this IPv6 header, in octets. Quick note, bestie: any extension headers [section 4] that are present count as part of the payload, so they're included in the length count π«Ά
- Next Header π§ is an 8-bit selector. It identifies the type of header immediately following the IPv6 header. It uses the same values as the IPv4 Protocol field [RFC-1700 et seq.] π’
- Hop Limit β³ is an 8-bit unsigned integer. Each node that forwards the packet decrements it by 1. If Hop Limit gets decremented to zero, the packet is discarded π
- Source Address π is the 128-bit address of the originator of the packet. See [ADDRARCH] π
- Destination Address π― is the 128-bit address of the intended recipient of the packet. This might not be the ultimate recipient, if a Routing header is present. See [ADDRARCH] and section 4.4 π§
4. IPv6 Extension Headers β¨
okay so IPv6 keeps optional internet-layer info in separate little headers π that can sit between the main IPv6 header and the upper-layer header. There aren't many of them, and each one is marked by its own Next Header value. A packet can carry zero, one, or several, and each header points to the next one using its Next Header field π
+---------------+------------------------
| IPv6 header | TCP header + data
| |
| Next Header = |
| TCP |
+---------------+------------------------
+---------------+----------------+------------------------
| IPv6 header | Routing header | TCP header + data
| | |
| Next Header = | Next Header = |
| Routing | TCP |
+---------------+----------------+------------------------
+---------------+----------------+-----------------+-----------------
| IPv6 header | Routing header | Fragment header | fragment of TCP
| | | | header + data
| Next Header = | Next Header = | Next Header = |
| Routing | Fragment | TCP |
+---------------+----------------+-----------------+-----------------
Extension headers are basically ignored by every node on the way π§ until the packet gets to the node (or each node in the group, if it's multicast) listed in the Destination Address field of the IPv6 header. Only the one exception gets looked at early. Once the packet arrives, normal demultiplexing on the IPv6 header's Next Header field hands things to the module that handles the first extension header, or straight to the upper-layer header if there aren't any π What each extension header contains and means decides whether processing moves on to the next one. So extension headers MUST be processed strictly in the order they show up in the packet. A receiver MUST NOT, for example, scan through the packet hunting for one kind of extension header and handle it before handling all the ones in front of it. Not me doing the hunt-and-skip thing π
The exception I mentioned is the Hop-by-Hop Options header π It carries information that MUST be examined and processed by every node along the delivery path, including the source and destination nodes. When it's present, the Hop-by-Hop Options header MUST immediately follow the IPv6 header. You can tell it's there because the IPv6 header's Next Header field is zero π
If a node has to move on to the next header, but the Next Header value in the current header isn't one it recognizes, it SHOULD discard the packet and send an ICMP Parameter Problem message to the packet's source. That message uses ICMP Code value 1 and its Pointer field holds the offset of the unrecognized value inside the original packet. The same action SHOULD be taken if a node runs into a Next Header value of zero in any header other than an IPv6 header π
Every extension header has to be a whole multiple of 8 octets long so the headers after it stay 8-octet aligned π¦ Multi-octet fields inside each one sit on their natural boundaries. That means a field n octets wide starts at a multiple of n octets from the start of the header, where n is 1, 2, 4, or 8. Very precise, very iconic π«Ά
A full IPv6 implementation covers these extension headers:
Hop-by-Hop Options
Routing (Type 0)
Fragment
Destination Options
Authentication
Encapsulating Security Payload
The first four are defined in this document. The last two are defined in [RFC-2402] and [RFC-2406], respectively π
4.1. Extension Header Order
When a packet uses more than one extension header, it is RECOMMENDED that they appear in this order:
IPv6 header
Hop-by-Hop Options header
Destination Options header (note 1)
Routing header
Fragment header
Authentication header (note 2)
Encapsulating Security Payload header (note 2)
Destination Options header (note 3)
upper-layer header
note 1: for options to be processed by the first destination
that appears in the IPv6 Destination Address field
plus subsequent destinations listed in the Routing
header.
note 2: additional recommendations regarding the relative
order of the Authentication and Encapsulating
Security Payload headers are given in [RFC-2406].
note 3: for options to be processed only by the final
destination of the packet.
Each extension header SHOULD show up at most once πΈ The one exception is the Destination Options header, which SHOULD show up at most twice: once before a Routing header and once before the upper-layer header.
If the upper-layer header is another IPv6 header (which happens when IPv6 is tunneled over or encapsulated in IPv6), it MAY be followed by its own extension headers. Those are subject to the same ordering recommendations on their own π₯
If and when other extension headers get defined, their ordering constraints relative to the ones listed above MUST be specified. Future-you will thank present-you for that one π§
IPv6 nodes MUST accept and attempt to process extension headers in any order, and they MUST handle them even when they appear any number of times in the same packet. The Hop-by-Hop Options header is the exception: it is restricted to appearing right after an IPv6 header only. Still, it is strongly advised that IPv6 packet sources stick to the RECOMMENDED order above, until and unless later specs revise that recommendation β¨
4.2. Options
Two of the extension headers defined so far, the Hop-by-Hop Options header and the Destination Options header, carry a variable number of type-length-value (TLV) encoded "options" π Each option looks like this:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - -
| Option Type | Opt Data Len | Option Data
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - -
Option Type 8-bit identifier of the type of option.
Opt Data Len 8-bit unsigned integer. Length of the Option
Data field of this option, in octets.
Option Data Variable-length field. Option-Type-specific
data.
The options inside a header MUST be processed strictly in the order they appear in that header. Again, a receiver MUST NOT, for example, scan through the header looking for one particular option and process it before processing all the options in front of it π
The Option Type values are encoded so their highest-order two bits decide what happens if the processing IPv6 node doesn't recognize that Option Type π
00 - skip over this option and continue processing the header.
01 - discard the packet.
10 - discard the packet and, regardless of whether or not the
packet's Destination Address was a multicast address, send an
ICMP Parameter Problem, Code 2, message to the packet's
Source Address, pointing to the unrecognized Option Type.
11 - discard the packet and, only if the packet's Destination
Address was not a multicast address, send an ICMP Parameter
Problem, Code 2, message to the packet's Source Address,
pointing to the unrecognized Option Type.
The third-highest-order bit of the Option Type says whether the Option Data of that option can change en-route to the packet's final destination π¦ When an Authentication header is present in the packet, then for any option whose data may change en-route, its entire Option Data field MUST be treated as zero-valued octets when computing or verifying the packet's authenticating value. Here's the breakdown:
0 - Option Data does not change en-route
1 - Option Data may change en-route
The three high-order bits are part of the Option Type, not separate from it π A particular option is identified by its full 8-bit Option Type, not just the low-order 5 bits. Don't just look at the bottom bits, bestie π
The Hop-by-Hop Options header and the Destination Options header share the same Option Type numbering space. However, the specification of a particular option MAY restrict its use to just one of those two headers π
Individual options may have specific alignment requirements, so that multi-octet values inside Option Data fields land on natural boundaries. An option's alignment requirement is written as xn+y, which means the Option Type MUST appear at an integer multiple of x octets from the start of the header, plus y octets. For example:
2n means any 2-octet offset from the start of the header.
8n+2 means any 8-octet offset from the start of the header,
plus 2 octets.
There are two padding options π§ They're used when needed to line up later options and to pad the whole header out to a multiple of 8 octets. These padding options MUST be recognized by all IPv6 implementations:
Pad1 option (alignment requirement: none)
+-+-+-+-+-+-+-+-+
| 0 |
+-+-+-+-+-+-+-+-+
NOTE! the format of the Pad1 option is a special case -- it does
not have length and value fields.
The Pad1 option is used to insert one octet of padding into the
Options area of a header. If more than one octet of padding is
required, the PadN option, described next, should be used, rather
than multiple Pad1 options.
Okay, the PadN option is the one that handles bigger gaps π It's the 2-or-more-octets version.
PadN option (alignment requirement: none)
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - -
| 1 | Opt Data Len | Option Data
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - -
The PadN option is used to insert two or more octets of padding
into the Options area of a header. For N octets of padding, the
Opt Data Len field contains the value N-2, and the Option Data
consists of N-2 zero-valued octets.
Appendix B has formatting guidelines if you're designing new options π
4.3. Hop-by-Hop Options Header β¨
okay so the Hop-by-Hop Options header is the one that carries optional info that every single node along the packet's delivery path has to look at π bestie, that's a LOT of responsibility for one header π
it's identified by a Next Header value of 0 in the IPv6 header, and it's giving this layout:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Next Header | Hdr Ext Len | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
| |
. .
. Options .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
let's break the fields down π
- Next Header π¦ is an 8-bit selector. It tells you what type of header comes right after the Hop-by-Hop Options header. It uses the same values as the IPv4 Protocol field
[RFC-1700 et seq.]π«Ά - Hdr Ext Len πΈ is an 8-bit unsigned integer. It's the length of the Hop-by-Hop Options header in 8-octet units, not including the first 8 octets π
- Options π is a variable-length field. Its length is set so that the complete Hop-by-Hop Options header comes out as an integer multiple of 8 octets long β¨ It holds one or more TLV-encoded options, as described in section 4.2 π§
The only hop-by-hop options defined in this document are the Pad1 and PadN options specified in section 4.2. That's it, that's the whole list π π
4.4. Routing Header β¨
okay so the Routing header is how an IPv6 source gets to write its own little itinerary πΊοΈ it lists one or more intermediate nodes that the packet has to "visit" on the way to its destination. honestly this is giving IPv4's Loose Source and Record Route option vibes π you'll know the Routing header by its Next Header value of 43 in the header right before it. here's the layout:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Next Header | Hdr Ext Len | Routing Type | Segments Left |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. .
. type-specific data .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
let's go field by field π
Next Headeris an 8-bit selector π it tells you what kind of header comes right after the Routing header. It uses the same values as the IPv4 Protocol field [RFC-1700 et seq.].Hdr Ext Lenis an 8-bit unsigned integer π’ it's the length of the Routing header in 8-octet units, not counting the first 8 octets.Routing Typeis an 8-bit identifier for a particular variant of the Routing header π¦Segments Leftis an 8-bit unsigned integer π§ it's the number of route segments still left, i.e., how many explicitly listed intermediate nodes still need to be visited before the final destination.type-specific datais a variable-length field π its format depends on the Routing Type, and its length is set so that the whole Routing header comes out to an integer multiple of 8 octets long.
now the drama π if a node is processing a packet and runs into a Routing header with a Routing Type value it doesn't recognize, what it has to do depends on the Segments Left field:
- If Segments Left is zero, the node must ignore the Routing header and move on to process the next header in the packet. You find that next header by checking the Next Header field in the Routing header.
- If Segments Left is non-zero, the node must discard the packet and send an ICMP Parameter Problem, Code 0, message to the packet's Source Address, pointing to the unrecognized Routing Type.
β οΈ bestie, the "non-zero means discard" rule is the important one. Don't skip past it!
there's also a rule about size π if an intermediate node has just processed a Routing header and sees that the packet is going out on a link whose link MTU is smaller than the packet, the node must discard the packet and send an ICMP Packet Too Big message to the packet's Source Address.
next up is the Type 0 Routing header, which has its own format β¨
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Next Header | Hdr Ext Len | Routing Type=0| Segments Left |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Address[1] +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Address[2] +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. . .
. . .
. . .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Address[n] +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
the fields in the Type 0 version work like this π¦
Next Headeris the same 8-bit selector as before, using the same values as the IPv4 Protocol field [RFC-1700 et seq.].Hdr Ext Lenis the same 8-bit unsigned integer, measured in 8-octet units and not counting the first 8 octets. For the Type 0 Routing header, Hdr Ext Len is equal to two times the number of addresses in the header π₯Routing Typeis 0 for this one πSegments Leftis the same 8-bit unsigned integer, the number of route segments still remaining, i.e., the number of explicitly listed intermediate nodes still to be visited before reaching the final destination.Reservedis a 32-bit reserved field π it's initialized to zero for transmission and ignored on reception.Address[1..n]is a vector of 128-bit addresses, numbered 1 to n πΈ
quick rule to keep in your back pocket π«Ά multicast addresses must not appear in a Routing header of Type 0, and they must not appear in the IPv6 Destination Address field of a packet carrying a Routing header of Type 0.
here's the good part π a Routing header doesn't get looked at or processed until it reaches the node named in the Destination Address field of the IPv6 header. Once it gets there, the Next Header field of the header right before it sends things to the Routing header module. For Routing Type 0, that module runs this algorithm:
if Segments Left = 0 {
proceed to process the next header in the packet, whose type is
identified by the Next Header field in the Routing header
}
else if Hdr Ext Len is odd {
send an ICMP Parameter Problem, Code 0, message to the Source
Address, pointing to the Hdr Ext Len field, and discard the
packet
}
else {
compute n, the number of addresses in the Routing header, by
dividing Hdr Ext Len by 2
if Segments Left is greater than n {
send an ICMP Parameter Problem, Code 0, message to the Source
Address, pointing to the Segments Left field, and discard the
packet
}
else {
decrement Segments Left by 1;
compute i, the index of the next address to be visited in
the address vector, by subtracting Segments Left from n
if Address [i] or the IPv6 Destination Address is multicast {
discard the packet
}
else {
swap the IPv6 Destination Address and Address[i]
if the IPv6 Hop Limit is less than or equal to 1 {
send an ICMP Time Exceeded -- Hop Limit Exceeded in
Transit message to the Source Address and discard the
packet
}
else {
decrement the Hop Limit by 1
resubmit the packet to the IPv6 module for transmission
to the new destination
}
}
}
}
to see how this algorithm plays out, let's follow a source node S sending a packet to destination node D, routed through intermediate nodes I1, I2, and I3 π§ here's what the relevant IPv6 header and Routing header fields look like on each leg of the trip πΊοΈ
as the packet travels from S to I1:
Source Address = S Hdr Ext Len = 6
Destination Address = I1 Segments Left = 3
Address[1] = I2
Address[2] = I3
Address[3] = D
as the packet travels from I1 to I2:
Source Address = S Hdr Ext Len = 6
Destination Address = I2 Segments Left = 2
Address[1] = I1
Address[2] = I3
Address[3] = D
as the packet travels from I2 to I3:
Source Address = S Hdr Ext Len = 6
Destination Address = I3 Segments Left = 1
Address[1] = I1
Address[2] = I2
Address[3] = D
as the packet travels from I3 to D:
Source Address = S Hdr Ext Len = 6
Destination Address = D Segments Left = 0
Address[1] = I1
Address[2] = I2
Address[3] = I3
the Segments Left count goes down at every hop, and the addresses keep swapping places, which is honestly iconic π¦β¨
4.5. Fragment Header β¨
Okay bestie, the Fragment header is what an IPv6 source uses when a packet is too chunky for the path MTU to carry π¦. Heads up: unlike IPv4, fragmentation in IPv6 is done ONLY by source nodes, never by routers along the delivery path π
ββοΈ (see section 5). You can spot it because the header right before it has a Next Header value of 44 π¦. It looks like this:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Next Header | Reserved | Fragment Offset |Res|M|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Identification |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Here's the field rundown π:
Next Headeris an 8-bit selector. It tells you the initial header type of the Fragmentable Part of the original packet (more on that below). It uses the same values as the IPv4 Protocol field [RFC-1700 et seq.], so it's giving familiar vibes π .Reservedis an 8-bit reserved field. It's set to zero when sending and ignored when receiving.Fragment Offsetis a 13-bit unsigned integer. It's the offset, in 8-octet units, of the data following this header, measured from the start of the Fragmentable Part of the original packet.Resis a 2-bit reserved field. It's set to zero when sending and ignored when receiving.M flagis 1 for more fragments and 0 for the last fragment.Identificationis 32 bits. More on this below π.
So, when a source node wants to send a packet that's too big for the MTU of the path to its destination, it MAY divide the packet into fragments and send each fragment as its own packet, to be reassembled at the receiver. Main character energy π.
For every packet that's going to be fragmented, the source node generates an Identification value. This Identification MUST be different from that of any other fragmented packet sent recently* with the same Source Address and Destination Address. If a Routing header is present, the Destination Address we care about is the final destination π§.
- "recently" means within the maximum likely lifetime of a packet. That includes transit time from source to destination and time spent waiting for reassembly with other fragments of the same packet. BUT it's not required that a source node know the maximum packet lifetime π. The requirement can be met by keeping the Identification value as a simple, 32-bit, "wrap-around" counter that increments each time a packet has to be fragmented. It's an implementation choice whether to keep one counter for the whole node, or multiple counters, like one for each of the node's possible source addresses, or one for each active (source address, destination address) combination π.
The big, unfragmented packet we started with is called the "original packet", and it's made of two parts, as shown:
original packet:
+------------------+----------------------//-----------------------+
| Unfragmentable | Fragmentable |
| Part | Part |
+------------------+----------------------//-----------------------+
The Unfragmentable Part is the IPv6 header plus any extension headers that MUST be processed by nodes en route to the destination. In other words, it's every header up to and including the Routing header if present, else the Hop-by-Hop Options header if present, else no extension headers π£οΈ.
The Fragmentable Part is everything else: any extension headers that only need to be processed by the final destination node(s), plus the upper-layer header and data π.
The Fragmentable Part of the original packet gets divided into fragments. Each fragment, except possibly the last ("rightmost") one, MUST be an integer multiple of 8 octets long. The fragments are sent out in separate "fragment packets", like this:
original packet:
+------------------+--------------+--------------+--//--+----------+
| Unfragmentable | first | second | | last |
| Part | fragment | fragment | .... | fragment |
+------------------+--------------+--------------+--//--+----------+
fragment packets:
+------------------+--------+--------------+
| Unfragmentable |Fragment| first |
| Part | Header | fragment |
+------------------+--------+--------------+
+------------------+--------+--------------+
| Unfragmentable |Fragment| second |
| Part | Header | fragment |
+------------------+--------+--------------+
o
o
o
+------------------+--------+----------+
| Unfragmentable |Fragment| last |
| Part | Header | fragment |
+------------------+--------+----------+
Each fragment packet is made of three things π§:
(1) The Unfragmentable Part of the original packet. The Payload Length of the original IPv6 header gets changed to hold the length of this fragment packet only (not counting the IPv6 header itself), and the Next Header field of the last header in the Unfragmentable Part gets changed to 44.
(2) A Fragment header containing:
- The Next Header value that identifies the first header of the Fragmentable Part of the original packet.
- A Fragment Offset containing the offset of the fragment, in 8-octet units, relative to the start of the Fragmentable Part of the original packet. The Fragment Offset of the first ("leftmost") fragment is 0.
- An M flag value of 0 if the fragment is the last ("rightmost") one, else an M flag value of 1.
- The Identification value generated for the original packet.
(3) The fragment itself.
The lengths of the fragments MUST be chosen so the resulting fragment packets fit within the MTU of the path to the packets' destination(s) π.
At the destination, the fragment packets get reassembled back into their original, unfragmented form π§©:
reassembled original packet:
+------------------+----------------------//------------------------+
| Unfragmentable | Fragmentable |
| Part | Part |
+------------------+----------------------//------------------------+
Here are the reassembly rules, and they're lowkey important π«Ά:
- An original packet is reassembled ONLY from fragment packets that have the same Source Address, Destination Address, and Fragment Identification.
- The Unfragmentable Part of the reassembled packet is made of all headers up to, but not including, the Fragment header of the first fragment packet (the one whose Fragment Offset is zero). Two things change:
- The Next Header field of the last header in the Unfragmentable Part is taken from the Next Header field of the first fragment's Fragment header.
- The Payload Length of the reassembled packet is computed from the length of the Unfragmentable Part and the length and offset of the last fragment. For example, a formula for computing the Payload Length of the reassembled original packet is:
PL.orig = PL.first - FL.first - 8 + (8 * FO.last) + FL.last
where
PL.orig = Payload Length field of reassembled packet.
PL.first = Payload Length field of first fragment packet.
FL.first = length of fragment following Fragment header of
first fragment packet.
FO.last = Fragment Offset field of Fragment header of
last fragment packet.
FL.last = length of fragment following Fragment header of
last fragment packet.
- The Fragmentable Part of the reassembled packet is built from the fragments that follow the Fragment headers in each fragment packet. The length of each fragment is worked out by subtracting from the packet's Payload Length the length of the headers between the IPv6 header and the fragment itself. Its position in the Fragmentable Part comes from its Fragment Offset value πΊοΈ.
- The Fragment header is NOT present in the final, reassembled packet π«₯.
Now, the error conditions that can come up when reassembling fragmented packets π¨:
- If there aren't enough fragments to finish reassembling a packet within 60 seconds of receiving the first-arriving fragment of that packet, reassembly of that packet MUST be abandoned and every fragment received for it MUST be discarded. If the first fragment (the one with a Fragment Offset of zero) has been received, an ICMP
Time Exceeded -- Fragment Reassembly Time Exceededmessage SHOULD be sent to the source of that fragment. - If the length of a fragment, as derived from the fragment packet's Payload Length field, is not a multiple of 8 octets AND the M flag of that fragment is 1, then that fragment MUST be discarded. An ICMP
Parameter Problem,Code 0message SHOULD be sent to the source of the fragment, pointing to the Payload Length field of the fragment packet. - If the length and offset of a fragment are such that the Payload Length of the packet reassembled from that fragment would exceed 65,535 octets, then that fragment MUST be discarded. An ICMP
Parameter Problem,Code 0message SHOULD be sent to the source of the fragment, pointing to the Fragment Offset field of the fragment packet.
These next conditions aren't expected to happen, but they aren't considered errors if they do π€·ββοΈ:
- The number and content of the headers before the Fragment header of different fragments of the same original packet MAY differ. Whatever headers are there before the Fragment header in each fragment packet get processed when the packets arrive, before the fragments are queued for reassembly. Only the headers in the Offset zero fragment packet are kept in the reassembled packet.
- The Next Header values in the Fragment headers of different fragments of the same original packet MAY differ. Only the value from the Offset zero fragment packet is used for reassembly.
4.6. Destination Options Header π
okay bestie, the Destination Options header is for optional info that ONLY the packet's destination node(s) need to look at π it's like a little note tucked away for the final stop. You can spot it because the Next Header value of 60 sits in the header right before it π
and here's the layout:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Next Header | Hdr Ext Len | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
| |
. .
. Options .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Here's what each field does β¨
Next Header: an 8-bit selector π¦ It tells you what type of header comes right after the Destination Options header. It uses the same values as the IPv4 Protocol field [RFC-1700 et seq.].Hdr Ext Len: an 8-bit unsigned integer πΈ It's the length of the Destination Options header in 8-octet units, NOT counting the first 8 octets.Options: a variable-length field π§ Its length is whatever makes the complete Destination Options header a whole multiple of 8 octets. It holds one or more TLV-encoded options, which we cover in section 4.2.
The ONLY destination options defined in this document are the Pad1 and PadN options from section 4.2 π
Now here's the fun part π₯ There are two ways to stash optional destination info in an IPv6 packet. You can put it as an option inside the Destination Options header, OR as its own separate extension header. The Fragment header and the Authentication header are examples of the second approach π«Ά Which one you pick depends on what you want a destination node to do if it DOESN'T understand the info:
- If you want the destination node to discard the packet and, ONLY if the packet's Destination Address is not a multicast address, send an ICMP Unrecognized Type message back to the packet's Source Address π, then the info MAY be encoded either as a separate header or as an option in the Destination Options header whose Option Type has the value 11 in its highest-order two bits. Picking between them MAY depend on things like which takes fewer octets, or which gives better alignment or more efficient parsing π
- If you want ANY other action, the information MUST be encoded as an option in the Destination Options header whose Option Type has the value 00, 01, or 10 in its highest-order two bits, which specifies the action you want (see section 4.2). β¨
4.7 No Next Header π
the value 59 in the Next Header field of an IPv6 header or any extension header means "nothing comes after this one" π So if the Payload Length field of the IPv6 header says there are octets past the end of a header whose Next Header field is 59, those octets MUST be ignored. And if the packet gets forwarded, they MUST be passed on unchanged π«Ά
5. Packet Size Issues π¦
IPv6 REQUIRES that every link in the internet has an MTU of 1280 octets or greater π If a link can't carry a 1280-octet packet in one piece, then link-specific fragmentation and reassembly MUST be provided at a layer below IPv6 π
Links with a configurable MTU (like PPP links [RFC-1661]) MUST be configured to have an MTU of at least 1280 octets. It's RECOMMENDED that they're configured with an MTU of 1500 octets or greater, so there's room for possible encapsulations (aka tunneling) without the IPv6 layer having to fragment anything π
From each link a node is directly attached to, the node MUST be able to accept packets as large as that link's MTU πΈ
It is strongly RECOMMENDED that IPv6 nodes implement Path MTU Discovery [RFC-1981], so they can find and use path MTUs bigger than 1280 octets β¨ BUT a minimal IPv6 implementation (say, one living in a boot ROM) MAY just stick to sending packets no bigger than 1280 octets and skip Path MTU Discovery altogether π§
To send a packet bigger than a path's MTU, a node MAY use the IPv6 Fragment header to fragment the packet at the source and let it get reassembled at the destination(s). Still, fragmentation is discouraged for any application that can adjust its packets to fit the measured path MTU (down to 1280 octets) π
A node MUST be able to accept a fragmented packet that, after reassembly, is as large as 1500 octets. A node is permitted to accept fragmented packets that reassemble to MORE than 1500 octets π An upper-layer protocol or application that relies on IPv6 fragmentation to send packets bigger than a path's MTU SHOULD NOT send packets larger than 1500 octets unless it's sure the destination can reassemble packets that big π₯
Now the spicy one πΆοΈ If an IPv6 packet is sent to an IPv4 destination (so it gets translated from IPv6 to IPv4), the originating IPv6 node MAY receive an ICMP Packet Too Big message reporting a Next-Hop MTU less than 1280. In that case the IPv6 node is NOT REQUIRED to shrink later packets below 1280, BUT it MUST include a Fragment header in those packets, so the IPv6-to-IPv4 translating router can grab a suitable Identification value to use in the resulting IPv4 fragments π Heads up: this means the payload MAY have to be reduced to 1232 octets (1280 minus 40 for the IPv6 header and 8 for the Fragment header), and even smaller if extra extension headers are used π
6. Flow Labels π
The 20-bit Flow Label field in the IPv6 header MAY be used by a source to label sequences of packets it wants special handling for from IPv6 routers, like non-default quality of service or "real-time" service β¨ Honest tea: as of writing, this part of IPv6 is still experimental and subject to change as the requirements for flow support on the Internet become clearer π§ͺ Hosts or routers that don't support the Flow Label field's functions are REQUIRED to set the field to zero when originating a packet, pass the field on unchanged when forwarding a packet, and ignore the field when receiving a packet π«Ά
Appendix A describes the current intended semantics and usage of the Flow Label field π
7. Traffic Classes π
The 8-bit Traffic Class field in the IPv6 header is available for originating nodes and/or forwarding routers to use when they want to identify and tell apart different classes or priorities of IPv6 packets π¦ When this spec was being written, there were a bunch of experiments going on with the IPv4 Type of Service and/or Precedence bits to get various forms of "differentiated service" for IP packets, without going through explicit flow set-up π The Traffic Class field in IPv6 is meant to support similar stuff πΈ
We're hoping those experiments eventually agree on which traffic classifications are most useful for IP packets π Detailed definitions of the syntax and semantics of all or some of the IPv6 Traffic Class bits (whether experimental or intended for eventual standardization) are going to be provided in separate documents π
The following general requirements apply to the Traffic Class field:
- The service interface to the IPv6 service within a node MUST provide a way for an upper-layer protocol to supply the value of the Traffic Class bits in packets that upper-layer protocol originates. The default value MUST be zero for all 8 bits. π
- Nodes that support a specific use (experimental or eventual standard) of some or all of the Traffic Class bits are permitted to change the value of those bits in packets they originate, forward, or receive, as that specific use requires. Nodes SHOULD ignore and leave unchanged any bits of the Traffic Class field they don't support a specific use for. π§
- An upper-layer protocol MUST NOT assume that the value of the Traffic Class bits in a received packet is the same as the value sent by the packet's source. π
8. Upper-Layer Protocol Issues π₯
8.1 Upper-Layer Checksums π
Okay bestie, so any transport or other upper-layer protocol that puts the addresses from the IP header into its checksum MUST be modified for IPv6 π«Ά. It has to use the 128-bit IPv6 addresses instead of the 32-bit IPv4 ones. The big one is the TCP and UDP "pseudo-header" for IPv6, and it's giving very structured π :
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Source Address +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Destination Address +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Upper-Layer Packet Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| zero | Next Header |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Routing header check π¦: If the IPv6 packet contains a Routing header, the Destination Address used in the pseudo-header is that of the final destination. At the originating node, that address will be in the last element of the Routing header. At the recipient(s), that address will be in the Destination Address field of the IPv6 header.
- Next Header vibes π: The Next Header value in the pseudo-header identifies the upper-layer protocol (e.g., 6 for TCP, or 17 for UDP). It will differ from the Next Header value in the IPv6 header if there are extension headers between the IPv6 header and the upper-layer header.
- Length drama πΈ: The Upper-Layer Packet Length in the pseudo-header is the length of the upper-layer header and data (e.g., TCP header plus TCP data). Some upper-layer protocols carry their own length information (e.g., the Length field in the UDP header). For those protocols, that's the length used in the pseudo-header. Other protocols (such as TCP) don't carry their own length information, so the length used in the pseudo-header is the Payload Length from the IPv6 header, minus the length of any extension headers present between the IPv6 header and the upper-layer header.
- UDP checksum is NOT optional π₯: Unlike IPv4, when UDP packets are originated by an IPv6 node, the UDP checksum is not optional. Whenever a UDP packet is originated, an IPv6 node MUST compute a UDP checksum over the packet and the pseudo-header. If that computation yields a result of zero, it MUST be changed to hex
FFFFfor placement in the UDP header. IPv6 receivers MUST discard UDP packets containing a zero checksum, and SHOULD log the error π.
The IPv6 version of ICMP [ICMPv6] includes the above pseudo-header in its checksum computation. That's a change from the IPv4 version of ICMP, which doesn't include a pseudo-header in its checksum. The reason is to protect ICMP from misdelivery or corruption of those fields of the IPv6 header it depends on. Unlike IPv4, those fields are not covered by an internet-layer checksum, so this is the fix π§. The Next Header field in the pseudo-header for ICMP contains the value 58, which identifies the IPv6 version of ICMP.
8.2 Maximum Packet Lifetime β³
Unlike IPv4, IPv6 nodes are not required to enforce maximum packet lifetime. That's the reason the IPv4 "Time to Live" field was renamed "Hop Limit" in IPv6 π. In practice, very few, if any, IPv4 implementations actually conform to the requirement that they limit packet lifetime, so this isn't really a change in practice, ngl π. Any upper-layer protocol that relies on the internet layer (whether IPv4 or IPv6) to limit packet lifetime ought to be upgraded to bring its own way of detecting and discarding obsolete packets. Main character energy means not depending on someone else for that π.
8.3 Maximum Upper-Layer Payload Size π
When working out the maximum payload size available for upper-layer data, an upper-layer protocol MUST take into account how much bigger the IPv6 header is compared to the IPv4 header. For example, in IPv4, TCP's MSS option is computed as the maximum packet size (a default value or a value learned through Path MTU Discovery) minus 40 octets. That's 20 octets for the minimum-length IPv4 header and 20 octets for the minimum-length TCP header. When using TCP over IPv6, the MSS MUST be computed as the maximum packet size minus 60 octets. That's because the minimum-length IPv6 header (i.e., an IPv6 header with no extension headers) is 20 octets longer than a minimum-length IPv4 header π.
8.4 Responding to Packets Carrying Routing Headers π§
When an upper-layer protocol sends one or more packets in response to a received packet that included a Routing header, the response packet(s) MUST NOT include a Routing header that was automatically derived by "reversing" the received Routing header UNLESS the integrity and authenticity of the received Source Address and Routing header have been verified (e.g., via the use of an Authentication header in the received packet). Basically, reversing the route is a no-go unless someone has checked it's legit π«. In other words, only the following kinds of packets are permitted in response to a received packet bearing a Routing header:
- Plain responses β : Response packets that do not carry Routing headers.
- Fresh routes πΊοΈ: Response packets that carry Routing headers that were NOT derived by reversing the Routing header of the received packet (for example, a Routing header supplied by local configuration).
- Reversed routes, but only if verified π: Response packets that carry Routing headers that were derived by reversing the Routing header of the received packet IF AND ONLY IF the integrity and authenticity of the Source Address and Routing header from the received packet have been verified by the responder.
Appendix A. Semantics and Usage of the Flow Label Field π¦
Okay so a flow is a sequence of packets sent from a particular source to a particular (unicast or multicast) destination, where the source wants special handling from the routers in between π. That special handling might be conveyed to the routers by a control protocol, like a resource reservation protocol, or by information inside the flow's packets themselves, e.g., in a hop-by-hop option. The details of those control protocols or options are beyond the scope of this document, so we're not getting into them here π .
There may be multiple active flows from a source to a destination, as well as traffic that isn't associated with any flow. A flow is uniquely identified by the combination of a source address and a non-zero flow label. Packets that don't belong to a flow carry a flow label of zero π«§.
A flow label is assigned to a flow by the flow's source node. New flow labels MUST be chosen (pseudo-)randomly and uniformly from the range 1 to FFFFF hex. The whole point of the random allocation is to make any set of bits within the Flow Label field suitable for use as a hash key by routers, for looking up the state associated with the flow π°. Iconic design, honestly.
All packets belonging to the same flow MUST be sent with the same source address, destination address, and flow label π. If any of those packets includes a Hop-by-Hop Options header, then they all MUST be originated with the same Hop-by-Hop Options header contents (excluding the Next Header field of the Hop-by-Hop Options header). If any of those packets includes a Routing header, then they all MUST be originated with the same contents in all extension headers up to and including the Routing header (excluding the Next Header field in the Routing header). The routers or destinations are permitted, but not required, to verify that these conditions are satisfied. If a violation is detected, it SHOULD be reported to the source by an ICMP Parameter Problem message, Code 0, pointing to the high-order octet of the Flow Label field (i.e., offset 1 within the IPv6 packet) π¨.
The maximum lifetime of any flow-handling state established along a flow's path MUST be specified as part of the description of the state-establishment mechanism, e.g., the resource reservation protocol or the flow-setup hop-by-hop option β°. A source MUST NOT re-use a flow label for a new flow within the maximum lifetime of any flow-handling state that might have been established for the prior use of that flow label. No recycling flow labels too early, bestie π ββοΈ.
When a node stops and restarts (e.g., as a result of a "crash"), it MUST be careful not to use a flow label that it might have used for an earlier flow whose lifetime may not have expired yet π₯. This can be handled by recording flow label usage on stable storage so it can be remembered across crashes, or by refraining from using any flow labels until the maximum lifetime of any possible previously established flows has expired. If the minimum time for rebooting the node is known, that time can be deducted from the necessary waiting period before starting to allocate flow labels π§ .
There is no requirement that all, or even most, packets belong to flows, i.e., carry non-zero flow labels. This observation is placed here to remind protocol designers and implementors not to assume otherwise π«Ά. For example, it would be unwise to design a router whose performance would only be adequate if most packets belonged to flows, or to design a header compression scheme that only worked on packets that belonged to flows. Don't be that designer π β¨.
Appendix B. Formatting Guidelines for Options β¨
okay bestie, this appendix is basically the cheat sheet for designing new options π that go into the Hop-by-Hop Options header or the Destination Options header (the stuff from section 4.2 π¦). it's built on three vibes:
- Natural alignment is a must-have π Any multi-octet field inside an option's Option Data area should sit on its natural boundary. So a field that's n octets wide (n = 1, 2, 4, or 8) should start at an integer multiple of n octets from the start of the Hop-by-Hop or Destination Options header. No misaligned chaos allowed π ββοΈ
- Be tiny π§ Hmm, no, let me say it right: the header should take up as little space as possible, but it has to stay an integer multiple of 8 octets long. Small and snug, but still a multiple of 8 π
- Expect a few options πΈ When either option-bearing header shows up, it's usually carrying just one option, maybe two. Tiny party, big vibes β¨
so the big move is: order your fields from smallest to largest, put zero interior padding in between them, and then figure out the option's alignment requirement from the biggest field (capped at 8 octets). the examples below show exactly how this plays out, and they're giving clean π
Example 1 π
okay so imagine option X needs two data fields: one that's 8 octets and one that's 4 octets. here's how it gets laid out:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Option Type=X |Opt Data Len=12|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 4-octet field |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ 8-octet field +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
its alignment requirement is 8n+2, which makes sure the 8-octet field starts at a multiple-of-8 offset from the start of the enclosing header π¦ (the enclosing header is the whole Hop-by-Hop or Destination Options header, btw).
a complete Hop-by-Hop or Destination Options header with just this one option looks like this:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Next Header | Hdr Ext Len=1 | Option Type=X |Opt Data Len=12|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 4-octet field |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ 8-octet field +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Example 2 π
now option Y is a bit more of a diva π it needs three data fields: one 4-octet, one 2-octet, and one 1-octet. layout time:
+-+-+-+-+-+-+-+-+
| Option Type=Y |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Opt Data Len=7 | 1-octet field | 2-octet field |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 4-octet field |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
its alignment requirement is 4n+3, so the 4-octet field starts at a multiple-of-4 offset from the start of the enclosing header π the full header with only option Y in it:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Next Header | Hdr Ext Len=1 | Pad1 Option=0 | Option Type=Y |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Opt Data Len=7 | 1-octet field | 2-octet field |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 4-octet field |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| PadN Option=1 |Opt Data Len=2 | 0 | 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Example 3 π
what if one header has BOTH option X and option Y from Examples 1 and 2? π it can come out in one of two formats, depending on which option shows up first. first up, X goes first:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Next Header | Hdr Ext Len=3 | Option Type=X |Opt Data Len=12|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 4-octet field |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ 8-octet field +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| PadN Option=1 |Opt Data Len=1 | 0 | Option Type=Y |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Opt Data Len=7 | 1-octet field | 2-octet field |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 4-octet field |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| PadN Option=1 |Opt Data Len=2 | 0 | 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
and now Y goes first, which is a whole different glow-up:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Next Header | Hdr Ext Len=3 | Pad1 Option=0 | Option Type=Y |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Opt Data Len=7 | 1-octet field | 2-octet field |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 4-octet field |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| PadN Option=1 |Opt Data Len=4 | 0 | 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 | 0 | Option Type=X |Opt Data Len=12|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 4-octet field |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ 8-octet field +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Security Considerations π
the security features of IPv6 are described in the Security Architecture for the Internet Protocol [RFC-2401]. go read that one, it's the real tea π΅
Acknowledgments π«Ά
the authors gratefully acknowledge the many helpful suggestions of the members of the IPng working group, the End-to-End Protocols research group, and the Internet Community At Large. thank you, everyone π
Authors' Addresses π
Stephen E. Deering Cisco Systems, Inc. 170 West Tasman Drive San Jose, CA 95134-1706 USA
Phone: +1 408 527 8213 Fax: +1 408 527 8254 EMail: deering@cisco.com
Robert M. Hinden Nokia 232 Java Drive Sunnyvale, CA 94089 USA
Phone: +1 408 990-2004 Fax: +1 408 743-5677 EMail: hinden@iprg.nokia.com
References π
[RFC-2401] Kent, S. and R. Atkinson, "Security Architecture for the Internet Protocol", RFC 2401, November 1998.
[RFC-2402] Kent, S. and R. Atkinson, "IP Authentication Header", RFC 2402, November 1998.
[RFC-2406] Kent, S. and R. Atkinson, "IP Encapsulating Security Protocol (ESP)", RFC 2406, November 1998.
[ICMPv6] Conta, A. and S. Deering, "ICMP for the Internet Protocol Version 6 (IPv6)", RFC 2463, December 1998.
[ADDRARCH] Hinden, R. and S. Deering, "IP Version 6 Addressing Architecture", RFC 2373, July 1998.
[RFC-1981] McCann, J., Mogul, J. and S. Deering, "Path MTU Discovery for IP version 6", RFC 1981, August 1996.
[RFC-791] Postel, J., "Internet Protocol", STD 5, RFC 791, September 1981.
[RFC-1700] Reynolds, J. and J. Postel, "Assigned Numbers", STD 2, RFC 1700, October 1994. See also: http://www.iana.org/numbers.html
[RFC-1661] Simpson, W., "The Point-to-Point Protocol (PPP)", STD 51, RFC 1661, July 1994.
CHANGES SINCE RFC-1883 β¨
okay bestie, this is the changelog, and it's giving receipts π§Ύπ this memo has the following changes from RFC-1883. The numbers mark which Internet-Draft version each change landed in. π¦
- 02) Removed all references to jumbograms and the Jumbo Payload option (moved to a separate document). π
- 02) Moved most of the Flow Label description from section 6 to a new Appendix A. π§
- 02) In the Flow Label description (now Appendix A), corrected the maximum Flow Label value from
FFFFFFtoFFFFF, which is one less "F", because the field shrank from 24 bits to 20 bits. π₯ - 02) Renumbered (relettered??) the previous Appendix A as Appendix B. πΈ
- 02) Reworded the Security Considerations section to avoid a dependency loop between this spec and the IPsec specs. π«Ά
- 02) Updated R. Hinden's email address and company affiliation. π
- 01) In section 3, renamed the field
ClasstoTraffic Classand grew it from 4 to 8 bits. To make room, the Flow Label field shrank from 24 to 20 bits. β¨ - 01) In section 4.1, put the Authentication Header and the ESP header back in their proper order. They got mistakenly swapped in the 00 version. π
- 01) In section 4.4, deleted the Strict/Loose Bit Map field and the strict routing functionality from the Type 0 Routing header. Also removed the limit on how many addresses the Type 0 Routing header can carry (it used to be capped at 23 because of the size of that bit map). π
- 01) In section 5, changed the minimum IPv6 MTU from 576 to 1280 octets, and added a recommendation that links with a configurable MTU (like PPP links) be set to an MTU of at least 1500 octets. π
- 01) In section 5, deleted the requirement that a node must not send fragmented packets that reassemble to more than 1500 octets without knowing the destination's reassembly buffer size. It's now a recommendation that upper-layer protocols or applications should not do that. π
- 01) Swapped the reference to the IPv4 Path MTU Discovery spec (RFC-1191) for the IPv6 Path MTU Discovery spec (RFC-1981), and deleted the Notes at the end of section 5 about Path MTU Discovery, since RFC-1981 covers those details now. π§
- 01) In section 6, deleted the "opportunistic" flow set-up and every mention of the 6-second maximum lifetime for opportunistically established flow state. π
- 01) In section 7, deleted the provisional description of the internal structure and semantics of the Traffic Class field. Those descriptions are supposed to live in separate documents now. π
- 00) In section 4, corrected the Code value for "unrecognized Next Header type encountered" in an ICMP Parameter Problem message, changing it from
2to1. π - 00) In the Payload Length description in section 3, and the Jumbo Payload Length description in section 4.3, made it clearer that extension headers are included in the payload length count. π«Ά
- 00) In section 4.1, swapped the Authentication header and the ESP header. (NOTE: this was a mistake, and the change was undone in version 01.) π
- 00) In section 4.2, made it clear that options are identified by the full 8-bit Option Type, not the low-order 5 bits of an Option Type. Also specified that Hop-by-Hop Options and Destination Options headers share the same Option Type numbering space. π¦
- 00) In section 4.4, added a sentence requiring that nodes processing a Routing header send an ICMP Packet Too Big message in response to a packet too big to fit in the next hop link, rather than, say, fragmenting it. π₯
- 00) Renamed the IPv6 Priority field to
Class, replaced the old description of Priority in section 7 with a description of the Class field, and excluded this field from the set of fields that must stay the same for all packets in a flow (section 6). β¨ - 00) In the pseudo-header in section 8.1, renamed the
Payload Lengthfield toUpper-Layer Packet Length. Also clarified that for protocols that carry their own length info (like non-jumbogram UDP), the upper-layer-derived length is used in the pseudo-header, not the IP-layer-derived length. πΈ - 00) Added section 8.4, specifying that upper-layer protocols, when responding to a received packet that carried a Routing header, must not include the reverse of the Routing header in the response packet(s) unless the received Routing header was authenticated. π
- 00) Fixed some typos and grammatical errors. π
- 00) Updated the authors' contact info. π
Full Copyright Statement π
okay so the legal bit, and it's important π₯Ή Copyright (C) The Internet Society (1998). All Rights Reserved.
This document and translations of it may be copied and given to others. Derivative works that comment on or explain it, or that help people implement it, may be prepared, copied, published and distributed, in whole or in part, without any restriction, as long as the copyright notice and this paragraph are included on every copy and derivative work. But the document itself can't be modified in any way, such as by removing the copyright notice or the references to the Internet Society or other Internet organizations. The exceptions are when it's needed for developing Internet standards (then the copyright procedures in the Internet Standards process must be followed) or when it's translated into a language other than English. π«Ά
The limited permissions above are perpetual and won't be revoked by the Internet Society or its successors or assigns. π¦
This document and the information in it are provided on an "AS IS" basis, and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. π
π¦ where this page comes from
- ietf: rfc2460 1998-12
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms