RFC 2002
IP Mobility Support
RFC 2002: IP Mobility Support ๐ฆ
Okay so this one is RFC 2002, called IP Mobility Support ๐. It's a Standards Track document dated October 1996, and C. Perkins from IBM is the editor ๐. It doesn't list anything it obsoletes or updates, so it stands on its own โจ.
Status of this Memo ๐
This doc is an Internet standards track protocol for the Internet community, and it's literally asking for discussion and suggestions for improvements ๐ . For the standardization state and status of this protocol, check the current edition of "Internet Official Protocol Standards" (STD 1) ๐ธ. Distribution of this memo is unlimited ๐.
Abstract ๐ฆ
Okay the big idea here is transparent routing of IP datagrams to mobile nodes, so they can roam around the Internet and still get their stuff ๐ง. Every mobile node is always known by its home address, no matter where it's plugged in โจ. When it's away from home, it also gets a care-of address, which tells everyone where it currently is on the Internet ๐บ๏ธ. The protocol lets the node register that care-of address with a home agent ๐. The home agent then sends datagrams meant for the mobile node through a tunnel to the care-of address ๐. Once they come out the other end of the tunnel, each datagram gets delivered to the mobile node ๐. Iconic. ๐
Table of Contents ๐
1. Introduction 3
1.1. Protocol Requirements . . . . . . . . . . . . . . . . . . 3
1.2. Goals . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3. Assumptions . . . . . . . . . . . . . . . . . . . . . . . 4
1.4. Applicability . . . . . . . . . . . . . . . . . . . . . . 4
1.5. New Architectural Entities . . . . . . . . . . . . . . . 5
1.6. Terminology . . . . . . . . . . . . . . . . . . . . . . . 6
1.7. Protocol Overview . . . . . . . . . . . . . . . . . . . . 8
1.8. Specification Language . . . . . . . . . . . . . . . . . 11
1.9. Message Format and Protocol Extensibility . . . . . . . . 12
2. Agent Discovery 14
2.1. Agent Advertisement . . . . . . . . . . . . . . . . . . . 14
2.1.1. Mobility Agent Advertisement Extension . . . . . 16
2.1.2. Prefix-Lengths Extension . . . . . . . . . . . . 18
2.1.3. One-byte Padding Extension . . . . . . . . . . . 19
2.2. Agent Solicitation . . . . . . . . . . . . . . . . . . . 19
2.3. Foreign Agent and Home Agent Considerations . . . . . . . 19
2.3.1. Advertised Router Addresses . . . . . . . . . . . 20
2.3.2. Sequence Numbers and Rollover Handling . . . . . 21
2.4. Mobile Node Considerations . . . . . . . . . . . . . . . 21
2.4.1. Registration Required . . . . . . . . . . . . . . 22
2.4.2. Move Detection . . . . . . . . . . . . . . . . . 22
2.4.3. Returning Home . . . . . . . . . . . . . . . . . 24
2.4.4. Sequence Numbers and Rollover Handling . . . . . 24
3. Registration 24
3.1. Registration Overview . . . . . . . . . . . . . . . . . . 25
3.2. Authentication . . . . . . . . . . . . . . . . . . . . . 26
3.3. Registration Request . . . . . . . . . . . . . . . . . . 26
3.4. Registration Reply . . . . . . . . . . . . . . . . . . . 29
3.5. Registration Extensions . . . . . . . . . . . . . . . . . 32
3.5.1. Computing Authentication Extension Values . . . . 32
3.5.2. Mobile-Home Authentication Extension . . . . . . 33
3.5.3. Mobile-Foreign Authentication Extension . . . . . 33
3.5.4. Foreign-Home Authentication Extension . . . . . . 34
3.6. Mobile Node Considerations . . . . . . . . . . . . . . . 34
3.6.1. Sending Registration Requests . . . . . . . . . . 36
3.6.2. Receiving Registration Replies . . . . . . . . . 40
3.6.3. Registration Retransmission . . . . . . . . . . . 42
3.7. Foreign Agent Considerations . . . . . . . . . . . . . . 43
3.7.1. Configuration and Registration Tables . . . . . . 44
3.7.2. Receiving Registration Requests . . . . . . . . . 44
3.7.3. Receiving Registration Replies . . . . . . . . . 47
3.8. Home Agent Considerations . . . . . . . . . . . . . . . . 49
3.8.1. Configuration and Registration Tables . . . . . . 49
3.8.2. Receiving Registration Requests . . . . . . . . . 49
3.8.3. Sending Registration Replies . . . . . . . . . . 53
4. Routing Considerations 55
4.1. Encapsulation Types . . . . . . . . . . . . . . . . . . . 56
4.2. Unicast Datagram Routing . . . . . . . . . . . . . . . . 56
4.2.1. Mobile Node Considerations . . . . . . . . . . . 56
4.2.2. Foreign Agent Considerations . . . . . . . . . . 57
4.2.3. Home Agent Considerations . . . . . . . . . . . . 58
4.3. Broadcast Datagrams . . . . . . . . . . . . . . . . . . . 59
4.4. Multicast Datagram Routing . . . . . . . . . . . . . . . 60
4.5. Mobile Routers . . . . . . . . . . . . . . . . . . . . . 61
4.6. ARP, Proxy ARP, and Gratuitous ARP . . . . . . . . . . . 62
5. Security Considerations 66
5.1. Message Authentication Codes . . . . . . . . . . . . . . 66
5.2. Areas of Security Concern in this Protocol . . . . . . . 66
5.3. Key Management . . . . . . . . . . . . . . . . . . . . . 67
5.4. Picking Good Random Numbers . . . . . . . . . . . . . . . 67
5.5. Privacy . . . . . . . . . . . . . . . . . . . . . . . . . 67
5.6. Replay Protection for Registration Requests . . . . . . . 68
5.6.1. Replay Protection using Timestamps . . . . . . . 68
5.6.2. Replay Protection using Nonces . . . . . . . . . 69
6. Acknowledgments 71
A. Patent Issues 72
A.1. IBM Patent #5,159,592 . . . . . . . . . . . . . . . . . . 72
A.2. IBM Patent #5,148,479 . . . . . . . . . . . . . . . . . . 72
B. Link-Layer Considerations 73
C. TCP Considerations 73
C.1. TCP Timers . . . . . . . . . . . . . . . . . . . . . . . 73
C.2. TCP Congestion Management . . . . . . . . . . . . . . . . 73
D. Example Scenarios 74
D.1. Registering with a Foreign Agent Care-of Address . . . . 74
D.2. Registering with a Co-Located Care-of Address . . . . . . 75
D.3. Deregistration . . . . . . . . . . . . . . . . . . . . . 76
E. Applicability of Prefix Lengths Extension 76
Editor's Address 79
1. Introduction โจ
Okay so here's the problem ๐ญ. IP version 4 assumes that a node's IP address tells you exactly where the node is plugged into the Internet ๐. That means a node has to be on the network its IP address points to, or else datagrams meant for it just can't be delivered ๐ญ. If a node wants to switch its point of attachment and still keep talking, there are currently two options that usually get used:
- a) the node has to change its IP address every time it changes its point of attachment, or
- b) host-specific routes have to get propagated throughout a big chunk of the Internet routing fabric.
Both of these are honestly often a no-go ๐ โโ๏ธ. Option a) makes it impossible for a node to keep its transport and higher-layer connections alive when it moves ๐. Option b) has obvious and severe scaling problems, especially with how fast notebook (mobile) computer sales are blowing up ๐๐.
So we need a new, scalable mechanism for node mobility on the Internet ๐ฆ. This document defines exactly that, and it lets nodes change their point of attachment without changing their IP address ๐.
1.1. Protocol Requirements ๐
A mobile node must be able to keep talking to other nodes after it changes its link-layer point of attachment to the Internet, and it has to do that without changing its IP address ๐ .
A mobile node must also be able to talk to other nodes that don't implement these mobility functions ๐ซถ. No protocol enhancements are required in hosts or routers that aren't acting as any of the new architectural entities introduced in Section 1.5 ๐.
Every message used to tell another node where a mobile node is must be authenticated โจ. That's how we protect against remote redirection attacks ๐จ. Don't skip this one, bestie ๐ฅ.
1.2. Goals ๐ฏ
The link a mobile node is directly attached to might often be a wireless link ๐ถ. That link can have a lot less bandwidth and a higher error rate than traditional wired networks ๐ฉ. Mobile nodes are also likely to be battery powered, so minimizing power consumption matters a lot ๐. For that reason, the number of administrative messages sent over that direct link should be minimized, and those messages should be kept as small as is reasonably possible ๐.
1.3. Assumptions ๐ง
The protocols in this document don't add any extra constraints on how IP addresses get assigned ๐ธ. So a mobile node can get an IP address from the organization that owns the machine, no drama ๐.
This protocol assumes that mobile nodes will generally not change their point of attachment to the Internet more than once per second โฑ๏ธ.
This protocol also assumes that IP unicast datagrams get routed based on the destination address in the datagram header, and not, for example, by source address ๐งญ.
1.4. Applicability ๐
Mobile IP is meant to let nodes move from one IP subnet to another ๐ถโโ๏ธ. It works just as well for mobility across homogeneous media as it does across heterogeneous media ๐. In other words, Mobile IP makes it just as easy to move from one Ethernet segment to another as it is to move from an Ethernet segment to a wireless LAN ๐ก, as long as the mobile node's IP address stays the same through the move โจ.
You can think of Mobile IP as solving the "macro" mobility management problem ๐ญ. It's less well suited to "micro" mobility management, like handoff between wireless transceivers that each only cover a tiny geographic area ๐. As long as the node doesn't move between points of attachment on different IP subnets, link-layer mechanisms for mobility (that is, link-layer handoff) may offer faster convergence and way less overhead than Mobile IP ๐โโ๏ธ๐จ.
โจ That's part 1 of 18, bestie, more coming soon ๐ซถ
1.5. New Architectural Entities โจ
okay so Mobile IP brings in three brand new functional entities, and they're the stars of the show ๐
- Mobile Node ๐ฆ: a host or router that switches its point of attachment from one network or subnetwork to another. It can move around without changing its IP address, and it can keep talking to other Internet nodes from any location using that same (constant) IP address, as long as link-layer connectivity to a point of attachment is available. Main character energy, no cap ๐
- Home Agent ๐ : a router sitting on a mobile node's home network. When the mobile node is away from home, it tunnels datagrams over to the mobile node so they still get delivered, and it keeps up-to-date location information for the mobile node. Basically the reliable bestie who always knows where you are ๐ซถ
- Foreign Agent ๐ธ: a router on a mobile node's visited network that provides routing services to the mobile node while it's registered. The foreign agent detunnels datagrams that the mobile node's home agent tunneled and delivers them to the mobile node. For datagrams the mobile node sends, the foreign agent may act as a default router for registered mobile nodes. It's giving helpful neighbour ๐ง
Now the address situation, which is lowkey the most iconic part ๐ Every mobile node gets a long-term IP address on its home network. This home address is handled the same way a "permanent" IP address gets handed out to a stationary host, so nothing weird there. When the mobile node is away from home, a "care-of address" gets attached to it, and that reflects wherever it's currently plugged in โจ The mobile node uses its home address as the source address on every IP datagram it sends, except in the cases this document spells out for certain mobility management functions (for example, Section 3.6.1.1). Those are the exceptions, and they're very specific ๐
1.6. Terminology ๐
This document uses a bunch of terms over and over, so here's the vocab list before we go further, bestie ๐
- Agent Advertisement ๐ฃ: an advertisement message made by attaching a special Extension to a router advertisement [4] message.
- Care-of Address ๐: the termination point of a tunnel heading toward a mobile node, for datagrams forwarded to the mobile node while it's away from home. The protocol can use two different types of care-of address. A "foreign agent care-of address" is the address of a foreign agent the mobile node is registered with. A "co-located care-of address" is an externally obtained local address that the mobile node has associated with one of its own network interfaces. Two flavours, both iconic ๐
- Correspondent Node ๐ค: a peer that a mobile node is communicating with. A correspondent node can be mobile or stationary, either one is valid ๐ฆ
- Foreign Network ๐: any network other than the mobile node's Home Network.
- Home Address ๐ก: an IP address assigned to a mobile node for an extended period of time. It stays unchanged no matter where the node is attached to the Internet.
- Home Network ๐ : a network, possibly virtual, whose network prefix matches the mobile node's home address. Standard IP routing will deliver datagrams destined for a mobile node's Home Address to the mobile node's Home Network, so that's how it finds its way home ๐ซถ
- Link ๐: a facility or medium over which nodes can communicate at the link layer. A link sits underneath the network layer.
- Link-Layer Address ๐ชช: the address used to identify an endpoint of some communication over a physical link. Typically, this is an interface's Media Access Control (MAC) address.
- Mobility Agent ๐ธ: either a home agent or a foreign agent.
- Mobility Binding ๐: the association of a home address with a care-of address, along with the remaining lifetime of that association. Think of it as a tiny relationship status with an expiry date ๐
- Mobility Security Association ๐ก๏ธ: a collection of security contexts between a pair of nodes, which may be applied to Mobile IP protocol messages exchanged between them. Each context indicates an authentication algorithm and mode (Section 5.1), a secret (a shared key, or an appropriate public/private key pair), and a style of replay protection in use (Section 5.6). Lots of moving parts, but so organised โจ
- Node ๐ป: a host or a router.
- Nonce ๐ฒ: a randomly chosen value, different from previous choices, inserted in a message to protect against replays. Never the same twice, periodt ๐
- Security Parameter Index (SPI) ๐๏ธ: an index identifying a security context between a pair of nodes, among the contexts available in the Mobility Security Association. SPI values 0 through 255 are reserved and MUST NOT be used in any Mobility Security Association. Those numbers are off-limits, no exceptions ๐ซ
- Tunnel ๐: the path a datagram follows while it's encapsulated. While it's encapsulated, the datagram is routed to a knowledgeable decapsulating agent, which decapsulates it and then correctly delivers it to its ultimate destination. It's giving delivery driver who actually knows the address ๐ง
- Virtual Network ๐ป: a network with no physical instantiation beyond a router, which has a physical network interface on another network. The router (for example, a home agent) generally advertises reachability to the virtual network using conventional routing protocols. A network that exists only in spirit, but still totally works ๐
- Visited Network ๐งณ: a network other than a mobile node's Home Network, to which the mobile node is currently connected. Basically wherever the mobile node is currently vibing โจ
- Visitor List ๐: the list of mobile nodes visiting a foreign agent. The guest list, essentially ๐
1.7. Protocol Overview โจ
Okay bestie, here's the big picture ๐ Mobile IP has two support services:
- Agent Discovery: home agents and foreign agents advertise that they're around on each link they serve. A newly arrived mobile node can send a solicitation on the link to find out if any prospective agents are there ๐ฆ
- Registration: when the mobile node is away from home, it registers its care-of address with its home agent. Depending on how it's attached, it either registers directly with its home agent, or goes through a foreign agent that forwards the registration along ๐
Here's the rough outline of how Mobile IP works, step by step ๐ง
- Mobility agents (that's foreign agents and home agents, fr fr) advertise their presence through Agent Advertisement messages (Section 2). A mobile node may optionally ask for an Agent Advertisement from any locally attached mobility agents by sending an Agent Solicitation message. ๐ฃ
- The mobile node gets these Agent Advertisements and figures out whether it's on its home network or a foreign one. ๐
- When the mobile node realizes it's back on its home network, it just operates without mobility services, no drama ๐ If it's returning home after being registered somewhere else, it deregisters with its home agent by swapping a Registration Request and a Registration Reply message with it.
- When a mobile node notices it has moved to a foreign network, it gets a care-of address on that network. The care-of address can come from a foreign agent's advertisements (a foreign agent care-of address), or from some external assignment mechanism like DHCP [6] (a co-located care-of address). ๐ธ
- The mobile node that's away from home then registers its new care-of address with its home agent, using a Registration Request and Registration Reply exchange, possibly through a foreign agent (Section 3). ๐
- Datagrams sent to the mobile node's home address get intercepted by its home agent, tunneled by the home agent to the mobile node's care-of address, received at the tunnel endpoint (either a foreign agent or the mobile node itself), and then finally delivered to the mobile node (Section 4.2.3). โจ
- Going the other way, datagrams sent by the mobile node are usually delivered to their destination using standard IP routing, and they don't necessarily go through the home agent. ๐ฆ
When the mobile node is away from home, Mobile IP uses protocol tunneling to hide its home address from the routers in between its home network and where it currently is ๐ซถ The tunnel ends at the mobile node's care-of address. That care-of address must be an address that datagrams can reach through conventional IP routing. Once the datagram gets there, the original datagram is pulled out of the tunnel and delivered to the mobile node.
Mobile IP gives you two alternative ways to get a care-of address ๐
- A "foreign agent care-of address" is a care-of address that a foreign agent hands out in its Agent Advertisement messages. In this case, the care-of address is an IP address of the foreign agent. The foreign agent is the tunnel endpoint, so when tunneled datagrams arrive, it decapsulates them and delivers the inner datagram to the mobile node. This is the preferred mode because lots of mobile nodes can share the same care-of address, which means it doesn't put unnecessary pressure on the already limited IPv4 address space ๐
- A "co-located care-of address" is a care-of address the mobile node gets as a local IP address through some external means, and then links to one of its own network interfaces. The address might be dynamically acquired as a temporary address by the mobile node, like through DHCP [6], or it could be a long-term address the mobile node owns, only used while it's visiting some foreign network. How you get a local IP address to use as a co-located care-of address is out of scope for this document ๐ When using a co-located care-of address, the mobile node is the tunnel endpoint and decapsulates the datagrams tunneled to it itself.
Using a co-located care-of address has the perk of letting a mobile node work without a foreign agent, for example in networks that haven't deployed a foreign agent yet ๐
Here's the catch though: it puts extra strain on the IPv4 address space, because a pool of addresses in the foreign network has to be made available to visiting mobile nodes. Maintaining pools like that for every subnet a mobile node might visit is hard to do efficiently ๐ญ
It's really important to understand the difference between the care-of address and the foreign agent functions ๐ The care-of address is simply the endpoint of the tunnel. It might be an address of a foreign agent (a foreign agent care-of address), or it might be an address the mobile node temporarily acquired (a co-located care-of address). A foreign agent, on the other hand, is a mobility agent that provides services to mobile nodes. See Sections 3.7 and 4.2.2 for more details.
A home agent MUST be able to attract and intercept datagrams that are destined to the home address of any of its registered mobile nodes. Using the proxy and gratuitous ARP mechanisms described in Section 4.6, this requirement can be satisfied if the home agent has a network interface on the link indicated by the mobile node's home address. Other placements of the home agent relative to the mobile node's home location MAY also be possible using other mechanisms for intercepting datagrams destined to the mobile node's home address. Such placements are beyond the scope of this document.
Similarly, a mobile node and a prospective or current foreign agent MUST be able to exchange datagrams without relying on standard IP routing mechanisms. That means the mechanisms that make forwarding decisions based on the network-prefix of the destination address in the IP header. This requirement can be satisfied if the foreign agent and the visiting mobile node have an interface on the same link. In that case, the mobile node and foreign agent just skip their normal IP routing when sending datagrams to each other, and address the underlying link-layer packets to their respective link-layer addresses. Other placements of the foreign agent relative to the mobile node MAY also be possible using other mechanisms to exchange datagrams between these nodes, but those placements are beyond the scope of this document. โจ
If a mobile node is using a co-located care-of address (as described in (b) above), the mobile node MUST be located on the link identified by the network prefix of this care-of address. Otherwise, datagrams destined to the care-of address would be undeliverable ๐
Here's an example of how datagrams get routed to and from a mobile node that's away from home, once it has registered with its home agent. In this figure, the mobile node is using a foreign agent care-of address ๐บ๏ธ
2) Datagram is intercepted 3) Datagram is
by home agent and detunneled and
is tunneled to the delivered to the
care-of address. mobile node.
+-----+ +-------+ +------+
|home | =======> |foreign| ------> |mobile|
|agent| | agent | <------ | node |
+-----+ +-------+ +------+
1) Datagram to /|\ /
mobile node | / 4) For datagrams sent by the
arrives on | / mobile node, standard IP
home network | / routing delivers each to its
via standard | |_ destination. In this figure,
IP routing. +----+ the foreign agent is the
|host| mobile node's default router.
+----+
1.8. Specification Language ๐
Okay so this section is the key to reading the rest of the doc ๐ Several words are used to signal the requirements of the specification, and they're often written in capitals so you can spot them easily.
- MUST: this word, or the adjective "required", means the definition is an absolute requirement of the specification. ๐
- MUST NOT: this phrase means the definition is an absolute prohibition of the specification. ๐ซ
- SHOULD: this word, or the adjective "recommended", means that in some circumstances there can be valid reasons to ignore this item. But the full implications have to be understood and carefully weighed before you pick a different course, because unexpected results may happen otherwise. ๐ค
- MAY: this word, or the adjective "optional", means this item is one of an allowed set of alternatives. An implementation that doesn't include this option MUST be prepared to interoperate with another implementation that does include it. ๐ซถ
- silently discard: the implementation discards the datagram without any further processing, and without indicating an error to the sender. The implementation SHOULD provide the capability of logging the error, including the contents of the discarded datagram, and SHOULD record the event in a statistics counter. ๐
1.9. Message Format and Protocol Extensibility ๐ง
okay so Mobile IP has its own control messages, and they get sent over UDP ๐ using the well-known port number 434. Right now there are only two message types defined:
1 Registration Request
3 Registration Reply
The up-to-date values for these message types live in the most recent "Assigned Numbers" [20], so go check there ๐.
For Agent Discovery, Mobile IP doesn't reinvent the wheel. It reuses the Router Advertisement and Router Solicitation messages that already exist for ICMP Router Discovery [4]. Lowkey genius ๐ซถ.
Mobile IP also has a general Extension mechanism, so optional info can ride along on Mobile IP control messages or on ICMP Router Discovery messages. Each Extension (with one exception) uses this Type-Length-Value format:
0 1 2
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
| Type | Length | Data ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Here's what each part does ๐:
Typeindicates the particular type of Extension.Lengthindicates the length (in bytes) of the data field within this Extension. The length does NOT include the Type and Length bytes.Datais the particular data associated with this Extension. This field may be zero or more bytes in length. The format and length of the data field is determined by the type and length fields.
Extensions let variable amounts of info fit inside each datagram. The end of the list of Extensions is marked by the total length of the IP datagram โจ.
Two separately maintained numbering spaces are used for Extension Type values in Mobile IP, and this part is the big one ๐:
- The first set is for Extensions that may appear only in Mobile IP control messages (the ones sent to and from UDP port number
434). Currently, these Types are defined:
32 Mobile-Home Authentication
33 Mobile-Foreign Authentication
34 Foreign-Home Authentication
- The second set is for Extensions that may appear only in ICMP Router Discovery messages [4]. Currently, Mobile IP defines these Types:
0 One-byte Padding (encoded with no Length nor Data field)
16 Mobility Agent Advertisement
19 Prefix-Lengths
Each individual Extension gets its own detailed section later in this document. The up-to-date Extension Type numbers are also in the most recent "Assigned Numbers" [20] ๐.
Because the two sets are separated (orthogonal), it's possible that two Extensions defined at a later date could share the same Type value. That only works as long as one is used only in Mobile IP control messages and the other only in ICMP Router Discovery messages ๐ฆ.
Now the important bit ๐จ. When an Extension numbered in either set within the range 0 through 127 is encountered but not recognized, the message containing that Extension MUST be silently discarded. When an Extension numbered in the range 128 through 255 is encountered and not recognized, that particular Extension is ignored, but the rest of the Extensions and message data MUST still be processed. The Length field of the Extension is used to skip the Data field when searching for the next Extension. So the length field is basically your skip button โญ๏ธ.
2. Agent Discovery ๐ฆ
Agent Discovery is how a mobile node figures out whether it's currently connected to its home network or to a foreign network. It's also how a mobile node can tell when it has moved from one network to another ๐. When it's connected to a foreign network, the methods in this section also let the mobile node find out the foreign agent care-of address each foreign agent on that network is offering ๐ .
Mobile IP extends ICMP Router Discovery [4] as its main mechanism for Agent Discovery. An Agent Advertisement is formed by including a Mobility Agent Advertisement Extension in an ICMP Router Advertisement message (Section 2.1). An Agent Solicitation message is identical to an ICMP Router Solicitation, except that its IP TTL MUST be set to 1 (Section 2.2). This section describes the message formats and procedures that mobile nodes, foreign agents, and home agents use together to make Agent Discovery work ๐ซถ.
Agent Advertisement and Agent Solicitation may not be necessary for link layers that already provide this functionality. How mobile nodes set up link-layer connections with prospective agents is outside the scope of this document (but see Appendix B) ๐. The procedures below assume that this link-layer connectivity is already in place.
No authentication is required for Agent Advertisement and Agent Solicitation messages. They MAY be authenticated using the IP Authentication Header [1], which is unrelated to the messages described in this document. How Advertisement and Solicitation messages may be authenticated is outside the scope of this document, so that's a whole other story ๐.
2.1. Agent Advertisement ๐ฃ
Agent Advertisements are sent by a mobility agent to advertise its services on a link. Mobile nodes use these advertisements to figure out their current point of attachment to the Internet ๐. An Agent Advertisement is an ICMP Router Advertisement that has been extended to also carry a Mobility Agent Advertisement Extension (Section 2.1.1) and, optionally, a Prefix-Lengths Extension (Section 2.1.2), a One-byte Padding Extension (Section 2.1.3), or other Extensions that might be defined in the future โจ.
Inside an Agent Advertisement message, the ICMP Router Advertisement fields are required to conform to these extra specifications:
- Link-Layer Fields
- Destination Address: The link-layer destination address of a unicast Agent Advertisement MUST be the same as the source link-layer address of the Agent Solicitation that prompted the Advertisement.
- IP Fields
- TTL: The TTL for all Agent Advertisements MUST be set to 1.
- Destination Address: As specified for ICMP Router Discovery [4], the IP destination address of an Agent Advertisement MUST be either the "all systems on this link" multicast address (
224.0.0.1) [5] or the "limited broadcast" address (255.255.255.255). The subnet-directed broadcast address of the form<prefix>.<-1>cannot be used, since mobile nodes will not generally know the prefix of the foreign network ๐ โโ๏ธ.
- ICMP Fields
- Code: The Code field of the agent advertisement is interpreted as follows:
0: The mobility agent handles common traffic. That is, it acts as a router for IP datagrams not necessarily related to mobile nodes.16: The mobility agent does not route common traffic. However, all foreign agents MUST (minimally) forward to a default router any datagrams received from a registered mobile node (Section 4.2.2).
- Lifetime: The maximum length of time that the Advertisement is considered valid in the absence of further Advertisements.
- Router Address(es): See Section 2.3.1 for a discussion of the addresses that may appear in this portion of the Agent Advertisement.
- Num Addrs: The number of Router Addresses advertised in this message. Note that in an Agent Advertisement message, the number of router addresses specified in the ICMP Router Advertisement portion of the message MAY be set to 0. See Section 2.3.1 for details.
- Code: The Code field of the agent advertisement is interpreted as follows:
If Agent Advertisements are sent periodically, the nominal interval between them SHOULD be 1/3 of the advertisement Lifetime given in the ICMP header. That gives a mobile node room to miss three successive advertisements before it deletes the agent from its list of valid agents ๐ฐ๏ธ. The actual transmission time for each advertisement SHOULD be slightly randomized [4] so it avoids synchronizing with, and colliding with, Agent Advertisements from other agents (or with Router Advertisements from other routers) ๐ฒ. Also note that this field has no relation to the "Registration Lifetime" field inside the Mobility Agent Advertisement Extension defined below. Two different timers, bestie, don't mix them up ๐.
2.1.1. Mobility Agent Advertisement Extension ๐
okay so the Mobility Agent Advertisement Extension sits right after the ICMP Router Advertisement fields ๐ . Its whole job is to say "hey, this ICMP Router Advertisement is also an Agent Advertisement from a mobility agent" โจ. 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 | Length | Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Registration Lifetime |R|B|H|F|M|G|V| reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| zero or more Care-of Addresses |
| ... |
Here's the breakdown, bestie ๐ซถ:
Typeis16๐Lengthis(6 + 4*N), whereNis the number of care-of addresses advertised ๐งฎSequence Numberis the count of Agent Advertisement messages sent since the agent was initialized (Section 2.3.2) ๐ขRegistration Lifetimeis the longest lifetime (measured in seconds) this agent is willing to accept in any Registration Request. A value of0xffffmeans infinity โพ๏ธ. This field has nothing to do with the "Lifetime" field inside the ICMP Router Advertisement portion of the Agent Advertisement, so don't mix them up ๐Rmeans registration required. Registration with this foreign agent (or another foreign agent on this link) is required, instead of using a co-located care-of address ๐Bmeans busy. The foreign agent will not accept registrations from additional mobile nodes ๐ซHmeans home agent. This agent offers service as a home agent on the link where this Agent Advertisement message is sent ๐Fmeans foreign agent. This agent offers service as a foreign agent on the link where this Agent Advertisement message is sent ๐งณMmeans minimal encapsulation. This agent implements receiving tunneled datagrams that use minimal encapsulation [15] ๐ฆGmeans GRE encapsulation. This agent implements receiving tunneled datagrams that use GRE encapsulation [8] ๐Vmeans Van Jacobson header compression. This agent supports use of Van Jacobson header compression [10] over the link with any registered mobile node ๐๏ธreservedis sent as zero and ignored on reception ๐ซง- Care-of Address(es) are the advertised foreign agent care-of address(es) this foreign agent provides. An Agent Advertisement MUST include at least one care-of address if the 'F' bit is set ๐ The number of care-of addresses present is determined by the Length field in the Extension ๐ง
Okay, the big one: a home agent MUST always be ready to serve the mobile nodes it's the home agent for ๐. A foreign agent might be too busy to serve more mobile nodes sometimes, but it still has to keep sending Agent Advertisements. That way, any mobile nodes already registered with it know they haven't wandered out of range and that the foreign agent hasn't crashed ๐ญ. A foreign agent can say it's "too busy" to let new mobile nodes register by setting the 'B' bit in its Agent Advertisements ๐ซ . An Agent Advertisement message MUST NOT have the 'B' bit set if the 'F' bit is not also set. And at least one of the 'F' bit and the 'H' bit MUST be set in any Agent Advertisement message sent ๐
When a foreign agent wants to require registration even from mobile nodes that have grabbed a co-located care-of address, it sets the 'R' bit to one ๐. This bit only applies to foreign agents, so an agent MUST NOT set the 'R' bit to one unless the 'F' bit is also set to one ๐ โโ๏ธ
2.1.2. Prefix-Lengths Extension ๐ธ
The Prefix-Lengths Extension MAY follow the Mobility Agent Advertisement Extension โจ. It tells you how many bits of network prefix apply to each Router Address listed in the ICMP Router Advertisement portion of the Agent Advertisement ๐งฉ. Important tea โ: the prefix lengths given DO NOT apply to the care-of address(es) listed in the Mobility Agent Advertisement Extension. 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 | Length | Prefix Length | ....
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Typeis19(Prefix-Lengths Extension) ๐ท๏ธLengthisN, whereNis the value of the Num Addrs field in the ICMP Router Advertisement portion of the Agent Advertisement ๐ข- Prefix Length(s) is the number of leading bits that define the network number of the matching Router Address in the ICMP Router Advertisement portion of the message. Each Router Address gets its own byte for its prefix length, in the same order the Router Addresses are listed in that portion of the message ๐งฑ
Bonus bestie info ๐ฆ: check out Section 2.4.2 for how a mobile node MAY use the Prefix Lengths Extension when it's figuring out whether it has moved. And see Appendix E for implementation details about using this Extension ๐
2.1.3. One-byte Padding Extension ๐งธ
Some IP protocol implementations are super picky and insist on padding ICMP messages to an even number of bytes ๐. So if the ICMP length of an Agent Advertisement is odd, this Extension MAY be included to make the ICMP length even โจ. But heads up ๐จ: this Extension is NOT meant to be a general-purpose Extension for word- or long-aligning the fields of the Agent Advertisement. An Agent Advertisement SHOULD NOT include more than one One-byte Padding Extension, and if one is present, it SHOULD be the last Extension in the Agent Advertisement ๐ซถ
Unlike the other Extensions in Mobile IP, the One-byte Padding Extension is just a single byte, with no "Length" or "Data" field ๐ค. Here's the layout:
0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+
| Type |
+-+-+-+-+-+-+-+-+
Type 0(One-byte Padding Extension) ๐ซง
2.2. Agent Solicitation ๐
An Agent Solicitation is identical to an ICMP Router Solicitation, with one extra rule: the IP TTL Field MUST be set to 1 ๐ต๏ธโโ๏ธ Simple but iconic.
2.3. Foreign Agent and Home Agent Considerations ๐ก
Any mobility agent that can't be discovered by a link-layer protocol MUST send Agent Advertisements ๐ข. An agent that can be discovered by a link-layer protocol SHOULD also implement Agent Advertisements ๐ค. However, the Advertisements need not be sent, except when site policy requires registration with the agent (that is, when the 'R' bit is set), or as a response to a specific Agent Solicitation ๐ซ . All mobility agents SHOULD respond to Agent Solicitations ๐ฌ.
The same procedures, defaults, and constants are used in Agent Advertisement messages and Agent Solicitation messages as specified for ICMP Router Discovery [4], with a few extra twists ๐:
- a mobility agent MUST limit the rate at which it sends broadcast or multicast Agent Advertisements. A recommended maximum rate is once per second, AND ๐ข
- a mobility agent that receives a Router Solicitation MUST NOT require that the IP Source Address is the address of a neighbor (that is, an address that matches one of the router's own addresses on the arrival interface, under the subnet mask associated with that address of the router) ๐ง
- a mobility agent MAY be configured to send Agent Advertisements only in response to an Agent Solicitation message ๐ฏ
If the home network is not a virtual network, the home agent for any mobile node SHOULD be located on the link identified by the mobile node's home address. Agent Advertisement messages sent by the home agent on this link MUST have the 'H' bit set ๐ That way, mobile nodes on their own home network can tell they're actually home โจ. Any Agent Advertisement messages the home agent sends on another link it may be attached to (if it's a mobility agent serving more than one link) MUST NOT have the 'H' bit set, unless the home agent also serves as a home agent (to other mobile nodes) on that other link ๐งญ
If the home network is a virtual network, it has no physical realization outside the home agent itself ๐ป. So there's no physical network link to send Agent Advertisement messages advertising the home agent on. Mobile nodes whose home network is virtual are always treated as being away from home ๐งณ
On a particular subnet, either all mobility agents MUST include the Prefix-Lengths Extension, or all of them MUST NOT include this Extension ๐งฉ. It's prohibited for some agents on a subnet to include it while others don't. Otherwise, one of the move detection algorithms designed for mobile nodes won't work properly (Section 2.4.2) ๐ค
2.3.1. Advertised Router Addresses ๐ฌ
The ICMP Router Advertisement portion of the Agent Advertisement MAY contain one or more router addresses. So an agent MAY include one of its own addresses in the advertisement ๐ช. A foreign agent MAY discourage use of that address as a default router by setting the preference to a low value and including the address of another router in the advertisement (with a correspondingly higher preference) ๐. Still, a foreign agent MUST route datagrams it receives from registered mobile nodes (Section 4.2.2) ๐ no skipping that step!
2.3.2. Sequence Numbers and Rollover Handling ๐
The sequence number in Agent Advertisements ranges from 0 to 0xffff ๐ข. After booting, an agent MUST use the number 0 for its first advertisement. Each subsequent advertisement MUST use the sequence number one greater, with one exception: the sequence number 0xffff MUST be followed by sequence number 256 ๐ช. This is the clever bit ๐ง . It lets mobile nodes tell apart a drop in sequence numbers caused by a reboot from a drop caused by the sequence number rolling over after hitting 0xffff ๐ก
2.4. Mobile Node Considerations ๐ฑโจ
Every mobile node MUST implement Agent Solicitation ๐
. Solicitations SHOULD only be sent when there are no Agent Advertisements around and a care-of address hasn't been figured out through a link-layer protocol or other means. The mobile node uses the same procedures, defaults, and constants for Agent Solicitation as ICMP Router Solicitation messages [4] do, with two exceptions: the mobile node MAY solicit more often than once every three seconds, and a mobile node that isn't connected to any foreign agent right now MAY solicit more times than MAX_SOLICITATIONS ๐ฆ.
The rate at which a mobile node sends Solicitations MUST be limited by the mobile node ๐ฆ. It MAY send three initial Solicitations at a maximum rate of one per second while it's searching for an agent. After that, the rate MUST be reduced so the overhead on the local link stays low. Later Solicitations MUST use binary exponential backoff, doubling the interval between consecutive Solicitations, up to a maximum interval. The maximum interval SHOULD be chosen based on the characteristics of the media the mobile node is soliciting over, and it SHOULD be at least one minute between Solicitations โณ.
While it's still searching, the mobile node MUST NOT increase the rate at which it sends Solicitations unless it has received a positive indication that it has moved to a new link ๐ โโ๏ธ. After successfully registering with an agent, the mobile node SHOULD also increase the rate at which it sends Solicitations when it next begins searching for a new agent to register with. That increased rate MAY revert to the maximum rate, but then it MUST be limited in the manner described above. In all cases, the recommended solicitation intervals are nominal values. Mobile nodes MUST randomize their solicitation times around these nominal values, as specified for ICMP Router Discovery [4] ๐ฒ.
Mobile nodes MUST process received Agent Advertisements ๐จ. A mobile node can tell an Agent Advertisement apart from other uses of the ICMP Router Advertisement message by looking at the number of advertised addresses and the IP Total Length field. When the IP total length says the ICMP message is longer than needed for the number of advertised addresses, the leftover data is read as one or more Extensions. If a Mobility Agent Advertisement Extension is present, the advertisement is an Agent Advertisement ๐งฉ.
When multiple methods of agent discovery are in use, the mobile node SHOULD first try to register with agents that include Mobility Agent Advertisement Extensions in their advertisements, instead of agents found by other means ๐. This preference makes it more likely the registration will be recognized, which means fewer registration attempts overall.
2.4.1. Registration Required ๐
When the mobile node receives an Agent Advertisement with the R bit set, the mobile node SHOULD register through the foreign agent, even if it could get its own co-located care-of address. This exists so sites can enforce visiting policies, like accounting, that need exchanges of authorization ๐งพ.
2.4.2. Move Detection ๐บ๏ธ
There are two main mechanisms for mobile nodes to detect when they've moved from one subnet to another. Other mechanisms MAY also be used. When the mobile node detects that it has moved, it SHOULD register (Section 3) with a suitable care-of address on the new foreign network. However, the mobile node MUST NOT register more frequently than once per second on average, as specified in Section 3.6.3 ๐.
2.4.2.1. Algorithm 1
The first method is based on the Lifetime field in the main body of the ICMP Router Advertisement portion of the Agent Advertisement โฐ. A mobile node SHOULD record the Lifetime received in any Agent Advertisements until that Lifetime expires. If the mobile node doesn't get another advertisement from the same agent within the specified Lifetime, it SHOULD assume it has lost contact with that agent ๐. If the mobile node has already received an Agent Advertisement from a different agent whose Lifetime hasn't expired yet, the mobile node MAY immediately try to register with that other agent. Otherwise, the mobile node SHOULD try to discover a new agent to register with ๐.
2.4.2.2. Algorithm 2
The second method uses network prefixes ๐ง . The Prefix-Lengths Extension MAY be used in some cases by a mobile node to figure out whether a newly received Agent Advertisement came from the same subnet as its current care-of address. If the prefixes differ, the mobile node MAY assume it has moved.
If a mobile node is using a foreign agent care-of address, it SHOULD NOT use this method of move detection unless both the current agent and the new agent include the Prefix-Lengths Extension in their Agent Advertisements. If this Extension is missing from one or both advertisements, this method SHOULD NOT be used ๐ซ.
Similarly, if a mobile node is using a co-located care-of address, it SHOULD not use this method of move detection unless the new agent includes the Prefix-Lengths Extension in its Advertisement and the mobile node knows the network prefix of its current co-located care-of address ๐ค.
When the current registration expires, if this method says the mobile node has moved, the mobile node MAY choose to register with a the foreign agent sending the new Advertisement with the different network prefix, instead of re-registering with its current care-of address ๐. The Agent Advertisement that the new registration is based on MUST NOT have expired according to its Lifetime field โณ.
2.4.3. Returning Home ๐
A mobile node can tell it has returned to its home network when it receives an Agent Advertisement from its own home agent ๐ฅน. If that happens, it SHOULD deregister with its home agent (Section 3). Before trying to deregister, the mobile node SHOULD configure its routing table appropriately for its home network (Section 4.2.1). Also, if the home network is using ARP [16], the mobile node MUST follow the procedures in Section 4.6 for ARP, proxy ARP, and gratuitous ARP ๐งน.
2.4.4. Sequence Numbers and Rollover Handling ๐ข
If a mobile node sees two successive sequence numbers in the Agent Advertisements from the foreign agent it's registered with, and the second one is less than the first and falls in the range 0 to 255, the mobile node SHOULD register again ๐. If the second value is less than the first but is greater than or equal to 256, the mobile node SHOULD assume the sequence number has rolled over past its maximum value (0xffff), and that reregistration is not necessary (Section 2.3) ๐.
3. Registration ๐โจ
Mobile IP registration gives mobile nodes a flexible way to tell their home agent where they currently are ๐. It's how mobile nodes:
- request forwarding services when they're visiting a foreign network,
- tell their home agent their current care-of address,
- renew a registration that's about to expire, and/or
- deregister when they get back home.
Registration messages swap information between a mobile node, (optionally) a foreign agent, and the home agent ๐. Registration creates or changes a mobility binding at the home agent, linking the mobile node's home address with its care-of address for the specified Lifetime ๐.
There are some other (optional) extras you get through the registration procedure, which let a mobile node:
- keep multiple registrations going at once, so a copy of each datagram gets tunneled to every active care-of address,
- deregister specific care-of addresses while keeping its other mobility bindings, and
- find the address of a home agent if it wasn't configured with that info ๐ง.
3.1. Registration Overview ๐๏ธ
Mobile IP defines two registration procedures: one through a foreign agent that passes the registration on to the mobile node's home agent, and one directly with the mobile node's home agent. These rules decide which one to use in any given situation ๐งญ:
- If a mobile node is registering a foreign agent care-of address, the mobile node MUST register via that foreign agent.
- If a mobile node is using a co-located care-of address and gets an Agent Advertisement from a foreign agent on the link where it's using that care-of address, the mobile node SHOULD register via that foreign agent (or via another foreign agent on this link) if the
Rbit is set in the received Agent Advertisement message. - If a mobile node is otherwise using a co-located care-of address, the mobile node MUST register directly with its home agent.
- If a mobile node has returned to its home network and is (de)registering with its home agent, the mobile node MUST register directly with its home agent.
Both registration procedures involve exchanging Registration Request and Registration Reply messages (Sections 3.3 and 3.4) ๐ฌ. When registering via a foreign agent, the procedure takes these four messages:
a) The mobile node sends a Registration Request to the prospective foreign agent to kick off the registration process.
b) The foreign agent processes the Registration Request and then relays it to the home agent.
c) The home agent sends a Registration Reply to the foreign agent to grant or deny the Request.
d) The foreign agent processes the Registration Reply and then relays it to the mobile node to let it know how its Request went.
When the mobile node registers directly with its home agent instead, the procedure only takes these two messages:
a) The mobile node sends a Registration Request to the home agent.
b) The home agent sends a Registration Reply to the mobile node, granting or denying the Request.
The registration messages defined in Sections 3.3 and 3.4 use the User Datagram Protocol (UDP) [17] ๐ฆ. A nonzero UDP checksum SHOULD be included in the header, and MUST be checked by the recipient โ .
3.2. Authentication ๐
Each mobile node, foreign agent, and home agent MUST be able to support a mobility security association for mobile entities, indexed by their SPI and IP address. For a mobile node, this must be its Home Address. See Section 5.1 for requirements on supporting authentication algorithms ๐ก๏ธ. Registration messages between a mobile node and its home agent MUST be authenticated with the Mobile-Home Authentication Extension (Section 3.5.2). This Extension immediately follows all non-authentication Extensions, except for those foreign agent-specific Extensions that may be added to the message after the mobile node computes the authentication ๐.
3.3. Registration Request โจ
okay so a mobile node registers with its home agent by sending a Registration Request message ๐, which lets the home agent create or modify a mobility binding for that mobile node (like giving it a new lifetime ๐ฐ๏ธ). The Request can be relayed to the home agent by the foreign agent the mobile node is registering through, or it can go straight to the home agent if the mobile node is registering a co-located care-of address ๐ก.
IP fields:
- Source Address: typically the interface address the message is sent from.
- Destination Address: typically that of the foreign agent or the home agent.
See Sections 3.6.1.1 and 3.7.2.2 for details ๐ง.
UDP fields:
- Source Port: variable
- Destination Port: 434
the UDP header is followed by the Mobile IP fields ๐:
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 |S|B|D|M|G|V|rsv| Lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Home Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Home Agent |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Care-of Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Identification +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Extensions ...
+-+-+-+-+-+-+-+-
- Type:
1(Registration Request) ๐ - S: Simultaneous bindings. If the
Sbit is set, the mobile node is requesting that the home agent retain its prior mobility bindings, as described in Section 3.6.1.2 ๐ซถ. - B: Broadcast datagrams. If the
Bbit is set, the mobile node requests that the home agent tunnel to it any broadcast datagrams that it receives on the home network, as described in Section 4.3 ๐ก. - D: Decapsulation by mobile node. If the
Dbit is set, the mobile node will itself decapsulate datagrams which are sent to the care-of address. That is, the mobile node is using a co-located care-of address ๐ . - M: Minimal encapsulation. If the
Mbit is set, the mobile node requests that its home agent use minimal encapsulation [15] for datagrams tunneled to the mobile node ๐ฆ. - G: GRE encapsulation. If the
Gbit is set, the mobile node requests that its home agent use GRE encapsulation [8] for datagrams tunneled to the mobile node ๐. - V: The mobile node requests that its mobility agent use Van Jacobson header compression [10] over its link with the mobile node ๐๏ธ.
- rsv: Reserved bits; sent as zero.
- Lifetime: The number of seconds remaining before the registration is considered expired. A value of zero indicates a request for deregistration. A value of
0xffffindicates infinity โณ. - Home Address: The IP address of the mobile node ๐ .
- Home Agent: The IP address of the mobile node's home agent ๐งโ๐ผ.
- Care-of Address: The IP address for the end of the tunnel ๐.
- Identification: A 64-bit number, constructed by the mobile node, used for matching Registration Requests with Registration Replies, and for protecting against replay attacks of registration messages. See Sections 5.4 and 5.6 ๐.
- Extensions: The fixed portion of the Registration Request is followed by one or more of the Extensions listed in Section 3.5. The Mobile-Home Authentication Extension MUST be included in all Registration Requests. See Sections 3.6.1.3 and 3.7.2.2 for information on the relative order in which different extensions, when present, MUST be placed in a Registration Request message ๐.
3.4. Registration Reply โจ
okay so a mobility agent sends a Registration Reply message back to a mobile node that sent a Registration Request (Section 3.3) ๐ฌ. If the mobile node is asking a foreign agent for service, that foreign agent gets the Reply from the home agent and then passes it along to the mobile node ๐. The Reply carries the codes that tell the mobile node how its Request went, plus the lifetime the home agent granted, which MAY be smaller than the one originally requested ๐ฆ.
now the lifetime rules, which are kinda the juiciest part ๐ญ:
- The foreign agent MUST NOT increase the Lifetime selected by the mobile node in the Registration Request, since the Lifetime is covered by the Mobile-Home Authentication Extension, which cannot be correctly (re)computed by the foreign agent ๐ โโ๏ธ.
- The home agent MUST NOT increase the Lifetime selected by the mobile node in the Registration Request, since doing so could increase it beyond the maximum Registration Lifetime allowed by the foreign agent ๐.
- If the Lifetime received in the Registration Reply is greater than that in the Registration Request, the Lifetime in the Request MUST be used โช.
- When the Lifetime received in the Registration Reply is less than that in the Registration Request, the Lifetime in the Reply MUST be used โฉ.
IP fields:
- Source Address: typically copied from the destination address of the Registration Request to which the agent is replying. See Sections 3.7.2.3 and 3.8.3.1 for complete details.
- Destination Address: copied from the source address of the Registration Request to which the agent is replying.
UDP fields:
- Source Port:
<variable> - Destination Port: copied from the source port of the corresponding Registration Request (Section 3.7.1).
the UDP header is followed by the Mobile IP fields ๐ง:
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 | Lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Home Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Home Agent |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Identification +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Extensions ...
+-+-+-+-+-+-+-+-
- Type:
3(Registration Reply) ๐ธ - Code: a value indicating the result of the Registration Request. See below for a list of currently defined Code values ๐ฏ.
- Lifetime: if the Code field indicates that the registration was accepted, the Lifetime field is set to the number of seconds remaining before the registration is considered expired. A value of zero indicates that the mobile node has been deregistered. A value of
0xffffindicates infinity. If the Code field indicates that the registration was denied, the contents of the Lifetime field are unspecified and MUST be ignored on reception ๐. - Home Address: The IP address of the mobile node ๐ .
- Home Agent: The IP address of the mobile node's home agent ๐งโ๐ผ.
- Identification: A 64-bit number used for matching Registration Requests with Registration Replies, and for protecting against replay attacks of registration messages. The value is based on the Identification field from the Registration Request message from the mobile node, and on the style of replay protection used in the security context between the mobile node and its home agent (defined by the mobility security association between them, and SPI value in the Mobile-Home Authentication Extension). See Sections 5.4 and 5.6 ๐.
- Extensions: the fixed portion of the Registration Reply is followed by one or more of the Extensions listed in Section 3.5. The Mobile-Home Authentication Extension MUST be included in all Registration Replies returned by the home agent. See Sections 3.7.2.2 and 3.8.3.3 for rules on placement of extensions to Reply messages ๐งฉ.
these are the Code values, all defined right here ๐:
Registration successful:
0 registration accepted
1 registration accepted, but simultaneous mobility
bindings unsupported
Registration denied by the foreign agent:
64 reason unspecified
65 administratively prohibited
66 insufficient resources
67 mobile node failed authentication
68 home agent failed authentication
69 requested Lifetime too long
70 poorly formed Request
71 poorly formed Reply
72 requested encapsulation unavailable
73 requested Van Jacobson compression unavailable
80 home network unreachable (ICMP error received)
81 home agent host unreachable (ICMP error received)
82 home agent port unreachable (ICMP error received)
88 home agent unreachable (other ICMP error received)
Registration denied by the home agent:
128 reason unspecified
129 administratively prohibited
130 insufficient resources
131 mobile node failed authentication
132 foreign agent failed authentication
133 registration Identification mismatch
134 poorly formed Request
135 too many simultaneous mobility bindings
136 unknown home agent address
Up-to-date values of the Code field are specified in the most recent "Assigned Numbers" [20] ๐.
3.5. Registration Extensions โจ
3.5.1. Computing Authentication Extension Values โจ
okay bestie, so every Authenticator value you compute for an authentication Extension MUST protect three things from the registration message ๐:
- the UDP payload (that's the Registration Request or Registration Reply data),
- all prior Extensions in their entirety, and
- the Type and Length of this Extension.
the default auth algorithm is keyed-MD5 [21] in "prefix+suffix" mode ๐. it makes a 128-bit "message digest" of the registration message. the default authenticator is a 128-bit value, and it's the MD5 checksum over this stream of bytes:
- the shared secret from the mobility security association between the nodes, plus the SPI value from the authentication Extension, then
- the protected fields from the registration message, in the order listed above, then
- the shared secret again.
ngl this part is so specific ๐ญ. the Authenticator field itself and the UDP header are NOT included in the default Authenticator computation. for support requirements on the message authentication codes used with the different auth Extensions, go check Section 5.1 ๐ธ.
the Security Parameter Index (SPI) in any authentication Extension picks the security context used to compute the Authenticator, and the receiver MUST use it to check that value ๐ฆ. it decides the algorithm and mode (Section 5.1) and the secret (a shared key, or a public/private key pair) that go into the Authenticator. for implementations to play nicely together, an implementation MUST be able to tie any SPI value to any authentication algorithm and mode it supports ๐ซถ. and all Mobile IP implementations MUST implement the default algorithm (keyed-MD5) and mode ("prefix+suffix") from above. non-negotiable, periodt ๐ .
3.5.2. Mobile-Home Authentication Extension ๐
this Extension MUST be present in every Registration Request and Registration Reply, exactly once ๐. its job is to stop the problems [2] caused by remote redirects spreading uncontrolled around the Internet. the spot where this Extension sits marks where the authenticated data ends.
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 | SPI ....
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
... SPI (cont.) | Authenticator ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type: 32Length: 4 plus the number of bytes in the AuthenticatorSPI: Security Parameter Index (4 bytes). it's an opaque identifier (see Section 1.6) ๐งAuthenticator: variable length (see Section 3.5.1)
3.5.3. Mobile-Foreign Authentication Extension ๐
this Extension MAY be included in Registration Requests and Replies when there's a mobility security association between the mobile node and the foreign agent ๐. for message authentication code support requirements, check Section 5.1.
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 | SPI ....
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
... SPI (cont.) | Authenticator ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type: 33Length: 4 plus the number of bytes in the AuthenticatorSPI: Security Parameter Index (4 bytes). it's an opaque identifier (see Section 1.6) ๐งAuthenticator: variable length (see Section 3.5.1)
3.5.4. Foreign-Home Authentication Extension ๐
same energy: this Extension MAY be included in Registration Requests and Replies when there's a mobility security association between the foreign agent and the home agent ๐ฆ. for support requirements, see Section 5.1.
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 | SPI ....
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
... SPI (cont.) | Authenticator ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type: 34Length: 4 plus the number of bytes in the AuthenticatorSPI: Security Parameter Index (4 bytes). it's an opaque identifier (see Section 1.6) ๐งAuthenticator: variable length (see Section 3.5.1)
3.6. Mobile Node Considerations ๐ธ
okay this is the mobile node's whole to-do list, bestie ๐ฑโจ. a mobile node MUST be configured with its home address, a netmask, and a mobility security association for each home agent ๐. it MAY also be configured with the IP address of one or more home agents. if it isn't, it MAY discover a home agent using the procedures in Section 3.6.1.2 ๐.
for each pending registration, the mobile node keeps track of:
- the link-layer address of the foreign agent the Registration Request was sent to, if that applies,
- the IP destination address of the Registration Request,
- the care-of address used in the registration,
- the Identification value sent in the registration,
- the originally requested Lifetime, and
- the remaining Lifetime of the pending registration.
a mobile node SHOULD start a registration whenever it notices its network connectivity has changed ๐. Section 2.4.2 covers ways a mobile node MAY figure that out. when it's away from home, the Registration Request lets its home agent create or change a mobility binding for it ๐ . when it's back home, the (de)Registration Request lets the home agent delete any old mobility binding(s) for it. and when it's at home, the mobile node operates without mobility functions at all, so it's just vibing ๐ง.
there are other times the mobile node SHOULD (re)register with its foreign agent. for example, when it detects the foreign agent rebooted (as specified in Section 2.4.4), or when the current registration's Lifetime is almost up โฐ.
without link-layer signs of a change in point of attachment, Agent Advertisements from new agents SHOULD NOT trigger a new registration if the current one hasn't expired AND the mobile node is still getting Agent Advertisements from the foreign agent it's registered with ๐ โโ๏ธ. and without those link-layer indications, a mobile node MUST NOT try to register more than once per second โฑ๏ธ.
a mobile node MAY register with a different agent when transport-layer protocols show excessive retransmissions ๐. a mobile node MUST NOT treat an ICMP Redirect from a foreign agent that's currently serving it as a reason to register with a new foreign agent. no thank you ๐ . within those limits, the mobile node MAY register again at any time ๐.
Appendix D has examples of how the registration message fields would be filled in for some typical registration scenarios ๐.
3.6.1. Sending Registration Requests ๐
the next sections spell out the values the mobile node MUST put in the fields of Registration Request messages ๐.
3.6.1.1. IP Fields ๐ง
this part gives the exact rules mobile nodes use to pick the IP header field values of a Registration Request ๐.
IP Source Address:
- when registering on a foreign network with a co-located care-of address, the IP source address MUST be the care-of address ๐๏ธ.
- in every other situation, the IP source address MUST be the mobile node's home address ๐ก.
IP Destination Address:
- when the mobile node found the agent it's registering with through something like link-layer discovery, which doesn't tell it the agent's IP address (so the IP address is unknown to the mobile node), the "All Mobility Agents" multicast address (224.0.0.11) MUST be used ๐ก. in this case the mobile node MUST use the agent's link-layer unicast address so the datagram actually reaches the right agent ๐ฏ.
- when registering with a foreign agent, the address MUST be the one learned from the IP source address of the matching Agent Advertisement ๐ซ. and when sending this Registration Request, the mobile node MUST use a link-layer destination address copied from the link-layer source address of the Agent Advertisement where it learned this foreign agent's IP address ๐.
- when the mobile node registers directly with its home agent and knows the home agent's (unicast) IP address, the destination address MUST be set to that address ๐.
- if the mobile node registers directly with its home agent but doesn't know the home agent's IP address, it may use dynamic home agent address resolution to find that address automatically (Section 3.6.1.2) ๐ต๏ธโโ๏ธ. in that case the IP destination address is set to the subnet-directed broadcast address of the mobile node's home network. this address MUST NOT be used as the destination IP address if the mobile node is registering via a foreign agent, though it MAY be used as the Home Agent address in the body of the Registration Request when registering via a foreign agent ๐.
IP Time to Live:
- the IP TTL field MUST be set to 1 if the IP destination address is the "All Mobility Agents" multicast address described above ๐ข. otherwise, a suitable value should be chosen in line with standard IP practice [19] ๐.
3.6.1.2. Registration Request Fields ๐
okay bestie, this part is all about how the mobile node picks values for the fixed portion of a Registration Request ๐ โจ it's the good stuff, promise.
A mobile node MAY set the 'S' bit to ask the home agent to keep its prior mobility binding(s) around. If it doesn't, the home agent deletes any previous binding(s) and swaps them out for the new binding in the Registration Request. Multiple simultaneous bindings are super useful when a mobile node with at least one wireless network interface wanders into range of more than one foreign agent ๐ฆ IP explicitly allows datagram duplication, so when the home agent allows simultaneous bindings, it tunnels a separate copy of each arriving datagram to each care-of address. The mobile node then gets multiple copies of everything addressed to it. (yes, it's giving duplicates ๐)
The mobile node SHOULD set the 'D' bit if it is registering with a co-located care-of address. Otherwise, the 'D' bit MUST NOT be set. ๐
A mobile node MAY set the 'B' bit to ask its home agent to forward a copy of the broadcast datagrams the home agent receives from the home network. How the home agent does this depends on the type of care-of address, which is determined by the 'D' bit in the mobile node's Registration Request:
- If the
'D'bit is set, the mobile node has said it will decapsulate any datagrams tunneled to this care-of address itself (it's using a co-located care-of address). So the home agent MUST tunnel the broadcast datagram to this care-of address. The mobile node de-tunnels it the same way it would any other datagram tunneled directly to it. ๐ง - If the
'D'bit is not set, the mobile node is using a foreign agent care-of address, which means the foreign agent will decapsulate arriving datagrams before forwarding them. So the home agent MUST first encapsulate the broadcast datagram in a unicast datagram addressed to the mobile node's home address, and then MUST tunnel that resulting datagram to the mobile node's care-of address.
When the foreign agent decapsulates it, the inner datagram is a unicast IP datagram addressed to the mobile node. That tells the foreign agent where the encapsulated broadcast datagram was meant to go, and it gets delivered to the mobile node like any other tunneled datagram. The foreign agent MUST NOT decapsulate the encapsulated broadcast datagram, and it MUST NOT use a local network broadcast to send it to the mobile node. So the mobile node MUST decapsulate the encapsulated broadcast datagram itself, and therefore MUST NOT set the 'B' bit in its Registration Request in this case, unless it is capable of decapsulating datagrams. ๐
A mobile node MAY request alternative forms of encapsulation by setting the 'M' bit and/or the 'G' bit. It can only do that if it's decapsulating its own datagrams (it's using a co-located care-of address), or if its foreign agent has said it supports those forms of encapsulation by setting the matching bits in the Mobility Agent Advertisement Extension of an Agent Advertisement the mobile node received. Otherwise, the mobile node MUST NOT set these bits. ๐ซ
The Lifetime field is chosen like this:
- If the mobile node is registering with a foreign agent, the
LifetimeSHOULD NOT exceed the value in theRegistration Lifetimefield of the Agent Advertisement message received from the foreign agent. When the method used to learn the care-of address doesn't include a Lifetime, the default ICMP Router Advertisement Lifetime (1800 seconds) MAY be used. โฐ - The mobile node MAY ask a home agent to delete a particular mobility binding. It does this by sending a Registration Request with the care-of address for that binding, with the
Lifetimefield set to zero (Section 3.8.2). - Similarly, a
Lifetimeof zero is used when the mobile node deregisters all of its care-of addresses, such as when it returns home ๐
The Home Agent field MUST be set to the address of the mobile node's home agent, if the mobile node knows that address. Otherwise, the mobile node MAY use dynamic home agent address resolution to learn its home agent's address. In that case, the mobile node MUST set the Home Agent field to the subnet-directed broadcast address of the mobile node's home network. Each home agent that receives such a Registration Request with a broadcast destination address MUST reject the mobile node's registration, and SHOULD return a rejection Registration Reply that gives its unicast IP address, for the mobile node to use in a future registration attempt. ๐ฎ
The Care-of Address field MUST be set to the value of the particular care-of address the mobile node wishes to (de)register. In the special case where a mobile node wishes to deregister all of its care-of addresses, it MUST set this field to its home address. ๐ธ
The mobile node picks the Identification field to match the style of replay protection it uses with its home agent. That's part of the mobility security association the mobile node shares with its home agent. See Section 5.6 for how the mobile node computes the Identification field. ๐
3.6.1.3. Extensions โจ
This section explains the order the mobile node has to follow when it tacks mandatory and optional Extensions onto a Registration Request. This following ordering MUST be followed:
a) The IP header, followed by the UDP header, followed by the fixed-length portion of the Registration Request, followed by
b) If present, any non-authentication Extensions expected to be used by the home agent (which may or may not also be used by the foreign agent), followed by
c) The Mobile-Home Authentication Extension, followed by
d) If present, any non-authentication Extensions used only by the foreign agent, followed by
e) The Mobile-Foreign Authentication Extension, if present.
Note that items (a) and (c) MUST appear in every Registration Request sent by the mobile node. Items (b), (d), and (e) are optional. Still, item (e) MUST be included when the mobile node and the foreign agent share a mobility security association. ๐ซถ
3.6.2. Receiving Registration Replies ๐ฌ
The mobile node will receive Registration Replies in response to its Registration Requests. Registration Replies generally fall into three categories:
- the registration was accepted,
- the registration was denied by the foreign agent, or
- the registration was denied by the home agent.
The rest of this section covers how a mobile node handles the Registration Reply in each of these three categories. ๐
3.6.2.1. Validity Checks ๐
Registration Replies with an invalid, non-zero UDP checksum MUST be silently discarded. ๐๏ธ
Also, the low-order 32 bits of the Identification field in the Registration Reply MUST be compared to the low-order 32 bits of the Identification field in the most recent Registration Request sent to the replying agent. If they don't match, the Reply MUST be silently discarded.
Also, the authentication in the Registration Reply MUST be checked. The mobile node MUST check for a valid authentication Extension, acting according to the Code field in the Reply. The rules are:
a) If the mobile node and the foreign agent share a mobility security association, exactly one Mobile-Foreign Authentication Extension MUST be present in the Registration Reply, and the mobile node MUST check the Authenticator value in the Extension. If no Mobile-Foreign Authentication Extension is found, or more than one is found, or the Authenticator is invalid, the mobile node MUST silently discard the Reply and SHOULD log the event as a security exception. ๐จ
b) If the Code field indicates that service is denied by the home agent, or if the Code field indicates that the registration was accepted by the home agent, exactly one Mobile-Home Authentication Extension MUST be present in the Registration Reply, and the mobile node MUST check the Authenticator value in the Extension. If no Mobile-Home Authentication Extension is found, or more than one is found, or the Authenticator is invalid, the mobile node MUST silently discard the Reply and SHOULD log the event as a security exception. ๐จ
If the Code field indicates an authentication failure, at either the foreign agent or the home agent, then any authenticators in the Registration Reply could also be wrong. That could happen, for example, if the shared secret between the mobile node and home agent was misconfigured. The mobile node SHOULD log such errors as security exceptions. ๐ญ
3.6.2.2. Registration Request Accepted ๐
If the Code field says the request was accepted, the mobile node SHOULD configure its routing table for its current point of attachment (Section 4.2.1). ๐บ๏ธ
If the mobile node is returning to its home network, and that network implements ARP, the mobile node MUST follow the procedures in Section 4.6 for ARP, proxy ARP, and gratuitous ARP.
If the mobile node has registered on a foreign network, it SHOULD re-register before its registration's Lifetime expires. As described in Section 3.6, for each pending Registration Request, the mobile node MUST maintain the remaining lifetime of that pending registration, as well as the original Lifetime from the Registration Request. When the mobile node receives a valid Registration Reply, it MUST decrease its view of the remaining lifetime of the registration by the amount the home agent decreased the originally requested Lifetime. This works the same as the mobile node starting a timer for the granted Lifetime at the moment it sent the Registration Request, even though the granted Lifetime isn't known until the Registration Reply arrives. Because the Registration Request is definitely sent before the home agent starts timing the registration Lifetime (also based on the granted Lifetime), this approach makes sure the mobile node re-registers before the home agent expires and deletes the registration. That holds even with possibly non-negligible transmission delays for the original Registration Request and Reply that started the Lifetime timers at the mobile node and its home agent. โณ๐
3.6.2.3. Registration Request Denied โ๐ซ
okay so if the Code field says service is getting denied, the mobile node SHOULD log the error ๐. in certain cases the mobile node might be able to "repair" it ๐งโจ bestie, here are the ones that can be fixed:
- Code 69: (Denied by foreign agent, Lifetime too long) ๐
okay this one is giving "too greedy" energy ๐ the Lifetime field in the Registration Reply holds the maximum Lifetime that foreign agent is willing to accept in any Registration Request. the mobile node MAY try to register with this same agent again ๐, using a Lifetime in the Request that MUST be less than or equal to the value in the Reply. no cap, that's the whole fix ๐
- Code 133: (Denied by home agent, Identification mismatch) ๐
this one is about being out of sync โฐ the Identification field in the Reply has a value that lets the mobile node resync with the home agent, based on the style of replay protection in effect (Section 5.6). so the mobile node MUST adjust the parameters it uses to compute the Identification field, using the info in the Reply, before sending any future Registration Requests. โจ main character glow-up moment
- Code 136: (Denied by home agent, Unknown home agent address) ๐ง
this code comes back from a home agent when the mobile node is doing dynamic home agent address resolution, as described in Sections 3.6.1.1 and 3.6.1.2 ๐ธ the Home Agent field in the Reply holds the unicast IP address of the home agent that sent it. the mobile node MAY then try to register with that home agent in future Registration Requests ๐ฆ. and ngl, the mobile node SHOULD also adjust its Identification parameters, based on the matching field in the Reply, before any future Registration Requests ๐ซถ
3.6.3. Registration Retransmission ๐๐
so when no Registration Reply shows up within a reasonable time, another Registration Request MAY be sent ๐ฌ if timestamps are in use, a brand new registration Identification gets picked for each retransmission, so it counts as a new registration ๐. when nonces are used instead, the unanswered Request gets resent exactly unchanged, so the retransmission does NOT count as a new registration (Section 5.6) ๐ โโ๏ธ that's the lowkey genius part, because the home agent won't have to resync with the mobile node by issuing another nonce just because the original Request got lost on the network instead of its Reply ๐ญโจ
the maximum time until a new Registration Request is sent SHOULD be no greater than the requested Lifetime of the Registration Request โณ. the minimum value SHOULD be large enough to cover the size of the messages, twice the round trip time to the home agent, and at least an extra 100 milliseconds for processing before responding ๐งฎ. the round trip time to the home agent will be at least as long as it takes to transmit the messages at the link speed of the mobile node's current point of attachment ๐ข. some circuits add another 200 milliseconds of satellite delay to that round trip ๐ฐ๏ธ. the minimum time between Registration Requests MUST NOT be less than 1 second ๐ซ. and each successive retransmission timeout period SHOULD be at least twice the previous one, as long as that's still less than the maximum above ๐ exponential glow-up energy ๐ฅ
3.7. Foreign Agent Considerations ๐ก๐
the foreign agent is mostly the chill, behind-the-scenes friend in Mobile IP registration ๐ซ it relays Registration Requests between mobile nodes and home agents, and when it provides the care-of address, it decapsulates datagrams so they can be delivered to the mobile node ๐ฆโจ. it SHOULD also send periodic Agent Advertisement messages to announce its presence, as described in Section 2.3, if link-layer means can't detect it ๐ฃ
okay now the boundaries ๐ง a foreign agent MUST NOT transmit a Registration Request except when relaying one received from a mobile node, to that mobile node's home agent ๐ โโ๏ธ. a foreign agent MUST NOT transmit a Registration Reply except when relaying a Registration Reply received from a mobile node's home agent, OR when replying to a Registration Request from a mobile node where the foreign agent is denying service to that mobile node ๐. in particular, a foreign agent MUST NOT generate a Registration Request or Reply just because a mobile node's registration Lifetime has expired โฐ๐ซ. a foreign agent also MUST NOT originate a Registration Request asking for deregistration of a mobile node ๐ค. however, it MUST relay valid (de)Registration Requests originated by a mobile node ๐ซถ the vibe is "I'm the messenger, not the author" ๐
3.7.1. Configuration and Registration Tables ๐๐
each foreign agent MUST be configured with a care-of address ๐ . and for each pending or current registration, the foreign agent MUST maintain a visitor list entry with the following info, taken from the mobile node's Registration Request ๐๏ธ:
- the link-layer source address of the mobile node
- the IP Source Address (the mobile node's Home Address)
- the IP Destination Address (as specified in 3.6.2.3)
- the UDP Source Port
- the Home Agent address
- the Identification field
- the requested registration Lifetime, and
- the remaining Lifetime of the pending or current registration.
as with any node on the Internet, a foreign agent MAY also share mobility security associations with other nodes ๐ค. when it relays a Registration Request from a mobile node to that node's home agent, and it shares a mobility security association with the home agent, it MUST add a Foreign-Home Authentication Extension to the Request ๐. it MUST also check the required Foreign-Home Authentication Extension in the Registration Reply from the home agent (Sections 3.3 and 3.4) ๐ง. similarly, when it receives a Registration Request from a mobile node and shares a mobility security association with that mobile node, it MUST check the required Mobile-Foreign Authentication Extension in the Request, and it MUST add a Mobile-Foreign Authentication Extension to the Registration Reply to the mobile node ๐ security squad assemble ๐ก๏ธโจ
3.7.2. Receiving Registration Requests ๐จ
if the foreign agent accepts a Registration Request from a mobile node, it MUST then relay the Request to the indicated home agent ๐. otherwise, if the foreign agent denies the Request, it MUST send a Registration Reply to the mobile node with an appropriate denial Code ๐ โโ๏ธ. the one exception: when the foreign agent would have to send out more than one such denial per second to the same mobile node ๐. the following sections go deeper on this behavior ๐
if a foreign agent gets a Registration Request from a mobile node that's already in its visitor list, the existing visitor list entry SHOULD NOT be deleted or modified until the foreign agent receives a valid Registration Reply from the home agent with a success Code ๐งธ. the foreign agent MUST record the new pending Request separately from the existing visitor list entry ๐. if the Request asks for deregistration, the existing entry SHOULD NOT be deleted until a successful Registration Reply comes in ๐ฅบ. and if the Reply says the home agent denied the Request (for registration or deregistration), the existing visitor list entry MUST NOT be modified because of that Reply ๐ protect the entry at all costs ๐
3.7.2.1. Validity Checks โ
Registration Requests with an invalid, non-zero UDP checksum MUST be silently discarded ๐คซ
also, the authentication in the Registration Request MUST be checked ๐. if the foreign agent and the mobile node share a mobility security association, exactly one Mobile-Foreign Authentication Extension MUST be present in the Request, and the foreign agent MUST check the Authenticator value in that Extension ๐. if there's no Mobile-Foreign Authentication Extension, or more than one, or the Authenticator is invalid, the foreign agent MUST silently discard the Request and SHOULD log the event as a security exception ๐จ. the foreign agent also SHOULD send a Registration Reply to the mobile node with Code 67 ๐
3.7.2.2. Forwarding a Valid Request to the Home Agent ๐๐จ
if the foreign agent accepts the mobile node's Registration Request, it MUST relay the Request to the mobile node's home agent, as specified in the Home Agent field of the Request ๐ฎ. the foreign agent MUST NOT modify any of the fields from the fixed portion of the Registration Request up through and including the Mobile-Home Authentication Extension ๐ โโ๏ธ bestie, if you touch those, an authentication failure is very likely at the home agent ๐ญ. on top of that, the foreign agent does the following:
- It MUST process and remove any Extensions following the Mobile-Home Authentication Extension,
- It MAY append any of its own non-authentication Extensions of relevance to the home agent, if applicable, and
- It MUST append the Foreign-Home Authentication Extension, if the foreign agent shares a mobility security association with the home agent.
the IP header and UDP header of the relayed Registration Request MUST be set as follows ๐งพ:
IP Source Address
The foreign agent's address on the interface from which
the message will be sent.
IP Destination Address
Copied from the Home Agent field within the Registration
Request.
UDP Source Port
<variable>
UDP Destination Port
434
after forwarding a valid Registration Request to the home agent, the foreign agent MUST begin timing the remaining lifetime of the pending registration, based on the Lifetime in the Request โฑ๏ธ. if that lifetime runs out before a valid Registration Reply arrives, the foreign agent MUST delete its visitor list entry for this pending registration ๐๏ธ๐
3.7.2.3. Denying Invalid Requests โจ
Okay so if the foreign agent says no to the mobile node's Registration Request for literally any reason, it SHOULD send the mobile node a Registration Reply with a suitable denial Code ๐
. In that case, the Home Address, Home Agent, and Identification fields in the Reply get copied from the matching fields in the Request. It's giving consistency ๐
If the Reserved field is nonzero, the foreign agent MUST deny the Request and SHOULD return a Registration Reply with status code 70 to the mobile node ๐ If the Request is getting denied because the requested Lifetime is too long, the foreign agent sets the Lifetime in the Reply to the maximum Lifetime value it's willing to accept in any Registration Request, and sets the Code field to 69. Otherwise, the Lifetime SHOULD be copied from the Lifetime field in the Request.
Specific fields within the IP header and the UDP header of the Registration Reply MUST be set as follows:
IP Source Address
Copied from the IP Destination Address of Registration
Request, unless the "All Agents Multicast" address was
used. In this case, the foreign agent's address (on the
interface from which the message will be sent) MUST be
used.
IP Destination Address
Copied from the IP Source Address of the Registration
Request.
UDP Source Port
434
UDP Destination Port
Copied from the UDP Source Port of the Registration
Request.
3.7.3. Receiving Registration Replies ๐ฆ
Okay this is where the foreign agent updates its visitor list. ๐ It does that whenever it gets a valid Registration Reply from a home agent, and then it relays the Reply on to the mobile node. The following sections go deeper into how this works.
If the foreign agent forwards a Registration Request to a home agent and gets an ICMP error message back instead of a Registration Reply, then it SHOULD send the mobile node a Registration Reply with an appropriate "Home Agent Unreachable" failure Code (within the range 80-95, inclusive) ๐ญ See Section 3.7.2.3 for details on building the Registration Reply.
3.7.3.1. Validity Checks ๐
Registration Replies with an invalid, non-zero UDP checksum MUST be silently discarded. Bye bye ๐
When a foreign agent gets a Registration Reply message, it MUST search its visitor list for a pending Registration Request with the same mobile node home address as shown in the Reply. If there's no pending Request, the foreign agent MUST silently discard the Reply. It also MUST silently discard the Reply if the low-order 32 bits of the Identification field in the Reply don't match the ones in the Request. Main character energy for the Request, but the Reply has to match it ๐
Also, the authentication in the Registration Reply MUST be checked ๐ If the foreign agent and the home agent share a mobility security association, exactly one Foreign-Home Authentication Extension MUST be present in the Registration Reply, and the foreign agent MUST check the Authenticator value in that Extension. If there's no Foreign-Home Authentication Extension, or if there's more than one, or if the Authenticator is invalid, the foreign agent MUST silently discard the Reply and SHOULD log the event as a security exception ๐จ The foreign agent also MUST reject the mobile node's registration and SHOULD send a Registration Reply to the mobile node with Code 68. Iconic security moment ๐ซถ
3.7.3.2. Forwarding Replies to the Mobile Node ๐
A Registration Reply that passes the validity checks in Section 3.8.2.1 gets relayed to the mobile node โจ The foreign agent MUST also update its visitor list entry for the mobile node so it reflects what happened in the Registration Request, as shown by the Code field in the Reply. If the Code says the mobile node accepted the registration and the Lifetime field is nonzero, the foreign agent MUST set the Lifetime in the visitor list entry to the value in the Lifetime field of the Registration Reply. If instead the Code says the Lifetime field is zero, the foreign agent MUST delete its visitor list entry for the mobile node. Finally, if the Code says the home agent denied the registration, the foreign agent MUST delete its pending registration list entry for the mobile node, but NOT its visitor list entry ๐
โโ๏ธ Wait, let me say that properly: the foreign agent MUST delete its pending registration list entry, but not its visitor list entry, for the mobile node.
The foreign agent MUST NOT modify any of the fields beginning with the fixed portion of the Registration Reply up through and including the Mobile-Home Authentication Extension. Otherwise, an authentication failure is very likely to happen at the mobile node ๐ญ Also, the foreign agent SHOULD do the following extra stuff:
- It MUST process and remove any Extensions following the Mobile-Home Authentication Extension,
- It MAY append its own non-authentication Extensions of relevance to the mobile node, if applicable, and
- It MUST append the Mobile-Foreign Authentication Extension, if the foreign agent shares a mobility security association with the mobile node.
Specific fields within the IP header and the UDP header of the relayed Registration Reply get set using the same rules as Section 3.7.2.3 ๐ง
After forwarding a valid Registration Reply to the mobile node, the foreign agent MUST update its visitor list entry for this registration like so โฐ If the Reply says the home agent accepted the registration, the foreign agent resets its timer for the registration lifetime to the Lifetime granted in the Reply. Unlike the mobile node's timing from Section 3.6.2.2, the foreign agent starts counting this lifetime when it forwards the Registration Reply, so the foreign agent never expires the registration before the mobile node does. Smart, right? ๐ง On the flip side, if the Reply says the home agent rejected the registration, the foreign agent deletes its visitor list entry for this attempted registration.
3.8. Home Agent Considerations ๐
Home agents play a reactive role in the registration process ๐ธ A home agent gets Registration Requests from the mobile node (sometimes relayed by a foreign agent), updates its record of the mobility bindings for this mobile node, and sends a suitable Registration Reply back for each one.
A home agent MUST NOT transmit a Registration Reply except when replying to a Registration Request received from a mobile node. Like, ever. In particular, the home agent MUST NOT generate a Registration Reply just to say the Lifetime has expired ๐ โโ๏ธ
3.8.1. Configuration and Registration Tables ๐
Each home agent MUST be configured with an IP address and with the prefix size for the home network. The home agent MUST also be configured with the home address and mobility security association of each authorized mobile node it's serving as a home agent for ๐ When the home agent accepts a valid Registration Request from a mobile node that it serves as a home agent for, the home agent MUST create or modify the entry for this mobile node in its mobility binding list, containing:
- the mobile node's care-of address
- the Identification field from the Registration Reply
- the remaining Lifetime of the registration
The home agent MAY also keep mobility security associations with various foreign agents. When it gets a Registration Request from a foreign agent, and the home agent shares a mobility security association with that foreign agent, the home agent MUST check the Authenticator in the required Foreign-Home Authentication Extension in the message, based on this mobility security association. Similarly, when sending a Registration Reply to a foreign agent, if the home agent shares a mobility security association with that foreign agent, the home agent MUST include a Foreign-Home Authentication Extension in the message, based on this mobility security association ๐
3.8.2. Receiving Registration Requests ๐จ
If the home agent accepts an incoming Registration Request, it MUST update its record of the the mobile node's mobility binding(s) and SHOULD send a Registration Reply with a suitable Code. Otherwise (if the home agent denies the Request), it SHOULD send a Registration Reply with an appropriate Code that specifies the reason the Request was denied. The following sections go deeper into this behavior ๐
3.8.2.1. Validity Checks โจ
okay bestie, first things first ๐ a Registration Request with an invalid, non-zero UDP checksum MUST be silently discarded by the home agent. no drama, just gone ๐ซฅ
the authentication in the Registration Request MUST be checked too ๐ that's got three parts:
- a) the home agent MUST check for a valid Mobile-Home Authentication Extension and do the authentication it asks for. exactly one Mobile-Home Authentication Extension MUST be in the Registration Request, and the home agent MUST check the Authenticator value in it. if there's no Mobile-Home Authentication Extension, or more than one, or the Authenticator is invalid, the home agent MUST reject the mobile node's registration and SHOULD send a Registration Reply to the mobile node with Code 131 ๐ซ then it MUST discard the Request and SHOULD log the error as a security exception ๐จ
- b) the home agent MUST check that the registration Identification field is correct, using the context picked by the SPI in the Mobile-Home Authentication Extension. see Section 5.6 for how that works ๐ง if it's wrong, the home agent MUST reject the Request and SHOULD send a Registration Reply to the mobile node with Code 133, and that Identification field has to be computed following the rules in Section 5.6 ๐ the home agent MUST do no further processing on that Request, though it SHOULD log the error as a security exception
- c) if the home agent shares a mobility security association with the foreign agent, the home agent MUST check for a valid Foreign-Home Authentication Extension ๐ค in that case exactly one Foreign-Home Authentication Extension MUST be in the Registration Request, and the home agent MUST check the Authenticator value in it. if there's none, or more than one, or the Authenticator is invalid, the home agent MUST reject the mobile node's registration and SHOULD send a Registration Reply to the mobile node with Code 132 ๐ then it MUST discard the Request and SHOULD log the error as a security exception
on top of checking the authentication, home agents MUST deny Registration Requests sent to the subnet-directed broadcast address of the home network (instead of being unicast to the home agent) ๐ โโ๏ธ the home agent MUST discard that Request and SHOULD return a Registration Reply with Code 136. in this case the Registration Reply carries the home agent's unicast address, so the mobile node can send the Registration Request again with the right home agent address ๐ฆ
3.8.2.2. Accepting a Valid Request โจ
if the Registration Request passes the validity checks in Section 3.8.2.1, and the home agent can handle it, the home agent MUST update its mobility binding list for the requesting mobile node and MUST return a Registration Reply to the mobile node ๐ the Reply Code will be 0 if the home agent supports simultaneous mobility bindings, or 1 if it doesn't. see Section 3.8.3 for how to build the Registration Reply message ๐ง
the home agent updates its record of the mobile node's mobility bindings based on the fields in the Registration Request, like this:
- if the Lifetime is zero and the Care-of Address equals the mobile node's home address, the home agent deletes all the entries in the mobility binding list for that mobile node. this is how a mobile node tells its home agent to stop providing mobility services ๐
- if the Lifetime is zero and the Care-of Address does not equal the mobile node's home address, the home agent deletes only the entry with that specific Care-of Address from the mobility binding list. any other active entries with other care-of addresses stay active ๐ธ
- if the Lifetime is nonzero, the home agent adds an entry with the requested Care-of Address to the mobility binding list for the mobile node. if the 'S' bit is set and the home agent supports simultaneous mobility bindings, the previous mobility binding entries are kept ๐ซถ otherwise the home agent removes all previous entries in the mobility binding list for the mobile node
in every case, the home agent MUST send a Registration Reply to the source of the Registration Request ๐ฌ which might be a different foreign agent from the one whose care-of address is being (de)registered. if the home agent shares a mobility security association with the foreign agent whose care-of address is being deregistered, and that foreign agent is different from the one that relayed the Request, the home agent MAY also send a Registration Reply to that foreign agent. the home agent MUST NOT send such a Reply if it doesn't share a mobility security association with that foreign agent. if no Reply is sent, the foreign agent's visitor list will expire naturally when the original Lifetime runs out โณ
the home agent MUST NOT increase the Lifetime above what the mobile node asked for in the Registration Request ๐ โโ๏ธ but it's not an error for the mobile node to ask for a longer Lifetime than the home agent is willing to give. in that case the home agent just lowers the Lifetime to an allowed value and returns that value in the Registration Reply โ๏ธ the Lifetime in the Registration Reply tells the mobile node how long the registration was granted for, which is when it SHOULD re-register to keep service going ๐ after that registration lifetime expires, the home agent MUST delete its entry for this registration in its mobility binding list ๐๏ธ
if the Registration Request duplicates an accepted current Registration Request, the new Lifetime MUST NOT extend past the Lifetime originally granted โ a Registration Request counts as a duplicate when its home address, care-of address, and Identification fields all match those of an accepted current registration ๐ฏ
also, if the home network implements ARP [16], and the Registration Request asks the home agent to make a mobility binding for a mobile node that had no binding before (so it was assumed to be at home), the home agent MUST follow the procedures in Section 4.6 about ARP, proxy ARP, and gratuitous ARP ๐งญ if the mobile node already had a previous mobility binding, the home agent MUST keep following the proxy ARP rules in Section 4.6 ๐
3.8.2.3. Denying an Invalid Request โจ
if the Registration Reply doesn't pass all the validity checks in Section 3.8.2.1, or the home agent can't handle the Request, the home agent SHOULD return a Registration Reply to the mobile node with a Code showing why it went wrong ๐ if a foreign agent helped relay the Request, this lets that foreign agent delete its pending visitor list entry ๐งน it also tells the mobile node what went wrong, so it can fix things and send another Request ๐ช
this section lists a bunch of reasons the home agent might reject a Request, and the Code value it should use for each one ๐ see Section 3.8.3 for more on building the Registration Reply message.
lots of rejections are administrative, tbh ๐ข for example, a home agent can cap how many simultaneous registrations a mobile node gets. it rejects any registration that would go over the cap and sends back a Registration Reply with error code 135 ๐ง a home agent can also refuse service to mobile nodes that wandered into unauthorized service areas by sending a Registration Reply with a Code of 129 ๐ท
if the Reserved field is nonzero, the home agent MUST deny the Request with a Code of 134 ๐
3.8.3. Sending Registration Replies โจ
if the home agent accepts a Registration Request, it MUST then update its record of the mobile node's mobility binding(s) and SHOULD send a Registration Reply with a suitable Code ๐จ otherwise (if the home agent denied the Request), it SHOULD send a Registration Reply with an appropriate Code saying why the Request was denied ๐ the next sections give more detail on the values the home agent MUST fill in the fields of Registration Reply messages ๐
3.8.3.1. IP/UDP Fields โจ
this section has the exact rules for picking the IP and UDP header field values of a Registration Reply ๐ง
IP Source Address: copied from the IP Destination Address of the Registration Request, unless a multicast or broadcast address was used. if the IP Destination Address of the Registration Request was a broadcast or multicast address, the IP Source Address of the Registration Reply MUST be set to the home agent's (unicast) IP address ๐IP Destination Address: copied from the IP Source Address of the Registration Request ๐UDP Source Port: copied from the UDP Destination Port of the Registration Request ๐UDP Destination Port: copied from the UDP Source Port of the Registration Request ๐
when the home agent sends a Registration Reply to a Registration Request that asked for deregistration (the Lifetime is zero and the Care-of Address equals the mobile node's home address), and the IP Source Address was also set to the mobile node's home address (the normal way a mobile node deregisters when it gets back home), the IP Destination Address in the Registration Reply will be the mobile node's home address, copied from the IP Source Address of the Request ๐
in this case, when the Registration Reply is sent, the home agent MUST transmit it directly onto the home network as if the mobile node were at home, skipping any mobility binding list entry that might still exist at the home agent for that destination mobile node ๐ here's the tricky part: for a mobile node coming home after being registered with a care-of address, if its new Registration Request isn't accepted, the mobility binding list entry will still say datagrams for the mobile node should be tunneled to its registered care-of address. when the home agent sends the Reply rejecting this Request, that existing binding list entry MUST be ignored, and the home agent MUST transmit this Reply as if the mobile node were at home ๐ซ โจ
3.8.3.2. Registration Reply Fields ๐
okay so this bit is the cheat sheet for how a home agent fills in the fixed part of a Registration Reply ๐ the Code field follows all the rules from the earlier sections, no cap. When a home agent replies to an accepted registration, it SHOULD respond with Code 1 if it doesn't support simultaneous registrations โจ
The Lifetime field MUST be copied from the Registration Request ๐ unless the requested time is longer than the max the home agent is willing to give for that service. If it is, the Lifetime MUST be set to however long the service will actually be provided ๐ฅบ and that shortened Lifetime SHOULD be the maximum Lifetime the home agent allows (for this mobile node and care-of address) ๐
The Home Address field MUST be copied from the Registration Request. Bestie, that one's a freebie ๐
Now the Home Agent field is where it gets spicy ๐ถ๏ธ If the Home Agent field in the Registration Request already has a unicast address of this home agent, that field MUST be copied into the Home Agent field of the Registration Reply. Otherwise, the home agent MUST put its own unicast address in there. And in that second case, the home agent MUST reject the registration with a suitable code (e.g., Code 136) ๐ญ so the mobile node can't possibly end up registered with two or more home agents at the same time. Iconic protection, honestly ๐
3.8.3.3. Extensions ๐ง
This part is all about the order a home agent sticks Mobile IP Extensions onto a Registration Reply. Some are required, some are optional, and the order MUST be followed ๐
a) The IP header, followed by the UDP header, followed by the
fixed-length portion of the Registration Reply,
b) If present, any non-authentication Extensions used by the
mobile node (which may or may not also be used by the foreign
agent),
c) The Mobile-Home Authentication Extension,
d) If present, any non-authentication Extensions used only by
the foreign agent, and
e) The Foreign-Home Authentication Extension, if present.
Quick recap so nobody gets lost ๐ซถ items (a) and (c) MUST appear in every Registration Reply the home agent sends. Items (b), (d), and (e) are optional. BUT item (e) MUST be included when the home agent and the foreign agent share a mobility security association ๐ no skipping that one, periodt ๐ฅ
4. Routing Considerations ๐บ๏ธ
Okay, this section is about how mobile nodes, home agents, and (maybe) foreign agents team up to route datagrams to and from a mobile node that's hanging out on a foreign network ๐ The mobile node tells its home agent where it currently is using the registration procedure from Section 3. If you want to know where the mobile node's home address sits compared to its home agent, and where the mobile node itself sits compared to any foreign agent it tries to register with, check the protocol overview in Section 1.7 โจ
4.1. Encapsulation Types ๐ฆ
Home agents and foreign agents MUST support tunneling datagrams using IP in IP encapsulation [14] ๐ซง Any mobile node that uses a co-located care-of address MUST support receiving datagrams tunneled with IP in IP encapsulation too. Minimal encapsulation [15] and GRE encapsulation [8] are alternate methods that mobility agents and mobile nodes MAY optionally support ๐ When the mobile node asks for one of those alternatives, it's up to the home agent whether to go with it ๐
4.2. Unicast Datagram Routing ๐
4.2.1. Mobile Node Considerations ๐ก
When a mobile node is connected to its home network, it doesn't need any mobility services at all. It acts like any other fixed host or router, no drama ๐ How a mobile node picks a default router when it's home, or away and using a co-located care-of address, is out of scope for this document. ICMP Router Advertisement [4] is one of the ways to do it ๐
When the mobile node is registered on a foreign network, it picks a default router using these rules:
- If the mobile node is registered using a foreign agent care-of address, then the mobile node MUST choose its default router from among the Router Addresses advertised in the ICMP Router Advertisement portion of that Agent Advertisement message. ๐ง
- The mobile node MAY also consider the IP source address of the Agent Advertisement as another possible choice for the IP address of a default router, along with the (possibly empty) list of Router Addresses from the ICMP Router Advertisement portion of the message. Sus, but allowed ๐
- In such cases, the IP source address MUST be considered to be the worst choice (lowest preference) for a default router. Basically last place, bestie ๐
- If the mobile node is registered directly with its home agent using a co-located care-of address, then the mobile node SHOULD choose its default router from among those advertised in any ICMP Router Advertisement message it receives, for which its externally obtained care-of address and the Router Address match under the network prefix. ๐ธ
- If the mobile node's externally obtained care-of address matches the IP source address of the Agent Advertisement under the network prefix, the mobile node MAY also consider that IP source address as another possible choice for the IP address of a default router, along with the (possibly empty) list of Router Addresses from the ICMP Router Advertisement portion of the message. โจ
- If so, the IP source address MUST be considered to be the worst choice (lowest preference) for a default router. Same tea as before, sorry not sorry ๐ซ
- The network prefix MAY be obtained from the Prefix-Lengths Extension in the Router Advertisement, if present. ๐
- The prefix MAY also be obtained through other mechanisms beyond the scope of this document. ๐ฆ
Beyond all of that, the actual selection of the default router is made by the selection method specified for ICMP Router Discovery [4], choosing among the Router Addresses specified above ๐ฏ And in any case, a mobile node registered via a foreign agent MAY choose its foreign agent as a default router ๐ซถ
Now, note this one, it's important ๐จ Van Jacobson header compression [10] will not function properly unless all TCP IP datagrams to and from the mobile node pass, respectively, through the same first and last-hop router. So if the mobile node is doing Van Jacobson header compression with its foreign agent, it MUST select its foreign agent as its default router. No exceptions, iykyk ๐
4.2.2. Foreign Agent Considerations ๐จ
When an encapsulated datagram shows up at the care-of address the foreign agent advertised, the foreign agent MUST compare the inner destination address against the entries in its visitor list ๐ If the destination doesn't match any mobile node currently on the visitor list, the foreign agent MUST NOT forward the datagram without modifications to the original IP header, because otherwise a routing loop is likely to result ๐ The datagram SHOULD be silently discarded. ICMP Destination Unreachable MUST NOT be sent when a foreign agent can't forward an incoming tunneled datagram, so no drama, just vibes ๐คซ Otherwise, the foreign agent forwards the decapsulated datagram to the mobile node ๐
The foreign agent MUST NOT advertise the presence of a mobile router (Section 4.5) to other routers in its routing domain, or to any other mobile node. That's need-to-know only ๐ค
The foreign agent MUST route datagrams it receives from registered mobile nodes. At a minimum, that means the foreign agent MUST verify the IP Header Checksum, decrement the IP Time To Live, recompute the IP Header Checksum, and forward those datagrams to a default router ๐งฎ On top of that, the foreign agent SHOULD send an appropriate ICMP Redirect message to the mobile node ๐ the way the routing stuff all clicks together here is honestly giving genius ๐ซถ
4.2.3. Home Agent Considerations
okay bestie, the home agent has a big job ๐ โจ the home agent MUST be able to intercept any datagrams on the home network that are addressed to the mobile node while the mobile node is registered away from home. Proxy and gratuitous ARP MAY be used to make that interception happen, as specified in Section 4.6 ๐
so the home agent must examine the IP Destination Address of every arriving datagram to see if it matches the home address of any of its mobile nodes registered away from home ๐ if it does, the home agent tunnels the datagram to the mobile node's currently registered care-of address or addresses. if the home agent supports the optional capability of multiple simultaneous mobility bindings, it tunnels a copy to each care-of address in the mobile node's mobility binding list ๐ฆ if the mobile node has no current mobility bindings, the home agent MUST NOT attempt to intercept datagrams destined for the mobile node, which means it won't in general receive those datagrams ๐
ngl the twist is this: if the home agent is also a router handling common IP traffic, it's possible it will still receive those datagrams and forward them onto the home network. in that case, the home agent MUST assume the mobile node is at home and simply forward the datagram directly onto the home network ๐ก๐
see Section 4.1 for the encapsulation methods that can be used for tunneling ๐ nodes implementing tunneling SHOULD also implement the "tunnel soft state" mechanism [14], which lets ICMP error messages coming back from the tunnel get correctly reflected to the original senders of the tunneled datagrams ๐ซถ
home agents SHOULD be able to decapsulate and further deliver packets addressed to themselves that were sent by a mobile node to keep its location private, as described in Section 5.5 ๐ง
okay now the lifetime stuff ๐ญ if the Lifetime for a given mobility binding expires before the home agent gets another valid Registration Request for that mobile node, that binding gets deleted from the mobility binding list. the home agent MUST NOT send any Registration Reply message just because the mobile node's binding expired ๐ซ the entry in the visitor list of the mobile node's current foreign agent will expire naturally, probably around the same time the binding expires at the home agent ๐ธ when a mobility binding's lifetime expires, the home agent MUST delete that binding, but it MUST retain any other (non-expired) simultaneous mobility bindings it holds for the mobile node ๐
when a home agent gets a datagram intercepted for one of its mobile nodes registered away from home, it MUST examine the datagram to check if it's already encapsulated. if it is, special rules apply to forwarding it to the mobile node ๐
- if the inner (encapsulated) Destination Address is the same as the outer Destination Address (the mobile node), then the home agent MUST also examine the outer Source Address of the encapsulated datagram (the source address of the tunnel) ๐ if this outer Source Address is the same as the mobile node's current care-of address, the home agent MUST silently discard that datagram to prevent a likely routing loop ๐ if, instead, the outer Source Address is not the same as the mobile node's current care-of address, then the home agent SHOULD forward the datagram to the mobile node โจ to do that, the home agent MAY simply alter the outer Destination Address to the care-of address, rather than re-encapsulating the datagram ๐
- otherwise (the inner Destination Address is not the same as the outer Destination Address), the home agent SHOULD encapsulate the datagram again (recursive encapsulation), with the new outer Destination Address set equal to the mobile node's care-of address ๐ฅ basically the home agent forwards the entire datagram to the mobile node the same way it would any other datagram, whether it's already encapsulated or not ๐ฆ
4.3. Broadcast Datagrams
when a home agent gets a broadcast datagram, it MUST NOT forward it to any mobile nodes in its mobility binding list except the ones that asked for forwarding of broadcast datagrams ๐ โโ๏ธ a mobile node MAY request that by setting the 'B' bit in its Registration Request message (Section 3.3) ๐ฃ for each registered mobile node like that, the home agent SHOULD forward received broadcast datagrams to it, although which specific categories of broadcast datagrams get forwarded is a matter of configuration at the home agent ๐
if the 'D' bit was set in the mobile node's Registration Request message (meaning it's using a co-located care-of address), the home agent simply tunnels the appropriate broadcast IP datagrams to the mobile node's care-of address ๐ otherwise (the 'D' bit was not set), the home agent first encapsulates the broadcast datagram in a unicast datagram addressed to the mobile node's home address, and then tunnels that encapsulated datagram to the foreign agent ๐ซ this extra layer is needed so the foreign agent can figure out which mobile node should get the datagram after it's decapsulated ๐ง when the foreign agent gets it, the unicast encapsulated datagram is detunneled and delivered to the mobile node like any other datagram ๐ท either way, the mobile node must decapsulate the datagram it receives to recover the original broadcast datagram ๐
4.4. Multicast Datagram Routing
as I mentioned before, a mobile node that's connected to its home network acts just like any other (fixed) host or router ๐ก so when it's at home, a mobile node works exactly like other multicast senders and receivers โจ this section is about the mobile node visiting a foreign network, so that's our focus ๐ง
In order receive multicasts, a mobile node MUST join the multicast group in one of two ways ๐ก first, a mobile node MAY join the group via a (local) multicast router on the visited subnet ๐ this option assumes there's a multicast router on the visited subnet ๐ if the mobile node is using a co-located care-of address, it SHOULD use that address as the source IP address of its IGMP [5] messages ๐ otherwise, it MUST use its home address ๐
or, alternatively, a mobile node that wants to receive multicasts MAY join groups via a bi-directional tunnel to its home agent, as long as the home agent is a multicast router ๐ฆ the mobile node tunnels IGMP messages to its home agent, and the home agent forwards multicast datagrams down the tunnel to the mobile node ๐ซถ the rules for delivering multicast datagrams to mobile nodes in this case are identical to the broadcast ones (Section 4.3) ๐ so if the mobile node is using a co-located care-of address (the 'D' bit was set in its Registration Request), the home agent SHOULD tunnel the datagram to that care-of address ๐ธ otherwise, the home agent MUST first encapsulate the datagram in a unicast datagram addressed to the mobile node's home address, and then MUST tunnel the resulting datagram (recursive tunneling) to the mobile node's care-of address ๐ฅ
a mobile node that wants to send datagrams to a multicast group also has two options: (1) send directly on the visited network, or (2) send via a tunnel to its home agent ๐ because multicast routing in general depends on the IP source address, a mobile node that sends multicast datagrams directly on the visited network MUST use a co-located care-of address as the IP source address ๐ similarly, a mobile node that tunnels a multicast datagram to its home agent MUST use its home address as the IP source address of both the (inner) multicast datagram and the (outer) encapsulating datagram ๐ง this second option assumes the home agent is a multicast router ๐
4.5. Mobile Routers ๐
okay so a mobile node can be a router ๐โ๏ธ, and its whole job is keeping an entire network mobile, like the whole network moving together. think of one on an airplane, a ship, a train, an automobile, a bicycle, or even a kayak ๐ถ๐ญ. the nodes connected to that network can be fixed nodes, mobile nodes, or other routers too, no cap. in this doc we call these networks "mobile networks" ๐ .
A mobile router MAY act as a foreign agent and provide a foreign agent care-of address to mobile nodes connected to the mobile network ๐ฆ. here's how routing to a mobile node through a mobile router works in this case, bestie ๐
- a) A laptop gets disconnected from its home network and later plugged into a network port in the seat back of an aircraft ๐ปโ๏ธ. It uses Mobile IP to register on this foreign network, using a foreign agent care-of address it found through an Agent Advertisement from the aircraft's foreign agent ๐ง.
- b) The aircraft network is itself mobile ๐ณ. Say the node acting as the foreign agent also acts as the default router connecting the aircraft network to the rest of the Internet. When the aircraft is at home, this router is attached to some fixed network at the airline's headquarters, and that's the router's home network. While the plane is in flight, the router keeps registering from time to time over its radio link with a series of foreign agents on the ground below ๐ก. This router's home agent is a node on the fixed network at airline HQ.
- c) Some correspondent node sends a datagram to the laptop, addressed to the laptop's home address ๐. It first gets routed to the laptop's home network.
- d) The laptop's home agent intercepts the datagram on the home network and tunnels it to the laptop's care-of address, which in this example is an address of the node serving as router and foreign agent on the aircraft ๐. Normal IP routing sends the datagram to the fixed network at the airline's headquarters.
- e) The aircraft router and foreign agent's home agent over there intercepts the datagram and tunnels it to its current care-of address, which in this example is some foreign agent on the ground below the aircraft. The original datagram from the correspondent node has now been encapsulated twice: once by the laptop's home agent, and again by the aircraft's home agent ๐คฏ.
- f) The foreign agent on the ground decapsulates the datagram, leaving a datagram still encapsulated by the laptop's home agent, with a destination of the laptop's care-of address. The ground foreign agent sends that over its radio link to the aircraft ๐ถ.
- g) The foreign agent on the aircraft decapsulates the datagram, giving back the original datagram from the correspondent node, with a destination of the laptop's home address. It then delivers the datagram over the aircraft network to the laptop's link-layer address ๐ฅณ.
This example showed the case where a mobile node is attached to a mobile network. So the mobile node is mobile with respect to the network, which is itself mobile too (here, with respect to the ground) ๐. But if, instead, the node is fixed with respect to the mobile network (the mobile network is the fixed node's home network), then either of two methods may be used to get datagrams from correspondent nodes routed to the fixed node ๐.
A home agent MAY be configured to have a permanent registration for the fixed node, showing the mobile router's address as the fixed host's care-of address ๐. The mobile router's home agent will usually be the one used for this purpose. That home agent is then responsible for advertising connectivity to the fixed node using normal routing protocols ๐ข. Any datagrams sent to the fixed node will therefore use recursive tunneling, as described above ๐.
Alternatively, the mobile router MAY advertise connectivity to the entire mobile network using normal IP routing protocols, through a bi-directional tunnel to its own home agent ๐ฆ. This method avoids the need for recursive tunneling of datagrams, which is a big W ๐โจ.
4.6. ARP, Proxy ARP, and Gratuitous ARP โจ
Okay bestie, ARP [16] is totally fine on a normal fixed network, but the second wireless or mobile nodes show up it gets messy ๐ญ. So this section sets special rules for it. These rules apply to all home networks where ARP is used for address resolution ๐
Besides the usual ARP job of finding a target's link-layer address from its IP address, this doc calls out two special uses:
- A Proxy ARP [18] is an ARP Reply that one node sends on behalf of another node that is unable or unwilling to answer its own ARP Requests. The sender reverses the Sender and Target Protocol Address fields as described in [16], but fills the Sender Hardware Address field with some configured link-layer address (generally its own). The node that gets the Reply then links this link-layer address to the IP address of the original target node, so it sends future datagrams for that target to the node with that link-layer address ๐
- A Gratuitous ARP [23] is an ARP packet that a node sends on its own to spontaneously make other nodes update an entry in their ARP cache ๐ฆ A gratuitous ARP MAY use either an ARP Request or an ARP Reply packet. Either way, the ARP Sender Protocol Address and ARP Target Protocol Address are both set to the IP address of the cache entry being updated, and the ARP Sender Hardware Address is set to the link-layer address that entry should be updated to. When it's an ARP Reply packet, the Target Hardware Address also gets set to that same link-layer address (this field isn't used in an ARP Request packet) ๐ธ
Either way, for a gratuitous ARP, the ARP packet MUST be sent as a local broadcast packet on the local link. As [16] says, any node that receives any ARP packet (Request or Reply) MUST update its local ARP cache with the Sender Protocol and Hardware Addresses in that packet, but only if it already has an entry for that IP address in its ARP cache. This rule applies even to ARP Request packets, and to ARP Reply packets that don't match any ARP Request the receiving node sent [16] ๐ซถ
While a mobile node is registered on a foreign network, its home agent uses proxy ARP [18] to reply to ARP Requests it gets that are looking for the mobile node's link-layer address ๐ง When the home agent gets an ARP Request, it MUST check the target IP address of the Request. If that IP address matches the home address of any mobile node the home agent has a registered mobility binding for, the home agent MUST send an ARP Reply on behalf of that mobile node. After swapping the sender and target addresses in the packet [18], the home agent MUST set the sender link-layer address in the packet to the link-layer address of its own interface that the Reply will go out over ๐
When a mobile node leaves its home network and registers a binding on a foreign network, its home agent uses gratuitous ARP to update the ARP caches of nodes on the home network. This makes those nodes link the home agent's link-layer address with the mobile node's home (IP) address ๐ฅ When registering a binding for a mobile node the home agent had no binding for before (the mobile node was assumed to be at home), the home agent MUST send a gratuitous ARP on behalf of the mobile node. That gratuitous ARP packet MUST be sent as a broadcast packet on the link where the mobile node's home address lives. Broadcasts on the local link (like Ethernet) usually aren't guaranteed to be reliable, so the gratuitous ARP packet SHOULD be retransmitted a few times to boost its reliability ๐
When a mobile node returns to its home network, the mobile node and its home agent both use gratuitous ARP to get all nodes on the mobile node's home network to update their ARP caches. That way they link the mobile node's own link-layer address with its home (IP) address again ๐ Before sending the (de)Registration Request to its home agent, the mobile node MUST send this gratuitous ARP on its home network as a local broadcast on that link. The gratuitous ARP packet SHOULD be retransmitted a few times for reliability, but these retransmissions SHOULD happen in parallel with sending and processing its (de)Registration Request โญ
When the mobile node's home agent receives and accepts this (de)Registration Request, the home agent MUST also send a gratuitous ARP on the mobile node's home network. This gratuitous ARP is also used to link the mobile node's home address with the mobile node's own link-layer address. Both the mobile node and its home agent send a gratuitous ARP, because with wireless interfaces, the area in range of the mobile node will likely be different from the area in range of its home agent ๐ The ARP packet from the home agent MUST be sent as a local broadcast on the mobile node's home link, and SHOULD be retransmitted a few times to boost its reliability. These retransmissions, however, SHOULD happen in parallel with sending and processing its (de)Registration Reply ๐
While the mobile node is away from home, it MUST NOT send any broadcast ARP Request or ARP Reply messages. โ While it's away from home, it also MUST NOT reply to ARP Requests whose target IP address is its own home address, unless the ARP Request comes from a foreign agent the mobile node is trying to register with, or from a foreign agent it has an unexpired registration with. In that second case, the mobile node MUST use a unicast ARP Reply to answer the foreign agent. Also note that if the mobile node is using a co-located care-of address and gets an ARP Request where the target IP address is that care-of address, then the mobile node SHOULD reply to that ARP Request. One more thing: when sending a Registration Request on a foreign network, a mobile node can find out a foreign agent's link-layer address by storing the address as it arrives in that foreign agent's Agent Advertisement, but NOT by sending a broadcast ARP Request message ๐
The exact order of each of the requirements above for ARP, proxy ARP, and gratuitous ARP matters a lot. They have to happen in the right order relative to the mobile node's Registration Request and Registration Reply messages, whether it's leaving home or coming back home, or the protocol won't work correctly ๐ญ
Okay, here's the recap. When a mobile node leaves its home network, these steps MUST be performed, in this order:
- The mobile node decides to register away from home, maybe because it got an Agent Advertisement from a foreign agent and hasn't gotten one from its home agent recently.
- Before sending the Registration Request, the mobile node turns off its own future processing of any ARP Requests it might later get asking for the link-layer address that matches its home address. The only exception is when it's needed to talk to foreign agents on visited networks.
- The mobile node sends its Registration Request.
- When the mobile node's home agent receives and accepts the Registration Request, it does a gratuitous ARP on behalf of the mobile node and starts using proxy ARP to answer ARP Requests asking for the mobile node's link-layer address. If the home agent rejects the Registration Request instead, the home agent does no ARP processing at all (neither gratuitous nor proxy).
When a mobile node later comes back to its home network, these steps MUST be performed, in this order:
- The mobile node decides to register at home, maybe because it got an Agent Advertisement from its home agent.
- Before sending the Registration Request, the mobile node turns its own future processing of any ARP Requests it might get asking for its link-layer address back on.
- The mobile node does a gratuitous ARP for itself.
- The mobile node sends its Registration Request.
- When the mobile node's home agent receives and accepts the Registration Request, it stops using proxy ARP to answer ARP Requests asking for the mobile node's link-layer address, and then does a gratuitous ARP on behalf of the mobile node. If the home agent rejects the Registration Request instead, the home agent does no ARP processing at all (neither gratuitous nor proxy).
5. Security Considerations ๐
The mobile computing environment can be super different from the ordinary computing environment ๐ฌ In a lot of cases, mobile computers connect to the network over wireless links. Those links are especially vulnerable to passive eavesdropping, active replay attacks, and other active attacks ๐
5.1. Message Authentication Codes
Home agents and mobile nodes MUST be able to do authentication. The default algorithm is keyed MD5 [21], with a 128-bit key size. The default mode is to put the 128-bit key both before and after the data being hashed, which means MD5 is used in "prefix+suffix" mode ๐ The foreign agent MUST also support authentication using keyed MD5 with key sizes of 128 bits or greater, with manual key distribution. More authentication algorithms, algorithm modes, key distribution methods, and key sizes MAY also be supported โจ
5.2. Areas of Security Concern in this Protocol
The registration protocol in this document will result in a mobile node's traffic being tunneled to its care-of address. That tunneling could be a really big vulnerability if the registration isn't authenticated ๐จ Remote redirection like this, which the mobile registration protocol does, is widely understood to be a security problem on today's Internet when it isn't authenticated [2]. On top of that, the Address Resolution Protocol (ARP) isn't authenticated, and it can be used to steal another host's traffic ๐ฑ Using "Gratuitous ARP" (Section 4.6) brings along all of the risks that come with ARP.
5.3. Key Management
This specification requires a strong authentication mechanism (keyed MD5), which blocks lots of potential attacks based on the Mobile IP registration protocol ๐ก๏ธ However, key distribution is hard without a network key management protocol, so messages with the foreign agent aren't all required to be authenticated. In a commercial environment it might matter a lot to authenticate every message between the foreign agent and the home agent, so billing works and service providers don't serve users who aren't legit customers of that provider ๐
5.4. Picking Good Random Numbers ๐ฒ
okay so how strong your auth is depends on a bunch of stuff ๐ : how strong the algorithm is on its own, how secret your key is, how strong the key itself is, and how well the implementation was actually built. This spec requires implementing keyed MD5 for authentication, but it doesn't stop you from using other auth algorithms and modes ๐ซถ. For keyed MD5 to be useful, that 128-bit key must be both secret (only known to the people who are allowed to know it ๐คซ) and pseudo-random โจ. And if you're using nonces for replay protection, you have to pick those carefully too ๐. Eastlake, et al. [7] has more info on generating pseudo-random numbers if you want to go deeper, bestie ๐ง.
5.5. Privacy ๐ถ๏ธ
Users with sensitive data they don't want anyone else seeing should use mechanisms outside the scope of this doc, like encryption, to protect it ๐. People worried about traffic analysis should consider appropriate use of link encryption ๐. If you want absolute location privacy, the mobile node can create a tunnel to its home agent ๐ฆ. Then, datagrams headed to correspondent nodes will look like they're coming from the home network, and it may be harder to pinpoint where the mobile node actually is ๐ซฃ. All of these mechanisms are beyond the scope of this document, so you'd have to look elsewhere for them ๐.
5.6. Replay Protection for Registration Requests ๐
The Identification field is how the home agent checks that a registration message was freshly generated by the mobile node, and not replayed by some attacker from an older registration ๐ต๏ธโโ๏ธ. Two methods are described in this section: timestamps (mandatory) and "nonces" (optional). All mobile nodes and home agents MUST implement timestamp-based replay protection. These nodes MAY also implement nonce-based replay protection (but check out Appendix A.2 for a patent that may apply to nonce-based replay protection ๐).
The style of replay protection in effect between a mobile node and its home agent is part of the mobile security association ๐ค. A mobile node and its home agent MUST agree on which method of replay protection they'll use. How the Identification field gets interpreted depends on that method, as described in the subsections below ๐ง .
Whatever method is used, the low-order 32 bits of the Identification MUST be copied unchanged from the Registration Request to the Reply ๐. The foreign agent uses those bits (and the mobile node's home address) to match Registration Requests with their corresponding replies ๐ฏ. The mobile node MUST verify that the low-order 32 bits of any Registration Reply are identical to the bits it sent in the Registration Request โ
.
The Identification in a new Registration Request MUST NOT be the same as in an immediately preceding Request, and SHOULD NOT repeat while the same security context is being used between the mobile node and the home agent ๐. Retransmission as in Section 3.6.3 is allowed ๐.
5.6.1. Replay Protection using Timestamps โฐ
The basic vibe of timestamp replay protection is that the generating node slaps the current time of day into the message, and the receiving node checks that this timestamp is close enough to its own time of day โฑ๏ธ. Obviously, the two nodes need adequately synchronized time-of-day clocks ๐ฐ๏ธ. Like any messages, time synchronization messages may be protected against tampering by an authentication mechanism set by the security context between the two nodes ๐.
If timestamps are used, the mobile node MUST set the Identification field to a 64-bit value formatted as specified by the Network Time Protocol [13]. The low-order 32 bits of the NTP format represent fractional seconds, and any bits a time source can't supply SHOULD be generated from a good source of randomness ๐ฒ. Note, though, that when using timestamps, the 64-bit Identification in a Registration Request from the mobile node MUST be greater than the one used in any previous Registration Request, because the home agent uses this field as a sequence number too ๐ข. Without that sequence number, a delayed duplicate of an earlier Registration Request could reach the home agent (within the clock synchronization the home agent requires) and get applied out of order, mistakenly changing the mobile node's current registered care-of address ๐ฑ.
Upon receipt of a Registration Request with a valid Mobile-Home Authentication Extension, the home agent MUST check the Identification field for validity. To be valid, the timestamp in the Identification field MUST be close enough to the home agent's time-of-day clock, and the timestamp MUST be greater than all previously accepted timestamps for the requesting mobile node ๐ง. Time tolerances and resynchronization details are specific to a particular mobility security association ๐.
If the timestamp is valid, the home agent copies the entire Identification field into the Registration Reply it returns to the mobile node โจ. If the timestamp is not valid, the home agent copies only the low-order 32 bits into the Registration Reply, and supplies the high-order 32 bits from its own time-of-day clock. In this latter case, the home agent MUST reject the registration by returning Code 133 (identification mismatch) in the Registration Reply ๐ซ.
As described in Section 3.6.2.1, the mobile node MUST verify that the low-order 32 bits of the Identification in the Registration Reply are identical to those in the rejected registration attempt, before using the high-order bits for clock resynchronization ๐.
5.6.2. Replay Protection using Nonces ๐๏ธ
Implementors of this optional mechanism should examine Appendix A.2 for a patent that may be applicable to nonce-based replay protection โ ๏ธ.
The basic principle of nonce replay protection is that node A includes a new random number in every message to node B, and checks that node B returns that same number in its next message to node A ๐. Both messages use an authentication code to protect against alteration by an attacker ๐ก๏ธ. At the same time, node B can send its own nonces in all messages to node A (to be echoed by node A), so that it can verify it's receiving fresh messages too ๐ซถ.
The home agent may be expected to have resources for computing pseudo-random numbers useful as nonces [7]. It inserts a new nonce as the high-order 32 bits of the Identification field of every Registration Reply. The home agent copies the low-order 32 bits of the Identification from the Registration Request message into the low-order 32 bits of the Identification in the Registration Reply. When the mobile node receives an authenticated Registration Reply from the home agent, it saves the high-order 32 bits of the identification to use as the high-order 32 bits of its next Registration Request ๐พ.
The mobile node is responsible for generating the low-order 32 bits of the Identification in each Registration Request. Ideally, it should generate its own random nonces. However, it may use any expedient method, including duplication of the random value sent by the home agent ๐คทโโ๏ธ. The method chosen is of concern only to the mobile node, because it's the node that checks for valid values in the Registration Reply. The high-order and low-order 32 bits of the identification chosen SHOULD both differ from their previous values. The home agent uses a new high-order value, and the mobile node uses a new low-order value, for each registration message. The foreign agent uses the low-order value (and the mobile host's home address) to correctly match registration replies with pending Requests (Section 3.7.1) ๐ฏ.
If a registration message is rejected because of an invalid nonce, the Reply always provides the mobile node with a new nonce to be used in the next registration. Thus, the nonce protocol is self-synchronizing ๐๐.
6. Acknowledgments ๐
Special thanks to Steve Deering (Xerox PARC), along with Dan Duchamp and John Ioannidis (JI) (Columbia), for forming the working group, chairing it, and putting so much effort into its early development ๐.
Thanks also to Kannan Alaggapan, Greg Minshall, and Tony Li for their contributions to the group while performing the duties of chairperson, plus all their many useful comments ๐.
Thanks to the active members of the Mobile IP Working Group, particularly those who contributed text, including (in alphabetical order)
- Ran Atkinson (Naval Research Lab),
- Dave Johnson (Carnegie Mellon University),
- Frank Kastenholz (FTP Software),
- Anders Klemets (KTH),
- Chip Maguire (KTH),
- Andrew Myles (Macquarie University),
- Al Quirt (Bell Northern Research),
- Yakov Rekhter (IBM), and
- Fumio Teraoka (Sony).
Thanks to Charlie Kunzinger and Bill Simpson, the editors who produced the first drafts of this document, reflecting the discussions of the Working Group ๐. Much of the new text of this memo is due to Jim Solomon and Dave Johnson ๐ซถ.
Thanks to Greg Minshall (Novell), Phil Karn (Qualcomm), and Frank Kastenholz (FTP Software) for their generous support in hosting interim Working Group meetings ๐ .
A. Patent Issues โ๏ธ
As of the time of publication, the IETF had been made aware of two patents that may be relevant to implementors of the protocol described in this technical specification ๐.
A.1. IBM Patent #5,159,592
Charles Perkins, editor of this memo, is the sole inventor of U.S. Patent No. 5,159,592, assigned to IBM. In a letter dated May 30, 1995, IBM brought this patent to the attention of the IETF, stating that this patent "relates to the Mobile IP." We understand that IBM did not intend to assert that any particular implementation of Mobile IP would or would not infringe the patent. Rather, IBM was meeting what it saw as a duty to disclose information that could be relevant to the process of adopting a standard ๐.
Based on a review of the claims of the patent, the IETF believes that a system of registering an address obtained from a foreign agent, as described in the document, would not necessarily infringe any of the claims of the patent; and that a system in which an address is obtained elsewhere and then registered can be implemented without necessarily infringing any claims of the patent. Accordingly, our view is that the proposed protocol can be implemented without necessarily infringing the Perkins Patent ๐.
Parties considering adopting this protocol must be aware that some specific implementations, or features added to otherwise non-infringing implementations, may raise an issue of infringement with respect to this patent or to some other patent ๐จ.
This statement is for the IETF's assistance in its standard-setting procedure, and should not be relied upon by any party as an opinion or guarantee that any implementation it might make or use would not be covered by the Perkins Patent and any other patents. In particular, IBM might disagree with the interpretation of this patent described herein ๐.
A.2. IBM Patent #5,148,479
This patent, also assigned to IBM, may be relevant to those who implement nonce-based replay protection as described in Section 5.6.2. Note that nonce-based replay protection is an optional feature of this specification. Timestamp-based replay protection, on the other hand (Section 5.6.1), is a requirement of this specification ๐ซ.
B. Link-Layer Considerations โจ
okay bestie, the mobile node MAY use link-layer mechanisms to figure out that its point of attachment changed ๐ Things like the Down/Testing/Up interface status [11] and changes in cell or administration are examples. These mechanisms are specific to each link-layer technology and are outside the scope of this doc ๐ซถ
The Point-to-Point-Protocol (PPP) [22] and its Internet Protocol Control Protocol (IPCP) [12] negotiate the use of IP addresses ๐
The mobile node SHOULD first attempt to specify its home address ๐ That way, if the mobile node is attaching to its home network, the unrouted link will work correctly. If the home address isn't accepted by the peer, but a transient IP address gets dynamically assigned to the mobile node, and the mobile node can support a co-located care-of address, the mobile node MAY register that address as a co-located care-of address ๐ฆ
โ ๏ธ Big reminder: when the peer specifies its own IP address, that address MUST NOT be assumed to be a foreign agent care-of address or the IP address of a home agent. Don't just assume it, bestie ๐
C. TCP Considerations ๐ธ
C.1. TCP Timers
Most hosts and routers that implement TCP/IP don't make it easy to configure the TCP timer values ๐ฉ When high-delay (e.g., SATCOM) or low-bandwidth (e.g., High-Frequency Radio) links are in use, the default TCP timer values on many systems can cause retransmissions or timeouts. That happens even when the link and network are actually working fine, just with longer delays because of the medium. This can make it impossible to create or maintain TCP connections over these links, and it can also cause unneeded retransmissions that eat up already scarce bandwidth ๐
Vendors are encouraged to make TCP timers more configurable ๐ Vendors of systems built for the mobile computing market should pick default timer values that suit low-bandwidth, high-delay links better. Users of mobile nodes should be sensitive to the possibility of timer-related difficulties โจ
C.2. TCP Congestion Management
Mobile nodes often use media that are more likely to introduce errors, which effectively means more packets get dropped ๐ญ This creates a conflict with the congestion management mechanisms in modern versions of TCP [9]. When a packet is dropped, the correspondent node's TCP implementation is likely to react as if there were network congestion, and start the slow-start mechanisms [9] that were designed to handle that problem. Those mechanisms aren't right for errors caused by the links themselves, though. They end up magnifying the discontinuity the dropped packet caused ๐
This problem was analyzed by Caceres, et al. [3]. There's no easy solution, and definitely no solution likely to be installed on all correspondent nodes anytime soon ๐ฎโ๐จ This problem is beyond the scope of this document, but it shows that providing performance transparency to mobile nodes means understanding mechanisms outside the network layer ๐ง It also points to the need to avoid designs that systematically drop packets ๐ซ Those designs might otherwise look good when people make engineering tradeoffs, so keep that in mind ๐
D. Example Scenarios ๐
This section shows example Registration Requests for a few common scenarios ๐
D.1. Registering with a Foreign Agent Care-of Address
The mobile node receives an Agent Advertisement from a foreign agent and wants to register with that agent using the advertised foreign agent care-of address. The mobile node only wants IP-in-IP encapsulation, doesn't want broadcasts, and doesn't want simultaneous mobility bindings ๐ฆ
IP fields:
Source Address = mobile node's home address
Destination Address = copied from the IP source address of the
Agent Advertisement
Time to Live = 1
UDP fields:
Source Port = <any>
Destination Port = 434
Registration Request fields:
Type = 1
S=0,B=0,D=0,M=0,G=0
Lifetime = the Registration Lifetime copied from the
Mobility Agent Advertisement Extension of the
Router Advertisement message
Home Address = the mobile node's home address
Home Agent = IP address of mobile node's home agent
Care-of Address = the Care-of Address copied from the
Mobility Agent Advertisement Extension of the
Router Advertisement message
Identification = Network Time Protocol timestamp or Nonce
Extensions:
The Mobile-Home Authentication Extension
D.2. Registering with a Co-Located Care-of Address
The mobile node enters a foreign network with no foreign agents ๐ It gets an address from a DHCP server [6] to use as a co-located care-of address. The mobile node supports all forms of encapsulation (IP-in-IP, minimal encapsulation, and GRE), wants a copy of broadcast datagrams on the home network, and doesn't want simultaneous mobility bindings ๐
IP fields:
Source Address = care-of address obtained from DHCP server
Destination Address = IP address of home agent
Time to Live = 64
UDP fields:
Source Port = <any>
Destination Port = 434
Registration Request fields:
Type = 1
S=0,B=1,D=1,M=1,G=1
Lifetime = 1800 (seconds)
Home Address = the mobile node's home address
Home Agent = IP address of mobile node's home agent
Care-of Address = care-of address obtained from DHCP server
Identification = Network Time Protocol timestamp or Nonce
Extensions:
The Mobile-Home Authentication Extension
D.3. Deregistration
The mobile node returns home and wants to deregister all of its care-of addresses with its home agent ๐ก
IP fields:
Source Address = mobile node's home address
Destination Address = IP address of home agent
Time to Live = 1
UDP fields:
Source Port = <any>
Destination Port = 434
Registration Request fields:
Type = 1
S=0,B=0,D=0,M=0,G=0
Lifetime = 0
Home Address = the mobile node's home address
Home Agent = IP address of mobile node's home agent
Care-of Address = the mobile node's home address
Identification = Network Time Protocol timestamp or Nonce
Extensions:
The Mobile-Home Authentication Extension
E. Applicability of Prefix Lengths Extension ๐ง
Be careful using the Prefix Lengths Extension over wireless links ๐ก Wireless transmitters have irregular coverage areas, so two foreign agents advertising the same prefix might actually give prospective mobile nodes different connectivity. Because of that, the Prefix-Lengths Extension SHOULD NOT be included in the advertisements sent by agents in that kind of configuration ๐ โโ๏ธ
Foreign agents using different wireless interfaces would have to cooperate using special protocols to provide identical coverage in space, and only then could they claim their wireless interfaces are on the same subnetwork ๐ค With wired interfaces, a mobile node that disconnects and then connects to a new point of attachment may well send a new Registration Request, whether or not the new advertisement is on the same medium as the last recorded advertisement. Finally, in areas with dense populations of foreign agents, it would seem unwise to require routing protocols to propagate the subnet prefixes of each individual wireless foreign agent ๐ต That strategy could quickly deplete the space available for routing tables, unreasonably increase the time needed to process routing updates, and lengthen route selection decision times if routes (which are almost always unnecessary) get stored for wireless "subnets" ๐ฅฒ
References ๐
- [1] Atkinson, R., "IP Authentication Header", RFC 1826, August 1995.
- [2] S. M. Bellovin. Security Problems in the TCP/IP Protocol Suite. ACM Computer Communications Review, 19(2), March 1989.
- [3] Ramon Caceres and Liviu Iftode. Improving the Performance of Reliable Transport Protocols in Mobile Computing Environments. IEEE Journal on Selected Areas in Communications, 13(5):850--857, June 1995.
- [4] Deering, S., Editor, "ICMP Router Discovery Messages", RFC 1256, September 1991.
- [5] Deering, S., "Host Extensions for IP Multicasting", STD 5, RFC 1112, August 1989.
- [6] Droms, R., "Dynamic Host Configuration Protocol", RFC 1541, October 1993.
- [7] Eastlake, D., Crocker, S., and J. Schiller, "Randomness Requirements for Security", RFC 1750, December 1994.
- [8] Hanks, S., Li, R., Farinacci, D., and P. Traina, "Generic Routing Encapsulation (GRE)", RFC 1701, October 1994.
- [9] Van Jacobson. Congestion Avoidance and Control. In Proceedings of the SIGCOMM '88 Symposium: Communications Architectures & Protocols, pages 314--329, August 1988.
- [10] Jacobson, V., "Compressing TCP/IP Headers for Low-Speed Serial Links", RFC 1144, February 1990.
- [11] McCloghrie, K., and F. Kastenholz, "Evolution of the Interfaces Group of MIB-II", RFC 1573, January 1994.
- [12] McGregor, G., "The PPP Internet Protocol Control Protocol (IPCP)", RFC 1332, May 1992.
- [13] Mills, D., "Network Time Protocol (Version 3): Specification, Implementation and Analysis", RFC 1305, March 1992.
- [14] Perkins, C., "IP Encapsulation within IP", RFC 2003, October 1996.
- [15] Perkins, C., "Minimal Encapsulation within IP", RFC 2004, October 1996.
- [16] Plummer, D., "An Ethernet Address Resolution Protocol: Or Converting Network Protocol Addresses to 48.bit Ethernet Addresses for Transmission on Ethernet Hardware", STD 37, RFC 826, November 1982.
- [17] Postel, J., "User Datagram Protocol", STD 6, RFC 768, August 1980.
- [18] Postel, J., "Multi-LAN Address Resolution", RFC 925, October 1984.
- [19] Postel, J., Editor, "Internet Protocol", STD 5, RFC 791, September 1981.
- [20] Reynolds, J., and J. Postel, "Assigned Numbers", STD 2, RFC 1700, October 1994.
- [21] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, April 1992.
- [22] Simpson, W., Editor, "The Point-to-Point Protocol (PPP)", STD 51, RFC 1661, July 1994.
- [23] W. Richard Stevens. TCP/IP Illustrated, Volume 1: The Protocols. Addison-Wesley, Reading, Massachusetts, 1994.
Editor's Address ๐
Questions about this memo can also be directed to the editor ๐
Charles Perkins
Room H3-D34
T. J. Watson Research Center
IBM Corporation
30 Saw Mill River Rd.
Hawthorne, NY 10532
Work: +1-914-784-7350
Fax: +1-914-784-6205
EMail: perk@watson.ibm.com
The working group can be contacted via the current chair ๐ซถ
Jim Solomon
Motorola, Inc.
1301 E. Algonquin Rd.
Schaumburg, IL 60196
Work: +1-847-576-2753
EMail: solomon@comm.mot.com
๐ฆ where this page comes from
- ietf: rfc2002 1996-10
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms