Académique Documents
Professionnel Documents
Culture Documents
Yung-Chang Wong
ycwong@pu.edu.tw
Page 1
Contents
– Overview of Functionality
IPv6 Header Structure
Extension Headers
– IPv6 Addressing
– ICMPv6
– Stateless Address Auto-configuration
– Neighbor Discovery
Conceptual sending algorithm
Address Resolution
– Routing
– Interoperability
Page 2
1
Overview of Functionality
Page 3
Reference
Page 4
2
Main changes from IPv4 to IPv6
Page 5
0 16 31
Ver=4 IHL TOS Total length
Identification Flags Fragment offset
TTL Protocol Header checksum
Source address
Destination address
IP options
Payload
Page 6
3
IPv6 Header Structure
Payload
IPv6 header Extension header
(Upper layer protocol
(1) (*)
header and data)
• The IPv4 header can be extended from 20-40 bytes to specify options
such as Security Options, Source Routing, or Timestamping.
• This capacity are rarely been used because it causes a performance hit.
IPv4 hardware forwarding implementations have to pass the packet
containing options to the CPU (software handling)
• The current IPv6 specification (RFC 2460) defines 6 extension headers
Hop-by-Hop Options header
Routing header
Fragment header
Destination Options header
Authentication header (RFC 2402)
Encrypted Security Payload header (RFC 2406)
Page 7
0 4 12 16 24 31
Ver Traffic Class Flow Label
Payload Length Next Header Hop Limit
Source address Header checksum
Source address (ctn.)
Source address (ctn.)
Source address (ctn.)
Destination address
Destination address (ctn.)
Destination address (ctn.)
Destination address (ctn.)
Page 8
4
IPv6 Header Structure
0 4 12 16 24 31
Ver Traffic Class Flow Label
Payload Length Next Header Hop Limit • This field can be used
to identify and distinguish
Source address Header checksum between different classes
Source address (ctn.) or priorities of IPv6
packets.
Source address (ctn.)
• See RFC 2474 for
Source address (ctn.) details
Destination address
Destination address (ctn.)
Destination address (ctn.)
Destination address (ctn.)
Page 9
• A flow is unique identified by the flow label and the address of source node
• Routers keep track of flows and can process packets belonging to the same
flow more efficiently because they do not have to process each packet’s
header Page 10
5
IPv6 Header Structure
0 4 12 16 24 31
Ver Traffic Class Flow Label
Payload Length Next Header Hop Limit • The Length filed in IPv4
includes the length of
Source address Header checksum IPv4 header
Source address (ctn.) • The Payload Length
field in IPv6 contains
Source address (ctn.)
only the data following
Source address (ctn.) the IPv6 header.
Destination address
Destination address (ctn.)
Destination address (ctn.)
Destination address (ctn.)
X 9 9
IPv6 header Extension header Payload
(1) (*) (TCP header and data)
Page 11
6
IPv6 Header Structure
0 4 12 16 24 31
Ver Traffic Class Flow Label
Payload Length Next Header Hop Limit
Source address Header checksum
Source address (ctn.)
Source address (ctn.)
Source address (ctn.)
Destination address
Destination address (ctn.)
Destination address (ctn.)
Destination address (ctn.)
Extension Headers
Page 14
7
Extension Headers
Extension Headers
Header Ext.
• In unit of 8-byte, excluding
Length (1 byte)
the first 8 bytes
Options
Type Len Data
(variable)
• Contain one or more options
TLV-format
Page 16
8
Extension Headers
– Routing header
• Give a list of intermediate nodes that should be visited
on the packet’s path to its destination
Next Header
(1 byte)
• Identified type of routing header
Header Ext. • Currently type zero defined (RFC 2460)
Length (1 byte)
Routing type
• Number of listed nodes left
(1 byte)
until final destination
Segments left
(1 byte)
Type specific For type zero:
Type Len Data Reserved
Data (variable)
(4 bytes)
Extension Headers
9
Extension Headers
Next Header
(1 byte)
Header Ext.
Length (1 byte)
Options
Type Len Data
(variable)
Page 19
IPv6 Addressing
Page 20
10
Reference
Page 21
Contents
– Types of address
– Interface initialization
Page 22
11
Type of Addresses
– Unicast addresses
– Multicast addresses
– Anycast addresses
– Global-scope addresses
– Link-local addresses
– Site-local addresses (NAT-like)
– Interface (or node)-local addresses
Page 23
Scope value:
1 interface-local
2 link-local scope
3,4 unassigned
5 site-local scope
E global scope
F reserved
Page 24
12
Multicast Addresses (2)
Link-local, well-known:
Notes.
(1) xx:xxxx is the low-order 24 bits of the IPv6 address
Page 25
Interface Initialization
Page 26
13
ICMPv6
Page 27
Reference
Page 28
14
Contents
Page 29
ICMPv6
Page 30
15
General Message Format
Type
(1 byte)
Code
(1 byte)
Checksum
(2 byte)
Message body
Type Len Data
(variable)
Page 31
Page 32
16
General Message Format
Page 34
17
Message Format: Router Solicitation
IPv6 header
Type SIP= Source IP address, or the
133
(1 byte) unspecified address
Code DIP= FF02::2 (all-router MC address)
0 Hop limit= 255
(1 byte)
Checksum
(2 byte) Valid option:
• Source link-layer address. MUST
Reserved
NOT be included if the Source
Address is the unspecified
Message body
Type Len Data address
(variable)
Page 35
IPv6 header
SIP= Link-local source address
DIP= Source address of an invoking
Type
134 RS or FF02::1 (all-node MC address)
(1 byte)
Hop limit= 255
Code
0
(1 byte) Default value for hop count field
of the IP header for outgoing packets.
Checksum
A value of zero means unspecified.
(2 byte)
Current Hop Limit
M= Managed address configuration flag
(1 byte)
• Set: hosts use the stateful protocol
(1 byte) for address auto-configuration
MO
O= Other stateful configuration flag
• Set: hosts use the stateful protocol
for auto-configuration of other
information
Page 36
18
Message Format: Router Advertisement (2)
Options
(variable)
The time, in ms., between
Valid options: Neighbor Solicitation messages.
• Source link-layer address Used by address resolution and
• MTU NUD.
• Prefix Information for auto-cfg Page 37
Page 38
19
Message Format: Neighbor Solicitation (2)
IPv6 header
SIP= Source IP address, or ( if DAD
Type is in progress) the unspecified address
135 0:0:0:0:0:0:0:0
(1 byte)
DIP= solicited-node MC address corresponding
Code to the target, or the target address
0
(1 byte) Hop limit= 255
Checksum
(2 bytes) Valid option:
Reserved • Source link-layer address. MUST
(4 bytes) NOT be included when the Source
IP Address is the unspecified
Target IP address
address
(16 bytes)
Message body
Type Len Data
(variable)
Page 39
IPv6 header
SIP
Type DIP= solicited-node IP address, or
136 FF02::1 (all-node MC address)
(1 byte)
Hop limit= 255
Code
0
(1 byte)
• R (router flag): when set, the R-bit
Checksum
indicates the sender is a router
(2 bytes)
• S (solicited flag): when set, the S-bit
Reserved indicates that the ad. was sent in
R SO
(4 bytes) response to a NS from the Dest. Add.
• O (override flag): when set, O-bit indicates
that the ad. should override an existing
cache entry and update the cached
link-layer address
Page 40
20
Message Format: Neighbor Advertisement (2)
Target IP address
(16 bytes)
Valid option:
Message body • Target link-layer address. The
Type Len Data
(variable) link-layer address for the sender
of the advertisement
Page 41
– (skip)
Page 42
21
Option Format
Page 43
Valid lifetime
(4 bytes)
Length of time in seconds that the prefix
Is valid for on-link determination
Page 44
22
Option Format: Prefix (2)
Preferred
Lifetime (4 bytes)
Reserved2
(4 bytes)
Prefix
(16 bytes) Length of time in seconds that the address
generated from the prefix via stateless
AAC remain preferred
Page 45
Type
1/2
(1 byte)
In
Inunit
unitof
of88octets.
octets.For
Forexample,
example,the
the
Length
4 length
length for IEEE 802 addressesisis1.1.
for IEEE 802 addresses
(1 byte)
Link-layer
address
• Source LLA contains the link-layer address of the sender of the packet.
It is used in the NS, RS, and RA packets.
• Target LLA contains the link-layer address of the target. It is used in
NA and Redirect packets.
Page 46
23
Stateless Address
Autoconfiguration
Page 47
Reference
Page 48
24
Contents
– Terminology
– Procedure Overview
– Creation of Link-local Addresses
– Creation of Global-scope Addresses
– Duplicate Address Detection (DAD)
– Addresses Lifetime Expiry
– Configuration Consistency
Page 49
Terminology
Page 50
25
Procedure Overview
Page 51
Procedure Overview
invalid
Page 52
26
Procedure Overview
Page 53
Procedure Overview
Page 54
27
Creation of Link-local Address (1)
Page 55
Notes
– Link-local addresses are sufficient for allowing comm.
among nodes attached to the same link
– An interface ID should be less than 118 bits in length
– A link-local address is never timed out
Page 56
28
Creation of Global-scope Address (1)
host router
RS
RA
Valid combination:
M-bit T F F
– ManagedFlag Å M bit O-bit T T F
OtherConfigFlag Å O bit
• value changed from F to T: start the stateful AC protocol
• value changed from T to F: the change has no effect
Page 57
Page 58
29
Creation of Global-scope Address (3)
Notes
– A link-local has no routers if no RAs are received after
having sent a small number of RS as described in
RFC 2461
– In this case, stateful auto-configuration should be invoked
Page 59
Host A Nodes
NS (DAD)
IPv6 header
SIP= the unspecified address 0:0:0:0:0:0:0:0
Type 135 DIP= solicited-node MC address corresponding
to the target address
Code 0 Hop limit= 255
Notes. Before sending NS, an interface MUST join the all-nodes MC address
and the solicited-node MC address of the tentative address. Page 60
30
DAD: on receipt of a Response (1)
Page 61
Host A Host B
NS
NS
Page 62
31
DAD: on receipt of a Response (3)
Host A Host B
NS
NS (resolution)
Page 63
Host A Host B
NS
NA (un-solicited)
Page 64
32
Address Lifetime Expiry
– A deprecated address
• SHOULD continue to be used as a source address in
existing comm.
• SHOULD NOT be used in new comm. if an alternate
address is available
• IP and higher layers MUST continue to accepted
packets destined to the address
– An invalid address
• MUST NOT be used as a source/target address
Page 65
Configuration Consistency
Page 66
33
Neighbor Discovery
Page 67
Reference
Page 68
34
Contents
Page 69
Page 70
35
Conceptual Data Structure
Page 71
time
enter DELAY enter PROBE
state state & send a NS
36
Conceptual Data Structure
newly
created INCOMPLETE
ReachableTime
expire REACHABLE PROBE
DELAY_FIRST_PROBE_TIME
Receipt of a
expire
Unsolicited NA
STALE DELAY
a packet was
sent
Page 73
Page 74
37
Conceptual Data Structure
Prefix information in RA
L A
Prefix
Page 75
IPv6 header
Router Advertisement SIP= Link-local source address
Type 134
Lifetime associated with default router in
Router Lifetime units of seconds. (Max. 18.2 hrs)
Zero means not a default router.
Page 76
38
Conceptual Sending algorithm
Internet
router
sender
Page 77
Page 78
39
Address Resolution (1)
Target IP
B’s IP address
address
Type 1
Link-layer
A’s link-layer address
address
Page 79
– Response a solicited NA
• Create of update the Neighbor Cache entry for the
IP source address of the solicitation
IPv6 header
Node A Node B DIP= A’s IP address
NS Type 136
NA (solicited) Reserved R SO
Target IP
B’s IP address
address
Type 2
• R (router flag): when set, the R-bit
indicates the sender is a router Link-layer
Target’s (B’s) link-layer address
• S (solicited flag) = 1 address
• O (overriding) = 1
Page 80
40
Address Resolution (3)
– Receipt of NA
• Search N-cache for the target’s entry
• If no entry exists, the NA SHOULD be discarded
• Once entry e has been located,
9 If e.state = INCOMPLETE
record the LLA in N-cache
If NA.S = 1, e.state Å REACHABLE
else e.state Å STALE
e.IsRouter Å NA.R
9 (skip)
Node A Node B
NS
NA (solicited)
Page 81
Page 82
41
Un-solicited N-Advertisement (2)
– Receipt of unsolicited NA
• Search N-cache for the target’s entry e
• e.state = STALL
• If NA.O=1, update e with Target link-layer address
• If NA.O=0, ignore the new LLA address
Node A Node B
NA (un-solicited)
Page 83
42