RFC 5944

IP Mobility Support for IPv4, Revised

๐Ÿ“… published November 2010, from ietf

RFC 5944: IP Mobility Support for IPv4, Revised ๐Ÿฆ‹

okay bestie, this one is the spec for making a node's IP address stay the same even when it moves around the internet ๐ŸŒธ It's RFC 5944, written by C. Perkins, Ed. from WiChorus Inc. and published in November 2010. It's a Standards Track document from the Internet Engineering Task Force (IETF), and it obsoletes RFC 3344. It doesn't update anything else. So if you were reading RFC 3344, this is the one that replaces it ๐Ÿ’…

Status of This Memo

This is an Internet Standards Track document โœจ

It's a product of the IETF, it reflects the consensus of the IETF community, and it got public review before the Internet Engineering Steering Group (IESG) approved it for publication. If you want more on Internet Standards, check Section 2 of RFC 5741. Info about this document's current status, errata, and where to send feedback lives at http://www.rfc-editor.org/info/rfc5944.

Copyright Notice

Copyright (c) 2010 IETF Trust and the persons identified as the document authors. All rights reserved. ๐Ÿ”ฅ

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as they stand on the publication date. Please actually read those, because they spell out your rights and restrictions. Any Code Components pulled out of this document must include Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions, and they come without warranty as described in that license.

This document may contain material from IETF Documents or IETF Contributions that were published or made publicly available before November 10, 2008. Some of that material's copyright holders may not have let the IETF Trust allow modifications outside the IETF Standards Process. So unless you get an adequate license from those copyright holders, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process. The only exceptions are formatting it for publication as an RFC or translating it into languages other than English ๐ŸŒˆ

Table of Contents

   1. Introduction ....................................................5
      1.1. Protocol Requirements ......................................5
      1.2. Goals ......................................................6
      1.3. Assumptions ................................................6
      1.4. Applicability ..............................................6
      1.5. New Architectural Entities .................................7
      1.6. Terminology ................................................7
      1.7. Protocol Overview .........................................11
      1.8. Message Format and Protocol Extensibility .................14
      1.9. Type-Length-Value Extension Format for Mobile IP
           Extensions ................................................16
      1.10. Long Extension Format ....................................17
      1.11. Short Extension Format ...................................18
   2. Agent Discovery ................................................18
      2.1. Agent Advertisement .......................................19
           2.1.1. Mobility Agent Advertisement Extension .............21
           2.1.2. Prefix-Lengths Extension ...........................23
           2.1.3. One-Byte Padding Extension .........................24
      2.2. Agent Solicitation ........................................24
      2.3. Foreign Agent and Home Agent Considerations ...............24
           2.3.1. Advertised Router Addresses ........................26
           2.3.2. Sequence Numbers and Rollover Handling .............26
      2.4. Mobile Node Considerations ................................26
           2.4.1. Registration Required ..............................28
           2.4.2. Move Detection .....................................28
           2.4.3. Returning Home .....................................29
           2.4.4. Sequence Numbers and Rollover Handling .............29
   3. Registration ...................................................29
      3.1. Registration Overview .....................................30
      3.2. Authentication ............................................31
      3.3. Registration Request ......................................32
      3.4. Registration Reply ........................................34
      3.5. Registration Extensions ...................................38
           3.5.1. Computing Authentication Extension Values ..........38
           3.5.2. Mobile-Home Authentication Extension ...............39
           3.5.3. Mobile-Foreign Authentication Extension ............40
           3.5.4. Foreign-Home Authentication Extension ..............40
      3.6. Mobile Node Considerations ................................41
           3.6.1. Sending Registration Requests ......................43
           3.6.2. Receiving Registration Replies .....................47
           3.6.3. Registration Retransmission ........................50
      3.7. Foreign Agent Considerations ..............................50
           3.7.1. Configuration and Registration Tables ..............51
           3.7.2. Receiving Registration Requests ....................52
           3.7.3. Receiving Registration Replies .....................56

      3.8. Home Agent Considerations .................................58
           3.8.1. Configuration and Registration Tables ..............58
           3.8.2. Receiving Registration Requests ....................59
           3.8.3. Sending Registration Replies .......................64
   4. Routing Considerations .........................................66
      4.1. Encapsulation Types .......................................67
      4.2. Unicast Datagram Routing ..................................67
           4.2.1. Mobile Node Considerations .........................67
           4.2.2. Foreign Agent Considerations .......................68
           4.2.3. Home Agent Considerations ..........................69
      4.3. Broadcast Datagrams .......................................70
      4.4. Multicast Datagram Routing ................................71
      4.5. Mobile Routers ............................................72
      4.6. ARP, Proxy ARP, and Gratuitous ARP ........................74
   5. Security Considerations ........................................77
      5.1. Message Authentication Codes ..............................77
      5.2. Areas of Security Concern in This Protocol ................78
      5.3. Key Management ............................................78
      5.4. Picking Good Random Numbers ...............................78
      5.5. Privacy ...................................................79
      5.6. Ingress Filtering .........................................79
      5.7. Replay Protection for Registration Requests ...............79
           5.7.1. Replay Protection Using Timestamps .................80
           5.7.2. Replay Protection Using Nonces .....................81
   6. IANA Considerations ............................................82
      6.1. Mobile IP Message Types ...................................82
      6.2. Extensions to RFC 1256 Router Advertisement Messages ......83
      6.3. Extensions to Mobile IP Registration Messages .............83
      6.4. Code Values for Mobile IP Registration Reply Messages .....84
   7. Acknowledgments ................................................84
   8. References .....................................................86
      8.1. Normative References ......................................86
      8.2. Informative References ....................................87
   Appendix A. Link-Layer Considerations .............................90
   Appendix B. TCP Considerations ....................................90
      B.1. TCP Timers ................................................90
      B.2. TCP Congestion Management .................................91
   Appendix C.  Example Scenarios ....................................92
      C.1. Registering with a Foreign Agent Care-of Address ..........92
      C.2. Registering with a Co-Located Care-of Address .............93
      C.3. Deregistration ............................................94
   Appendix D. Applicability of Prefix-Lengths Extension .............94
   Appendix E. Interoperability Considerations .......................95
   Appendix F. Changes since RFC 3344 ................................96
   Appendix G. Example Messages ......................................98
      G.1. Example ICMP Agent Advertisement Message Format ...........98
      G.2. Example Registration Request Message Format ...............99
      G.3. Example Registration Reply Message Format ................100

1. Introduction โœจ

Okay so here's the problem ๐Ÿ™ˆ IPv4 assumes that a node's IP address uniquely tells you where the node is attached to the Internet. That means a node has to be on the network its IP address points to in order to receive datagrams meant for it. If it isn't there, those datagrams just can't be delivered.

So if a node wants to change where it's plugged in and still be reachable, you usually have to do one of two things:

  • the node changes its IP address every time it changes its point of attachment, or
  • host-specific routes get propagated throughout a huge chunk of the Internet routing fabric.

Honestly, both are usually a no-go ๐Ÿ’€ The first one means a node can't keep its transport and higher-layer connections alive when it moves. The second one has obvious, severe scaling problems, and that's especially bad given how fast sales of notebook (mobile) computers were exploding.

So we need a new, scalable mechanism for node mobility on the Internet. This document is that mechanism ๐ŸŽ€ It lets nodes change their point of attachment to the Internet without changing their IP address. Ate, honestly. Any changes between this revised Mobile IP spec and the original specifications (see [44], [14], [15], [20], [4], and [50]) are detailed in Appendix F.

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. Main character energy ๐Ÿ‘‘

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. Basically, nobody else has to upgrade just to deal with this ๐Ÿซถ

Last thing, and it's a big one ๐Ÿ”ฅ All messages used to tell another node where a mobile node is located must be authenticated, in order to protect against remote redirection attacks. No cap, this is non-negotiable.

1.2. Goals ๐ŸŽ€

okay so the link a mobile node is directly attached to is often a wireless one ๐Ÿ“ก and that means it can be way slower and way more error-prone than a wired network ๐Ÿ˜ญ plus mobile nodes are usually battery powered, so saving power matters a lot ๐Ÿ”‹ soooo the number of admin messages sent over that link should be minimized ๐Ÿ’…, and each message should be kept as small as is reasonably possible โœจ it's giving "don't waste the bandwidth, bestie" ๐Ÿซถ

1.3. Assumptions ๐ŸŒธ

the protocols in this doc don't add any extra rules on how IP addresses get assigned ๐Ÿงš so a mobile node can be given an IP address by whoever owns the machine, and that's totally valid ๐Ÿ’–

this protocol assumes mobile nodes won't change their point of attachment to the Internet more than once per second ๐Ÿฆ‹ like, they're not hopping networks every two seconds, that would be chaotic ๐Ÿ’€

this protocol also assumes IP unicast datagrams get routed based on the Destination Address in the datagram header ๐Ÿ—บ๏ธ and NOT, for example, by source address ๐Ÿ™ˆ so the destination is what steers the packet, fr fr

1.4. Applicability ๐ŸŒˆ

Mobile IP is made to let nodes move from one IP subnet to another ๐Ÿƒโ€โ™€๏ธโœจ and honestly it's just as iconic for moving across the same kind of media as it is across different kinds ๐Ÿ‘‘ so Mobile IP can handle a move from one Ethernet segment to another, or from an Ethernet segment to a wireless LAN ๐Ÿ”ฅ as long as the mobile node's IP address stays the same after the move ๐Ÿ’œ

one way to think about it is that Mobile IP solves the "macro" mobility management problem ๐ŸŒ it's less of a fit for the "micro" stuff -- like handoff between wireless transceivers that each only cover a super tiny area ๐Ÿ“ as long as the node isn't moving between points of attachment on different IP subnets, link-layer mechanisms for mobility (aka link-layer handoff) might converge faster and have way less overhead than Mobile IP โšก so it's not a competition, just the right tool for the right job ๐Ÿง โœจ

1.5. New Architectural Entities ๐Ÿงšโ€โ™€๏ธ

Mobile IP introduces the following new functional entities, and they're the main characters ๐Ÿ‘‘

Mobile Node ๐Ÿฆ‹

a host or router that changes its point of attachment from one network or subnetwork to another ๐Ÿšถโ€โ™€๏ธ a mobile node can change location without changing its IP address ๐Ÿ’– so it can keep talking to other Internet nodes from anywhere, using its (constant) IP address, as long as link-layer connectivity to a point of attachment is available ๐Ÿ“ถ

Home Agent ๐Ÿ 

a router on a mobile node's home network that tunnels datagrams for delivery to the mobile node when it's away from home ๐Ÿš‡ and it keeps up-to-date location info for the mobile node ๐Ÿ“ it's the reliable friend 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 and delivers to the mobile node the datagrams that were tunneled by the mobile node's home agent ๐Ÿ“ฆ and for datagrams a mobile node sends, the foreign agent may serve as a default router for registered mobile nodes ๐ŸŒŸ

a mobile node gets a long-term IP address on a home network ๐Ÿก this home address is administered the same way a "permanent" IP address is given to a stationary host ๐Ÿ’… when the node is away from its home network, a "care-of address" gets associated with it and reflects its current point of attachment ๐Ÿ“Œ the mobile node uses its home address as the source address of all IP datagrams it sends, except where this document says otherwise for datagrams sent for certain mobility management functions (e.g., as in Section 3.6.1.1) ๐ŸŽ€

1.6. Terminology ๐Ÿ“š

okay the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [1] ๐Ÿง  bestie, read those capitals like they're the rules of the group chat ๐Ÿ’€๐Ÿซถ

also this doc uses the following terms a lot, so let's get them down ๐Ÿ“

Authorization-Enabling Extension ๐Ÿ”

an authentication that makes a (registration) message acceptable to the ultimate recipient of the registration message ๐Ÿ’Œ an authorization-enabling extension MUST contain a Security Parameter Index (SPI) ๐Ÿ”‘

in this document, every use of authorization-enabling extension refers to authentication extensions that make the Registration Request message acceptable to the home agent ๐Ÿ  using additional protocol structures specified outside this document, it may be possible for the mobile node to authenticate its registration to the home agent, through another authenticating entity in the network that the home agent accepts (for example, see RFC 2794 [2]) ๐Ÿค

Agent Advertisement ๐Ÿ“ข

an advertisement message built by attaching a special Extension to a Router Advertisement [5] message ๐ŸŽ€

Authentication ๐Ÿ•ต๏ธโ€โ™€๏ธ

the process of verifying (using cryptographic techniques, for all applications in this specification) the identity of the originator of a message ๐Ÿ” no cap, this is the "who really sent this" check ๐Ÿ’ฏ

Care-of Address ๐Ÿ“

the termination point of a tunnel toward a mobile node, for datagrams forwarded to the mobile node while it's away from home ๐Ÿ›ค๏ธ the protocol can use two types of care-of address: a "foreign agent care-of address" is an address of a foreign agent the mobile node is registered with, and 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 ๐ŸŒธ

Correspondent Node ๐Ÿ’ฌ

a peer that a mobile node is communicating with ๐Ÿ—ฃ๏ธ a correspondent node may be either mobile or stationary ๐Ÿงš

Foreign Network ๐ŸŒ

any network other than the mobile node's home network โœˆ๏ธ

Gratuitous ARP ๐Ÿ“ฃ

an Address Resolution Protocol (ARP) packet sent by a node to spontaneously cause other nodes to update an entry in their ARP cache [45] ๐Ÿ’ฅ see Section 4.6 ๐Ÿ‘€

Home Address ๐Ÿก

an IP address assigned for an extended period of time to a mobile node ๐Ÿ’– it stays unchanged no matter where the node is attached to the Internet ๐Ÿซถ

Home Network ๐Ÿ 

a network, possibly virtual, with a network prefix matching that of a mobile node's home address ๐ŸŒท note that standard IP routing mechanisms will deliver datagrams destined to a mobile node's home address to the mobile node's home network ๐Ÿ—บ๏ธ it's giving "home is where the prefix is" ๐Ÿฅน

a facility or medium over which nodes can communicate at the link layer ๐Ÿ’ซ a link underlies the network layer ๐Ÿงฑ

the address used to identify an endpoint of some communication over a physical link ๐Ÿ’… typically, the link-layer address 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 โณ bestie, that's the pairing that makes everything work ๐Ÿ’œ

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 appropriate public/private key pair), and a style of replay protection in use (Section 5.7) ๐Ÿฆ‹

Node ๐Ÿ–ฅ๏ธ

a host or a router ๐ŸŒˆ

Nonce ๐ŸŽฒ

a randomly chosen value, different from previous choices, inserted in a message to protect against replays ๐Ÿ” ngl, the "never the same twice" energy is so iconic ๐Ÿ˜ญ

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 ๐Ÿšซ so don't even touch those, periodt ๐Ÿ’…

Tunnel ๐Ÿš‡

the path a datagram follows while it's encapsulated ๐ŸŒ€ the model is that, while encapsulated, a datagram is routed to a knowledgeable decapsulating agent, which decapsulates the datagram and then correctly delivers it to its ultimate destination ๐Ÿ“ฌ it's like a sealed envelope with a trusted courier ๐Ÿ’Œ

Virtual Network ๐ŸŒŒ

a network with no physical instantiation beyond a router (with a physical network interface on another network) ๐Ÿ‘ป the router (e.g., a home agent) generally advertises reachability to the virtual network using conventional routing protocols ๐Ÿ“ก it's a network that only exists in spirit, and honestly that's kind of magical ๐Ÿงšโ€โ™€๏ธโœจ

Visited Network ๐Ÿ›ฌ

a network other than a mobile node's home network, to which the mobile node is currently connected ๐ŸŒธ

Visitor List ๐Ÿ“‹

the list of mobile nodes visiting a foreign agent ๐ŸŽ€ basically the guest list ๐Ÿ’…

1.7. Protocol Overview โœจ

okay bestie, this part is where Mobile IP really starts to click for me ๐Ÿฆ‹ so let's get into it ๐Ÿ’–

Mobile IP has three support services that it's built on: ๐ŸŽ€

Agent Discovery ๐Ÿ”

Home agents and foreign agents can advertise that they're around on every link where they provide service ๐Ÿ“ก A newly arrived mobile node can send a solicitation on that link to find out if any prospective agents are nearby ๐Ÿ‘€

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, the mobile node will either register directly with its home agent, or through a foreign agent that forwards the registration along to the home agent ๐Ÿ’Œ

Silently Discard ๐Ÿคซ

The implementation throws the datagram away without any further processing, and without telling the sender there was an error ๐Ÿ™ˆ 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 ๐Ÿ“Š

Here's the rough outline of how Mobile IP operates, step by step ๐Ÿงš

Step one: mobility agents (that's foreign agents and home agents) announce their presence through Agent Advertisement messages (Section 2) ๐Ÿ“ฃ A mobile node MAY optionally solicit an Agent Advertisement message from any locally attached mobility agents through an Agent Solicitation message ๐Ÿ™‹โ€โ™€๏ธ

Step two: the mobile node receives these Agent Advertisements and figures out whether it's on its home network or a foreign network ๐Ÿงญ

Step three: when the mobile node detects that it's on its home network, it operates without mobility services ๐Ÿก If it's coming back home after being registered somewhere else, it deregisters with its home agent, by exchanging a Registration Request and Registration Reply message with it ๐Ÿ”„

Step four: when a mobile node detects that it has moved to a foreign network, it gets a care-of address on that foreign network ๐ŸŒ The care-of address can either be determined from a foreign agent's advertisements (a foreign agent care-of address), or by some external assignment mechanism such as DHCP [34] (a co-located care-of address) ๐Ÿ’…

Step five: the mobile node away from home then registers its new care-of address with its home agent, through a Registration Request and Registration Reply message exchange with the home agent, possibly via a foreign agent (Section 3) ๐Ÿ’œ

Step six: 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 at a foreign agent or at the mobile node itself), and finally delivered to the mobile node (Section 4.2.3) ๐ŸŽ

Step seven: going the other way, datagrams sent by the mobile node are generally delivered to their destination using standard IP routing mechanisms, not necessarily passing through the home agent ๐Ÿš€

When Mobile IP is away from home, it uses protocol tunneling to hide a mobile node's 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 ๐ŸŽฏ The care-of address MUST be an address that datagrams can be delivered to via conventional IP routing ๐Ÿ’Œ At the care-of address, the original datagram gets taken out of the tunnel and delivered to the mobile node โœจ

Mobile IP gives you two different ways to get a care-of address ๐Ÿ‘‘

a. A "foreign agent care-of address" is a care-of address that a foreign agent hands out through 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 here, so when it gets tunneled datagrams, it decapsulates them and delivers the inner datagram to the mobile node ๐Ÿ“ฆ This is the preferred way because lots of mobile nodes can share the same care-of address, so it doesn't put unnecessary pressure on the already limited IPv4 address space ๐ŸŒธ

b. 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 grabbed as a temporary address by the mobile node, like through DHCP [34], or it might be a long-term address the mobile node owns, only used while it's visiting some foreign network ๐Ÿงณ How you actually get a local IP address to use as a co-located care-of address is beyond the scope of this document ๐Ÿคทโ€โ™€๏ธ When using a co-located care-of address, the mobile node is the tunnel endpoint and does its own decapsulation of the datagrams tunneled to it ๐Ÿซถ

Co-located care-of addresses are great because they let a mobile node work without a foreign agent, for example in networks that haven't deployed one yet ๐Ÿฅน BUT they do put 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 ๐Ÿ˜ญ And it's hard to keep those address pools running efficiently for every subnet a mobile node might visit ๐Ÿ’€

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 actually 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 ๐Ÿงฉ Those placements are beyond the scope of this document ๐Ÿ™ƒ

In the same way, 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 mechanisms that make forwarding decisions based upon 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 simply bypass their normal IP routing mechanism when sending datagrams to each other, addressing 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 ๐Ÿ’…

Here's the picture, it's giving everything ๐Ÿ–ผ๏ธ

               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.
                     +----+

                    Figure 1:  Operation of Mobile IPv4

If a mobile node is using a co-located care-of address (the one from item (b) above), the mobile node MUST be located on the link identified by the network prefix of this care-of address ๐Ÿ“ Otherwise, datagrams sent to the care-of address would be undeliverable ๐Ÿ˜ฑ

For example, Figure 1 shows how datagrams get routed to and from a mobile node that's away from home, once it's registered with its home agent โœˆ๏ธ In Figure 1, the mobile node is using a foreign agent care-of address, not a co-located care-of address ๐ŸŒท

1.8. Message Format and Protocol Extensibility โœจ

okay so Mobile IP has its own brand-new control messages ๐Ÿ’… They get sent over UDP [17] using well-known port number 434 ๐ŸŽ€ The two message types defined in this doc are:

1 Registration Request

3 Registration Reply

Up-to-date values for the Mobile IP control message types live in the IANA online database [48] ๐ŸŒธ

For Agent Discovery, Mobile IP is lowkey borrowing the Router Advertisement and Router Solicitation messages that already exist for ICMP Router Discovery [5] ๐Ÿซถ

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. Some extensions are encoded in the simple Type-Length-Value format from Section 1.9 ๐Ÿงš

Extensions let each datagram carry a variable amount of info. The end of the extension list is marked by the total length of the IP datagram ๐Ÿ’œ

Mobile IP keeps two separately maintained numbering spaces for Extension Type values ๐Ÿฆ‹

  • The first set is for Extensions that may appear in Mobile IP control messages (the ones sent to and from UDP port number 434). This doc defines these types for that set:
  0  One-byte Padding (encoded with neither Length nor Data field)
 32 Mobile-Home Authentication
 33 Mobile-Foreign Authentication
 34 Foreign-Home Authentication
  • The second set is for Extensions that may appear in ICMP Router Discovery messages [5]. This doc defines these types for that set:
  0  One-byte Padding (encoded with neither Length nor Data field)
 16 Mobility Agent Advertisement
 19 Prefix-Lengths

Each individual Extension gets its own section later in the doc, and up-to-date values for these Extension Type numbers are in the IANA online database [48] ๐Ÿ’–

Because the two sets are orthogonal (completely separate), two Extensions defined later on could end up with identical Type values, as long as one is only used in Mobile IP control messages and the other is only used in ICMP Router Discovery messages โœจ

The Type field in the Mobile IP extension structure can support up to 255 uniquely identifiable extensions, both skippable and non-skippable. When an Extension numbered 0 through 127 in either of these sets is encountered but not recognized, the message containing that Extension MUST be silently discarded. When an Extension numbered 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.

๐Ÿšจ bestie, the 0 to 127 versus 128 to 255 split is the whole game here. Lower numbers get the whole message tossed, higher numbers just get skipped.

Unless additional structure is used for the extension types, new developments or additions to Mobile IP might need so many new extensions that the space for extension types runs out. Two new extension structures are proposed to solve this problem ๐Ÿ‘‘ Certain types of extensions can be aggregated, using subtypes to identify the precise extension, like the Generic Authentication Keys extensions [46] do. In many cases this may reduce the rate at which new values of the Type field get allocated.

Since the new extension structures make efficient use of the extension type space, it is recommended that new Mobile IP extensions follow one of the two new extension formats whenever there is a possibility of grouping related extensions together โœจ

The following subsections describe three distinct structures for Mobile IP extensions:

  • The simple extension format
  • The long extension format
  • The short extension format

1.9. Type-Length-Value Extension Format for Mobile IP Extensions ๐ŸŽ€

The Type-Length-Value format shown in Figure 2 is used for the extensions specified in this document. This simple extension structure doesn't encourage the most efficient use of the extension type space, so it is recommended that new Mobile IP extensions follow one of the two new extension formats in Section 1.10 or Section 1.11 whenever there may be a possibility of grouping related extensions together ๐Ÿซถ

           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 ...
          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

   Figure 2:  Type-Length-Value Extension Format for Mobile IPv4

Here's what each field does:

  • Type indicates the particular type of Extension.
  • Length indicates the length (in bytes) of the Data field within this Extension. The length does NOT include the Type and Length bytes.
  • Data is 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 are determined by the Type and Length fields.

1.10. Long Extension Format ๐ŸŒˆ

This format is applicable for non-skippable extensions that carry more than 256 bytes of information. Skippable extensions can never use the long format, because the receiver is not required to include parsing code and is likely to treat the 8 bits immediately following the Type as the Length field ๐Ÿ™ˆ

 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      |  Sub-Type     |           Length              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           Data      .....
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

The Long Extension format requires that the following fields be specified as the first fields of the extension:

  • Type is the type, which describes a collection of extensions having a common data type.
  • Sub-Type is a unique number given to each member in the aggregated type.
  • Length indicates the length (in bytes) of the Data field within this Extension. It does NOT include the Type, Length, and Sub-Type bytes.
  • Data is the data associated with the subtype of this extension. This specification does not place any additional structure on the subtype data.

Since the Length field is 16 bits wide, the extension data can exceed 256 bytes in length ๐Ÿ’…


1.11. Short Extension Format ๐Ÿฆ‹

This format is compatible with the skippable extensions defined in Section 1.9. It is not applicable for extensions that require more than 256 bytes of data. For those extensions, use the format described in Section 1.10 ๐Ÿ“

 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      |    Sub-Type   |    Data ....
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

The Short Extension format requires that the following fields be specified as the first fields of the extension:

  • Type is the type, which describes a collection of extensions having a common data type.
  • Sub-Type is a unique number given to each member in the aggregated type.
  • Length is an 8-bit unsigned integer. It is the length of the extension, in bytes, excluding the extension Type and the extension Length fields. This field MUST be set to 1 plus the total length of the Data field.
  • Data is the data associated with this extension. This specification does not place any additional structure on the subtype data.

2. Agent Discovery โœจ

Agent Discovery is the method by which a mobile node figures out whether it's currently connected to its home network or to a foreign network, and by which a mobile node can detect 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 being offered by each foreign agent on that network ๐Ÿ’œ

Mobile IP extends ICMP Router Discovery [5] as its primary 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 Time to Live (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 to cooperate and realize Agent Discovery ๐Ÿงš

Agent Advertisement and Agent Solicitation may not be necessary for link layers that already provide this functionality. The method by which mobile nodes establish link-layer connections with prospective agents is outside the scope of this document (but see Appendix A). The procedures described below assume that such link-layer connectivity has already been established ๐ŸŒธ

No authentication is required for Agent Advertisement and Agent Solicitation messages. They MAY be authenticated using the IP Authentication Header [9], which is unrelated to the messages described in this document. Further specification of the way in which Advertisement and Solicitation messages may be authenticated is outside of the scope of this document ๐Ÿ”ฅ

2.1. Agent Advertisement ๐Ÿ“ฃ

okay so Agent Advertisements are how a mobility agent yells "hey, I'm here, come register!" on a link ๐Ÿ“ฃ. Mobile nodes use them to figure out where they're currently plugged into the Internet ๐ŸŒธ. An Agent Advertisement is basically an ICMP Router Advertisement that got a glow-up: it also carries 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, the ICMP Router Advertisement fields are required to conform to these extra rules:

  • 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 [5], the IP Destination Address of a multicast Agent Advertisement MUST be either the "all systems on this link" multicast address (224.0.0.1) [6] 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. When the Agent Advertisement is unicast to a mobile node, the IP home address of the mobile node SHOULD be used as the Destination Address.
  • ICMP Fields ๐Ÿงพ
    • Code: The Code field of the Agent Advertisement is interpreted as follows (it's giving mood ring ๐Ÿ”ฎ):
      • 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.

If these are sent periodically, the nominal interval between Agent Advertisements SHOULD be no longer than 1/3 of the advertisement Lifetime given in the ICMP header. This interval MAY be shorter than 1/3 of the advertised Lifetime. This lets a mobile node 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 [5], so agents don't synchronize and collide with other Agent Advertisements (or with other Router Advertisements sent by other routers) ๐ŸŽ€. Note that this field has no relation to the "Registration Lifetime" field within the Mobility Agent Advertisement Extension defined below.

2.1.1. Mobility Agent Advertisement Extension โœจ

The Mobility Agent Advertisement Extension follows the ICMP Router Advertisement fields. It's how we say "this ICMP Router Advertisement is also an Agent Advertisement from a mobility agent" ๐Ÿฆ‹. Here's what it looks like:

     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|r|T|U|X|I|reserved |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                  zero or more Care-of Addresses               |
    |                              ...                              |
  • Type: 16
  • Length: (6 + 4*N), where 6 accounts for the number of bytes in the Sequence Number, Registration Lifetime, flags, and reserved fields, and N is the number of care-of addresses advertised.
  • Sequence Number: The count of Agent Advertisement messages sent since the agent was initialized (Section 2.3.2).
  • Registration Lifetime: The longest lifetime (measured in seconds) that this agent is willing to accept in any Registration Request. A value of 0xffff indicates infinity. This field has no relation to the "Lifetime" field within the ICMP Router Advertisement portion of the Agent Advertisement.
  • R: Registration required. Registration with this foreign agent (or another foreign agent on this link) is required even when using a co-located care-of address.
  • B: Busy. The foreign agent will not accept registrations from additional mobile nodes.
  • H: Home agent. This agent offers service as a home agent on the link on which this Agent Advertisement message is sent.
  • F: Foreign agent. This agent offers service as a foreign agent on the link on which this Agent Advertisement message is sent.
  • M: Minimal encapsulation. This agent implements receiving tunneled datagrams that use minimal encapsulation [15].
  • G: Generic Routing Encapsulation (GRE) encapsulation. This agent implements receiving tunneled datagrams that use GRE encapsulation [13].
  • r: Sent as zero; ignored on reception. SHOULD NOT be allocated for any other uses.
  • T: Foreign agent supports reverse tunneling as specified in [12].
  • U: Mobility agent supports UDP Tunneling as specified in [27].
  • X: Mobility agent supports Registration Revocation as specified in [28].
  • I: Foreign agent supports Regional Registration as specified in [29].
  • reserved: Sent as zero; ignored on reception.
  • Care-of Address(es): The advertised foreign agent care-of address(es) provided by this foreign agent. 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.

A home agent MUST always be prepared to serve the mobile nodes for which it is the home agent ๐Ÿ . A foreign agent may at times be too busy to serve additional mobile nodes. Even so, it has to keep sending Agent Advertisements, so mobile nodes that are already registered with it know they haven't drifted out of range and that the foreign agent hasn't failed ๐Ÿ˜ญ. A foreign agent may 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. Furthermore, 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 acquired a co-located care-of address, it sets the 'R' bit to one. Because this bit only applies to foreign agents, 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. Heads up, though: 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 |      ....
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  • Type: 19 (Prefix-Lengths Extension)
  • Length: N, where N is the value (possibly zero) of the Num Addrs field in the ICMP Router Advertisement portion of the Agent Advertisement.
  • Prefix Length(s): The number of leading bits that define the network number of the corresponding router address listed in the ICMP Router Advertisement portion of the message. The prefix length for each router address is encoded as a separate byte, in the order that the router addresses are listed in the ICMP Router Advertisement portion of the message.

See Section 2.4.2 for info on how a mobile node MAY use the Prefix-Lengths Extension when figuring out whether it has moved ๐Ÿงญ. See Appendix D for implementation details about using this Extension.

2.1.3. One-Byte Padding Extension ๐Ÿซง

Some IP protocol implementations insist on padding ICMP messages to an even number of bytes. If the ICMP length of an Agent Advertisement is odd, this Extension MAY be included to make the ICMP length even. This Extension is NOT intended as a general-purpose Extension for word- or long-aligning the fields of the Agent Advertisement, so don't go using it for that ๐Ÿ™…โ€โ™€๏ธ. 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 other Extensions used in Mobile IP, the One-byte Padding Extension is encoded as a single byte, with no Length or Data field present. Here's how it's defined:

     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 the further restriction that the IP TTL Field MUST be set to 1. โœจ

2.3. Foreign Agent and Home Agent Considerations โœจ

Okay bestie, this section is about who has to shout about themselves and who gets to be quiet ๐Ÿคซ๐Ÿ’…. Any mobility agent that can't be found by a link-layer protocol MUST send Agent Advertisements ๐Ÿ“ฃ. If an agent can be found by a link-layer protocol, it SHOULD also implement Agent Advertisements, which is the responsible thing to do ๐Ÿซถ.

Advertisements don't have to go out all the time though ๐Ÿ™ˆ. They only need to be sent when the site policy says mobile nodes have to register with the agent (that's when the 'R' bit is set), or when someone specifically asks with an Agent Solicitation. All mobility agents MUST process packets addressed to the Mobile-Agents multicast group at 224.0.0.11 ๐Ÿ’–. A mobile node MAY send an Agent Solicitation to 224.0.0.11, and all mobility agents SHOULD respond to Agent Solicitations, because being rude is not it ๐Ÿ’….

The same procedures, defaults, and constants are used for Agent Advertisement and Agent Solicitation messages as for ICMP Router Discovery [5], with a couple of twists ๐Ÿฆ‹:

  • A mobility agent MUST limit how fast it sends broadcast or multicast Agent Advertisements. The maximum rate SHOULD be picked so the Advertisements don't eat a significant chunk of network bandwidth, AND
  • A mobility agent that receives a Router Solicitation MUST NOT require that the IP Source Address is the address of a neighbor. Here a neighbor means an address that matches one of the router's own addresses on the arrival interface, under the subnet mask linked to 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 on the link identified by the mobile node's home address ๐Ÿ . Agent Advertisements the home agent sends on this link MUST have the 'H' bit set, and that's how mobile nodes on their own home network can tell they're actually home ๐Ÿฅน. Any Agent Advertisements the home agent sends on another link it's 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 acts as a home agent for other mobile nodes on that other link ๐Ÿ‘‘. A mobility agent MAY use different settings for the 'R', 'H', and 'F' bits on different network interfaces ๐ŸŒˆ.

If the home network is a virtual network, it has no physical existence outside the home agent itself ๐Ÿ‘ป. So there's no physical link to send Agent Advertisements on to advertise the home agent. 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 it ๐ŸŽ€. Mixing it up (some agents including it, others not) is prohibited, no cap ๐Ÿšซ. 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. An agent SHOULD only put its own addresses, if it has any, in the advertisement ๐Ÿ’œ. Whether or not its own address shows up in the router addresses, a foreign agent MUST route datagrams it receives from registered mobile nodes (Section 3.7) ๐Ÿš—.

2.3.2. Sequence Numbers and Rollover Handling ๐Ÿ”ข

The sequence number in Agent Advertisements goes from 0 to 0xffff ๐Ÿ“. After booting, an agent MUST use the number 0 for its first advertisement. Each advertisement after that MUST use the sequence number one greater, with one exception: 0xffff MUST be followed by sequence number 256 โœจ. This is how mobile nodes can tell the difference between a drop in the sequence number caused by a reboot and a drop caused by rollover 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 and when a care-of address hasn't been figured out through a link-layer protocol or some other means ๐Ÿ”. The mobile node uses the same procedures, defaults, and constants for Agent Solicitation as for ICMP Router Solicitation messages [5], except 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 ๐Ÿšฆ. The mobile node 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 a binary exponential backoff, doubling the interval between consecutive solicitations, up to a maximum interval ๐Ÿ“ˆ. The maximum interval SHOULD be picked based on the characteristics of the media the mobile node is soliciting over. That maximum interval SHOULD be at least one minute between solicitations โฐ.

While still searching for an agent, the mobile node MUST NOT increase how often 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 its solicitation rate when it next starts searching for a new agent to register with. That increased rate MAY go back to the maximum rate, but then it MUST be limited the way described above ๐ŸŽข. In every case, the recommended solicitation intervals are nominal values. Mobile nodes MUST randomize their solicitation times around these nominal values, as specified for ICMP Router Discovery [5] ๐ŸŽฒ.

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, that's what identifies the advertisement as an Agent Advertisement ๐Ÿช„.

If more than one address is advertised, the mobile node SHOULD pick the first address for its initial registration attempt 1๏ธโƒฃ. If that registration fails with a status code showing the foreign agent rejected it, the mobile node MAY retry with each later advertised address, one at a time ๐Ÿ”.

When more than one agent discovery method is in use, the mobile node SHOULD first try registering with agents whose advertisements include Mobility Agent Advertisement Extensions, instead of agents found some other way ๐ŸŒŸ. That preference makes it more likely the registration gets recognized, so there are fewer attempts overall ๐ŸŽฏ.

A mobile node MUST ignore reserved bits in Agent Advertisements, rather than throwing those advertisements away ๐Ÿ™Œ. That way, new bits can be defined later without messing up mobile nodes that use the advertisements and don't understand the newly defined bits ๐Ÿ’ซ.

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 is meant to let sites enforce visiting policies (like accounting) that need authorization exchanges ๐Ÿ“’.

If formerly reserved bits need some kind of monitoring or enforcement on the foreign link, foreign agents that implement the new specification for those bits can set the 'R' bit ๐Ÿ”. That forces the mobile node to register through the foreign agent, so the foreign agent can monitor or enforce the policy ๐Ÿ‘€.

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 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 another agent whose Lifetime field hasn't expired yet, the mobile node MAY immediately try registering 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 in on 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 right now, it SHOULD NOT use this method unless both the current agent and the new agent include the Prefix-Lengths Extension in their Agent Advertisements. If that 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 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 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's back on its home network when it receives an Agent Advertisement from its own home agent ๐Ÿฅณ. If so, it SHOULD deregister with its home agent (Section 3) ๐Ÿ‘‹. Before trying to deregister, the mobile node SHOULD set up its routing table properly 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 about ARP, proxy ARP, and gratuitous ARP ๐Ÿ“ข. Slay ๐Ÿ’…โœจ

2.4.4. Sequence Numbers and Rollover Handling โœจ

Okay so bestie, if a mobile node spots two successive sequence numbers in the Agent Advertisements from the foreign agent it's registered with, and the second one is smaller than the first AND sits inside the 0 to 255 range, it SHOULD register again. ๐Ÿ”„

But if the second value is less than the first and is greater than or equal to 256, the mobile node SHOULD assume the sequence number rolled over past its max (0xffff) ๐ŸŒˆ. So no re-registration needed, and that's the whole plot twist! (Section 2.3) ๐Ÿ’…

3. Registration ๐ŸŽ€

Mobile IP registration is the flexible little mechanism mobile nodes use to tell their home agent where they currently are ๐Ÿ“. It's basically how a mobile node:

  • requests forwarding services when visiting a foreign network,
  • informs its home agent of its current care-of address,
  • renews a registration that's about to expire, and/or
  • deregisters when it gets back home ๐Ÿ 

Registration messages swap info between a mobile node, (optionally) a foreign agent, and the home agent ๐Ÿงš. Registration creates or modifies a mobility binding at the home agent, linking the mobile node's home address to its care-of address for the specified Lifetime ๐Ÿ’œ.

There are also some optional extras you can do through registration, so a mobile node can:

  • discover its home address, if it isn't configured with that info,
  • maintain multiple simultaneous registrations, so a copy of each datagram gets tunneled to each active care-of address,
  • deregister specific care-of addresses while keeping other mobility bindings, and
  • discover the address of a home agent if it isn't configured with that info ๐Ÿฆ‹

3.1. Registration Overview ๐ŸŒธ

Mobile IP has two registration procedures: one through a foreign agent that relays it to the home agent, and one straight to the home agent ๐Ÿ‘€. These rules decide which one to use:

  • 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 receives an Agent Advertisement from a foreign agent on the link on which it is using this care-of address, the mobile node SHOULD register via that foreign agent (or via another foreign agent on this link) if the R bit 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 procedures involve Registration Request and Registration Reply messages (Section 3.3 and Section 3.4) ๐Ÿ“จ. When registering via a foreign agent, there are four messages:

a. The mobile node sends a Registration Request to the prospective foreign agent to begin 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 inform it of the disposition of its Request.

When the mobile node registers directly with its home agent, it's just 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 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. A zero UDP checksum SHOULD be accepted by the recipient. How the mobile node and home agent handle mutual acceptance of packets with zero UDP checksums SHOULD be defined as part of the Mobility Security Association that exists between them ๐Ÿ”.

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 the 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 an authorization-enabling extension, e.g., the Mobile-Home Authentication Extension (Section 3.5.2) ๐Ÿ’–. This extension MUST be the first authentication extension. Other foreign-agent-specific extensions MAY be added to the message after the mobile node computes the authentication โœจ.

3.3. Registration Request ๐Ÿ’Œ

A mobile node registers with its home agent using a Registration Request message, so the home agent can create or modify a mobility binding for it (e.g., with a new Lifetime) ๐ŸŒท. The foreign agent the mobile node is registering through may relay the Request to the home agent, or the mobile node may send it directly to the home agent when it's registering a co-located care-of address ๐ŸŽฏ.

IP fields:

  • Source Address: Typically the interface address from which the message is sent.
  • 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 shown below ๐Ÿงšโ€โ™€๏ธ:

     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|r|T|x|          Lifetime             |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                          Home Address                         |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                           Home Agent                          |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                        Care-of Address                        |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                                                               |
    +                         Identification                        +
    |                                                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | Extensions ...
    +-+-+-+-+-+-+-+-+-

The fields, bestie ๐Ÿ’œ:

  • Type: 1 (Registration Request)
  • S: Simultaneous bindings. If the S bit 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 B bit 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 D bit is set, the mobile node will itself decapsulate datagrams that 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 M bit is set, the mobile node requests that its home agent use minimal encapsulation [16] for datagrams tunneled to the mobile node ๐Ÿ“.
  • G: GRE encapsulation. If the G bit is set, the mobile node requests that its home agent use GRE encapsulation [13] for datagrams tunneled to the mobile node ๐Ÿซถ.
  • r: Sent as zero; ignored on reception. SHOULD NOT be allocated for any other uses ๐Ÿ™ˆ.
  • T: Reverse Tunneling requested; see [12] ๐Ÿ”.
  • x: Sent as zero; ignored on reception ๐ŸŒธ.
  • Lifetime: The number of seconds remaining before the registration is considered expired. A value of zero indicates a request for deregistration. A value of 0xffff indicates 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.7 ๐Ÿ›ก๏ธ.
  • Extensions: The fixed portion of the Registration Request is followed by one or more of the Extensions listed in Section 3.5. An authorization-enabling 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 usually sends back a Registration Reply to a mobile node that sent it a Registration Request, bestie ๐Ÿ’Œ If the mobile node is asking a foreign agent for service, that foreign agent will typically get the Reply from the home agent and then pass it along to the mobile node. The Reply has the codes that tell the mobile node how its Request went, plus the lifetime the home agent actually granted, which MAY be smaller than the original Request. Main character energy, the home agent gets the final say ๐Ÿ‘‘

The foreign agent MUST NOT increase the Lifetime the mobile node picked in the Registration Request ๐Ÿ™…โ€โ™€๏ธ The reason is that the Lifetime is covered by an authentication extension that lets the home agent authorize things, and that extension holds authentication data the foreign agent can't correctly (re)compute. The home agent MUST NOT increase the Lifetime the mobile node picked either, because that could push it past the maximum Registration Lifetime the foreign agent allows ๐Ÿ’€ If the Lifetime in the Registration Reply is greater than the one in the Registration Request, the Lifetime in the Request MUST be used. And if the Lifetime in the Reply is less than the one in the Request, the Lifetime in the Reply MUST be used. Tiny rules, huge vibes ๐Ÿซถ

IP fields:

  • Source Address: Usually copied from the Destination Address of the Registration Request the agent is replying to. See Sections 3.7.2.3 and 3.8.3.2 for the full details ๐Ÿฆ‹
  • Destination Address: Copied from the source address of the Registration Request the agent is replying to.

UDP fields:

  • Source Port: Copied from the UDP Destination Port of the matching Registration Request.
  • Destination Port: Copied from the source port of the matching Registration Request (Section 3.7.1).

After the UDP header come the Mobile IP fields, and 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      |     Code      |           Lifetime            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                          Home Address                         |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                           Home Agent                          |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                                                               |
    +                         Identification                        +
    |                                                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | Extensions ...
    +-+-+-+-+-+-+-+-+-+-

Here's what each field does โœจ

  • Type: 3 (Registration Reply)
  • Code: A value showing the result of the Registration Request. The list of currently defined code values is below ๐Ÿ’…
  • Lifetime: If the Code field says the registration was accepted, the Lifetime field holds the number of seconds left before the registration counts as expired. A value of zero means the mobile node has been deregistered, and a value of 0xffff means infinity โ™พ๏ธ If the Code field says 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 to match Registration Requests with Registration Replies, and to protect against replay attacks of registration messages ๐Ÿ” The value is based on the Identification field from the mobile node's Registration Request, and on the style of replay protection used in the security context between the mobile node and its home agent. That style is defined by the Mobility Security Association between them, plus the SPI value in the authorization-enabling extension. See Sections 5.4 and 5.7.
  • Extensions: The fixed part of the Registration Reply is followed by one or more of the Extensions listed in Section 3.5. An authorization-enabling 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 the rules on where extensions go in Reply messages.

These are the values defined for the Code field ๐ŸŒˆ

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  reserved and unavailable
77  invalid care-of address
78  registration timeout
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)
194 Invalid Home Agent Address

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 in the IANA online database [48] ๐Ÿฆ‹


3.5. Registration Extensions ๐ŸŒธ

3.5.1. Computing Authentication Extension Values

The Authenticator value computed for each authentication Extension MUST protect the following fields from the registration message ๐Ÿ”’

  • the UDP payload (that is, the Registration Request or Registration Reply data),
  • all prior Extensions in their entirety, and
  • the Type, Length, and SPI of this Extension.

The default authentication algorithm uses HMAC-MD5 [10] to compute a 128-bit "message digest" of the registration message ๐Ÿ’œ The data the HMAC is computed over is defined as:

  • the UDP payload (that is, the Registration Request or Registration Reply data),
  • all prior Extensions in their entirety, and
  • the Type, Length, and SPI of this Extension.

Note that the Authenticator field itself and the UDP header are NOT included in the computation of the default Authenticator value ๐Ÿ™ˆ See Section 5.1 for information about support requirements for message authentication codes, which are to be used with the various authentication Extensions.

The Security Parameter Index (SPI) within any of the authentication Extensions defines the security context used to compute the Authenticator value, and it MUST be used by the receiver to check that value. Basically, the SPI picks the authentication algorithm and mode (Section 5.1) and the secret (a shared key, or an appropriate public/private key pair) used to compute the Authenticator ๐Ÿ—๏ธ For interoperability between different implementations of the Mobile IP protocol, an implementation MUST be able to associate any SPI value with any authentication algorithm and mode that it implements. On top of that, all implementations of Mobile IP MUST implement the default authentication algorithm (HMAC-MD5) specified above ๐Ÿ’…

3.5.2. Mobile-Home Authentication Extension

At least one authorization-enabling extension MUST be present in all Registration Requests, and also in all Registration Replies generated by the home agent ๐Ÿ›ก๏ธ The Mobile-Home Authentication Extension is always an authorization-enabling extension for the registration messages specified in this document. This requirement is meant to get rid of problems [30] caused by remote redirects spreading uncontrolled across the Internet. The location of the authorization-enabling extension marks the end of the data that the authorizing agent interpreting that extension has to authenticate.

     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: 32
  • Length: 4 plus the number of bytes in the Authenticator.
  • SPI: Security Parameter Index (4 bytes). 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 in cases where a Mobility Security Association exists between the mobile node and the foreign agent ๐Ÿฆ‹ See Section 5.1 for information about support requirements for message authentication codes.

     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: 33
  • Length: 4 plus the number of bytes in the Authenticator.
  • SPI: Security Parameter Index (4 bytes). An opaque identifier (see Section 1.6).
  • Authenticator: (variable length) (See Section 3.5.1.)

3.5.4. Foreign-Home Authentication Extension โœจ

okay so this extension MAY be included in Registration Requests and Replies ๐Ÿซถ when a Mobility Security Association exists between the foreign agent and the home agent. the catch is that the Registration Request can't be a deregistration (aka the mobile node asked for a nonzero Lifetime and the home address is different from the care-of address) ๐Ÿฆ‹ the Foreign-Home Authentication extension MUST NOT be applied to deregistration messages, no exceptions bestie ๐Ÿ’… and for message authentication code support requirements, check out 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 ...
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

here's the breakdown ๐Ÿงš

  • Type is 34 ๐ŸŒธ
  • Length is 4 plus the number of bytes in the Authenticator ๐Ÿ“
  • SPI is the Security Parameter Index, 4 bytes long. it's an opaque identifier (see Section 1.6) ๐Ÿ”ฅ
  • Authenticator is variable length (see Section 3.5.1) โœจ

so the home agent and the foreign agent are both configured with a Mobility Security Association indexed by the SPI (from the appended Foreign-Home Authentication Extension) and the IP Source Address of the Registration Request ๐ŸŽ€ when this extension shows up in a Registration Reply, the foreign agent address MUST be used as the Destination IP Address in the IP header. main character energy ๐Ÿ‘‘

when the extension is on a Registration Request, the home agent picks the right Mobility Security Association to verify the auth data based on the Source IP Address field of the Registration Request and the SPI of the Authentication extension ๐Ÿ’– the Source IP Address will match the Care-of Address field of the Registration Request (see Section 3.7.2.2) ๐Ÿฆ‹

when it's on a Registration Reply, the foreign agent picks the Mobility Security Association based on the home agent Address field of the Registration Reply ๐Ÿซถ

โš ๏ธ heads up: if the Care-of Address in the Registration Request isn't in the Agent Advertisement, the foreign agent MUST NOT append the Foreign-Home Authentication Extension when relaying the message to the home agent. same deal for a deregistration (Lifetime = 0): the foreign agent MUST NOT append the Foreign-Home Authentication Extension when relaying it to the home agent ๐Ÿ’€ which means when the home agent (HA) gets a deregistration request with no Foreign-Home Authentication Extension, it MUST NOT discard the request for that reason as part of security association processing ๐Ÿ˜ญ

3.6. Mobile Node Considerations ๐Ÿ“ฑ

okay now for the mobile node side ๐ŸŒˆ a mobile node MUST be configured (statically or dynamically) with a netmask and a Mobility Security Association for each of its home agents. it MAY also be configured with its home address and the IP address of one or more home agents ๐Ÿ’œ otherwise, it MAY discover a home agent using the procedures in Section 3.6.1.2 ๐Ÿ”

if the mobile node doesn't have a home address configured, it MAY use the Mobile Node Network Access Identifier (NAI) extension [2] to identify itself, and set the Home Address field of the Registration Request to 0.0.0.0 ๐Ÿ™ˆ in that case, the mobile node MUST be able to assign its home address after pulling that info out of the Registration Reply from the home agent โœจ

for every pending registration, the mobile node keeps track of these things ๐Ÿ“

  • the link-layer address of the foreign agent the Registration Request was sent to, if applicable
  • 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
  • the remaining Lifetime of the pending registration

a mobile node SHOULD start a registration whenever it notices a change in its network connectivity. see Section 2.4.2 for ways a mobile node MAY figure that out ๐Ÿฆ‹ when it's away from home, the Registration Request lets the home agent create or modify a mobility binding for it ๐ŸŒธ when it's back home, the (de)Registration Request lets the home agent delete any previous mobility binding(s) for it ๐Ÿ  and at home, a mobile node operates without mobility functions support ๐Ÿ’…

there are other situations where the mobile node SHOULD (re)register with its foreign agent ๐Ÿ”„ like when it notices the foreign agent has rebooted (as specified in Section 2.4.4) or when its current registration's Lifetime is almost up โฐ

without link-layer hints about a change in point of attachment, Agent Advertisements from new agents SHOULD NOT trigger a new registration if the current registration hasn't expired and the mobile node is still getting Agent Advertisements from the foreign agent it's currently registered with ๐Ÿซถ and without 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 ๐Ÿ™…โ€โ™€๏ธ within those limits, the mobile node MAY register again at any time ๐Ÿ’–

Appendix C has examples of how the fields in registration messages get set up in typical registration scenarios ๐Ÿ“š

3.6.1. Sending Registration Requests ๐ŸŽ€

these sections spell out the values the mobile node MUST supply in the fields of Registration Request messages ๐Ÿ‘‘

3.6.1.1. IP Fields ๐ŸŒ

this section has the specific rules for how mobile nodes pick values for the IP header fields 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 ๐Ÿก
  • otherwise, if the mobile node doesn't have a home address, the IP source address MUST be 0.0.0.0 ๐Ÿซ 
  • in all other circumstances, 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 (e.g., link-layer) that doesn't give 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 to deliver the datagram to the correct agent ๐ŸŽฏ
  • when registering with a foreign agent, the address of the agent learned from the IP source address of the corresponding Agent Advertisement MUST be used ๐ŸŒธ this MAY be an address that does not show up as an advertised care-of address in the Agent Advertisement ๐Ÿฆ‹ also, when sending this Registration Request message, the mobile node MUST use a link-layer Destination Address copied from the link-layer source address of the Agent Advertisement message where it learned this foreign agent's IP address ๐Ÿ”—
  • when the mobile node registers directly with its home agent and knows the (unicast) IP address of its home agent, the Destination Address MUST be set to that address ๐Ÿ 
  • if the mobile node registers directly with its home agent but doesn't know the IP address of its home agent, the mobile node may use dynamic home agent address resolution to automatically find the IP address of its home agent (Section 3.6.1.2) ๐Ÿ”Ž in this 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, although 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 accordance with standard IP practice [18] ๐Ÿซถ

3.6.1.2. Registration Request Fields โœจ

This section is basically the cheat sheet for how a mobile node fills in the fixed part of a Registration Request. Let's go, bestie ๐Ÿซถ

A mobile node MAY set the 'S' bit to ask its home agent to keep the older mobility binding(s) around. If it doesn't, the home agent deletes any previous binding(s) and replaces them with the new binding from the Registration Request. Keeping several bindings at once is super useful when a mobile node with at least one wireless interface wanders into range of more than one foreign agent ๐Ÿ“ก. IP explicitly allows datagrams to be duplicated ๐Ÿ‘€. So when the home agent allows simultaneous bindings, it tunnels a separate copy of each arriving datagram to each care-of address, and the mobile node ends up getting multiple copies of anything addressed to it. Iconic, right? ๐Ÿ’…

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 broadcast datagrams it 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 Registration Request ๐Ÿฆ‹

  • If the 'D' bit is set, the mobile node is saying it will decapsulate any datagrams tunneled to this care-of address itself (it's using a co-located care-of address). So to forward a broadcast datagram, the home agent MUST tunnel it to this care-of address. The mobile node detunnels it the same way as 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. In that case, 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 was meant to go, and it gets delivered to the mobile node just like any other tunneled datagram arriving for it ๐Ÿงš 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, which means it MUST NOT set the 'B' bit in its Registration Request in this case unless it can decapsulate datagrams ๐Ÿ˜ญ

The mobile node MAY ask for 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 signaled support for those forms 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 Lifetime SHOULD NOT exceed the value in the Registration Lifetime field of the Agent Advertisement message received from that foreign agent. When the way the care-of address was learned 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 and the Lifetime field set to zero (Section 3.8.2) ๐Ÿ—‘๏ธ
  • Similarly, a Lifetime of zero is used when the mobile node deregisters all of its care-of addresses, such as when it gets back home ๐Ÿ 

The Home Address field MUST be set to the mobile node's home address, if that info is known. Otherwise, the Home Address field MUST be set to zeroes ๐Ÿ“

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 it. In that case, the mobile node MUST set the Home Agent field to the subnet-directed broadcast address of its home network. Each home agent that receives such a Registration Request with a broadcast Destination Address MUST reject the registration, and SHOULD send back a rejection Registration Reply that includes its unicast IP address, so the mobile node can use it 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 wants to (de)register. In the special case where the mobile node wants to deregister all care-of addresses, it MUST set this field to its home address ๐Ÿ’œ

The mobile node picks the Identification field based on the style of replay protection it uses with its home agent. This is part of the Mobility Security Association the mobile node shares with that home agent. See Section 5.7 for how the mobile node computes the Identification field ๐Ÿ”

3.6.1.3. Extensions ๐ŸŽ€

This section describes the order of any mandatory and optional Extensions that a mobile node appends to a Registration Request. This ordering is REQUIRED ๐Ÿ“‹:

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 or other authorizing agent (which may or may not also be useful to the foreign agent), followed by

c. All authorization-enabling extensions (see Section 1.6), 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. However, item (e) MUST be included when the mobile node and the foreign agent share a Mobility Security Association ๐Ÿซถ

3.6.2. Receiving Registration Replies ๐Ÿ’Œ

Registration Replies will be received by the mobile node in response to its Registration Requests. They 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 Registration Replies 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.

In addition, 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 do not match, the Reply MUST be silently discarded ๐Ÿ™…โ€โ™€๏ธ

Also, the Registration Reply MUST be checked for the presence of an authorization-enabling extension. For all Registration Reply messages containing a status code that indicates status from the home agent, the mobile node MUST check for the presence of an authorization-enabling extension, acting in accordance with the Code field in the Reply. The rules are as follows:

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 if more than one is found, or if 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 the Registration Reply was generated by the home agent but no Mobile-Home Authentication Extension is found, or if more than one is found, or if 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, either at the foreign agent or the home agent, then it's quite possible that any authenticators in the Registration Reply will also be in error ๐Ÿ˜ฌ This could happen, for example, if the shared secret between the mobile node and home agent was configured incorrectly. The mobile node SHOULD log such errors as security exceptions ๐Ÿ“

3.6.2.2. Registration Request Accepted ๐Ÿฅณ

If the Code field indicates that the request has been accepted, the mobile node SHOULD configure its routing table appropriately 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 described in Section 4.6 with regard to ARP, proxy ARP, and gratuitous ARP ๐Ÿงน

If the mobile node has registered on a foreign network, it SHOULD re-register before the 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 is equivalent to the mobile node starting a timer for the granted Lifetime at the time it sent the Registration Request, even though the granted Lifetime isn't known to the mobile node until the Registration Reply arrives. Since the Registration Request is certainly sent before the home agent starts timing the registration Lifetime (also based on the granted Lifetime), this procedure makes sure the mobile node re-registers before the home agent expires and deletes the registration, even with possibly non-negligible transmission delays for the original Registration Request and Reply that started the timing at the mobile node and its home agent โฐโœจ

Part 10 of 22 complete, bestie! ๐ŸŒˆ๐Ÿ’–

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 ๐Ÿ“. the vibe is that in some cases the mobile node may be able to "repair" the error and get back on track ๐Ÿ”ง. here are the ones that can be fixed:

Code 69: (Denied by foreign agent, requested Lifetime too long) โณ

Here the Lifetime field in the Registration Reply tells you the maximum Lifetime the 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 Registration Request that MUST be less than or equal to the value specified in the Reply ๐Ÿ’….

Code 133: (Denied by home agent, registration Identification mismatch) ๐Ÿ™ˆ

This one's giving desync energy ๐Ÿ˜ญ. The Identification field in the Registration Reply has a value that lets the mobile node sync back up with the home agent, based on the style of replay protection in effect (Section 5.7) ๐Ÿงฉ. The mobile node MUST adjust the parameters it uses to compute the Identification field based on the information in the Registration Reply, before sending any future Registration Requests ๐Ÿซถ.

Code 136: (Denied by home agent, unknown home agent address) ๐Ÿ—บ๏ธ

This code shows up when the mobile node is doing dynamic home agent address resolution, the way Sections 3.6.1.1 and 3.6.1.2 describe ๐Ÿ”. The Home Agent field in the Reply holds the unicast IP address of the home agent that sent the Reply ๐Ÿ“. The mobile node MAY then try to register with this home agent in future Registration Requests ๐Ÿ’–. On top of that, the mobile node SHOULD adjust the parameters it uses to compute the Identification field based on the corresponding field in the Registration Reply, before sending any future Registration Requests ๐ŸŽ€.


3.6.3. Registration Retransmission ๐Ÿ”

when no Registration Reply shows up within a reasonable time, another Registration Request MAY be sent ๐Ÿ“ฌ. if timestamps are being used, a new registration Identification gets picked for every retransmission, so it counts as a brand new registration ๐Ÿ†•. if nonces are being used, the unanswered Request gets resent exactly as it was, so the retransmission does not count as a new registration (Section 5.7) ๐Ÿง˜โ€โ™€๏ธ. this is the whole point: the home agent won't have to resync with the mobile node by issuing another nonce just because the original Registration 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 so the messages can be processed before a response goes out ๐Ÿงฎ. 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 the total round-trip time to the home agent ๐Ÿ›ฐ๏ธ. The minimum time between Registration Requests MUST NOT be less than 1 second ๐Ÿšซ. Each successive retransmission timeout period SHOULD be at least twice the previous period, as long as that is less than the maximum described above ๐Ÿ“ˆ.


3.7. Foreign Agent Considerations ๐Ÿก

the foreign agent has a mostly passive role in Mobile IP registration, honestly the quiet best friend ๐Ÿคซ. 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 the link layer can't already detect it ๐Ÿ“ฃ.

A foreign agent MUST NOT transmit a Registration Request, unless the request is being relayed 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 received from a mobile node in the case 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 message asking for deregistration of a mobile node ๐Ÿ™…โ€โ™€๏ธ. however, it MUST relay well-formed (de)Registration Requests that come from a mobile node ๐Ÿ’Œ.


3.7.1. Configuration and Registration Tables ๐Ÿ—‚๏ธ

Each foreign agent MUST be configured with a care-of address ๐Ÿ . on top of that, for each pending or current registration, the foreign agent MUST maintain a visitor list entry holding the following information 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) or its co-located care-of address (see the description of the 'R' bit in Section 2.1.1)
  • the IP Destination Address (as specified in Section 3.6.1.1)
  • 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

If there is an NAI extension in the Registration Request message (which often happens when the mobile node's Home Address is zero, for example) ๐Ÿชช, then the foreign agent MUST follow the procedures specified in RFC 2794 [2] ๐Ÿ“œ. specifically, if the foreign agent can't manage pending Registration Request records with such a zero Home Address for the mobile node, the foreign agent MUST return a Registration Reply with a code indicating NONZERO_HOMEADDR_REQD (see [2]) ๐Ÿ™…โ€โ™€๏ธ.

The foreign agent MAY configure a maximum number of pending registrations it's willing to maintain (typically 5) ๐Ÿ”ข. Additional registrations SHOULD then be rejected by the foreign agent with Code 66 ๐Ÿšช. The foreign agent MAY delete any pending Registration Request after the request has been pending for more than 7 seconds โฑ๏ธ; in that case, the foreign agent SHOULD reject the Request with Code 78 (registration timeout) โฐ.

As with any node on the Internet, a foreign agent MAY also share Mobility Security Associations with any other nodes ๐Ÿ”. when relaying a Registration Request from a mobile node to its home agent, if the foreign agent shares a Mobility Security Association with the home agent, it MUST add a Foreign-Home Authentication Extension to the Request ๐Ÿงพ. in this case, when the Registration Reply has a nonzero Lifetime, the foreign agent MUST check the required Foreign-Home Authentication Extension in the Registration Reply from the home agent (Sections 3.3 and 3.4) โœ…. similarly, when receiving a Registration Request from a mobile node, if the foreign agent shares a Mobility Security Association with the mobile node, it MUST check the required Mobile-Foreign Authentication Extension in the Request, and MUST add a Mobile-Foreign Authentication Extension to the Registration Reply to the mobile node ๐Ÿ’–.


3.7.2. Receiving Registration Requests ๐Ÿ“ฅ

If the foreign agent accepts a Registration Request from a mobile node, it checks that the indicated home agent address doesn't belong to any network interface of the foreign agent ๐Ÿ”Ž. if it doesn't, the foreign agent MUST 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 ๐Ÿ™…โ€โ™€๏ธ, except in cases where the foreign agent would have to send out more than one such denial per second to the same mobile node ๐Ÿซ . the following sections go into more detail on this behavior ๐Ÿ‘€.

If the foreign agent has configured one of its network interfaces with the IP address the mobile node specified as its home agent address, the foreign agent MUST NOT forward the Request again ๐Ÿ›‘. if the foreign agent serves the mobile node as a home agent, it follows the procedures specified in Section 3.8.2 ๐Ÿ . otherwise, if the foreign agent doesn't serve the mobile node as a home agent, it rejects the Registration Request with Code 194 (Invalid Home Agent Address) ๐Ÿ’€.

If a foreign agent receives a Registration Request from a mobile node that's already in its visitor list, the existing visitor list entry for the mobile node SHOULD NOT be deleted or modified until the foreign agent receives a valid Registration Reply from the home agent with a code indicating success ๐Ÿซถ. the foreign agent MUST record the new pending Request as a separate part of the existing visitor list entry for the mobile node ๐Ÿ—ƒ๏ธ. if the Registration Request asks for deregistration, the existing visitor list entry for the mobile node SHOULD NOT be deleted until the foreign agent has received a successful Registration Reply ๐Ÿฅน. if the Registration Reply says the Request (for registration or deregistration) was denied by the home agent, the existing visitor list entry for the mobile node MUST NOT be modified as a result of receiving that Registration Reply ๐Ÿ”’.

3.7.2.1. Validity Checks ๐Ÿ•ต๏ธโ€โ™€๏ธ

Registration Requests with an invalid, non-zero UDP checksum MUST be silently discarded ๐Ÿ—‘๏ธ. Requests with non-zero bits in reserved fields MUST be rejected with Code 70 (poorly formed Request) ๐Ÿ™…โ€โ™€๏ธ. Requests with the 'D' bit set to 0, a nonzero Lifetime, and a care-of address not offered by the foreign agent MUST be rejected with Code 77 (invalid care-of address) ๐Ÿšซ.

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 Registration Request, and the foreign agent MUST check the Authenticator value in that Extension ๐Ÿง. if no Mobile-Foreign Authentication Extension is found, or if more than one is found, or if 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 ๐Ÿฆ‹

Okay bestie, if the foreign agent says yes to the mobile node's Registration Request, it MUST relay it to the mobile node's home agent, the one named in the Home Agent field. The foreign agent MUST NOT modify any of the fields from the fixed portion of the Request through the Mobile-Home Authentication Extension, or through any other authentication extension the mobile node supplied as an authorization-enabling extension for the home agent. If it does, the home agent is very likely to hit an authentication failure, and nobody wants that ๐Ÿ’€. The foreign agent also does the following:

  • It MUST process and remove any extensions that do not precede any authorization-enabling extension,
  • It MAY append any of its own non-authentication Extensions of relevance to the home agent, if applicable, and
  • If the foreign agent shares a Mobility Security Association with the home agent, and the Request has Lifetime != 0, then it MUST append the Foreign-Home Authentication Extension.

Specific fields within the IP header and the UDP header of the relayed Registration Request MUST be set as follows:

  • IP Source Address: The care-of address offered by the foreign agent for the mobile node sending the Registration Request.
  • 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 Registration Request. If this lifetime runs out before a valid Registration Reply shows up, the foreign agent MUST delete its visitor list entry for this pending registration. Timers, but make it iconic ๐Ÿ•ฐ๏ธโœจ

3.7.2.3. Denying Invalid Requests ๐Ÿšซ

If the foreign agent denies the mobile node's Registration Request for 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 Registration Reply get copied from the matching fields in the Registration Request. Clean and consistent, no drama ๐Ÿ’…

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 being denied because the requested Lifetime is too long, the foreign agent sets the Lifetime in the Reply to the maximum Lifetime value it is 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 the 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: If the Registration Reply is generated by the foreign agent in order to reject a mobile node's Registration Request, and the Registration Request contains a Home Address that is not 0.0.0.0, then the IP Destination Address is copied from the Home Address field of the Registration Request. Otherwise, if the Registration Reply is received from the home agent, and contains a Home Address that is not 0.0.0.0, then the IP Destination Address is copied from the Home Address field of the Registration Reply. Otherwise, the IP Destination Address of the Registration Reply is set to be 255.255.255.255.
  • UDP Source Port: 434
  • UDP Destination Port: Copied from the UDP Source Port of the Registration Request.

3.7.3. Receiving Registration Replies ๐Ÿ“ฌ

The foreign agent updates its visitor list when it receives a valid Registration Reply from a home agent, and then relays that Reply to the mobile node. The following sections dig into this behavior in more detail. Get ready to nerd out ๐Ÿค“

If, after relaying a Registration Request to a home agent, the foreign agent gets an ICMP error message instead of a Registration Reply, then the foreign agent 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, bad packet ๐Ÿ‘‹

When a foreign agent receives a Registration Reply message, it MUST search its visitor list for a pending Registration Request with the same mobile node home address as indicated in the Reply. If there are multiple entries with the same home address, and the Registration Reply has the Mobile Node NAI extension [2], the foreign agent MUST use the NAI to disambiguate the pending Registration Requests with the same home address. If no matching pending Request is found, and the Registration Reply does not correspond with any pending Registration Request with a zero mobile node home address (see Section 3.7.1), the foreign agent MUST silently discard the Reply. The foreign agent MUST also silently discard the Reply if the low-order 32 bits of the Identification field in the Reply do not match those in the Request.

The authentication in the Registration Reply MUST be checked too. 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 the Extension. If no Foreign-Home Authentication Extension is found, or if more than one is found, 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. This part is seriously important, so no skipping ๐Ÿ”๐Ÿ˜ญ

3.7.3.2. Forwarding Replies to the Mobile Node ๐ŸŽ€

A Registration Reply that satisfies the validity checks of Section 3.8.2.1 is relayed to the mobile node. The foreign agent MUST also update its visitor list entry for the mobile node to reflect the results of the Registration Request, as indicated by the Code field in the Reply. If the code says the home agent accepted the registration and the Lifetime field is nonzero, the foreign agent SHOULD set the Lifetime in the visitor list entry to the minimum of the following two values:

  • the value specified in the Lifetime field of the Registration Reply, and
  • the foreign agent's own maximum value for allowable registration Lifetime.

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, but not its visitor list entry, for the mobile node.

The foreign agent MUST NOT modify any of the fields from the fixed portion of the Registration Reply through the Mobile-Home Authentication Extension. If it does, an authentication failure is very likely to happen at the mobile node. In addition, the foreign agent SHOULD perform the following procedures:

  • It MUST process and remove any Extensions that are not covered by any authorization-enabling extension,
  • It MAY append its own non-authentication Extensions that supply information 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 are set according to the same rules specified in 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 as follows. If the Registration Reply says the home agent accepted the registration, the foreign agent resets its timer for the registration lifetime to the Lifetime granted in the Registration Reply. Unlike the mobile node's timing of the registration lifetime described in Section 3.6.2.2, the foreign agent counts this lifetime from the moment it forwards the Registration Reply, which makes sure the foreign agent never expires the registration before the mobile node does. ๐Ÿซถ On the other hand, if the Registration 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. The home agent receives Registration Requests from the mobile node (perhaps relayed by a foreign agent), updates its record of the mobility bindings for this mobile node, and issues a suitable Registration Reply in response to each one. Think of them as the chill friend who only speaks when spoken to ๐Ÿ˜Œ

A home agent MUST NOT transmit a Registration Reply except when replying to a Registration Request received from a mobile node. In particular, the home agent MUST NOT generate a Registration Reply to indicate that the Lifetime has expired. No random surprise replies, periodt ๐Ÿ’œ

3.8.1. Configuration and Registration Tables ๐Ÿ 

Okay bestie, first things first ๐Ÿ’– Every 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 Mobility Security Association of each authorized mobile node that it is serving as a home agent โœจ

When the home agent accepts a valid Registration Request from a mobile node that it serves as a home agent, the home agent MUST create or modify the entry for this mobile node in its mobility binding list. That entry contains:

  • the mobile node's home address
  • the mobile node's care-of address
  • the Identification field from the Registration Reply
  • the remaining Lifetime of the registration

The home agent MAY optionally offer the capability to dynamically associate a home address to a mobile node when it gets a Registration Request from that mobile node ๐Ÿฆ‹ How the home address gets handed out is beyond the scope of this doc, but go check [2] if you're curious. After the home agent makes that association, the home agent MUST put that home address into the Home Address field of the Registration Reply ๐Ÿ’…

The home agent MAY also maintain Mobility Security Associations with various foreign agents ๐ŸŒธ When it receives 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, unless the Lifetime field equals 0. When processing a Registration Request with Lifetime = 0, the HA MAY skip checking for the presence and validity of a Foreign-Home Authentication Extension. Similarly, when sending a Registration Reply to a foreign agent, and 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 mobile node's mobility binding(s), and it SHOULD send a Registration Reply with a suitable code ๐ŸŽ€ Otherwise (the home agent has denied the Request), it SHOULD in most cases send a Registration Reply with an appropriate code that says why the Request was denied. The following sections go into more detail on all this ๐Ÿงš If the home agent does not support broadcasts (see Section 4.3), it MUST ignore the 'B' bit. That means ignoring it, not rejecting the Registration Request, which is a different move entirely ๐Ÿ™ˆ

3.8.2.1. Validity Checks ๐Ÿ”

Registration Requests with an invalid, non-zero UDP checksum MUST be silently discarded by the home agent. Ghosted, no notes ๐Ÿ‘ป

The authentication in the Registration Request MUST be checked. This involves the following operations:

a. The home agent MUST check for the presence of at least one authorization-enabling extension, and make sure that all indicated authentications are carried out. At least one authorization-enabling extension MUST be present in the Registration Request, and the home agent MUST either check the Authenticator value in the extension or verify that the Authenticator Value has been checked by another agent that it has a security association with ๐Ÿซถ

If the home agent receives a Registration Request from a mobile node that it does not have any security association with, the home agent MUST silently discard the Registration Request ๐Ÿ’€

If the home agent receives a Registration Request without any authorization-enabling extension, the home agent MUST silently discard the Registration Request ๐Ÿ˜ญ

If the Authenticator is invalid, the home agent MUST reject the mobile node's registration. What happens next depends on whether the Request has a valid Foreign-Home authentication extension, so here's the breakdown:

  • If there is a valid Foreign-Home authentication extension, the home agent MUST send a Registration Reply with Code 131.
  • Otherwise, if there is no Foreign-Home Security Association, the home agent MAY send a Registration Reply with Code 131. If the home agent sends a Registration Reply, it MUST contain a valid Mobile-Home Authentication Extension. When building the Reply, the home agent SHOULD choose a security association that is likely to exist in the mobile node. For example, this may be an older security association, or one with a longer lifetime than the one the mobile node tried to use in its Request. Deployments should take care when updating security associations to make sure there is at least one common security association shared between the mobile node and the home agent ๐ŸŒˆ In any case of a failed Authenticator, the home agent MUST then discard the Request without further processing, and it SHOULD log the error as a security exception ๐Ÿšจ

b. The home agent MUST check that the registration Identification field is correct, using the context selected by the SPI within the authorization-enabling extension that the home agent used to authenticate the mobile node's Registration Request. See Section 5.7 for how this gets done ๐Ÿง  If it's incorrect, the home agent MUST reject the Request and SHOULD send a Registration Reply to the mobile node with Code 133. That Reply includes an Identification field computed according to the rules in Section 5.7. The home agent MUST do no further processing with such a 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, and this is a Registration Request (one with a non-zero Lifetime), the home agent MUST check for the presence of a valid Foreign-Home Authentication Extension. In this case, exactly one Foreign-Home Authentication Extension MUST be present in the Registration Request, and the home agent MUST check the Authenticator Value in that Extension. If no Foreign-Home Authentication Extension is found, or more than one is found, 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. The home agent MUST then discard the Request and SHOULD log the error as a security exception ๐Ÿ›ก๏ธ

d. If the home agent and the foreign agent do not share a Mobility Security Association, and the Registration contains a Foreign-Home Authentication Extension, the home agent MUST discard the Request and SHOULD log the error as a security exception ๐Ÿ™…โ€โ™€๏ธ

In addition to checking the authentication in the Registration Request, home agents MUST deny Registration Requests that are sent to the subnet-directed broadcast address of the home network (as opposed to being unicast to the home agent) ๐Ÿ“ก The home agent MUST discard the Request and SHOULD return a Registration Reply with a Code of 136. In this case, the Registration Reply will contain the home agent's unicast address, so the mobile node can re-issue the Registration Request with the correct home agent address ๐Ÿฆ‹

Tiny plot twist ๐ŸŒช๏ธ Some routers change the IP Destination Address of a datagram from a subnet-directed broadcast address to 255.255.255.255 before injecting it into the destination subnet. When that happens, home agents that try to pick up dynamic home agent discovery requests by binding a socket explicitly to the subnet-directed broadcast address will not see those packets. Home agent implementors should be prepared for both the subnet-directed broadcast address and 255.255.255.255 if they want to support dynamic home agent discovery ๐Ÿ“

3.8.2.2. Accepting a Valid Request โœจ

okay so if the Registration Request passes the validity checks in Section 3.8.2.1 ๐Ÿ” and the home agent is able to 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 code in that Reply 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 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 of the entries in the mobility binding list for the requesting mobile node. This is how a mobile node says "okay bye, 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 containing the specified Care-of Address from the mobility binding list for the requesting mobile node. Any other active entries containing other care-of addresses will remain active. ๐Ÿฆ‹
  • If the Lifetime is nonzero, the home agent adds an entry containing 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 retained. Otherwise, the home agent removes all previous entries in the mobility binding list for the mobile node. ๐ŸŒธ

In all cases, the home agent MUST send a Registration Reply to the source of the Registration Request, which might indeed be a different foreign agent than 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 Registration Request, the home agent MAY additionally send a Registration Reply to the foreign agent whose care-of address is being deregistered. The home agent MUST NOT send such a Reply if it does not share a Mobility Security Association with the foreign agent. If no Reply is sent, the foreign agent's visitor list will expire naturally when the original Lifetime expires. โณ

When a foreign agent relays a deregistration message containing a care-of address that it does not own, it MUST NOT add a Foreign-Home Authentication Extension to that deregistration. See Section 3.5.4 for more details. ๐Ÿ™ˆ

The home agent MUST NOT increase the Lifetime above that specified by the mobile node in the Registration Request. However, it is not an error for the mobile node to request a Lifetime longer than the home agent is willing to accept. In this case, the home agent simply reduces the Lifetime to a permissible value and returns this value in the Registration Reply. The Lifetime value in the Registration Reply tells the mobile node the granted Lifetime of the registration, and it indicates when the mobile node SHOULD re-register in order to keep getting service. ๐Ÿ’– After this 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 beyond the Lifetime originally granted. A Registration Request is a duplicate if the home address, care-of address, and Identification fields all equal those of an accepted current registration. ๐Ÿ‘ฏ

In addition, if the home network implements ARP [16], and the Registration Request asks the home agent to create a mobility binding for a mobile node that previously had no binding (the mobile node was previously assumed to be at home), then the home agent MUST follow the procedures described in Section 4.6 with regard to ARP, proxy ARP, and gratuitous ARP. If the mobile node already had a previous mobility binding, the home agent MUST continue to follow the rules for proxy ARP described in Section 4.6. ๐Ÿง 

3.8.2.3. Denying an Invalid Request ๐Ÿ™…โ€โ™€๏ธ

If the Registration Request does not satisfy all of the validity checks in Section 3.8.2.1, or the home agent is unable to accommodate the Request, the home agent SHOULD return a Registration Reply to the mobile node with a Code that indicates the reason for the error. ๐Ÿšซ If a foreign agent was involved in relaying the Request, this lets the foreign agent delete its pending visitor list entry. It also tells the mobile node why things went wrong, so it can fix the problem and send another Request ๐Ÿ”ง

This section lists a number of reasons the home agent might reject a Request, and gives the code value it should use in each case. See Section 3.8.3 for additional details on building the Registration Reply message. ๐Ÿ“‹

Lots of reasons for rejecting a registration are administrative. For example, a home agent can limit the number of simultaneous registrations for a mobile node by rejecting any registrations that would push it over the limit, and returning a Registration Reply with a Code of 135. ๐Ÿ›‘ Similarly, a home agent may refuse to grant service to mobile nodes that have entered unauthorized service areas by returning a Registration Reply with a Code of 129. ๐Ÿšง

Requests with non-zero bits in reserved fields MUST be rejected with Code 134 (poorly formed Request). ๐Ÿ’€


3.8.3. Sending Registration Replies ๐Ÿ“จ

If the home agent accepts a Registration Request, it then MUST update its record of the mobile node's mobility binding(s) and SHOULD send a Registration Reply with a suitable Code. Otherwise (the home agent has denied the Request), it SHOULD in most cases send a Registration Reply with an appropriate Code specifying the reason the Request was denied. ๐Ÿ™ƒ The following sections give extra detail on the values the home agent MUST supply in the fields of Registration Reply messages. ๐Ÿ“

3.8.3.1. IP/UDP Fields ๐ŸŒ

This section gives the specific rules that home agents use to pick values for the IP and UDP header fields 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 sending a Registration Reply in response to a Registration Request that asked to deregister the mobile node (the Lifetime is zero and the Care-of Address equals the mobile node's home address), and where the IP Source Address was also set to the mobile node's home address (this is the normal way a mobile node deregisters when it comes back to its home network), the IP Destination Address in the Registration Reply will be set to the mobile node's home address, copied from the IP Source Address of the Request. ๐Ÿ โœจ

In this case, when transmitting the Registration Reply, the home agent MUST transmit the Reply directly onto the home network as if the mobile node were at home, bypassing any mobility binding list entry that may still exist at the home agent for the destination mobile node. ๐Ÿก In particular, for a mobile node returning home after being registered with a care-of address: if the mobile node's new Registration Request is not accepted by the home agent, the mobility binding list entry for that mobile node will still say that datagrams addressed to it should be tunneled to its registered care-of address. When sending the Registration Reply that rejects this Request, this 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 ๐ŸŽ€

This section gives the specific rules that home agents use to pick values for the fields in the fixed portion of a Registration Reply. ๐Ÿ’…

The Code field of the Registration Reply is chosen according to the rules in the previous sections. When replying to an accepted registration, a home agent SHOULD respond with Code 1 if it does not support simultaneous registrations. ๐Ÿ”ข

The Lifetime field MUST be copied from the corresponding field in the Registration Request, unless the requested value is greater than the maximum length of time the home agent is willing to provide the requested service. In that case, the Lifetime MUST be set to the length of time that service will actually be provided by the home agent. This reduced Lifetime SHOULD be the maximum Lifetime allowed by the home agent (for this mobile node and care-of address). โฑ๏ธ

If the Home Address field of the Registration Request is non-zero, it MUST be copied into the Home Address field of the Registration Reply message. If the home agent cannot support the specified nonzero unicast address in the Home Address field of the Registration Request, then the home agent MUST reject the Registration Request with a Code of 129. ๐Ÿšท

Otherwise, if the Home Address field of the Registration Request is zero as specified in Section 3.6, the home agent SHOULD arrange for the selection of a home address for the mobile node, and insert the selected address into the Home Address field of the Registration Reply message. See [2] for further relevant details in the case where mobile nodes identify themselves using an NAI instead of their IP home address. ๐Ÿชช

If the Home Agent field in the Registration Request contains a unicast address of this home agent, then that field MUST be copied into the Home Agent field of the Registration Reply. Otherwise, the home agent MUST set the Home Agent field in the Registration Reply to its unicast address. In this latter case, the home agent MUST reject the registration with a suitable code (e.g., Code 136) to prevent the mobile node from possibly being registered with two or more home agents at the same time. ๐Ÿšฆ๐Ÿ™…โ€โ™€๏ธ

3.8.3.3. Extensions ๐Ÿงฉ

This section describes the ordering of any required and any optional Mobile IP Extensions that a home agent appends to a Registration Reply. The following ordering 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.

Note that items (a) and (c) MUST appear in every Registration Reply sent by the home agent. Items (b), (d), and (e) are optional. However, item (e) MUST be included when the home agent and the foreign agent share a Mobility Security Association. ๐Ÿ”๐Ÿ‘‘

4. Routing Considerations โœจ

okay so this section is all about how mobile nodes, home agents, and (possibly) foreign agents team up to get datagrams to and from a mobile node that's chilling on a foreign network ๐ŸŒธ the mobile node tells its home agent where it is using the registration procedure from Section 3 ๐Ÿ’–. if you want the big picture of where the mobile node's home address sits relative to its home agent, peep Section 1.7, which also covers where the mobile node is relative to any foreign agent it might try to register with ๐Ÿ—บ๏ธ


4.1. Encapsulation Types

bestie, home agents and foreign agents MUST support tunneling datagrams using IP in IP encapsulation [14] ๐Ÿซถ. any mobile node using a co-located care-of address MUST support receiving datagrams tunneled with IP in IP encapsulation too ๐Ÿ’…. minimal encapsulation [15] and GRE encapsulation [13] are the alternate methods, and mobility agents and mobile nodes MAY optionally support them ๐Ÿฆ‹. when the mobile node asks for one of these alternate forms, it's otherwise up to the home agent whether it goes with that request ๐Ÿ‘‘


4.2. Unicast Datagram Routing

4.2.1. Mobile Node Considerations

okay, when the mobile node is home, it's literally just a regular (fixed) host or router with zero mobility stuff going on ๐Ÿ โœจ. it works the same as any other device would. how a mobile node picks a default router when it's home, or when it's away and using a co-located care-of address, is outside the scope of this document ๐Ÿ™ˆ. ICMP Router Advertisement [5] is one such method, so it's giving option one ๐Ÿ’œ

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, it MAY use its foreign agent as a first-hop router. The foreign agent's MAC address can be learned from the foreign agent's Agent Advertisement message. Otherwise, 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. ๐ŸŒท
  • 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 that 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. 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. ๐Ÿงš

while they're away from home, mobile nodes MUST NOT broadcast ARP packets to find the MAC address of another Internet node ๐Ÿšซ. so the (possibly empty) list of router addresses from the ICMP Router Advertisement portion of the message is not useful for picking a default router, unless the mobile node has some way that doesn't involve broadcast ARP (and isn't specified in this document) to get the MAC address of one of the routers in the list. similarly, unless unspecified mechanisms exist for getting MAC addresses on foreign networks, the mobile node MUST ignore redirects to other routers on foreign networks. no redirect drama allowed ๐Ÿ’€

4.2.2. Foreign Agent Considerations

when a foreign agent gets an encapsulated datagram sent to its advertised care-of address, it MUST compare the inner Destination Address to the entries in its visitor list ๐Ÿ‘€. if the Destination doesn't match the address of any mobile node currently in 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 ๐Ÿคซ. otherwise, the foreign agent forwards the decapsulated datagram to the mobile node ๐Ÿ’–

the foreign agent MUST NOT advertise to other routers in its routing domain, nor to any other mobile node, the presence of a mobile router (Section 4.5) or mobile node in its visitor list. lowkey private, iykyk ๐Ÿ™Š

the foreign agent MUST route datagrams it receives from registered mobile nodes ๐Ÿ›ฃ๏ธ. at a minimum, this 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 โœ…

a foreign agent MUST NOT use broadcast ARP for a mobile node's MAC address on a foreign network. it can get the MAC address by copying the info from an Agent Solicitation or a Registration Request sent from a mobile node. also, the foreign agent's ARP cache for the mobile node's IP address MUST NOT be allowed to expire before the mobile node's visitor list entry expires, unless the foreign agent has some way other than broadcast ARP to refresh its MAC address for that IP address. this one is serious, bestie ๐Ÿ˜ญ

each foreign agent SHOULD support the mandatory features for reverse tunneling [12] ๐Ÿ”ฅ

4.2.3. Home Agent Considerations

the home agent MUST be able to intercept any datagrams on the home network addressed to the mobile node while the mobile node is registered away from home ๐Ÿ•ต๏ธโ€โ™€๏ธ. proxy and gratuitous ARP MAY be used to make this interception happen, as specified in Section 4.6 ๐Ÿง

the home agent must examine the IP Destination Address of all arriving datagrams to see if it equals 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, so in general it won't receive those datagrams ๐Ÿ™ƒ. however, if the home agent is also a router handling common IP traffic, it's possible it will receive such datagrams for forwarding onto the home network. in this case, the home agent MUST assume the mobile node is at home and simply forward the datagram directly onto the home network ๐Ÿก

for multihomed home agents, the source address in the outer IP header of the encapsulated datagram MUST be the address sent to the mobile node in the Home Agent field of the Registration Reply. that means the home agent can't use the address of some other network interface as the source address ๐Ÿšท

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 returned from the tunnel get correctly reflected back to the original senders of the tunneled datagrams ๐Ÿชž

home agents MUST decapsulate packets addressed to themselves that were sent by a mobile node for maintaining location privacy, as described in Section 5.5 ๐Ÿฅท. this feature is also required for supporting reverse tunneling [12] ๐Ÿ’œ

if the Lifetime for a given mobility binding expires before the home agent gets another valid Registration Request for that mobile node, then that binding is deleted from the mobility binding list โฐ. the home agent MUST NOT send any Registration Reply message just because the mobile node's binding has 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 whether it's already encapsulated. if it is, special rules apply to forwarding that datagram 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 forward the datagram in this case, 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 (nested encapsulation), with the new outer Destination Address set equal to the mobile node's care-of address. So 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 have requested forwarding of broadcast datagrams ๐Ÿ“ข๐Ÿšซ. a mobile node MAY request forwarding of broadcast datagrams 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, though 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, which means the mobile node is 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, then tunnels that encapsulated datagram to the foreign agent. this extra layer of encapsulation is required so the foreign agent can figure out which mobile node should get the datagram after it's decapsulated ๐Ÿ•ถ๏ธ. when the foreign agent receives it, the unicast encapsulated datagram is detunneled and delivered to the mobile node just 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 โœจ

Okay so, bestie ๐Ÿซถ a mobile node that's chilling at home is literally just like any other fixed host or router, so it does multicast the exact same way as everyone else ๐Ÿ’… This section is only about the mobile node that's out visiting a foreign network, and it's giving main character energy ๐ŸŽ€

Now, to actually receive multicasts, a mobile node MUST join the multicast group in one of two ways ๐Ÿฆ‹ The first way: a mobile node MAY join the group through a (local) multicast router on the visited subnet ๐ŸŒธ This only works if there's a multicast router on that visited subnet, obviously ๐Ÿ™ˆ 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 [6] messages ๐Ÿ’œ Otherwise, it MAY use its home address โœจ

The other option is that a mobile node that wants multicasts MAY join groups through a bidirectional tunnel to its home agent, assuming the home agent is a multicast router ๐Ÿงš The mobile node tunnels its IGMP messages to the home agent, and then the home agent forwards multicast datagrams down the tunnel to the mobile node ๐Ÿซถ For packets that get tunneled to the home agent, the source address in the IP header SHOULD be the mobile node's home address ๐ŸŒˆ

The delivery rules for multicast datagrams to mobile nodes in this case are exactly the same as the ones for broadcast datagrams (Section 4.3) ๐Ÿ’– So if the mobile node is using a co-located care-of address (the 'D' bit was set in the mobile node's Registration Request), then 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 (nested tunneling) to the mobile node's care-of address ๐Ÿ”ฅ Which means the mobile node MUST be capable of decapsulating packets sent to its home address if it wants to receive multicast datagrams this way ๐Ÿ˜ญ

Sending is its own thing too ๐Ÿ’… A mobile node that wants to send datagrams to a multicast group has two options: (1) send directly on the visited network; or (2) send through a tunnel to its home agent ๐Ÿฆ‹ Multicast routing generally depends on the IP source address, so 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 ๐Ÿš—โœˆ๏ธ

A mobile node can be a router that's responsible for the mobility of one or more entire networks moving together ๐ŸŒˆ Think an airplane, a ship, a train, an automobile, a bicycle, or even a kayak ๐Ÿ›ถ The nodes connected to a network served by the mobile router can be fixed nodes, mobile nodes, or routers themselves ๐ŸŽ€ In this document, these networks are called "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 via a mobile router works in this case, with an example that is literally so iconic ๐Ÿ˜ญ

a. A laptop computer is 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 on the aircraft also serves 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, which is the router's home network ๐Ÿข While the aircraft is in flight, this router keeps registering 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 the airline's headquarters ๐Ÿ’–

c. A correspondent node sends a datagram to the laptop computer, addressing it to the laptop's home address ๐Ÿ’Œ That datagram gets routed to the laptop's home network first ๐Ÿ 

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 acting as the 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 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, which leaves a datagram still encapsulated by the laptop's home agent, with a Destination Address of the laptop's care-of address ๐Ÿ“ก The ground foreign agent then sends that datagram 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 Address of the laptop's home address ๐Ÿ’… The aircraft foreign agent then delivers the datagram over the aircraft network to the laptop's link-layer address ๐ŸŽ‰

This example shows the case where a mobile node is attached to a mobile network ๐Ÿงณ So the mobile node is mobile with respect to the network, and the network is itself mobile too (here, with respect to the ground) ๐ŸŒ If instead the node is fixed with respect to the mobile network (meaning 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 ๐Ÿฆ‹

For the fixed node, a home agent MAY be configured to have a permanent registration that indicates the mobile router's address as the fixed host's care-of address ๐ŸŒธ The mobile router's home agent will normally be used for this purpose ๐Ÿงš The 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 nested tunneling, as described above ๐Ÿช†

Alternatively, the mobile router MAY advertise connectivity to the entire mobile network using normal IP routing protocols through a bidirectional tunnel to its own home agent ๐Ÿ’œ This method avoids the need for nested tunneling of datagrams ๐Ÿ™Œ

4.6. ARP, Proxy ARP, and Gratuitous ARP ๐ŸŽ€

Okay so ARP [16] is lowkey picky once wireless or mobile nodes join the party, which is why it needs special rules to work right. These requirements apply to all home networks where ARP is used for address resolution. ๐Ÿ’–

Besides the normal ARP job of figuring out a target's link-layer address from its IP address, this document calls out two special uses of ARP:

  • Proxy ARP [49] is an ARP Reply that one node sends on behalf of another node that is either unable or unwilling to answer its own ARP Requests. The sender of a Proxy ARP reverses the Sender Protocol Address and Target Protocol Address fields as described in [16], but fills the Sender Hardware Address field with some configured link-layer address (usually its own). The node that gets the Reply then links that 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. ๐Ÿงš
  • Gratuitous ARP [45] is an ARP packet that a node sends to spontaneously get other nodes to 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 the cache entry should be updated to. When using an ARP Reply packet, the Target Hardware Address is also set to that link-layer address (this field is not used in an ARP Request packet).

In either case, for a gratuitous ARP, the ARP packet MUST be transmitted as a local broadcast packet on the local link. As specified in [16], any node receiving any ARP packet (Request or Reply) MUST update its local ARP cache with the Sender Protocol and Hardware Addresses in the ARP packet, if the receiving node already has an entry for that IP address in its ARP cache. This requirement in the ARP protocol applies even for ARP Request packets, and for ARP Reply packets that do not match any ARP Request transmitted by the receiving node [16]. ๐Ÿ”ฅ

While a mobile node is registered on a foreign network, its home agent uses proxy ARP [49] to reply to ARP Requests it receives that seek the mobile node's link-layer address. ๐Ÿ  When it receives an ARP Request, the home agent MUST examine the target IP address of the Request. If that IP address matches the home address of any mobile node for which it has a registered mobility binding, the home agent MUST transmit an ARP Reply on behalf of the mobile node. After exchanging the sender and target addresses in the packet [49], the home agent MUST set the sender link-layer address in the packet to the link-layer address of its own interface over which the Reply will be sent.

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 causes those nodes to associate the link-layer address of the home agent with the mobile node's home (IP) address. When registering a binding for a mobile node for which the home agent previously had no binding (the mobile node was assumed to be at home), the home agent MUST transmit a gratuitous ARP on behalf of the mobile node. This gratuitous ARP packet MUST be transmitted as a broadcast packet on the link on which the mobile node's home address is located. Since broadcasts on the local link (such as Ethernet) are typically not guaranteed to be reliable, the gratuitous ARP packet SHOULD be retransmitted a small number of times to increase its reliability. ๐Ÿ”

When a mobile node returns to its home network, the mobile node and its home agent use gratuitous ARP to get all nodes on the mobile node's home network to update their ARP caches, so they once again associate the mobile node's own link-layer address with the mobile node's home (IP) address. ๐Ÿฅน Before transmitting the (de)Registration Request message to its home agent, the mobile node MUST transmit this gratuitous ARP on its home network as a local broadcast on this link. The gratuitous ARP packet SHOULD be retransmitted a small number of times to increase its reliability, but these retransmissions SHOULD proceed in parallel with the transmission and processing of the mobile node's (de)Registration Request.

When the mobile node's home agent receives and accepts this (de)Registration Request, the home agent MUST also transmit a gratuitous ARP on the mobile node's home network. This gratuitous ARP also associates the mobile node's home address with the mobile node's own link-layer address. A gratuitous ARP is sent by both the mobile node and its home agent, since with wireless network interfaces, the area within transmission range of the mobile node will likely differ from the area within range of its home agent. ๐Ÿ“ก The ARP packet from the home agent MUST be transmitted as a local broadcast on the mobile node's home link, and SHOULD be retransmitted a small number of times to increase its reliability. These retransmissions, however, SHOULD proceed in parallel with the transmission and processing of the mobile node's (de)Registration Reply. ๐Ÿ’œ

While the mobile node is away from home, it MUST NOT transmit any broadcast ARP Request or ARP Reply messages. ๐Ÿ™…โ€โ™€๏ธ Finally, while the mobile node is away from home, it MUST NOT reply to ARP Requests in which the target IP address is its own home address, unless the ARP Request is unicast by a foreign agent with which the mobile node is attempting to register, or by a foreign agent with which the mobile node has an unexpired registration. In the latter case, the mobile node MUST use a unicast ARP Reply to respond to the foreign agent. Note that if the mobile node is using a co-located care-of address and receives an ARP Request in which the target IP address is this care-of address, then the mobile node SHOULD reply to this ARP Request. Note also that, when transmitting a Registration Request on a foreign network, a mobile node may discover the link-layer address of a foreign agent by storing the address as it is received from the Agent Advertisement from that foreign agent, but not by transmitting a broadcast ARP Request message. ๐ŸŒธ

The specific order in which each of the above requirements for ARP, proxy ARP, and gratuitous ARP are applied is super important, relative to the transmission and processing of the mobile node's Registration Request and Registration Reply messages when leaving home or returning home. Getting the order right is what keeps the protocol working correctly! โฐ

To sum it all up: when a mobile node leaves its home network, the following steps MUST be performed, in this order:

  • The mobile node decides to register away from home, perhaps because it has received an Agent Advertisement from a foreign agent and has not recently received one from its home agent.
  • Before transmitting the Registration Request, the mobile node disables its own future processing of any ARP Requests it may subsequently receive requesting the link-layer address corresponding to its home address, except insofar as necessary to communicate with foreign agents on visited networks.
  • The mobile node transmits its Registration Request.
  • When the mobile node's home agent receives and accepts the Registration Request, it performs a gratuitous ARP on behalf of the mobile node, and begins using proxy ARP to reply to ARP Requests that it receives requesting the mobile node's link-layer address. In the gratuitous ARP, the ARP Sender Hardware Address is set to the link-layer address of the home agent. If, instead, the home agent rejects the Registration Request, no ARP processing (neither gratuitous nor proxy) is performed by the home agent.

When a mobile node later returns to its home network, the following steps MUST be performed, in this order:

  • The mobile node decides to register at home, perhaps because it has received an Agent Advertisement from its home agent.
  • Before transmitting the Registration Request, the mobile node re-enables its own future processing of any ARP Requests it may subsequently receive requesting its link-layer address.
  • The mobile node performs a gratuitous ARP for itself. In this gratuitous ARP, the ARP Sender Hardware Address is set to the link-layer address of the mobile node.
  • The mobile node transmits its Registration Request.
  • When the mobile node's home agent receives and accepts the Registration Request, it stops using proxy ARP to reply to ARP Requests that it receives requesting the mobile node's link-layer address, and then performs a gratuitous ARP on behalf of the mobile node. In this gratuitous ARP, the ARP Sender Hardware Address is set to the link-layer address of the mobile node. If, instead, the home agent rejects the Registration Request, the home agent MUST NOT make any change to the way it performs ARP processing (neither gratuitous nor proxy) for the mobile node. In this latter case, the home agent should operate as if the mobile node has not returned home, and continue to perform proxy ARP on behalf of the mobile node. ๐Ÿก

5. Security Considerations ๐Ÿ”

The mobile computing environment is potentially very different from the ordinary computing environment, bestie. ๐Ÿ˜ญ In many cases, mobile computers will be connected to the network via wireless links. Such links are particularly vulnerable to passive eavesdropping, active replay attacks, and other active attacks. This is seriously the part where we have to be extra careful!! ๐Ÿšจ

5.1. Message Authentication Codes ๐Ÿ›ก๏ธ

Home agents and mobile nodes MUST be able to perform authentication. The default algorithm is HMAC-MD5 [10], with a key size of 128 bits. The foreign agent MUST also support authentication using HMAC-MD5 and key sizes of 128 bits or greater, with manual key distribution. Keys with arbitrary binary values MUST be supported. ๐Ÿ”‘

The "prefix+suffix" use of MD5 to protect data and a shared secret is considered vulnerable to attack by the cryptographic community. ๐Ÿ’€ Where backward compatibility with existing Mobile IP implementations that use this mode is needed, new implementations SHOULD include keyed MD5 [19] as one of the additional authentication algorithms for use when producing and verifying the authentication data that is supplied with Mobile IP registration messages, for instance, in the extensions specified in Sections 3.5.2, 3.5.3, and 3.5.4. ๐Ÿง

More authentication algorithms, algorithm modes, key distribution methods, and key sizes MAY also be supported for all of these extensions. โœจ

5.2. Areas of Security Concern in This Protocol ๐Ÿ”

okay so the registration protocol in this doc means a mobile node's traffic gets tunneled to its care-of address ๐Ÿฆ‹ and that tunneling is a HUGE vulnerability if the registration isn't authenticated ๐Ÿ˜ญ remote redirection like this is widely understood as a security problem on the current Internet when it's not authenticated [30]. ngl that's giving danger. ALSO the Address Resolution Protocol (ARP) is not authenticated at all ๐Ÿ’€ which means it can be used to steal another host's traffic. and using gratuitous ARP (Section 4.6) brings along every single risk that comes with ARP. not me having to say that twice ๐Ÿ™ˆ

5.3. Key Management ๐Ÿ—๏ธ

this spec REQUIRES a strong authentication mechanism (keyed MD5) that blocks a whole bunch of attacks on the Mobile IP registration protocol ๐Ÿ‘‘ BUT key distribution is hard without a network key management protocol, so messages with the foreign agent are not all required to be authenticated. lowkey messy, but that's the tradeoff. in a commercial setting it could matter a LOT to authenticate every message between the foreign agent and the home agent ๐Ÿ’… that way billing works and service providers don't end up serving people who aren't legit customers of that provider. iconic accountability energy โœจ

5.4. Picking Good Random Numbers ๐ŸŽฒ

the strength of any authentication mechanism depends on a few things: how strong the algorithm is by itself, how secret the key stays, how strong the key is, and how well the implementation is actually built ๐Ÿ”ฅ this spec REQUIRES implementing keyed MD5 for authentication, but it doesn't rule out other algorithms and modes. for keyed MD5 to be useful, the 128-bit key has to be both secret (meaning only authorized parties know it) AND pseudo-random ๐ŸŒˆ

if nonces are used for replay protection, they also have to be picked carefully ๐Ÿงš RFC 4086 [8] by Eastlake, et al. has more info on generating pseudo-random numbers, so go read that if you're making them ๐Ÿ“š

5.5. Privacy ๐Ÿซฃ

users with sensitive data they don't want anyone else seeing should use mechanisms outside the scope of this document (like encryption) to protect it ๐Ÿ” users worried about traffic analysis should think about using link encryption. if you want ABSOLUTE location privacy, the mobile node can make a tunnel to its home agent ๐Ÿฆ‹ then datagrams going to correspondent nodes look like they're coming from the home network, so it can get way harder to pinpoint where the mobile node actually is. but all of these mechanisms are beyond the scope of this document ๐Ÿ™ˆ

5.6. Ingress Filtering ๐Ÿšง

a lot of routers use security policies like "ingress filtering" [35] that won't forward packets whose Source Address looks topologically wrong ๐Ÿ’€ when that's a problem, mobile nodes MAY use reverse tunneling [12] with the foreign-agent-supplied care-of address as the Source Address ๐ŸŒธ reverse-tunneled packets can get through those routers just fine, AND ingress filtering can still find the true topological source of the packet the same way it does for non-mobile nodes. slay ๐Ÿ’…

5.7. Replay Protection for Registration Requests ๐Ÿ”

the Identification field lets the home agent check that a registration message was freshly made by the mobile node and not replayed by some attacker from an earlier registration ๐Ÿ‘€ this section describes two methods: 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 too.

the replay protection style in use between a mobile node and its home agent is part of the Mobility Security Association ๐Ÿซถ a mobile node and its home agent MUST agree on which replay protection method they're using. how the Identification field gets read depends on the method, as the subsections below explain.

whatever method you pick, the low-order 32 bits of the Identification field MUST be copied unchanged from the Registration Request into the Reply ๐Ÿšจ the foreign agent uses those bits (plus the mobile node's home address) to match Registration Requests with their replies. the mobile node MUST verify that the low-order 32 bits of any Registration Reply are identical to what it sent in the Registration Request. no skipping this one, bestie

the Identification field in a NEW Registration Request MUST NOT be the same as the one in the immediately preceding Request, and it SHOULD NOT repeat while the same security context is still in use between the mobile node and the home agent ๐ŸŽ€ retransmission as in Section 3.6.3 is allowed.

5.7.1. Replay Protection Using Timestamps โฐ

the big idea with timestamp replay protection is pretty simple: the sending node puts the current time of day in the message, and the receiving node checks that the timestamp is close enough to its own time of day โœจ unless the security association between the nodes says otherwise, a default of 7 seconds MAY be used to limit the time difference. that value SHOULD be greater than 3 seconds. obviously the two nodes need clocks that are adequately synchronized ๐Ÿ•ฐ๏ธ and like any message, time synchronization messages MAY be protected against tampering by whatever authentication mechanism the security context between the two nodes calls for.

if timestamps are used, the mobile node MUST set the Identification field to a 64-bit value formatted as the Network Time Protocol [11] specifies ๐Ÿง the low-order 32 bits of the NTP format are fractional seconds, and any of those bits a time source can't supply SHOULD be generated from a good source of randomness. BUT here's the tea: when you're using timestamps, the 64-bit Identification in a Registration Request from the mobile node MUST be greater than the one in any previous Registration Request, because the home agent treats this value as a sequence number ๐Ÿ‘‘ without that sequence number, a delayed duplicate of an earlier Registration Request could show up at the home agent (within the clock sync the home agent requires) and get applied out of order, which would wrongly change the mobile node's current registered care-of address. chaotic, I know ๐Ÿ˜ญ

when a Registration Request comes in with an authorization-enabling 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 each Mobility Security Association ๐ŸŒˆ

if the timestamp is valid, the home agent copies the ENTIRE Identification field into the Registration Reply it sends back to the mobile node ๐ŸŽ‰ if it's NOT valid, the home agent copies only the low-order 32 bits into the Reply and fills in the high-order 32 bits from its own time of day. in that second case, the home agent MUST reject the registration by returning Code 133 (registration 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 field in the Registration Reply match the ones from the rejected registration attempt, BEFORE it uses the high-order bits to resync its clock ๐Ÿ•ฐ๏ธ very important ordering, periodt.

5.7.2. Replay Protection Using Nonces ๐ŸŽฒ

the basic idea with nonce replay protection is that node A includes a brand new random number in every message to node B, and then checks that node B sends that SAME number back in its next message to node A ๐Ÿ’œ both messages use an authentication code so an attacker can't alter them. node B can also send its own nonces in every message to node A (which node A then echoes back), so B can verify that it's getting fresh messages too. two-way vibes ๐Ÿซถ

the home agent is expected to have resources for computing pseudo-random numbers useful as nonces [8] ๐Ÿง  it puts a new nonce in 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 field from the Registration Request into the low-order 32 bits of the Identification field in the Reply. when the mobile node gets an authenticated Registration Reply from the home agent, it saves those high-order 32 bits 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 field in each Registration Request ๐ŸŒธ ideally, it should make its own random nonces. HOWEVER, it can use any expedient method, including just duplicating the random value the home agent sent. the method only matters to the mobile node, because it's the one checking for valid values in the Registration Reply. the high-order AND low-order 32-bit values of the identification 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 (plus the mobile host's home address) to correctly match registration replies with pending Requests (Section 3.7.1).

if a registration message gets rejected because of an invalid nonce, the Reply ALWAYS gives the mobile node a new nonce to use in the next registration ๐Ÿ”„ so the nonce protocol is self-synchronizing. literally so cute ๐Ÿฅน


6. IANA Considerations ๐Ÿ“‹

Mobile IP sets up several new number spaces for values used in various message fields ๐Ÿ“ these number spaces include the following:

  • Mobile IP message types sent to UDP port 434, as defined in Section 1.8.
  • types of extensions to Registration Request and Registration Reply messages (see Sections 3.3 and 3.4, and also consult [12], [43], [2], [3], and [7]).
  • values for the code in the Registration Reply message (see Section 3.4, and also consult [12], [43], [2], [3], and [7]).
  • Mobile IP defines so-called Agent Solicitation and Agent Advertisement messages. these are actually Router Discovery messages [5] with Mobile-IP-specific extensions added on ๐Ÿ’– so they don't define a new name space, but they DO define additional Router Discovery extensions, described below in Section 6.2. also see Section 2.1, and consult [3] and [7].

there are additional Mobile IP numbering spaces specified in [3] ๐ŸŒˆ

info about assignment of Mobile IP numbers that come from specifications outside this document is given by IANA at http://www.iana.org/protocols. from that URL, look for the "Mobile Internet Protocol (IP) Numbers" section ๐Ÿฆ‹

in this revised spec, a new code value (for the field in the Registration Reply message) is needed within the range typically used for foreign agent messages โœจ this error code is needed to indicate the status "Invalid Home Agent Address". see Section 3.7.2 for details ๐Ÿ’…

6.1. Mobile IP Message Types โœจ

okay so Mobile IP messages are basically anything sent to a message recipient at port 434 ๐ŸŽ€ (UDP or TCP). the number space for those is in Section 1.8 ๐Ÿ’…. adding new ones is Expert Review territory, and you need a specification too [22]. the currently standardized message types look like this ๐Ÿฆ‹:

Type  Name                                             Section
----  --------------------------------------------     ---------
1     Registration Request                             3.3
3     Registration Reply                               3.4

6.2. Extensions to RFC 1256 Router Advertisement ๐ŸŒธ

RFC 1256 defines two ICMP message types, Router Advertisement and Router Solicitation ๐Ÿงš. Mobile IP sets up its own number space for extensions to Router Advertisement, and other protocols could use it too, which is so cool ๐Ÿ’œ. The extension types currently standardized for Mobile IP are numbered like this:

Type  Name                                             Section
----  --------------------------------------------     ---------
0     One-byte Padding                                 2.1.3
16    Mobility Agent Advertisement                     2.1.1
19    Prefix-Lengths                                   2.1.2

Approval of new extension numbers for Mobile IP is subject to Expert Review, and a specification is required [22]. no shortcuts, bestie ๐Ÿ™ˆ.

6.3. Extensions to Mobile IP Registration Messages ๐Ÿ“

The Mobile IP messages in this document, the ones listed in Sections 1.8 and 6.1, can have extensions โœจ. All Mobile IP message extensions share one number space, even when they're attached to different Mobile IP messages ๐Ÿซถ. That number space is specified right here in this document, and new extension numbers need Expert Review plus a specification [22] ๐Ÿ’….

Type  Name                                             Section
----  --------------------------------------------     ---------
0     One-byte Padding
32    Mobile-Home Authentication                       3.5.2
33    Mobile-Foreign Authentication                    3.5.3
34    Foreign-Home Authentication                      3.5.4

6.4. Code Values for Mobile IP Registration Reply Messages ๐Ÿ”ฅ

The Mobile IP Registration Reply message, from Section 3.4, has a Code field ๐Ÿ‘‘. The number space for those Code values is also in Section 3.4 ๐Ÿ’–. The Code space is split up depending on whether the registration worked, whether the foreign agent denied the Registration Request, or whether the home agent denied it. Here's the breakdown ๐ŸŒˆ:

+---------+------------------------------------------------------+
| Code #s |                       Guideline                      |
+---------+------------------------------------------------------+
|   0-8   |                     Success Codes                    |
|         |                                                      |
|   9-63  | Allocation guidelines not specified in this document |
|         |                                                      |
|  64-127 |          Error Codes from the Foreign Agent          |
|         |                                                      |
| 128-192 |            Error Codes from the Home Agent           |
|         |                                                      |
| 193-200 |    Error Codes from the Gateway Foreign Agent [29]   |
|         |                                                      |
| 201-255 | Allocation guidelines not specified in this document |
+---------+------------------------------------------------------+

Approval of new code values requires Expert Review [22] โœจ.

   Table 1:  Guidelines for Allocation of Code Values

7. Acknowledgments ๐Ÿซถ

Special thanks to Steve Deering (Xerox PARC), along with Dan Duchamp and John Ioannidis (JI) (Columbia University), for forming the working group, chairing it, and putting so much effort into its early development ๐Ÿฅน. Columbia's early Mobile IP work can be found in [37], [38], [39] ๐Ÿ’œ.

Thanks also to Kannan Alaggapan, Greg Minshall, Tony Li, Jim Solomon, Erik Nordmark, Basavaraj Patil, and Phil Roberts for their contributions to the group while performing the duties of chairperson, as well as for 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)
  • Samita Chakrabarti (Sun Microsystems)
  • Ken Imboden (Candlestick Networks, Inc.)
  • Dave Johnson (Carnegie Mellon University)
  • Frank Kastenholz (FTP Software)
  • Anders Klemets (KTH)
  • Chip Maguire (KTH)
  • Alison Mankin (ISI)
  • Andrew Myles (Macquarie University)
  • Thomas Narten (IBM)
  • Al Quirt (Bell Northern Research)
  • Yakov Rekhter (IBM)
  • Fumio Teraoka (Sony)
  • Alper Yegin (NTT DoCoMo)

Thanks to Charlie Kunzinger and to Bill Simpson, the editors who produced the first drafts of this document, reflecting the discussions of the working group ๐Ÿ™Œ. Much of the new text in the later revisions preceding RFC 2002 is due to Jim Solomon and Dave Johnson ๐Ÿ’–.

Thanks to Greg Minshall (Novell), Phil Karn (Qualcomm), Frank Kastenholz (FTP Software), and Pat Calhoun (Sun Microsystems) for their generous support in hosting interim working group meetings ๐Ÿ .

Sections 1.10 and 1.11, which specify new extension formats to be used with aggregatable extension types, were included from a specification document (entitled "Mobile IP Extensions Rationalization (MIER)", which was written by ๐Ÿ“ โœจ

  • Mohamed Khalil (Nortel Networks)
  • Raja Narayanan (nVisible Networks)
  • Haseeb Akhtar (Nortel Networks)
  • Emad Qaddoura (Nortel Networks)

Thanks to these authors, and also for the additional work on MIER, which was contributed by Basavaraj Patil, Pat Calhoun, Neil Justusson, N. Asokan, and Jouni Malinen ๐ŸŽ€.

Thanks to Vijay Devarapalli, who put in many hours to convert the source for this text document into XML format ๐Ÿงš๐Ÿ’œ.


8. References ๐Ÿ“š

8.1. Normative References

[1] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[2] Calhoun, P. and C. Perkins, "Mobile IP Network Access Identifier Extension for IPv4", RFC 2794, March 2000.

[3] Perkins, C., Calhoun, P., and J. Bharatia, "Mobile IPv4 Challenge/Response Extensions (Revised)", RFC 4721, January 2007.

[4] Cong, D., Hamlen, M., and C. Perkins, "The Definitions of Managed Objects for IP Mobility Support using SMIv2", RFC 2006, October 1996.

[5] Deering, S., Ed., "ICMP Router Discovery Messages", RFC 1256, September 1991.

[6] Deering, S., "Host extensions for IP multicasting", STD 5, RFC 1112, August 1989.

[7] Dommety, G. and K. Leung, "Mobile IP Vendor/Organization-Specific Extensions", RFC 3115, April 2001.

[8] Eastlake 3rd, D., Schiller, J., and S. Crocker, "Randomness Requirements for Security", BCP 106, RFC 4086, June 2005.

[9] Kent, S., "IP Authentication Header", RFC 4302, December 2005.

[10] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed-Hashing for Message Authentication", RFC 2104, February 1997.

[11] Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch, "Network Time Protocol Version 4: Protocol and Algorithms Specification", RFC 5905, June 2010.

[12] Montenegro, G., Ed., "Reverse Tunneling for Mobile IP, revised", RFC 3024, January 2001.

[13] Farinacci, D., Li, T., Hanks, S., Meyer, D., and P. Traina, "Generic Routing Encapsulation (GRE)", RFC 2784, March 2000.

[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., "Ethernet Address Resolution Protocol: Or Converting Network Protocol Addresses to 48.bit Ethernet Address 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., "Internet Protocol", STD 5, RFC 791, September 1981.

[19] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, April 1992.

[20] Solomon, J., "Applicability Statement for IP Mobility Support", RFC 2005, October 1996.

[21] Perkins, C., Ed., "IP Mobility Support for IPv4", RFC 3344, August 2002.

[22] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 5226, May 2008.

8.2. Informative References ๐Ÿ“š

  • [23] Solomon, J. and S. Glass, "Mobile-IPv4 Configuration Option for PPP IPCP", RFC 2290, February 1998.
  • [24] Montenegro, G., Dawkins, S., Kojo, M., Magret, V., and N. Vaidya, "Long Thin Networks", RFC 2757, January 2000.
  • [25] Allman, M., Glover, D., and L. Sanchez, "Enhancing TCP Over Satellite Channels using Standard Mechanisms", BCP 28, RFC 2488, January 1999.
  • [26] Paxson, V. and M. Allman, "Computing TCP's Retransmission Timer", RFC 2988, November 2000.
  • [27] Levkowetz, H. and S. Vaarala, "Mobile IP Traversal of Network Address Translation (NAT) Devices", RFC 3519, April 2003.
  • [28] Glass, S. and M. Chandra, "Registration Revocation in Mobile IPv4", RFC 3543, August 2003.
  • [29] Fogelstroem, E., Jonsson, A., and C. Perkins, "Mobile IPv4 Regional Registration", RFC 4857, June 2007.
  • [30] Bellovin, S., "Security Problems in the TCP/IP Protocol Suite", ACM Computer Communications Review, 19(2), March 1989.
  • [31] Border, J., Kojo, M., Griner, J., Montenegro, G., and Z. Shelby, "Performance Enhancing Proxies Intended to Mitigate Link-Related Degradations", RFC 3135, June 2001.
  • [32] Caceres, R. and L. Iftode, "Improving the Performance of Reliable Transport Protocols in Mobile Computing Environments", IEEE Journal on Selected Areas in Communication, 13(5):850-857, June 1995.
  • [33] Dawkins, S., Montenegro, G., Kojo, M., Magret, V., and N. Vaidya, "End-to-end Performance Implications of Links with Errors", BCP 50, RFC 3155, August 2001.
  • [34] Droms, R., "Dynamic Host Configuration Protocol", RFC 2131, March 1997.
  • [35] Ferguson, P. and D. Senie, "Network Ingress Filtering: Defeating Denial of Service Attacks which employ IP Source Address Spoofing", BCP 38, RFC 2827, May 2000.
  • [36] Jacobson, V., "Compressing TCP/IP Headers for Low-Speed Serial Links", RFC 1144, February 1990.
  • [37] Ioannidis, J., Duchamp, D., and G. Maguire, "IP-Based Protocols for Mobile Internetworking", In Proceedings of the SIGCOMM '01 Conference: Communications Architectures and Protocols, pages 235-245, September 1991.
  • [38] Ioannidis, J. and G. Maguire, "The Design and Implementation of a Mobile Internetworking Architecture", In Proceedings of the Winter USENIX Technical Conference, pages 489-500, January 1993.
  • [39] Ioannidis, J., "Protocols for Mobile Internetworking", PhD Dissertation - Columbia University in the City of New York, July 1993.
  • [40] Jacobson, V., "Congestion Avoidance and Control", In Proceedings of the SIGCOMM '88 Workshop, ACM SIGCOMM, ACM Press, pages 314-329, August 1998.
  • [41] McCloghrie, K. and F. Kastenholz, "The Interfaces Group MIB", RFC 2863, June 2000.
  • [42] McGregor, G., "The PPP Internet Protocol Control Protocol (IPCP)", RFC 1332, May 1992.
  • [43] Montenegro, G. and V. Gupta, "Sun's SKIP Firewall Traversal for Mobile IP", RFC 2356, June 1998.
  • [44] Perkins, C., Ed., "IP Mobility Support", RFC 2002, October 1996.
  • [45] Stevens, R., "TCP/IP Illustrated, Volume 1: The Protocols", Addison-Wesley, Reading, Massachusetts, 1994.
  • [46] Perkins, C. and P. Calhoun, "Authentication, Authorization, and Accounting (AAA) Registration Keys for Mobile IPv4", RFC 3957, March 2005.
  • [47] Simpson, W., Ed., "The Point-to-Point Protocol (PPP)", STD 51, RFC 1661, July 1994.
  • [48] IANA, "Mobile IPv4 Numbers", http://www.iana.org.
  • [49] Postel, J., "Multi-LAN address resolution", RFC 925, October 1984.
  • [50] Perkins, C., Ed., "IP Mobility Support for IPv4", RFC 3220, January 2002.

okay so the mobile node MAY use link-layer mechanisms to figure out that its point of attachment has changed ๐Ÿฆ‹ Stuff like the Down/ Testing/Up interface status [41] and changes in cell or administration totally count. These mechanisms are specific to each link-layer technology, and they're outside the scope of this document ๐Ÿ’…

The Point-to-Point-Protocol (PPP) [47] and its Internet Protocol Control Protocol (IPCP) [42] are the ones that negotiate the use of IP addresses ๐Ÿงš

The mobile node SHOULD first try to specify its home address ๐Ÿ  That way, if the mobile node is attaching to its home network, the unrouted link will work correctly. When the home address isn't accepted by the peer, but a transient IP address gets dynamically assigned, and the mobile node is capable of supporting a co-located care-of address, the mobile node MAY register that address as a co-located care-of address ๐Ÿ’– 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. Not me assuming things ๐Ÿ™ˆ

PPP extensions for Mobile IP have been specified in RFC 2290 [23]. Please consult that document for additional details on how to handle care-of address assignment from PPP in a more efficient manner โœจ


Appendix B. TCP Considerations ๐ŸŒธ

B.1. TCP Timers โฑ๏ธ

When high-delay (e.g., SATCOM) or low-bandwidth (e.g., High-Frequency Radio) links are in use, some TCP stacks may have retransmission timeouts that aren't adaptive enough (they're non-standard) ๐Ÿ˜ญ There may be spurious retransmission timeouts even when the link and network are actually operating properly, just with a high delay because of the medium in use. This can cause an inability to create or maintain TCP connections over such links, and it can also cause unneeded retransmissions that eat up already scarce bandwidth. Vendors are encouraged to follow the algorithms in RFC 2988 [26] when implementing TCP retransmission timers ๐Ÿซถ Vendors of systems designed for low-bandwidth, high-delay links should consult RFCs 2757 and 2488 [24], [25]. Designers of applications targeted to run on mobile nodes should be sensitive to the possibility of timer-related difficulties ๐Ÿฆ‹

B.2. TCP Congestion Management ๐Ÿšฆ

Mobile nodes often use media that are more likely to introduce errors, which effectively causes more packets to be dropped. This creates a conflict with the congestion management mechanisms found in modern versions of TCP [40]. Now, when a packet is dropped, the correspondent node's TCP implementation is likely to react as if there were a source of network congestion, and initiate the slow-start mechanisms [40] designed for controlling that problem. However, those mechanisms are inappropriate for overcoming errors introduced by the links themselves, and they end up magnifying the discontinuity introduced by the dropped packet ๐Ÿ’€ This problem has been analyzed by Caceres, et al. [32]. TCP approaches to the problem of handling errors that might interfere with congestion management are discussed in documents from the PILC working group [31] [33]. While such approaches are beyond the scope of this document, they show that providing performance transparency to mobile nodes involves understanding mechanisms outside the network layer ๐ŸŒˆ Problems introduced by higher media error rates also indicate the need to avoid designs that systematically drop packets, even though such designs might otherwise look favorable when making engineering tradeoffs.


Appendix C. Example Scenarios ๐ŸŽ€

This section shows example Registration Requests for several common scenarios ๐Ÿ’œ

C.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:
          An authorization-enabling extension (e.g., the Mobile-Home
            Authentication Extension)

C.2. Registering with a Co-Located Care-of Address ๐Ÿก

The mobile node enters a foreign network that has no foreign agents. The mobile node gets an address from a DHCP server [34] 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

C.3. Deregistration ๐Ÿ‘‹

The mobile node returns home and wants to deregister all 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:
          An authorization-enabling extension (e.g., the Mobile-Home
            Authentication Extension)

Appendix D. Applicability of Prefix-Lengths Extension ๐ŸŒง๏ธ

okay bestie, wireless links are kind of a mess ๐Ÿฅบ their coverage areas are super irregular, so two foreign agents advertising the same prefix might actually give mobile nodes totally different connectivity. so the Prefix-Lengths Extension SHOULD NOT be included in advertisements from agents in that kind of setup. caution is giving ๐Ÿ’…

foreign agents on different wireless interfaces would need to team up with special protocols to get identical coverage in space, and only then could they claim their wireless interfaces are on the same subnetwork. wired interfaces are a different story ๐Ÿ”Œ a mobile node that unplugs and plugs into a new point of attachment may send a new Registration Request, even if the new advertisement is on the same medium as the last one it recorded.

and finally, in areas packed with foreign agents, it would seem unwise to make routing protocols spread the subnet prefix for every single wireless foreign agent ๐Ÿ™ƒ that could quickly eat up all the space in routing tables, make routing updates take forever to process, and slow down route selection, if routes (which are almost always unnecessary) get stored for wireless "subnets". nobody needs that drama ๐Ÿ˜ญ


Appendix E. Interoperability Considerations ๐Ÿค

this document revises RFC 2002 to fix the ambiguities in the earlier text, so interop gets better โœจ implementations that do authentication using the new, more precisely specified algorithm can still talk to earlier implementations that did what was originally expected when producing authentication data. that used to be a major source of non-interop, so this is a glow-up ๐ŸŒธ

BUT ngl, some of the new features cause problems with older implementations if you actually use them ๐Ÿ’€ every feature from RFC 2002 works with the new implementations, except for V-J compression [36]. here's the lowdown on where compatibility can get messy for nodes following this revised spec when they try to interoperate with RFC 2002 nodes:

  • a client that expects some of the newly mandatory features (like reverse tunneling) from a foreign agent (FA) is still interoperable, as long as it pays attention to the 'T' bit ๐ŸŽ€
  • mobile nodes (MNs) that use the NAI extension to identify themselves won't work with old mobility agents ๐Ÿ˜ค
  • mobile nodes that use a zero home address and expect to get their home address in the Registration Reply won't work with old mobility agents ๐Ÿ’”
  • mobile nodes that try to authenticate without using the Mobile-Home authentication extension won't be able to register with their home agent ๐Ÿšซ

in all of these cases, a robust and well-configured mobile node can usually recover if it takes sensible action when it gets a Registration Reply with an error code telling it why it was rejected ๐Ÿงš for example, if a mobile node sends a Registration Request that gets rejected because it has the wrong kind of authentication extension, it can just retry the registration with a mobile-home authentication extension. the foreign agent and/or home agent in that case won't be set up to demand the other authentication data, so the retry is the move ๐Ÿ™Œ


Appendix F. Changes since RFC 3344 ๐Ÿ“

these are the revisions to details of the specification in this document made after RFC 3344 was published ๐ŸŒˆ if you want the list of changes from RFC 2002 that happened while RFC 3344 was being developed, check out RFC 3344 [21]. for items marked with issue numbers, the MIP4 mailing list archives have more info ๐Ÿ“ฌ

  • showed more bit definitions in the Agent Advertisement message structure (see Section 2.1.1) ๐Ÿฆ‹ new advertisement bits got defined by other spec documents but never made it into earlier publications of this spec, which caused confusion. the citations for those other documents are included now too
  • (Issue 6) the home agent's behavior changed so it doesn't have to mandate error replies to Registration Requests that were invalidated because the foreign agent failed authentication ๐Ÿ›ก๏ธ the goal is to make the home agent sturdier against Denial of Service attacks, where the bad device has zero plans to send a valid Registration Request and just wants to clog traffic on the home network. see Section 3.8.2.1
  • because IPv4 addresses aren't uniquely assigned in lots of domains, different mobile nodes can end up with the same home address ๐Ÿซ  if they use the NAI, the foreign agent can still tell them apart. wording was added to Section 3.7.1 and Section 3.7.3.1 saying that the foreign agent MUST use the NAI to distinguish mobile nodes that share a home address
  • (Issue 45) specified that a foreign agent MUST NOT apply a Foreign-Home Authentication extension to a mobile node's deregistration request. also, the foreign agent MUST NOT apply a Foreign-Home Authentication extension unless the Care-of Address in the Registration Request matches an address the foreign agent advertised ๐Ÿšฆ
  • specified that the Mobility Security Association used by the foreign agent and home agent depends on values in the message data, not the IP headers ๐Ÿง 
  • (Issues 9, 18) created a new error code for the foreign agent, for when it doesn't serve the mobile node as a home agent. before this, the foreign agent could use an error Code of 136 for that case ๐Ÿ”ข
  • (Issue 17) specified that if the home agent can't support the requested nonzero unicast address in the Home Address field of the Registration Request, then it MUST reject the registration with an error Code of 129. see Section 3.8.3.2 ๐Ÿšซ
  • (Issue 19) specified that multiple authorization-enabling extensions may show up in the Registration Request message, but the home agent has to (somehow) make sure they've all been checked. see Section 3.8.3.1 ๐Ÿ•ต๏ธ
  • (Issue 20) specified that the foreign agent SHOULD NOT modify any of the fields of the Registration Reply message that are covered by the Mobile-Home Authentication Extension when it relays the packet to the mobile node ๐Ÿค
  • (Issue 21) clarified that the foreign agent removes extensions that don't precede any authorization-enabling extension, not just the Mobile-Home Authentication extension (Section 3.7.3.2) ๐Ÿงน
  • (Issue 44) specified that the address the foreign agent advertises in Agent Advertisements is the care-of address offered on that network interface, not necessarily the address of the network interface itself (Section 3.7.2.2) ๐Ÿ“
  • (Issue 45) clarified in Section 3.7.2.1 that Code 77 can only apply to a Registration Request with a nonzero Lifetime โณ
  • created a new error code for when a foreign agent can detect that the Home Agent address field is incorrect ๐Ÿšจ
  • prohibited the use of the Foreign-Home Authorization Extension on deregistration messages ๐Ÿ™…โ€โ™€๏ธ
  • cleaned up some more wording about authorization-enabling extensions ๐Ÿงฝ
  • for consistency, changed some wording about copying UDP ports ๐Ÿ”Œ
  • added wording to clearly not rule out dynamically configuring netmask and security information at the mobile node ๐ŸŽ›๏ธ
  • revamped the Changes section ๐Ÿ’…
  • updated citations ๐Ÿ“š

Appendix G. Example Messages ๐ŸŽ€

G.1. Example ICMP Agent Advertisement Message Format ๐Ÿ“

ok this is the cutest little diagram of what an ICMP Agent Advertisement message looks like, field by field ๐Ÿฅฐ

     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |     Type      |     Code      |           Checksum            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |   Num Addrs   |Addr Entry Size|           Lifetime            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                       Router Address[1]                       |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                      Preference Level[1]                      |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                       Router Address[2]                       |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                      Preference Level[2]                      |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                        ....                                   |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |   Type = 16   |     Length    |      Sequence Number          |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |    Registration Lifetime      |R|B|H|F|M|G|r|T|U|X|I|reserved |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                     Care-of Address[1]                        |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                     Care-of Address[2]                        |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                         ....                                  |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    :                     Optional  Extensions                      :
    :   ....                ......                      ......      :
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

G.2. Example Registration Request Message Format ๐ŸŽ€

okay so the UDP header is followed by the Mobile IP fields, and this is the layout bestie. the first row has Type = 1, the S/B/D/M/G/r/T/x flag bits, and Lifetime. then you get Home Address, Home Agent, Care-of Address, and the 64-bit Identification field ๐Ÿซถ after that comes the optional non-auth extensions for the HA, and then the MN-HA Authenticator with its SPI โœจ

     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 = 1  |S|B|D|M|G|r|T|x|          Lifetime             |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                          Home Address                         |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                           Home Agent                          |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                        Care-of Address                        |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                                                               |
    +                         Identification                        +
    |                                                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                Optional Non-Auth Extensions for HA ...        |
    |                     ( variable length )                       |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |   Type = 32   |      Length   |           SPI                 |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |          SPI (cont.)          |                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               |
    :         MN-HA Authenticator ( variable length )               :
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    :           Optional  Non-Auth Extensions for FA .........
    :           Optional  MN-FA  Authentication Extension...
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

G.3. Example Registration Reply Message Format ๐Ÿงš

the UDP header goes first again, then the Mobile IP fields. this reply starts with Type = 3, then Code and Lifetime. after that it's the same vibe as the request: Home Address, Home Agent, the Identification field, the optional HA non-auth extensions, and then the Type = 32 SPI and MN-HA Authenticator stuff. at the bottom you get the optional extensions used by the FA plus the MN-FA Authentication Extension ๐Ÿ’œ

     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |   Type = 3    |     Code      |           Lifetime            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                          Home Address                         |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                           Home Agent                          |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                                                               |
    +                         Identification                        +
    |                                                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                 Optional  HA  Non-Auth Extensions ...         |
    |                     ( variable length )                       |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |   Type = 32   |      Length   |           SPI                 |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |          SPI (cont.)          |                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               |
    :         MN-HA Authenticator ( variable length )               :
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    :           Optional  Extensions used by FA.........
    :           Optional  MN-FA Authentication Extension...
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Author's Address ๐Ÿ’Œ

Charles E. Perkins (editor) ๐ŸŒธ WiChorus Inc. 3590 N. 1st Street, Suite 300 San Jose, CA 95134 USA

EMail: charliep@computer.org ๐Ÿ’–

๐Ÿ“ฆ where this page comes from