IPv6 packet: Difference between revisions

Content deleted Content added
Hddqsb (talk | contribs)
m Extension headers: fix redundancy ("should only appear at most once" => "should appear at most once"; for comparison, the RFC's wording is "should occur at most once"
m unpiped links using script
(35 intermediate revisions by 15 users not shown)
Line 1:
{{short description|Smallest message entity exchanged using Internet Protocol version 6}}
 
An '''IPv6 packet''' is the smallest message entity exchanged using [[IPv6|Internet Protocol version 6]] (IPv6). [[Network packet|Packet]]s consist of control information for addressing and routing and a [[payload (computing)|payload]] of user data. The control information in IPv6 packets is subdivided into a mandatory fixed [[header (computing)|header]] and optional extension headers. The payload of an IPv6 packet is typically a [[datagram]] or segment of the higher-level [[transport layer]] protocol, but may be data for an [[internet layer]] (e.g., [[ICMPv6]]) or [[link layer]] (e.g., [[OSPF]]) instead.
 
IPv6 packets are typically transmitted over the link layer (i.e., over [[Ethernet]] or [[Wi-Fi]]), which encapsulates each packet in a [[frame (networking)|frame]]. Packets may also be transported over a higher-layer [[tunneling protocol]], such as [[IPv4]] when using [[6to4]] or [[Teredo tunneling|Teredo]] transition technologies.
Line 7:
In contrast to IPv4, [[router (computing)|routers]] do not fragment IPv6 packets larger than the [[maximum transmission unit]] (MTU), it is the sole responsibility of the originating node. A minimum MTU of 1,280 [[octet (computing)|octets]] is mandated by IPv6, but [[Host (network)|hosts]] are "strongly recommended" to use [[Path MTU Discovery]] to take advantage of MTUs greater than the minimum.{{Ref RFC|8200}}
 
Since July 2017, the [[Internet Assigned Numbers Authority]] (IANA) ishas been responsible for registering all IPv6 parameters that are used in IPv6 packet headers.<ref name=rfc8200/>
 
==Fixed header==
The fixed header starts an IPv6 packet and has a size of 40 [[octet (computing)|octets]] (320 [[bit|bits]]).<ref{{Ref name=rfc8200RFC|8200}} />The bytes of the multi-byte fields are in the [[network byte order]].
{{APHD|start|title=Fixed header format}}
 
{{APHD|0|bits1=4|bits2=8|bits3=20|field1=Version|field2=Traffic class|field3=Flow label}}
:{| class="wikitable" style="text-align: center"
{{APHD|4|bits1=16|bits2=8|bits3=8|field1=Payload length|field2=Next header|field3=Hop limit}}
|+Fixed header format
{{APHD|8|bits1=128|field1=Source address}}
|-
{{APHD|24|bits1=128|field1=Destination address}}
! style="border-bottom:none; border-right:none;"| ''Offsets''
{{APHD|end}}
! style="border-left:none;"| [[Octet (computing)|Octet]]
;{{APHD|def|Version|4 bits|The constant 6 (bit sequence {{mono|0110}}).}}
! colspan="8" | 0
;{{APHD|def|Traffic Class|6+2 bits|The bits of this field hold two values. The six most-significant bits hold the [[differentiated services field]] (DS field), which is used to classify packets.{{Ref RFC|2474}}{{Ref RFC|3260}} Currently, all standard DS fields end with a '0'&nbsp;bit. Any DS field that ends with two '1'&nbsp;bits is intended for local or experimental use.{{Ref RFC|4727}} The remaining two bits are used for [[Explicit Congestion Notification]] (ECN);{{Ref RFC|3168}} priority values subdivide into ranges: traffic where the source provides congestion control and non-congestion control traffic.}}
! colspan="8" | 1
;{{APHD|def|Flow Label|20 bits|A high-entropy identifier of a flow of packets between a source and destination. A flow is a group of packets, e.g., a TCP session or a media stream. The special flow label 0 means the packet does not belong to any flow (using this scheme). An older scheme identifies flow by source address and port, destination address and port, protocol (value of the last ''Next Header'' field).{{Ref RFC|6437}} It has further been suggested that the flow label be used to help detect spoofed packets.<ref>[http://tools.ietf.org/html/draft-blake-ipv6-flow-label-nonce-02 Use of the IPv6 Flow Label as a Transport-Layer Nonce to Defend Against Off-Path Spoofing Attacks]</ref>}}
! colspan="8" | 2
;{{APHD|def|name=Payload Length|length=16 bits|text=The size of the payload in octets, including any extension headers. The length is set to zero when a ''Hop-by-Hop'' extension header carries a [[#Jumbogram|Jumbo Payload]] option.{{Ref RFC|2675}}}}
! colspan="8" | 3
;{{APHD|def|name=Next Header|length=8 bits|text=Specifies the type of the next header. This field usually specifies the [[transport layer]] protocol used by a packet's payload. When extension headers are present in the packet this field indicates which extension header follows. The values are shared with those used for the IPv4 protocol field, as both fields have the same function (see [[List of IP protocol numbers]]).}}
|-
;{{APHD|def|name=Hop Limit|length=8 bits|text=Replaces the [[time to live]] field in IPv4. This value is decremented by one at each forwarding node and the packet is discarded if it becomes 0. However, the destination node should process the packet normally even if received with a hop limit of 0.}}
! style="border-top: none" | [[Octet (computing)|Octet]]
;{{APHD|def|name=Source Address|length=128 bits|text=The unicast [[IPv6 address]] of the sending node.}}
! [[Bit]]
;{{APHD|def|name=Destination Address|length=128 bits|text=The IPv6 unicast or multicast address of the destination node(s).}}
! style="width:2.6%;"| 0
In order to increase performance, and since current [[link layer]] technology and transport layer protocols are assumed to provide sufficient error detection,{{Ref RFC|1726|section=2.6}} the header has no [[checksum]] to protect it.{{Ref RFC|8200}}
! style="width:2.6%;"| 1
! style="width:2.6%;"| 2
! style="width:2.6%;"| 3
! style="width:2.6%;"| 4
! style="width:2.6%;"| 5
! style="width:2.6%;"| 6
! style="width:2.6%;"| 7
! style="width:2.6%;"| 8
! style="width:2.6%;"| 9
! style="width:2.6%;"| 10
! style="width:2.6%;"| 11
! style="width:2.6%;"| 12
! style="width:2.6%;"| 13
! style="width:2.6%;"| 14
! style="width:2.6%;"| 15
! style="width:2.6%;"| 16
! style="width:2.6%;"| 17
! style="width:2.6%;"| 18
! style="width:2.6%;"| 19
! style="width:2.6%;"| 20
! style="width:2.6%;"| 21
! style="width:2.6%;"| 22
! style="width:2.6%;"| 23
! style="width:2.6%;"| 24
! style="width:2.6%;"| 25
! style="width:2.6%;"| 26
! style="width:2.6%;"| 27
! style="width:2.6%;"| 28
! style="width:2.6%;"| 29
! style="width:2.6%;"| 30
! style="width:2.6%;"| 31
|-
! 0
! 0
| colspan="4"|''Version''
| colspan="8"|''Traffic class''
| colspan="20"|''Flow label''
|-
! 4
! 32
| colspan="16"|''Payload length''
| colspan="8"|''Next header''
| colspan="8"|''Hop limit''
|-
! 8
! 64
| colspan="32" rowspan="4"|''Source address''
|-
! 12
! 96
|-
! 16
! 128
|-
! 20
! 160
|-
! 24
! 192
| colspan="32" rowspan="4"|''Destination address''
|-
! 28
! 224
|-
! 32
! 256
|-
! 36
! 288
|}
 
; ''Version'' (4 bits)
: The constant 6 (bit sequence <tt>0110</tt>).
; ''Traffic Class'' (6+2 bits)
: The bits of this field hold two values. The six most-significant bits hold the [[differentiated services field]] (DS field), which is used to classify packets.{{Ref RFC|2474}}{{Ref RFC|3260}} Currently, all standard DS fields end with a '0'&nbsp;bit. Any DS field that ends with two '1'&nbsp;bits is intended for local or experimental use.<ref name=rfc4727/>
: The remaining two bits are used for [[Explicit Congestion Notification]] (ECN);{{Ref RFC|3168}} priority values subdivide into ranges: traffic where the source provides congestion control and non-congestion control traffic.
; ''Flow Label'' (20 bits)
: A high-entropy identifier of a flow of packets between a source and destination. A flow is a group of packets, e.g., a TCP session or a media stream. The special flow label 0 means the packet does not belong to any flow (using this scheme). An older scheme identifies flow by source address and port, destination address and port, protocol (value of the last ''Next Header'' field).{{Ref RFC|6437}} It has further been suggested that the flow label be used to help detect spoofed packets.<ref>[http://tools.ietf.org/html/draft-blake-ipv6-flow-label-nonce-02 Use of the IPv6 Flow Label as a Transport-Layer Nonce to Defend Against Off-Path Spoofing Attacks]</ref>
; ''Payload Length'' (16 bits)
: The size of the payload in octets, including any extension headers. The length is set to zero when a ''Hop-by-Hop'' extension header carries a [[#Jumbogram|Jumbo Payload]] option.{{Ref RFC|2675}}
; ''Next Header'' (8 bits)
: Specifies the type of the next header. This field usually specifies the [[transport layer]] protocol used by a packet's payload. When extension headers are present in the packet this field indicates which extension header follows. The values are shared with those used for the IPv4 protocol field, as both fields have the same function (see [[List of IP protocol numbers]]).
; ''Hop Limit'' (8 bits)
: Replaces the [[time to live]] field in IPv4. This value is decremented by one at each forwarding node and the packet is discarded if it becomes 0. However, the destination node should process the packet normally even if received with a hop limit of 0.
; ''Source Address'' (128 bits)
: The unicast [[IPv6 address]] of the sending node.
; ''Destination Address'' (128 bits)
: The IPv6 unicast or multicast address of the destination node(s).
 
In order to increase performance, and since current [[link layer]] technology and transport layer protocols are assumed to provide sufficient error detection,<ref name=rfc1726>{{Cite IETF|rfc=1726|author=C. Partridge|author2=F. Kastenholz|date=December 1994|title=Technical Criteria for Choosing IP The Next Generation (IPng)|section=6.2}}</ref> the header has no [[checksum]] to protect it.<ref name=rfc8200/>
 
==Extension headers==
Line 125 ⟶ 36:
The defined extension headers below are listed in the preferred order for the case where there is more than one extension header following the fixed header.
 
:{| class="wikitable" <!-- Listed in order as recommended by RFC8200 -->
|-
! Extension header
Line 152 ⟶ 63:
| | 135 || Parameters used with [[Mobile IPv6]]
|-
| ''Host Identity Protocol'' || 139 || Used for [[Host Identity Protocol]] version 2 (HIPv2)<ref name=rfc7401>{{CiteRef IETFRFC|rfc=7401|title=Host Identity Protocol Version 2 (HIPv2)|editor=R. Moskowitz|author1=T. Heer|author2=P. Jokela|author3=T. Henderson|date=April 2015|publisher=[[Internet Engineering Task Force]] (IETF)|issn=2070-1721}}</ref>
|-
| ''Shim6 Protocol'' || 140 || Used for [[Shim6]]<ref name=rfc5533>{{CiteRef IETFRFC|rfc=5533|title=Shim6: Level 3 Multihoming Shim Protocol for IPv6|author1=E. Nordmark|author2=M. Bagnulo}}
|date=June 2009|publisher=Networking Working Group}}</ref>
|-
| Reserved || 253 || Used for experimentation and testing{{Ref RFC|3692}}{{Ref RFC|4727}}
| Reserved || 253 || Used for experimentation and testing<ref name=rfc3692>{{Cite IETF|rfc=3692|title=Assigning Experimental and Testing Numbers Considered Useful|author=T. Narten|date=January 2004|publisher=Network Working Group}} BCP 82. Updates RFC 2434.</ref><ref name=rfc4727>{{Cite IETF|rfc=4727|title=Experimental Values in IPv4, IPv6, ICMPv4, ICMPv6, UDP, and TCP Headers|author=B. Fenner|publisher=Network Working Group|date=November 2006}}</ref>
|-
| Reserved || 254 || Used for experimentation and testing<ref name=rfc3692/><ref name=rfc4727/>
Line 165 ⟶ 75:
 
===Hop-by-hop options and destination options===
{{anchor|hop-by-hop options|destination options}}
The ''Hop-by-Hop Options'' extension header may be examined and altered by all nodes on the packet's path, including sending and receiving nodes. (For authentication, option values that may change along the path are ignored.) The ''Destination Options'' extension header needs to be examined by the destination node(s) only. The extension headers are both at least 8 octets in size; if more options are present than will fit in that space, blocks of 8 octets, containing options and padding, are added to the header repeatedly until all options are represented.
{{APHD|start|title=''Hop-by-Hop Options'' and ''Destination Options'' extension header format}}
:{| class="wikitable" style="text-align: center"
{{APHD|0|bits1=8|bits2=8|bits3=16|field1=Next header|field2=Header extension length|field3=Options and padding}}
|+''Hop-by-Hop Options'' and ''Destination Options'' extension header format
{{APHD|4|bits1=32|field1=Options and padding}}
|-
{{APHD|8|bits1=0|background1=linen|field1=Optional: more Options and padding}}
! style="border-bottom:none; border-right:none;"| ''Offsets''
{{APHD|end}}
! style="border-left:none;"| Octet
;{{APHD|def|name=Next Header|length=8 bits|text=Specifies the [[List of IP protocol numbers|type]] of the next header.}}
! colspan="8" | 0
;{{APHD|def|name=Header extension length|length=8 bits|text=Length of this header in 8-octet units, not including the first 8 octets.}}
! colspan="8" | 1
;{{APHD|def|name=Options and padding|length=variable|text=Contains one or more options, and optional padding fields to align options and to make the total header length a multiple of 8 octets. Options are [[Type–length–value|TLV]]-coded.}}
! colspan="8" | 2
! colspan="8" | 3
|-
! style="border-top: none" | Octet
! Bit
! style="width:2.6%;"| 0
! style="width:2.6%;"| 1
! style="width:2.6%;"| 2
! style="width:2.6%;"| 3
! style="width:2.6%;"| 4
! style="width:2.6%;"| 5
! style="width:2.6%;"| 6
! style="width:2.6%;"| 7
! style="width:2.6%;"| 8
! style="width:2.6%;"| 9
! style="width:2.6%;"| 10
! style="width:2.6%;"| 11
! style="width:2.6%;"| 12
! style="width:2.6%;"| 13
! style="width:2.6%;"| 14
! style="width:2.6%;"| 15
! style="width:2.6%;"| 16
! style="width:2.6%;"| 17
! style="width:2.6%;"| 18
! style="width:2.6%;"| 19
! style="width:2.6%;"| 20
! style="width:2.6%;"| 21
! style="width:2.6%;"| 22
! style="width:2.6%;"| 23
! style="width:2.6%;"| 24
! style="width:2.6%;"| 25
! style="width:2.6%;"| 26
! style="width:2.6%;"| 27
! style="width:2.6%;"| 28
! style="width:2.6%;"| 29
! style="width:2.6%;"| 30
! style="width:2.6%;"| 31
|-
! 0
! 0
| colspan="8"|''Next header
| colspan="8"|''Header extension length
| colspan="16"|''Options and padding''
|-
! 4
! 32
| colspan="32"|''Options and padding''
|-
! 8
! 64
| colspan="32" rowspan=2|Optional: more ''Options and padding''
|-
! 12
! 96
|}
; ''Next Header'' (8 bits) : Specifies the [[List of IP protocol numbers|type]] of the next header.
; ''Header extension length'' (8 bits) : Length of this header in 8-octet units, not including the first 8 octets.
; ''Options and padding'' (variable) : Contains one or more options, and optional padding fields to align options and to make the total header length a multiple of 8 octets. Options are [[Type–length–value|TLV]]-coded.
 
===Routing===
The ''Routing'' extension header is used to direct a packet to one or more intermediate nodes before being sent to its destination. The header is at least 8 octets in size; if more ''Type-specific Data'' is needed than will fit in 4 octets, blocks of 8 octets are added to the header repeatedly, until all ''Type-specific Data'' is placed.<ref name=rfc8200/>
{{APHD|start|title=''Routing'' extension header format}}
:{| class="wikitable" style="text-align: center"
{{APHD|0|bits1=8|bits2=8|bits3=8|bits4=8|field1=Next header|field2=Header extension length|field3=Routing type|field4=Segments left}}
|+''Routing'' extension header format
{{APHD|4|bits1=32|field1=Type-specific data}}
|-
{{APHD|8|bits1=0|background1=linen|field1=Optional: more type-specific data...}}
! style="border-bottom:none; border-right:none;"| ''Offsets''
{{APHD|end}}
! style="border-left:none;"| Octet
;{{APHD|def|name=Next header|length=8 bits|text=Indicates the type of the next header.}}
! colspan="8" | 0
;{{APHD|def|name=Header extension length|length=8 bits|text=The length of this header, in multiples of 8 octets, not including the first 8 octets.}}
! colspan="8" | 1
;{{APHD|def|name=Routing type|length=8 bits|text=A value between 0 and 255, as assigned by [[IANA]].<ref name=iana_routing_options>{{Cite web|url=https://www.iana.org/assignments/ipv6-parameters/ipv6-parameters.xhtml|title=Internet Protocol Version 6 (IPv6) Parameters: Routing Types|publisher=[[IANA]]|access-date=2021-10-15}}</ref>}}
! colspan="8" | 2
! colspan="8" | 3
|-
! style="border-top: none" | Octet
! Bit
! style="width:2.6%;"| 0
! style="width:2.6%;"| 1
! style="width:2.6%;"| 2
! style="width:2.6%;"| 3
! style="width:2.6%;"| 4
! style="width:2.6%;"| 5
! style="width:2.6%;"| 6
! style="width:2.6%;"| 7
! style="width:2.6%;"| 8
! style="width:2.6%;"| 9
! style="width:2.6%;"| 10
! style="width:2.6%;"| 11
! style="width:2.6%;"| 12
! style="width:2.6%;"| 13
! style="width:2.6%;"| 14
! style="width:2.6%;"| 15
! style="width:2.6%;"| 16
! style="width:2.6%;"| 17
! style="width:2.6%;"| 18
! style="width:2.6%;"| 19
! style="width:2.6%;"| 20
! style="width:2.6%;"| 21
! style="width:2.6%;"| 22
! style="width:2.6%;"| 23
! style="width:2.6%;"| 24
! style="width:2.6%;"| 25
! style="width:2.6%;"| 26
! style="width:2.6%;"| 27
! style="width:2.6%;"| 28
! style="width:2.6%;"| 29
! style="width:2.6%;"| 30
! style="width:2.6%;"| 31
|-
! 0
! 0
| colspan="8"|''Next header''
| colspan="8"|''Header extension length''
| colspan="8"|''Routing type''
| colspan="8"|''Segments left''
|-
! 4
! 32
| colspan="32"|''Type-specific data''
|-
! 8
! 64
| colspan="32" rowspan="2"|Optional: more ''type-specific data''...
|-
! 12
! 96
|}
; ''Next header'' (8 bits): Indicates the type of the next header.
; ''Header extension length'' (8 bits): The length of this header, in multiples of 8 octets, not including the first 8 octets.
; ''Routing type'' (8 bits): A value between 0 and 255, as assigned by [[IANA]].<ref name=iana_routing_options>{{Cite web|url=https://www.iana.org/assignments/ipv6-parameters/ipv6-parameters.xhtml|title=Internet Protocol Version 6 (IPv6) Parameters: Routing Types|publisher=[[IANA]]|access-date=2021-10-15}}</ref>
:{| class="wikitable" style="text-align: left"
!| Type
Line 307 ⟶ 103:
| 0
| Deprecated
| Due to the fact that with Routing Header type 0 a simple but effective [[denial-of-service attack]] could be launched,<ref>{{cite web |url=http://www.secdev.org/conf/IPv6_RH_security-csw07.pdf |title=IPv6 Routing Header Security |author=Philippe Biondi, Arnoud Ebalard |date=April 2007 |publisher=[[EADS]] |quote=Type 0: the evil mechanism... |access-date=3 December 2010}}</ref> this header was deprecated in 2007 and host and routers are required to ignore these headers.<ref name=rfc5095>{{CiteRef IETFRFC|rfc=5095|author=J. Abley|author2=P. Savola|author3=G. Neville-Neil|date=December 2007|title=Deprecation of Type 0 Routing Headers in IPv6}}</ref>
|-
| 1
| Deprecated
| Used for the Nimrod project<ref name=rfc1992>{{CiteRef IETFRFC|rfc=1992|author=I. Castineyra|author2=N. Chiappa|author3=M. Steenstrup|date=August 1996|title=The Nimrod Routing Architecture}}</ref> funded by [[DARPA]]. It was deprecated in 2009.
|-
| 2
Line 319 ⟶ 115:
| 3
| Allowed
| RPL Source Route Header{{Ref RFC|6554}} for low-power and lossy networks.
| RPL Source Route Header<ref name=rfc6554>{{Cite IETF|rfc=6554|title=An IPv6 Routing Header for Source Routes with the Routing Protocol for Low-Power and Lossy Networks (RPL)|author1=J. Hui|author2=JP. Vasseur|author3=D. Culler|author4=V. Manral|publisher=[[Internet Engineering Task Force]] (IETF)|date=March 2012}}</ref> for low-power and lossy networks.
|-
| 4
| Allowed
| Segment Routing Header (SRH).{{Ref RFC|8754}}
| Segment Routing Header (SRH).<ref name=rfc8754>{{Cite IETF|rfc=8754|title=IPv6 Segment Routing Header (SRH)|editor1=C. Filsfils|editor2=D. Dukes|author1=S. Previdi|author2=J. Leddy|author3=S. Matsushima|author4=D. Voyer|publisher=[[Internet Engineering Task Force]] (IETF)|date=March 2020}}</ref>
|-
| 253 || Private use
Line 331 ⟶ 127:
| May be used for testing, not for actual implementations. ''RFC3692-style Experiment 2''.<ref name=rfc3692></ref>
|}
; ''{{APHD|def|name=Segments Left'' (|length=8 bits): |text=Number of nodes this packet still has to visit before reaching its final destination.}}
; ''{{APHD|def|name=Type-specific Data'' (|length=variable): |text=Data that belongs to this type of routing header.}}
 
===Fragment===
In order to send a packet that is larger than the path [[Maximum transmission unit|MTU]], the sending node splits the packet into fragments. The ''Fragment'' extension header carries the information necessary to reassemble the original (unfragmented) packet.<ref{{Ref name=rfc8200/>RFC|8200}}
{{APHD|start|title=''Fragment'' extension header format}}
:{| class="wikitable" style="text-align: center"
{{APHD|0|bits1=8|bits2=8|bits3=13|bits4=2|field1=Next Header|field2=Reserved|field3=Fragment offset|field4=Res|hint4=Reserved2|field5=M|hint5=M Flag}}
|+''Fragment'' extension header format
{{APHD|4|bits1=32|field1=Identification}}
|-
{{APHD|end}}
! style="border-bottom:none; border-right:none;"| ''Offsets''
;{{APHD|def|name=Next header|length=8 bits|text=Identifies the type of the next header.}}
! style="border-left:none;"| Octet
;{{APHD|def|name=Reserved|length=8 bits|constraint=Reserved == 0|text=Initialized to all zeroes.}}
! colspan="8" | 0
;{{APHD|def|name=Fragment offset|length=13 bits|text=Offset, in 8-octet units, relative to the start of the fragmentable part of the original packet.}}
! colspan="8" | 1
;{{APHD|def|name=Reserved2|short=Res|length=2 bits|constraint=Res == 0|text=Reserved; initialized to zeroes.}}
! colspan="8" | 2
;{{APHD|def|name=M Flag|short=M|length=1 bit|text=1 means more fragments follow; 0 means last fragment.}}
! colspan="8" | 3
;{{APHD|def|name=Identification|length=32 bits|text=Packet identification value, generated by the source node. Needed for reassembly of the original packet.}}
|-
! style="border-top: none" | Octet
! Bit
! style="width:2.6%;"| 0
! style="width:2.6%;"| 1
! style="width:2.6%;"| 2
! style="width:2.6%;"| 3
! style="width:2.6%;"| 4
! style="width:2.6%;"| 5
! style="width:2.6%;"| 6
! style="width:2.6%;"| 7
! style="width:2.6%;"| 8
! style="width:2.6%;"| 9
! style="width:2.6%;"| 10
! style="width:2.6%;"| 11
! style="width:2.6%;"| 12
! style="width:2.6%;"| 13
! style="width:2.6%;"| 14
! style="width:2.6%;"| 15
! style="width:2.6%;"| 16
! style="width:2.6%;"| 17
! style="width:2.6%;"| 18
! style="width:2.6%;"| 19
! style="width:2.6%;"| 20
! style="width:2.6%;"| 21
! style="width:2.6%;"| 22
! style="width:2.6%;"| 23
! style="width:2.6%;"| 24
! style="width:2.6%;"| 25
! style="width:2.6%;"| 26
! style="width:2.6%;"| 27
! style="width:2.6%;"| 28
! style="width:2.6%;"| 29
! style="width:2.6%;"| 30
! style="width:2.6%;"| 31
|-
! 0
! 0
| colspan="8"|''Next header''
| colspan="8"|''Reserved''
| colspan="13"|''Fragment offset''
| colspan="2"|''Res''
| colspan="1"|''M''
|-
! 4
! 32
| colspan="32"|''Identification''
|}
; ''Next header'' (8 bits): Identifies the type of the next header.
; ''Reserved'' (8 bits): Initialized to all zeroes.
; ''Fragment offset'' (13 bits): Offset, in 8-octet units, relative to the start of the fragmentable part of the original packet.
; ''Res'' (2 bits): Reserved; initialized to zeroes.
; ''M Flag'' (1 bit): 1 means more fragments follow; 0 means last fragment.
; ''Identification'' (32 bits): Packet identification value, generated by the source node. Needed for reassembly of the original packet.
 
===Authentication Header (AH) and Encapsulating Security Payload (ESP)===
The ''[[IPsec#Authentication Header|Authentication Header]]'' and the ''[[IPsec#Encapsulating Security Payload|Encapsulating Security Payload]]'' are part of [[IPsec]] and are used identically in IPv6 and in IPv4.{{Ref RFC|4302}}{{Ref RFC|4303}}
 
==Payload==
Line 410 ⟶ 153:
 
===Jumbogram===
 
{{See also|Jumbogram#IPv6 jumbograms}}
 
An optional feature of IPv6, the ''jumbo payload'' option in a ''Hop-By-Hop Options'' extension header,<ref name=rfc2675/> allows the exchange of packets with payloads of up to one octet less than 4{{nbsp}}[[Gigabyte|GB]] (2<sup>32</sup>{{nbsp}}−{{nbsp}}1{{nbsp}}= [[4294967295 (number)|{{Val|4294967295}}]] octets), by making use of a 32-bit length field. Packets with such payloads are called [[jumbogram]]s.
 
Since both [[Transmission Control Protocol|TCP]] and [[User Datagram Protocol|UDP]] include fields limited to 16&nbsp;bits (length, urgent data pointer), support for IPv6 jumbograms requires modifications to the transport layer protocol implementation.<ref name=rfc2675 /> Jumbograms are only relevant for links that have a [[maximum transmission unit|MTU]] larger than {{Val|65583}} octets <!-- The RFC mentions 65575 octets (payload + fixed header) but ignores the fact that you need a Hop-by-Hop extension header to enable payloads over 65535 octets. -->(more than {{Val|65535}} octets for the payload, plus 40 octets for the fixed header, plus 8 octets for the ''Hop-by-Hop'' extension header). Only a few link-layer protocols can process packets larger than {{Val|65535}} octets.{{Citation needed|date=July 2010}}
 
==Fragmentation==
Line 424 ⟶ 170:
The per-fragment headers are determined based on whether the original contains ''Routing'' or ''Hop-by-Hop'' extension header. If neither exists, the per-fragment part is just the fixed header. If the ''Routing'' extension header exists, the per-fragment headers include the fixed header and all the extension headers up to and including the ''Routing'' one. If the ''Hop-by-Hop'' extension header exists, the per-fragment headers consist of only the fixed header and the ''Hop-by-Hop'' extension header.
 
In any case, the last header of the per-fragment part has its ''Next Header'' value set to <tt>{{mono|44</tt>}} to indicate that a ''Fragment'' extension header follows. Each ''Fragment'' extension header has its ''M'' flag set to <tt>{{mono|1</tt>}} (indicating more fragments follow), except the last, whose flag is set to <tt>{{mono|0</tt>}}. Each fragment's length is a multiple of 8 octets, except, potentially, the last fragment.
 
The per-fragment headers were historically called the "unfragmentable part", referring to pre-2014 possibility of fragmenting the rest of the header. Now no headers are actually fragmentable.{{Ref RFC|7112}}
Line 435 ⟶ 181:
When reassembling node detects a fragment that overlaps with another fragment, the reassembly of the original packet is aborted and all fragments are dropped. A node may optionally ignore the exact duplicates of a fragment instead of treating exact duplicates as overlapping each other.<ref name=rfc8200 />
 
Receiving hosts must make a best-effort attempt to reassemble fragmented IP datagrams that, after reassembly, contain up to 1500 bytes. Hosts are permitted to make an attempt to reassemble fragmented datagrams larger than 1,500 bytes, but they are also permitted to silently discard any datagram after it becomes apparent that the reassembled packet would be larger than 1,500 bytes. Therefore, senders should avoid sending fragmented IP datagrams with a total reassembled size larger than 1,500 bytes, unless they have knowledge that the receiver is capable of reassembling such large datagrams.<!--[[User:Kvng/RTH]]-->
 
===Security===
Research has shown that the use of fragmentation can be leveraged to evade network security controls. As a result, in 2014 the earlier allowance for overflowing the IPv6 header chain beyond the first fragment became forbidden in order to avoid some very pathological fragmentation cases.<ref name=rfc7112/> Additionally, as a result of research on the evasion of Router Advertisement Guard,{{Ref RFC|7113}} the use of fragmentation with neighbor[[Neighbor discoveryDiscovery]] is deprecated, and the use of fragmentation with [[Secure Neighbor Discovery]] (SEND) is discouraged.{{Ref RFC|6980}}
 
==References==