RFC 6275
Mobility Support in IPv6
RFC 6275: Mobility Support in IPv6 โจ
Part 1 of 39
- Number: RFC 6275 ๐
- Title: Mobility Support in IPv6 ๐ฆ
- Authors: C. Perkins, Ed. (Tellabs, Inc.), D. Johnson (Rice University), J. Arkko (Ericsson) ๐
- Category: Standards Track ๐ฅ
- Date: July 2011 ๐ธ
- ISSN: 2070-1721 ๐
- Obsoletes: RFC 3775 ๐
Abstract โจ
okay so this doc specifies Mobile IPv6 ๐ง, which lets nodes stay reachable even while they're moving around the IPv6 Internet. ๐ Every mobile node is always identified by its home address, no matter where it's currently plugged in. ๐ When it's away from home, it also gets a care-of address, which tells you where it is right now. ๐
Packets sent to a mobile node's home address get transparently routed to its care-of address. ๐ช The protocol lets IPv6 nodes cache the binding between a mobile node's home address and its care-of address, so they can send packets straight to that care-of address. ๐น To make this work, Mobile IPv6 defines a new IPv6 protocol and a new destination option. ๐ Literally every IPv6 node, mobile or stationary, can talk to mobile nodes. ๐ซถ This document obsoletes RFC 3775. ๐
Status of This Memo โจ
This is an Internet Standards Track document. ๐ฅ
This document is a product of the Internet Engineering Task Force (IETF). ๐ It represents the consensus of the IETF community, it got public review, and the Internet Engineering Steering Group (IESG) approved it for publication. โ For more on Internet Standards, check out Section 2 of RFC 5741. ๐
For info on the current status of this document, any errata, and how to send feedback, go to http://www.rfc-editor.org/info/rfc6275. ๐
Copyright Notice ๐
Copyright (c) 2011 IETF Trust and the persons identified as the document authors. All rights reserved. ๐
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as they stand on the date this document was published. ๐ Please read these carefully, because they spell out your rights and restrictions for this document. ๐ Code Components pulled out of this document must include the Simplified BSD License text described in Section 4.e of the Trust Legal Provisions, and they come without warranty, as the Simplified BSD License describes. ๐งพ
This document may contain material from IETF Documents or IETF Contributions that were published or made publicly available before November 10, 2008. ๐ฆ The people who hold the copyright in some of that material may not have given the IETF Trust permission to allow modifications outside the IETF Standards Process. ๐ธ Unless you get an adequate license from those copyright holders, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside that process. โญ The one exceptions are formatting it for publication as an RFC, or translating it into languages other than English. ๐
Table of Contents ๐
1. Introduction ....................................................7
2. Comparison with Mobile IP for IPv4 ..............................8
3. Terminology .....................................................9
3.1. General Terms ..............................................9
3.2. Mobile IPv6 Terms .........................................11
4. Overview of Mobile IPv6 ........................................15
4.1. Basic Operation ...........................................15
4.2. New IPv6 Protocol .........................................17
4.3. New IPv6 Destination Option ...............................18
4.4. New IPv6 ICMP Messages ....................................19
4.5. Conceptual Data Structure Terminology .....................19
4.6. Unique-Local Addressability ...............................20
5. Overview of Mobile IPv6 Security ...............................20
5.1. Binding Updates to Home Agents ............................21
5.2. Binding Updates to Correspondent Nodes ....................22
5.2.1. Node Keys ..........................................22
5.2.2. Nonces .............................................23
5.2.3. Cookies and Tokens .................................23
5.2.4. Cryptographic Functions ............................24
5.2.5. Return Routability Procedure .......................24
5.2.6. Authorizing Binding Management Messages ............28
5.2.7. Updating Node Keys and Nonces ......................30
5.2.8. Preventing Replay Attacks ..........................32
5.2.9. Handling Interruptions to Return Routability .......32
5.3. Dynamic Home Agent Address Discovery ......................33
5.4. Mobile Prefix Discovery ...................................33
5.5. Payload Packets ...........................................33
6. New IPv6 Protocol, Message Types, and Destination Option .......34
6.1. Mobility Header ...........................................34
6.1.1. Format .............................................34
6.1.2. Binding Refresh Request Message ....................36
6.1.3. Home Test Init Message .............................37
6.1.4. Care-of Test Init Message ..........................38
6.1.5. Home Test Message ..................................39
6.1.6. Care-of Test Message ...............................41
6.1.7. Binding Update Message .............................42
6.1.8. Binding Acknowledgement Message ....................44
6.1.9. Binding Error Message ..............................47
6.2. Mobility Options ..........................................48
6.2.1. Format .............................................49
6.2.2. Pad1 ...............................................49
6.2.3. PadN ...............................................50
6.2.4. Binding Refresh Advice .............................50
6.2.5. Alternate Care-of Address ..........................51
6.2.6. Nonce Indices ......................................52
6.2.7. Binding Authorization Data .........................52
okay bestie, the map keeps going and it's giving a lot ๐บ๏ธโจ every section and page number is copied exactly so nothing gets lost ๐
6.3. Home Address Option .......................................54
6.4. Type 2 Routing Header .....................................55
6.4.1. Format .............................................56
6.5. ICMP Home Agent Address Discovery Request Message .........57
6.6. ICMP Home Agent Address Discovery Reply Message ...........58
6.7. ICMP Mobile Prefix Solicitation Message Format ............60
6.8. ICMP Mobile Prefix Advertisement Message Format ...........61
7. Modifications to IPv6 Neighbor Discovery .......................64
7.1. Modified Router Advertisement Message Format ..............64
7.2. Modified Prefix Information Option Format .................65
7.3. New Advertisement Interval Option Format ..................66
7.4. New Home Agent Information Option Format ..................67
7.5. Changes to Sending Router Advertisements ..................69
8. Requirements for Types of IPv6 Nodes ...........................71
8.1. All IPv6 Nodes ............................................71
8.2. IPv6 Nodes with Support for Route Optimization ............72
8.3. All IPv6 Routers ..........................................73
8.4. IPv6 Home Agents ..........................................74
8.5. IPv6 Mobile Nodes .........................................75
9. Correspondent Node Operation ...................................76
9.1. Conceptual Data Structures ................................76
9.2. Processing Mobility Headers ...............................78
9.3. Packet Processing .........................................78
9.3.1. Receiving Packets with Home Address Option .........78
9.3.2. Sending Packets to a Mobile Node ...................79
9.3.3. Sending Binding Error Messages .....................81
9.3.4. Receiving ICMP Error Messages ......................81
9.4. Return Routability Procedure ..............................82
9.4.1. Receiving Home Test Init Messages ..................82
9.4.2. Receiving Care-of Test Init Messages ...............82
9.4.3. Sending Home Test Messages .........................83
9.4.4. Sending Care-of Test Messages ......................83
9.5. Processing Bindings .......................................83
9.5.1. Receiving Binding Updates ..........................83
9.5.2. Requests to Cache a Binding ........................86
9.5.3. Requests to Delete a Binding .......................86
9.5.4. Sending Binding Acknowledgements ...................87
9.5.5. Sending Binding Refresh Requests ...................88
9.6. Cache Replacement Policy ..................................88
10. Home Agent Operation ..........................................89
10.1. Conceptual Data Structures ...............................89
10.2. Processing Mobility Headers ..............................90
10.3. Processing Bindings ......................................90
10.3.1. Primary Care-of Address Registration ..............90
10.3.2. Primary Care-of Address De-Registration ...........94
10.4. Packet Processing ........................................96
10.4.1. Intercepting Packets for a Mobile Node ............96
10.4.2. Processing Intercepted Packets ....................98
10.4.3. Multicast Membership Control ......................99
10.4.4. Stateful Address Autoconfiguration ...............100
10.4.5. Handling Reverse-Tunneled Packets ................100
10.4.6. Protecting Return Routability Packets ............101
10.5. Dynamic Home Agent Address Discovery ....................102
10.5.1. Receiving Router Advertisement Messages ..........102
10.6. Sending Prefix Information to the Mobile Node ...........104
10.6.1. List of Home Network Prefixes ....................104
10.6.2. Scheduling Prefix Deliveries .....................105
10.6.3. Sending Advertisements ...........................107
10.6.4. Lifetimes for Changed Prefixes ...................108
11. Mobile Node Operation ........................................108
11.1. Conceptual Data Structures ..............................108
11.2. Processing Mobility Headers .............................110
11.3. Packet Processing .......................................110
11.3.1. Sending Packets While Away from Home .............110
11.3.2. Interaction with Outbound IPsec Processing .......113
11.3.3. Receiving Packets While Away from Home ...........115
11.3.4. Routing Multicast Packets ........................117
11.3.5. Receiving ICMP Error Messages ....................118
11.3.6. Receiving Binding Error Messages .................119
11.4. Home Agent and Prefix Management ........................120
11.4.1. Dynamic Home Agent Address Discovery .............120
11.4.2. Sending Mobile Prefix Solicitations ..............121
11.4.3. Receiving Mobile Prefix Advertisements ...........121
11.5. Movement ................................................123
11.5.1. Movement Detection ...............................123
11.5.2. Home Link Detection ..............................125
11.5.3. Forming New Care-of Addresses ....................126
11.5.4. Using Multiple Care-of Addresses .................127
11.5.5. Returning Home ...................................127
11.6. Return Routability Procedure ............................130
11.6.1. Sending Test Init Messages .......................130
11.6.2. Receiving Test Messages ..........................131
11.6.3. Protecting Return Routability Packets ............132
11.7. Processing Bindings .....................................132
11.7.1. Sending Binding Updates to the Home Agent ........132
11.7.2. Correspondent Registration .......................135
11.7.3. Receiving Binding Acknowledgements ...............138
11.7.4. Receiving Binding Refresh Requests ...............140
11.8. Retransmissions and Rate Limiting .......................141
12. Protocol Constants ...........................................142
13. Protocol Configuration Variables .............................142
14. IANA Considerations ..........................................143
15. Security Considerations ......................................146
15.1. Threats .................................................146
15.2. Features ................................................148
15.3. Binding Updates to Home Agent ...........................150
15.4. Binding Updates to Correspondent Nodes ..................152
15.4.1. Overview .........................................153
15.4.2. Achieved Security Properties .....................153
15.4.3. Comparison to Regular IPv6 Communications ........154
15.4.4. Replay Attacks ...................................156
15.4.5. Denial-of-Service Attacks ........................156
15.4.6. Key Lengths ......................................157
15.5. Dynamic Home Agent Address Discovery ....................158
15.6. Mobile Prefix Discovery .................................159
15.7. Tunneling via the Home Agent ............................159
15.8. Home Address Option .....................................160
15.9. Type 2 Routing Header ...................................161
15.10. SHA-1 Secure Enough for Mobile IPv6 Control Messages ...161
16. Contributors .................................................162
17. Acknowledgements .............................................162
18. References ...................................................162
18.1. Normative References ....................................162
18.2. Informative References ..................................164
Appendix A. Future Extensions ....................................166
A.1. Piggybacking .............................................166
A.2. Triangular Routing .......................................166
A.3. New Authorization Methods ................................166
A.4. Neighbor Discovery Extensions ............................166
Appendix B. Changes since RFC 3775 ...............................167
1. Introduction โจ
okay so bestie, this doc is about letting nodes stay reachable while they're wandering around the IPv6 Internet ๐ฆ Without special mobility support in IPv6 [6], packets aimed at a mobile node just can't find it when it's away from its home link ๐ญ You could change its IP address every time it moves to a new link, but then it can't keep its transport and higher-layer connections alive when it changes location. Mobility support in IPv6 is a big deal, ngl, because mobile computers are likely to be a majority, or at least a substantial chunk, of the Internet's population during the lifetime of IPv6 ๐
Mobile IPv6 is the protocol defined here, and it lets a mobile node hop from one link to another without changing its "home address" ๐ Packets can still be routed to the node using that address, no matter where it's plugged in to the Internet. The mobile node can also keep talking to other nodes, stationary or mobile, after it moves. So moving away from its home link is totally transparent to transport and higher-layer protocols and applications. main character energy โจ
Mobile IPv6 is just as suitable for mobility across homogeneous media as it is for heterogeneous media ๐ For example, it helps a node move from one Ethernet segment to another just as well as it helps a node move from an Ethernet segment to a wireless LAN cell, and the mobile node's IP address stays the same through all of it ๐ซถ
You can think of Mobile IPv6 as solving the network-layer mobility management problem ๐ง Some mobility management stuff, like handover between wireless transceivers that each cover a super tiny geographic area, has already been solved with link-layer techniques ๐ธ For example, in lots of current wireless LAN products, link-layer mobility mechanisms let a mobile node "hand over" from one cell to another, re-establishing link-layer connectivity to the node in each new spot ๐ถ
Mobile IPv6 does NOT try to fix every problem that comes with mobile computers or wireless networks, lol ๐ Specifically, this protocol is not trying to solve:
- Handling links with unidirectional connectivity or partial reachability, such as the hidden terminal problem where a host is hidden from only some of the routers on the link.
- Access control on a link being visited by a mobile node.
- Local or hierarchical forms of mobility management (similar to many current link-layer mobility management solutions).
- Assistance for adaptive applications.
- Mobile routers.
- Service discovery.
- Distinguishing between packets lost due to bit errors versus network congestion.
This document obsoletes RFC 3775 ๐ Issues with the original document came up during the integration, testing, and deployment of RFC 3775, so this is the fix-up. A more detailed list of the changes since RFC 3775 can be found in Appendix B ๐
2. Comparison with Mobile IP for IPv4
okay this section is the glow-up story ๐ฅ Mobile IPv6 learned from the experiences gained while developing Mobile IP support in IPv4 (Mobile IPv4) [32] [25] [26], and it also got to use the opportunities IPv6 brings to the table โจ So Mobile IPv6 shares lots of features with Mobile IPv4, but it's built into IPv6 and has a bunch of other improvements. Here are the major differences between the two:
- There's no need to deploy special routers as "foreign agents", like in Mobile IPv4. Mobile IPv6 works in any location without any special support from the local router ๐ฆ
- Support for route optimization is a fundamental part of the protocol, instead of a nonstandard set of extensions ๐
- Mobile IPv6 route optimization can operate securely even without pre-arranged security associations. It's expected that route optimization can be deployed on a global scale between all mobile nodes and correspondent nodes ๐
- Support is also built into Mobile IPv6 so route optimization can coexist efficiently with routers that perform "ingress filtering" [27] ๐ซถ
- The IPv6 Neighbor Unreachability Detection makes sure there's symmetric reachability between the mobile node and its default router in the current location ๐
- Most packets sent to a mobile node while it's away from home in Mobile IPv6 use an IPv6 routing header instead of IP encapsulation, which cuts down the overhead compared to Mobile IPv4 ๐
- Mobile IPv6 is decoupled from any particular link layer, because it uses IPv6 Neighbor Discovery [18] instead of the Address Resolution Protocol (ARP). This also improves the robustness of the protocol ๐ช
- The use of IPv6 encapsulation (and the routing header) removes the need in Mobile IPv6 to manage "tunnel soft state" ๐ง
- The dynamic home agent address discovery mechanism in Mobile IPv6 returns a single reply to the mobile node. The directed broadcast approach used in IPv4 returns separate replies from each home agent ๐ธ
3. Terminology
the key words in this doc are "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL", and they're interpreted as described in RFC 2119 [2] ๐ Now let's get into the vocab ๐
3.1. General Terms
IP Internet Protocol Version 6 (IPv6). ๐
node A device that implements IP. ๐
router A node that forwards IP packets not explicitly addressed to itself. ๐
unicast routable address An identifier for a single interface such that a packet sent to it from another IPv6 subnet is delivered to the interface identified by that address. So a unicast routable address has to be either a global IPv6 address or a unique local IPv6 address ๐ฆ
host Any node that is not a router. ๐
link A communication facility or medium over which nodes can communicate at the link layer, such as an Ethernet (simple or bridged). A link is the layer immediately below IP ๐
interface A node's attachment to a link. ๐
subnet prefix A bit string that consists of some number of initial bits of an IP address. โจ
interface identifier A number used to identify a node's interface on a link. The interface identifier is the remaining low-order bits in the node's IP address after the subnet prefix ๐
link-layer address A link-layer identifier for an interface, such as IEEE 802 addresses on Ethernet links. ๐ท๏ธ
packet An IP header plus payload. ๐ฆ
security association An IPsec security association is a cooperative relationship formed by the sharing of cryptographic keying material and associated context. Security associations are simplex. That is, two security associations are needed to protect bidirectional traffic between two nodes, one for each direction ๐
security policy database A database that specifies what security services are to be offered to IP packets and in what fashion. ๐ก๏ธ
destination option Destination options are carried by the IPv6 Destination Options extension header. Destination options include optional information that need be examined only by the IPv6 node given as the destination address in the IPv6 header, not by routers in between. Mobile IPv6 defines one new destination option, the Home Address destination option (see Section 6.3) ๐
routing header A routing header may be present as an IPv6 header extension, and indicates that the payload has to be delivered to a destination IPv6 address in some way that is different from what would be carried out by standard Internet routing. In this document, use of the term "routing header" typically refers to use of a type 2 routing header, as specified in Section 6.4 ๐ฃ๏ธ
"|" (concatenation) Some formulas in this specification use the symbol "|" to indicate bytewise concatenation, as in A | B. This concatenation requires that all of the octets of the datum A appear first in the result, followed by all of the octets of the datum B ๐งฉ
First (size, input) Some formulas in this specification use a functional form First (size, input) to indicate truncation of the "input" data so that only the first "size" bits remain to be used โ๏ธ
3.2. Mobile IPv6 Terms
okay so these terms are meant to vibe with the definitions in RFC 3753 [40] ๐ but if they ever clash, these ones win. no debate ๐
home address ๐ก A unicast routable address given to a mobile node as its forever address ๐ It lives on the mobile node's home link, and normal IP routing will deliver packets aimed at it back to that home link. A mobile node can have more than one home address, for instance when the home link has multiple home prefixes ๐ธ
home subnet prefix ๐งญ The IP subnet prefix that matches a mobile node's home address โจ
home link ๐ The link where a mobile node's home subnet prefix is defined ๐ซถ
mobile node ๐ฆ A node that can switch its point of attachment from one link to another and still be reachable through its home address. main character energy, literally ๐
movement ๐ถโโ๏ธ A change in a mobile node's point of attachment to the Internet, so that it's no longer on the same link it was on before. If it isn't attached to its home link right now, it's said to be "away from home" ๐
Layer 2 (L2) handover ๐ถ The process where the mobile node swaps from one link-layer connection to another. Switching wireless access points is a classic example ๐
Layer 3 (L3) handover ๐ฅ This happens after an L2 handover, when the mobile node notices a change in an on-link subnet prefix that would force a change to its primary care-of address. Say it switches access routers after changing wireless access points. That usually means an L3 handover ๐ญ
correspondent node ๐ A peer node that the mobile node is talking to. The correspondent node might be mobile or stationary, no judgment ๐ง
foreign subnet prefix ๐ Any IP subnet prefix that isn't the mobile node's home subnet prefix ๐
foreign link โ๏ธ Any link that isn't the mobile node's home link ๐
care-of address ๐จ A unicast routable address that goes with a mobile node while it's visiting a foreign link. Its subnet prefix is a foreign subnet prefix. A mobile node can have several care-of addresses at once, maybe with different subnet prefixes, and the one registered with its home agent for a given home address is called its "primary" care-of address ๐
home agent ๐๏ธ A router on the mobile node's home link where the mobile node has registered its current care-of address. While the mobile node is away from home, the home agent grabs packets on the home link aimed at the mobile node's home address, wraps them up, and tunnels them to the registered care-of address. a true bestie ๐ซถ
binding ๐ The pairing of a mobile node's home address with a care-of address, plus how much lifetime that pairing has left โณ
registration ๐ The process where a mobile node sends a Binding Update to its home agent or a correspondent node, so a binding gets registered for it โจ
mobility message ๐จ A message that carries a Mobility Header (see Section 6.1) ๐ธ
binding authorization ๐ Correspondent registration has to be authorized, so the recipient can trust that the sender really has the right to set up a new binding ๐ซข
return routability procedure ๐ This procedure authorizes registrations through a cryptographic token exchange. it's giving security, periodt ๐
correspondent registration ๐ค A return routability procedure followed by a registration, run between the mobile node and a correspondent node ๐
home registration ๐ก A registration between the mobile node and its home agent, authorized by using IPsec ๐ก๏ธ
nonce ๐ฒ Nonces are random numbers the correspondent node uses internally when it creates keygen tokens for the return routability procedure. They aren't tied to any one mobile node, and they stay secret inside the correspondent node ๐คซ
nonce index ๐๏ธ A nonce index shows which nonces were used to create keygen token values, without giving away the nonces themselves ๐
cookie ๐ช A cookie is a random number that a mobile node uses to stop a bogus correspondent node from spoofing it during the return routability procedure ๐ซฃ
care-of init cookie ๐ช A cookie sent to the correspondent node in the Care-of Test Init message, to be sent back in the Care-of Test message ๐ซ
home init cookie ๐ช A cookie sent to the correspondent node in the Home Test Init message, to be sent back in the Home Test message ๐ซ
keygen token ๐ A keygen token is a number a correspondent node hands over in the return routability procedure. It lets the mobile node work out the binding management key it needs to authorize a Binding Update ๐ง
care-of keygen token ๐ A keygen token the correspondent node sends in the Care-of Test message ๐ท
home keygen token ๐ A keygen token the correspondent node sends in the Home Test message ๐ท
binding management key (Kbm) ๐๏ธ A binding management key (Kbm) is the key used to authorize a binding cache management message, like a Binding Update or a Binding Acknowledgement. Return routability gives you a way to make one ๐
4. Overview of Mobile IPv6 ๐ฆ
4.1. Basic Operation โจ
okay so bestie, a mobile node is always expected to be addressable at its home address ๐ , whether it's chilling on its home link or off wandering somewhere else ๐งณ. The home address is an IP address given to the mobile node inside its home subnet prefix on its home link. When the mobile node is at home, packets sent to that home address get routed to its home link the normal internet way ๐ .
When a mobile node is attached to some foreign link away from home, it's also addressable at one or more care-of addresses ๐. A care-of address is an IP address tied to the mobile node that has the subnet prefix of a particular foreign link. The mobile node can get its care-of address through regular IPv6 stuff, like stateless or stateful auto-configuration ๐ช. As long as it stays in that spot, packets sent to this care-of address get routed to the mobile node. It may also accept packets from several care-of addresses, like when it's moving but can still be reached at the previous link ๐โโ๏ธ๐จ.
The link between a mobile node's home address and its care-of address is called a "binding" ๐. While away from home, the mobile node registers its primary care-of address with a router on its home link, asking that router to be its "home agent" ๐ซถ. It does this registration by sending a "Binding Update" message to the home agent, and the home agent replies with a "Binding Acknowledgement" message ๐. The mobile node's behaviour is specified in Section 11, and the home agent's is specified in Section 10.
Any node talking to a mobile node is called a "correspondent node" of that mobile node ๐ฏ. A correspondent node can be a stationary node or a mobile node too ๐. Mobile nodes can share info about where they currently are with correspondent nodes, and this happens through the correspondent registration ๐. As part of that, a return routability test is run to authorize setting up the binding ๐ต๏ธโโ๏ธ. The correspondent node's behaviour is specified in Section 9.
There are two possible modes for talking between a mobile node and a correspondent node ๐. The first one is bidirectional tunneling. It doesn't need Mobile IPv6 support from the correspondent node, and it works even if the mobile node hasn't registered its current binding with that correspondent node ๐. Packets from the correspondent node get routed to the home agent and then tunneled to the mobile node. Packets going to the correspondent node get tunneled from the mobile node to the home agent ("reverse tunneled") and then routed normally from the home network to the correspondent node ๐. In this mode, the home agent uses proxy Neighbor Discovery to catch any IPv6 packets addressed to the mobile node's home address (or home addresses) on the home link ๐ธ๏ธ. Each caught packet gets tunneled to the mobile node's primary care-of address, and this tunneling uses IPv6 encapsulation [7] ๐ฆ.
The second mode is "route optimization" ๐๏ธ๐จ. It needs the mobile node to register its current binding at the correspondent node. Packets from the correspondent node can be routed directly to the mobile node's care-of address. When a correspondent node sends a packet to any IPv6 destination, it checks its cached bindings for an entry matching the packet's destination address ๐. If it finds a cached binding for that destination address, the node uses a new type of IPv6 routing header [6] (see Section 6.4) to route the packet to the mobile node by way of the care-of address in that binding ๐บ๏ธ.
Routing packets straight to the mobile node's care-of address gives the shortest communications path ๐ค๏ธ. It also takes the pressure off the mobile node's home agent and home link ๐ฎโ๐จ. On top of that, temporary failures of the home agent, or of networks on the path to or from the home agent, have less impact ๐ก๏ธ.
When packets are routed directly to the mobile node, the correspondent node sets the Destination Address in the IPv6 header to the mobile node's care-of address ๐ฏ. A new type of IPv6 routing header (see Section 6.4) also gets added to the packet to carry the desired home address ๐ผ. In the other direction, the mobile node sets the Source Address in the packet's IPv6 header to its current care-of address ๐ชช. The mobile node also adds a new IPv6 "Home Address" destination option (see Section 6.3) to carry its home address ๐ท๏ธ. Because the home addresses are in these packets, the care-of address stays transparent above the network layer (for example, at the transport layer) ๐ฅฐ.
Mobile IPv6 also supports multiple home agents, plus a limited amount of reconfiguration for the home network ๐๏ธ. In these cases, the mobile node might not know the IP address of its own home agent, and the home subnet prefixes might change over time ๐. A mechanism called "dynamic home agent address discovery" lets a mobile node find the IP address of a home agent on its home link, even when it's away from home ๐. Mobile nodes can also learn new info about home subnet prefixes through the "mobile prefix discovery" mechanism ๐. These mechanisms are described starting in Section 6.5.
This document assumes the mobile node is configured with the home prefix, so it can discover a home agent and configure a home address ๐งฉ. That could be limiting in deployments where the home agent and the mobile node's home address need to be assigned dynamically ๐ฌ. Extra mechanisms have been specified so the mobile node can dynamically configure a home agent, a home address, and the home prefix ๐ฑ. These are described in "Mobile IPv6 Bootstrapping in Split Scenario" [22] and "MIP6-bootstrapping for the Integrated Scenario" [36] ๐.
4.2. New IPv6 Protocol ๐ง
Mobile IPv6 defines a new IPv6 protocol, using the Mobility Header (see Section 6.1) ๐. This header carries the following messages:
Home Test Init
Home Test
Care-of Test Init
Care-of Test
These four messages do the return routability procedure from the mobile node to a correspondent node ๐ต๏ธโโ๏ธ. That's what makes sure later Binding Updates are authorized, as described in Section 5.2.5 โ .
Binding Update ๐: A Binding Update is how a mobile node tells a correspondent node or its home agent about its current binding. A Binding Update sent to the home agent to register the primary care-of address gets marked as a "home registration" ๐ .
Binding Acknowledgement ๐: A Binding Acknowledgement acknowledges receipt of a Binding Update, but only if an acknowledgement was requested in that Binding Update (for example, when it was sent to a home agent), or when an error happened ๐โโ๏ธ.
Binding Refresh Request ๐: A correspondent node uses a Binding Refresh Request to ask a mobile node to re-establish its binding with that correspondent node. This is usually used when the cached binding is still in active use but its lifetime is almost up โณ. The correspondent node might look at things like recent traffic and open transport layer connections as signs of active use ๐.
Binding Error ๐จ: The correspondent node uses the Binding Error to signal a mobility-related error, like an inappropriate attempt to use the Home Address destination option without an existing binding ๐ค. The home agent also uses the Binding Error to signal an error to the mobile node if it gets an unrecognized Mobility Header Message Type from that mobile node ๐ โโ๏ธ.
4.3. New IPv6 Destination Option ๐
Mobile IPv6 defines a new IPv6 destination option, the Home Address destination option. It's described in detail in Section 6.3 ๐.
4.4. New IPv6 ICMP Messages ๐ก
Mobile IPv6 also brings four new ICMP message types ๐. Two are for the dynamic home agent address discovery mechanism, and two are for renumbering and mobile configuration. As described in Sections 10.5 and 11.4.1, these two new ICMP message types are used for home agent address discovery:
- Home Agent Address Discovery Request, described in Section 6.5.
- Home Agent Address Discovery Reply, described in Section 6.6.
The next two message types are for network renumbering and address configuration on the mobile node, as described in Section 10.6 ๐ง:
- Mobile Prefix Solicitation, described in Section 6.7.
- Mobile Prefix Advertisement, described in Section 6.8.
4.5. Conceptual Data Structure Terminology ๐ง
This document describes the Mobile IPv6 protocol using these conceptual data structures ๐๏ธ:
Binding Cache ๐๏ธ: This is a cache of bindings for other nodes, maintained by home agents and correspondent nodes. It holds both "correspondent registration" entries (see Section 9.1) and "home registration" entries (see Section 10.1) ๐ .
Binding Update List ๐: Each mobile node maintains this list. It has an item for every binding the mobile node has or is trying to set up with a specific other node. Both correspondent and home registrations are in this list. Entries get deleted as the lifetime of the binding expires โ. See Section 11.1.
Home Agents List ๐ก: Home agents need to know which other home agents are on the same link ๐ญ. That info is stored in the Home Agents List, as described in more detail in Section 10.1. The list is used to inform mobile nodes during dynamic home agent address discovery ๐ฃ.
4.6. Unique-Local Addressability ๐ช
Okay, this part is kind of a big deal ๐ญ. This specification says home and care-of addresses MUST be unicast routable addresses ๐ซ. Unique-local IPv6 unicast addresses (ULAs, RFC 4193 [15]) may be usable on networks that use these non-globally routable addresses, but this specification doesn't define when that's safe and when it isn't ๐คทโโ๏ธ. Mobile nodes might not be able to tell their home site apart from the site they're currently at ๐ซ . That makes it hard to stop accidental attachment to other sites. The mobile node might use a ULA at another site, and that ULA couldn't be used to successfully send packets to the mobile node's home agent (HA) ๐. The result is unreachability between the mobile node (MN) and the HA when unique-local IPv6 routable addresses are used as care-of addresses ๐ต. Similarly, CNs outside the MN's own site won't be reachable when ULAs are used as home addresses ๐ โโ๏ธ.
So, unique-local IPv6 unicast addresses SHOULD NOT be used as home or care-of addresses when other address choices are available ๐. If they are used anyway, RFC 4193 [15] says they get treated like any global unicast IPv6 address ๐. For the rest of this specification, using unique-local IPv6 unicast addresses isn't differentiated from other globally unique IPv6 addresses ๐.
5. Overview of Mobile IPv6 Security โจ
okay bestie, this is the security section and it is SO important ๐๐ Mobile IPv6 has a bunch of protections: Binding Updates are protected both when they go to home agents and when they go to correspondent nodes, mobile prefix discovery is protected, and the mechanisms that carry payload packets are protected too ๐ฆ
Binding Updates get protected with IPsec extension headers, or with the Binding Authorization Data option. That option uses a binding management key, Kbm, which can be set up through the return routability procedure ๐ Mobile prefix discovery is protected with IPsec extension headers ๐ก๏ธ And the payload-carrying bits, like the Home Address destination option and the type 2 routing header, were designed so they can't be easily abused in attacks ๐
5.1. Binding Updates to Home Agents ๐
The mobile node and the home agent MUST use an IPsec security association to protect the integrity and authenticity of the Binding Updates and Acknowledgements. Both the mobile nodes and the home agents MUST support and SHOULD use the Encapsulating Security Payload (ESP) [5] header in transport mode, and MUST use a non-NULL payload authentication algorithm to provide data origin authentication, connectionless integrity, and optional anti-replay protection ๐ Authentication Header (AH) [4] is also possible, but this specification doesn't cover it, for brevity ๐
To protect the messages between the mobile node and the home agent with IPsec, you have to create the right security policy database entries ๐ A mobile node must not be able to use its security association to send a Binding Update on behalf of another mobile node that uses the same home agent ๐ซ This MUST be achieved by having the home agent check that the given home address has been used with the right security association. The IPsec processing does this check: the security policy database entries unequivocally identify a single security association for protecting Binding Updates between any given home address and home agent ๐ฏ For this to work, the home address of the mobile node has to be visible in the Binding Updates and Acknowledgements. It shows up in these packets as a source or destination, or inside the Home Address destination option or the type 2 routing header ๐
As with all IPsec security associations in this specification, manual configuration of security associations MUST be supported. The shared secrets MUST be random and unique for different mobile nodes, and MUST be distributed off-line to the mobile nodes ๐ Automatic key management with the Internet Key Exchange Protocol version 2 (IKEv2) [24] MAY be supported, as described in [20] ๐ธ
Section 11.3.2 talks about how IKEv2 connections to the home agent need careful handling of the addresses used to transport IKEv2. This matters because a Binding Update must not be needed before the IKEv2 exchange that secures the Binding Update itself ๐
If you want more detailed descriptions and examples of using IPsec to protect communication between the mobile node and the home agent, they've been published in [12][20] ๐
5.2. Binding Updates to Correspondent Nodes ๐
Protecting Binding Updates sent to correspondent nodes doesn't need any security associations to be configured, and it doesn't need an authentication infrastructure between the mobile nodes and correspondent nodes ๐ Instead, a method called the return routability procedure makes sure the right mobile node is the one sending the message ๐ฌ This method doesn't protect against attackers who sit on the path between the home network and the correspondent node. Honestly though, attackers in that spot can already do the same attacks without Mobile IPv6 ๐คทโโ๏ธ The big win is that return routability limits the potential attackers to those with access to one specific path in the Internet, and it stops forged Binding Updates from anywhere else in the Internet ๐ For a deeper look at the security properties of the return routability procedure, see Section 15. Also, consult [43] ๐
The integrity and authenticity of Binding Update messages sent to correspondent nodes are protected with a keyed-hash algorithm ๐ The binding management key, Kbm, keys the hash algorithm for this purpose, and Kbm is established using data exchanged during the return routability procedure ๐๏ธ That data exchange uses node keys, nonces, cookies, tokens, and certain cryptographic functions ๐ง Section 5.2.5 outlines the basic return routability procedure, and Section 5.2.6 shows how the results of that procedure are used to authorize a Binding Update to a correspondent node โ
5.2.1. Node Keys ๐๏ธ
Each correspondent node has a secret key, Kcn, called the "node key" ๐คซ It uses this key to produce the keygen tokens that get sent to the mobile nodes. The node key MUST be a random number, 20 octets in length ๐ฒ The node key lets the correspondent node check that the keygen tokens a mobile node uses to authorize a Binding Update really are its own tokens ๐ This key MUST NOT be shared with any other entity ๐ซ
A correspondent node MAY generate a fresh node key at any time, which means it doesn't need secure persistent key storage ๐พ How to optionally update the node key is covered later, in Section 5.2.7 ๐
5.2.2. Nonces ๐ฒ
Each correspondent node also generates nonces at regular intervals โฐ The nonces should be generated with a random number generator that is known to have good randomness properties [14] ๐ A correspondent node may use the same Kcn and nonce with all the mobile nodes it's talking to ๐ซถ
Each nonce is identified by a nonce index ๐ท๏ธ When a new nonce is generated, it must get a new nonce index. For example, you could do this by incrementing the previous nonce index, if the nonce index works as an array pointer into a linear array of nonces ๐ But there's no requirement that nonces be stored that way, and no requirement that subsequent nonce indices have any particular relationship to each other ๐คทโโ๏ธ The index value is communicated in the protocol, so if a nonce gets replaced by a new one during a protocol run, the correspondent node can tell apart messages that should be checked against the old nonce from messages that should be checked against the new nonce ๐งฉ Strictly speaking, indices aren't needed for the authentication itself, but they let the correspondent node quickly find the nonce value it used when it created a keygen token ๐โโ๏ธ
Correspondent nodes keep the current nonce and a small set of valid previous nonces whose lifetime hasn't expired yet ๐ฆ Expired values MUST be discarded, and messages that use stale or unknown indices will be rejected ๐๏ธ
The specific nonce index values can't be used by mobile nodes to figure out whether a nonce is still valid ๐ โโ๏ธ The expected validity times for the nonce values, and the procedures for updating them, are discussed later in Section 5.2.7 โณ
A nonce is an octet string of any length ๐งต The recommended length is 64 bits ๐
5.2.3. Cookies and Tokens ๐ช
The return routability address test procedure uses cookies and keygen tokens as opaque values inside the test init and test messages, respectively ๐ซง
- The "home init cookie" and "care-of init cookie" are 64-bit values. They're sent to the correspondent node from the mobile node, and then sent back to the mobile node later. The home init cookie goes in the Home Test Init message and comes back in the Home Test message. The care-of init cookie goes in the Care-of Test Init message and comes back in the Care-of Test message ๐
- The "home keygen token" and "care-of keygen token" are 64-bit values that the correspondent node sends to the mobile node. The home keygen token goes via the home agent (inside the Home Test message), and the care-of keygen token goes to the care-of address (inside the Care-of Test message) ๐
The mobile node should set the home init or care-of init cookie to a newly generated random number in every Home or Care-of Test Init message it sends ๐ฐ The cookies are used to check that a Home Test or Care-of Test message matches the Home Test Init or Care-of Test Init message it answers. They also make sure that parties who never saw the request can't spoof responses ๐ต๏ธโโ๏ธโจ
Home and care-of keygen tokens are produced by the correspondent node from its currently active secret key (Kcn) and nonces, plus the home or care-of address (respectively) ๐ง A keygen token stays valid for as long as both the secret key (Kcn) and the nonce used to create it are valid โณ
5.2.4. Cryptographic Functions ๐งฎ
By default in this specification, the hash function is SHA-1 [11]. The spec considers that good enough protection for Mobile IPv6 control messages (see Section 15.10) ๐ซถ Message Authentication Codes (MACs) are then computed with HMAC_SHA1 [1][11]. HMAC_SHA1(K,m) is how we write a MAC computed over message m with key K ๐ (iykyk, it's the notation that shows up everywhere in the keygen math ๐ค)
5.2.5. Return Routability Procedure ๐ฆ
okay so the return routability procedure is the correspondent node's way of asking "wait, are you actually where you say you are?" ๐ต๏ธโโ๏ธ It gives the correspondent node some reasonable assurance that the mobile node can be reached at its claimed care-of address AND at its home address. And this matters a LOT, because the correspondent node only accepts Binding Updates from the mobile node after this check passes. Those Binding Updates are what tell it to send that mobile node's data traffic over to the claimed care-of address, so no shortcuts allowed bestie ๐
So how does the check work? The correspondent node sends data (the "keygen tokens") to both of those claimed addresses, and the mobile node can only pass if it can prove it actually received them ๐ง The mobile node then mixes those tokens together into a binding management key, which is called Kbm. Think of Kbm as the secret handshake that comes out of the whole process โจ
Here's the message flow for the return routability procedure:
Mobile node Home agent Correspondent node
| |
| Home Test Init (HoTI) | |
|------------------------->|------------------------->|
| | |
| Care-of Test Init (CoTI) |
|---------------------------------------------------->|
| |
| | Home Test (HoT) |
|<-------------------------|<-------------------------|
| | |
| Care-of Test (CoT) |
|<----------------------------------------------------|
| |
The Home Test Init and Care-of Test Init messages get sent at the same time ๐ธ The whole procedure is super light on the correspondent node's side, so the Home Test and Care-of Test messages can come back really fast, maybe almost at the exact same moment. These four messages together make up the return routability procedure, and honestly it's giving efficiency ๐ญ๐ฅ
Home Test Init
A mobile node sends a Home Test Init message to the correspondent node (going via the home agent) to get the home keygen token. Here's the vibe of what's inside:
- Source Address = home address
- Destination Address = correspondent
- Parameters:
- home init cookie
So the Home Test Init message tells the correspondent node the mobile node's home address. The mobile node also tucks in a home init cookie that the correspondent node has to send back later ๐ The message gets reverse tunneled through the home agent. (The headers and addresses for reverse tunneling were left out of the stuff above, so don't panic if they're missing ๐) The mobile node holds onto these cookie values, which gives it some assurance that its protocol messages are being handled by the correspondent node it actually wanted. Main character energy for sure ๐
Care-of Test Init
The mobile node sends a Care-of Test Init message straight to the correspondent node (NOT via the home agent) to get the care-of keygen token. The contents look like this:
- Source Address = care-of address
- Destination Address = correspondent
- Parameters:
- care-of init cookie
This message tells the correspondent node the mobile node's care-of address, and it comes with a care-of init cookie that the correspondent node must return later ๐ฆ And it goes directly to the correspondent node, no detours!
Home Test
The Home Test message is the reply to a Home Test Init message ๐ It gets sent via the home agent, and its contents are:
- Source Address = correspondent
- Destination Address = home address
- Parameters:
- home init cookie
- home keygen token
- home nonce index
When the correspondent node gets the Home Test Init message, it makes a home keygen token like this:
home keygen token :=
First (64, HMAC_SHA1 (Kcn, (home address | nonce | 0)))
Where | means concatenation. That final "0" inside the HMAC_SHA1 function is a single zero octet, and its whole job is to tell home cookies apart from care-of cookies ๐ง
The home keygen token is made from the first 64 bits of the MAC. It checks that the mobile node can receive messages sent to its home address. Kcn is used to make the home keygen token, and this is the clever part: it lets the correspondent node verify that IT generated the home and care-of nonces, WITHOUT having to remember a list of every token it ever handed out. No giant memory hoard needed, iconic ๐ โจ
The Home Test message gets sent to the mobile node through the home network, and the home agent is presumed to tunnel it over to the mobile node. That means the mobile node already needs to have sent a Binding Update to the home agent. That way the home agent has already received and authorized the new care-of address before the return routability procedure starts ๐ซถ For extra security, the data passed between the home agent and the mobile node is made immune to inspection and passive attacks. That protection comes from encrypting the home keygen token as it gets tunneled from the home agent to the mobile node, as specified in Section 10.4.6. The security properties of this extra protection are discussed in Section 15.4.1, so go check those out if you're a security nerd like me ๐๐
The home init cookie from the mobile node comes back in the Home Test message. This makes sure the message really came from a node on the route between the home agent and the correspondent node ๐
The home nonce index is delivered to the mobile node so that, later on, the correspondent node can quickly find the nonce value it used to create the home keygen token ๐
Care-of Test
This message is the reply to a Care-of Test Init message. It is NOT sent via the home agent. It goes directly to the mobile node ๐ Its contents are:
- Source Address = correspondent
- Destination Address = care-of address
- Parameters:
- care-of init cookie
- care-of keygen token
- care-of nonce index
When the correspondent node receives the Care-of Test Init message, it makes a care-of keygen token like this:
care-of keygen token :=
First (64, HMAC_SHA1 (Kcn, (care-of address | nonce | 1)))
Here, the final "1" inside the HMAC_SHA1 function is a single octet holding the hex value 0x01, and it's used to tell home and care-of cookies apart ๐ The keygen token is made from the first 64 bits of the MAC and sent straight to the mobile node at its care-of address. The care-of init cookie from the Care-of Test Init message gets returned too, so the mobile node knows the message came from a node on the route to the correspondent node ๐ธ
The care-of nonce index tells the mobile node which nonce was used for the care-of keygen token. The home and care-of nonce indices MAY be the same, or they MAY be different, in the Home and Care-of Test messages ๐
Once the mobile node has received BOTH the Home Test and Care-of Test messages, the return routability procedure is complete ๐ At that point the mobile node has everything it needs to send a Binding Update to the correspondent node. It hashes the two tokens together to make a 20-octet binding key Kbm:
Kbm = SHA-1 (home keygen token | care-of keygen token)
A Binding Update can also be used to delete a binding that was already set up (Section 6.1.7). In that case the care-of keygen token is NOT used. Instead, the binding management key is made like this:
Kbm = SHA-1(home keygen token)
Also, the correspondent node doesn't create any state for the mobile node until it gets the Binding Update from that mobile node ๐ It also doesn't store the binding management key Kbm. It just creates Kbm again whenever it's given the nonce indices and the mobile node's addresses. Stateless and slay โจ๐งโโ๏ธ
5.2.6. Authorizing Binding Management Messages โจ
okay so once the mobile node has made its binding management key (Kbm) ๐, it can finally send a verifiable Binding Update to the correspondent node ๐. this section is the quick tour of that handshake, and the diagram below shows who sends what, in what order ๐ฆ
Mobile node Correspondent node
| |
| Binding Update (BU) |
|---------------------------------------------->|
| (MAC, seq#, nonce indices, care-of address) |
| |
| |
| Binding Acknowledgement (BA) (if sent) |
|<----------------------------------------------|
| (MAC, seq#, status) |
Binding Update ๐
so to authorize a Binding Update, the mobile node builds Kbm from the keygen tokens we just covered in the last section ๐ง the Binding Update is packed with the following goodies:
- Source Address = care-of address
- Destination Address = correspondent
- Parameters:
- home address (inside the Home Address destination option if it's different from the Source Address)
- sequence number (inside the Binding Update message header)
- home nonce index (inside the Nonce Indices option)
- care-of nonce index (inside the Nonce Indices option)
- First (96,
HMAC_SHA1 (Kbm, (care-of address | correspondent | BU)))
the Binding Update carries a Nonce Indices option, which tells the correspondent node exactly which home and care-of nonces to use when it recomputes Kbm, the binding management key ๐ฅ the MAC gets computed as described in Section 6.2.7, with the correspondent node's address as the destination address, and the Binding Update message itself (that's the "BU" up above) as the Mobility Header (MH) Data ๐
once the correspondent node has checked the MAC, it can make a Binding Cache entry for the mobile ๐
Binding Acknowledgement ๐ธ
sometimes the correspondent node acknowledges the Binding Update, and when it does, the message looks like this:
- Source Address = correspondent
- Destination Address = care-of address
- Parameters:
- sequence number (inside the Binding Update message header)
- First (96,
HMAC_SHA1 (Kbm, (care-of address | correspondent | BA)))
the Binding Acknowledgement uses the same sequence number as the Binding Update ๐ the MAC is computed as described in Section 6.2.7, with the correspondent node's address as the destination address, and the message itself (that's the "BA" up above) as the MH Data ๐
bindings made with correspondent nodes using keys from the return routability procedure MUST NOT exceed MAX_RR_BINDING_LIFETIME seconds (see Section 12). no cap, that's a hard limit ๐ซ
the Source Address in the IPv6 header of the Binding Update is usually the same care-of address that goes into the binding โจ but a different care-of address MAY be specified by adding an Alternate Care-of Address mobility option to the Binding Update (see Section 6.2.5). when a message like that goes to the correspondent node and return routability is the authorization method, the Care-of Test Init and Care-of Test messages MUST have been performed for the address in the Alternate Care-of Address option (not the Source Address) ๐ญ the nonce indices and MAC value MUST be based on information gained in this test ๐ซถ
also, Binding Updates can be used to delete a binding that already exists ๐๏ธ in that case, the binding management key comes purely from the home keygen token, and the care-of nonce index gets ignored ๐
5.2.7. Updating Node Keys and Nonces ๐
correspondent nodes make new nonces at regular intervals โฐ it is recommended to keep each nonce (identified by a nonce index) acceptable for at least MAX_TOKEN_LIFETIME seconds (see Section 12) after it's first used to build a return routability message response ๐ท but the correspondent node MUST NOT accept nonces beyond MAX_NONCE_LIFETIME seconds (see Section 12) after that first use ๐ซ the gap between those two constants is 30 seconds, so the easiest way to enforce both lifetimes is to generate a new nonce every 30 seconds ๐ง the node can then keep accepting tokens based on the last 8 (MAX_NONCE_LIFETIME / 30) nonces. the result is that tokens stay acceptable from MAX_TOKEN_LIFETIME to MAX_NONCE_LIFETIME seconds after they were sent to the mobile node, depending on whether the token went out at the start or the end of that first 30-second period ๐ฆ
the correspondent node can also generate new nonces on demand, or only once the old ones have actually been used ๐ง that works, as long as the node keeps track of how long ago each nonce was first used, and doesn't make a fresh nonce for every single return routability request ๐
because of resource limits, quick binding deletions, or reboots, the correspondent node might not recognize the nonces the tokens were based on ๐ฌ if a nonce index isn't recognized, the correspondent node answers with an error code in the Binding Acknowledgement (either 136, 137, or 138, as discussed in Section 6.1.8) ๐ the mobile node can then just retry the return routability procedure ๐
an update of Kcn SHOULD be done at the same time as an update of a nonce, so that a nonce index can identify both the nonce and the key ๐ which means old Kcn values have to be remembered for as long as the old nonce values are ๐งก
since tokens are normally expected to be usable for MAX_TOKEN_LIFETIME seconds, the mobile node MAY use them beyond a single run of the return routability procedure, until MAX_TOKEN_LIFETIME runs out โณ after that, the mobile node SHOULD NOT use the tokens ๐ โโ๏ธ a fast moving mobile node MAY reuse a recent home keygen token from a correspondent node when it moves to a new location, and only grab a new care-of keygen token to prove routability in the new spot ๐โโ๏ธ๐จ
this doesn't cut down on the round-trips from processing the home and care-of return routability tests at the same time ๐ฅฒ but there are fewer messages flying around, and a potentially long trip through the home agent gets skipped ๐ so this optimization is often useful โจ a mobile node with multiple home addresses MAY also use the same care-of keygen token for Binding Updates about all of those addresses ๐
5.2.8. Preventing Replay Attacks ๐จ
the return routability procedure also protects both sides against replayed Binding Updates, using the sequence number and a MAC ๐ก๏ธ but you have to be careful when you remove bindings at the correspondent node, bestie ๐ correspondent nodes must keep bindings and the associated sequence number information at least as long as the nonces used to authorize the binding are still valid โณ if memory is super tight, though, the correspondent node MAY invalidate the nonces that were used for the binding being deleted (or some bigger group of nonces they belong to) ๐งน the catch is that this could affect whether it can accept Binding Updates from mobile nodes that just got keygen tokens ๐ต so this alternative is recommended only as a last measure ๐ซ
5.2.9. Handling Interruptions to Return Routability โก
sometimes things go sideways, like during simultaneous mobility, when the correspondent host and the mobile host both move at the same time ๐ช๏ธ or when the correspondent node reboots and loses its data ๐ in those cases, route optimization might not finish, or the relevant data in the binding cache could get lost ๐ญ
- Return Routability signaling MUST be sent to the correspondent node's home address if it has one (i.e., not to the correspondent nodes care-of address if the correspondent node is also mobile) ๐
- If Return Routability signaling timed out after MAX_RO_FAILURE attempts, the mobile node MUST revert to sending packets to the correspondent node's home address through its home agent ๐
the mobile node may run bidirectional tunneling in parallel with the return routability procedure until that procedure succeeds ๐ค exponential backoff SHOULD be used for retransmitting return routability messages ๐
the return routability procedure can get kicked off by the mobile node moving, or by sustained loss of end-to-end communication with a correspondent node (for example, based on hints from upper layers) that has been using a route optimized connection to the mobile node ๐ซฃ if those hints come in, the mobile node MAY fall back to bidirectional tunneling while it restarts the return routability procedure ๐
5.3. Dynamic Home Agent Address Discovery ๐ก
dynamic home agent address discovery was designed for deployments where security isn't needed ๐ so for that reason, this document doesn't provide any security solution for dynamic home agent address discovery ๐คทโโ๏ธ
5.4. Mobile Prefix Discovery ๐ฎ
the mobile node and the home agent SHOULD use an IPsec security association to protect the integrity and authenticity of the Mobile Prefix Solicitations and Advertisements ๐ both the mobile nodes and the home agents MUST support, and SHOULD use, the Encapsulating Security Payload (ESP) header in transport mode with a non-NULL payload authentication algorithm, which gives you data origin authentication, connectionless integrity, and optional anti-replay protection ๐ซถโจ
5.5. Payload Packets ๐
Okay so payload packets going to and from mobile nodes can be protected the usual way ๐ , the same way stationary hosts protect theirs. BUT Mobile IPv6 adds some new stuff to payload packets: the Home Address destination option, a routing header, and tunneling headers. So here we define the security measures for all of that, and we make sure nobody can use it to attack other parties ๐ก๏ธ. Lowkey the most important part of this whole section.
This specification limits the use of the Home Address destination option to the situation where the correspondent node already has a Binding Cache entry for the given home address. That's the rule ๐ โโ๏ธ. It keeps the Home Address option out of the attacks described in Section 15.1.
Mobile IPv6 uses a type of routing header that's specific to Mobile IPv6 ๐ฆ. It gives you everything it needs, and it doesn't open up the vulnerabilities discussed in Section 15.1 and RFC 5095 [45]. Iconic behavior, honestly.
Tunnels between the mobile node and the home agent are protected by making sure source addresses are used properly, plus optional cryptographic protection ๐. The mobile node checks that the outer IP address matches its home agent. The home agent checks that the outer IP address matches the mobile node's current location (Binding Updates sent to the home agents are secure). The home agent figures out who the mobile node is from the source address of the inner packet. Usually that's the home address of the mobile node, but it can also be a link-local address, as discussed in Section 10.4.2. To recognize that second kind of address, the home agent needs the Link-Local Address Compatibility (L) to have been set in the Binding Update. These measures protect the tunnels against the vulnerabilities discussed in Section 15.1, so the tunnels are giving protected ๐ซถ.
For traffic tunneled via the home agent, additional IPsec ESP encapsulation MAY be supported and used ๐ธ. And if multicast group membership control protocols or stateful address autoconfiguration protocols are supported, payload data protection MUST be supported. No exceptions, bestie ๐ญ.
6. New IPv6 Protocol, Message Types, and Destination Option ๐ง
6.1. Mobility Header ๐
The Mobility Header is an extension header used by mobile nodes, correspondent nodes, and home agents for all the messaging involved in creating and managing bindings. The subsections in this section describe the message types that can be sent using the Mobility Header.
Mobility Header messages MUST NOT be sent with a type 2 routing header, except as described in Section 9.5.4 for Binding Acknowledgement. Mobility Header messages also MUST NOT be used with a Home Address destination option, except as described in Sections 11.7.1 and 11.7.2 for Binding Update. And Binding Update List or Binding Cache information (when it's present) for the destination MUST NOT be used when sending Mobility Header messages. So basically, Mobility Header messages skip both the Binding Cache check in Section 9.3.2 and the Binding Update List check in Section 11.3.1, even though those checks normally run for all packets ๐. This still applies even when the message is going to or coming from a correspondent node that is itself a mobile node. Main character energy, no exceptions ๐.
6.1.1. Format ๐
The Mobility Header is identified by a Next Header value of 135 in the immediately preceding header, and it has the following format:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Payload Proto | Header Len | MH Type | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| |
. .
. Message Data .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Let's go through the fields one by one ๐ง.
Payload Proto is an 8-bit selector. It tells you the type of header that comes right after the Mobility Header, and it uses the same values as the IPv6 Next Header field [6]. This field is meant for a future extension (see Appendix A.1). Implementations that conform to this specification SHOULD set the payload protocol type to IPPROTO_NONE (59 decimal). Vibes.
Header Len is an 8-bit unsigned integer that gives the length of the Mobility Header in units of 8 octets, not counting the first 8 octets. The length of the Mobility Header MUST be a multiple of 8 octets, so it always lines up ๐.
MH Type is an 8-bit selector that identifies the particular mobility message. The current values are specified in Section 6.1.2 and onward. If an unrecognized MH Type field shows up, an error indication gets sent back ๐จ.
Reserved is an 8-bit field that's kept for future use. The sender MUST initialize the value to zero, and the receiver MUST ignore it ๐ค.
Checksum is a 16-bit unsigned integer ๐งฎ. It holds the checksum of the Mobility Header. The checksum is calculated over an octet string made of a "pseudo-header" followed by the entire Mobility Header, starting from the Payload Proto field. It's the 16-bit one's complement of the one's complement sum of that string.
The pseudo-header has IPv6 header fields, as specified in Section 8.1 of RFC 2460 [6]. The Next Header value used in the pseudo-header is 135. The addresses used in the pseudo-header are the ones that show up in the Source and Destination Address fields of the IPv6 packet carrying the Mobility Header.
Note that the procedures for calculating upper-layer checksums while away from home, described in Section 11.3.1, apply even to the Mobility Header ๐ . If a mobility message has a Home Address destination option, then the checksum calculation uses the home address in that option as the value of the IPv6 Source Address field. The type 2 routing header is treated as explained in [6].
The Mobility Header counts as the upper-layer protocol when calculating the pseudo-header. The Upper-Layer Packet Length field in the pseudo-header MUST be set to the total length of the Mobility Header. And when you're computing the checksum, the checksum field gets set to zero first ๐ง .
Message Data is a variable-length field that holds the data specific to the Mobility Header type you're using ๐ฆ.
Mobile IPv6 also defines a bunch of "mobility options" you can include in these messages. If you include them, any options MUST show up after the fixed portion of the message data specified in this document. Their presence gets flagged by the Header Len field. When the Header Len value is bigger than what the message needs, the leftover octets are read as mobility options ๐. These can include padding options, which help line other options up properly and make the total message length divisible by 8. The encoding and format of the defined options are described in Section 6.2.
The alignment rules for the Mobility Header are the same as for any IPv6 protocol header. In other words, it MUST be aligned on an 8-octet boundary โจ.
6.1.2. Binding Refresh Request Message ๐
The Binding Refresh Request (BRR) message asks a mobile node to update its mobility binding. Correspondent nodes send it according to the rules in Section 9.5.5. When a mobile node gets a packet containing a Binding Refresh Request message, it processes the message following the rules in Section 11.7.4 ๐ซก.
The Binding Refresh Request message uses the MH Type value 0. When that value shows up in the MH Type field, the Message Data field in the Mobility Header looks like this:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. .
. Mobility Options .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Reserved is a 16-bit field that's kept for future use. The sender MUST initialize it to zero, and the receiver MUST ignore it ๐.
Mobility Options is a variable-length field, sized so the complete Mobility Header ends up as an integer multiple of 8 octets. It holds zero or more TLV-encoded mobility options. The encoding and format of the defined options are described in Section 6.2. The receiver MUST ignore and skip any options it doesn't understand ๐โโ๏ธ.
There MAY be additional information associated with this Binding Refresh Request message, but it doesn't need to show up in every BRR that gets sent. Mobility options are how future extensions to the Binding Refresh Request format can be defined. This specification doesn't define any options that are valid for the Binding Refresh Request message ๐.
If no actual options are present in this message, no padding is necessary, and the Header Len field will be set to 0 โ
.
6.1.3. Home Test Init Message ๐
okay bestie, so the Home Test Init (HoTI) message is how a mobile node kicks off the return routability procedure ๐ฆ and asks a correspondent node for a home keygen token (see Section 11.6.1). It rocks MH Type value 1. When that value shows up in the MH Type field, the Message Data field in the Mobility Header looks like this ๐
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Home Init Cookie +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. .
. Mobility Options .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Reserved ๐ซถ
A 16-bit field reserved for future use. This value MUST be initialized to zero by the sender, and MUST be ignored by the receiver.
Home Init Cookie ๐
A 64-bit field that contains a random value, the home init cookie.
Mobility Options ๐
This is a variable-length field, sized so that the complete Mobility Header is an integer multiple of 8 octets long. It contains zero or more TLV-encoded mobility options. The receiver MUST ignore and skip any options that it does not understand. This specification does not define any options valid for the Home Test Init message. ๐
If no actual options are present in this message, no padding is necessary and the Header Len field will be set to 1.
Tunneling check ๐: this message gets tunneled through the home agent when the mobile node is away from home. That tunneling SHOULD employ IPsec ESP in tunnel mode between the home agent and the mobile node. The IPsec security policy database is what indicates this protection. The protection of Home Test Init messages is unrelated to the requirement to protect regular payload traffic, which MAY use such tunnels as well. ๐
6.1.4. Care-of Test Init Message ๐ง
the Care-of Test Init (CoTI) message is the mobile node's way of starting the return routability procedure and asking a correspondent node for a care-of keygen token (see Section 11.6.1) โจ. It uses MH Type value 2. When that value is in the MH Type field, the Message Data field looks like this:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Care-of Init Cookie +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. .
. Mobility Options .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Reserved ๐ธ
A 16-bit field reserved for future use. The value MUST be initialized to zero by the sender, and MUST be ignored by the receiver.
Care-of Init Cookie ๐
A 64-bit field that contains a random value, the care-of init cookie.
Mobility Options ๐ฆ
This is a variable-length field, sized so that the complete Mobility Header is an integer multiple of 8 octets long. It contains zero or more TLV-encoded mobility options. The receiver MUST ignore and skip any options that it does not understand. This specification does not define any options valid for the Care-of Test Init message. ๐
If no actual options are present in this message, no padding is necessary and the Header Len field will be set to 1.
6.1.5. Home Test Message ๐
the Home Test (HoT) message is the response to a Home Test Init message, and the correspondent node sends it back to the mobile node (see Section 5.2.5) ๐. It uses MH Type value 3. When that value is in the MH Type field, the Message Data field looks like this:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Home Nonce Index |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Home Init Cookie +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Home Keygen Token +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. .
. Mobility Options .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Home Nonce Index ๐ฅ
This field will be echoed back by the mobile node to the correspondent node in a subsequent Binding Update. ๐
Home Init Cookie ๐
A 64-bit field that contains the home init cookie.
Home Keygen Token โญ
This field contains the 64-bit home keygen token used in the return routability procedure.
Mobility Options ๐
This is a variable-length field, sized so that the complete Mobility Header is an integer multiple of 8 octets long. It contains zero or more TLV-encoded mobility options. The receiver MUST ignore and skip any options that it does not understand. This specification does not define any options valid for the Home Test message. ๐ง
If no actual options are present in this message, no padding is necessary and the Header Len field will be set to 2.
6.1.6. Care-of Test Message ๐ฆ
the Care-of Test (CoT) message is the response to a Care-of Test Init message, and the correspondent node sends it to the mobile node (see Section 11.6.2) ๐ซ. It uses MH Type value 4. When that value is in the MH Type field, the Message Data field looks like this:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Care-of Nonce Index |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Care-of Init Cookie +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Care-of Keygen Token +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. .
. Mobility Options .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Care-of Nonce Index ๐
This value will be echoed back by the mobile node to the correspondent node in a subsequent Binding Update. ๐
Care-of Init Cookie ๐
A 64-bit field that contains the care-of init cookie.
Care-of Keygen Token ๐ฎ
This field contains the 64-bit care-of keygen token used in the return routability procedure.
Mobility Options ๐ท
This is a variable-length field, sized so that the complete Mobility Header is an integer multiple of 8 octets long. It contains zero or more TLV-encoded mobility options. The receiver MUST ignore and skip any options that it does not understand. This specification does not define any options valid for the Care-of Test message. ๐
If no actual options are present in this message, no padding is necessary and the Header Len field will be set to 2.
6.1.7. Binding Update Message ๐
okay so the Binding Update (BU) message is how a mobile node tells other nodes about its shiny new care-of address ๐ฆ it's giving "hey, I moved, pls update your notes" โจ Binding Updates get sent the way described in Sections 11.7.1 and 11.7.2.
The Binding Update uses the MH Type value 5. When this value is indicated in the MH Type field, the Message Data field in the Mobility Header looks like this ๐
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence # |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|A|H|L|K| Reserved | Lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. .
. Mobility Options .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Acknowledge (A) ๐ซถ
The Acknowledge (A) bit is set by the sending mobile node to request a Binding Acknowledgement (Section 6.1.8) be returned upon receipt of the Binding Update.
Home Registration (H) ๐
The Home Registration (H) bit is set by the sending mobile node to request that the receiving node should act as this node's home agent. The destination of the packet carrying this message MUST be that of a router sharing the same subnet prefix as the home address of the mobile node in the binding.
Link-Local Address Compatibility (L) ๐
The Link-Local Address Compatibility (L) bit is set when the home address reported by the mobile node has the same interface identifier as the mobile node's link-local address.
Key Management Mobility Capability (K) ๐
If this bit is cleared, the protocol used for establishing the IPsec security associations between the mobile node and the home agent does not survive movements. It may then have to be rerun. (Note that the IPsec security associations themselves are expected to survive movements.) If manual IPsec configuration is used, the bit MUST be cleared.
This bit is valid only in Binding Updates sent to the home agent, and MUST be cleared in other Binding Updates. Correspondent nodes MUST ignore this bit.
Reserved ๐ง
These fields are unused. They MUST be initialized to zero by the sender and MUST be ignored by the receiver.
Sequence # ๐ข
A 16-bit unsigned integer used by the receiving node to sequence Binding Updates and by the sending node to match a returned Binding Acknowledgement with this Binding Update.
Lifetime โณ
16-bit unsigned integer. The number of time units remaining before the binding MUST be considered expired. A value of zero indicates that the Binding Cache entry for the mobile node MUST be deleted. One time unit is 4 seconds.
Mobility Options ๐งฉ
Variable-length field of such length that the complete Mobility Header is an integer multiple of 8 octets long. This field contains zero or more TLV-encoded mobility options. The encoding and format of defined options are described in Section 6.2. The receiver MUST ignore and skip any options that it does not understand.
The following options are valid in a Binding Update:
- Binding Authorization Data option (this option is mandatory in Binding Updates sent to a correspondent node)
- Nonce Indices option
- Alternate Care-of Address option
If no options are present in this message, 4 octets of padding are necessary and the Header Len field will be set to 1.
The care-of address is specified either by the Source Address field in the IPv6 header or by the Alternate Care-of Address option, if present. The care-of address MUST be a unicast routable address. IPv6 Source Address MUST be a topologically correct source address. Binding Updates for a care-of address that is not a unicast routable address MUST be silently discarded.
The deletion of a binding MUST be indicated by setting the Lifetime field to 0. In deletion, the generation of the binding management key depends exclusively on the home keygen token, as explained in Section 5.2.5.
Correspondent nodes SHOULD NOT delete the Binding Cache entry before the lifetime expires, if any application hosted by the correspondent node is still likely to require communication with the mobile node. A Binding Cache entry that is de-allocated prematurely might cause subsequent packets to be dropped from the mobile node, if they contain the Home Address destination option. This situation is recoverable, since a Binding Error message is sent to the mobile node (see Section 6.1.9); however, it causes unnecessary delay in the communications. ๐ญ
6.1.8. Binding Acknowledgement Message ๐
The Binding Acknowledgement is used to acknowledge receipt of a Binding Update (Section 6.1.7). This packet is sent as described in Sections 9.5.4 and 10.3.1.
The Binding Acknowledgement has the MH Type value 6. When this value is indicated in the MH Type field, the Message Data field in the Mobility Header looks like this ๐ฆ
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Status |K| Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence # | Lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. .
. Mobility Options .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Status ๐ฆ
8-bit unsigned integer indicating the disposition of the Binding Update. Values of the Status field less than 128 indicate that the Binding Update was accepted by the receiving node. Values greater than or equal to 128 indicate that the Binding Update was rejected by the receiving node. The following Status values are currently defined:
0 Binding Update accepted
1 Accepted but prefix discovery necessary
128 Reason unspecified
129 Administratively prohibited
130 Insufficient resources
131 Home registration not supported
132 Not home subnet
133 Not home agent for this mobile node
134 Duplicate Address Detection failed
135 Sequence number out of window
136 Expired home nonce index
137 Expired care-of nonce index
138 Expired nonces
139 Registration type change disallowed
174 Invalid Care-of Address
Up-to-date values of the Status field are to be specified in the IANA registry of assigned numbers [30].
Key Management Mobility Capability (K) ๐
If this bit is cleared, the protocol used by the home agent for establishing the IPsec security associations between the mobile node and the home agent does not survive movements. It may then have to be rerun. (Note that the IPsec security associations themselves are expected to survive movements.)
Correspondent nodes MUST set the K bit to 0.
Reserved ๐ง
This field is unused. It MUST be initialized to zero by the sender and MUST be ignored by the receiver.
Sequence # ๐ข
The Sequence Number in the Binding Acknowledgement is copied from the Sequence Number field in the Binding Update. It is used by the mobile node in matching this Binding Acknowledgement with an outstanding Binding Update.
Lifetime โณ
The granted lifetime, in time units of 4 seconds, for which this node SHOULD retain the entry for this mobile node in its Binding Cache.
The value of this field is undefined if the Status field indicates that the Binding Update was rejected.
Mobility Options ๐งฉ
Variable-length field of such length that the complete Mobility Header is an integer multiple of 8 octets long. This field contains zero or more TLV-encoded mobility options. The encoding and format of defined options are described in Section 6.2. The receiver MUST ignore and skip any options that it does not understand.
There MAY be additional information associated with this Binding Acknowledgement that need not be present in all Binding Acknowledgements sent. Mobility options allow future extensions to the format of the Binding Acknowledgement to be defined. The following options are valid for the Binding Acknowledgement:
- Binding Authorization Data option (this option is mandatory in Binding Acknowledgements sent by a correspondent node, except where otherwise noted in Section 9.5.4)
- Binding Refresh Advice option
If no options are present in this message, 4 octets of padding are necessary and the Header Len field will be set to 1.
6.1.9. Binding Error Message ๐ฆ
okay so the Binding Error (BE) message is how a correspondent node says "hold up, that's an error" ๐ โโ๏ธ It's all about mobility stuff, like when someone tries to use the Home Address destination option without an existing binding. Go check Section 9.3.3 if you want the full tea โ
The Binding Error message uses the MH Type value 7. When that value is in the MH Type field, the Message Data field in the Mobility Header looks like this:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Status | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Home Address +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. Mobility Options .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Status ๐จ is an 8-bit unsigned integer that tells you why this message got sent. Only two values are defined right now:
1 Unknown binding for Home Address destination option
2 Unrecognized MH Type value
Reserved ๐ง is an 8-bit field saved for future use. The sender MUST set it to zero, and the receiver MUST ignore it.
Home Address ๐ is the home address that was in the Home Address destination option. The mobile node uses this to figure out which binding is missing, which is super handy when it has several home addresses โจ
Mobility Options ๐งฉ is a variable-length field, sized so the whole Mobility Header is an integer multiple of 8 octets long. It holds zero or more TLV-encoded mobility options. The receiver MUST ignore and skip any option it doesn't understand. There MAY be extra info with this Binding Error message, but it doesn't have to show up in every BE message. Mobility options are how future extensions to the Binding Error format can get defined. The encoding and format of defined options are in Section 6.2. This specification doesn't define any options that are valid for the Binding Error message ๐
If there are no actual options in this message, no padding is needed and the Header Len field gets set to 2. ๐
6.2. Mobility Options ๐
Mobility messages can carry zero or more mobility options. This is what lets you have optional fields that aren't needed every time you use a Mobility Header, plus it leaves room for future format changes ๐
The options sit in the Message Data field of the message itself, after the fixed part of the message data described in the message subsections of Section 6.1.
The Header Len of the Mobility Header tells you whether options are present. If they are, the Binding Authorization Data option (Section 6.2.7) MUST be the last option, and it MUST NOT have trailing padding. Everything else can go in any order, no drama ๐
6.2.1. Format ๐ง
Mobility options are packed into the leftover space of the Message Data field in a mobility message, using a type-length-value (TLV) format that looks like this:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Option Type | Option Length | Option Data...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Option Type ๐ท๏ธ is an 8-bit identifier for the kind of mobility option. If a receiver hits an option whose Option Type it doesn't recognize, it MUST quietly ignore and skip over that option, and it still has to handle the rest of the options in the message correctly.
Option Length ๐ is an 8-bit unsigned integer. It's the length of the mobility option in octets, not counting the Option Type and Option Length fields.
Option Data ๐ฆ is a variable-length field full of whatever data that particular option needs.
The following subsections list the Option types that are defined for the Mobility Header right now ๐
Implementations MUST silently ignore any mobility options they don't understand. No drama, no error, just skip ๐ซถ
Mobility options can have alignment requirements. Following the IPv6 convention, these options get lined up in a packet so that multi-octet values inside the Option Data field land on natural boundaries (meaning fields that are n octets wide sit at an integer multiple of n octets from the start of the header, for n = 1, 2, 4, or 8) [6] ๐
6.2.2. Pad1 ๐ซง
The Pad1 option has no alignment requirements. Its format looks like this:
0
0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+
| Type = 0 |
+-+-+-+-+-+-+-+-+
NOTE! Pad1 is the odd one out. It doesn't have an Option Length or Option Data field at all ๐
Pad1 is used to put one octet of padding into the Mobility Options area of a Mobility Header. If you need more than one octet of padding, the PadN option (described next) should be used instead of a bunch of Pad1 options ๐ง
6.2.3. PadN ๐ธ
The PadN option has no alignment requirements either. Its format looks like this:
0 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - -
| Type = 1 | Option Length | Option Data
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - -
PadN is for putting two or more octets of padding in the Mobility Options area of a mobility message. For N octets of padding, the Option Length field holds the value N-2, and the Option Data is N-2 zero-valued octets. The receiver MUST ignore PadN Option data ๐ค
6.2.4. Binding Refresh Advice ๐
The Binding Refresh Advice option has an alignment requirement of 2n. Its format looks like this:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 2 | Length = 2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Refresh Interval |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
This option is only valid in the Binding Acknowledgement, and only in Binding Acknowledgements that the mobile node's home agent sends back in reply to a home registration ๐ฌ The Refresh Interval is measured in units of four seconds. It tells you how much time is left before the mobile node SHOULD send a new home registration to the home agent. The Refresh Interval MUST be set to indicate a smaller time interval than the Lifetime value of the Binding Acknowledgement โฐ
6.2.5. Alternate Care-of Address ๐ก
The Alternate Care-of Address option has an alignment requirement of 8n + 6. Its format looks like this:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 3 | Length = 16 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Alternate Care-of Address +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Normally, a Binding Update tells you the care-of address it wants in the Source Address field of the IPv6 header. But that's not always possible ๐ For example, the mobile node might want to name a care-of address it can't use as a topologically correct source address (Sections 6.1.7 and 11.7.2), or the security mechanism in use might not protect the IPv6 header (Section 11.7.1).
That's why this option exists. It's only valid in Binding Update. The Alternate Care-of Address field holds an address to use as the care-of address for the binding, instead of using the Source Address of the packet as the care-of address ๐
6.2.6. Nonce Indices ๐ฒ
The Nonce Indices option has an alignment requirement of 2n. Its format looks like this:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 4 | Length = 4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Home Nonce Index | Care-of Nonce Index |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
This option is only valid in a Binding Update message sent to a correspondent node, and only when it shows up together with a Binding Authorization Data option ๐ When the correspondent node authorizes the Binding Update, it needs to make home and care-of keygen tokens from its stored random nonce values.
The Home Nonce Index field tells the correspondent node which nonce value to use when it makes the home keygen token.
The Care-of Nonce Index field gets ignored in requests to delete a binding. Otherwise, it tells the correspondent node which nonce value to use when it makes the care-of keygen token โจ
6.2.7. Binding Authorization Data โจ
okay so this option doesn't have alignment requirements as such ๐ but since it has to be the very last mobility option, the implicit alignment ends up being 8n + 2 ๐ here's the layout:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 5 | Option Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| Authenticator |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
this option is valid in the Binding Update and the Binding Acknowledgement ๐ฆ
the Option Length field holds the length of the authenticator, measured in octets ๐ธ
the Authenticator field holds a cryptographic value that lets you check the message really came from the right authority ๐ how you work that value out depends on which authorization procedure you're using ๐
for the return routability procedure, this option can show up in the Binding Update and the Binding Acknowledgements โจ here's how the Authenticator gets calculated:
Mobility Data = care-of address | correspondent | MH Data
Authenticator = First (96, HMAC_SHA1 (Kbm, Mobility Data))
the | means concatenation ๐ the "care-of address" is the one that gets registered for the mobile node if the Binding Update succeeds, or the mobile node's home address if this option is used for de-registration ๐ and bestie, this address might be different from the source address of the Binding Update, especially when the Alternative Care-of Address mobility option is used, or when the binding lifetime is set to zero ๐ญ
the "correspondent" is the IPv6 address of the correspondent node ๐ง heads up, if the message is going to a destination that's also mobile, the "correspondent" might not be what's sitting in the IPv6 header's Destination Address field ๐ instead you use the home address from the type 2 Routing header โจ
"MH Data" is the Mobility Header's content, except for the Authenticator field itself ๐ the Authenticator gets calculated as if the Checksum field in the Mobility Header were zero ๐ซถ the Checksum in the packet still gets computed the normal way, with the calculated Authenticator sitting inside the part of the packet the Checksum protects ๐ Kbm is the binding management key, which is usually made from nonces the correspondent node provides (see Section 9.4) ๐ also, the contents of a possible Home Address destination option aren't covered by this formula, BUT the rules for working out Kbm DO take the home address into account ๐ so the MAC comes out different for different home addresses, which is iconic ๐
the first 96 bits of the MAC result become the Authenticator field ๐
6.3. Home Address Option ๐
the Home Address option rides along in the Destination Option extension header (Next Header value = 60) ๐ง a mobile node uses it on a packet it sends while it's away from home, so the recipient knows the mobile node's home address ๐
the Home Address option is encoded in type-length-value (TLV) format like this:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Option Type | Option Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Home Address +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Option Type
201 = 0xC9
Option Length
8-bit unsigned integer. The length of the option in octets, not counting the Option Type and Option Length fields. This field MUST be set to 16 ๐
Home Address
the home address of the mobile node sending the packet ๐ท this address MUST be a unicast routable address ๐
the alignment requirement [6] for the Home Address option is 8n + 6 ๐
the three highest-order bits of the Option Type field are encoded to say how the option should be processed [6] ๐ฅ for the Home Address option, those three bits are set to 110 โจ which means:
- any IPv6 node that doesn't recognize the Option Type MUST discard the packet, and if the packet's Destination Address wasn't a multicast address, it returns an ICMP Parameter Problem, Code 2, message to the packet's Source Address ๐ญ the Pointer field in that ICMP message SHOULD point at the Option Type field ๐ซถ otherwise, for multicast addresses, the ICMP message MUST NOT be sent ๐
- the data inside the option cannot change en route to the packet's final destination ๐
the Home Address option MUST be placed like this:
- after the routing header, if that header is present
- before the Fragment Header, if that header is present
- before the AH Header or ESP Header, if either one of those headers is present
for each IPv6 packet header, the Home Address option MUST NOT appear more than once ๐ BUT an encapsulated packet [7] MAY have a separate Home Address option tied to each encapsulating IP header ๐
including a Home Address destination option in a packet only affects how the receiving node processes that one packet ๐ฆ no state gets created or changed in the receiving node just because it got a Home Address option ๐ธ in particular, a Home Address option in a received packet MUST NOT change the receiver's Binding Cache, and MUST NOT cause any changes to how that receiving node routes packets it sends afterwards ๐
6.4. Type 2 Routing Header ๐ฃ๏ธ
Mobile IPv6 defines a brand-new routing header variant, the type 2 routing header ๐ it lets a packet go straight from a correspondent to the mobile node's care-of address ๐ง the care-of address goes into the IPv6 Destination Address field ๐ once the packet reaches the care-of address, the mobile node pulls its home address out of the routing header, and that becomes the packet's final destination address โจ
this routing header uses a different type than regular IPv6 source routing does ๐ฅ that way firewalls can apply different rules to source routed packets than they do to Mobile IPv6 ๐ the type 2 routing header is restricted to carrying exactly one IPv6 address ๐ซถ
all IPv6 nodes that process this routing header MUST verify that the address inside is the node's own home address, so packets can't get forwarded outside the node ๐ญ the IP address in the routing header, since it's the mobile node's home address, MUST be a unicast routable address ๐ and if the scope of the home address is smaller than the scope of the care-of address, the mobile node MUST discard the packet (see Section 4.6) ๐
6.4.1. Format ๐
the type 2 routing header looks like this:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Next Header | Hdr Ext Len=2 | Routing Type=2|Segments Left=1|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Home Address +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Next Header
8-bit selector. It identifies the type of header that comes right after the routing header ๐ it uses the same values as the IPv6 Next Header field [6] โจ
Hdr Ext Len
2 (8-bit unsigned integer). The length of the routing header in 8-octet units, not counting the first 8 octets ๐ธ
Routing Type
2 (8-bit unsigned integer) ๐ฆ
Segments Left
1 (8-bit unsigned integer) ๐ง
Reserved
32-bit reserved field. The sender MUST initialize this value to zero, and the receiver MUST ignore it ๐
Home Address
the home address of the destination mobile node ๐
for a type 2 routing header, Hdr Ext Len MUST be 2 ๐ the Segments Left value tells you how many route segments are still left, meaning how many explicitly listed intermediate nodes still need to be visited before the final destination โจ Segments Left MUST be 1 ๐ฅ the ordering rules for extension headers in an IPv6 packet are described in Section 4.1 of RFC 2460 [6] ๐ the type 2 routing header defined for Mobile IPv6 follows the same ordering as other routing headers ๐ซถ if another routing header shows up along with a type 2 routing header, the type 2 routing header SHOULD follow the other routing header ๐ a packet with that kind of nested encapsulation SHOULD be created as if the inner (type 2) routing header were built first, and then treated as an original packet by the header construction process for the other routing header ๐
also, the general procedures IPv6 defines for routing headers suggest that a received routing header MAY be automatically "reversed" to build a routing header for any response packets that upper-layer protocols send, as long as the received packet was authenticated [6] ๐ BUT this MUST NOT be done automatically for type 2 routing headers ๐ญ๐ซถ
6.5. ICMP Home Agent Address Discovery Request Message ๐
okay so this is the message a mobile node sends when it wants to kick off dynamic home agent address discovery, which we get into in Section 11.4.1 ๐ The mobile node sends it to the Mobile IPv6 Home-Agents anycast address [8] for its own home subnet prefix. (ngl, the currently defined anycast addresses may not work with all prefix lengths other than those defined in RFC 4291 [16] [37], so keep that in mind ๐)
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Code | Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Identifier | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type ๐ 144
Code ๐ 0
Checksum ๐ The ICMP checksum [17].
Identifier ๐ An identifier to aid in matching Home Agent Address Discovery Reply messages to this Home Agent Address Discovery Request message.
Reserved ๐ This field is unused. It MUST be initialized to zero by the sender and MUST be ignored by the receiver.
The Source Address of the Home Agent Address Discovery Request message packet is typically one of the mobile node's current care-of addresses. At the time of performing this dynamic home agent address discovery procedure, it's likely that the mobile node isn't registered with any home agent yet ๐ฅบ So neither the nature of the address nor the identity of the mobile node can be established at this time. The home agent MUST then return the Home Agent Address Discovery Reply message directly to the Source Address chosen by the mobile node. โจ
6.6. ICMP Home Agent Address Discovery Reply Message ๐ฆ
the Home Agent Address Discovery Reply message is how a home agent answers a mobile node that's using the dynamic home agent address discovery mechanism, as described in Section 10.5. it's giving reply energy ๐
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Code | Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Identifier | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
. .
. Home Agent Addresses .
. .
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type ๐ 145
Code ๐ 0
Checksum ๐ The ICMP checksum [17].
Identifier ๐ The identifier from the invoking Home Agent Address Discovery Request message.
Reserved ๐ This field is unused. It MUST be initialized to zero by the sender and MUST be ignored by the receiver.
Home Agent Addresses ๐ A list of addresses of home agents on the home link for the mobile node. The number of addresses presented in the list is indicated by the remaining length of the IPv6 packet carrying the Home Agent Address Discovery Reply message. ๐ธ
6.7. ICMP Mobile Prefix Solicitation Message Format ๐ง
the Mobile Prefix Solicitation message is sent by a mobile node to its home agent while it's away from home ๐ โ๏ธ its whole job is to ask the home agent for a Mobile Prefix Advertisement, which lets the mobile node gather prefix information about its home network. that info can then be used to configure and update home address(es) whenever the prefix information from the home agent changes. it's giving organised bestie energy ๐
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Code | Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Identifier | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
IP Fields: ๐
Source Address ๐ The mobile node's care-of address.
Destination Address ๐ The address of the mobile node's home agent. This home agent must be on the link that the mobile node wishes to learn prefix information about.
Hop Limit ๐ Set to an initial hop limit value, similarly to any other unicast packet sent by the mobile node.
Destination Option: ๐ A Home Address destination option MUST be included.
ESP header: ๐ IPsec headers MUST be supported and SHOULD be used as described in Section 5.4.
ICMP Fields: ๐
Type ๐ 146
Code ๐ 0
Checksum ๐ The ICMP checksum [17].
Identifier ๐ An identifier to aid in matching a future Mobile Prefix Advertisement to this Mobile Prefix Solicitation.
Reserved ๐ This field is unused. It MUST be initialized to zero by the sender and MUST be ignored by the receiver.
The Mobile Prefix Solicitation messages may have options. These options MUST use the option format defined in Neighbor Discovery (RFC 4861 [18]). This document doesn't define any option types for the Mobile Prefix Solicitation message, but future documents may define new options. Home agents MUST silently ignore any options they do not recognize and continue processing the message. ๐
6.8. ICMP Mobile Prefix Advertisement Message Format ๐
a home agent sends a Mobile Prefix Advertisement to a mobile node to share prefix information about the home link while the mobile node is traveling away from the home network ๐งณ This happens either in response to a Mobile Prefix Solicitation with an Advertisement, or as an unsolicited Advertisement sent according to the rules in Section 10.6.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Code | Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Identifier |M|O| Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
IP Fields: ๐
Source Address ๐ The home agent's address as the mobile node would expect to see it (i.e., same network prefix).
Destination Address ๐ If this message is a response to a Mobile Prefix Solicitation, this field contains the Source Address field from that packet. For unsolicited messages, the mobile node's care-of address SHOULD be used. Note that unsolicited messages can only be sent if the mobile node is currently registered with the home agent. ๐ซถ
Routing header: ๐ A type 2 routing header MUST be included.
ESP header: ๐ IPsec headers MUST be supported and SHOULD be used as described in Section 5.4.
ICMP Fields: ๐
Type ๐ 147
Code ๐ 0
Checksum ๐ The ICMP checksum [17].
Identifier ๐ An identifier to aid in matching this Mobile Prefix Advertisement to a previous Mobile Prefix Solicitation.
M ๐ 1-bit Managed Address Configuration flag. When set, hosts use the administered (stateful) protocol for address autoconfiguration in addition to any addresses autoconfigured using stateless address autoconfiguration. The use of this flag is described in [18] [19].
O ๐ 1-bit Other Stateful Configuration flag. When set, hosts use the administered (stateful) protocol for autoconfiguration of other (non-address) information. The use of this flag is described in [18] [19].
Reserved ๐ This field is unused. It MUST be initialized to zero by the sender and MUST be ignored by the receiver.
The Mobile Prefix Advertisement messages may have options. These options MUST use the option format defined in Neighbor Discovery (RFC 4861 [18]). This document defines one option that may be carried in a Mobile Prefix Advertisement message, but future documents may define new options. Mobile nodes MUST silently ignore any options they do not recognize and continue processing the message. ๐
Prefix Information ๐ Each message contains one or more Prefix Information options. Each option carries the prefix(es) that the mobile node should use to configure its home address(es). Section 10.6 describes which prefixes should be advertised to the mobile node.
The Prefix Information option is defined in Section 4.6.2 of Neighbor Discovery (RFC 4861 [18]), with modifications defined in Section 7.2 of this specification. The home agent MUST use this modified Prefix Information option to send home network prefixes as defined in Section 10.6.1.
If the Advertisement is sent in response to a Mobile Prefix Solicitation, the home agent MUST copy the Identifier value from that message into the Identifier field of the Advertisement.
The home agent MUST NOT send more than one Mobile Prefix Advertisement message per second to any mobile node. โฑ๏ธ
The M and O bits MUST be cleared if the Home Agent DHCPv6 support is not provided. If such support is provided, then they are set in concert with the home network's administrative settings. ๐
7. Modifications to IPv6 Neighbor Discovery โจ
7.1. Modified Router Advertisement Message Format โจ
okay so Mobile IPv6 tweaks the Router Advertisement message [18] by adding just one flag bit ๐. That bit tells everyone that the router sending the Advertisement is acting as a home agent on this link ๐ . Here's the format:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Code | Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Cur Hop Limit |M|O|H| Reserved| Router Lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reachable Time |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Retrans Timer |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options ...
+-+-+-+-+-+-+-+-+-+-+-+-
This format represents the following changes over that originally specified for Neighbor Discovery [18]:
Home Agent (H) ๐ฆ
The Home Agent (H) bit is set in a Router Advertisement to indicate that the router sending this Router Advertisement is also functioning as a Mobile IPv6 home agent on this link.
Reserved ๐
Reduced from a 6-bit field to a 5-bit field to account for the addition of the above bit.
7.2. Modified Prefix Information Option Format ๐ธ
so Mobile IPv6 needs to know a router's global address ๐ when it builds a Home Agents List as part of dynamic home agent address discovery.
The thing is, Neighbor Discovery [18] only advertises a router's link-local address ๐, because it requires that address to be used as the IP Source Address of each Router Advertisement.
So Mobile IPv6 extends Neighbor Discovery so a router can advertise its global address, by adding a single flag bit to the Prefix Information option used in Router Advertisement messages ๐ง. Here's the format:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Length | Prefix Length |L|A|R|Reserved1|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Valid Lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Preferred Lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reserved2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Prefix +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
This format represents the following changes over that originally specified for Neighbor Discovery [18]:
Router Address (R) ๐ฆ
1-bit router address flag. When set, it indicates that the Prefix field contains a complete IP address assigned to the sending router. The indicated prefix is given by the first Prefix Length bits of the Prefix field. The router IP address has the same scope and conforms to the same lifetime values as the advertised prefix. This use of the Prefix field is compatible with its use in advertising the prefix itself, since Prefix Advertisement uses only the leading bits. Interpretation of this flag bit is thus independent of the processing required for the On-Link (L) and Autonomous Address-Configuration (A) flag bits.
Reserved1 ๐
Reduced from a 6-bit field to a 5-bit field to account for the addition of the above bit.
In a Router Advertisement, a home agent MUST, and all other routers MAY, include at least one Prefix Information option with the Router Address (R) bit set. Neighbor Discovery (RFC 4861 [18]) specifies that, when including all options in a Router Advertisement causes the size of the Advertisement to exceed the link MTU, multiple Advertisements can be sent, each containing a subset of the Neighbor Discovery options. Also, when sending unsolicited multicast Router Advertisements more frequently than the limit specified in RFC 4861, the sending router need not include all options in each of these Advertisements. However, in both of these cases the router SHOULD include at least one Prefix Information option with the Router Address (R) bit set in each such advertisement, if this bit is set in some advertisement sent by the router.
In addition, the following requirement can assist mobile nodes in movement detection ๐โโ๏ธ. Barring changes in the prefixes for the link, routers that send multiple Router Advertisements with the Router Address (R) bit set in some of the included Prefix Information options SHOULD provide at least one option and router address that stays the same in all of the Advertisements.
7.3. New Advertisement Interval Option Format ๐ฅ
Mobile IPv6 defines a brand new Advertisement Interval option ๐. It's used in Router Advertisement messages to advertise how often the sending router sends unsolicited multicast Router Advertisements. Here's the format:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Length | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Advertisement Interval |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type โจ
7
Length ๐
8-bit unsigned integer. The length of the option (including the type and length fields) is in units of 8 octets. The value of this field MUST be 1.
Reserved ๐
This field is unused. It MUST be initialized to zero by the sender and MUST be ignored by the receiver.
Advertisement Interval โฑ๏ธ
32-bit unsigned integer. The maximum time, in milliseconds, between successive unsolicited Router Advertisement messages sent by this router on this network interface. Using the conceptual router configuration variables defined by Neighbor Discovery [18], this field MUST be equal to the value MaxRtrAdvInterval, expressed in milliseconds.
Routers MAY include this option in their Router Advertisements. A mobile node receiving a Router Advertisement containing this option SHOULD utilize the specified Advertisement Interval for that router in its movement detection algorithm, as described in Section 11.5.1.
This option MUST be silently ignored for other Neighbor Discovery messages.
7.4. New Home Agent Information Option Format ๐
Mobile IPv6 also defines a new Home Agent Information option ๐ง. It's used in Router Advertisements sent by a home agent to advertise info specific to that router's job as a home agent. Here's the format:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Length | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Home Agent Preference | Home Agent Lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type โจ
8
Length ๐
8-bit unsigned integer. The length of the option (including the type and length fields) in units of 8 octets. The value of this field MUST be 1.
Reserved ๐
This field is unused. It MUST be initialized to zero by the sender and MUST be ignored by the receiver.
Home Agent Preference ๐
16-bit unsigned integer. The preference for the home agent sending this Router Advertisement, used for ordering the addresses returned to a mobile node in the Home Agent Addresses field of a Home Agent Address Discovery Reply message. Higher values mean more preferable. If this option is not included in a Router Advertisement in which the Home Agent (H) bit is set, the preference value for this home agent MUST be considered to be 0. Greater values indicate a more preferable home agent than lower values.
Manual configuration of the Home Agent Preference value is described in Section 8.4. In addition, the sending home agent MAY dynamically set the Home Agent Preference value, for example, basing it on the number of mobile nodes it is currently serving or on its remaining resources for serving additional mobile nodes. Such dynamic settings are beyond the scope of this document. Any such dynamic setting of the Home Agent Preference, however, MUST set the preference appropriately, relative to the default Home Agent Preference value of 0 that may be in use by some home agents on this link (i.e., a home agent not including a Home Agent Information option in its Router Advertisements will be considered to have a Home Agent Preference value of 0).
Home Agent Lifetime โณ
16-bit unsigned integer. The lifetime associated with the home agent in units of seconds. The default value is the same as the Router Lifetime, as specified in the main body of the Router Advertisement. The maximum value corresponds to 18.2 hours. A value of 0 MUST NOT be used. The Home Agent Lifetime applies only to this router's usefulness as a home agent; it does not apply to information contained in other message fields or options.
Home agents MAY include this option in their Router Advertisements. This option MUST NOT be included in a Router Advertisement in which the Home Agent (H) bit (see Section 7.1) is not set. If this option is not included in a Router Advertisement in which the Home Agent (H) bit is set, the lifetime for this home agent MUST be considered to be the same as the Router Lifetime in the Router Advertisement. If multiple Advertisements are being sent instead of a single larger unsolicited multicast Router Advertisement, all of the multiple Advertisements with the Router Address (R) bit set MUST include this option with the same contents; otherwise, this option MUST be omitted from all Advertisements.
This option MUST be silently ignored for other Neighbor Discovery messages.
If both the Home Agent Preference and Home Agent Lifetime are set to their default values specified above, this option SHOULD NOT be included in the Router Advertisement messages sent by this home agent.
7.5. Changes to Sending Router Advertisements ๐ก
Okay bestie, so the Neighbor Discovery protocol spec [18] limits routers to a minimum interval of 3 seconds between sending unsolicited multicast Router Advertisement messages from any given network interface (limited by MinRtrAdvInterval and MaxRtrAdvInterval) ๐ค And it literally says:
"Routers generate Router Advertisements frequently enough that hosts will learn of their presence within a few minutes, but not frequently enough to rely on an absence of advertisements to detect router failure; a separate Neighbor Unreachability Detection algorithm provides failure detection."
Now, this limit is NOT giving mobile nodes what they need for timely movement detection ๐ญ Mobile nodes figure out they've moved by spotting new routers as they roll into wireless range (or plug into a new wired network), and by noticing that their old routers have gone quiet. Mobile nodes MUST be able to quickly detect when they move to a link served by a new router, so they can grab a new care-of address and send Binding Updates to register that care-of address with their home agent and notify correspondent nodes as needed. No waiting around allowed! ๐
One way to get faster movement detection is to send unsolicited Router Advertisements more often ๐ฆ Mobile IPv6 relaxes this limit so that routers MAY send unsolicited multicast Router Advertisements more frequently. This works where the router expects to serve visiting mobile nodes (like wireless network interfaces), or where it's acting as a home agent for one or more mobile nodes (who may return home and need to hear its Advertisements).
Routers supporting mobility SHOULD be able to be configured with a smaller MinRtrAdvInterval value and MaxRtrAdvInterval value, so they can send unsolicited multicast Router Advertisements more often ๐ธ The minimum allowed values are:
- MinRtrAdvInterval 0.03 seconds
- MaxRtrAdvInterval 0.07 seconds
If the minimum intervals and delays are used, the mean time between unsolicited multicast Router Advertisements is 50 ms โก Using these modified limits MUST be configurable (see also the configuration variable MinDelayBetweenRas in Section 13, which may also have to be modified accordingly). Systems where these values are available MUST NOT default to them, and SHOULD default to the values specified in Neighbor Discovery (RFC 4861 [18]). Knowledge of the type of network interface and operating environment SHOULD be taken into account when configuring these limits for each network interface. This matters a lot on some wireless links, where increasing the frequency of multicast beacons can cause considerable overhead ๐ Routers SHOULD adhere to the intervals specified in RFC 4861 [18] if this overhead is likely to cause service degradation.
Also, the possible low values of MaxRtrAdvInterval may cause some problems with movement detection in some mobile nodes ๐ To make sure this isn't a problem, Routers SHOULD add 20 ms to any Advertisement Intervals sent in RAs that are below 200 ms, to account for scheduling granularities on both the MN and the router. Tiny timers, big feelings ๐ง
Note that multicast Router Advertisements aren't always required in certain wireless networks that have limited bandwidth โจ Mobility detection or link changes in those networks may be handled at lower layers. Router advertisements in such networks SHOULD be sent only when solicited. In such networks it SHOULD be possible to disable unsolicited multicast Router Advertisements on specific interfaces. The MinRtrAdvInterval and MaxRtrAdvInterval in such a case can be set to some high values.
Home agents MUST include the Source Link-Layer Address option in all Router Advertisements they send ๐ This simplifies the process of returning home, as discussed in Section 11.5.5.
Last thing, and it's a little plot twist ๐ According to Neighbor Discovery (RFC 4861 [18]), AdvDefaultLifetime is by default based on the value of MaxRtrAdvInterval. AdvDefaultLifetime is used in the Router Lifetime field of Router Advertisements. Since this field is expressed in seconds, a small MaxRtrAdvInterval value can result in a zero value for the field. To prevent this, routers SHOULD keep AdvDefaultLifetime at at least one second, even if using MaxRtrAdvInterval would give a smaller value.
8. Requirements for Types of IPv6 Nodes ๐
Mobile IPv6 puts some special requirements on the functions provided by different types of IPv6 nodes ๐ฆ This section sums those requirements up and points out what functionality each one is meant to support.
The requirements are set for the following groups of nodes:
- All IPv6 nodes.
- All IPv6 nodes with support for route optimization.
- All IPv6 routers.
- All Mobile IPv6 home agents.
- All Mobile IPv6 mobile nodes.
It's outside the scope of this specification to say which of these groups are mandatory in IPv6 ๐ โโ๏ธ We only describe what's mandatory for a node that supports, for instance, route optimization. Other specifications are expected to define the extent of IPv6.
8.1. All IPv6 Nodes ๐
Any IPv6 node may at any time be a correspondent node of a mobile node, either sending a packet to a mobile node or receiving one from it. There are no Mobile IPv6 specific MUST requirements for these nodes, and basic IPv6 techniques are sufficient ๐ If a mobile node tries to set up route optimization with a node that only has basic IPv6 support, an ICMP error will signal that the node doesn't support such optimizations (Section 11.3.5), and communications will flow through the home agent.
An IPv6 node MUST NOT support the Home Address destination option, type 2 routing header, or the Mobility Header unless it fully supports the requirements listed in the next sections for route optimization, mobile node, or home agent functionality. No half-stanning allowed ๐
8.2. IPv6 Nodes with Support for Route Optimization ๐
Nodes that implement route optimization are a subset of all IPv6 nodes on the Internet. A correspondent node's ability to take part in route optimization is essential for the efficient operation of the IPv6 Internet, for these reasons:
- Avoiding congestion in the home network, and making it possible to use lower-performance home agent equipment even while supporting thousands of mobile nodes.
- Reducing network load across the entire Internet, as mobile devices start to predominate.
- Reducing jitter and latency for communications.
- Giving Quality of Service (QoS) signaling a greater likelihood of success, since tunneling is avoided and there are fewer sources of congestion.
- Improving robustness against network partitions, congestion, and other problems, since fewer routing path segments are traversed.
All of these effects combine to enable much better performance and robustness for communications between mobile nodes and IPv6 correspondent nodes ๐ Route optimization does add a small amount of extra state for the peers, some additional messaging, and up to 1.5 round-trip delays before it can be turned on. However, it is believed that the benefits far outweigh the costs in most cases. Section 11.3.1 discusses how mobile nodes may avoid route optimization for some of the remaining cases, such as very short-term communications.
The following requirements apply to all correspondent nodes that support route optimization:
- The node MUST be able to validate a Home Address option using an existing Binding Cache entry, as described in Section 9.3.1.
- The node MUST be able to insert a type 2 routing header into packets to be sent to a mobile node, as described in Section 9.3.2.
- Unless the correspondent node is also acting as a mobile node, it MUST ignore type 2 routing headers and silently discard all packets that it has received with such headers.
- The node SHOULD be able to interpret ICMP messages as described in Section 9.3.4.
- The node MUST be able to send Binding Error messages as described in Section 9.3.3.
- The node MUST be able to process Mobility Headers as described in Section 9.2.
- The node MUST be able to participate in a return routability procedure (Section 9.4).
- The node MUST be able to process Binding Update messages (Section 9.5).
- The node MUST be able to return a Binding Acknowledgement (Section 9.5.4).
- The node MUST be able to maintain a Binding Cache of the bindings received in accepted Binding Updates, as described in Sections 9.1 and 9.6.
- The node SHOULD allow route optimization to be administratively enabled or disabled. The default SHOULD be enabled โจ
8.3. All IPv6 Routers ๐
All IPv6 routers, even the ones that aren't serving as a home agent for Mobile IPv6, affect how well mobile nodes can communicate ๐ซถ
- Every IPv6 router SHOULD be able to send an Advertisement Interval option (Section 7.3) in each of its Router Advertisements [18], to help mobile nodes with movement detection (as in Section 11.5.1). The use of this option in Router Advertisements SHOULD be configurable.
- Every IPv6 router SHOULD be able to support sending unsolicited multicast Router Advertisements at the faster rate described in Section 7.5. If the router supports a faster rate, the rate used MUST be configurable.
- Each router SHOULD include at least one prefix with the Router Address (R) bit set and with its full IP address in its Router Advertisements (as described in Section 7.2).
- Routers supporting filtering of packets with routing headers SHOULD support different rules for type 0 and type 2 routing headers (see Section 6.4), so that filtering of source routed packets (type 0) will not necessarily limit Mobile IPv6 traffic that is delivered via type 2 routing headers ๐
8.4. IPv6 Home Agents โจ
okay so, for a mobile node to actually work while it's away from home, at least one IPv6 router on the mobile node's home link has to act as a home agent for it ๐ โจ and any IPv6 router that serves as a home agent has these extra requirements, bestie ๐ซถ
- Every home agent MUST be able to maintain an entry in its Binding Cache for each mobile node it is serving as the home agent for (Sections 10.1 and 10.3.1). ๐๏ธ
- Every home agent MUST be able to intercept packets (using proxy Neighbor Discovery [18]) that are addressed to a mobile node it is currently serving, on that mobile node's home link, while the mobile node is away from home (Section 10.4.1). ๐
- Every home agent MUST be able to encapsulate [7] those intercepted packets so they get tunneled to the primary care-of address for the mobile node, as listed in its binding in the home agent's Binding Cache (Section 10.4.2). ๐ฆ
- Every home agent MUST support decapsulating [7] reverse-tunneled packets sent to it from a mobile node's home address. Every home agent MUST also check that the source address in the tunneled packets matches the currently registered location of the mobile node (Section 10.4.5). ๐
- The node MUST be able to process Mobility Headers as described in Section 10.2. ๐
- Every home agent MUST be able to return a Binding Acknowledgement in response to a Binding Update (Section 10.3.1). ๐
- Every home agent MUST maintain a separate Home Agents List for each link it is serving as a home agent on, as described in Sections 10.1 and 10.5.1. ๐
- Every home agent MUST be able to accept packets addressed to the Mobile IPv6 Home-Agents anycast address [8] for the subnet it is serving as a home agent on, and MUST be able to participate in dynamic home agent address discovery (Section 10.5). ๐ง
- Every home agent SHOULD support a configuration mechanism so a system administrator can manually set the value this home agent sends in the Home Agent Preference field of the Home Agent Information Option in the Router Advertisements it sends (Section 7.4). ๐๏ธ
- Every home agent SHOULD support sending ICMP Mobile Prefix Advertisements (Section 6.8), and SHOULD respond to Mobile Prefix Solicitations (Section 6.7). If supported, this behavior MUST be configurable, so home agents can be set up to avoid sending those Prefix Advertisements based on what the network administration in the home domain needs ๐ธ
- Every home agent MUST support IPsec ESP for protecting packets that belong to the return routability procedure (Section 10.4.6). ๐
- Every home agent SHOULD support the multicast group membership control protocols described in Section 10.4.3. If that support is provided, the home agent MUST be capable of using it to figure out which multicast data packets to forward through the tunnel to the mobile node. ๐ก
- Home agents MAY support stateful address autoconfiguration for mobile nodes, as described in Section 10.4.4. ๐
8.5. IPv6 Mobile Nodes
Last but definitely not least, these requirements apply to all IPv6 nodes that can work as mobile nodes ๐
- The node MUST maintain a Binding Update List (Section 11.1). ๐
- The node MUST support sending packets that contain a Home Address option (Section 11.3.1), and follow the required IPsec interaction (Section 11.3.2). ๐
- The node MUST be able to perform IPv6 encapsulation and decapsulation [7]. ๐ฆ
- The node MUST be able to process type 2 routing header as defined in Sections 6.4 and 11.3.3. ๐ฃ๏ธ
- The node MUST support receiving a Binding Error message (Section 11.3.6). ๐จ
- The node MUST support receiving ICMP errors (Section 11.3.5). ๐
- The node MUST support movement detection, care-of address formation, and returning home (Section 11.5). ๐ก
- The node MUST be able to process Mobility Headers as described in Section 11.2. ๐
- The node MUST support the return routability procedure (Section 11.6). ๐
- The node MUST be able to send Binding Updates, as specified in Sections 11.7.1 and 11.7.2. ๐
- The node MUST be able to receive and process Binding Acknowledgements, as specified in Section 11.7.3. โ
- The node MUST support receiving a Binding Refresh Request (Section 6.1.2), and respond to it with a Binding Update. ๐
- The node MUST support receiving Mobile Prefix Advertisements (Section 11.4.3) and reconfiguring its home address based on the prefix information inside them. ๐ช
- The node SHOULD support the dynamic home agent address discovery mechanism, as described in Section 11.4.1. ๐
- The node MUST allow route optimization to be administratively enabled or disabled. The default SHOULD be enabled. โ๏ธ
- The node MAY support the multicast address listener part of a multicast group membership protocol, as described in Section 11.3.4. If that support is provided, the mobile node MUST be able to receive tunneled multicast packets from the home agent. ๐ถ
- The node MAY support stateful address autoconfiguration mechanisms such as DHCPv6 [31] on the interface that represents the tunnel to the home agent. ๐ง
9. Correspondent Node Operation โจ
9.1. Conceptual Data Structures
IPv6 nodes with route optimization support keep a Binding Cache of bindings for other nodes, okay ๐ง A separate Binding Cache SHOULD be maintained by each IPv6 node for each of its unicast routable addresses. The Binding Cache MAY be implemented in any way that's consistent with the external behavior described in this document, for example by being combined with the node's Destination Cache as maintained by Neighbor Discovery [18]. When sending a packet, the Binding Cache gets searched before the Neighbor Discovery conceptual Destination Cache [18] ๐โโ๏ธ
Each Binding Cache entry conceptually contains the following fields:
- The home address of the mobile node that this Binding Cache entry is for. This field is the key used to search the Binding Cache for the destination address of a packet being sent. ๐
- The care-of address for the mobile node indicated by the home address field in this Binding Cache entry. ๐ โก๏ธ
- A lifetime value, showing the remaining lifetime for this Binding Cache entry. The lifetime value is set from the Lifetime field in the Binding Update that created or last modified this entry. A correspondent node MAY pick a smaller lifetime for the Binding Cache entry, and send that value to the mobile node in the Binding Acknowledgment message. โณ
- A flag showing whether or not this Binding Cache entry is a home registration entry (only applicable on nodes that support home agent functionality). ๐ฉ
- The maximum value of the Sequence Number field received in previous Binding Updates for this home address. The Sequence Number field is 16 bits long. Sequence Number values MUST be compared modulo
2**16, as explained in Section 9.5.1. ๐ข - Usage information for this Binding Cache entry. This is needed to implement the cache replacement policy in use in the Binding Cache. Recent use of a cache entry also works as a sign that a Binding Refresh Request should be sent when the lifetime of this entry is getting close to expiring. ๐
Binding Cache entries that aren't marked as home registrations MAY be replaced at any time by any reasonable local cache replacement policy, but SHOULD NOT be deleted unnecessarily ๐๏ธ The Binding Cache for any one of a node's IPv6 addresses may contain at most one entry for each mobile node home address. The contents of a node's Binding Cache MUST NOT be changed in response to a Home Address option in a received packet. ๐ซ
9.2. Processing Mobility Headers
Mobility Header processing MUST observe the following rules, no exceptions ๐
- The checksum must be verified as per Section 6.1. If it's invalid, the node MUST silently discard the message. ๐คซ
- The
MH Typefield MUST have a known value (Section 6.1.1). Otherwise, the node MUST discard the message and issue a Binding Error message as described in Section 9.3.3, with theStatusfield set to 2 (unrecognized MH Type value). ๐ โโ๏ธ - The
Payload Protofield MUST beIPPROTO_NONE(59 decimal). Otherwise, the node MUST discard the message and SHOULD send ICMP Parameter Problem, Code 0, directly to the Source Address of the packet, as specified in RFC 4443 [17]. So no Binding Cache information gets used in sending that ICMP message ๐ ThePointerfield in the ICMP message SHOULD point at thePayload Protofield. ๐ - The
Header Lenfield in the Mobility Header MUST NOT be less than the length specified for this particular type of message in Section 6.1. Otherwise, the node MUST discard the message and SHOULD send ICMP Parameter Problem, Code 0, directly to the Source Address of the packet, as specified in RFC 4443 [17]. (Again, the Binding Cache information is not used here either ๐ ) ThePointerfield in the ICMP message SHOULD point at theHeader Lenfield. ๐ฏ
Subsequent checks depend on the particular Mobility Header, so keep an eye out for those ๐
9.3. Packet Processing
This section is all about how the correspondent node sends packets to the mobile node, and how it receives packets from the mobile node ๐
9.3.1. Receiving Packets with Home Address Option
Okay bestie, so this is the rule for when a packet shows up with a Home Address option ๐ Packets containing a Home Address option MUST be dropped if the given home address is not a unicast routable address. Non-negotiable, no cap. ๐
Mobile nodes can include a Home Address destination option in a packet if they believe the correspondent node has a Binding Cache entry for the home address of a mobile node ๐ฆ If the Next Header value of the Destination Option is one of these: {50 (ESP), 51 (AH), 135 (Mobility Header)}, the packet SHOULD be processed normally. Otherwise, the packet MUST be dropped if there is no corresponding Binding Cache entry. A corresponding Binding Cache entry MUST have the same home address as appears in the Home Address destination option, and the currently registered care-of address MUST be equal to the source address of the packet. Lowkey strict, but it's giving security ๐ฅ
If the packet gets dropped because of the tests above, the correspondent node MUST send the Binding Error message as described in Section 9.3.3 ๐ซถ The Status field in this message should be set to 1 (unknown binding for Home Address destination option). Okay, the Status field should be 1, that's the vibe ๐ธ
The correspondent node MUST process the option in a manner consistent with exchanging the Home Address field from the Home Address option into the IPv6 header and replacing the original value of the Source Address field there โจ After all IPv6 options have been processed, it MUST be possible for upper layers to process the packet without the knowledge that it came originally from a care-of address or that a Home Address option was used. Upper layers should not even know, that's iconic ๐
The use of IPsec Authentication Header (AH) for the Home Address option is not required, except that if the IPv6 header of a packet is covered by AH, then the authentication MUST also cover the Home Address option ๐ง This coverage is achieved automatically by the definition of the Option Type code for the Home Address option, since it indicates that the data within the option cannot change en route to the packet's final destination, and thus the option is included in the AH computation. By requiring that any authentication of the IPv6 header also cover the Home Address option, the security of the Source Address field in the IPv6 header is not compromised by the presence of a Home Address option. Main character energy for security ๐
When attempting to verify AH authentication data in a packet that contains a Home Address option, the receiving node MUST calculate the AH authentication data as if the following were true: the Home Address option contains the care-of address, and the source IPv6 address field of the IPv6 header contains the home address ๐ This conforms with the calculation specified in Section 11.3.2.
9.3.2. Sending Packets to a Mobile Node
Before sending any packet, the sending node SHOULD examine its Binding Cache for an entry for the destination address to which the packet is being sent ๐ If the sending node has a Binding Cache entry for this address, the sending node SHOULD use a type 2 routing header to route the packet to this mobile node (the destination node) by way of its care-of address. However, the sending node MUST NOT do this in the following cases:
- When sending an IPv6 Neighbor Discovery [18] packet.
- Where otherwise noted in Section 6.1.
When calculating authentication data in a packet that contains a type 2 routing header, the correspondent node MUST calculate the AH authentication data as if the following were true: the routing header contains the care-of address, the destination IPv6 address field of the IPv6 header contains the home address, and the Segments Left field is zero. The IPsec Security Policy Database lookup MUST based on the mobile node's home address. (Yes, the grammar in the original is a little jumbled, but the requirement is clear ๐)
For instance, assuming there are no additional routing headers in this packet beyond those needed by Mobile IPv6, the correspondent node could set the fields in the packet's IPv6 header and routing header as follows:
- The Destination Address in the packet's IPv6 header is set to the mobile node's home address (the original destination address to which the packet was being sent).
- The routing header is initialized to contain a single route segment, containing the mobile node's care-of address copied from the Binding Cache entry. The Segments Left field is, however, temporarily set to zero.
The IP layer will insert the routing header before performing any necessary IPsec processing ๐ฆ Once all IPsec processing has been performed, the node swaps the IPv6 destination field with the Home Address field in the routing header, sets the Segments Left field to one, and sends the packet. This ensures the AH calculation is done on the packet in the form it will have on the receiver after advancing the routing header. Swapping is the whole move here ๐
Following the definition of a type 2 routing header in Section 6.4, this packet will be routed to the mobile node's care-of address, where it will be delivered to the mobile node (the mobile node has associated the care-of address with its network interface) ๐
Note that following the above conceptual model in an implementation creates some additional requirements for path MTU discovery since the layer that determines the packet size (e.g., TCP and applications using UDP) needs to be aware of the size of the headers added by the IP layer on the sending node ๐ธ Bestie, that's a whole thing to keep in mind ๐ญ
If, instead, the sending node has no Binding Cache entry for the destination address to which the packet is being sent, the sending node simply sends the packet normally, with no routing header โจ If the destination node is not a mobile node (or is a mobile node that is currently at home), the packet will be delivered directly to this node and processed normally by it. If, however, the destination node is a mobile node that is currently away from home, the packet will be intercepted by the mobile node's home agent and tunneled to the mobile node's current primary care-of address ๐ง
9.3.3. Sending Binding Error Messages
Sections 9.2 and 9.3.1 describe error conditions that lead to a need to send a Binding Error message ๐
A Binding Error message is sent directly to the address that appeared in the IPv6 Source Address field of the offending packet. If the Source Address field does not contain a unicast address, the Binding Error message MUST NOT be sent. Not sending it to a non-unicast address, periodt ๐
The Home Address field in the Binding Error message MUST be copied from the Home Address field in the Home Address destination option of the offending packet, or set to the unspecified address if no such option appeared in the packet ๐
Note that the IPv6 Source Address and Home Address field values discussed above are the values from the wire, i.e., before any modifications possibly performed as specified in Section 9.3.1 ๐
Binding Error messages SHOULD be subject to rate limiting in the same manner as is done for ICMPv6 messages [17] ๐ซถ
9.3.4. Receiving ICMP Error Messages
When the correspondent node has a Binding Cache entry for a mobile node, all traffic destined to the mobile node goes directly to the current care-of address of the mobile node using a routing header. Any ICMP error message caused by packets on their way to the care-of address will be returned in the normal manner to the correspondent node ๐ฆ
On the other hand, if the correspondent node has no Binding Cache entry for the mobile node, the packet will be routed through the mobile node's home link. Any ICMP error message caused by the packet on its way to the mobile node while in the tunnel will be transmitted to the mobile node's home agent. By the definition of IPv6 encapsulation [7], the home agent MUST relay certain ICMP error messages back to the original sender of the packet, which in this case is the correspondent node ๐
Thus, in all cases, any meaningful ICMP error messages caused by packets from a correspondent node to a mobile node will be returned to the correspondent node โจ If the correspondent node receives persistent ICMP Destination Unreachable messages after sending packets to a mobile node based on an entry in its Binding Cache, the correspondent node SHOULD delete this Binding Cache entry. Note that if the mobile node continues to send packets with the Home Address destination option to this correspondent node, they will be dropped due to the lack of a binding. For this reason it is important that only persistent ICMP messages lead to the deletion of the Binding Cache entry ๐ฅบ๐
9.4. Return Routability Procedure
This subsection specifies actions taken by a correspondent node during the return routability procedure ๐ง
9.4.1. Receiving Home Test Init Messages
Upon receiving a Home Test Init message, the correspondent node verifies the following:
- The packet MUST NOT include a Home Address destination option.
Any packet carrying a Home Test Init message that fails to satisfy this test MUST be silently ignored ๐
Otherwise, in preparation for sending the corresponding Home Test Message, the correspondent node checks that it has the necessary material to engage in a return routability procedure, as specified in Section 5.2. The correspondent node MUST have a secret Kcn and a nonce. If it does not have this material yet, it MUST produce it before continuing with the return routability procedure ๐
Section 9.4.3 specifies further processing ๐
9.4.2. Receiving Care-of Test Init Messages
Upon receiving a Care-of Test Init message, the correspondent node verifies the following:
- The packet MUST NOT include a Home Address destination option.
Any packet carrying a Care-of Test Init message that fails to satisfy this test MUST be silently ignored ๐
Otherwise, in preparation for sending the corresponding Care-of Test Message, the correspondent node checks that it has the necessary material to engage in a return routability procedure in the manner described in Section 9.4.1 ๐ธ
Section 9.4.4 specifies further processing โจ
9.4.3. Sending Home Test Messages
The correspondent node creates a home keygen token and uses the current nonce index as the Home Nonce Index. It then creates a Home Test message (Section 6.1.5) and sends it to the mobile node at the latter's home address ๐ฆ
9.4.4. Sending Care-of Test Messages
The correspondent node creates a care-of keygen token and uses the current nonce index as the Care-of Nonce Index. It then creates a Care-of Test message (Section 6.1.6) and sends it to the mobile node at the latter's care-of address ๐ง
9.5. Processing Bindings
This section explains how the correspondent node processes messages related to bindings. These messages are:
- Binding Update
- Binding Refresh Request
- Binding Acknowledgement
- Binding Error
9.5.1. Receiving Binding Updates โจ
Okay bestie, before a Binding Update gets accepted, the receiving node MUST validate it with the following tests ๐
- The packet MUST contain a unicast routable home address, either in the
Home Addressoption or in theSource Address, if theHome Addressoption is not present. ๐ฆ - The
Sequence Numberfield in the Binding Update is greater than theSequence Numberreceived in the previous valid Binding Update for this home address, if any. ๐ธ
If the receiving node has no Binding Cache entry for the indicated home address, it MUST accept any Sequence Number value in a received Binding Update from this mobile node. It's giving "fresh start" energy ๐ง
This Sequence Number comparison MUST be performed modulo 2**16, i.e., the number is a free running counter represented modulo 65536. ๐ข A Sequence Number in a received Binding Update is considered less than or equal to the last received number if its value lies in the range of the last received number and the preceding 32768 values, inclusive. For example, if the last received sequence number was 15, then messages with sequence numbers 0 through 15, as well as 32783 through 65535, would be considered less than or equal. The wrap-around math is lowkey iconic ๐
When the Home Registration (H) bit is not set, the following are also required:
- A Nonce Indices mobility option MUST be present, and the Home and Care-of Nonce Index values in this option MUST be recent enough to be recognized by the correspondent node. (Care-of Nonce Index values are not inspected for requests to delete a binding.) ๐
- The correspondent node MUST re-generate the home keygen token and the care-of keygen token from the information contained in the packet. It then generates the binding management key Kbm and uses it to verify the authenticator field in the Binding Update as specified in Section 6.1.7. ๐
- The Binding Authorization Data mobility option MUST be present, and its contents MUST satisfy rules presented in Section 5.2.6. Note that a care-of address different from the Source Address MAY have been specified by including an Alternate Care-of Address mobility option in the Binding Update. When such a message is received and the return routability procedure is used as an authorization method, the correspondent node MUST verify the authenticator by using the address within the Alternate Care-of Address in the calculations. โจ
- The Binding Authorization Data mobility option MUST be the last option and MUST NOT have trailing padding. ๐
If the Home Registration (H) bit is set, the Nonce Indices mobility option MUST NOT be present. No Nonce Indices option when H is set, bestie, that's the rule ๐
If the mobile node sends a sequence number that is not greater than the sequence number from the last valid Binding Update for this home address, then the receiving node MUST send back a Binding Acknowledgement with status code 135, and the last accepted sequence number in the Sequence Number field of the Binding Acknowledgement. ๐ญ Rejected but still helpful, that's the vibe.
If a binding already exists for the given home address and the home registration flag has a different value than the Home Registration (H) bit in the Binding Update, then the receiving node MUST send back a Binding Acknowledgement with status code 139 (registration type change disallowed). The home registration flag stored in the Binding Cache entry MUST NOT be changed. No flipping the registration type mid-stream, periodt ๐
If the receiving node no longer recognizes the Home Nonce Index value, Care-of Nonce Index value, or both values from the Binding Update, then the receiving node MUST send back a Binding Acknowledgement with status code 136, 137, or 138, respectively. ๐ฅ
Packets carrying Binding Updates that fail to satisfy all of these tests for any reason other than insufficiency of the Sequence Number, registration type change, or expired nonce index values, MUST be silently discarded. ๐คซ Ghosted, no reply, no drama.
If the Binding Update is valid according to the tests above, then the Binding Update is processed further as follows:
- The
Sequence Numbervalue received from a mobile node in a Binding Update is stored by the receiving node in its Binding Cache entry for the given home address. ๐ - If the Lifetime specified in the Binding Update is not zero, then this is a request to cache a binding for the home address. If the Home Registration (H) bit is set in the Binding Update, the Binding Update is processed according to the procedure specified in Section 10.3.1; otherwise, it is processed according to the procedure specified in Section 9.5.2. ๐ง
- If the Lifetime specified in the Binding Update is zero, then this is a request to delete the cached binding for the home address. In this case, the Binding Update MUST include a valid home nonce index, and the care-of nonce index MUST be ignored by the correspondent node. The generation of the binding management key depends then exclusively on the home keygen token (Section 5.2.5). If the Home Registration (H) bit is set in the Binding Update, the Binding Update is processed according to the procedure specified in Section 10.3.2; otherwise, it is processed according to the procedure specified in Section 9.5.3. ๐๏ธ
The specified care-of address MUST be determined as follows:
- If the Alternate Care-of Address option is present, the care-of address is the address in that option. ๐ก
- Otherwise, the care-of address is the
Source Addressfield in the packet's IPv6 header. ๐ฃ๏ธ
The home address for the binding MUST be determined as follows:
- If the Home Address destination option is present, the home address is the address in that option. ๐
- Otherwise, the home address is the
Source Addressfield in the packet's IPv6 header. ๐
9.5.2. Requests to Cache a Binding ๐งบ
This section is about a valid Binding Update that asks a node to cache a binding, where the Home Registration (H) bit is not set. Think of it as the "please remember me" request ๐ฅน
In this case, the receiving node SHOULD create a new entry in its Binding Cache for this home address, or update its existing Binding Cache entry for this home address, if such an entry already exists. The lifetime for the Binding Cache entry is initialized from the Lifetime field specified in the Binding Update, although this lifetime MAY be reduced by the node caching the binding; the lifetime for the Binding Cache entry MUST NOT be greater than the Lifetime value specified in the Binding Update. Any Binding Cache entry MUST be deleted after the expiration of its lifetime. โณ Nothing lives forever, not even a cache entry ๐
Note that if the mobile node did not request a Binding Acknowledgement, then it is not aware of the selected shorter lifetime. The mobile node may thus use route optimization and send packets with the Home Address destination option. As discussed in Section 9.3.1, such packets will be dropped if there is no binding. This situation is recoverable, but can cause temporary packet loss. ๐ฆ๐จ Oops, but it's fixable, so no panic bestie ๐ซถ
The correspondent node MAY refuse to accept a new Binding Cache entry if it does not have sufficient resources. A new entry MAY also be refused if the correspondent node believes its resources are utilized more efficiently in some other purpose, such as serving another mobile node with higher amount of traffic. In both cases the correspondent node SHOULD return a Binding Acknowledgement with status value 130. ๐ซ Rude but make it make sense, the resources are a limited bestie ๐ฅบ
9.5.3. Requests to Delete a Binding ๐๏ธ
This section is about a valid Binding Update that asks a node to delete a binding when the Home Registration (H) bit is not set. It's the "bye felicia" request ๐
Any existing binding for the given home address MUST be deleted. A Binding Cache entry for the home address MUST NOT be created in response to receiving the Binding Update. Gone means gone, no new entry sneaking in ๐ซ
If the Binding Cache entry was created by use of return routability nonces, the correspondent node MUST ensure that the same nonces are not used again with the particular home and care-of address. If both nonces are still valid, the correspondent node has to remember the particular combination of nonce indices, addresses, and sequence number as illegal until at least one of the nonces has become too old. ๐ No recycling those nonces, that's a no cap security move ๐ก๏ธ
9.5.4. Sending Binding Acknowledgements ๐
A Binding Acknowledgement may be sent to indicate receipt of a Binding Update as follows:
- If the Binding Update was discarded as described in Sections 9.2 or 9.5.1, a Binding Acknowledgement MUST NOT be sent. Otherwise, the treatment depends on the following rules. ๐ โโ๏ธ
- If the Acknowledge (A) bit is set in the Binding Update, a Binding Acknowledgement MUST be sent. Otherwise, the treatment depends on the next rule. ๐ฌ
- If the node rejects the Binding Update due to an expired nonce index, sequence number being out of window (Section 9.5.1), or insufficiency of resources (Section 9.5.2), a Binding Acknowledgement MUST be sent. If the node accepts the Binding Update, the Binding Acknowledgement SHOULD NOT be sent. ๐ค
If the node accepts the Binding Update and creates or updates an entry for this binding, the Status field in the Binding Acknowledgement MUST be set to a value less than 128. Otherwise, the Status field MUST be set to a value greater than or equal to 128. Values for the Status field are described in Section 6.1.8 and in the IANA registry of assigned numbers [30]. ๐ท๏ธ Less than 128 is the happy zone, 128 and up is the oof zone ๐
If the Status field in the Binding Acknowledgement contains the value 136 (expired home nonce index), 137 (expired care-of nonce index), or 138 (expired nonces), then the message MUST NOT include the Binding Authorization Data mobility option. Otherwise, the Binding Authorization Data mobility option MUST be included, and MUST meet the specific authentication requirements for Binding Acknowledgements as defined in Section 5.2. ๐
If the Source Address field of the IPv6 header that carried the Binding Update does not contain a unicast address, the Binding Acknowledgement MUST NOT be sent and the Binding Update packet MUST be silently discarded. Otherwise, the acknowledgement MUST be sent to the Source Address. Unlike the treatment of regular packets, this addressing procedure does not use information from the Binding Cache. However, a routing header is needed in some cases. If the Source Address is the home address of the mobile node, i.e., the Binding Update did not contain a Home Address destination option, then the Binding Acknowledgement MUST be sent to that address and the routing header MUST NOT be used. Otherwise, the Binding Acknowledgement MUST be sent using a type 2 routing header that contains the mobile node's home address. ๐งญ Routing header drama, but it's all sorted out ๐
9.5.5. Sending Binding Refresh Requests ๐
If a Binding Cache entry being deleted is still in active use when sending packets to a mobile node, then the next packet sent to the mobile node will be routed normally to the mobile node's home link. Communication with the mobile node continues, but the tunneling from the home network creates additional overhead and latency in delivering packets to the mobile node. ๐ข Still works, just extra slow, not it ๐ฌ
If the sender knows that the Binding Cache entry is still in active use, it MAY send a Binding Refresh Request message to the mobile node in an attempt to avoid this overhead and latency due to deleting and recreating the Binding Cache entry. This message is always sent to the home address of the mobile node. ๐จ Refresh before the entry dies, that's the move ๐
The correspondent node MAY retransmit Binding Refresh Request messages as long as the rate limitation is applied. The correspondent node MUST stop retransmitting when it receives a Binding Update. ๐ Once the Binding Update shows up, the nagging stops, iykyk ๐
9.6. Cache Replacement Policy ๐งน
okay so, conceptually a node keeps a separate timer for every single entry in its Binding Cache ๐ฐ๏ธ๐. When it creates or updates an entry because it got a Binding Update that it received and accepted, it sets that entry's timer to the Lifetime period. Any entry in a node's Binding Cache MUST be deleted once the Lifetime from the Binding Update that created or last updated it runs out. no exceptions bestie ๐
Each node's Binding Cache is, by necessity, going to be finite ๐ฅฒ. A node MAY use any reasonable local policy for managing the space in its Binding Cache โจ.
A node MAY choose to drop any entry already in its Binding Cache to make room for a new one ๐๏ธ. For example, a "least-recently used" (LRU) strategy for cache entry replacement should work well ๐, unless the Binding Cache is substantially insufficient (then it's giving struggle ๐). When entries are deleted, the correspondent node MUST follow the rules in Section 5.2.8 in order to guard the return routability procedure against replay attacks ๐ก๏ธ.
If the node sends a packet to a destination whose entry it already dropped from its Binding Cache, the packet will be routed through the mobile node's home link ๐ . The mobile node can detect this and establish a new binding if necessary ๐.
However, if the mobile node still thinks the binding exists, it may use route optimization and send packets with the Home Address destination option ๐ฆ. This can create temporary packet loss, as discussed earlier, in the context of binding lifetime reductions performed by the correspondent node (Section 9.5.2) ๐ญ.
10. Home Agent Operation ๐
10.1. Conceptual Data Structures ๐งฉ
Each home agent MUST maintain a Binding Cache and Home Agents List ๐.
The rules for maintaining a Binding Cache are the same for home agents and correspondent nodes, and we already covered them in Section 9.1 ๐.
The Home Agents List is maintained by each home agent and records info about each router on the same link that is acting as a home agent ๐๏ธ. This list is used by the dynamic home agent address discovery mechanism. A router counts as a home agent if it sends a Router Advertisement with the Home Agent (H) bit set. When the lifetime for a list entry (defined below) expires, that entry gets removed from the Home Agents List โณ. The Home Agents List is similar to the Default Router List that each host keeps for Neighbor Discovery [18] ๐ง . The Home Agents List MAY be implemented in any manner, as long as it's consistent with the external behavior described in this document โจ.
Each home agent keeps a separate Home Agents List for each link it serves as a home agent on ๐. A new entry gets created, or an existing one gets updated, whenever it receives a valid Router Advertisement with the Home Agent (H) bit set ๐จ. Each Home Agents List entry conceptually contains the following fields:
- The link-local IP address of a home agent on the link ๐. This address is learned from the
Source Addressof the Router Advertisements [18] received from the router. - One or more global IP addresses for this home agent ๐. Global addresses are learned through
Prefix Informationoptions with theRouter Address (R) bitset, received in Router Advertisements from this link-local address. Global addresses for the router in a Home Agents List entry MUST be deleted once the prefix associated with that address is no longer valid [18] ๐ โโ๏ธ. - The remaining lifetime of this Home Agents List entry โฐ. If a
Home Agent Information Optionis present in a Router Advertisement received from a home agent, the entry's lifetime gets initialized from theHome Agent Lifetimefield in that option (if present). Otherwise, it gets initialized from theRouter Lifetimefield in the received Router Advertisement. If the Home Agents List entry lifetime reaches zero, the entry MUST be deleted from the Home Agents List ๐. - The preference for this home agent ๐, where higher values mean a more preferable home agent. The preference value comes from the
Home Agent Preferencefield in the received Router Advertisement, if that advertisement has aHome Agent Information Option. Otherwise it's just the default value of 0. A home agent uses this preference to order the Home Agents List when it sends an ICMP Home Agent Address Discovery message ๐ .
10.2. Processing Mobility Headers ๐
All IPv6 home agents MUST observe the rules described in Section 9.2 when processing Mobility Headers ๐ซถ.
10.3. Processing Bindings ๐ฆ
10.3.1. Primary Care-of Address Registration โจ
okay bestie, so when a node gets a Binding Update ๐, it MUST validate it and figure out what type of Binding Update it is, following the steps in Section 9.5.1. ๐ It MUST also authenticate it the way Section 5.1 describes. There's an extra home-agent-only authorization step ๐ so that only the right node can control a particular home address. The home address basically points to the exact security association that has to be used. iykyk ๐ซถ
This section is about a valid, authorized Binding Update that asks to register the mobile node's primary care-of address ๐ โ๏ธ.
To begin, the home agent MUST run through this sequence of tests ๐งช:
- If the node only does correspondent node functionality, or hasn't been configured to act as a home agent, then the node MUST reject the Binding Update. It MUST also return a Binding Acknowledgement to the mobile node with
Statusset to131(home registration not supported). ๐ - Else, if the home address for the binding (the Home Address field in the packet's Home Address option) is not an on-link IPv6 address with respect to the home agent's current Prefix List, then the home agent MUST reject the Binding Update and SHOULD return a Binding Acknowledgement to the mobile node with
Statusset to132(not home subnet). ๐ - Else, if the home agent chooses to reject the Binding Update for any other reason (like not having enough resources to serve another mobile node as a home agent), then the home agent SHOULD return a Binding Acknowledgement with a
Statusvalue that shows the reason for the rejection. ๐ธ - A Home Address destination option MUST be present in the message. It MUST be validated as described in Section 9.3.1, with one extra rule: the Binding Cache entry existence test MUST NOT be done for IPsec packets when the Home Address option contains an address for which the receiving node could act as a home agent. ๐ฅ
If the home agent accepts the Binding Update, it MUST then create a new entry in its Binding Cache for this mobile node, or update the existing entry if one already exists ๐. The Home Address field in the Home Address option gives us the mobile node's home address.
The home agent MUST mark this Binding Cache entry as a home registration, which tells everyone that this node is serving as a home agent for this binding ๐. Binding Cache entries marked as a home registration MUST be excluded from the normal cache replacement policy used for the Binding Cache (Section 9.6), and they MUST NOT be removed from the Binding Cache until the Lifetime period expires. Protected, no cap ๐ก๏ธ.
Unless this home agent already has a binding for the given home address, the home agent MUST perform Duplicate Address Detection [19] on the mobile node's home link before returning the Binding Acknowledgement ๐. This makes sure no other node on the home link was using the mobile node's home address when the Binding Update showed up. If Duplicate Address Detection fails for the given home address or an associated link-local address, then the home agent MUST reject the complete Binding Update and MUST return a Binding Acknowledgement to the mobile node with Status set to 134 (Duplicate Address Detection failed). ๐ญ When the home agent sends a successful Binding Acknowledgement, it's promising the mobile node that its address(es) will stay unique for as long as the lifetime was granted for the binding ๐ค.
Which addresses get tested before accepting the Binding Update (and later defended with Duplicate Address Detection) depends on the Link-Local Address Compatibility (L) bit ๐งฉ:
L=0: Defend only the given address. Don't derive a link-local address.L=1: Defend both the given non-link-local unicast (home) address and the derived link-local address. The link-local address is derived by replacing the subnet prefix in the mobile node's home address with the link-local prefix.
The lifetime of the Binding Cache entry depends on a few factors โณ:
- The lifetime for the Binding Cache entry MUST NOT be greater than the Lifetime value specified in the Binding Update.
- The lifetime for the Binding Cache entry MUST NOT be greater than the remaining valid lifetime for the subnet prefix in the mobile node's home address specified with the Binding Update. The home agent works out that remaining valid lifetime from its own Prefix List entry [18].
The remaining preferred lifetime SHOULD NOT have any impact on the lifetime for the Binding Cache entry. ๐ โโ๏ธ
The home agent MUST remove a binding when the valid lifetime of the prefix associated with it expires. No exceptions, periodt ๐ .
- The home agent MAY further decrease the specified lifetime for the binding, for example based on a local policy. The resulting lifetime is stored by the home agent in the Binding Cache entry, and this Binding Cache entry MUST be deleted by the home agent after that lifetime expires ๐๏ธ.
No matter what the Acknowledge (A) bit says in the Binding Update, the home agent MUST return a Binding Acknowledgement to the mobile node, built like this ๐:
- The
Statusfield MUST be set to a value indicating success. The value1(accepted but prefix discovery necessary) MUST be used if the subnet prefix of the specified home address is deprecated, or becomes deprecated during the lifetime of the binding, or becomes invalid at the end of the lifetime. Otherwise, the value0MUST be used. To compare the binding and prefix lifetimes, the prefix lifetimes are first converted into units of four seconds by ignoring the two least significant bits ๐งฎ. - The Key Management Mobility Capability (K) bit is set if all of the following are true, and cleared otherwise ๐:
- The Key Management Mobility Capability (K) bit was set in the Binding Update.
- The IPsec security associations between the mobile node and the home agent have been established dynamically.
- The home agent has the capability to update its endpoint in the used key management protocol to the new care-of address every time it moves.
Depending on the final value of the bit in the Binding Acknowledgement, the home agent SHOULD take these actions ๐ง:
K = 0: Discard key management connections, if any, to the old care-of address. If the mobile node did not have a binding before sending this Binding Update, discard the connections to the home address too.K = 1: Move the peer endpoint of the key management protocol connection, if any, to the new care-of address.
- The Sequence Number field MUST be copied from the Sequence Number given in the Binding Update ๐ข.
- The Lifetime field MUST be set to the remaining lifetime for the binding, as set by the home agent in its home registration Binding Cache entry for the mobile node, as described above โฐ.
- If the home agent stores the Binding Cache entry in nonvolatile storage, then the Binding Refresh Advice mobility option MUST be omitted. Otherwise, the home agent MAY include this option to suggest that the mobile node refreshes its binding before the actual lifetime ends ๐.
If the Binding Refresh Advice mobility option is present, the Refresh Interval field in the option MUST be set to a value less than the Lifetime value being returned in the Binding Acknowledgement. That signals the mobile node SHOULD try to refresh its home registration at the shorter interval shown. The home agent MUST still retain the registration for the full Lifetime period, even if the mobile node doesn't refresh within the Refresh period. Main character energy, the home agent is not dropping you early ๐.
The rules for picking the Destination IP address (and possibly routing header construction) for the Binding Acknowledgement to the mobile node are the same as in Section 9.5.4 ๐บ๏ธ.
On top of that, the home agent MUST follow the procedure in Section 10.4.1 to intercept packets on the mobile node's home link addressed to the mobile node, while it's serving as the home agent for this mobile node ๐. The home agent MUST also be prepared to accept reverse-tunneled packets from the mobile node's new care-of address, as described in Section 10.4.5 ๐. Finally, the home agent MUST also propagate new home network prefixes, as described in Section 10.6 ๐โจ.
10.3.2. Primary Care-of Address De-Registration ๐งณ
okay so bindings need to get de-registered sometimes ๐ like when the mobile node gets back home, or when it knows it won't have any care-of addresses on the visited network anymore. it's giving closing the tab ๐ซถ
the Binding Update gets validated and authorized the same way as in the previous section, no cap ๐ but there's a twist! when the mobile node de-registers while it's at home, it MAY skip the Home Address destination option. if it does, the mobile node's home address is just the source IP address of that de-registration Binding Update. ๐ฆ this section covers how a valid Binding Update is processed when it asks the receiving node to stop being its home agent and de-register its primary care-of address. main character energy โจ
first up, the home agent MUST run this check before doing anything else:
- If the receiving node has no entry marked as a home registration in its Binding Cache for this mobile node, then this node MUST reject the Binding Update and SHOULD return a Binding Acknowledgement to the mobile node, in which the Status field is set to 133 (not home agent for this mobile node). ๐
if the home agent doesn't reject the Binding Update, then it MUST send back a Binding Acknowledgement that's built like this:
- The Status field MUST be set to a value 0, indicating success. ๐ธ
- The Key Management Mobility Capability (K) bit is set or cleared, and the actions based on its value are done the way the previous section describes. the mobile node's home address gets used as its new care-of address so the key management connection can move to a new endpoint ๐
- The Sequence Number field MUST be copied from the Sequence Number given in the Binding Update. ๐ข
- The Lifetime field MUST be set to zero. โณ
- The Binding Refresh Advice mobility option MUST be omitted. ๐
picking the Destination IP address (and building a routing header if one's needed) for that Binding Acknowledgement works exactly like the previous section ๐ง and when the Status field is greater than or equal to 128, the Source Address of the Binding Update is on the home link, and the Binding Update came from a mobile node on that same link, the home agent MUST send it to the mobile node's link-layer address. the home agent can grab that address from the Binding Update or find it with Neighbor Solicitation ๐
okay now the drama ๐ญ a race condition can happen when a mobile node sends a Binding Update to refresh its binding from the visited link, then moves home really quickly and sends a de-registration Binding Update. if that first Binding Update gets delayed, it can make the home agent create a brand new Binding Cache entry for a mobile node that just got home and already deleted its binding. then the mobile node can't use its home address from the home link. literally the worst ๐
to stop this, the home agent SHOULD NOT remove the Binding Cache entry right away after getting the de-registration Binding Update. it SHOULD mark the Binding Cache entry as invalid, and it MUST stop intercepting packets on the mobile node's home link that are addressed to the mobile node (Section 10.4.1). the home agent should wait for MAX_DELETE_BCE_TIMEOUT (Section 12) seconds before fully removing the Binding Cache entry ๐ซง so in that same scenario, if the home agent gets the delayed Binding Update that the mobile node sent from the visited link, it rejects it, because its sequence number is less than the last de-registration Binding Update received from the home link. the home agent then sends a Binding Acknowledgment with status '135' (Sequence number out of window) to the care-of address on the visited link. the mobile node can keep using its home address from the home link, and that's the vibe โจ๐
10.4. Packet Processing ๐
10.4.1. Intercepting Packets for a Mobile Node ๐ต๏ธโโ๏ธ
while a node is serving as the home agent for a mobile node, it MUST try to intercept packets on the mobile node's home link that are addressed to the mobile node. ๐งฒ
to do that, when a node starts serving as the home agent, it MUST have done Duplicate Address Detection (as specified in Section 10.3.1). after that, it MUST multicast a Neighbor Advertisement message [18] onto the home link on behalf of the mobile node. for the home address in the Binding Update, the home agent sends a Neighbor Advertisement message [18] to the all-nodes multicast address on the home link. this advertises the home agent's own link-layer address for that IP address, acting on behalf of the mobile node ๐ฃ and if the Link-Layer Address Compatibility (L) flag was set in the Binding Update, the home agent MUST do the same thing for the mobile node's link-local address ๐
every field in each Neighbor Advertisement message SHOULD be set the same way the mobile node would set it if it were sending this Neighbor Advertisement [18] while at home, with these exceptions:
- The Target Address in the Neighbor Advertisement MUST be set to the specific IP address for the mobile node. ๐ฏ
- The Advertisement MUST include a Target Link-layer Address option specifying the home agent's link-layer address. ๐ชช
- The Router (R) bit in the Advertisement MUST be set to zero. ๐ โโ๏ธ
- The Solicited (S) flag in the Advertisement MUST NOT be set, since it was not solicited by any Neighbor Solicitation. ๐ซ
- The Override (O) flag in the Advertisement MUST be set, indicating that the Advertisement SHOULD override any existing Neighbor Cache entry at any node receiving it. ๐
- The Source Address in the IPv6 header MUST be set to the home agent's IP address on the interface used to send the advertisement. ๐
any node on the home link that gets one of these Neighbor Advertisement messages will update its Neighbor Cache to link the mobile node's address with the home agent's link-layer address. so any future packets normally headed to the mobile node get sent to its home agent instead ๐ฆ multicast on the local link (like Ethernet) isn't guaranteed to be reliable, so the home agent MAY resend this Neighbor Advertisement message up to MAX_NEIGHBOR_ADVERTISEMENT (see [18]) times to boost reliability. some nodes on the home link might still miss every Neighbor Advertisement, but they'll eventually notice the link-layer address change for the mobile node's address using Neighbor Unreachability Detection [18] ๐ฐ๏ธ
while a node is serving as a home agent for some mobile node, the home agent uses IPv6 Neighbor Discovery [18] to intercept unicast packets on the home link that are addressed to the mobile node. to pull that off, the home agent MUST act as a proxy for this mobile node and reply to any Neighbor Solicitations it receives for it. when a home agent gets a Neighbor Solicitation, it MUST check whether the Target Address in the message matches the address of any mobile node that has a Binding Cache entry marked as a home registration ๐
if there's a match in the home agent's Binding Cache, the home agent MUST reply to that Neighbor Solicitation with a Neighbor Advertisement that gives the home agent's own link-layer address as the link-layer address for the specified Target Address. plus, the Router (R) bit in the Advertisement MUST be set to zero. being a proxy like this lets other nodes on the mobile node's home link resolve the mobile node's address, and lets the home agent defend those addresses on the home link during Duplicate Address Detection [18] ๐ก๏ธ๐
10.4.2. Processing Intercepted Packets ๐ฆ
for any packet sent to a mobile node from its home agent (where the home agent is the original sender), the home agent is acting as a correspondent node of that mobile node for this packet, so the procedures in Section 9.3.2 apply ๐ the home agent then uses a routing header to send the packet to the mobile node through the primary care-of address in the home agent's Binding Cache ๐ค๏ธ
while the mobile node is away from home, the home agent intercepts any packets on the home link addressed to the mobile node's home address, as described in Section 10.4.1. to forward each intercepted packet to the mobile node, the home agent MUST tunnel it using IPv6 encapsulation [7]. when a home agent encapsulates an intercepted packet to forward it, it sets the Source Address in the new tunnel IP header to its own IP address, and it sets the Destination Address in the tunnel IP header to the mobile node's primary care-of address. when the mobile node receives it, normal processing of the tunnel header [7] decapsulates the packet and the mobile node processes the original packet ๐
โ ๏ธ packets addressed to the mobile node's link-local address MUST NOT be tunneled to the mobile node. these packets MUST be discarded instead, and the home agent SHOULD return an ICMP Destination Unreachable, Code 3, message to the packet's Source Address (unless that Source Address is a multicast address). no tunneling for link-local, bestie ๐ซ
interception and tunneling of the following multicast addressed packets on the home network only happen if the home agent supports multicast group membership control messages from the mobile node, as described in the next section ๐ถ multicast packets follow similar limits to the ones above for unicast packets addressed to the mobile node's link-local address. multicast packets addressed to a multicast address with link-local scope [16], which the mobile node is subscribed to, MUST NOT be tunneled to the mobile node. these packets SHOULD be silently discarded (after being delivered to other local multicast recipients). multicast packets addressed to a multicast address with a scope bigger than link-local but smaller than global (like site-local and organization-local [16]), which the mobile node is subscribed to, SHOULD NOT be tunneled to the mobile node. multicast packets addressed with global scope, which the mobile node has successfully subscribed to, MUST be tunneled to the mobile node ๐
last but not least ๐ before tunneling a packet to the mobile node, the home agent MUST perform any IPsec processing indicated by the security policy data base ๐โจ
10.4.3. Multicast Membership Control โจ
okay bestie, this section is the prerequisite for the multicast data packet forwarding we just went through ๐ . If this support isn't provided, multicast group membership control messages get silently ignored ๐.
So the home agent SHOULD be capable of receiving tunneled multicast group membership control information from the mobile node. That's how it figures out which groups the mobile node has subscribed to, so it can forward multicast packets from the home network to all the right mobile nodes ๐ฆ. These membership messages are Listener Report messages from Multicast Listener Discovery (MLD) [9], or from other protocols like [41].
The mobile node is the one who issues these messages, but they get sent through the reverse tunnel to the home agent ๐ธ. The mobile node sends them whenever it decides to start receiving packets for a multicast group, or when it's responding to an MLD Query from the home agent. And when it's no longer interested in a group, it sends control messages to turn off reception for that group. Bye, group ๐.
To get the mobile node's current group membership, the home agent must periodically transmit MLD Query messages through the tunnel to the mobile node. These periodic queries keep the home agent's record accurate, even when some of the mobile node's MLD group membership messages get lost along the way ๐ง.
All MLD packets are sent directly between the mobile node and the home agent ๐. These packets all go to a link-scope multicast address and have a hop limit of 1, so there's no direct forwarding of them between the home network and the mobile node. The MLD packets between the two are encapsulated in the same tunnel header used for the other packet flows between the mobile node and home agent.
Here's a fun detail: even though MLD packets use a link-local source address, nothing depends on those addresses being unique, and they don't trigger direct responses. All MLD messages go to multicast destinations. But mobile nodes might pick identical link-local source addresses for their MLD function, so to avoid confusion, the home agent has to figure out which mobile node actually issued a particular MLD message. It can do that by noting which tunnel the MLD arrived through, which IPsec security association (SA) was used, or by some other distinguishing means ๐ฅ.
This specification doesn't put any requirement on how the functions in this section or the multicast forwarding in Section 10.4.2 get achieved. When this was written, people thought the home agent would need a full IPv6 multicast router function. But it might be possible to get the same effects with a "proxy MLD" application paired with kernel multicast forwarding. That could be the subject of future specifications ๐.
10.4.4. Stateful Address Autoconfiguration
This section explains how home agents support stateful address autoconfiguration mechanisms, like DHCPv6 [31], for mobile nodes ๐. If this support isn't provided, then the M and O bits must remain cleared on the Mobile Prefix Advertisement Messages. And any mobile node that sends DHCPv6 messages to a home agent without this support won't get a response ๐.
If DHCPv6 is used, the packets go out with link-local source addresses, either to a link-scope multicast address or to a link-local address โจ. A mobile node that wants to find a DHCPv6 service can reverse tunnel standard DHCPv6 packets to the home agent. Since these link-scope packets can't be forwarded onto the home network, the home agent has to implement either a DHCPv6 relay agent or a DHCPv6 server function itself. The arriving tunnel or IPsec SA of the DHCPv6 link-scope messages from the mobile node must be noted, so the DHCPv6 responses can get sent back to the right mobile node ๐ซถ. And DHCPv6 messages sent to the mobile node with a link-local destination must be tunneled within the same tunnel header used for other packet flows.
10.4.5. Handling Reverse-Tunneled Packets
Unless a binding has been established between the mobile node and a correspondent node, traffic from the mobile node to that correspondent node goes through a reverse tunnel ๐ฆ. Home agents MUST support reverse tunneling, and here's how it works:
- The tunneled traffic arrives at the home agent's address using IPv6 encapsulation [7].
- Depending on the security policies the home agent uses, reverse-tunneled packets MAY be discarded unless they come with a valid ESP header. Supporting authenticated reverse tunneling lets the home agent protect the home network and correspondent nodes from malicious nodes pretending to be a mobile node ๐ก๏ธ.
- Otherwise, when a home agent decapsulates a tunneled packet from the mobile node, the home agent MUST verify that the Source Address in the tunnel IP header is the mobile node's primary care-of address. Otherwise, any node on the Internet could send traffic through the home agent and escape ingress filtering limitations ๐ญ. This simple check forces an attacker to know where the real mobile node currently is and to be able to get past ingress filtering. This check isn't necessary if the reverse-tunneled packet is protected by ESP in tunnel mode.
10.4.6. Protecting Return Routability Packets
The return routability procedure, from Section 5.2.5, assumes that the confidentiality of the Home Test Init and Home Test messages is protected while they're tunneled between the home agent and the mobile node ๐. So the home agent MUST support tunnel mode IPsec ESP to protect packets that belong to the return routability procedure. A non-null encryption transform and an authentication algorithm MUST be available. It isn't necessary to tell apart the different kinds of packets during the return routability procedure.
Security associations are needed to provide this protection. When the mobile node's care-of address changes because an accepted Binding Update came in, the next packets sent using these security associations need special treatment ๐. The home agent MUST set the new care-of address as the destination address of these packets, as if the outer header destination address in the security association had changed.
The above protection SHOULD be used with all mobile nodes. Whether it's in use is controlled by how the IPsec security policy database is configured, both at the mobile node and at the home agent โญ.
As described earlier, the Binding Update and Binding Acknowledgement messages need protection between the home agent and the mobile node. The Mobility Header protocol carries both of these messages, along with the return routability messages. From the point of view of the security policy database, these messages look exactly the same ๐. When IPsec is used to protect return routability signaling or payload packets, this protection MUST only be applied to the return routability packets entering the IPv6 encapsulated tunnel interface between the mobile node and the home agent. One way to do that is to define the security policy database entries specifically for the tunnel interface. In other words, the policy entries aren't generally applied to all traffic on the physical interface(s) of the nodes. They're only applied to traffic that enters the tunnel. This works by using per-interface security policy database entries [3] specific to the tunnel interface (the node's attachment to the tunnel [6]) ๐.
10.5. Dynamic Home Agent Address Discovery
This section describes an optional mechanism that lets a home agent help mobile nodes discover the addresses of other home agents on the mobile node's home network ๐งโโ๏ธ. The home agent keeps track of the other home agents on the same link and responds to queries that the mobile node sends.
10.5.1. Receiving Router Advertisement Messages โจ
okay so every link where a router is acting as a home agent ๐ , it keeps a Home Agents List ๐ of all the other home agents on that link. This list powers dynamic home agent address discovery, and the mobile node uses it the way Section 11.4.1 describes. ๐ซถ The info gets collected from the periodic unsolicited multicast Router Advertisements, kinda like how every host keeps a Default Router List for Neighbor Discovery [18]. The Router Advertisements we care about come from each (other) home agent on the link, and their Home Agent (H) bit is set. ๐ฆ
When a valid Router Advertisement shows up (valid as defined by the Neighbor Discovery processing algorithm [18]), the home agent does these steps on top of whatever Neighbor Discovery already asks of it ๐:
- If the Home Agent (H) bit in the Router Advertisement is not set, delete the sending node's entry in the current Home Agents List (if one exists). Skip all the following steps. ๐
- Otherwise, grab the Source Address from the IP header of the Router Advertisement. This is the link-local IP address on this link of the home agent that sent it [18]. ๐ธ
- Figure out the preference for this home agent. If the Router Advertisement has a Home Agent Information Option, the preference comes from its Home Agent Preference field. Otherwise, the default preference of 0 MUST be used. ๐
- Figure out the lifetime for this home agent. If the Router Advertisement has a Home Agent Information Option, the lifetime comes from its Home Agent Lifetime field. Otherwise, the lifetime from the Router Lifetime field in the Router Advertisement SHOULD be used. โญ
- If the sending home agent's link-local address is already in this home agent's Home Agents List and the received home agent lifetime is zero, delete that entry immediately. ๐ญ
- Otherwise, if the sending home agent's link-local address is already in the receiving home agent's Home Agents List, reset its lifetime and preference to the values we just figured out. ๐ฅ
- If the sending home agent's link-local address is not already in the Home Agents List and its lifetime is non-zero, create a new entry and set its lifetime and preference to those same values. ๐ง
- If the sending home agent's entry wasn't deleted in the steps above, work out its global address(es) from each Prefix Information option in this Advertisement that has the Router Address (R) bit set (Section 7.2). Add all of those global addresses to the list of global addresses in that Home Agents List entry. ๐
A home agent SHOULD keep an entry in its Home Agents List for each valid home agent address until that entry's lifetime runs out. After that, the entry MUST be deleted. โณ๐
Here's the discovery part ๐. As Section 11.4.1 explains, a mobile node tries dynamic home agent address discovery by sending an ICMP Home Agent Address Discovery Request message to the Mobile IPv6 Home-Agents anycast address [8] for its home IP subnet prefix. When a home agent that serves this subnet gets that request, it SHOULD send back an ICMP Home Agent Address Discovery Reply message to the mobile node, with the Source Address of the Reply packet set to one of the home agent's global unicast addresses. The Home Agent Addresses field in the Reply is built like this:
- The Home Agent Addresses field SHOULD contain all global IP addresses for each home agent currently listed in this home agent's own Home Agents List (Section 10.1). ๐
- The IP addresses in the Home Agent Addresses field SHOULD be listed in order of decreasing preference values. That preference is either the advertised preference from a Home Agent Information option, or the default preference of 0 if none was advertised (or the configured home agent preference for this home agent itself). ๐
- Among home agents with equal preference, their IP addresses in the Home Agent Addresses field SHOULD be listed in an order that's randomized with respect to the other home agents with equal preference, every time this home agent returns a Home Agent Address Discovery Reply message. ๐
- If more than one global IP address belongs to a home agent, those addresses SHOULD be listed in a randomized order. ๐ฆ
- The home agent SHOULD trim the number of home agent IP addresses so the packet fits within the minimum IPv6 MTU [6]. The addresses picked for the packet SHOULD come from the complete list and have the highest preference. This limit exists to avoid the Reply message getting fragmented (or rejected by an intermediate router with an ICMP Packet Too Big message [17]). ๐ซ
10.6. Sending Prefix Information to the Mobile Node ๐ธ
10.6.1. List of Home Network Prefixes ๐บ๏ธ
Mobile IPv6 makes sure the mobile node gets relevant prefix info while it's away from home ๐งณ. That way it can use the prefixes for home address configuration and for network renumbering. In this setup, away-from-home mobile nodes receive Mobile Prefix Advertisement messages. These messages carry Prefix Information Options for the prefixes configured on the home agent's home subnet interface(s). ๐
If there are multiple home agents, the advertisements from different ones might differ, and then the mobile node can't use a particular home address after switching to another home agent ๐ฌ. To keep mobile nodes getting the same info from every home agent, it's preferred that all the home agents on the same link are configured the same way. โจ
To help with this, the home agent keeps an eye on the prefixes advertised by itself and by the other home agents on the home link ๐. Neighbor Discovery (RFC 4861 [18]) is totally fine with two routers advertising different sets of prefixes on the same link. For home agents, though, those differences should be caught for a given home address, because the mobile node only talks to one home agent at a time and needs the full set of prefixes assigned to the home link. All other comparisons of Router Advertisements follow Section 6.2.7 of RFC 4861. ๐ซถ
10.6.2. Scheduling Prefix Deliveries ๐
A home agent serving a mobile node schedules delivery of new prefix info to that node whenever any of these happen ๐ :
MUST:
- The state of the flags changes for the prefix of the mobile node's registered home address. ๐ฉ
- The valid or preferred lifetime is reconfigured or changes for any reason other than advancing real time. โฐ
- The mobile node asks for the info with a Mobile Prefix Solicitation (see Section 11.4.2). ๐โโ๏ธ
SHOULD:
- A new prefix is added to the home subnet interface(s) of the home agent. ๐
MAY:
- The valid or preferred lifetime or the state of the flags changes for a prefix that isn't used in any Binding Cache entry for this mobile node. ๐
Here's how the home agent decides when to send prefix info to the mobile node ๐ง :
- If a mobile node sends a solicitation, answer right away. โก
- If no Mobile Prefix Advertisement has gone to the mobile node in the last MaxMobPfxAdvInterval seconds (see Section 13), make sure a transmission is scheduled. The actual send time gets randomized, as described below. ๐ฒ
- If a prefix matching the mobile node's home registration gets added to the home subnet interface, or its info changes in any way that doesn't deprecate the mobile node's address, make sure a transmission is scheduled. The actual send time gets randomized, as described below. ๐
- If a home registration expires, cancel any scheduled advertisements to the mobile node. ๐
The prefix list always gets sent in its entirety, no matter what. ๐ฆ
If the home agent has already scheduled a Mobile Prefix Advertisement to the mobile node, it replaces that advertisement with the new one, to go out at the scheduled time. ๐
Otherwise, the home agent works out a fresh RAND_ADV_DELAY, which offsets the scheduled transmission from the current time. First, figure out the maximum delay for the scheduled Advertisement:
MaxScheduleDelay = min (MaxMobPfxAdvInterval, Preferred Lifetime),
where MaxMobPfxAdvInterval is as defined in Section 12. Then, compute the final delay for the advertisement:
RAND_ADV_DELAY = MinMobPfxAdvInterval +
(rand() % abs(MaxScheduleDelay - MinMobPfxAdvInterval))
Here rand() returns a random integer value in the range of 0 to the maximum possible integer value. ๐ฐ This computation is expected to ease bursts of advertisements when prefix information changes ๐. On top of that, a home agent MAY further reduce the rate of packet transmission by delaying individual advertisements even more, when needed to avoid overwhelming local network resources ๐งโโ๏ธ. The home agent SHOULD keep periodically retransmitting an unsolicited Advertisement to the mobile node, until the mobile node acknowledges it by sending a Mobile Prefix Solicitation ๐.
The home agent MUST wait PREFIX_ADV_TIMEOUT (see Section 12) before the first retransmission, and it MUST double the retransmission wait time for every retransmission after that, until PREFIX_ADV_RETRIES attempts (see Section 12) have been tried ๐. If the mobile node's bindings expire before the matching Binding Update arrives, the home agent MUST NOT attempt any more retransmissions, even if not all PREFIX_ADV_RETRIES have gone out ๐ช. Meanwhile, if the mobile node sends another Binding Update without returning home, the home agent SHOULD start sending the unsolicited Advertisement again ๐.
If some condition from above happens on the home link and causes another Prefix Advertisement to go to the mobile node before the mobile node has acknowledged the previous one, the home agent SHOULD combine the Prefix Information options from the unacknowledged Mobile Prefix Advertisement into a new Advertisement ๐งฉ. Then the home agent throws away the old Advertisement ๐๏ธโจ.
10.6.3. Sending Advertisements โจ
okay so bestie, when the home agent sends a Mobile Prefix Advertisement to the mobile node, it MUST build the packet like this ๐
- The Source Address in the IPv6 header MUST be set to the home agent's IP address that the mobile node used for its current home registration, or to its default global home agent address if there's no binding yet ๐
- If the advertisement was solicited, it MUST go to the source address of the solicitation ๐ซถ But if it was triggered by prefix changes or renumbering, the destination is the mobile node's home address from the binding that set off the rule ๐ฆ
- A type 2 routing header MUST be included, carrying the mobile node's home address ๐ธ
- IPsec headers MUST be supported and SHOULD be used ๐โจ
- The home agent MUST send the packet the same way it would send any other unicast IPv6 packet it originates ๐
- Set the Managed Address Configuration (M) flag if that flag was set in any of the Router Advertisements the prefix information was learned from, including the ones this home agent sent ๐
- Set the Other Stateful Configuration (O) flag if that flag was set in any of the Router Advertisements the prefix information was learned from, including the ones this home agent sent ๐ง
10.6.4. Lifetimes for Changed Prefixes ๐
as we covered in Section 10.3.1, the lifetime the home agent returns in a Binding Acknowledgement MUST NOT be greater than the remaining valid lifetime of the subnet prefix in the mobile node's home address ๐ญ this limit is what stops the mobile node from using its home address once it has become invalid ๐
11. Mobile Node Operation ๐
11.1. Conceptual Data Structures ๐
each mobile node MUST maintain a Binding Update List ๐
the Binding Update List records info for each Binding Update this mobile node sent, as long as the binding's lifetime hasn't expired yet ๐ธ it includes every binding the mobile node sent to either its home agent or correspondent nodes, and it also holds Binding Updates that are waiting for the return routability procedure to finish before they can be sent ๐ฆ but for multiple Binding Updates going to the same destination address, the list only keeps the most recent one (the one with the greatest Sequence Number value) sent to that destination ๐ the Binding Update List MAY be implemented in any way, as long as it's consistent with the external behavior described in this document ๐ซถ
each Binding Update List entry conceptually contains these fields:
- The IP address of the node the Binding Update was sent to ๐
- The home address that Binding Update was sent for ๐
- The care-of address sent in that Binding Update. This is needed so the mobile node can tell whether it already sent a Binding Update giving its new care-of address to this destination after changing care-of addresses ๐ง
- The initial value of the Lifetime field sent in that Binding Update ๐
- The remaining lifetime of that binding. It starts from the Lifetime value sent in the Binding Update and counts down until it hits zero, and then this entry MUST be deleted from the Binding Update List โณ๐
- The maximum value of the Sequence Number field sent in previous Binding Updates to this destination. The Sequence Number field is 16 bits long, and all comparisons between Sequence Number values MUST be performed modulo 2**16 (see Section 9.5.1) ๐ขโจ
- The time a Binding Update was last sent to this destination, which is needed to enforce the rate limiting restriction on sending Binding Updates ๐ฐ๏ธ
- The state of any retransmissions needed for this Binding Update. This includes the time left until the next retransmission attempt and the current state of the exponential back-off mechanism ๐
- A flag saying whether future Binding Updates should be sent to this destination. The mobile node sets this flag in the entry when it receives an ICMP Parameter Problem, Code 1, error message in response to a return routability message or Binding Update sent to that destination, as described in Section 11.3.5 ๐ฉ
the Binding Update List is used to decide whether a particular packet goes directly to the correspondent node or gets tunneled via the home agent (see Section 11.3.1) ๐
the Binding Update List also conceptually holds the following data for running the return routability procedure. This data only matters for Binding Updates sent to correspondent nodes ๐ต๏ธโโ๏ธ
- The time a Home Test Init or Care-of Test Init message was last sent to this destination, which is needed to enforce the rate limiting restriction for the return routability procedure โฑ๏ธ
- The state of any retransmissions needed for this return routability procedure. This includes the time left until the next retransmission attempt and the current state of the exponential back-off mechanism ๐
- Cookie values used in the Home Test Init and Care-of Test Init messages ๐ช
- Home and care-of keygen tokens received from the correspondent node ๐๏ธ
- Home and care-of nonce indices received from the correspondent node ๐
- The time each of the tokens and nonces was received from the correspondent node, which is needed to reuse them while moving ๐โโ๏ธ๐จ
11.2. Processing Mobility Headers ๐
all IPv6 mobile nodes MUST observe the rules described in Section 9.2 when processing Mobility Headers ๐ โจ
11.3. Packet Processing ๐ฆ
11.3.1. Sending Packets While Away from Home โ๏ธ
okay so, while a mobile node is away from home, it keeps its home address AND uses one or more care-of addresses ๐งณ when it sends a packet while away from home, a mobile node MAY choose among these to pick the source address for the packet, like this:
- bestie, protocols layered over IP will usually treat the mobile node's home address as its IP source address for most packets ๐ for packets that are part of transport-level connections set up while the mobile node was at home, the mobile node MUST use its home address ๐ and for packets that are part of transport-level connections the mobile node might still be using after moving somewhere new, the mobile node SHOULD use its home address in this way ๐ซถ if a binding exists, the mobile node SHOULD send the packets directly to the correspondent node ๐ฏ otherwise, if a binding does not exist, the mobile node MUST use reverse tunneling ๐
- the mobile node MAY choose to directly use one of its care-of addresses as the source of the packet, without needing a Home Address option in the packet โจ this is especially giving for short-term communication that can easily be retried if it fails ๐โโ๏ธ using the care-of address as the source for these queries will generally have lower overhead than using the home address, since no extra options need to be used in either the query or its reply ๐ these packets can be routed normally, straight between their source and destination, without relying on Mobile IPv6 ๐ฆ if an application on the mobile node has no particular knowledge that the communication fits within this general type of communication, however, the mobile node should not use its care-of address as the source of the packet in this way ๐
The choice of the most efficient communications method is application specific, and it's outside the scope of this specification ๐ธ the APIs needed to control that choice are also out of scope. One example of such an API is described in the IPv6 Socket API for Source Address Selection specification [44] ๐ง
- while it's not at its home link, the mobile node MUST NOT use the Home Address destination option when communicating with link-local peers ๐ซ similarly, the mobile node MUST NOT use the Home Address destination option for IPv6 Neighbor Discovery [18] packets ๐
Detailed operation of these cases is described later in this section and also discussed in [33] ๐
when a packet is sent by a mobile node while it's at home, no special Mobile IPv6 processing is required ๐ก likewise, if the mobile node uses any address other than one of its home addresses as the source of a packet sent while away from home, no special Mobile IPv6 processing is required ๐ either way, the packet is simply addressed and transmitted like any normal IPv6 packet ๐ฉท
now, for packets sent by the mobile node while it's away from home using its home address as the source, special Mobile IPv6 processing of the packet IS required ๐ there are two ways to do this:
Route Optimization
This way of delivering packets doesn't go through the home network, and it typically enables faster and more reliable transmission ๐
The mobile node needs to make sure a Binding Cache entry exists for its home address, so that the correspondent node can process the packet (Section 9.3.1 specifies the rules for Home Address Destination Option Processing at a correspondent node) ๐ the mobile node SHOULD examine its Binding Update List for an entry that meets the following conditions:
- the
Source Addressfield of the packet being sent is equal to the home address in the entry - the
Destination Addressfield of the packet being sent is equal to the address of the correspondent node in the entry - one of the mobile node's current care-of addresses appears as the care-of address in the entry
- the entry indicates that a binding has been successfully created
- the remaining lifetime of the binding is greater than zero
When these conditions are met, the mobile node knows that the correspondent node has a suitable Binding Cache entry ๐ฅฐ
A mobile node SHOULD arrange to supply the home address in a Home Address option, and it MUST set the IPv6 header's Source Address field to the care-of address that the mobile node has registered to use with this correspondent node ๐ง the correspondent node will then use the address supplied in the Home Address option to do the job that the Source Address in the IPv6 header normally does ๐ช the mobile node's home address is then passed up to higher protocol layers and applications ๐ซ
Specifically:
- construct the packet using the mobile node's home address as the packet's
Source Address, the same way as if the mobile node were at home ๐ this includes calculating upper-layer checksums using the home address as the source value - insert a Home Address option into the packet, with the
Home Addressfield copied from the original value of the packet'sSource Addressfield ๐ - change the
Source Addressfield in the packet's IPv6 header to one of the mobile node's care-of addresses ๐ this will typically be the mobile node's current primary care-of address, but it MUST be an address assigned to the interface on the link being used ๐
By putting the care-of address in the IPv6 header's Source Address and the home address in the Home Address option instead, the packet can safely pass through any router implementing ingress filtering [27] ๐ก๏ธโจ
Reverse Tunneling
This is the mechanism that tunnels packets via the home agent ๐ it's not as efficient as the mechanism above, but it's needed if there is no binding yet with the correspondent node ๐ญ
This mechanism is used for packets that have the mobile node's home address as the Source Address in the IPv6 header, or with multicast control protocol packets as described in Section 11.3.4 ๐ specifically:
- the packet is sent to the home agent using IPv6 encapsulation [7] ๐ฆ
- the
Source Addressin the tunnel packet is the primary care-of address as registered with the home agent ๐ - the
Destination Addressin the tunnel packet is the home agent's address ๐ฐ
Then, the home agent passes the encapsulated packet to the correspondent node ๐
11.3.2. Interaction with Outbound IPsec Processing ๐
This section sketches the interaction between outbound Mobile IPv6 processing and outbound IP Security (IPsec) processing for packets sent by a mobile node while away from home ๐บ๏ธ any specific implementation MAY use algorithms and data structures other than the ones suggested here, but its processing MUST be consistent with the effect of the operation described here and with the relevant IPsec specifications ๐งฉ in the steps below, it is assumed that IPsec is being used in transport mode [3] and that the mobile node is using its home address as the source for the packet (from the point of view of higher protocol layers or applications, as described in Section 11.3.1) ๐ซง
- the packet is created by higher-layer protocols and applications (e.g., by TCP) as if the mobile node were at home and Mobile IPv6 were not being used ๐ฅน
- determine the outgoing interface for the packet. (Note that the selection between reverse tunneling and route optimization may imply different interfaces, particularly if tunnels are considered interfaces as well.) ๐
- as part of outbound packet processing in IP, the packet is compared against the IPsec security policy database to determine what processing is required for the packet [3] ๐
- if IPsec processing is required, the packet is either mapped to an existing security association (or SA bundle), or a new SA (or SA bundle) is created for the packet, following the procedures defined for IPsec ๐
- since the mobile node is away from home, it is using either reverse tunneling or route optimization to reach the correspondent node ๐ค๏ธ
If reverse tunneling is used, the packet is constructed in the normal manner and then tunneled through the home agent ๐
If route optimization is in use, the mobile node inserts a Home Address destination option into the packet, replacing the Source Address in the packet's IP header with the care-of address used with this correspondent node, as described in Section 11.3.1 ๐ the Destination Options header in which the Home Address destination option is inserted MUST appear in the packet after the routing header, if present, and before the IPsec (AH [4] or ESP [5]) header, so that the Home Address destination option is processed by the destination node before the IPsec header is processed ๐ง
Finally, once the packet is fully assembled, the necessary IPsec authentication (and encryption, if required) processing is performed on the packet, initializing the Authentication Data in the IPsec header ๐
The treatment of destination options described in RFC 4302 is extended as follows. The AH authentication data MUST be calculated as if the following were true:
- the IPv6 source address in the IPv6 header contains the mobile node's home address, and
- the
Home Addressfield of the Home Address destination option (Section 6.3) contains the new care-of address.
- this allows, but does not require, the receiver of a packet containing a Home Address destination option to exchange the two fields of the incoming packet to reach the situation above, which simplifies processing for all subsequent packet headers ๐ however, such an exchange is not required, as long as the result of the authentication calculation remains the same ๐ค
When an automated key management protocol is used to create new security associations for a peer, it's important to make sure the peer can send the key management protocol packets to the mobile node ๐ซข this may not be possible if the peer is the home agent of the mobile node and the purpose of the security associations would be to send a Binding Update to the home agent ๐ฌ packets addressed to the home address of the mobile node can't be used before the Binding Update has been processed ๐ โโ๏ธ for the default case of using IKEv2 [24] as the automated key management protocol, these problems can be avoided by the following requirements when communicating with its home agent:
- when the mobile node is away from home, it MUST use its care-of address as the Source Address of all packets it sends as part of the key management protocol (without using Mobile IPv6 for these packets, as suggested in Section 11.3.1) ๐๏ธ
The Key Management Mobility Capability (K) bit in Binding Updates and Acknowledgements can be used to avoid the need to rerun IKEv2 upon movements ๐ฆโจ
11.3.3. Receiving Packets While Away from Home โจ
okay so while the mobile node is away from home ๐ , packets addressed to its home address can reach it in two ways ๐
- Packets from a correspondent node that doesn't have a Binding Cache entry for the mobile node get sent to the home address, get captured by the home agent, and get tunneled over to the mobile node ๐
- Packets from a correspondent node that has a Binding Cache entry with the mobile node's current care-of address get sent using a type 2 routing header ๐ฆ. The packet is addressed to the care-of address, and the final hop in the routing header points it at the home address. Processing that last hop is entirely internal to the mobile node, since the care-of address and home address are both addresses within the mobile node ๐ซถ
For packets that come in the first way, the mobile node MUST check that the IPv6 source address of the tunneled packet is the IP address of its home agent ๐. With this method, the mobile node may also send a Binding Update to the original sender, as described in Section 11.7.2 and subject to the rate limiting defined in Section 11.8. The mobile node MUST also process the received packet the way IPv6 encapsulation [7] defines it. That means the inner packet gets handled normally by upper-layer protocols inside the mobile node, as if it had been addressed (only) to the mobile node's home address ๐
For packets that come in the second way, the rules below mean the packet still gets processed normally by upper-layer protocols, as if it had been addressed to the home address ๐
A node receiving a packet addressed to itself (i.e., one of the node's addresses is in the IPv6 destination field) follows the next header chain of headers and processes them. When it runs into a type 2 routing header during this processing, it does the following checks. If any of these checks fail, the node MUST silently discard the packet ๐
- The length field in the routing header is exactly 2.
- The segments left field in the routing header is 1 on the wire. (But implementations may process the routing header so that the value may become 0 after the routing header has been processed, but before the rest of the packet is processed.)
- The Home Address field in the routing header is one of the node's home addresses, if the segments left field was 1. Thus, in particular, the address field is required to be a unicast routable address.
Once those checks are done, the node swaps the IPv6 destination field with the Home Address field in the routing header, decrements segments left by one from the value it had on the wire, and resubmits the packet to IP for processing the next header ๐. Conceptually, this follows the same model as in RFC 2460. However, with a type 2 routing header this can be simplified, since it's known that the packet won't be forwarded to a different node ๐ง
The definition of AH requires the sender to calculate the AH integrity check value of a routing header the same way it appears at the receiver after the receiver has processed the header. Since IPsec headers follow the routing header, any IPsec processing will operate on the packet with the home address in the IP destination field and segments left set to zero. So the AH calculations at the sender and receiver have an identical view of the packet ๐
11.3.4. Routing Multicast Packets ๐
A mobile node that is connected to its home link functions the same way as any other (stationary) node. So when it's at home, a mobile node works exactly like other multicast senders and receivers. That's why this section describes the behavior of a mobile node that is not on its home link ๐ก
To receive packets sent to some multicast group, a mobile node must join that multicast group. One method, where the mobile node MAY join the group, is through a (local) multicast router on the foreign link being visited. In this case, the mobile node MUST use its care-of address and MUST NOT use the Home Address destination option when sending MLD packets [9] ๐ก
Alternatively, a mobile node MAY join multicast groups through a bidirectional tunnel to its home agent. The mobile node tunnels its multicast group membership control packets (such as those defined in [9] or in [41]) to its home agent, and the home agent forwards multicast packets down the tunnel to the mobile node. A mobile node MUST NOT tunnel multicast group membership control packets until (1) the mobile node has a binding in place at the home agent, and (2) the latter sends at least one multicast group membership control packet via the tunnel. Once this condition is true, the mobile node SHOULD assume it does not change as long as the binding does not expire ๐ฐ๏ธ
A mobile node that wants to send packets to a multicast group has two options too ๐ซง
- Send directly on the foreign link being visited.
To do this, the application uses the care-of address as a source address for multicast traffic, just like it would use a stationary address. This requires that the application either knows the care-of address, or uses an API such as the IPv6 Socket API for Source Address Selection specification [44] to request that the care-of address be used as the source address in transmitted packets. The mobile node MUST NOT use the Home Address destination option in such traffic.
- Send via a tunnel to its home agent.
Because multicast routing in general depends upon the Source Address used in the IPv6 header of the multicast packet, a mobile node that tunnels a multicast packet to its home agent MUST use its home address as the IPv6 Source Address of the inner multicast packet.
Note that direct sending from the foreign link only works while the mobile node is at that foreign link ๐. The reason is that the associated multicast tree is specific to that source location, so any change of location and source address will invalidate the source-specific tree or branch and the application context of the other multicast group members ๐ญ
This specification doesn't provide mechanisms that let such a local multicast session survive a hand-off and seamlessly continue from a new care-of address on each new foreign link. Any such mechanism, developed as an extension to this specification, needs to take into account the impact of fast moving mobile nodes on the Internet multicast routing protocols, and on their ability to maintain the integrity of source specific multicast trees and branches ๐
While bidirectional tunneling can ensure that multicast trees are independent of the mobile node's movement, in some cases tunneling can have adverse effects ๐. The latency of specific types of multicast applications (such as multicast-based discovery protocols) will be affected when the round-trip time between the foreign subnet and the home agent is significant compared to that of the topology to be discovered. On top of that, the delivery tree from the home agent in such circumstances relies on unicast encapsulation from the agent to the mobile node. So bandwidth usage is inefficient compared to native multicast forwarding in the foreign multicast system ๐ฅฒ
11.3.5. Receiving ICMP Error Messages ๐จ
Any node that does not recognize the Mobility header will return an ICMP Parameter Problem, Code 1, message to the sender of the packet. If the mobile node receives such an ICMP error message in response to a return routability procedure or Binding Update, it SHOULD record in its Binding Update List that future Binding Updates SHOULD NOT be sent to this destination. Such Binding Update List entries SHOULD be removed after a period of time, so the mobile node can retry route optimization โณ
New Binding Update List entries MUST NOT be created as a result of receiving ICMP error messages ๐ โโ๏ธ
Correspondent nodes that have participated in the return routability procedure MUST implement the ability to correctly process received packets containing a Home Address destination option. So correctly implemented correspondent nodes should always be able to recognize Home Address options ๐ . If a mobile node receives an ICMP Parameter Problem, Code 2, message from some node saying that it doesn't support the Home Address option, the mobile node SHOULD log the error and then discard the ICMP message ๐
11.3.6. Receiving Binding Error Messages ๐ซฃ
When a mobile node receives a packet containing a Binding Error message, it should first check whether the mobile node has a Binding Update List entry for the source of the Binding Error message. If there's no such entry, it MUST ignore the message. This is necessary to prevent a waste of resources, e.g., on return routability procedures triggered by spoofed Binding Error messages ๐ก๏ธ
Otherwise, if the message Status field was 1 (unknown binding for Home Address destination option), the mobile node should perform one of the following three actions:
- If the Binding Error Message was sent by the home agent, the mobile node SHOULD send a Binding Update to the home agent according to Section 11.7.1.
- If the mobile node has recent upper-layer progress information, which indicates that communications with the correspondent node are progressing, it MAY ignore the message. This can be done to limit the damage that spoofed Binding Error messages can cause to ongoing communications ๐ธ
- If the mobile node has no upper-layer progress information, it MUST remove the entry and route further communications through the home agent. It MAY also optionally start a return routability procedure (see Section 5.2) ๐
If the message Status field was 2 (unrecognized MH Type value), the mobile node should perform one of the following two actions:
- If the mobile node is not expecting an acknowledgement or response from the correspondent node, the mobile node SHOULD ignore this message.
- Otherwise, the mobile node SHOULD cease the use of any extensions to this specification. If no extensions had been used, the mobile node should cease the attempt to use route optimization ๐
11.4. Home Agent and Prefix Management โจ
11.4.1. Dynamic Home Agent Address Discovery ๐งญ
Okay so sometimes the mobile node needs to send a Binding Update to its home agent to register its new primary care-of address (that's the part described in Section 11.7.1 ๐ซถ), but it doesn't actually know the address of any router on its home link that can be its home agent. Lowkey annoying, right? ๐ญ For example, some nodes on the home link might've been reconfigured while the mobile node was away, so the router that used to be its home agent got swapped out for a different one doing the job now. Plot twist. ๐ญ
In that case, the mobile node MAY attempt to discover the address of a suitable home agent on its home link. ๐ To do that, it sends an ICMP Home Agent Address Discovery Request message to the Mobile IPv6 Home-Agents anycast address [8] for its home subnet prefix. As described in Section 10.5, the home agent on the home link that gets this Request message sends back an ICMP Home Agent Address Discovery Reply message, and that Reply lists the addresses of the home agents operating on the home link. Iconic. ๐
Once the mobile node gets that Home Agent Address Discovery Reply, it MAY then send its home registration Binding Update to any of the unicast IP addresses listed in the Home Agent Addresses field of the Reply. ๐ฆ For example, it MAY attempt its home registration to each of those addresses, one at a time, until one of them accepts the registration. The mobile node sends a Binding Update to one address and waits for the matching Binding Acknowledgement, and if nothing comes back, it moves on to the next address. But the mobile node MUST, however, wait at least InitialBindackTimeoutFirstReg seconds (see Section 13) before sending a Binding Update to the next home agent. Patience is a whole vibe. ๐ธ
When it's trying each returned home agent address, the mobile node SHOULD try them in the order they appear in the Home Agent Addresses field of the received Home Agent Address Discovery Reply message. ๐ To make that work, the mobile node SHOULD store the list of home agents for later, just in case the home agent currently handling forwarding for the mobile node's care-of address suddenly becomes unavailable. ๐ง The list MAY be stored, along with any available lifetime information for the home agent addresses, in nonvolatile memory so it survives reboots of the mobile node. Main character memory. ๐ง โจ
If the mobile node already has a current registration with some home agent (the Lifetime for that registration hasn't expired yet), then the mobile node MUST attempt any new registration with that home agent first. ๐ If that attempt fails (for example, it times out or gets rejected), the mobile node SHOULD then reattempt this registration with another home agent. And if the mobile node doesn't know of any other suitable home agent, then it MAY attempt the dynamic home agent address discovery mechanism described above. ๐
If the mobile node sends a Home Agent Address Discovery Request message to the Home Agents Anycast address and doesn't get a matching Home Agent Address Discovery Reply message within INITIAL_DHAAD_TIMEOUT seconds (see Section 12), it MAY retransmit the same Request message to the same anycast address. โฐ This retransmission MAY be repeated up to a maximum of DHAAD_RETRIES attempts (see Section 12). And here's the rule: each retransmission MUST be delayed by twice the time interval of the previous retransmission. Exponential waiting, bestie. ๐ข๐
11.4.2. Sending Mobile Prefix Solicitations ๐
When a mobile node has a home address that's about to become invalid, it SHOULD send a Mobile Prefix Solicitation to its home agent to try to get fresh routing prefix information. ๐ That new info also lets the mobile node take part in renumbering operations that affect the home network, as described in Section 10.6. Renumbering isn't scary when you're prepared. ๐ โจ
The mobile node MUST use the Home Address destination option to carry its home address. ๐ It MUST support IPsec and SHOULD use it to protect the solicitation. ๐ And the mobile node MUST set the Identifier field in the ICMP header to a random value. ๐ฒ Literally a little ID card for each request. ๐ชช
As described in Section 11.7.2, Binding Updates that the mobile node sends to other nodes MUST use a lifetime no greater than the remaining lifetime of its home registration of its primary care-of address. โณ On top of that, the mobile node SHOULD further limit the lifetimes it sends on any Binding Updates so they stay within the remaining valid lifetime (see Section 10.6.2) for the prefix in its home address. Don't overpromise your lifetime, periodt. ๐
When the lifetime for a changed prefix goes down, and that change would cause cached bindings at correspondent nodes in the Binding Update List to be stored past the newly shortened lifetime, the mobile node MUST issue a Binding Update to all such correspondent nodes. ๐ฃ Everyone needs the update, no exceptions. ๐
All of these limits on the binding lifetime exist to stop anyone from using a mobile node's home address after it becomes invalid. ๐ซ Hard stop, no cap. ๐
11.4.3. Receiving Mobile Prefix Advertisements ๐จ
Section 10.6 describes how a home agent supports boot time configuration and renumbering of a mobile node's home subnet while the mobile node is away from home. ๐ก While the mobile node is away, the home agent sends it Mobile Prefix Advertisements that carry "important" Prefix Information options describing changes to the prefixes in use on the mobile node's home link. Such a tea-spilling little message. โ๐ซ
The Mobile Prefix Solicitation is similar to the Router Solicitation used in Neighbor Discovery [18], except it's routed from the mobile node on the visited network to the home agent on the home network using the usual unicast routing rules. ๐ฃ๏ธ Same energy, different destination. ๐ฆ
When a mobile node receives a Mobile Prefix Advertisement, it MUST validate it using the following test:
- The
Source Addressof the IP packet carrying the Mobile Prefix Advertisement is the same as the home agent address to which the mobile node last sent an accepted home registration Binding Update to register its primary care-of address. Otherwise, if no such registrations have been made, it SHOULD be the mobile node's stored home agent address, if one exists. Otherwise, if the mobile node has not yet discovered its home agent's address, it MUST NOT accept Mobile Prefix Advertisements. ๐ต๏ธโโ๏ธ - The packet MUST have a type 2 routing header and SHOULD be protected by an IPsec header as described in Sections 5.4 and 6.8. ๐
- If the ICMP
Identifiervalue matches the ICMPIdentifiervalue of the most recently sent Mobile Prefix Solicitation and no other advertisement has yet been received for this value, then the advertisement is considered to be solicited and will be processed further. โ
Otherwise, the advertisement is unsolicited, and MUST be discarded. In this case the mobile node SHOULD send a Mobile Prefix Solicitation. ๐ โโ๏ธ
Any received Mobile Prefix Advertisement that doesn't pass these tests MUST be silently discarded. ๐คซ Shh, it's gone.
For an accepted Mobile Prefix Advertisement, the mobile node MUST process the Managed Address Configuration (M), Other Stateful Configuration (O), and the Prefix Information Options as if they had arrived in a Router Advertisement [18] on the mobile node's home link. ๐ฌ (This specification does not, however, describe how to acquire home addresses through stateful protocols. ๐) That processing might result in the mobile node configuring a new home address, but because preferred lifetime and valid lifetime are separate, such changes should not affect most of the mobile node's communications, just like for nodes that are at home. Smooth, bestie. ๐งโจ
This specification assumes that any security associations and security policy entries needed for new prefixes have already been pre-configured in the mobile node. ๐ Note that while dynamic key management avoids the need to configure new security associations, it's still necessary to add policy entries to protect the communications involving the home address(es). Setting up those entries is outside the scope of this specification. ๐ง
11.5. Movement ๐ฆ
11.5.1. Movement Detection โจ
okay so the big goal of movement detection is spotting L3 handovers ๐ฆ, which is when your device hops onto a totally new network at the IP layer. This section isn't trying to hand you a super-fast detection algorithm that works perfectly for every app, link layer, and deployment ๐ . Instead it describes a generic method that borrows the IPv6 Neighbor Discovery tools, including Router Discovery and Neighbor Unreachability Detection. At the time of writing, this method is considered well understood enough to recommend for standardization โจ. Future versions of this spec, or other specs, might have updated movement detection algorithms with better performance ๐.
Generic movement detection uses Neighbor Unreachability Detection to notice when the default router is no longer bidirectionally reachable ๐. Then the mobile node has to discover a new default router, usually on a new link. BUT the catch is that this check only happens when the mobile node actually has packets to send ๐. If Router Advertisements are infrequent or the link layer isn't giving any hints, the mobile node might not even realize an L3 handover happened. So the mobile node should supplement this method with other information whenever it has it (e.g., from lower protocol layers) ๐ซถ.
When the mobile node detects an L3 handover, it performs Duplicate Address Detection [19] on its link-local address, selects a new default router as a result of Router Discovery, and then does prefix discovery with that new router to form new care-of address(es) as described in Section 11.5.3 ๐. Then it registers its new primary care-of address with its home agent as described in Section 11.7.1. After updating its home registration, it updates the related mobility bindings in the correspondent nodes it's doing route optimization with, as specified in Section 11.7.2 ๐.
Quick reminder: updating mobility bindings causes a temporary packet flow disruption and signaling overhead, so the mobile node should avoid performing an L3 handover until it's strictly necessary ๐ธ.
Specifically, when the mobile node receives a Router Advertisement from a new router that contains a different set of on-link prefixes, and it detects that the currently selected default router on the old link is still bidirectionally reachable, it should generally keep using the old router on the old link rather than switching away to a new default router โจ.
Mobile nodes can use the information in received Router Advertisements to detect L3 handovers. When they do, the mobile node needs to consider these issues:
- There might be multiple routers on the same link. So hearing a new router doesn't automatically mean an L3 handover ๐.
- When there are multiple routers on the same link, they might advertise different prefixes. So even hearing a new router with a new prefix might not be a reliable sign of an L3 handover ๐.
- The link-local addresses of routers aren't globally unique. So after completing an L3 handover, the mobile node might keep receiving Router Advertisements with the same link-local source address. This might be common if routers use the same link-local address on multiple interfaces. This issue can be avoided when routers use the Router Address (
R) bit, since that provides a global address of the router ๐.
In addition, the mobile node should consider these events as indications that an L3 handover may have occurred. When it receives such indications, the mobile node needs to perform Router Discovery to discover routers and prefixes on the new link, as described in Section 6.3.7 of Neighbor Discovery (RFC 4861 [18]) ๐ง.
- If Router Advertisements the mobile node receives include an Advertisement Interval option, the mobile node may use its
Advertisement Intervalfield as an indication of how often it should expect to keep receiving Advertisements from that router. This field specifies the minimum rate (the maximum amount of time between successive Advertisements) the mobile node should expect. If that amount of time passes without the mobile node receiving any Advertisement from this router, the mobile node can be sure that at least one Advertisement sent by the router has been lost. The mobile node can then implement its own policy to decide how many lost Advertisements from its current default router count as an L3 handover indication ๐. - Neighbor Unreachability Detection determines that the default router is no longer reachable ๐ .
- With some types of networks, notification that an L2 handover has occurred might come from lower-layer protocols or device driver software within the mobile node. Further details around handling L2 indications as movement hints is an item for further study. At the time of writing this specification, the following is considered reasonable:
An L2 handover indication may or may not imply L2 movement, and L2 movement may or may not imply L3 movement. The correlations might be a function of the type of L2, but might also be a function of the actual deployment of the wireless topology ๐ซ .
Unless it is well-known that an L2 handover indication is likely to imply L3 movement, instead of immediately multicasting a router solicitation it may be better to verify whether the default router is still bidirectionally reachable. This can be accomplished by sending a unicast Neighbor Solicitation and waiting for a Neighbor Advertisement with the Solicited flag set. Note that this is similar to Neighbor Unreachability detection, but it does not have the same state machine, such as the STALE state ๐ง .
If the default router does not respond to the Neighbor Solicitation, it makes sense to proceed to multicasting a Router Solicitation ๐.
11.5.2. Home Link Detection
okay so when an MN detects that it has arrived on a new link, either through the movement detection algorithm in use (Section 11.5.1) or at bootstrapping, it runs the steps below to figure out whether it's on the home link ๐ก.
- The MN performs the procedure described in Section 11.5.3 and configures an address. It also keeps track of all the on-link prefix(es) received in the RA, along with their prefix lengths ๐.
- If the home prefix hasn't been statically configured, the MN uses some form of bootstrapping procedure (e.g., RFC 5026 [22]) to determine the home prefix ๐.
- Once the home prefix is available, the MN checks whether it matches one of the prefixes received in the RA. If it does, the MN concludes that it is connected to the home link ๐.
11.5.3. Forming New Care-of Addresses
After a mobile node has moved, it SHOULD generate a new primary care-of address using normal IPv6 mechanisms โจ. This SHOULD also be done when the current primary care-of address becomes deprecated ๐ฅ. A mobile node MAY form a new primary care-of address at any time, but a mobile node MUST NOT send a Binding Update about a new care-of address to its home agent more than MAX_UPDATE_RATE times within a second ๐ฆ.
In addition, a mobile node MAY form new non-primary care-of addresses even when it hasn't switched to a new default router ๐ท. A mobile node can have only one primary care-of address at a time (which is registered with its home agent), but it MAY have an additional care-of address for any or all of the prefixes on its current link ๐. Furthermore, since a wireless network interface may actually let a mobile node be reachable on more than one link at a time (i.e., within wireless transmitter range of routers on more than one separate link), a mobile node MAY have care-of addresses on more than one link at a time ๐. The use of more than one care-of address at a time is described in Section 11.5.4.
As described in Section 4, in order to form a new care-of address, a mobile node MAY use either stateless [19] or stateful (e.g., DHCPv6 [31]) Address Autoconfiguration ๐. If a mobile node needs to use a source address (other than the unspecified address) in packets sent as part of address autoconfiguration, it MUST use an IPv6 link-local address rather than its own IPv6 home address ๐.
RFC 4862 [19] specifies that in normal processing for Duplicate Address Detection, the node SHOULD delay sending the initial Neighbor Solicitation message by a random delay between 0 and MAX_RTR_SOLICITATION_DELAY. Delaying Duplicate Address Detection (DAD) can cause significant delays in configuring a new care-of address when the mobile node moves to a new link, so the mobile node preferably SHOULD NOT delay DAD when configuring a new care-of address ๐โโ๏ธ. The mobile node SHOULD delay according to the mechanisms specified in RFC 4862, unless the implementation has a behavior that desynchronizes the steps that happen before DAD in case multiple nodes experience handover at the same time. Those desynchronizing behaviors might be due to random delays in the L2 protocols or device drivers, or due to the movement detection mechanism being used ๐งฉ.
11.5.4. Using Multiple Care-of Addresses
As described in Section 11.5.3, a mobile node MAY use more than one care-of address at a time ๐ซ. Especially with many wireless networks, a mobile node effectively might be reachable through multiple links at the same time (e.g., with overlapping wireless cells), and different on-link subnet prefixes may exist on each one ๐ก. The mobile node MUST ensure that its primary care-of address always has a prefix that is advertised by its current default router ๐ก๏ธ. After selecting a new primary care-of address, the mobile node MUST send a Binding Update containing that care-of address to its home agent. The Binding Update MUST have the Home Registration (H) and Acknowledge (A) bits set, as described in Section 11.7.1 ๐ฎ.
To help with smooth handovers, a mobile node SHOULD retain its previous primary care-of address as a (non-primary) care-of address, and SHOULD still accept packets at this address, even after registering its new primary care-of address with its home agent ๐ค. This makes sense, since the mobile node could only receive packets at its previous primary care-of address if it were still connected to that link ๐. If the previous primary care-of address was allocated using stateful Address Autoconfiguration [31], the mobile node may not want to release the address right away after switching to a new primary care-of address ๐ซง.
Whenever a mobile node determines that it's no longer reachable through a given link, it SHOULD invalidate all care-of addresses associated with address prefixes that it discovered from routers on the unreachable link, if those prefixes aren't in the current set of address prefixes advertised by the (possibly new) current default router ๐งน๐.
11.5.5. Returning Home ๐ก
okay bestie, so the mobile node figures out it's back home through whatever movement detection algorithm it's using (Section 11.5.2) ๐ฆ. The moment its home subnet prefix is on-link again, it's like "I'm home!!" ๐ธ. But here's the tea: to send and receive packets with its home address from the home link, the mobile node MUST send a Binding Update to its home agent so the home agent stops intercepting or tunneling packets for it ๐ . Until that de-registration Binding Update goes out, the mobile node MUST NOT try to send and receive with its home address from the home link ๐ โโ๏ธ. Meanwhile, the home agent keeps grabbing everything sent to the mobile's home address and tunneling it to the previously registered care-of address ๐ฆ (not me stuck in the tunnel ๐ญ).
In this home registration, the mobile node MUST set the Acknowledge (A) and Home Registration (H) bits, set the Lifetime field to zero, and set the care-of address for the binding to the mobile node's own home address ๐. The mobile node MUST use its home address as the source address in the Binding Update ๐ซถ.
When sending this Binding Update to its home agent, the mobile node must be careful about how it uses Neighbor Solicitation [18] (if needed) to learn the home agent's link-layer address ๐. The reason is that the home agent is still set up to intercept packets to the mobile node's home address using Proxy Neighbor Discovery (Proxy ND) ๐ต๏ธโโ๏ธ. So the mobile node can't use its home address as the Source Address in the Neighbor Solicitation until the home agent stops defending that address ๐ซ.
Neighbor Solicitation by the mobile node for the home agent's address usually isn't needed, since the mobile node has already learned the home agent's link-layer address from a Source Link-Layer Address option in a Router Advertisement โจ. Still, if there are multiple home agents, it may be necessary to send a solicitation ๐ง. In this special case of returning home, the mobile node MUST multicast the packet, and it also MUST set the Source Address of this Neighbor Solicitation to the unspecified address (0:0:0:0:0:0:0:0) ๐. The target of the Neighbor Solicitation MUST be set to the mobile node's home address, and the destination IP address MUST be set to the Solicited-Node multicast address [16] ๐. The home agent will send a multicast Neighbor Advertisement back to the mobile node with the Solicited (S) flag set to zero ๐. Either way, the mobile node SHOULD record the information from the Source Link-Layer Address option or from the advertisement, and set the state of the Neighbor Cache entry for the home agent to REACHABLE โญ.
The mobile node then sends its Binding Update to the home agent's link-layer address, telling its home agent to stop acting as a home agent for it ๐. Once that Binding Update is processed, the home agent stops defending the mobile node's home address for Duplicate Address Detection and stops responding to Neighbor Solicitations for the mobile node's home address ๐. That makes the mobile node the only node on the link receiving packets at its home address, which is iconic ๐. Also, if the mobile node returns home before a current binding for its home address expires, and it configures its home address on its network interface on the home link, it MUST NOT perform Duplicate Address Detection on its own home address ๐. This keeps it from clashing with its home agent's use of the same address. The same rule applies to the derived link-local address of the mobile node, if the Link Local Address Compatibility (L) bit was set when the binding was created ๐. But if the mobile node returns home after the bindings for all of its care-of addresses have expired, then it SHOULD perform DAD ๐.
After the mobile node sends the Binding Update, it MUST be prepared to reply to Neighbor Solicitations for its home address ๐ฌ. Those replies MUST be sent using a unicast Neighbor Advertisement to the sender's link-layer address ๐. Replying matters because sending the Binding Acknowledgement from the home agent may require performing Neighbor Discovery, and the mobile node may not be able to tell Neighbor Solicitations coming from the home agent apart from other Neighbor Solicitations ๐ฅบ. There's also a race condition where both the mobile node and the home agent respond to the same solicitations sent by other nodes ๐ฌ. Don't panic though, it's only temporary, lasting until the Binding Update is accepted ๐ .
After receiving the Binding Acknowledgement for its Binding Update to its home agent, the mobile node MUST multicast onto the home link (to the all-nodes multicast address) a Neighbor Advertisement [18] ๐ฃ. The point is to advertise the mobile node's own link-layer address for its own home address ๐ฆ. The Target Address in this Neighbor Advertisement MUST be set to the mobile node's home address, and the Advertisement MUST include a Target Link-layer Address option specifying the mobile node's link-layer address ๐. The mobile node MUST multicast such a Neighbor Advertisement for each of its home addresses, as defined by the current on-link prefixes, including its link-local address ๐ธ. The Solicited (S) flag in these Advertisements MUST NOT be set, since they weren't solicited by any Neighbor Solicitation ๐ โโ๏ธ. The Override (O) flag in these Advertisements MUST be set, which tells any receiving node that the Advertisements SHOULD override any existing Neighbor Cache entries ๐ฅ.
Multicasting on the local link (such as Ethernet) isn't typically guaranteed to be reliable ๐, so the mobile node MAY retransmit these Neighbor Advertisements [18] up to MAX_NEIGHBOR_ADVERTISEMENT times to make them more reliable ๐. It's still possible that some nodes on the home link won't receive any of these Neighbor Advertisements, but those nodes will eventually recover through Neighbor Unreachability Detection [18] ๐ซถ.
Note that the tunnel via the home agent typically stops working at the same time the home registration is deleted ๐งโโ๏ธ.
11.6. Return Routability Procedure ๐ค๏ธ
This section defines the rules that the mobile node must follow when performing the return routability procedure ๐. Section 11.7.2 describes the rules for when the return routability procedure needs to be initiated ๐ฆ.
11.6.1. Sending Test Init Messages ๐
A mobile node that starts a return routability procedure MUST send (in parallel) a Home Test Init message and a Care-of Test Init message ๐ซ. But if the mobile node has recently received (see Section 5.2.7) one or both home or care-of keygen tokens, and associated nonce indices for the desired addresses, it MAY reuse them โป๏ธ. So the return routability procedure may sometimes be completed with only one message pair ๐ฅณ. It can even be completed without any messages at all, if the mobile node has a recent home keygen token and has previously visited the same care-of address, so that it also has a recent care-of keygen token ๐คฏ. If the mobile node intends to send a Binding Update with the Lifetime set to zero and the care-of address equal to its home address (like when returning home), then sending a Home Test Init message is enough ๐ก. In this case, generating the binding management key depends exclusively on the home keygen token (Section 5.2.5) ๐.
A Home Test Init message MUST be created as described in Section 6.1.3 ๐.
A Care-of Test Init message MUST be created as described in Section 6.1.4 ๐. When sending a Home Test Init or Care-of Test Init message, the mobile node MUST record the following fields from the messages in its Binding Update List ๐:
- The IP address of the node to which the message was sent.
- The home address of the mobile node. This value will appear in the Source Address field of the Home Test Init message. When sending the Care-of Test Init message, this address doesn't appear in the message, but it stands in for the home address the binding is wanted for ๐ฏ.
- The time at which each of these messages was sent โฐ.
- The cookies used in the messages ๐ช.
Note that a single Care-of Test Init message may be enough even when there are multiple home addresses ๐. In this case, the mobile node MAY record the same information in multiple Binding Update List entries ๐.
11.6.2. Receiving Test Messages ๐ฉ
Upon receiving a packet carrying a Home Test message, a mobile node MUST validate the packet against the following tests ๐ง:
- The Source Address of the packet belongs to a correspondent node for which the mobile node has a Binding Update List entry with a state indicating that the return routability procedure is in progress. Note that there may be multiple such entries ๐ฏ.
- The Binding Update List indicates that no home keygen token has been received yet ๐.
- The Destination Address of the packet has the home address of the mobile node, and the packet has been received in a tunnel from the home agent ๐.
- The Home Init Cookie field in the message matches the value stored in the Binding Update List ๐ช.
Any Home Test message that doesn't satisfy all of these tests MUST be silently ignored ๐คซ. Otherwise, the mobile node MUST record the Home Nonce Index and home keygen token in the Binding Update List ๐๏ธ. If the Binding Update List entry doesn't have a care-of keygen token, the mobile node SHOULD keep waiting for the Care-of Test message โณ.
Upon receiving a packet carrying a Care-of Test message, a mobile node MUST validate the packet against the following tests ๐:
- The Source Address of the packet belongs to a correspondent node for which the mobile node has a Binding Update List entry with a state indicating that the return routability procedure is in progress. Note that there may be multiple such entries ๐ญ.
- The Binding Update List indicates that no care-of keygen token has been received yet ๐.
- The Destination Address of the packet is the current care-of address of the mobile node ๐.
- The Care-of Init Cookie field in the message matches the value stored in the Binding Update List ๐ช.
Any Care-of Test message that doesn't satisfy all of these tests MUST be silently ignored ๐ค. Otherwise, the mobile node MUST record the Care-of Nonce Index and care-of keygen token in the Binding Update List ๐พ. If the Binding Update List entry doesn't have a home keygen token, the mobile node SHOULD keep waiting for the Home Test message ๐ฐ๏ธ.
If, after receiving either the Home Test or the Care-of Test message and performing the actions above, the Binding Update List entry has both the home and the care-of keygen tokens, the return routability procedure is complete ๐. The mobile node SHOULD then go ahead and send a Binding Update as described in Section 11.7.2 ๐.
Correspondent nodes from before this specification was published may not support the Mobility Header protocol ๐ฆ. These nodes will respond to Home Test Init and Care-of Test Init messages with an ICMP Parameter Problem code 1 ๐. The mobile node SHOULD take such messages as a sign that the correspondent node can't provide route optimization, and fall back to using bidirectional tunneling ๐๐.
11.6.3. Protecting Return Routability Packets โจ
okay so first things first, bestie: the mobile node MUST support protecting Home Test and Home Test Init messages, the way Section 10.4.6 describes ๐ no cap, this one's non-negotiable ๐
When IPsec is used to protect return routability signaling or payload packets, the mobile node MUST set the source address it uses for the outgoing tunnel packets to the current primary care-of address. And the mobile node starts using a new primary care-of address immediately after it sends a Binding Update to the home agent to register that new address. It's giving perfectly timed handoff ๐ฆ
11.7. Processing Bindings ๐
11.7.1. Sending Binding Updates to the Home Agent ๐ฎ
okay, so to change its primary care-of address like Sections 11.5.1 and 11.5.3 describe, a mobile node MUST register that care-of address with its home agent so it becomes the primary one ๐
Also, if the mobile node wants the home agent's services past the current registration period, it should send a new Binding Update well before that period runs out, even if it isn't changing its primary care-of address ๐ธ But here's the twist: if the home agent gave back a Binding Acknowledgement for the current registration with the Status field set to 1 (accepted but prefix discovery necessary), the mobile node should not try to register again until it has learned whether its home prefixes are still valid through mobile prefix discovery. This is typically necessary every time this Status value shows up, because what it learned earlier may have changed ๐
To register a care-of address or extend an existing registration's lifetime, the mobile node sends a packet to its home agent containing a Binding Update, built like this:
- The Home Registration (H) bit MUST be set in the Binding Update.
- The Acknowledge (A) bit MUST be set in the Binding Update.
- The packet MUST contain a Home Address destination option, giving the mobile node's home address for the binding.
- The care-of address for the binding MUST be used as the Source Address in the packet's IPv6 header, unless an Alternate Care-of Address mobility option is included in the Binding Update. This option MUST be included in all home registrations, as the ESP protocol will not be able to protect care-of addresses in the IPv6 header. (Mobile IPv6 implementations that know they are using IPsec AH to protect a particular message might avoid this option. For brevity the usage of AH is not discussed in this document.) ๐ง
- If the mobile node's link-local address has the same interface identifier as the home address it's supplying a new care-of address for, then the mobile node SHOULD set the Link-Local Address Compatibility (L) bit.
- If the home address was generated using RFC 4941 [21], then the link local address is unlikely to have a compatible interface identifier. In this case, the mobile node MUST clear the Link-Local Address Compatibility (L) bit. ๐ซถ
- If the IPsec security associations between the mobile node and the home agent have been established dynamically, and the mobile node has the capability to update its endpoint in the used key management protocol to the new care-of address every time it moves, the mobile node SHOULD set the Key Management Mobility Capability (K) bit in the Binding Update. Otherwise, the mobile node MUST clear the bit. โจ
- The value specified in the Lifetime field MUST be non-zero and SHOULD be less than or equal to the remaining valid lifetime of the home address and the care-of address specified for the binding.
Mobile nodes that use dynamic home agent address discovery should be careful with long lifetimes. If the mobile node loses the knowledge of its binding with a specific home agent, registering a new binding with another home agent may be impossible as the previous home agent is still defending the existing binding. Therefore, to ensure that mobile nodes using home agent address discovery do not lose information about their binding, they SHOULD de-register before losing this information, or use small lifetimes. ๐ญ
The Acknowledge (A) bit in the Binding Update asks the home agent to send back a Binding Acknowledgement in response. As described in Section 6.1.8, the mobile node SHOULD retransmit this Binding Update to its home agent until it gets a matching Binding Acknowledgement. Once it hits a retransmission timeout period of MAX_BINDACK_TIMEOUT, the mobile node SHOULD restart the process of delivering the Binding Update, but this time try the next home agent returned during dynamic home agent address discovery (see Section 11.4.1). If there was only one home agent, the mobile node SHOULD instead keep retransmitting the Binding Update at this rate until it's acknowledged (or until it starts trying to register a different primary care-of address). See Section 11.8 for info about retransmitting Binding Updates. ๐
With the Binding Update, the mobile node asks the home agent to serve as the home agent for the given home address. Until the lifetime of this registration expires, the home agent considers itself the home agent for that home address ๐
Each Binding Update MUST be authenticated as coming from the right mobile node, as defined in Section 5.1. The mobile node MUST use its home address, either in the Home Address destination option or in the Source Address field of the IPv6 header, in Binding Updates sent to the home agent. This is necessary so the IPsec policies can be matched with the correct home address ๐
When sending a Binding Update to its home agent, the mobile node MUST also create or update the corresponding Binding Update List entry, as specified in Section 11.7.2. ๐
The last Sequence Number value sent to the home agent in a Binding Update is stored by the mobile node. If the sending mobile node has no knowledge of the correct Sequence Number value, it may start at any value. If the home agent rejects the value, it sends back a Binding Acknowledgement with status code 135, and the last accepted sequence number in the Sequence Number field of the Binding Acknowledgement. The mobile node MUST store this information and use the next Sequence Number value for the next Binding Update it sends. ๐ข
If the mobile node has additional home addresses, then it SHOULD send an additional packet containing a Binding Update to its home agent to register the care-of address for each of those other home addresses. ๐
The home agent will only perform DAD for the mobile node's home address when the mobile node has supplied a valid binding between its home address and a care-of address. If some time goes by where the mobile node has no binding at the home agent, it might be possible for another node to autoconfigure the mobile node's home address. So the mobile node MUST treat creating a new binding with the home agent using an existing home address the same as creating a new home address. In the unlikely event that the mobile node's home address gets autoconfigured as the IPv6 address of another network node on the home network, the home agent will reply to the mobile node's next Binding Update with a Binding Acknowledgement containing a Status of 134 (Duplicate Address Detection failed). In this case, the mobile node MUST NOT attempt to re-use the same home address. It SHOULD keep registering care-of addresses for its other home addresses, if it has any. The mechanisms outlined in "Mobile IPv6 Bootstrapping in Split Scenario" [22] let mobile nodes acquire new home addresses to replace the one that got Status 134 ๐งโโ๏ธ๐
11.7.2. Correspondent Registration โจ
okay so once the mobile node is sure its home address is valid ๐ , it can start a correspondent registration. the point is to let the correspondent node cache the mobile node's current care-of address ๐ฆ. it's two steps: the return routability procedure first, then the actual registration. it's giving very organised energy ๐
this section is the rulebook for when that happens and what to watch out for while it's going on ๐
so the mobile node has just sent its Binding Update to the home agent to register a brand new primary care-of address (see Section 11.7.1 ๐). at that point it SHOULD start a correspondent registration for every node that's already in its Binding Update List ๐ธ. those procedures can be used to either update the binding info on the correspondent node or delete it ๐ง.
for nodes that aren't in the Binding Update List, the mobile node MAY start a correspondent registration whenever it wants after it's sent the Binding Update to the home agent ๐. when to do it (or if it should do it at all) depends on how the mobile node is moving and what traffic it's getting, and that's outside the scope of this document ๐คทโโ๏ธ.
the mobile node MAY also start the correspondent registration when it gets a packet that passes all of these tests ๐:
- The packet was tunneled using IPv6 encapsulation.
- The Destination Address in the tunnel (outer) IPv6 header is equal to any of the mobile node's care-of addresses.
- The Destination Address in the original (inner) IPv6 header is equal to one of the mobile node's home addresses.
- The Source Address in the tunnel (outer) IPv6 header differs from the Source Address in the original (inner) IPv6 header.
- The packet does not contain a Home Test, Home Test Init, Care-of Test, or Care-of Test Init message.
if the mobile node has multiple home addresses, picking the right one for the correspondent registration is a big deal ๐. the home address that gets used MUST be the Destination Address of the original (inner) packet ๐ฏ.
the peer address used in the procedure MUST be worked out like this:
- If a Home Address destination option is present in the original (inner) packet, the address from that option is used.
- Otherwise, the Source Address in the original (inner) IPv6 header of the packet is used.
also, the validity of the original packet gets checked before the mobile node even tries to start a correspondent registration ๐. for example, if a Home Address destination option showed up in the original packet, then the rules in Section 9.3.1 get followed.
a mobile node MAY also decide to keep its topological location private from certain correspondent nodes, in which case it doesn't have to start the correspondent registration ๐ซถ.
once the return routability procedure has finished successfully, and the mobile node has gotten a successful Binding Acknowledgement from the home agent, a Binding Update MAY be sent to the correspondent node ๐.
in any Binding Update a mobile node sends, the care-of address (either the Source Address in the packet's IPv6 header or the Care-of Address in the Alternate Care-of Address mobility option of the Binding Update) MUST be set to one of the care-of addresses the mobile node is currently using, or to its home address ๐. a mobile node MAY set the care-of address differently for different correspondent nodes ๐ฆ.
a mobile node MAY also send a Binding Update to a correspondent node telling it to delete any existing binding for the mobile node from its Binding Cache, as described in Section 6.1.7 ๐. even then, a successful return routability procedure is required first โจ.
if the care-of address is NOT the mobile node's home address, then the Binding Update is asking the correspondent node to create or update an entry for the mobile node in its Binding Cache ๐. that's so the correspondent node has a care-of address to send future packets to ๐ง. in this case, the value in the Lifetime field of the Binding Update SHOULD be less than or equal to the remaining lifetime of the home registration and of the care-of address specified for the binding โณ. the care-of address in the Binding Update MAY be different from the mobile node's primary care-of address ๐ธ.
if the Binding Update is going to a correspondent node and asking it to delete any Binding Cache entry it has for the mobile node, the care-of address is set to the mobile node's home address and the Lifetime field is set to zero ๐ซง. in this case, the binding management key comes ONLY from the home keygen token (Section 5.2.5) ๐. the care-of nonce index SHOULD be set to zero here too. and to follow the Binding Update creation rules below, the care-of address MUST be the home address if the mobile node is at home, or the current care-of address if it's away from home ๐ .
if the mobile node wants to be sure its new care-of address has actually been entered into a correspondent node's Binding Cache, it can ask for an acknowledgement by setting the Acknowledge (A) bit in the Binding Update ๐ฌ.
a Binding Update is created like this ๐ ๏ธ:
- The current care-of address of the mobile node MUST be sent either in the Source Address of the IPv6 header or in the Alternate Care-of Address mobility option.
- The Destination Address of the IPv6 header MUST contain the address of the correspondent node.
- The Mobility Header is built according to the rules in Sections 6.1.7 and 5.2.6, including the Binding Authorization Data (calculated as defined in Section 6.2.7) and possibly the Nonce Indices mobility options.
- The home address of the mobile node MUST be added to the packet in a Home Address destination option, unless the Source Address is the home address.
every Binding Update MUST have a Sequence Number that's greater than the Sequence Number sent in the previous Binding Update to the same destination address (if there was one) ๐ข. the sequence numbers get compared modulo 2**16, as described in Section 9.5.1 ๐. the Sequence Number doesn't have to go up by exactly 1 every time a new Binding Update is sent or received, as long as it stays within the window ๐. the last Sequence Number sent to a destination in a Binding Update gets stored by the mobile node in its Binding Update List entry for that destination ๐. if the sending mobile node has no Binding Update List entry, the Sequence Number SHOULD start at a random value ๐ฒ. the mobile node MUST NOT use the same Sequence Number in two different Binding Updates to the same correspondent node, even if those Binding Updates give different care-of addresses ๐ซ.
the mobile node is responsible for finishing the correspondent registration, plus any retransmissions that might be needed (subject to the rate limitation in Section 11.8) ๐ช.
11.7.3. Receiving Binding Acknowledgements โจ
okay so when a packet carrying a Binding Acknowledgement shows up, the mobile node MUST validate it with these tests ๐
- The packet has to meet the authentication requirements for Binding Acknowledgements from Sections 6.1.8 and 5. If the Binding Update went to the home agent, the underlying IPsec protection is used. If it went to the correspondent node, the Binding Authorization Data mobility option MUST be present and have a valid value. ๐
- The Binding Authorization Data mobility option, if present, MUST be the last option and MUST NOT have trailing padding. ๐งต
- The Sequence Number field matches the Sequence Number the mobile node sent to this destination address in an outstanding Binding Update, and the Status field is not 135. ๐ฏ
Any Binding Acknowledgement that doesn't pass all of these tests MUST be silently ignored. no notes, no drama ๐
When a mobile node gets a packet with a valid Binding Acknowledgement, it MUST check the Status field like this ๐
- If the Status field says the Binding Update was accepted (the Status field is less than 128), then the mobile node MUST update the matching entry in its Binding Update List to show the Binding Update has been acknowledged. Then it MUST stop retransmitting the Binding Update. โ Also, if the Lifetime field in the Binding Acknowledgement is less than the Lifetime value sent in the Binding Update being acknowledged, the mobile node MUST subtract the difference between those two Lifetime values from the remaining lifetime for the binding, as kept in the matching Binding Update List entry (the Binding Update List entry lifetime has a minimum value of 0). So if the Lifetime value sent in the Binding Update was L_update, the Lifetime value received in the Binding Acknowledgement was L_ack, and the current remaining lifetime of the Binding Update List entry is L_remain, then the new value for the remaining lifetime of the Binding Update List entry should be:
max((L_remain - (L_update - L_ack)), 0)
where max(X, Y) is the maximum of X and Y. This step keeps the mobile node's view of the binding's remaining lifetime (as kept in the matching Binding Update List entry) accurate, so it counts down from the Lifetime value given in the Binding Acknowledgement, with the timer starting at the moment the Binding Update was sent. โณ
Mobile nodes SHOULD send a new Binding Update well before this period expires so they can extend the lifetime. That helps avoid disruptions that network delays or clock drift might otherwise cause. ๐
- If the Binding Acknowledgement correctly passes authentication and the Status field value is 135 (Sequence Number out of window), then the mobile node MUST update its binding sequence number to match the sequence number given in the Binding Acknowledgement. Otherwise, if the Status field value is 135 but the Binding Acknowledgement doesn't pass authentication, the message MUST be silently ignored. ๐ข
- If the Status field value is 1 (accepted but prefix discovery necessary), the mobile node SHOULD send a Mobile Prefix Solicitation message to update its info about the available prefixes. ๐บ๏ธ
- If the Status field says the Binding Update was rejected (the Status field is greater than or equal to 128), then the mobile node can fix whatever caused the error and retransmit the Binding Update (with a new Sequence Number value), subject to the rate limiting restriction in Section 11.8. If that isn't done or it fails, then the mobile node SHOULD record in its Binding Update List that future Binding Updates SHOULD NOT be sent to this destination. ๐ซ
How the Binding Refresh Advice mobility option inside the Binding Acknowledgement gets treated depends on where the acknowledgement came from. This option MUST be ignored if the acknowledgement came from a correspondent node. If it came from the home agent, the mobile node uses the Refresh Interval field in the option as a suggestion that it SHOULD try to refresh its home registration at the shorter interval it names. ๐
If the acknowledgement came from the home agent, the mobile node checks the Key Management Mobility Capability (K) bit. If this bit is not set, the mobile node SHOULD discard any key management protocol connections to the home agent. The mobile node MAY also start a new key management connection. ๐
If this bit is set, the mobile node SHOULD move its own endpoint in the key management protocol connections to the home agent, if there are any. The mobile node's new endpoint should be the new care-of address. ๐กโก๏ธ๐
11.7.4. Receiving Binding Refresh Requests ๐
When a mobile node gets a packet with a Binding Refresh Request message, if the mobile node has a Binding Update List entry for the source of that request, and it wants to keep its Binding Cache entry at the correspondent node, then it should start a return routability procedure. ๐งญ If the mobile node wants its Binding Cache entry removed, it has two options. It can ignore the Binding Refresh Request and let the binding time out, or it can at any time delete its binding from a correspondent node with an explicit Binding Update that has a zero lifetime and the care-of address set to the home address. ๐๏ธ If the mobile node doesn't know whether it needs the Binding Cache entry, it can decide in an implementation-dependent manner, such as based on available resources. ๐คทโโ๏ธ
Note that the mobile node should be careful not to respond to Binding Refresh Requests for addresses that aren't in the Binding Update List. This protects it from being targeted by a denial of service attack. ๐ก๏ธ๐ค
If the return routability procedure completes successfully, a Binding Update message SHOULD be sent, as described in Section 11.7.2. The Lifetime field in this Binding Update SHOULD be set to a new lifetime, extending any current lifetime left from a previous Binding Update sent to this node (as shown in any existing Binding Update List entry for this node). The lifetime SHOULD again be less than or equal to the remaining lifetime of the home registration and the care-of address specified for the binding. When sending this Binding Update, the mobile node MUST update its Binding Update List the same way it does for any other Binding Update it sends. ๐
11.8. Retransmissions and Rate Limiting ๐โฑ๏ธ
The mobile node is in charge of retransmissions and rate limiting in the return routability procedure, in registrations, and in solicited prefix discovery. ๐
When the mobile node sends a Mobile Prefix Solicitation, Home Test Init, Care-of Test Init, or Binding Update that it expects a response to, it has to pick a value for the initial retransmission timer:
- If the mobile node is sending a Mobile Prefix Solicitation, it SHOULD use an initial retransmission interval of INITIAL_SOLICIT_TIMER (see Section 12).
- If the mobile node is sending a Binding Update and doesn't have an existing binding at the home agent, it SHOULD use InitialBindackTimeoutFirstReg (see Section 13) as the value for the initial retransmission timer. This long interval gives the home agent time to finish the Duplicate Address Detection procedure required in this case, as detailed in Section 11.7.1. ๐ฐ๏ธ
- Otherwise, the mobile node should use the specified value of INITIAL_BINDACK_TIMEOUT for the initial retransmission timer.
If the mobile node doesn't get a valid matching response within the chosen initial retransmission interval, it SHOULD keep retransmitting the message until a response arrives. ๐จ
The retransmissions by the mobile node MUST use an exponential back-off process, where the timeout period doubles with each retransmission, until either the node gets a response or the timeout period reaches MAX_BINDACK_TIMEOUT. The mobile node MAY keep sending these messages at this slower pace indefinitely. ๐ข
The mobile node SHOULD start a separate back-off process for different message types, different home addresses, and different care-of addresses. There's also an overall rate limit for messages sent to a particular correspondent node. This makes sure the correspondent node has enough time to respond when bindings for multiple home addresses are registered, for instance. The mobile node MUST NOT send Mobility Header messages of a particular type to a particular correspondent node more than MAX_UPDATE_RATE times within a second. ๐ฆ
Retransmitted Binding Updates MUST use a Sequence Number value greater than the one used for the previous transmission of that Binding Update. Retransmitted Home Test Init and Care-of Test Init messages MUST use new cookie values. ๐ช
12. Protocol Constants ๐
DHAAD_RETRIES 4 retransmissions
INITIAL_BINDACK_TIMEOUT 1 second
INITIAL_DHAAD_TIMEOUT 3 seconds
INITIAL_SOLICIT_TIMER 3 seconds
MAX_BINDACK_TIMEOUT 32 seconds
MAX_DELETE_BCE_TIMEOUT 10 seconds
MAX_NONCE_LIFETIME 240 seconds
MAX_TOKEN_LIFETIME 210 seconds
MAX_RO_FAILURE 3 retries
MAX_RR_BINDING_LIFETIME 420 seconds
MAX_UPDATE_RATE 3 times
PREFIX_ADV_RETRIES 3 retransmissions
PREFIX_ADV_TIMEOUT 3 seconds
13. Protocol Configuration Variables โ๏ธ
MaxMobPfxAdvInterval Default: 86,400 seconds
MinDelayBetweenRAs Default: 3 seconds,
Min: 0.03 seconds
MinMobPfxAdvInterval Default: 600 seconds
InitialBindackTimeoutFirstReg Default: 1.5 seconds
Home agents MUST allow the first three variables to be configured by system management, and mobile nodes MUST allow the last variable to be configured by system management. ๐ ๏ธ
The default value for InitialBindackTimeoutFirstReg was calculated as 1.5 times the default value of RetransTimer, as specified in Neighbor Discovery (RFC 4861 [18]), times the default value of DupAddrDetectTransmits, as specified in Stateless Address Autoconfiguration (RFC 4862 [19]). ๐งฎ
The value MinDelayBetweenRAs overrides the protocol constant MIN_DELAY_BETWEEN_RAS, as specified in Neighbor Discovery (RFC 4861 [18]). This variable SHOULD be set to MinRtrAdvInterval if MinRtrAdvInterval is less than 3 seconds. ๐
14. IANA Considerations โจ
okay bestie, this part is for the IANA crew ๐ง this doc brings in a brand new IPv6 protocol, the Mobility Header, which you can read about in Section 6.1. It got protocol number 135 ๐
It also makes a new name space called "Mobility Header Type" for the MH Type field in the Mobility Header ๐ The message types are described starting from Section 6.1.2, and they're:
0 Binding Refresh Request
1 Home Test Init
2 Care-of Test Init
3 Home Test
4 Care-of Test
5 Binding Update
6 Binding Acknowledgement
7 Binding Error
Future values of the MH Type can be allocated using Standards Action or IESG Approval [23].
Each mobility message can also carry mobility options, as described in Section 6.2 ๐ This doc creates a new name space "Mobility Option" for these. The current options are defined starting from Section 6.2.2, and they're:
0 Pad1
1 PadN
2 Binding Refresh Advice
3 Alternate Care-of Address
4 Nonce Indices
5 Authorization Data
Future values of the Option Type can be allocated using Standards Action or IESG Approval [23].
The doc also makes a third new name space, "Status Code", for the Status field in the Binding Acknowledgement message ๐ฆ The current values are listed in Section 6.1.8:
0 Binding Update accepted
1 Accepted but prefix discovery necessary
128 Reason unspecified
129 Administratively prohibited
130 Insufficient resources
131 Home registration not supported
132 Not home subnet
133 Not home agent for this mobile node
134 Duplicate Address Detection failed
135 Sequence number out of window
136 Expired home nonce index
137 Expired care-of nonce index
138 Expired nonces
139 Registration type change disallowed
174 Invalid Care-of Address
Future values of the Status field can be allocated using Standards Action or IESG Approval [23].
All fields labeled "Reserved" are only to be assigned through Standards Action or IESG Approval ๐ธ
This doc also defines a new IPv6 destination option, the Home Address option, described in Section 6.3. It was assigned the Option Type value 0xC9 โญ
It also defines a new IPv6 type 2 routing header, described in Section 6.4. The value 2 has been allocated by IANA ๐
Then there are four ICMP message types ๐ง Two are used for the dynamic home agent address discovery mechanism, and two are used in lieu of Router Solicitations and Advertisements when the mobile node is away from the home link. They got ICMPv6 type numbers from the informational message range:
- The Home Agent Address Discovery Request message, described in Section 6.5;
- The Home Agent Address Discovery Reply message, described in Section 6.6;
- The Mobile Prefix Solicitation, described in Section 6.7; and
- The Mobile Prefix Advertisement, described in Section 6.8.
Last one: this doc defines two new Neighbor Discovery [18] options, which got Option Type values within the option numbering space for Neighbor Discovery messages ๐
- The Advertisement Interval option, described in Section 7.3; and
- The Home Agent Information option, described in Section 7.4.
15. Security Considerations ๐จ
15.1. Threats ๐
okay this part is super important, so read closely ๐ซถ any mobility solution has to protect itself against misuse of the mobility features and mechanisms. In Mobile IPv6, most of the threats are about false bindings, which usually leads to denial-of-service attacks. Some threats also open the door to man-in-the-middle, hijacking, confidentiality, and impersonation attacks. The main threats this protocol protects against are:
- Threats involving Binding Updates sent to home agents and correspondent nodes ๐ญ For instance, an attacker might claim that a certain mobile node is currently at a different location than it really is. If a home agent accepts that spoofed info, the mobile node might not get the traffic that was destined to it. Similarly, a malicious (mobile) node might use the home address of a victim node in a forged Binding Update sent to a correspondent node.
These are threats to confidentiality, integrity, and availability ๐ An attacker might learn the contents of packets destined for another node by redirecting that traffic to itself. They could also use the redirected packets to set themselves up as a man in the middle between a mobile and a correspondent node. That would let the attacker impersonate the mobile node, which causes integrity and availability problems.
A malicious (mobile) node might also send Binding Updates where the care-of address is set to the address of a victim node. If those Binding Updates were accepted, the malicious node could lure the correspondent node into sending potentially large amounts of data to the victim. The correspondent node's replies to messages sent by the malicious mobile node would go to the victim host or network. This could be used to cause a distributed denial-of-service attack. For example, the correspondent node might be a site that sends a high-bandwidth stream of video to anyone who asks for it. Note that flow-control protocols such as TCP don't necessarily defend against this type of attack, because the attacker can fake the acknowledgements. Even keeping TCP initial sequence numbers secret doesn't help, because the attacker can receive the first few segments (including the ISN) at its own address, and only then redirect the stream to the victim's address. These types of attacks may also be aimed at networks instead of nodes. Further variations of this threat are described elsewhere [28] [35].
An attacker might also try to disrupt a mobile node's communications by replaying a Binding Update that the node sent earlier. If the old Binding Update was accepted, packets destined for the mobile node would go to its old location instead of its current one.
A malicious mobile node associated with multiple home agents could create a routing loop between them ๐ This can happen when a mobile node binds one home address located on a first home agent to another home address on a second home agent. This kind of binding forces the home agents to route the same packet among each other, without knowing a routing loop has been created. This looping problem is limited to cases where a mobile node has multiple home agents and is allowed to be associated with them. For the single home agent case, a policy at the home agent would prevent binding one home address to another home address hosted by the same home agent.
The potential problems caused by such routing loops in this scenario can be greatly reduced by using the Tunnel-Limit Option specified in RFC 2473 [7] โจ
In conclusion, there are denial-of-service, man-in-the-middle, confidentiality, and impersonation threats against the parties involved in sending legitimate Binding Updates. There's also the threat of routing loops when there are multiple home agents, plus denial-of-service threats against any other party ๐
- Threats associated with payload packets ๐ Payload packets exchanged with mobile nodes are exposed to threats similar to regular IPv6 traffic. However, Mobile IPv6 introduces the Home Address destination option and a new routing header type (type 2), and it uses tunneling headers in the payload packets. The protocol must protect against potential new threats involving these mechanisms.
Third parties become exposed to a reflection threat via the Home Address destination option, unless appropriate security precautions are followed. The Home Address destination option could be used to direct response traffic toward a node whose IP address appears in the option. In this case, ingress filtering would not catch the forged "return address" [38] [43].
A similar threat exists with the tunnels between the mobile node and the home agent. An attacker might forge tunnel packets between them, making it look like the traffic is coming from the mobile node when it isn't. An attacker who can forge tunnel packets would typically also be able to forge packets that appear to come directly from the mobile node, so this isn't a new threat as such. However, it may make it easier for attackers to escape detection by avoiding ingress filtering and packet tracing mechanisms. Furthermore, spoofed tunnel packets might be used to gain access to the home network ๐
Finally, a routing header could also be used in reflection attacks, and in attacks designed to bypass firewalls. The generality of the regular routing header would allow circumvention of IP-address based rules in firewalls. It would also allow reflection of traffic to other nodes. These threats exist with routing headers in general, even if the usage that Mobile IPv6 requires is safe.
- Threats associated with dynamic home agent and mobile prefix discovery ๐ง
- Threats against the Mobile IPv6 security mechanisms themselves ๐ค An attacker might, for instance, lure the participants into doing expensive cryptographic operations or allocating memory to keep state. The victim node would have no resources left to handle other tasks.
As a fundamental service in an IPv6 stack, Mobile IPv6 is expected to be deployed in most nodes of the IPv6 Internet ๐ The threats above should therefore be considered applicable to the whole Internet.
It's also worth knowing that some additional threats come from movement itself, even without any mobility protocols involved ๐ฆ Mobile nodes must be capable of defending themselves in the networks they visit, because typical perimeter defenses applied in the home network no longer protect them ๐ซฃ
15.2. Features โจ
okay bestie, this section is basically the security feature checklist ๐ Mobile IPv6 is coming in with a whole set of protections to fight the threats we just covered, and they're lowkey iconic:
- Reverse tunneling as a mandatory feature. ๐
- Protection of Binding Updates sent to home agents. ๐
- Protection of Binding Updates sent to correspondent nodes. ๐ค
- Protection against reflection attacks that use the Home Address destination option. ๐ช
- Protection of tunnels between the mobile node and the home agent. ๐
- Closing routing header vulnerabilities. ๐
- Mitigating denial-of-service threats to the Mobile IPv6 security mechanisms themselves. ๐ก๏ธ
The support for encrypted reverse tunneling (see Section 11.3.1) lets mobile nodes defeat certain kinds of traffic analysis. That's a whole mood ๐ซถ
Now here's the tea ๐ต Protecting Binding Updates sent to home agents and protecting the ones sent to arbitrary correspondent nodes need totally different solutions, because the situations are totally different ๐ญ Mobile nodes and home agents are expected to be under the network administration of the same home domain, so they can (and are supposed to) have a security association that lets them reliably authenticate the messages they swap. See Section 5.1 for how the mechanisms work, and Section 15.3 below for how secure that ends up being. ๐
Correspondent nodes are a different story. Route optimization is expected to run globally, between nodes in different administrative domains, and building an authentication infrastructure at that scale would be a huge ask ๐ Also, a regular authentication infrastructure can't easily authenticate IP addresses, since addresses change a lot. Authenticating the mobile node isn't enough on its own, either. You also need authorization to show you have the right to use an address ๐ So an "infrastructureless" approach is needed. That method is covered in Section 5.2, and Section 15.4 explains how secure it is and why it was designed this way โจ
Specific rules control how the Home Address destination option, the routing header, and the tunneling headers in payload packets get used ๐ These rules are there to kill the vulnerabilities that come from using them without any limits. You can see their effects in Sections 15.7, 15.8, and 15.9.
Last but not least, denial-of-service threats against the Mobile IPv6 security mechanisms are mostly about the Binding Update procedures with correspondent nodes. The protocol was built to limit the damage from those attacks, which we'll get into in Section 15.4.5 ๐ฆ
15.3. Binding Updates to Home Agent ๐
Signaling between the mobile node and the home agent needs message integrity. That's what lets the home agent be sure a Binding Update is coming from a legit mobile node ๐ซถ Correct ordering and anti-replay protection are also optional, but they're definitely useful to have.
IPsec ESP protects the integrity of Binding Updates and Binding Acknowledgements by securing the mobility messages between the mobile node and the home agent. ๐
IPsec can only give you anti-replay protection if dynamic keying is used, and that isn't always the case ๐ฅฒ IPsec also doesn't guarantee correct ordering of packets. It only makes sure they haven't been replayed. That's why the sequence numbers inside Mobile IPv6 messages are used to keep things in order (see Section 5.1). But here's the catch โ ๏ธ If the 16-bit Mobile IPv6 sequence number space gets cycled through, or the home agent reboots and loses its sequence number state, replay and reordering attacks become possible. Using dynamic keying, IPsec anti-replay protection, and the Mobile IPv6 sequence numbers together stops those attacks. It's also recommended to think about non-volatile storage for home agents, so they don't lose their state ๐พ
The sequence numbers use a sliding window scheme ๐ช Without a key management mechanism, protection against replays and reordering attacks holds up as long as the attacker remembers no more than 2**15 Binding Updates.
The checks above don't prove that the care-of address in a Binding Update is correct. That leaves room for denial-of-service attacks against third parties ๐ฌ Still, the mobile node and home agent share a security association, so the home agent can always figure out which mobile node is misbehaving. That lets the home agent operator cut off the mobile node's service and maybe take further action based on their business relationship with the mobile node's owner ๐
Heads up, though: using a single pair of manually keyed security associations clashes with generating a new home address [21] for the mobile node, or with adopting a new home subnet prefix ๐ That's because IPsec security associations are tied to the addresses they use. Certificate-based automatic keying helps with this to some extent, but you still need to make sure one mobile node can't send Binding Updates for another mobile node's address. Usually that means putting home addresses in the Subject AltName field of certificates. That again makes it hard to introduce new addresses without manual or automatic steps to set up new certificates. So this specification only lets new home addresses be generated (for any reason) when a security association or certificate for the new address already exists ๐
Support for IKEv2 is optional in this spec ๐ธ Here's what to keep in mind about manual keying:
- Like we said above, manually keyed IPsec only gives limited protection against replay and reordering attacks. There's a vulnerability if the sequence number space gets cycled through, or if the home agent reboots and forgets its sequence numbers (because it stores them in volatile memory) ๐ต Assuming the mobile node moves continuously every 10 minutes, it takes roughly 455 days before the sequence number space gets cycled through. Typical movement patterns rarely reach that high a frequency today ๐ข
- A mobile node and its home agent belong to the same domain. If that weren't true, manual keying wouldn't be possible [42]. But in Mobile IPv6, only these two parties need to know the manually configured keys. We also note that Mobile IPv6 uses standard block ciphers in IPsec, so it isn't vulnerable to the problems tied to stream ciphers and manual keying ๐ง
- The owner of the mobile node and the administrator of the home agent are expected to agree on the keys and other parameters through some off-line mechanism ๐
The use of IKEv2 with Mobile IPv6 is documented in more detail in [20]. Here's what to know about IKEv2 ๐
- A mobile node must not be able to claim another mobile node's home address. The home agent has to verify that the mobile node trying to negotiate the SA for a particular home address is authorized for that address. So even with IKEv2, a policy entry needs to be configured for each home address served by the home agent ๐ It may be possible to include home addresses in the Subject AltName field of a certificate to avoid this. However, implementations aren't guaranteed to support using one IP address (the care-of address) while another address (the home address) appears in the certificate. And even this approach would need user-specific tasks at the certificate authority ๐ฉ
- Because of the problems outlined in Section 11.3.2, the IKEv2 SA between the mobile node and its home agent is set up using the mobile node's current care-of address. That means when the mobile node moves somewhere new, it may have to re-establish an IKEv2 security association ๐ A Key Management Mobility Capability (K) flag exists for implementations that can update the IKEv2 endpoints without re-establishing an IKEv2 security association. Support for that behavior is optional, though ๐ซ
- Even if IKEv2 still needs per-mobile node configuration, a big perk is that it automates negotiating cryptographic parameters, including the Security Parameter Indices (SPIs), cryptographic algorithms, and so on. So less configuration info is needed ๐
- In some link layers or deployment scenarios, movement can be frequent enough that replay and reordering attacks become possible when only manual keying is used. IKEv2 SHOULD be used in those cases. Potentially vulnerable scenarios include continuous movement through small cells, or uncontrolled switching between available network attachment points ๐ถ
- In some deployments, the number of mobile nodes can be really large. In those cases, automatic mechanisms can cut down the management effort for cryptographic parameters, even though some per-mobile node configuration is always needed. IKEv2 SHOULD also be used in those cases ๐
15.4. Binding Updates to Correspondent Nodes ๐ค
The whole reason the return routability procedure was designed was to give Mobile IPv6 enough support without creating big new security problems ๐ The goal wasn't to protect against attacks that were already possible before Mobile IPv6 came along.
The next sections walk through the security properties of this method. They look at it from two angles: possible on-path attackers who can see the cryptographic values sent in the clear (Sections 15.4.2 and 15.4.3), and other attackers (Section 15.4.6) ๐ต๏ธโโ๏ธโจ
15.4.1. Overview ๐
okay so the chosen infrastructureless method checks that the mobile node is "live" (aka it responds to probes) at its home and care-of addresses. โจ Section 5.2 breaks down the return routability procedure in full detail ๐ซถ. It runs on these principles:
- A message exchange verifies that the mobile node is reachable at its addresses, i.e., is at least able to transmit and receive traffic at both the home and care-of addresses. ๐ก
- The eventual Binding Update is cryptographically bound to the tokens supplied in the exchanged messages. ๐
- Symmetric exchanges are employed so this protocol can't be used in reflection attacks ๐ โโ๏ธ. In a symmetric exchange, the responses are always sent to the same address the request came from.
- The correspondent node operates in a stateless manner until it receives a fully authorized Binding Update. ๐ง
- Some additional protection comes from encrypting the tunnels between the mobile node and home agent with IPsec ESP ๐. Since the tunnel also carries the nonce exchanges, attackers have a much harder time seeing those nonces. For instance, this blocks attacks launched from the mobile node's current foreign link, even when no link-layer confidentiality is available.
ngl the resulting level of security is in theory the same even without this extra layer: the return routability tokens are still exposed only to one path within the whole Internet ๐. But mobile nodes are often on an insecure link, like a public access Wireless LAN ๐ถ. So in many cases, this addition makes a practical difference ๐ .
For further information about the design rationale of the return routability procedure, see [28] [35] [34] [43]. The mechanisms used have been adopted from these documents. ๐
15.4.2. Achieved Security Properties ๐
The return routability procedure protects Binding Updates against all attackers who are unable to monitor the path between the home agent and the correspondent node ๐ก๏ธ. It does not defend against attackers who can monitor this path. Note that such attackers can already mount an active attack against the mobile node when it's at its home location anyway ๐. That possibility isn't a blocker for deploying Mobile IPv6, because those attacks are possible whether or not Mobile IPv6 is in use. ๐โโ๏ธ
This procedure also protects against denial-of-service attacks where the attacker pretends to be mobile but uses the victim's address as the care-of address ๐ค. That would make the correspondent node send the victim some unexpected traffic. The procedure shuts this down by requiring at least the passive presence of the attacker at the care-of address or on the path from the correspondent to the care-of address. Normally, that will be the mobile node itself ๐ซถ.
15.4.3. Comparison to Regular IPv6 Communications ๐
This section compares the protection the return routability method offers to the security of regular IPv6 communications ๐ . We'll sort vulnerabilities into three classes: (1) those related to attackers on the local network of the mobile node, home agent, or the correspondent node, (2) those related to attackers on the path between the home network and the correspondent node, and (3) off-path attackers, i.e., the rest of the Internet ๐.
Let's start with the vulnerabilities of regular IPv6 communications ๐ง. The on-link vulnerabilities include denial-of-service, masquerading, man-in-the-middle, eavesdropping, and other attacks. These can be launched by spoofing Router Discovery, Neighbor Discovery, and other IPv6 mechanisms. Some of them can be prevented with cryptographic protection in the packets ๐.
On-path attackers are a similar situation. Without cryptographic protection, the traffic is completely vulnerable ๐ฌ.
Assuming attackers haven't penetrated the security of the Internet routing protocols, attacks are much harder to launch from off-path locations ๐. The attacks that can come from these locations are mainly denial-of-service attacks, like flooding and/or reflection attacks. An off-path attacker can't become a man in the middle. Not possible, bestie ๐ซ.
Next up: vulnerabilities when IPv6 is used together with Mobile IPv6 and the return routability procedure ๐ฆ. On the local link, the vulnerabilities are the same as in IPv6, but masquerade and man-in-the-middle attacks can now also target future communications, not just current ones ๐ฑ. If a Binding Update was sent while the attacker was present on the link, its effects stay for the lifetime of the binding, even if the attacker moves away from the link. With plain IPv6, an attacker generally has to stay on the link to keep the attack going. Also, to launch these new attacks, the victim's IP address has to be known. That makes this attack feasible mainly with well-known interface IDs, like the ones already showing up in traffic on the link or registered in the DNS ๐ซฃ.
On-path attackers can exploit vulnerabilities similar to regular IPv6 ๐ค๏ธ. There are some minor differences though. Masquerade, man-in-the-middle, and denial-of-service attacks can be launched by intercepting just a few packets, while in regular IPv6 the attacker has to intercept every packet. The effect of the attacks is the same regardless of method, though. In any case, the hardest part for an attacker is getting on the right path ๐งญ.
The vulnerabilities for off-path attackers are the same as in regular IPv6. Nodes that aren't on the path between the home agent and the correspondent node won't be able to receive the home address probe messages ๐ .
So, the main takeaways from this comparison ๐:
- Return routability prevents any off-path attacks beyond those already possible in regular IPv6. This is the most important result, since it stops attackers on the Internet from exploiting any vulnerabilities ๐.
- Vulnerabilities to attackers on the home agent link, the correspondent node link, and the path between them are roughly the same as in regular IPv6 โ๏ธ.
- However, one difference is that in basic IPv6 an on-path attacker must be constantly present on the link or the path, whereas with Mobile IPv6, an attacker can leave a binding behind after moving away ๐ค.
That's why this specification limits the creation of bindings to at most MAX_TOKEN_LIFETIME seconds after the last routability check has been performed, and limits the duration of a binding to at most MAX_RR_BINDING_LIFETIME seconds โณ. With these limits, attackers can't take any practical advantage of this vulnerability ๐.
- There are some other minor differences, like an effect on the denial-of-service vulnerabilities. These can be considered insignificant ๐คทโโ๏ธ.
- The path between the home agent and a correspondent node is typically easiest to attack at the links on either end, especially if those links are publicly accessible wireless LANs ๐ถ. Attacks against the routers or switches on the path are typically harder to pull off. Layer 2 security of those links plays a major role in the overall network security. Similarly, the security of IPv6 Neighbor and Router Discovery on these links has a big impact. If these were secured using some new technology in the future, that could change where the easiest point of attack is ๐.
For a more in-depth discussion of these issues, see [43] ๐.
15.4.4. Replay Attacks ๐
The return routability procedure also protects participants against replayed Binding Updates ๐ก๏ธ. The attacker can't replay the same message because of the sequence number that's part of the Binding Update. They also can't modify the Binding Update, since MAC verification would fail after any change ๐ โโ๏ธ.
Care must be taken when removing bindings at the correspondent node, though ๐ง. If a binding is removed while the nonce used in its creation is still valid, an attacker could replay the old Binding Update ๐ฑ. The rules outlined in Section 5.2.8 make sure that can't happen ๐ซถ.
15.4.5. Denial-of-Service Attacks ๐จ
The return routability procedure has protection against resource exhaustion denial-of-service attacks ๐ช. Correspondent nodes don't keep any state about individual mobile nodes until an authentic Binding Update arrives. This works through keygen tokens built from the nonces and node keys, which aren't specific to individual mobile nodes ๐. The correspondent node can reconstruct the keygen tokens from the home and care-of address information that arrives with the Binding Update. So correspondent nodes are safe against memory exhaustion attacks, except where on-path attackers are concerned ๐ง . And because it uses symmetric cryptography, correspondent nodes are relatively safe against CPU resource exhaustion attacks too โก.
Still, as [28] describes, there are situations where the mobile and correspondent nodes can't tell whether they actually need a binding or whether an attacker just tricked them into thinking so ๐ซฃ. So it's necessary to consider situations where such attacks are happening.
Route optimization is a very important optimization, but it's still only an optimization ๐โโ๏ธ. A mobile node can communicate with a correspondent node even if the correspondent refuses to accept any Binding Updates. Performance will suffer, though, because packets from the correspondent node to the mobile node get routed via the mobile's home agent instead of a more direct route ๐ข. A correspondent node can protect itself against some of these resource exhaustion attacks as follows. If it's flooded with a large number of Binding Updates that fail the cryptographic integrity checks, it can stop processing Binding Updates ๐. And if a correspondent node finds it's spending more resources checking bogus Binding Updates than it's likely to save by accepting genuine ones, then it may silently discard some or all Binding Updates without performing any cryptographic operations ๐คซ.
Layers above IP can usually provide extra information to help decide whether a binding with a specific peer is needed ๐งฉ. For example, TCP knows if the node has a queue of data it's trying to send to a peer ๐ฌ. An implementation of this specification isn't required to use information from higher protocol layers, but some implementations are likely to manage resources more effectively by using that information ๐.
We also require that all implementations be capable of administratively disabling route optimization ๐.
15.4.6. Key Lengths โจ
okay bestie, attackers can try to break the return routability procedure in a bunch of ways ๐. Section 15.4.2 covers the case where the attacker can see the crypto values sent in the clear, and Section 15.4.3 talks about what that does to IPv6 communications. This part is about whether they can just guess the right values without seeing them ๐.
While return routability is in progress, 64-bit cookies protect spoofed responses ๐. This is believed to be enough, because to blindly spoof a response you'd have to send a very large number of messages before you'd probably win ๐ซถ.
The tokens used in return routability give 128 bits of info together ๐ฅ. That info gets fed into a hash function internally to make a 160-bit quantity, which is then used for the keyed hash in the Binding Update with HMAC_SHA1 ๐ . The final keyed hash is 96 bits. The limiting factors are the input token lengths and the final keyed hash length ๐. The internal hash function doesn't reduce the entropy โจ.
The 96-bit final keyed hash is a typical size and is believed to be secure ๐ฆ. The 128 bits of token input are split into two pieces, the home keygen token and the care-of keygen token ๐ธ. An attacker can try to guess the correct cookie value, but they'd need a huge number of messages (an the average 263 messages for one or 2127 for two) ๐ญ. Also, cookies are only valid for a short time, so the attacker would have to keep a high constant message rate to get a lasting effect. That doesn't seem practical ๐.
When the mobile node is returning home, it's allowed to use just the home keygen token, which is 64 bits ๐ . That's less than 128 bits, but attacking it blindly would still need a large number of messages ๐. If the attacker is on the path and can see the Binding Update, they could conceivably break the keyed hash with brute force. But being on the path means they'd have easier ways to cause denial of service than stopping route optimization, so it's not the obvious move ๐.
15.5. Dynamic Home Agent Address Discovery
The dynamic home agent address discovery function could be used to learn the addresses of home agents in the home network ๐ง.
Learning addresses of nodes may be useful to attackers, because brute-force scanning of the address space isn't practical with IPv6 ๐ โโ๏ธ. So they'd benefit from anything that makes mapping networks easier. For example, if a security threat aimed at routers or even home agents is discovered, having a simple ICMP mechanism that makes it easy to find possible targets may be an additional (though minor) security risk ๐.
This document doesn't define any authentication mechanism for dynamic home agent address discovery messages. So the home agent can't verify the home address of the mobile node that asked for the list of home agents ๐ฌ.
Apart from finding the address(es) of home agents, attackers won't learn much from this info, and mobile nodes can't be tricked into using the wrong home agents, because all other communication with the home agents is secure ๐.
If you need extra security, you could consider using MIPv6 bootstrapping [22] (based on DNS SRV Resource Records [10]) together with the security mechanisms suggested in these specifications ๐. In that solution, security comes from the DNS Security (DNSSEC) [13] framework. The pre-configured data the mobile node needs for this is the domain name of the mobile service provider, which is only marginally better than the home subnet prefix ๐. For security, you need a trust anchor that dominates the domain โจ.
15.6. Mobile Prefix Discovery
The mobile prefix discovery function may leak interesting info about network topology and prefix lifetimes to eavesdroppers ๐. That's why requests for this info have to be authenticated ๐. Responses and unsolicited prefix info also need to be authenticated, so mobile nodes can't be tricked into believing false info about prefixes, which could stop communications with existing addresses ๐ฑ. Encryption may optionally be applied to prevent leakage of prefix info ๐ซง.
15.7. Tunneling via the Home Agent
Tunnels between the mobile node and the home agent can be protected by using source addresses properly, plus optional cryptographic protection ๐. These procedures are covered in Section 5.5.
Binding Updates to the home agents are secure ๐ก๏ธ. When receiving tunneled traffic, the home agent checks that the outer IP address matches the current location of the mobile node. This is a weak form of protection against spoofed packets that appear to come from the mobile node ๐ต๏ธโโ๏ธ. It's especially useful if no end-to-end security is being applied between the mobile and correspondent nodes ๐. The outer IP address check stops attacks where the attacker is controlled by ingress filtering. It also stops attacks where the attacker doesn't know the mobile node's current care-of address ๐.
Attackers who know the care-of address and aren't controlled by ingress filtering could still send traffic through the home agent. That includes attackers on the same local link the mobile node is currently on ๐ณ. But those attackers could send packets that appear to come from the mobile node without attacking the tunnel at all, since they could just send packets with the source address set to the mobile node's home address ๐คทโโ๏ธ. This attack doesn't work if the packet's final destination is in the home network and some form of perimeter defense is applied to packets sent there ๐งฑ. In those cases, it's recommended that either end-to-end security or additional tunnel protection be applied, which is pretty usual in remote access situations ๐ .
Home agents and mobile nodes may use IPsec ESP to protect payload packets tunneled between themselves ๐. This is useful for protecting communications against attackers on the tunnel's path ๐ค๏ธ.
When a unique-local address (ULA, RFC 4193 [15]) is used as a home address, reverse tunneling can be used to send local traffic from another location ๐. Administrators should be aware of this when they allow such home addresses โ ๏ธ. In particular, the outer IP address check described above isn't enough against all attackers. Encrypted tunnels are especially useful for these kinds of home addresses ๐ฉท.
15.8. Home Address Option
When the mobile node sends packets directly to the correspondent node, the Source Address field of the packet's IPv6 header is the care-of address ๐ก. So ingress filtering [27] works in the usual way even for mobile nodes, because the Source Address is topologically correct โ . The Home Address option is used to tell the correspondent node the mobile node's home address ๐.
The care-of address in the Source Address field doesn't survive in replies sent by the correspondent node unless it has a binding for this mobile node ๐. Also, not all attacker tracing mechanisms work when packets are reflected through correspondent nodes using the Home Address option ๐ต๏ธ. For these reasons, this specification restricts the use of the Home Address option. It may only be used when a binding has already been set up with the participation of the node at the home address, as described in Sections 5.5 and 6.3 ๐ซ. This prevents reflection attacks through the Home Address option, and it makes sure correspondent nodes reply to the same address the mobile node sends traffic from ๐ฏ.
No special authentication of the Home Address option is required beyond the above. But note that if the IPv6 header of a packet is covered by IPsec Authentication Header, that authentication covers the Home Address option too ๐. So even when authentication is used in the IPv6 header, the security of the Source Address field isn't compromised by the presence of a Home Address option ๐. Without authentication of the packet, any field in the IPv6 header (including the Source Address field), or any other part of the packet, and the Home Address option can be forged or modified in transit ๐ฑ. In that case, the contents of the Home Address option are no more suspect than any other part of the packet ๐ซ .
15.9. Type 2 Routing Header
The type 2 routing header is defined in Section 6.4 ๐งฉ. This definition and its processing rules were chosen so the header can't be used for what's traditionally seen as source routing ๐ โโ๏ธ. In particular, the home address in the routing header will always have to be assigned to the home address of the receiving node, or else the packet gets dropped ๐๏ธ.
Source routing has a number of security concerns in general ๐ฉ. These include the automatic reversal of unauthenticated source routes (which is an issue for IPv4, but not for IPv6). Another concern is using source routing to "jump" between nodes inside and outside a firewall ๐งฑ. None of these are issues in Mobile IPv6, because of the rules above ๐.
Basically, the semantics of the type 2 routing header are the same as a special form of IP-in-IP tunneling, where the inner and outer source addresses are the same ๐ช.
This means a device that filters packets should be able to tell a type 2 routing header apart from other routing headers, as required in Section 8.3 ๐. That's needed so Mobile IPv6 traffic still gets through while you keep the option of filtering out other uses of routing headers ๐.
15.10. SHA-1 Secure Enough for Mobile IPv6 Control Messages
This document relies on hash-based message authentication codes (HMAC) computed with the SHA-1 [11] hash algorithm ๐. They're used for the home keygen token and care-of keygen token, plus the authentication fields in the binding update and binding authorization data (see Section 5.2.4) ๐. SHA-1 has been deprecated for some cryptographic mechanisms, but it's considered secure for the foreseeable future when used as specified here ๐ซถ. For additional details, see [39] ๐.
16. Contributors ๐ธ
Work done by Tuomas Aura, Mike Roe, Greg O'Shea, Pekka Nikander, Erik Nordmark, and Michael Thomas shaped the return routability protocols described in [35] ๐.
Significant contributions were made by members of the Mobile IPv6 Security Design Team, including (in alphabetical order) Gabriel Montenegro, Pekka Nikander, and Erik Nordmark ๐ฆ.
17. Acknowledgements โจ
Okay bestie, we have to give a big shoutout ๐ซถ to the members of the Mobile IP, Mobility Extensions for IPv6, and IPng Working Groups for their comments and suggestions on this work ๐ We especially want to thank (in alphabetical order) Fred Baker, Josh Broch, Samita Chakrabarti, Robert Chalmers, Noel Chiappa, Jean-Michel Combes, Greg Daley, Vijay Devarapalli, Rich Draves, Francis Dupont, Ashutosh Dutta, Arnaud Ebalard, Wesley Eddy, Thomas Eklund, Jun-Ichiro Itojun Hagino, Brian Haley, Marc Hasson, John Ioannidis, James Kempf, Rajeev Koodli, Suresh Krishnan, Krishna Kumar, T.J. Kniveton, Joe Lau, Aime Le Rouzic, Julien Laganier, Jiwoong Lee, Benjamin Lim, Vesa-Matti Mantyla, Kevin Miles, Glenn Morrow, Ahmad Muhanna, Thomas Narten, Karen Nielsen, Simon Nybroe, David Oran, Mohan Parthasarathy, Basavaraj Patil, Brett Pentland, Lars Henrik Petander, Alexandru Petrescu, Mattias Petterson, Ken Powell, Ed Remmell, Phil Roberts, Patrice Romand, Luis A. Sanchez, Pekka Savola, Jeff Schiller, Arvind Sevalkar, Keiichi Shima, Tom Soderlund, Hesham Soliman, Jim Solomon, Tapio Suihko, Dave Thaler, Pascal Thubert, Benny Van Houdt, Jon-Olov Vatn, Ryuji Wakikawa, Kilian Weniger, Carl E. Williams, Vladislav Yasevich, Alper Yegin, and Xinhua Zhao ๐, for their detailed reviews of earlier versions of this document. Their suggestions literally helped improve both the design and presentation of the protocol ๐ฅ
We also want to thank the participants of the Mobile IPv6 testing event (1999) ๐ธ, the implementers who joined Mobile IPv6 interoperability testing at Connectathons (2000, 2001, 2002, and 2003) ๐ , and the participants at the ETSI interoperability testing (2000, 2002) โจ. Finally, we want to thank the TAHI project for providing test suites for Mobile IPv6 ๐ฆ. Iconic behaviour, honestly.
18. References ๐
18.1. Normative References
- [1] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed-Hashing for Message Authentication", RFC 2104, February 1997.
- [2] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
- [3] Kent, S. and K. Seo, "Security Architecture for the Internet Protocol", RFC 4301, December 2005.
- [4] Kent, S., "IP Authentication Header", RFC 4302, December 2005.
- [5] Kent, S., "IP Encapsulating Security Payload (ESP)", RFC 4303, December 2005.
- [6] Deering, S. and R. Hinden, "Internet Protocol, Version 6 (IPv6) Specification", RFC 2460, December 1998.
- [7] Conta, A. and S. Deering, "Generic Packet Tunneling in IPv6 Specification", RFC 2473, December 1998.
- [8] Johnson, D. and S. Deering, "Reserved IPv6 Subnet Anycast Addresses", RFC 2526, March 1999.
- [9] Deering, S., Fenner, W., and B. Haberman, "Multicast Listener Discovery (MLD) for IPv6", RFC 2710, October 1999.
- [10] Gulbrandsen, A., Vixie, P., and L. Esibov, "A DNS RR for specifying the location of services (DNS SRV)", RFC 2782, February 2000.
- [11] National Institute of Standards and Technology, "Secure Hash Standard", FIPS PUB 180-1, April 1995, <http://www.itl.nist.gov/fipspubs/fip180-1.htm>.
- [12] Arkko, J., Devarapalli, V., and F. Dupont, "Using IPsec to Protect Mobile IPv6 Signaling Between Mobile Nodes and Home Agents", RFC 3776, June 2004.
- [13] Arends, R., Austein, R., Larson, M., Massey, D., and S. Rose, "DNS Security Introduction and Requirements", RFC 4033, March 2005.
- [14] Eastlake, D., Schiller, J., and S. Crocker, "Randomness Requirements for Security", BCP 106, RFC 4086, June 2005.
- [15] Hinden, R. and B. Haberman, "Unique Local IPv6 Unicast Addresses", RFC 4193, October 2005.
- [16] Hinden, R. and S. Deering, "IP Version 6 Addressing Architecture", RFC 4291, February 2006.
- [17] Conta, A., Deering, S., and M. Gupta, "Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6) Specification", RFC 4443, March 2006.
- [18] Narten, T., Nordmark, E., Simpson, W., and H. Soliman, "Neighbor Discovery for IP version 6 (IPv6)", RFC 4861, September 2007.
- [19] Thomson, S., Narten, T., and T. Jinmei, "IPv6 Stateless Address Autoconfiguration", RFC 4862, September 2007.
- [20] Devarapalli, V. and F. Dupont, "Mobile IPv6 Operation with IKEv2 and the Revised IPsec Architecture", RFC 4877, April 2007.
- [21] Narten, T., Draves, R., and S. Krishnan, "Privacy Extensions for Stateless Address Autoconfiguration in IPv6", RFC 4941, September 2007.
- [22] Giaretta, G., Kempf, J., and V. Devarapalli, "Mobile IPv6 Bootstrapping in Split Scenario", RFC 5026, October 2007.
- [23] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 5226, May 2008.
- [24] Kaufman, C., Hoffman, P., Nir, Y., and P. Eronen, "Internet Key Exchange Protocol Version 2 (IKEv2)", RFC 5996, September 2010.
18.2. Informative References
- [25] Perkins, C., "IP Encapsulation within IP", RFC 2003, October 1996.
- [26] Perkins, C., "Minimal Encapsulation within IP", RFC 2004, October 1996.
- [27] Ferguson, P. and D. Senie, "Network Ingress Filtering: Defeating Denial of Service Attacks which employ IP Source Address Spoofing", BCP 38, RFC 2827, May 2000.
- [28] Aura, T. and J. Arkko, "MIPv6 BU Attacks and Defenses", Work in Progress, March 2002.
- [29] Krishnan, S. and G. Tsirtsis, "MIPv6 Home Link Detection", Work in Progress, March 2008.
- [30] Reynolds, J., "Assigned Numbers: RFC 1700 is Replaced by an On-line Database", RFC 3232, January 2002.
- [31] Droms, R., Bound, J., Volz, B., Lemon, T., Perkins, C., and M. Carney, "Dynamic Host Configuration Protocol for IPv6 (DHCPv6)", RFC 3315, July 2003.
- [32] Perkins, C., "IP Mobility Support for IPv4, Revised", RFC 5944, November 2010.
- [33] Draves, R., "Default Address Selection for Internet Protocol version 6 (IPv6)", RFC 3484, February 2003.
- [34] Nordmark, E., "Securing MIPv6 BUs using return routability (BU3WAY)", Work in Progress, November 2001.
- [35] Roe, M., "Authentication of Mobile IPv6 Binding Updates and Acknowledgments", Work in Progress, March 2002.
- [36] Chowdhury, K. and A. Yegin, "MIP6-bootstrapping for the Integrated Scenario", Work in Progress, April 2008.
- [37] Savola, P., "Use of /127 Prefix Length Between Routers Considered Harmful", RFC 3627, September 2003.
- [38] Savola, P., "Security of IPv6 Routing Header and Home Address Options", Work in Progress, March 2002.
- [39] Polk, T., Chen, L., Turner, S., and P. Hoffman, "Security Considerations for the SHA-0 and SHA-1 Message-Digest Algorithms", RFC 6194, March 2011.
- [40] Manner, J. and M. Kojo, "Mobility Related Terminology", RFC 3753, June 2004.
- [41] Vida, R. and L. Costa, "Multicast Listener Discovery Version 2 (MLDv2) for IPv6", RFC 3810, June 2004.
- [42] Bellovin, S. and R. Housley, "Guidelines for Cryptographic Key Management", BCP 107, RFC 4107, June 2005.
- [43] Nikander, P., Arkko, J., Aura, T., Montenegro, G., and E. Nordmark, "Mobile IP Version 6 Route Optimization Security Design Background", RFC 4225, December 2005.
- [44] Nordmark, E., Chakrabarti, S., and J. Laganier, "IPv6 Socket API for Source Address Selection", RFC 5014, September 2007.
- [45] Abley, J., Savola, P., and G. Neville-Neil, "Deprecation of Type 0 Routing Headers in IPv6", RFC 5095, December 2007.
Appendix A. Future Extensions ๐ฎ
A.1. Piggybacking
This document does not specify how to piggyback payload packets on the binding-related messages ๐. However, it is envisioned that this can be specified in a separate document when issues such as the interaction between piggybacking and IPsec are fully resolved (see also Appendix A.3). The return routability messages can indicate support for piggybacking with a new mobility option.
A.2. Triangular Routing
Due to the concerns about opening reflection attacks with the Home Address destination option, this specification requires that this option be verified against the Binding Cache, i.e., there must be a Binding Cache entry for the home address and care-of address. ๐
Future extensions may be specified that allow the use of unverified Home Address destination options in ways that do not introduce security issues ๐.
A.3. New Authorization Methods
While the return routability procedure provides a good level of security, there exist methods that have even higher levels of security ๐. Second, as discussed in Section 15.4, future enhancements of IPv6 security may cause a need to also improve the security of the return routability procedure. Using IPsec as the sole method for authorizing Binding Updates to correspondent nodes is also possible. The protection of the Mobility Header for this purpose is easy, though one must ensure that the IPsec SA was created with appropriate authorization to use the home address referenced in the Binding Update. For instance, a certificate used by IKEv2 to create the security association might contain the home address. A future specification may specify how this is done ๐ง.
A.4. Neighbor Discovery Extensions
Future specifications may improve the efficiency of Neighbor Discovery tasks, which could be helpful for fast movements ๐โโ๏ธ๐จ. One factor is currently being looked at: the delays caused by the Duplicate Address Detection mechanism. Currently, Duplicate Address Detection needs to be performed for every new care-of address as the mobile node moves, and for the mobile node's link-local address on every new link. In particular, the need and the trade-offs of re-performing Duplicate Address Detection for the link-local address every time the mobile node moves on to new links will need to be examined. Improvements in this area are, however, generally applicable and progress independently from the Mobile IPv6 specification ๐.
Future functional improvements may also be relevant for Mobile IPv6 and other applications. For instance, mechanisms that would allow recovery from a Duplicate Address Detection collision would be useful for link-local, care-of, and home addresses ๐ .
Appendix B. Changes since RFC 3775 โจ
okay bestie, this is the changelog, and it's giving "here's everything we fixed since the last draft" ๐
The discussion for most of these lives on the [mext] working group page at http://trac.tools.ietf.org/wg/mext/trac/report/6 ๐ฆ
Issue #1 Last Accepted SQN [Ahmad Muhanna]
Solution: specify that the mobile node updates its binding sequence number to match the sequence number given in the Binding Acknowledgement, as long as the Binding Acknowledgement correctly passes authentication and the status is 135 (Sequence Number out of window). See Section 11.7.3. ๐ขโจ
Issue #4 Remove references to site-local addresses [George Tsirtsis].
Fixed. ๐๏ธ๐
Issue #5 Wrong protocol number (2 instead of 135) used in discussion about checksum pseudo-header.
Fixed. See Section 6.1.1. ๐งฎ๐
Issue #8 Application using the care-of address [Julien Laganier]
Cite IPv6 Socket API for Source Address Selection specification [44]. See Section 11.3.4. ๐
Issue #10 The usage of "HA lifetime" [Ryuji Wakikawa]
The mobile node SHOULD store the list of home agents for later use in case the home agent currently managing the mobile node's care-of address forwarding should become unavailable. See Section 11.4.1. ๐ ๐ซถ
Issue #11 De-registration when returning home [Vijay Devarapalli]
Okay this one is so important ๐ญ To be able to send and receive packets using its home address from the home link, the mobile node MUST send a Binding Update to its home agent to instruct its home agent to no longer intercept or tunnel packets for it. Until the mobile node sends such a de-registration Binding Update, it MUST NOT attempt to send and receive packets using its home address from the home link. See Section 11.5.5. ๐ช๐ฅ
Issue #12 BErr sent by HA too, not only by CN [Alexandru Petrescu]
Fixed. See Section 4.2. ๐
Issue #13 Home Link Detection [Suresh Krishnan]
Proposal: Add Section 11.5.2 for Home Link Detection, drawing on "MIPv6 Home Link Detection" [29]. ๐๐ธ
Issue #14 References to bootstrapping [Vijay Devarapalli]
Cite "Mobile IPv6 Bootstrapping in Split Scenario" [22] and "MIP6-bootstrapping for the Integrated Scenario" [36]. See Section 4.1. ๐ง
Issue #17 Multi-homed mobile node can cause routing loop between home agents [Benjamin Lim]
Added security advisory in Section 15.1, to highlight risk of routing loop among HAs (e.g., in 3GPP):
๐จ Security advisory, be careful! A malicious mobile node associated to multiple home agents could create a routing loop amongst them. This would happen when a mobile node binds one home address located on a first home agent to another home address on a second home agent. ๐
Issue #18 Subject: Issues regarding Home Address Option and ICMP / Binding Errors [Fabian Mauchle]
Proposal: Use the value in the Next Header field {50 (ESP), 51 (AH), 135 (Mobility Header)} to determine, if a Binding Cache entry is required. See Section 9.3.1. ๐งฉ
Proposal: If the Binding Error message was sent by the home agent, the mobile node SHOULD send a Binding Update to the home agent according to Section 11.7.1. See Section 11.3.6. ๐ก๐
Issue #19 BU de-registration race condition [Kilian Weniger]
Ngl this is a whole plot twist ๐ช๏ธ The problem arises if de-registration arrives at home agent before an immediately preceding Binding Update.
Solution: Home agent defers BCE removal after sending the Binding Acknowledgement. See Section 10.3.2. โณโจ
Issue #6 Minor editorial corrections and updates.
Update IPsec and IKE references to the revised IPsec architecture and IKEv2. ๐
Update HMAC_SHA1 [1] to Normative instead of Informational. ๐
Include discussion (see Section 15.10) to inform implementers that HMAC_SHA1 is considered to offer sufficient protection for control messages as required by Mobile IPv6. ๐๐
Authors' Addresses ๐
Charles E. Perkins (editor)
Tellabs, Inc.
4555 Great America Parkway, Suite 150
Santa Clara CA 95054
USA
EMail: charliep@computer.org
David B. Johnson
Rice University
Dept. of Computer Science, MS 132
6100 Main Street
Houston TX 77005-1892
USA
EMail: dbj@cs.rice.edu
Jari Arkko
Ericsson
Jorvas 02420
Finland
EMail: jari.arkko@ericsson.com
๐ฆ where this page comes from
- ietf: rfc6275 2011-07
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms