RFC 3220

IP Mobility Support for IPv4

๐Ÿ“… published January 2002, from ietf

IP Mobility Support for IPv4 ๐Ÿฆ‹

Okay bestie, this one is RFC 3220 and it's giving mobile IP realness ๐Ÿ’– It was written by C. Perkins, Ed., from the Nokia Research Center, dated January 2002, and it's on the Standards Track ๐ŸŽ€ It obsoletes RFC 2002, so if you see that older one floating around, this is the one you want โœจ

Status of this Memo ๐Ÿ“œ

This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited.

Copyright (C) The Internet Society (2002). All Rights Reserved.

Abstract ๐Ÿ’…

Okay so this section is the elevator pitch ๐Ÿ›— It sets up protocol enhancements that let IP datagrams get routed transparently to mobile nodes on the Internet. Each mobile node is always identified by its home address, no matter where it's plugged in right now ๐Ÿ  While it's away from home, it also gets a care-of address, which tells everyone where it currently is attached to the Internet ๐Ÿ“ The protocol lets you register that care-of address with a home agent. The home agent then sends datagrams meant for the mobile node through a tunnel to the care-of address, and once they reach the end of the tunnel, each datagram gets delivered to the mobile node ๐Ÿš‡๐Ÿ’œ

Contents ๐ŸŽ€

1. Introduction                                                     3
    1.1. Protocol Requirements . . . . . . . . . . . . . . . . .    4
    1.2. Goals . . . . . . . . . . . . . . . . . . . . . . . . .    4
    1.3. Assumptions . . . . . . . . . . . . . . . . . . . . . .    5
    1.4. Applicability . . . . . . . . . . . . . . . . . . . . .    5
    1.5. New Architectural Entities  . . . . . . . . . . . . . .    5
    1.6. Terminology . . . . . . . . . . . . . . . . . . . . . .    6
    1.7. Protocol Overview . . . . . . . . . . . . . . . . . . .    9
    1.8. Message Format and Protocol Extensibility . . . . . . .   13
    1.9. Type-Length-Value Extension Format for Mobile IP
            Extensions . . . . . . . . . . . . . . . . . . . . .   15
   1.10. Long Extension Format . . . . . . . . . . . . . . . . .   16
   1.11. Short Extension Format  . . . . . . . . . . . . . . . .   16
2. Agent Discovery                                                 17
    2.1. Agent Advertisement . . . . . . . . . . . . . . . . . .   18
          2.1.1. Mobility Agent Advertisement Extension  . . . .   20
          2.1.2. Prefix-Lengths Extension  . . . . . . . . . . .   22
          2.1.3. One-byte Padding Extension  . . . . . . . . . .   22
    2.2. Agent Solicitation  . . . . . . . . . . . . . . . . . .   23
    2.3. Foreign Agent and Home Agent Considerations . . . . . .   23
          2.3.1. Advertised Router Addresses . . . . . . . . . .   24
          2.3.2. Sequence Numbers and Rollover Handling  . . . .   24
    2.4. Mobile Node Considerations  . . . . . . . . . . . . . .   25
          2.4.1. Registration Required . . . . . . . . . . . . .   26
          2.4.2. Move Detection  . . . . . . . . . . . . . . . .   26
          2.4.3. Returning Home  . . . . . . . . . . . . . . . .   27
          2.4.4. Sequence Numbers and Rollover Handling  . . . .   28
3. Registration                                                    28
    3.1. Registration Overview . . . . . . . . . . . . . . . . .   29
    3.2. Authentication  . . . . . . . . . . . . . . . . . . . .   30
    3.3. Registration Request  . . . . . . . . . . . . . . . . .   30
    3.4. Registration Reply  . . . . . . . . . . . . . . . . . .   33
    3.5. Registration Extensions . . . . . . . . . . . . . . . .   36
          3.5.1. Computing Authentication Extension Values . . .   36
          3.5.2. Mobile-Home Authentication Extension  . . . . .   37
          3.5.3. Mobile-Foreign Authentication Extension . . . .   37
          3.5.4. Foreign-Home Authentication Extension . . . . .   38
    3.6. Mobile Node Considerations  . . . . . . . . . . . . . .   38
          3.6.1. Sending Registration Requests . . . . . . . . .   40
          3.6.2. Receiving Registration Replies  . . . . . . . .   43
          3.6.3. Registration Retransmission . . . . . . . . . .   46
    3.7. Foreign Agent Considerations  . . . . . . . . . . . . .   46
          3.7.1. Configuration and Registration Tables . . . . .   47
          3.7.2. Receiving Registration Requests . . . . . . . .   48
          3.7.3. Receiving Registration Replies  . . . . . . . .   51
    3.8. Home Agent Considerations . . . . . . . . . . . . . . .   53
          3.8.1. Configuration and Registration Tables . . . . .   54
          3.8.2. Receiving Registration Requests . . . . . . . .   55
          3.8.3. Sending Registration Replies  . . . . . . . . .   58
4. Routing Considerations                                          61
    4.1. Encapsulation Types . . . . . . . . . . . . . . . . . .   61
    4.2. Unicast Datagram Routing  . . . . . . . . . . . . . . .   61
          4.2.1. Mobile Node Considerations  . . . . . . . . . .   61
          4.2.2. Foreign Agent Considerations  . . . . . . . . .   62
          4.2.3. Home Agent Considerations . . . . . . . . . . .   63
    4.3. Broadcast Datagrams . . . . . . . . . . . . . . . . . .   65
    4.4. Multicast Datagram Routing  . . . . . . . . . . . . . .   65
    4.5. Mobile Routers  . . . . . . . . . . . . . . . . . . . .   66
    4.6. ARP, Proxy ARP, and Gratuitous ARP  . . . . . . . . . .   68
5. Security Considerations                                         72

    5.1. Message Authentication Codes  . . . . . . . . . . . . .   72
    5.2. Areas of Security Concern in this Protocol  . . . . . .   72
    5.3. Key Management  . . . . . . . . . . . . . . . . . . . .   73
    5.4. Picking Good Random Numbers . . . . . . . . . . . . . .   73
    5.5. Privacy . . . . . . . . . . . . . . . . . . . . . . . .   73
    5.6. Ingress Filtering . . . . . . . . . . . . . . . . . . .   74
    5.7. Replay Protection for Registration Requests . . . . . .   74
          5.7.1. Replay Protection using Timestamps  . . . . . .   74
          5.7.2. Replay Protection using Nonces  . . . . . . . .   76
6. IANA Considerations                                             76
    6.1. Mobile IP Message Types . . . . . . . . . . . . . . . .   77
    6.2. Extensions to RFC 1256 Router Advertisement . . . . . .   77
    6.3. Extensions to Mobile IP Registration Messages . . . . .   78
    6.4. Code Values for Mobile IP Registration Reply
             Messages. . . . . . . . . . . . . . . . . . . . . .   78
7. Acknowledgments                                                 79
A. Patent Issues                                                   81
B. Link-Layer Considerations                                       81
C. TCP Considerations                                              82
    C.1. TCP Timers  . . . . . . . . . . . . . . . . . . . . . .   82
    C.2. TCP Congestion Management . . . . . . . . . . . . . . .   82
D. Example Scenarios                                               83
    D.1. Registering with a Foreign Agent Care-of Address  . . .   83
    D.2. Registering with a Co-Located Care-of Address . . . . .   83
    D.3. Deregistration  . . . . . . . . . . . . . . . . . . . .   84
E. Applicability of Prefix-Lengths Extension                       85
F. Interoperability Considerations                                 85
G. Changes since RFC 2002                                          86
    G.1. Major Changes . . . . . . . . . . . . . . . . . . . . .   86
    G.2. Minor Changes . . . . . . . . . . . . . . . . . . . . .   88
    G.3. Changes since revision 04 of RFC2002bis . . . . . . . .   90
H. Example Messages                                                91
    H.1. Example ICMP Agent Advertisement Message Format . . . .   91
    H.2. Example Registration Request Message Format . . . . . .   92
    H.3. Example Registration Reply Message Format . . . . . . .   93
References  . . . . . . . . . . . . . . . . . . . . . . . . . . .  93
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . .   97
Full Copyright Statement . . . . . . . . . . . . . . . . . . . .   98

1. Introduction โœจ

Okay so IP version 4 basically assumes that a node's IP address uniquely tells you where it's plugged in ๐Ÿ”Œ That means a node has to be sitting on the network its IP address points to in order to receive datagrams meant for it. If it isn't, those datagrams are undeliverable, and that's a whole mess ๐Ÿ™ˆ So if a node wants to switch its point of attachment without losing the ability to communicate, right now one of two mechanisms usually has to be used:

  • a) the node must change its IP address whenever it changes its point of attachment, or
  • b) host-specific routes must be propagated throughout much of the Internet routing fabric.

Both of these are often unacceptable, bestie ๐Ÿ’€ The first one makes it impossible for a node to keep its transport and higher-layer connections alive when it moves location. The second one has obvious and severe scaling problems, which is extra relevant given the explosive growth in sales of notebook (mobile) computers ๐Ÿ’ป

So we need a new, scalable mechanism for handling node mobility on the Internet, and this document is literally that ๐Ÿฆ‹ It lets nodes change their point of attachment to the Internet without changing their IP address. Iconic ๐Ÿ‘‘

Changes between this revised specification for Mobile IP and the original specifications (see [33, 32, 34, 43, 8]) are detailed in the appendix section G ๐Ÿ“

1.1. Protocol Requirements ๐ŸŽ€

Okay, the first main requirement is that a mobile node must be able to keep talking to other nodes after it changes its link-layer point of attachment to the Internet, and it has to do that without changing its IP address ๐Ÿ™Œ

A mobile node must also be able to communicate with other nodes that do not implement these mobility functions. No protocol enhancements are required in hosts or routers that are not acting as any of the new architectural entities introduced in Section 1.5 ๐Ÿซถ

Finally, all messages used to update another node about the location of a mobile node must be authenticated, so you're protected against remote redirection attacks ๐Ÿ” Not me being the one who forgot the auth ๐Ÿ˜ญ

1.2. Goals ๐ŸŒธ

The link that directly attaches a mobile node to the Internet may often be a wireless link, and that means it can have a substantially lower bandwidth and higher error rate than traditional wired networks ๐Ÿ“ถ Plus, mobile nodes are likely to be battery powered, so minimizing power consumption is important ๐Ÿ”‹

Because of that, the number of administrative messages sent over the link that directly attaches a mobile node to the Internet should be minimized, and those messages should be kept as small as is reasonably possible ๐Ÿ“

1.3. Assumptions ๐Ÿงš

The protocols in this document place no additional constraints on the assignment of IP addresses. That means a mobile node can be assigned an IP address by the organization that owns the machine ๐Ÿข

This protocol assumes that mobile nodes will generally not change their point of attachment to the Internet more frequently than once per second โฑ๏ธ

And this protocol assumes that IP unicast datagrams are routed based on the destination address in the datagram header (and not, for example, by source address) ๐Ÿ’œ

1.4. Applicability ๐Ÿฆ‹

okay so Mobile IP is built for nodes moving from one IP subnet to another ๐Ÿš—๐Ÿ’จ and it's just as iconic for moving across the same kind of media as it is across different kinds. Mobile IP helps a node hop from one Ethernet segment to another, and it's equally happy helping a node go from an Ethernet segment to a wireless LAN ๐Ÿ“ถ, as long as the mobile node's IP address stays the same after the move. main character energy, fr ๐Ÿ’–

ngl, Mobile IP is really giving "macro" mobility management ๐ŸŒ. It's less of a fit for "micro" mobility management stuff ๐Ÿ™ˆ, like handoff between wireless transceivers that each only cover a tiny geographic 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) may be faster to converge and way less overhead than Mobile IP โšก. so it's all about picking the right tool, bestie ๐Ÿงš

1.5. New Architectural Entities ๐ŸŒธ

okay so Mobile IP introduces the following new functional entities, and they're the main cast of this whole show ๐Ÿ‘‘:

  • Mobile Node: A host or router that changes its point of attachment from one network or subnetwork to another. A mobile node may change its location without changing its IP address ๐ŸŽ€. It can keep talking to other Internet nodes from any location using its (constant) IP address, assuming 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 maintains current location information for the mobile node ๐Ÿ“.
  • 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 the datagrams that were tunneled by the mobile node's home agent ๐Ÿ“ฆ. For datagrams sent by a mobile node, the foreign agent may serve as a default router for registered mobile nodes ๐Ÿ’œ.

okay so 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 it's away from its home network, a "care-of address" gets associated with the mobile node 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 describes otherwise for datagrams sent for certain mobility management functions (e.g., as in Section 3.6.1.1) ๐Ÿ™Œ.


1.6. Terminology ๐Ÿ’–

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 [4] ๐Ÿ“š. These are the key words, so pay close attention to them ๐Ÿ‘€.

In addition, this document frequently uses the following terms ๐Ÿง :

  • Authorization-enabling extension: An authentication which makes a (registration) message acceptable to the ultimate recipient of the registration message. An authorization-enabling extension MUST contain an SPI โœจ.

In this document, all uses of authorization-enabling extension refer to authentication extensions that enable the Registration Request message to be acceptable to the home agent. Using additional protocol structures specified outside of this document, it may be possible for the mobile node to provide authentication of its registration to the home agent, by way of another authenticating entity within the network that is acceptable to the home agent (for example, see RFC 2794 [6]) ๐Ÿ”.

  • Agent Advertisement: An advertisement message constructed by attaching a special Extension to a router advertisement [10] message ๐Ÿ“ฃ.
  • Authentication: The process of verifying (using cryptographic techniques, for all applications in this specification) the identity of the originator of a message ๐Ÿ•ต๏ธโ€โ™€๏ธ.
  • Care-of Address: The termination point of a tunnel toward a mobile node, for datagrams forwarded to the mobile node while it is away from home ๐ŸŽฏ. The protocol can use two different types of care-of address: a "foreign agent care-of address" is an address of a foreign agent with which the mobile node is registered, and a "co-located care-of address" is an externally obtained local address which the mobile node has associated with one of its own network interfaces ๐Ÿชž.
  • Correspondent Node: A peer with which a mobile node is communicating. A correspondent node may be either mobile or stationary ๐Ÿค.
  • Foreign Network: Any network other than the mobile node's Home Network ๐ŸŒ.
  • Gratuitous ARP: An ARP packet sent by a node in order to spontaneously cause other nodes to update an entry in their ARP cache [45]. See section 4.6 ๐Ÿ“จ.
  • Home Address: An IP address that is assigned for an extended period of time to a mobile node. It remains unchanged regardless of where the node is attached to the Internet ๐Ÿท๏ธ.
  • Home Network: A network, possibly virtual, having 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 ๐Ÿ ๐Ÿ’Œ.
  • Link: A facility or medium over which nodes can communicate at the link layer. A link underlies the network layer ๐Ÿงต.
  • Link-Layer Address: 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 โณ.
  • 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 ๐ŸŽฒ.
  • 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 ๐Ÿšซ. (not me being so strict about the reserved range ๐Ÿ’€)
  • Tunnel: The path followed by a datagram while it is encapsulated. The model is that, while it is encapsulated, a datagram is routed to a knowledgeable decapsulating agent, which decapsulates the datagram and then correctly delivers it to its ultimate destination ๐Ÿš‡.
  • 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 ๐Ÿ›ฐ๏ธ.
  • 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 ๐Ÿ“.

1.7. Protocol Overview ๐ŸŒธ

okay so let's talk about how Mobile IP actually works ๐Ÿฆ‹ It has three support services, and they're the building blocks for everything else:

  • Agent Discovery ๐Ÿ”: Home agents and foreign agents may advertise their availability on each link where they provide service. A newly arrived mobile node can send a solicitation on the link to find out if any prospective agents are around.
  • 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 register either directly with its home agent, or through a foreign agent that forwards the registration to the home agent.
  • silently discard ๐Ÿคซ: The implementation throws away the datagram without further processing, and without telling the sender there was an error. The implementation SHOULD be able to log the error, including the contents of the discarded datagram, and SHOULD record the event in a statistics counter.

Now for the rough outline of how Mobile IP goes down, step by step ๐Ÿ’–

  • Mobility agents (that is, foreign agents and home agents) announce that they're around by sending Agent Advertisement messages (Section 2). A mobile node may optionally ask for an Agent Advertisement from any locally attached mobility agents by sending an Agent Solicitation message.
  • The mobile node gets these Agent Advertisements and figures out whether it's on its home network or a foreign network. ๐Ÿ‘€
  • When the mobile node realizes it's back on its home network, it stops using mobility services altogether. If it's coming home from being registered somewhere else, it deregisters with its home agent by swapping a Registration Request and a Registration Reply message with it.
  • When a mobile node notices it's moved to a foreign network, it gets a care-of address on that foreign network. This care-of address can come from a foreign agent's advertisements (a foreign agent care-of address), or from some external assignment mechanism such as DHCP [13] (a co-located care-of address). ๐Ÿงณ
  • The mobile node that's away from home then registers its new care-of address with its home agent by exchanging a Registration Request and a Registration Reply message with it, possibly through a foreign agent (Section 3). โœจ
  • Datagrams sent to the mobile node's home address get intercepted by its home agent, tunneled by the home agent to the mobile node's care-of address, received at the tunnel endpoint (either at a foreign agent or at the mobile node itself), and finally delivered to the mobile node (Section 4.2.3). ๐ŸŽ€
  • Going the other way, datagrams sent by the mobile node usually get delivered to their destination using standard IP routing mechanisms, and they don't necessarily have to go through the home agent. ๐Ÿƒโ€โ™€๏ธ

When the mobile node is away from home, Mobile IP uses protocol tunneling to hide the 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. That care-of address has to be an address that datagrams can actually be delivered to via conventional IP routing. Once a datagram gets to the care-of address, the original datagram is pulled out of the tunnel and delivered to the mobile node. ๐Ÿ“ฆ

Mobile IP gives you two alternative modes for getting a care-of address ๐Ÿ‘‘

  • a) A "foreign agent care-of address" is a care-of address that a foreign agent provides 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 endpoint of the tunnel, and when it receives tunneled datagrams, it decapsulates them and delivers the inner datagram to the mobile node. This mode is the one that's preferred, because it lets lots of mobile nodes share the same care-of address, so it doesn't put extra pressure on the already limited IPv4 address space. ๐Ÿ’…
  • b) A "co-located care-of address" is a care-of address that the mobile node gets as a local IP address through some external means, and then associates with one of its own network interfaces. The address might be dynamically acquired as a temporary address by the mobile node, such as through DHCP [13], or it might be a long-term address the mobile node owns and only uses while visiting some foreign network. Specific external methods for acquiring a local IP address to use as a co-located care-of address are beyond the scope of this document. When using a co-located care-of address, the mobile node is the endpoint of the tunnel and does the decapsulation of the datagrams tunneled to it itself. ๐Ÿงš

The co-located mode is great because it lets a mobile node work without a foreign agent, which is super handy in networks that haven't deployed a foreign agent yet ๐ŸŒˆ The catch is that it puts extra strain on the IPv4 address space, since it needs a pool of addresses within the foreign network to be made available to visiting mobile nodes. And honestly, it's hard to keep 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 could be an address of a foreign agent (a foreign agent care-of address), or it could 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.

Here's figure 1, which 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. ๐Ÿฆ‹

           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

A home agent MUST be able to attract and intercept datagrams that are destined to the home address of any of its registered mobile nodes ๐Ÿšจ Using the proxy and gratuitous ARP mechanisms described in Section 4.6, this requirement can be satisfied if the home agent has a network interface on the link indicated by the mobile node's home address. Other placements of the home agent relative to the mobile node's home location MAY also be possible using other mechanisms for intercepting datagrams destined to the mobile node's home address. Such placements are beyond the scope of this document. ๐Ÿ 

Similarly, a mobile node and a prospective or current foreign agent MUST be able to exchange datagrams without relying on standard IP routing mechanisms ๐Ÿ’œ That means 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, and they address the underlying link-layer packets to their respective link-layer addresses. Other placements of the foreign agent relative to the mobile node MAY also be possible using other mechanisms to exchange datagrams between these nodes, but such placements are beyond the scope of this document. ๐Ÿ“

Last but not least, if a mobile node is using a co-located care-of address (as described in (b) above), the mobile node MUST be located on the link identified by the network prefix of this care-of address ๐Ÿ”ฅ Otherwise, datagrams destined to the care-of address would be undeliverable, and nobody wants that ๐Ÿ’€

1.8. Message Format and Protocol Extensibility โœจ

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

1  Registration Request
3  Registration Reply

Up-to-date values for the Mobile IP control message types live in the most recent "Assigned Numbers" [40]. Bookmark that one bestie ๐Ÿ”–

For Agent Discovery, Mobile IP also borrows the Router Advertisement and Router Solicitation messages from ICMP Router Discovery [10]. Love a good reuse moment ๐Ÿฆ‹

Mobile IP also has a general Extension mechanism, which lets optional info ride along in Mobile IP control messages or in ICMP Router Discovery messages ๐Ÿงš Some extensions are encoded in the simple Type-Length-Value format from Section 1.9. Extensions can carry a variable amount of info in each datagram, and the list of Extensions ends when you reach the total length of the IP datagram ๐ŸŒˆ

There are two separate numbering spaces that Extension Type values come from, and they're kept apart on purpose ๐Ÿ‘‘

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

Each individual Extension gets its own detailed section later in this document. Up-to-date values for these Extension Type numbers are also in the most recent "Assigned Numbers" [40] ๐Ÿ“š

Because the two sets are kept apart (orthogonal), it's actually possible for two Extensions defined later to share the same Type value ๐Ÿ™ˆ As long as one is only used in Mobile IP control messages and the other is only used in ICMP Router Discovery messages, all good โœจ

The type field in the Mobile IP extension structure can support up to 255 uniquely identifiable extensions, both skippable and not skippable ๐Ÿ’– When an Extension from either set with a number from 0 through 127 shows up but isn't recognized, the message containing it MUST be silently discarded ๐Ÿ’€ When an Extension numbered 128 through 255 shows up and isn't recognized, that one Extension is ignored, but the rest of the Extensions and message data MUST still be processed ๐Ÿซถ The Length field tells you how far to skip the Data field so you can find the next Extension ๐Ÿƒโ€โ™€๏ธ

Now here's the thing ๐Ÿ‘€ Unless extension types get some extra structure, new developments might need so many extensions that the space for extension types runs out ๐Ÿ˜ญ Two new extension structures are proposed to fix that. Some types can be aggregated, using subtypes to pin down the exact extension, the same way the Generic Authentication Keys extensions [35] did it. In many cases this can slow down how fast new values get allocated for the type field ๐ŸŒธ

And since the new extension structures use the extension type space efficiently, it is recommended that new Mobile IP extensions follow one of these two new formats whenever they might be grouped together with related extensions ๐ŸŽ€

This section has 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 what this document uses for the Extensions it specifies. This simple 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 formats in sections 1.10 or 1.11 whenever they might be grouped with related extensions ๐Ÿ“

    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

  • Type tells you the particular kind of Extension.
  • Length is the length (in bytes) of the data field inside this Extension. The length does not include the Type and Length bytes.
  • Data is the particular data for this Extension. This field can be zero or more bytes long. Its format and length are decided by the type and length fields.

1.10. Long Extension Format ๐Ÿข

This format is for non-skippable extensions that carry more than 256 bytes of info ๐Ÿ’…

     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 needs these fields to come first in the extension:

  • Type is the type. It describes a collection of extensions that share a common data type.
  • Sub-Type is a unique number given to each member of the aggregated type.
  • Length is the length (in bytes) of the data field inside this Extension. It does not include the Type, Length, and Sub-Type bytes.
  • Data is the data tied to this extension's subtype. This specification doesn't put any extra structure on the subtype data.

Since the length field is 16 bits wide, the extension data can go past 256 bytes, which is the whole point ๐Ÿ™Œ


1.11. Short Extension Format ๐Ÿง

This format works with the skippable extensions from section 1.9. It isn't for extensions that need more than 256 bytes of data. For those, use the format in section 1.10 instead ๐Ÿซถ

     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 needs these fields to come first in the extension:

  • Type is the type. It describes a collection of extensions that share a common data type.
  • Sub-Type is a unique number given to each member of the aggregated type.
  • Length is an 8-bit unsigned integer: the length of the extension in bytes, not counting the extension Type and extension Length fields. This field MUST be set to 1 plus the total length of the data field ๐Ÿ”ข
  • Data is the data for this extension. This specification doesn't put any extra structure on the subtype data.

2. Agent Discovery ๐Ÿ”

Agent Discovery is how a mobile node figures out whether it's currently hanging out on its home network or on a foreign network ๐Ÿ โœˆ๏ธ It's also how a mobile node can tell when it has moved from one network to another. When it's connected to a foreign network, these methods also let the mobile node find the foreign agent care-of address that each foreign agent on that network is offering ๐Ÿ’Œ

Mobile IP uses ICMP Router Discovery [10] as its main tool for Agent Discovery ๐Ÿ› ๏ธ An Agent Advertisement is made by putting a Mobility Agent Advertisement Extension inside an ICMP Router Advertisement message (Section 2.1). An Agent Solicitation message is the same as an ICMP Router Solicitation, except its IP TTL MUST be set to 1 (Section 2.2). This section describes the message formats and the procedures mobile nodes, foreign agents, and home agents use together to make Agent Discovery work ๐Ÿฅฐ

Agent Advertisement and Agent Solicitation may not be needed for link layers that already provide this functionality ๐Ÿ’โ€โ™€๏ธ How mobile nodes set up link-layer connections with possible agents is outside the scope of this document (but see Appendix B). The procedures below assume that link-layer connectivity is already set up ๐ŸŒˆ

No authentication is required for Agent Advertisement and Agent Solicitation messages ๐Ÿ™…โ€โ™€๏ธ They MAY be authenticated using the IP Authentication Header [22], which is unrelated to the messages described in this document. How Advertisement and Solicitation messages may be authenticated is outside the scope of this document, so we'll leave that for another day ๐Ÿ”

2.1. Agent Advertisement โœจ

Agent Advertisements are sent by a mobility agent to show off its services on a link. Mobile nodes use them to figure out where they're plugged into the Internet right now ๐Ÿ“ก. An Agent Advertisement is an ICMP Router Advertisement that's been glammed up with 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 any other Extensions that might be defined in the future ๐ŸŽ€

Inside an Agent Advertisement, the ICMP Router Advertisement fields are required to conform to the following 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 it. No mixing and matching ๐Ÿ™ˆ
  • IP Fields
    • TTL: The TTL for all Agent Advertisements MUST be set to 1. Strictly local, bestie ๐Ÿฆ‹
    • Destination Address: As spelled out for ICMP Router Discovery [10], the IP destination address of a multicast Agent Advertisement MUST be either the "all systems on this link" multicast address (224.0.0.1) [11] or the "limited broadcast" address (255.255.255.255). The subnet-directed broadcast address of the form <prefix>.<-1> can't be used, because mobile nodes generally won't know the prefix of the foreign network ๐Ÿ™…โ€โ™€๏ธ. When an Agent Advertisement is unicast to a mobile node, the IP home address of that mobile node SHOULD be used as the Destination Address ๐Ÿ’Œ
  • ICMP Fields
    • Code: The Code field of the agent advertisement is read like this:
      • 0: The mobility agent handles common traffic. In other words, it acts as a router for IP datagrams that aren't 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 they receive from a registered mobile node (Section 4.2.2). Main character energy, but make sure they still deliver ๐Ÿ“ฆ
    • Lifetime: The maximum length of time the Advertisement is considered valid when no further Advertisements show up โณ
    • Router Address(es): See Section 2.3.1 for the scoop on which addresses can appear in this part of the Agent Advertisement ๐Ÿ‘€
    • Num Addrs: The number of Router Addresses advertised in this message. Quick heads-up: in an Agent Advertisement, the number of router addresses in the ICMP Router Advertisement portion MAY be set to 0. See Section 2.3.1 for details ๐Ÿงš

If it's sent periodically, the nominal interval between Agent Advertisements SHOULD be no longer than 1/3 of the advertisement Lifetime given in the ICMP header. It MAY be shorter than 1/3 of the advertised Lifetime. Why 1/3? It lets a mobile node miss three advertisements in a row before it deletes the agent from its list of valid agents, which is honestly so smart ๐Ÿง โœจ The actual transmission time for each advertisement SHOULD be slightly randomized [10] so agents don't all send at the same moment and crash into each other's Agent Advertisements (or into Router Advertisements from other routers) ๐Ÿ’ฅ Note that this field has nothing to do with the "Registration Lifetime" field in the Mobility Agent Advertisement Extension below. Don't mix those two up, bestie ๐Ÿซถ

2.1.1. Mobility Agent Advertisement Extension ๐ŸŒˆ

The Mobility Agent Advertisement Extension goes right after the ICMP Router Advertisement fields. It's how an ICMP Router Advertisement message announces that it's also an Agent Advertisement sent by a mobility agent ๐Ÿ“ฃ Here's the layout:

    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Type      |    Length     |        Sequence Number        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |    Registration Lifetime      |R|B|H|F|M|G|r|T|   reserved    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                  zero or more Care-of Addresses               |
   |                              ...                              |
  • Type: 16
  • Length: (6 + 4*N). The 6 covers the Sequence Number, Registration Lifetime, flags, and reserved fields, and N is the number of care-of addresses being advertised ๐Ÿ”ข
  • Sequence Number: The count of Agent Advertisement messages sent since the agent was initialized (Section 2.3.2) ๐Ÿ”
  • Registration Lifetime: The longest lifetime (in seconds) this agent is willing to accept in any Registration Request. A value of 0xffff means infinity โ™พ๏ธ This field has no relation to the "Lifetime" field in the ICMP Router Advertisement portion of the Agent Advertisement, so keep those separate ๐Ÿ’–
  • 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 won't accept registrations from additional mobile nodes ๐Ÿšซ
  • H: Home agent. This agent offers service as a home agent on the link where this Agent Advertisement is sent ๐Ÿ 
  • F: Foreign agent. This agent offers service as a foreign agent on the link where this Agent Advertisement is sent ๐Ÿ›ฌ
  • M: Minimal encapsulation. This agent implements receiving tunneled datagrams that use minimal encapsulation [34] ๐Ÿ“ฆ
  • G: GRE encapsulation. This agent implements receiving tunneled datagrams that use GRE encapsulation [16] ๐ŸŽ
  • r: Sent as zero and ignored on reception. It SHOULD NOT be allocated for any other uses ๐Ÿค
  • T: Foreign agent supports reverse tunneling [27] ๐Ÿ”„
  • reserved: Sent as zero and ignored on reception ๐Ÿซง
  • Care-of Address(es): The foreign agent care-of address(es) this foreign agent is advertising. 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 ready to serve the mobile nodes it's the home agent for. Non-negotiable ๐Ÿ‘‘ A foreign agent might sometimes be too busy to serve more mobile nodes, but it still has to keep sending Agent Advertisements. That way, any mobile nodes already registered with it know they haven't wandered out of range and that the foreign agent hasn't ghosted them ๐Ÿ‘ป A foreign agent can say it's "too busy" to let new mobile nodes register by setting the 'B' bit in its Agent Advertisements. An Agent Advertisement MUST NOT have the 'B' bit set if the 'F' bit isn't also set. And at least one of the 'F' bit and the 'H' bit MUST be set in any Agent Advertisement that gets sent ๐Ÿ™Œ

When a foreign agent wants to require registration even from mobile nodes that have grabbed a co-located care-of address, it sets the 'R' bit to one. This bit only applies to foreign agents, so an agent MUST NOT set the 'R' bit to one unless the 'F' bit is also set to one ๐Ÿ”

2.1.2. Prefix-Lengths Extension ๐Ÿงฉ

The Prefix-Lengths Extension MAY follow the Mobility Agent Advertisement Extension. It tells you how many bits of network prefix apply to each Router Address listed in the ICMP Router Advertisement portion of the Agent Advertisement ๐Ÿ” Heads-up: the prefix lengths given DO NOT apply to the care-of address(es) listed in the Mobility Agent Advertisement Extension. Different rules, different vibes ๐Ÿ’… 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 matching Router Address listed in the ICMP Router Advertisement portion of the message. Each Router Address gets its own separate byte, in the same order the Router Addresses are listed in that portion of the message ๐Ÿงฎ

See Section 2.4.2 for how a mobile node MAY use the Prefix-Lengths Extension when deciding whether it has moved. And see Appendix E for implementation details on using this Extension ๐Ÿ“š

2.1.3. One-byte Padding Extension ๐Ÿซง

Some IP protocol implementations insist on padding ICMP messages out to an even number of bytes, which is so extra ๐Ÿ™„ If the ICMP length of an Agent Advertisement is odd, this Extension MAY be included to make the ICMP length even. Just know that this Extension is NOT meant to be a general-purpose tool for word- or long-aligning the fields of the Agent Advertisement. An Agent Advertisement SHOULD NOT include more than one One-byte Padding Extension, and if one is present, it SHOULD be the last Extension in the Agent Advertisement ๐ŸŽฏ

Unlike the other Extensions in Mobile IP, the One-byte Padding Extension is just a single byte, with no "Length" or "Data" field at all ๐Ÿค Here's the layout:

    0 1 2 3 4 5 6 7
   +-+-+-+-+-+-+-+-+
   |     Type      |
   +-+-+-+-+-+-+-+-+
  • Type: 0 (One-byte Padding Extension)

2.2. Agent Solicitation ๐Ÿ“ฃ

An Agent Solicitation is basically an ICMP Router Solicitation, with one extra rule: the IP TTL field MUST be set to 1 ๐Ÿ”ฅ

2.3. Foreign Agent and Home Agent Considerations โœจ

okay so any mobility agent that can't be found by a link-layer protocol MUST send Agent Advertisements ๐Ÿ“ฃ. An agent that can be discovered by a link-layer protocol SHOULD also implement Agent Advertisements ๐Ÿ’…. Still, the Advertisements don't need to be sent, except when the site policy requires registration with the agent (aka when the 'R' bit is set), or as a reply to a specific Agent Solicitation ๐Ÿฆ‹. All mobility agents MUST process packets they receive addressed to the Mobile-Agents multicast group, at address 224.0.0.11 ๐Ÿซถ. A mobile node MAY send an Agent Solicitation to 224.0.0.11 ๐ŸŒธ. All mobility agents SHOULD respond to Agent Solicitations ๐Ÿ’–.

The same procedures, defaults, and constants are used in Agent Advertisement messages and Agent Solicitation messages as specified for ICMP Router Discovery [10], except that:

  • a mobility agent MUST limit the rate at which it sends broadcast or multicast Agent Advertisements; the maximum rate SHOULD be chosen so that the Advertisements do not consume a significant amount 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 (i.e., an address that matches one of the router's own addresses on the arrival interface, under the subnet mask associated with that address of the router).
  • a mobility agent MAY be configured to send Agent Advertisements only in response to an Agent Solicitation message.

If the home network is not a virtual network, then the home agent for any mobile node SHOULD be located on the link identified by the mobile node's home address, and Agent Advertisement messages sent by the home agent on this link MUST have the 'H' bit set. In this way, mobile nodes on their own home network will be able to determine that they are indeed at home ๐Ÿ . Any Agent Advertisement messages sent by the home agent on another link to which it may be attached (if it is a mobility agent serving more than one link), MUST NOT have the 'H' bit set, unless the home agent also serves as a home agent (to other mobile nodes) on that other link. A mobility agent MAY use different settings for each of the 'R', 'H', and 'F' bits on different network interfaces.

If the home network is a virtual network, the home network has no physical realization external to the home agent itself. In this case, there is no physical network link on which to send Agent Advertisement messages advertising the home agent. Mobile nodes for which this is the home network are always treated as being away from home ๐Ÿงณ.

On a particular subnet, either all mobility agents MUST include the Prefix-Lengths Extension or all of them MUST NOT include this Extension. Equivalently, it is prohibited for some agents on a given subnet to include the Extension but for others not to include it. Otherwise, one of the move detection algorithms designed for mobile nodes will not function 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 any, in the advertisement. Whether or not its own address appears in the Router Addresses, a foreign agent MUST route datagrams it receives from registered mobile nodes (Section 4.2.2) ๐Ÿš.

2.3.2. Sequence Numbers and Rollover Handling

The sequence number in Agent Advertisements ranges from 0 to 0xffff. After booting, an agent MUST use the number 0 for its first advertisement. Each subsequent advertisement MUST use the sequence number one greater, with the exception that the sequence number 0xffff MUST be followed by sequence number 256. In this way, mobile nodes can distinguish a reduction in the sequence number that occurs after a reboot from a reduction that results in rollover of the sequence number after it attains the value 0xffff ๐Ÿ”ขโœจ.

2.4. Mobile Node Considerations ๐Ÿ“ฑ

Every mobile node MUST implement Agent Solicitation. Solicitations SHOULD only be sent in the absence of Agent Advertisements and when a care-of address has not been determined through a link-layer protocol or other means. The mobile node uses the same procedures, defaults, and constants for Agent Solicitation as specified for ICMP Router Solicitation messages [10], except that the mobile node MAY solicit more often than once every three seconds, and that a mobile node that is currently not connected to any foreign agent 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 searching for an agent. After this, the rate at which Solicitations are sent MUST be reduced so as to limit the overhead on the local link. Subsequent Solicitations MUST be sent using a binary exponential backoff mechanism, doubling the interval between consecutive Solicitations, up to a maximum interval. The maximum interval SHOULD be chosen appropriately based upon the characteristics of the media over which the mobile node is soliciting. This maximum interval SHOULD be at least one minute between Solicitations โฑ๏ธ.

While still searching for an agent, the mobile node MUST NOT increase the rate at which it sends Solicitations unless it has received a positive indication that it has moved to a new link. After successfully registering with an agent, the mobile node SHOULD also increase the rate at which it will send Solicitations when it next begins searching for a new agent with which to register. The increased solicitation rate MAY revert to the maximum rate, but then MUST be limited in the manner described above. In all cases, the recommended solicitation intervals are nominal values. Mobile nodes MUST randomize their solicitation times around these nominal values as specified for ICMP Router Discovery [10] ๐ŸŽฒ.

Mobile nodes MUST process received Agent Advertisements. A mobile node can distinguish an Agent Advertisement message from other uses of the ICMP Router Advertisement message by examining the number of advertised addresses and the IP Total Length field. When the IP total length indicates that the ICMP message is longer than needed for the number of advertised addresses, the remaining data is interpreted as one or more Extensions. The presence of a Mobility Agent Advertisement Extension identifies the advertisement as an Agent Advertisement ๐Ÿ”.

If there is more than one advertised address, the mobile node SHOULD pick the first address for its initial registration attempt. If the registration attempt fails with a status Code indicating rejection by the foreign agent, the mobile node MAY retry the attempt with each subsequent advertised address in turn.

When multiple methods of agent discovery are in use, the mobile node SHOULD first attempt registration with agents including Mobility Agent Advertisement Extensions in their advertisements, in preference to those discovered by other means. This preference maximizes the likelihood that the registration will be recognized, thereby minimizing the number of registration attempts ๐ŸŽฏ.

A mobile node MUST ignore reserved bits in Agent Advertisements, as opposed to discarding such advertisements. In this way, new bits can be defined later, without affecting the ability for mobile nodes to use the advertisements even when the newly defined bits are not understood ๐ŸŒˆ.

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 when the mobile node might be able to acquire its own co-located care-of address. This feature is intended to allow sites to enforce visiting policies (such as accounting) which require exchanges of authorization ๐Ÿ›‚.

If formerly reserved bits require some kind of monitoring/enforcement at the foreign link, foreign agents implementing the new specification for the formerly reserved bits can set the 'R' bit. This has the effect of forcing the mobile node to register through the foreign agent, so the foreign agent could then monitor/enforce the policy ๐Ÿ‘€.

2.4.2. Move Detection

Two primary mechanisms are provided for mobile nodes to detect when they have moved from one subnet to another. Other mechanisms MAY also be used. When the mobile node detects that it has moved, it SHOULD register (Section 3) with a suitable care-of address on the new foreign network. However, the mobile node MUST NOT register more frequently than once per second on average, as specified in Section 3.6.3 ๐Ÿšถโ€โ™€๏ธ๐Ÿ’จ.

2.4.2.1. Algorithm 1

The first method of move detection is based upon the Lifetime field within 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 fails to receive another advertisement from the same agent within the specified Lifetime, it SHOULD assume that it has lost contact with that agent. If the mobile node has previously received an Agent Advertisement from another agent for which the Lifetime field has not yet expired, the mobile node MAY immediately attempt registration with that other agent. Otherwise, the mobile node SHOULD attempt to discover a new agent with which to register โณ.

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 determine whether or not a newly received Agent Advertisement was received on the same subnet as the mobile node's current care-of address. If the prefixes differ, the mobile node MAY assume that it has moved. If a mobile node is currently using a foreign agent care-of address, the mobile node SHOULD NOT use this method of move detection unless both the current agent and the new agent include the Prefix-Lengths Extension in their respective Agent Advertisements; if this Extension is missing from one or both of the advertisements, this method of move detection SHOULD NOT be used. Similarly, if a mobile node is using a co-located care-of address, it SHOULD not use this method of move detection unless the new agent includes the Prefix-Lengths Extension in its Advertisement and the mobile node knows the network prefix of its current co-located care-of address. On the expiration of its current registration, if this method indicates that the mobile node has moved, rather than re-registering with its current care-of address, a mobile node MAY choose instead to register with a the foreign agent sending the new Advertisement with the different network prefix. The Agent Advertisement on which the new registration is based MUST NOT have expired according to its Lifetime field ๐Ÿงฉ.

2.4.3. Returning Home

A mobile node can detect that it has returned to 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 attempting to deregister, the mobile node SHOULD configure its routing table appropriately for its home network (Section 4.2.1). In addition, if the home network is using ARP [36], the mobile node MUST follow the procedures described in Section 4.6 with regard to ARP, proxy ARP, and gratuitous ARP ๐Ÿก๐Ÿ’œ.

2.4.4. Sequence Numbers and Rollover Handling

okay so, if a mobile node sees two sequence numbers in a row from the Agent Advertisements of the foreign agent it's registered with, and the second one is smaller than the first and sits somewhere between 0 and 255, the mobile node SHOULD register again ๐Ÿ”. but if the second value is smaller than the first and is 256 or higher, the mobile node SHOULD assume the sequence number rolled over past its max (0xffff), so re-registering isn't needed (Section 2.3) ๐Ÿงšโœจ

3. Registration โœจ

Mobile IP registration is a flexible way for mobile nodes to tell their home agent where they currently are ๐Ÿ“ฎ๐Ÿ’– It's how mobile nodes:

  • request forwarding services when visiting a foreign network,
  • inform their home agent of their current care-of address,
  • renew a registration that's about to expire, and/or
  • deregister when they get back home.

Registration messages pass info between a mobile node, (optionally) a foreign agent, and the home agent. Registration creates or changes a mobility binding at the home agent, linking the mobile node's home address to its care-of address for the specified Lifetime ๐Ÿฆ‹

A few other (optional) capabilities come along for the ride too, letting a mobile node:

  • discover its home address, if it wasn'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 its other mobility bindings, and
  • discover the address of a home agent, if it wasn't configured with that info.

3.1. Registration Overview

Mobile IP has two registration procedures ๐ŸŽ€ One goes through a foreign agent that relays the registration to the mobile node's home agent. The other goes directly to the mobile node's home agent. These rules decide which one to use in any situation:

  • If a mobile node is registering a foreign agent care-of address, the mobile node MUST register via that foreign agent.
  • If a mobile node is using a co-located care-of address, and receives an Agent Advertisement from a foreign agent on the link where it's 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 use Registration Request and Registration Reply messages (Sections 3.3 and 3.4) ๐Ÿ’… When registering via a foreign agent, there are four messages:

  1. The mobile node sends a Registration Request to the prospective foreign agent to start the registration.
  2. The foreign agent processes the Registration Request and then relays it to the home agent.
  3. The home agent sends a Registration Reply to the foreign agent to grant or deny the Request.
  4. The foreign agent processes the Registration Reply and then relays it to the mobile node to tell it what happened with its Request.

When the mobile node registers directly with its home agent, there are only two messages:

  1. The mobile node sends a Registration Request to the home agent.
  2. The home agent sends a Registration Reply to the mobile node, granting or denying the Request.

The registration messages defined in Sections 3.3 and 3.4 use the User Datagram Protocol (UDP) [37] ๐Ÿซถ 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 the home agent handle each other's packets with zero UDP checksums SHOULD be defined as part of the mobility security association 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 a mobile node, that address 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 change a mobility binding for that mobile node (for example, with a new lifetime) ๐ŸŒธ The Request might get relayed to the home agent by the foreign agent the mobile node is registering through, or it might go straight to the home agent if the mobile node is registering a co-located care-of address.

IP fields:

  • Source Address: Typically the interface address the message is sent from.
  • Destination Address: Typically that of the foreign agent or the home agent.

See Sections 3.6.1.1 and 3.7.2.2 for details. UDP fields:

   Source Port        variable

   Destination Port   434

The UDP header is followed by the Mobile IP fields 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 ...
   +-+-+-+-+-+-+-+-

Here's what each field means ๐Ÿ’œ

  • Type: 1 (Registration Request).
  • S: Simultaneous bindings. If the 'S' bit is set, the mobile node is asking the home agent to keep its prior mobility bindings, as described in Section 3.6.1.2.
  • B: Broadcast datagrams. If the 'B' bit is set, the mobile node asks the home agent to tunnel to it any broadcast datagrams 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 decapsulate the datagrams sent to the care-of address itself. In other words, the mobile node is using a co-located care-of address.
  • M: Minimal encapsulation. If the 'M' bit is set, the mobile node asks its home agent to use minimal encapsulation [34] for datagrams tunneled to it.
  • G: GRE encapsulation. If the 'G' bit is set, the mobile node asks its home agent to use GRE encapsulation [16] for datagrams tunneled to it.
  • r: Sent as zero; ignored on reception. It SHOULD NOT be allocated for any other uses.
  • T: Reverse Tunneling requested; see [27].
  • x: Sent as zero; ignored on reception.
  • Lifetime: The number of seconds left before the registration counts as expired. A value of zero means a request to deregister. A value of 0xffff means 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 built by the mobile node. It's used to match Registration Requests with Registration Replies, and to guard against replay attacks on registration messages. See Sections 5.4 and 5.7.
  • Extensions: The fixed part 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 the order in which the different extensions MUST be placed in a Registration Request message, when they're present ๐ŸŽ€
โš ๏ธ the Extensions order is a whole thing, so go check Sections 3.6.1.3 and 3.7.2.2 before you build one ๐Ÿ’€

3.4. Registration Reply โœจ

Okay bestie, so when a mobility agent gets a Registration Request from a mobile node (see Section 3.3), it sends back a Registration Reply ๐Ÿ’Œ. If the mobile node is asking a foreign agent for service, that foreign agent is the one who gets the Reply from the home agent and then passes 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 one in the original Request ๐ŸŒธ.

The foreign agent MUST NOT increase the Lifetime the mobile node picked in the Registration Request ๐Ÿ™…. Why? The Lifetime is covered by an authentication extension that lets the home agent do its authorization thing, and that extension holds authentication data the foreign agent can't correctly (re)compute ๐Ÿ”. The home agent MUST NOT increase it either, because that could push it past the maximum Registration Lifetime the foreign agent allows ๐Ÿ’€. If the Lifetime in the Reply is greater than the one in the Request, the Lifetime in the Request MUST be used. When the Lifetime in the Reply is less than the one in the Request, the Lifetime in the Reply MUST be used. Lifetime drama, resolved ๐Ÿ‘‘

IP fields:

  • Source Address: Typically copied from the destination address of the Registration Request that the agent is replying to. See Sections 3.7.2.3 and 3.8.3.1 for complete details.
  • Destination Address: Copied from the source address of the Registration Request that the agent is replying to.

UDP fields:

  • Source Port: <variable>
  • Destination Port: Copied from the source port of the corresponding Registration Request (Section 3.7.1).

The UDP header is followed by the Mobile IP fields 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      |     Code      |           Lifetime            |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                          Home Address                         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                           Home Agent                          |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   +                         Identification                        +
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   | Extensions ...
   +-+-+-+-+-+-+-+-+-

Here's what each field means ๐ŸŽ€:

  • Type: 3 (Registration Reply)
  • Code: A value indicating the result of the Registration Request. See below for a list of currently defined Code values.
  • Lifetime: If the Code field indicates that the registration was accepted, the Lifetime field is set to the number of seconds remaining before the registration is considered expired. A value of zero indicates that the mobile node has been deregistered. A value of 0xffff indicates infinity. If the Code field indicates that the registration was denied, the contents of the Lifetime field are unspecified and MUST be ignored on reception. (bestie, don't read anything into a denied Lifetime, it's just not it ๐Ÿ™ˆ)
  • Home Address: The IP address of the mobile node.
  • Home Agent: The IP address of the mobile node's home agent.
  • Identification: A 64-bit number used for matching Registration Requests with Registration Replies, and for protecting against replay attacks of registration messages. The value is based on the Identification field from the Registration Request message from the mobile node, and on the style of replay protection used in the security context between the mobile node and its home agent (defined by the mobility security association between them, and SPI value in the authorization-enabling extension). See Sections 5.4 and 5.7. Replay protection is a whole vibe ๐Ÿ”ฅ
  • Extensions: The fixed portion 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 rules on placement of extensions to Reply messages.

The following values are defined for use within 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)

   Registration denied by the home agent:

      128 reason unspecified
      129 administratively prohibited
      130 insufficient resources
      131 mobile node failed authentication
      132 foreign agent failed authentication
      133 registration Identification mismatch
      134 poorly formed Request
      135 too many simultaneous mobility bindings
      136 unknown home agent address

Up-to-date values of the Code field are specified in the most recent "Assigned Numbers" [40]. So if you need the latest codes, go check there, periodt ๐Ÿ“šโœจ


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 [23] to compute a 128-bit "message digest" of the registration message ๐Ÿง. The data over which the HMAC is computed 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 which is used to compute the Authenticator value and which MUST be used by the receiver to check that value. In particular, the SPI selects the authentication algorithm and mode (Section 5.1) and secret (a shared key, or appropriate public/private key pair) used in computing the Authenticator. In order to ensure 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 which it implements. In addition, all implementations of Mobile IP MUST implement the default authentication algorithm (HMAC-MD5) specified above. So the SPI is basically the key to the whole security context, and everyone has to be able to handle it ๐Ÿ—๏ธ๐Ÿ’–

3.5.2. Mobile-Home Authentication Extension

Exactly 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 for registration messages specified in this document. This requirement is intended to eliminate problems [2] which result from the uncontrolled propagation of remote redirects in the Internet ๐Ÿšซ. The location of the extension marks the end of the authenticated data.

    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 in which 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

This Extension MAY be included in Registration Requests and Replies in cases in which a mobility security association exists between the foreign agent and the home 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: 34
  • 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.6. Mobile Node Considerations ๐Ÿงš

okay so this is the mobile node's to-do list, and bestie, it's giving responsibility ๐Ÿ’…. A mobile node MUST be configured with a netmask and a mobility security association for each of its home agents. ๐Ÿ” It can also be configured with its home address and the IP address of one or more of its home agents ๐Ÿ . If it doesn't have those, it MAY discover a home agent using the procedures in Section 3.6.1.2 ๐Ÿ”.

If the mobile node has no home address configured, it MAY use the Mobile Node NAI extension [6] to identify itself ๐Ÿชช, and it sets 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 each 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, and
  • 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 the ways a mobile node MAY figure that out โœจ. When it's away from home, the Registration Request lets its home agent create or update a mobility binding for it ๐Ÿงณ. When it's home, the (de)Registration Request lets the home agent delete any old mobility binding(s) for it ๐Ÿก. And when it's at home, the mobile node operates without mobility functions at all, so it's just vibing ๐Ÿ˜Œ.

There are other moments when 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), and when the current registration's Lifetime is about to expire โณ.

Without link-layer indications of a change in point of attachment, Agent Advertisements from new agents SHOULD NOT make a mobile node try a new registration, as long as its current registration hasn't expired and it's still getting Agent Advertisements from the foreign agent it's already registered with ๐Ÿ™…โ€โ™€๏ธ. And without link-layer indications, a mobile node MUST NOT try to register more often than once per second โฑ๏ธ. Literally don't spam it ๐Ÿ’€.

A mobile node MAY register with a different agent when transport-layer protocols show excessive retransmissions ๐Ÿ”„. A mobile node MUST NOT treat receiving an ICMP Redirect from a foreign agent that's currently serving it as a reason to register with a new foreign agent ๐Ÿšซ. Within these limits, the mobile node MAY register again at any time ๐Ÿ’–.

Appendix D has examples of how the fields in registration messages get set up in some typical registration scenarios ๐Ÿ“šโœจ.

3.6.1. Sending Registration Requests ๐Ÿ“ค

Here are the details for the values the mobile node MUST supply in the fields of Registration Request messages ๐Ÿ’Œ.

3.6.1.1. IP Fields ๐ŸŒ

This part has the exact 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 does not 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 has found the agent it's registering with through some means (e.g., link-layer) that doesn't give the agent's IP address (the IP address of the agent is unknown to the mobile node), then 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 right agent ๐ŸŽฏ.
  • When registering with a foreign agent, the address of the agent as learned from the IP source address of the matching Agent Advertisement MUST be used. This MAY be an address that doesn't 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 is registering directly with its home agent and knows the (unicast) IP address of its home agent, the destination address MUST be set to this address ๐Ÿ ๐Ÿ’ซ.
  • If the mobile node is registering 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 figure out 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 set to the "All Mobility Agents" multicast address as described above. Otherwise a suitable value should be chosen in accordance with standard IP practice [38] โณ.

3.6.1.2. Registration Request Fields ๐Ÿ“

This section has the specific rules for how mobile nodes pick values for the fields in the fixed portion of a Registration Request ๐Ÿ’….

A mobile node MAY set the S bit to ask the home agent to keep prior mobility binding(s) ๐Ÿงท. Otherwise, the home agent deletes any previous binding(s) and replaces them with the new binding from the Registration Request. Multiple simultaneous mobility bindings are likely to be useful when a mobile node with at least one wireless network interface moves into wireless range of more than one foreign agent ๐Ÿ“ก. IP explicitly allows duplicated datagrams ๐Ÿ‘ฏ. When the home agent allows simultaneous bindings, it tunnels a separate copy of each arriving datagram to each care-of address, so the mobile node gets multiple copies of datagrams destined for it ๐Ÿซถ.

The mobile node SHOULD set the D bit if it's 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 the home agent gets from the home network ๐Ÿ“ฃ. How the home agent forwards broadcasts depends on the type of care-of address the mobile node registered, as shown by the D bit in the Registration Request ๐Ÿ‘‘:

  • If the D bit is set, then the mobile node has said it will decapsulate any datagrams tunneled to this care-of address itself (the mobile node is using a co-located care-of address). In this case, to forward a received broadcast datagram to the mobile node, the home agent MUST tunnel it to this care-of address. The mobile node de-tunnels the received datagram the same way as any other datagram tunneled directly to it ๐ŸŽ€.
  • If the D bit is NOT set, then the mobile node has said it's using a foreign agent care-of address, and that the foreign agent will decapsulate arriving datagrams before forwarding them to the mobile node. In this case, to forward a received broadcast datagram to the mobile node, 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 this 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 the intended destination of the encapsulated broadcast datagram, and it gets delivered to the mobile node like any tunneled datagram arriving for it ๐Ÿ’Œ. The foreign agent MUST NOT decapsulate the encapsulated broadcast datagram, and 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 request other forms of encapsulation by setting the M bit and/or the G bit, but only if it's decapsulating its own datagrams (the mobile node is using a co-located care-of address), or if its foreign agent has said it supports these forms of encapsulation by setting the matching bits in the Mobility Agent Advertisement Extension of an Agent Advertisement the mobile node received ๐Ÿฆ‹. Otherwise, the mobile node MUST NOT set these bits ๐Ÿšซ.

The Registration Request's parts go in this order ๐Ÿงฉ:

  • a) The IP header, followed by the UDP header, followed by the fixed-length portion of the Registration Request, followed by
  • b) If present, any non-authentication Extensions expected to be used by the home agent (which may or may not also be useful to the foreign agent), followed by
  • c) An authorization-enabling extension, followed by
  • d) If present, any non-authentication Extensions used only by the foreign agent, followed by
  • e) The Mobile-Foreign Authentication Extension, if present.

Note that items (a) and (c) MUST appear in every Registration Request sent by the mobile node ๐Ÿซถ. Items (b), (d), and (e) are optional. 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 ๐Ÿ“ฅ

Mobile nodes get Registration Replies in response to their Registration Requests ๐Ÿ’ฌ. Registration Replies generally fall into three categories ๐Ÿ—‚๏ธ:

  • the registration was accepted,
  • the registration was denied by the foreign agent, or
  • the registration was denied by the home agent.

The rest of this section covers how a mobile node handles the Registration Reply in each of these three categories ๐ŸŒˆโœจ.

3.6.2.1. Validity Checks

Okay bestie, first things first ๐Ÿ’… any Registration Reply with an invalid, non-zero UDP checksum MUST be silently discarded ๐Ÿ™ˆ no exceptions, no drama.

Next, the low-order 32 bits of the Identification field in the Reply MUST be compared with the low-order 32 bits of the Identification field in the most recent Registration Request sent to the replying agent ๐Ÿ”. If they don't match, the Reply MUST be silently discarded. Ghosted. ๐Ÿ‘ป

Also, the Registration Reply MUST be checked for an authorization-enabling extension ๐Ÿ”. For every Reply carrying a Status Code that shows status from the Home Agent, the mobile node MUST check for an authorization-enabling extension and act based on the Code field in the Reply. Here's how it goes:

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 that 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 says service is denied by the home agent, or if it says 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 that Extension. If the 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 ๐Ÿšจ

Okay, this part is lowkey the most important bit. If you skip these checks, a fake Reply can walk right in and pretend to be your home agent ๐Ÿ’€ so yes, be paranoid. That's the vibe. ๐Ÿซถ

If the Code field shows an authentication failure, either at the foreign agent or at the home agent, then it's very possible that any authenticators in the Registration Reply are also wrong ๐Ÿ˜ฌ This could happen, for example, if the shared secret between the mobile node and the home agent was configured incorrectly. The mobile node SHOULD log these errors as security exceptions ๐Ÿ“

3.6.2.2. Registration Request Accepted

If the Code field says the request was accepted โœ… the mobile node SHOULD set up its routing table properly for its current point of attachment (Section 4.2.1). Routing, but make it cute. ๐ŸŽ€

If the mobile node is heading back to its home network, and that network implements ARP, the mobile node MUST follow the procedures in Section 4.6 for ARP, proxy ARP, and gratuitous ARP ๐Ÿ โœจ

If the mobile node has registered on a foreign network, it SHOULD re-register before its registration Lifetime runs out โฐ Here's the clever part ๐Ÿง  For each pending Registration Request, the mobile node MUST keep track of the remaining lifetime of that pending registration, plus the original Lifetime from the Request (as described in Section 3.6). When a valid Registration Reply arrives, the mobile node MUST lower its view of the remaining lifetime by the amount the home agent cut from the originally requested Lifetime. Basically, it's the same as the mobile node starting a timer for the granted Lifetime at the moment it sent the Request, even though it doesn't know the granted Lifetime until the Reply shows up ๐Ÿ•ฐ๏ธ Since the Request is definitely sent before the home agent starts its own timer (which is also based on the granted Lifetime), this makes sure the mobile node re-registers before the home agent expires and deletes the registration ๐Ÿ™Œ That's true even if the original Request and Reply take a while to travel, which could otherwise throw off both timers ๐Ÿข

3.6.2.3. Registration Request Denied

If the Code field says service is being denied ๐Ÿ˜ค the mobile node SHOULD log the error. In certain cases, the mobile node MAY be able to "repair" the error ๐Ÿ”ง Here are those cases:

Code 69: (Denied by foreign agent, Lifetime too long)

In this case, the Lifetime field in the Registration Reply will contain the maximum Lifetime value that 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 given in the Reply ๐Ÿ“‰

Code 133: (Denied by home agent, Identification mismatch)

In this case, the Identification field in the Registration Reply will contain a value that lets the mobile node sync 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. Resync energy. ๐Ÿ’œ

Code 136: (Denied by home agent, Unknown home agent address)

This code is returned by a home agent when the mobile node is doing dynamic home agent address resolution, as described in Sections 3.6.1.1 and 3.6.1.2 ๐Ÿ—บ๏ธ In this case, the Home Agent field in the Reply will contain 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 ๐Ÿฆ‹ Also, the mobile node SHOULD adjust the parameters it uses to compute the Identification field based on the matching field in the Registration Reply before sending any future Registration Requests.

3.6.3. Registration Retransmission

If no Registration Reply has come back within a reasonable time โณ another Registration Request MAY be sent. When timestamps are used, a brand-new registration Identification gets picked for every retransmission, so it counts as a new registration ๐Ÿ†• When nonces are used, the unanswered Request gets resent exactly as it was, so the retransmission does NOT count as a new registration (Section 5.7). That's the whole point: if the original Request got lost in the network (instead of the Reply), the home agent doesn't have to resync with the mobile node by handing out another nonce. Efficient and iconic. ๐Ÿงš

The maximum time before a new Registration Request is sent SHOULD be no greater than the requested Lifetime of the Registration Request โฑ๏ธ The minimum value SHOULD be big enough to cover the size of the messages, twice the round trip time to the home agent, and at least an extra 100 milliseconds for processing before responding ๐Ÿซง The round trip time to the home agent will be at least as long as it takes to transmit the messages at the link speed of the mobile node's current point of attachment. Some circuits also add another 200 milliseconds of satellite delay to the round trip time to the home agent ๐Ÿ›ฐ๏ธ The minimum time between Registration Requests MUST NOT be less than 1 second โœ‹ And each successive retransmission timeout period SHOULD be at least twice the previous one, as long as it stays below the maximum described above ๐Ÿ“ˆ


3.7. Foreign Agent Considerations

The foreign agent has a mostly passive role in Mobile IP registration ๐ŸŒธ It relays Registration Requests between mobile nodes and home agents, and when it provides the care-of address, it decapsulates datagrams so they can be delivered to the mobile node ๐Ÿ“ฆ The foreign agent SHOULD also send periodic Agent Advertisement messages to advertise its presence, as described in Section 2.3, if that presence can't be detected by link-layer means ๐Ÿ“ฃ

A foreign agent MUST NOT transmit a Registration Request except when relaying a Registration Request received from a mobile node to that mobile node's home agent ๐Ÿšซ A foreign agent MUST NOT transmit a Registration Reply except when relaying a Registration Reply received from a mobile node's home agent, or when replying to a Registration Request from a mobile node in the case where the foreign agent is denying service to that mobile node ๐Ÿ™…โ€โ™€๏ธ Specifically, a foreign agent MUST NOT generate a Registration Request or Reply just because a mobile node's registration Lifetime has expired โŒ› A foreign agent also MUST NOT originate a Registration Request asking for deregistration of a mobile node. However, it MUST relay valid (de)Registration Requests that a mobile node originates ๐Ÿ’Œ

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 keep a visitor list entry with the following info, pulled 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 description of the 'R' bit in section 2.1.1)
  • the IP Destination Address (as specified in 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 the mobile node's Home Address is zero in the Registration Request message, then the foreign agent MUST follow the procedures specified in RFC 2794 [6] ๐Ÿง In particular, if the foreign agent can't manage pending registration request records with a zero Home Address for the mobile node, the foreign agent MUST return a Registration Reply with a Code indicating NONZERO_HOMEADDR_REQD (see [6]) โŒ

The foreign agent MAY configure a maximum number of pending registrations it's willing to keep (typically 5 ๐Ÿ–๏ธ). Any additional registrations SHOULD then be rejected by the foreign agent with code 66. The foreign agent MAY delete any pending Registration Request once it has been pending for more than 7 seconds โฒ๏ธ in this 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 other nodes ๐Ÿค When a foreign agent relays a Registration Request from a mobile node to its home agent, and it shares a mobility security association with that home agent, it MUST add a Foreign-Home Authentication Extension to the Request. It MUST also check the required Foreign-Home Authentication Extension in the Registration Reply from the home agent (Sections 3.3 and 3.4) ๐Ÿ” Similarly, when a foreign agent receives a Registration Request from a mobile node, and it shares a mobility security association with that mobile node, it MUST check the required Mobile-Foreign Authentication Extension in the Request, and it MUST add a Mobile-Foreign Authentication Extension to the Registration Reply sent back to the mobile node ๐Ÿ’œ

3.7.2. Receiving Registration Requests

okay so this is where the foreign agent gets a Registration Request from a mobile node and decides what to do with it ๐Ÿ’… If it accepts the Request, it first double-checks that the home agent address in there isn't one of its own network interfaces ๐Ÿ‘€ If it isn't, the foreign agent MUST relay the Request to that home agent. Otherwise, if the foreign agent is denying the Request, it MUST send a Registration Reply to the mobile node with an appropriate denial Code ๐Ÿ™…โ€โ™€๏ธ, except in cases where it would have to send more than one such denial per second to the same mobile node. The next sections break this down even more ๐Ÿงš

If the foreign agent has configured one of its network interfaces with the IP address the mobile node put down 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 in section 3.8.2. Otherwise, if it does not serve the mobile node as a home agent, it rejects the Registration Request with code 136 (unknown home agent address). <rose>not the loop ๐Ÿ’€</rose>

If a foreign agent gets a Registration Request from a mobile node that's already in its visitor list, the existing visitor list entry SHOULD NOT be deleted or modified until the foreign agent receives a valid Registration Reply from the home agent with a success Code โœจ The foreign agent MUST record the new pending Request as a separate part of that existing entry. If the Request is asking for deregistration, the existing entry SHOULD NOT be deleted until the foreign agent gets a successful Registration Reply. And if the Reply says the home agent denied the Request (whether it was for registration or deregistration), the existing visitor list entry MUST NOT be modified just because the Reply arrived ๐Ÿซถ

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, and specifying a care-of address the foreign agent didn't offer, 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 Request, and the foreign agent MUST check the Authenticator value in that Extension. If there's no Mobile-Foreign Authentication Extension, or if there's more than one, 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

If the foreign agent accepts the mobile node's Registration Request, it MUST relay the Request to the mobile node's home agent, as listed in the Home Agent field of the Request ๐Ÿ“ฌ The foreign agent MUST NOT modify any of the fields from the fixed portion of the Registration Request up through and including the Mobile-Home Authentication Extension (or any other authentication extension the mobile node supplied as an authorization-enabling extension for the home agent). Otherwise, an authentication failure is very likely to happen at the home agent, and nobody wants that ๐Ÿ˜ญ On top of that, the foreign agent does the following:

  • It MUST process and remove any Extensions following the Mobile-Home Authentication Extension,
  • It MAY append any of its own non-authentication Extensions that are relevant to the home agent, if applicable, and
  • It MUST append the Foreign-Home Authentication Extension, if the foreign agent shares a mobility security association with the home agent.

Specific fields within the IP header and the UDP header of the relayed Registration Request MUST be set like this ๐ŸŽ€

  • IP Source Address: The foreign agent's address on the interface the message will be sent from.
  • 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 start timing the remaining lifetime of the pending registration, based on the Lifetime in the Registration Request โฐ If that lifetime runs out before a valid Registration Reply shows up, the foreign agent MUST delete its visitor list entry for this pending registration. bye bye entry ๐Ÿ‘‹

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 Reply are copied from the matching fields in the Request.

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's willing to accept in any Registration Request, and sets the Code field to 69 ๐Ÿ“ Otherwise, the Lifetime SHOULD be copied from the Lifetime field in the Request.

Specific fields within the IP header and the UDP header of the Registration Reply MUST be set like this ๐Ÿง

  • IP Source Address: Copied from the IP Destination Address of the Registration Request, unless the "All Agents Multicast" address was used. In that case, the foreign agent's address (on the interface the message will be sent from) MUST be used.
  • IP Destination Address: If the Registration Reply is generated by the Foreign Agent to reject a mobile node's Registration Request, and the 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 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 Reply. Otherwise, the IP Destination Address of the Registration Reply is set to 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 gets a valid Registration Reply from a home agent ๐Ÿ”„ Then it relays that Reply to the mobile node. The following sections go into more detail.

If, after relaying a Registration Request to a home agent, the foreign agent gets an ICMP error message instead of a Registration Reply, 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 that Registration Reply.

3.7.3.1. Validity Checks

Registration Replies with an invalid, non-zero UDP checksum MUST be silently discarded ๐Ÿ—‘๏ธ

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 the one in the Reply ๐Ÿ” If no such pending Request is found, and the Reply doesn't match 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 don't match those in the Request.

Also, the authentication in the Registration Reply MUST be checked ๐Ÿ” If the foreign agent and the home agent share a mobility security association, exactly one Foreign-Home Authentication Extension MUST be present in the Reply, and the foreign agent MUST check the Authenticator value in that Extension. If there's no Foreign-Home Authentication Extension, or more than one, or 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. yikes, the whole thing gets shut down ๐Ÿ’€

3.7.3.2. Forwarding Replies to the Mobile Node

okay so the foreign agent gets a Registration Reply that passes the checks in Section 3.8.2.1, and it relays that reply to the mobile node ๐Ÿ’Œ ๐ŸŽ€ The foreign agent MUST also update its visitor list entry for the mobile node so it matches what the Code field says happened in the Request. 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 smaller of these two values:

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

If the Code says the Lifetime field is zero instead, the foreign agent MUST delete its visitor list entry for the mobile node ๐Ÿ—‘๏ธ And if the home agent denied the registration, the foreign agent MUST delete its pending registration list entry for the mobile node, but it keeps the visitor list entry ๐Ÿซถ

โš ๏ธ The foreign agent MUST NOT modify any of the fields from the start of the fixed portion of the Registration Reply up through and including the Mobile-Home Authentication Extension. Otherwise, an authentication failure is very likely to occur at the mobile node. ๐Ÿ˜ญ Don't touch the authenticated stuff, bestie!

The foreign agent SHOULD also do these extra steps:

  • It MUST process and remove any Extensions that follow the Mobile-Home Authentication Extension.
  • It MAY append its own non-authentication Extensions that are relevant to the mobile node, if applicable.
  • It MUST append the Mobile-Foreign Authentication Extension if the foreign agent shares a mobility security association with the mobile node.

The IP header and UDP header fields of the relayed Registration Reply get set using the same rules as Section 3.7.2.3, so nothing new to memorize here, yay ๐Ÿงš

After forwarding a valid Registration Reply to the mobile node, the foreign agent MUST update its visitor list entry for this registration. If the reply says the home agent accepted it, the foreign agent resets its registration lifetime timer to the Lifetime granted in the reply. This is lowkey clever: unlike the mobile node, which times the lifetime as described in Section 3.6.2.2, the foreign agent starts counting from the moment it forwards the Registration Reply. That way the foreign agent never expires the registration before the mobile node does ๐ŸŒธ If instead the reply says the home agent rejected it, the foreign agent deletes its visitor list entry for this attempted registration ๐Ÿ’”


3.8. Home Agent Considerations

Home agents are the reactive ones in the registration process ๐Ÿฆ‹ The home agent receives Registration Requests from the mobile node (sometimes relayed by a foreign agent), updates its record of the mobility bindings for this mobile node, and sends back a suitable Registration Reply for each request. Iconic behavior honestly ๐Ÿ’…

A home agent MUST NOT transmit a Registration Reply except when it is replying to a Registration Request received from a mobile node. In particular, the home agent MUST NOT generate a Registration Reply to say the Lifetime has expired. No random reply drama allowed ๐Ÿ™…โ€โ™€๏ธ

3.8.1. Configuration and Registration Tables

Each home agent MUST be configured with an IP address and with the prefix size for the home network. The home agent MUST also be configured with the mobility security association of each authorized mobile node that it is serving as a home agent for. Setup vibes โœจ

When the home agent accepts a valid Registration Request from a mobile node that it serves as a home agent for, the home agent MUST create or modify the entry for this mobile node in its mobility binding list. 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 ability to dynamically associate a home address with a mobile node when it gets a Registration Request from that mobile node. How the home address gets allocated is beyond the scope of this document, but see [6] if you're curious ๐Ÿ“ Once the home agent makes that association, it 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. Same deal in reverse: when sending a Registration Reply to a foreign agent, and the home agent shares a mobility security association with it, the home agent MUST include a Foreign-Home Authentication Extension in the message, based on this mobility security association. Secure, verified, slay ๐Ÿ”

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 SHOULD send a Registration Reply with a suitable Code. Otherwise, if the home agent denies the Request, it SHOULD send a Registration Reply with an appropriate Code that gives the reason the Request was denied. The following sections go deeper into this behavior ๐Ÿ” If the home agent does not support broadcasts (see section 4.3), it MUST ignore the 'B' bit, and it does this instead of rejecting the Registration Request. Ignore, don't reject, periodt ๐Ÿ’…

3.8.2.1. Validity Checks

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

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

a) The home agent MUST check for the presence of an authorization-enabling extension and perform the indicated authentication. Exactly one authorization-enabling extension MUST be present in the Registration Request. The home agent MUST either check the Authenticator value in the extension, or verify that the authenticator value has already been checked by another agent it has a security association with. If no authorization-enabling extension is found, or if more than one is found, or if the Authenticator is invalid, the home agent MUST reject the mobile node's registration and SHOULD send a Registration Reply to the mobile node with Code 131. The home agent MUST then discard the Request and SHOULD log the error as a security exception ๐Ÿšจ

b) The home agent MUST check that the registration Identification field is correct, using the context selected by the SPI within the authorization-enabling extension. See Section 5.7 for how this is 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, including 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, 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 if more than one is found, or if 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 ๐Ÿ›ก๏ธ

On top of 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 (instead of being unicast to the home agent). The home agent MUST discard the Request and SHOULD returning a Registration Reply with a Code of 136. In this case, the Registration Reply contains the home agent's unicast address, so the mobile node can re-issue the Registration Request with the correct home agent address ๐ŸŽฏ

๐Ÿ‘€ 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. In that case, home agents that try to catch dynamic home agent discovery requests by binding a socket explicitly to the subnet-directed broadcast address will never 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. Be ready for both, bestie ๐Ÿ’–

3.8.2.2. Accepting a Valid Request โœจ

Okay bestie, 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. ๐Ÿ’–

In this case the Reply Code is 0 if the home agent supports simultaneous mobility bindings, or 1 if it doesn't. See Section 3.8.3 for how to build the Registration Reply message ๐ŸŽ€

The home agent updates its record of the mobile node's mobility bindings based on the fields in the Registration Request, and it goes 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 tells its home agent to stop providing mobility services ๐Ÿฅบ
  • If the Lifetime is zero and the Care-of Address does not equal the mobile node's home address, the home agent deletes only the entry containing the specified Care-of Address. Any other active entries with other care-of addresses stay 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. That source might totally be a different foreign agent than the one whose care-of address is being (de)registered, so no cap, that's normal ๐Ÿซถ 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 also send a Registration Reply to that deregistered foreign agent. The home agent MUST NOT send such a Reply if it doesn't share a mobility security association with that foreign agent. If no Reply is sent, the foreign agent's visitor list will expire naturally when the original Lifetime runs out โณ

The home agent MUST NOT increase the Lifetime above what the mobile node asked for in the Registration Request. Asking for a longer Lifetime than the home agent is willing to accept is not an error, though ๐Ÿ™Œ In that case the home agent just lowers the Lifetime to a permissible value and returns that value in the Registration Reply. The Lifetime in the Reply tells the mobile node how long the registration was actually granted, and it's how the mobile node knows when it SHOULD re-register to keep service going โญ Once that registration lifetime expires, the home agent MUST delete its entry for this registration in its mobility binding list.

If a Registration Request duplicates an accepted current Registration Request, the new Lifetime MUST NOT extend beyond the Lifetime originally granted. A Registration Request counts as a duplicate when its home address, care-of address, and Identification fields all match those of an accepted current registration ๐Ÿ‘ฏ

Also, if the home network implements ARP [36], and the Registration Request asks the home agent to create a mobility binding for a mobile node that previously had no binding (so the mobile node was assumed to be at home), then the home agent MUST follow the procedures in Section 4.6 about ARP, proxy ARP, and gratuitous ARP. If the mobile node already had a previous mobility binding, the home agent MUST continue to follow the proxy ARP rules in Section 4.6 ๐Ÿ’…


3.8.2.3. Denying an Invalid Request

If the Registration Reply 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 tells them why it went wrong ๐Ÿ˜ญ If a foreign agent helped relay the Request, this lets that foreign agent delete its pending visitor list entry. It also tells the mobile node what went wrong, so it can fix the problem and send another Request ๐Ÿ”

This section lists a bunch of reasons the home agent might reject a Request, plus the Code value it should use for each one. See Section 3.8.3 for more details on building the Registration Reply message ๐Ÿ“‹

A lot of rejections are administrative. For example, a home agent can cap the number of simultaneous registrations for a mobile node by rejecting any registration that would push it over the limit, and returning a Registration Reply with error code 135. A home agent can also refuse service to mobile nodes that have wandered into unauthorized service areas by returning a Registration Reply with a Code of 129. Main character gatekeeping ๐Ÿšช๐Ÿ‘‘

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 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 send a Registration Reply with an appropriate Code that explains why the Request was denied ๐Ÿ’Œ The following sections go through the values the home agent MUST supply in the fields of Registration Reply messages ๐Ÿงš


3.8.3.1. IP/UDP Fields

Here's where we get into the exact rules for how home agents pick 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 ๐ŸŽ€

Now the deregistration case, which is giving full plot twist ๐Ÿ˜ณ When a Registration Request asks for deregistration of the mobile node (the Lifetime is zero and the Care-of Address equals the mobile node's home address), and the IP Source Address was also set to the mobile node's home address (this is the normal way a mobile node deregisters when it gets 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 send 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. This matters most for a mobile node returning home after it was registered with a care-of address. If the mobile node's new Registration Request isn't accepted, the binding list entry will still say datagrams for the mobile node should be tunneled to its registered care-of address. But when the home agent sends the Reply rejecting this Request, that existing entry MUST be ignored, and the home agent MUST transmit the Reply as if the mobile node were at home ๐Ÿซ 


3.8.3.2. Registration Reply Fields

This section has the specific rules for how home agents fill in the values for the fixed portion of a Registration Reply ๐Ÿ“

The Code field is chosen by following 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 service. In that case the Lifetime MUST be set to the length of time the service will actually be provided by the home agent. This reduced Lifetime SHOULD be the maximum Lifetime the home agent allows for this mobile node and care-of address โฐ

If the Home Address field of the Registration Request is nonzero, it MUST be copied into the Home Address field of the Registration Reply message. Otherwise, if the Home Address field of the Registration Request is zero as specified in section 3.6, the home agent SHOULD arrange for a home address to be selected for the mobile node, and insert the selected address into the Home Address field of the Registration Reply message. See [6] for more 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 that latter case, the home agent MUST reject the registration with a suitable code (e.g., Code 136) so the mobile node can't end up registered with two or more home agents at once ๐Ÿšซ๐Ÿ‘ฏ


3.8.3.3. Extensions

This section describes the order 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.

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 bestie, this is the part where the mobile node, the home agent, and (maybe) the foreign agent all work together 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 currently is through the registration procedure in Section 3. for who's-where-relative-to-who, check the protocol overview in Section 1.7 ๐Ÿ—บ๏ธ

4.1. Encapsulation Types

okay so the rule is that home agents and foreign agents MUST support tunneling datagrams with IP in IP encapsulation [32] ๐ŸŽ€. and any mobile node using a co-located care-of address MUST support receiving datagrams tunneled that way too ๐Ÿ’–. minimal encapsulation [34] and GRE encapsulation [16] are alternate methods that mobility agents and mobile nodes MAY optionally support ๐ŸŒธ. when the mobile node asks for one of those alternatives, it's otherwise up to the home agent whether it actually gets used ๐Ÿซถ

4.2. Unicast Datagram Routing

4.2.1. Mobile Node Considerations

when the mobile node is home, it's giving "regular fixed host or router" energy and doesn't need any mobility services at all ๐Ÿ โœจ. how it picks a default router when it's home, or away and using a co-located care-of address, is out of scope for this doc ๐Ÿ™ˆ. ICMP Router Advertisement [10] is one way to do it, fr ๐Ÿ‘‘

when the mobile node is registered on a foreign network, it picks a default router using these rules:

  • if it's 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 Agent Advertisement ๐Ÿ’œ. otherwise, the mobile node MUST choose its default router from the Router Addresses advertised in the ICMP Router Advertisement portion of that Agent Advertisement message ๐Ÿ˜ญ
  • if it's registered directly with its home agent using a co-located care-of address, then the mobile node SHOULD choose its default router from the ones advertised in any ICMP Router Advertisement message it gets, as long as 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, it MAY also consider that IP source address as another possible choice for a default router โœจ. the network prefix MAY be obtained from the Prefix-Lengths Extension in the Router Advertisement, if it's there ๐Ÿงš. the prefix MAY also be obtained through other mechanisms that are beyond this document's scope ๐Ÿ’…

ok now the big one: 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 isn't really useful for picking a default router, unless the mobile node has some way to get a router's MAC address that doesn't use broadcast ARP and isn't specified in this document ๐Ÿคทโ€โ™€๏ธ. similarly, since there are no unspecified mechanisms for getting MAC addresses on foreign networks, the mobile node MUST ignore redirects to other routers on foreign networks ๐Ÿšซ bestie, don't let it get distracted ๐Ÿ˜ค

4.2.2. Foreign Agent Considerations

when an encapsulated datagram shows up at the foreign agent's advertised care-of address, the foreign agent MUST compare the inner destination address to the entries in its visitor list ๐Ÿ”. if the destination doesn't match 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 happen ๐Ÿ”๐Ÿ’€. 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 the presence of a mobile router (Section 4.5) or a mobile node in its visitor list to other routers in its routing domain, or to any other mobile node ๐Ÿค๐Ÿซฃ

the foreign agent MUST route datagrams it receives from registered mobile nodes ๐Ÿš€. at a minimum, that means the foreign agent has to 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 by a mobile node ๐Ÿชž. the foreign agent's ARP cache entry 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 the MAC address tied to that IP address ๐Ÿซถ

each foreign agent SHOULD support the mandatory features for reverse tunneling [27] ๐Ÿ”โœจ

4.2.3. Home Agent Considerations

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

the home agent has to check the IP Destination Address of every arriving datagram to see if it matches the home address of any of its mobile nodes that are 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 for it, so it won't generally get those datagrams in the first place ๐Ÿ™ˆ. but if the home agent is also a router handling regular IP traffic, it might still receive such datagrams to forward onto the home network ๐Ÿ“ฌ. in that case, the home agent MUST assume the mobile node is at home and simply forward the datagram straight 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 ๐Ÿ“ฎ. the home agent can't use the address of some other network interface as the source address, bestie ๐Ÿ™…โ€โ™€๏ธ

check Section 4.1 for the encapsulation methods that can be used for tunneling ๐ŸŽ. nodes implementing tunneling SHOULD also implement the "tunnel soft state" mechanism [32] ๐Ÿซง, which lets ICMP error messages returned from the tunnel be reflected back correctly to the original senders of the tunneled datagrams ๐Ÿชžโœจ

home agents MUST decapsulate packets addressed to themselves that a mobile node sent to keep its location private, as described in Section 5.5 ๐Ÿ”. this feature is also required for supporting reverse tunneling [27] ๐Ÿ’œ

if the Lifetime for a mobility binding expires before the home agent gets another valid Registration Request for that mobile node, the binding gets deleted from the mobility binding list โณ๐Ÿ˜ข. the home agent MUST NOT send any Registration Reply message just because the mobile node's binding expired ๐Ÿค. the entry in the visitor list of the mobile node's current foreign agent will expire on its own, probably at the same time the binding expires at the home agent โŒ›. when a mobility binding's lifetime runs out, the home agent MUST delete that binding, but it MUST keep any other (non-expired) simultaneous mobility bindings it holds for the mobile node ๐Ÿซถ๐Ÿ’–

when a home agent gets a datagram that it intercepted for one of its mobile nodes registered away from home, the home agent MUST examine the datagram to see if it's already encapsulated ๐Ÿ”ฌ. if it is, special rules kick in for forwarding it to the mobile node:

  • if the inner (encapsulated) Destination Address is the same as the outer Destination Address (the mobile node), then the home agent MUST also examine the outer Source Address of the encapsulated datagram (the tunnel's source address) ๐Ÿง. if that outer Source Address is the same as the mobile node's current care-of address, the home agent MUST silently discard the datagram to prevent a likely routing loop ๐Ÿ”๐Ÿšซ. but if the outer Source Address is NOT the same as the mobile node's current care-of address, the home agent SHOULD forward the datagram to the mobile node ๐Ÿ’Œ. to do that, the home agent MAY simply change the outer Destination Address to the care-of address, instead of 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 to the mobile node's care-of address ๐Ÿช†. so the home agent forwards the whole datagram to the mobile node the same way it would any other datagram, whether it was already encapsulated or not ๐Ÿฆ‹

4.3. Broadcast Datagrams

when a home agent gets a broadcast datagram, it MUST NOT forward it to any mobile nodes in its mobility binding list except the ones that asked for broadcast forwarding ๐Ÿ“ข๐Ÿšซ. a mobile node MAY request forwarding of broadcast datagrams by setting the 'B' bit in its Registration Request message (Section 3.3) ๐Ÿ™‹โ€โ™€๏ธ. for each mobile node that did this, the home agent SHOULD forward the received broadcast datagrams to it ๐Ÿ“จ. which specific categories of broadcast datagrams get forwarded is a configuration choice 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, and then tunnels that encapsulated datagram to the foreign agent ๐Ÿช†. this extra layer is needed so the foreign agent can tell 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 like any other datagram ๐Ÿ’…. either way, the mobile node has to decapsulate the datagram it receives to recover the original broadcast datagram ๐ŸŽโœจ

4.4. Multicast Datagram Routing ๐Ÿฆ‹

okay so, a mobile node that's chilling at home works exactly like any other fixed host or router ๐Ÿ  so when it's home, it's just a regular multicast sender and receiver. this section is about the mobile node that's visiting a foreign network ๐ŸŒโœˆ๏ธ

to receive multicasts, a mobile node MUST join the multicast group in one of two ways ๐Ÿ’… first, a mobile node MAY join the group through a (local) multicast router on the visited subnet. this option assumes there's a multicast router on the visited subnet, so make sure it's actually there, bestie ๐Ÿ‘€ 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 [11] messages. otherwise, it MAY use its home address ๐ŸŒธ

or, a mobile node that wants multicasts MAY join groups through a bi-directional 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 the home agent forwards the multicast datagrams down the tunnel to the mobile node. for packets tunneled to the home agent, the source address in the IP header SHOULD be the mobile node's home address ๐Ÿซถ

the rules for delivering multicast datagrams to mobile nodes here are the same as 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, it's a whole thing: 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 (that's nested tunneling ๐Ÿช†) to the mobile node's care-of address. which is why the mobile node MUST be capable of decapsulating packets sent to its home address if it wants to receive multicast datagrams this way ๐Ÿ”ฅ

now for sending. a mobile node that wants to send datagrams to a multicast group also has two options: (1) send directly on the visited network, or (2) send via a tunnel to its home agent ๐Ÿฆ‹ multicast routing in general 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, so no cap, that's a big assumption to check ๐Ÿ’€


4.5. Mobile Routers ๐Ÿšข

okay this one is so iconic ๐Ÿ˜ญ a mobile node can actually be a router that's in charge of 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 give a foreign agent care-of address to the mobile nodes connected to the mobile network ๐Ÿ’– here's how routing to a mobile node through a mobile router works in this case, step by step ๐Ÿ‘‡

a) a laptop gets unplugged from its home network and later plugged into a network port in the seat back of an aircraft ๐Ÿ’ปโœˆ๏ธ the laptop 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 that's the foreign agent on the aircraft is also 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 registers from time to time over its radio link with a series of foreign agents below it on the ground ๐Ÿ“ก this router's home agent is a node on the fixed network at the airline's headquarters ๐ŸŽ€

c) some correspondent node sends a datagram to the laptop, addressed to the laptop's home address ๐Ÿ’Œ this datagram gets routed to the laptop's home network first ๐Ÿ 

d) the laptop's home agent catches the datagram on the home network and tunnels it to the laptop's care-of address ๐Ÿช† in this example, that care-of address is an address of the node serving as router and foreign agent on the aircraft โœˆ๏ธ normal IP routing sends the datagram to the fixed network at the airline's headquarters โœจ

e) the aircraft router and foreign agent's home agent there catches 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 ๐ŸŒ so the original datagram from the correspondent node has now been encapsulated TWICE: once by the laptop's home agent and once by the aircraft's home agent ๐Ÿ˜ญ๐Ÿ™ˆ

f) the foreign agent on the ground decapsulates the datagram ๐Ÿช„ what's left is still encapsulated by the laptop's home agent, with a destination address of the laptop's care-of address. the ground foreign agent sends that datagram over its radio link to the aircraft ๐Ÿ“ก

g) the foreign agent on the aircraft decapsulates the datagram, which gives back the original datagram from the correspondent node, with a destination address of the laptop's home address ๐ŸŽ‰ the aircraft foreign agent then delivers it over the aircraft network to the laptop's link-layer address ๐Ÿ’ป๐Ÿ’–

that example showed the case where a mobile node is attached to a mobile network. so the mobile node is mobile with respect to the network, and the network is mobile too (with respect to the ground) ๐Ÿ›ธ but 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 can be used to get datagrams from correspondent nodes routed to the fixed node ๐Ÿ’…

first, a home agent MAY be configured with a permanent registration for the fixed node, which shows the mobile router's address as the fixed host's care-of address ๐ŸŽ€ the mobile router's home agent will usually be used for this purpose ๐Ÿข the home agent is then in charge of advertising connectivity to the fixed node using normal routing protocols ๐Ÿ“ฃ any datagrams sent to the fixed node will use nested tunneling, as described above ๐Ÿช†

or, the mobile router MAY advertise connectivity to the entire mobile network using normal IP routing protocols through a bi-directional tunnel to its own home agent ๐ŸŒˆ this method avoids the need for nested tunneling of datagrams, which is honestly a glow-up ๐Ÿฆ‹โœจ

4.6. ARP, Proxy ARP, and Gratuitous ARP ๐Ÿฆ‹

okay so ARP [36] needs some extra rules ๐Ÿ™ˆ once wireless or mobile nodes are involved. The requirements in this section apply to every home network that uses ARP for address resolution ๐Ÿ’…

Besides the normal ARP job of finding a target node's link-layer address from its IP address, this doc calls out two special ARP moves โœจ

  • A Proxy ARP [39] is an ARP Reply that one node sends on behalf of another node that can't or won't answer its own ARP Requests ๐Ÿซถ. The sender swaps the Sender and Target Protocol Address fields like [36] describes, but puts some configured link-layer address (generally, its own) in the Sender Hardware Address field. The node that gets the Reply links that link-layer address to the original target's IP address, so it sends future datagrams for that target to the node with that link-layer address. iykyk ๐Ÿ’€
  • A Gratuitous ARP [45] is an ARP packet a node sends on purpose to spontaneously make other nodes update an entry in their ARP cache ๐ŸŒธ. A gratuitous ARP MAY use either an ARP Request or an ARP Reply packet. Either way, the ARP Sender Protocol Address and ARP Target Protocol Address are both set to the IP address of the cache entry being updated, and the ARP Sender Hardware Address is set to the link-layer address that entry should be updated to. When 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 [36], 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 [36] ๐Ÿคฏ

While a mobile node is registered on a foreign network, its home agent uses proxy ARP [39] to reply to ARP Requests it receives that seek the mobile node's link-layer address ๐Ÿ โœจ. When receiving an ARP Request, the home agent MUST examine the target IP address of the Request. If this 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 that mobile node. After exchanging the sender and target addresses in the packet [39], 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 makes those nodes associate the home agent's link-layer address with the mobile node's home (IP) address. When registering a binding for a mobile node the home agent previously had no binding for (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 where the mobile node's home address is located. Broadcasts on the local link (such as Ethernet) are typically not guaranteed to be reliable, so 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 both 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 its 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 its (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 is also used to associate 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 its (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 the mobile node is trying to register with, or by a foreign agent with which the mobile node has an unexpired registration. In that 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. Also note 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 that foreign agent's Agent Advertisement, but not by transmitting a broadcast ARP Request message ๐Ÿง

The exact order in which each of the above ARP, proxy ARP, and gratuitous ARP requirements are applied, relative to the transmission and processing of the mobile node's Registration Request and Registration Reply messages when leaving or returning home, is super important for the protocol to work correctly ๐Ÿšจ

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

  • 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 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, the home agent performs no ARP processing (gratuitous or proxy).

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

  • 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 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 (gratuitous or 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 ๐Ÿšจ

okay bestie, buckle up ๐Ÿ˜ญ The mobile computing environment is potentially very different from the ordinary computing environment. 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 ๐Ÿ’€

5.1. Message Authentication Codes ๐Ÿ”

Home agents and mobile nodes MUST be able to perform authentication. The default algorithm is HMAC-MD5 [23], 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 [41] as one of the additional authentication algorithms for use when producing and verifying the authentication data 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 bestie, so the registration protocol in this doc means a mobile node's traffic gets tunneled to its care-of address ๐Ÿฆ‹ That tunneling is a huge vulnerability if the registration isn't authenticated ๐Ÿ˜ญ Sending traffic somewhere else on someone's behalf is widely understood as a security problem on today's Internet if it isn't authenticated [2], and the mobile registration protocol does exactly that kind of remote redirection. ๐Ÿ™ˆ Also, ARP isn't authenticated at all, so it can be used to steal another host's traffic. Gratuitous ARP (Section 4.6) comes with every single risk that regular ARP has, so be careful with it fr fr ๐Ÿ’€

5.3. Key Management

this spec requires a strong authentication mechanism (keyed MD5) ๐Ÿ’ช which shuts down a bunch of attacks against the Mobile IP registration protocol โœจ BUT key distribution is genuinely hard without a network key management protocol, so messages with the foreign agent aren't all required to be authenticated ๐Ÿซถ In a commercial setting, though, it might be super important 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. Main character energy for the billing department ๐Ÿ’œ

5.4. Picking Good Random Numbers

the strength of any authentication mechanism depends on a bunch of stuff ๐ŸŒˆ like how strong the algorithm is, how secret the key is, how strong the key is, and how well the implementation was actually built. This spec requires implementing keyed MD5 for authentication, but it does not preclude other authentication algorithms and modes ๐ŸŽ€ For keyed MD5 to be useful, the 128-bit key has to be both secret (only authorized parties know it) and pseudo-random โœจ If nonces are used for replay protection, they must also be selected carefully ๐Ÿ‘€ Eastlake, et al. [14] has more info on generating pseudo-random numbers if you want to go deeper, iykyk ๐Ÿงš

5.5. Privacy

if you've got sensitive data you don't want anyone seeing, use mechanisms outside the scope of this doc (like encryption) to protect it ๐Ÿ”’ Folks worried about traffic analysis should consider using link encryption ๐Ÿฆ‹ If you want absolute location privacy, the mobile node can make a tunnel to its home agent. Then datagrams headed to correspondent nodes look like they're coming from the home network, which makes it harder to pinpoint where the mobile node actually is ๐ŸŒธ All of these mechanisms are beyond the scope of this document, so go explore them elsewhere, bestie ๐Ÿซถ

5.6. Ingress Filtering

lowkey so a lot of routers run security policies like "ingress filtering" [15] ๐Ÿšง These block forwarding of packets whose Source Address looks topologically wrong. ๐Ÿ™ƒ If that's a problem for you, mobile nodes may use reverse tunneling [27] with the foreign agent supplied care-of address as the Source Address ๐Ÿ“ Reverse tunneled packets can pass through those routers normally, and ingress filtering rules can still find the true topological source of the packet, the same way they do for packets from non-mobile nodes โœจ Galaxy brain move, honestly ๐Ÿง ๐Ÿ’–

5.7. Replay Protection for Registration Requests

the Identification field is how the home agent checks that a registration message was freshly made by the mobile node and not replayed by some attacker from an earlier registration ๐Ÿ•ต๏ธโ€โ™€๏ธ There are two methods in this section: timestamps (mandatory) and "nonces" (optional). All mobile nodes and home agents MUST implement timestamp-based replay protection. These nodes MAY also implement nonce-based replay protection (but see Appendix A) ๐Ÿ’…

The replay protection style in effect between a mobile node and its home agent is part of the mobile security association ๐Ÿ” A mobile node and its home agent MUST agree on which method they're using. How the Identification field gets interpreted depends on the method, as explained in the subsections below ๐ŸŒˆ

No matter which method you use, the low-order 32 bits of the Identification MUST be copied unchanged from the Registration Request to the Reply ๐ŸŽ€ The foreign agent uses those bits (plus the mobile node's home address) to match Registration Requests with their replies. of any Registration Reply are identical to the bits it sent in the Registration Request.

The Identification in a new Registration Request MUST NOT be the same as in an immediately preceding Request, and SHOULD NOT repeat while the same security context is 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 core idea of timestamp replay protection is that the sending node stamps in the current time of day, and the receiving node checks that the stamp is close enough to its own clock โฐ Unless the security association between the nodes says otherwise, a default value of 7 seconds MAY be used to limit the time difference. That value SHOULD be greater than 3 seconds โœจ Obviously the two nodes need properly synchronized clocks ๐Ÿ•ฐ๏ธ And just like any other message, time synchronization messages may be protected against tampering by whatever authentication mechanism the security context between the two nodes sets up ๐Ÿซถ

If you're using timestamps, the mobile node MUST set the Identification field to a 64-bit value formatted as the Network Time Protocol [26] specifies ๐ŸŒŸ The low-order 32 bits of the NTP format are fractional seconds, and any bits you can't get from a time source SHOULD be generated from a good source of randomness ๐ŸŽฒ Here's the important part, though: when using timestamps, the 64-bit Identification in a Registration Request from the mobile node MUST be greater than the one used in any previous Registration Request, because the home agent uses this field as a sequence number too ๐Ÿ”ข Without that, a delayed duplicate of an earlier Registration Request could show up at the home agent (within the clock sync window the home agent requires) and get applied out of order, quietly changing the mobile node's current registered care-of address ๐Ÿ˜ฑ

When a Registration Request arrives 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 the timestamp is not valid, the home agent copies only the low-order 32 bits into the Registration Reply and supplies the high-order 32 bits from its own time of day clock ๐Ÿซ  In that case, the home agent MUST reject the registration by returning Code 133 (identification mismatch) in the Registration Reply ๐Ÿšซ

As described in Section 3.6.2.1, the mobile node MUST verify that the low-order 32 bits of the Identification in the Registration Reply are identical to those in the rejected registration attempt, before it uses the high-order bits for clock resynchronization ๐Ÿ” Double-check before you resync, babe ๐Ÿซถ

5.7.2. Replay Protection using Nonces

the basic idea of nonce replay protection is that node A puts a brand-new random number in every message to node B, and checks that node B sends that exact same number back in its next message to node A ๐Ÿ” Both messages use an authentication code to protect against alteration by an attacker ๐Ÿ›ก๏ธ At the same time, node B can send its own nonces in all messages to node A (which node A echoes back), so B can also verify it's getting fresh messages ๐Ÿ’œ

The home agent is expected to have the resources to compute pseudo-random numbers useful as nonces [14] ๐Ÿง  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 from the Registration Request into the low-order 32 bits of the Identification in the Registration Reply. When the mobile node gets an authenticated Registration Reply from the home agent, it saves the high-order 32 bits of the identification to use as the high-order 32 bits of its next Registration Request ๐ŸŒธ

The mobile node is responsible for generating the low-order 32 bits of the Identification in each Registration Request. Ideally it should generate its own random nonces ๐ŸŽฒ But it can use any expedient method, including duplicating the random value the home agent sent. The method is only the mobile node's concern, because the mobile node is the one checking for valid values in the Registration Reply ๐Ÿคทโ€โ™€๏ธ The high-order and low-order 32 bits of the identification chosen SHOULD both differ from their previous values ๐Ÿ”„ The home agent uses a new high-order value, and the mobile node uses a new low-order value, for each registration message ๐Ÿ’… The foreign agent uses the low-order value (and the mobile host's home address) to correctly match registration replies with pending Requests (Section 3.7.1) ๐Ÿฆ‹

If a registration message 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, and honestly that's iconic ๐Ÿ‘‘โœจ


6. IANA Considerations

Mobile IP specifies 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 [27, 29, 6, 7, 12]) ๐Ÿงฉ
  • values for the Code in the Registration Reply message (see section 3.4, and also consult [27, 29, 6, 7, 12]) ๐Ÿ”ข
  • Mobile IP defines so-called Agent Solicitation and Agent Advertisement messages. These are actually Router Discovery messages [10] augmented with Mobile IP-specific extensions. So they don't define a new name space, but they do define additional Router Discovery extensions as described below in Section 6.2. Also see Section 2.1 and consult [7, 12]. ๐Ÿ’–

There are additional Mobile IP numbering spaces specified in [7] ๐Ÿ’œ

Info about assignment of mobile-ip numbers derived from specifications outside this document is given by IANA at http://www.iana.org/numbers.html. From that URL, follow the hyperlinks to [M] within the "Directory of General Assigned Numbers," and then go to the specific section for "Mobile IP Numbers" ๐Ÿ—บ๏ธโœจ

6.1. Mobile IP Message Types ๐Ÿ’Œ

Okay so, Mobile IP messages are basically anything sent to a recipient at port 434, over UDP or TCP. ๐Ÿ“ฌ The number space for them is in Section 1.8. New extension numbers need Expert Review, and a specification is required [30]. ๐Ÿ“ The message types that are standardized right now are:

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

6.2. Extensions to RFC 1256 Router Advertisement ๐Ÿ›ฐ๏ธ

RFC 1256 gave us two ICMP message types, Router Advertisement and Router Solicitation. ๐Ÿซถ Mobile IP then made its own number space for extensions to Router Advertisement, and other protocols could use those too โœจ. The extension types standardized for Mobile IP are numbered like this:

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

Getting a new extension number approved for use with Mobile IP is subject to Expert Review, and a specification is required [30]. ๐Ÿ™ˆ

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) may have extensions. ๐Ÿงฉ All Mobile IP message extensions share the same number space, even when they're applied to different messages. The number space for these extensions is specified within this document. Approval of new extension numbers is subject to Expert Review, and a specification is required [30]. ๐Ÿ’…

Type  Name                                             Reference
----  --------------------------------------------     ---------
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, specified in section 3.4, has a Code field. The number space for those Code values is also specified in Section 3.4. ๐ŸŒธ The Code space is split up based on whether the registration worked, whether the foreign agent denied the registration request, or whether the home agent denied it:

   0-8        Success Codes
   9-63       No allocation guidelines currently exist
   64-127     Error Codes from the Foreign Agent
   128-192    Error Codes from the Home Agent
   193-255    No allocation guidelines currently exist

Approval of new Code values requires Expert Review [30]. ๐Ÿ”ฅ


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 [18, 19, 17].

Thanks also to Kannan Alaggapan, Greg Minshall, Tony Li, Jim Solomon, Erik Nordmark, Basavaraj Patil, and Phil Roberts, who kept the group going while performing the duties of chairperson, and who left a lot of really useful comments too. ๐Ÿ’–

Thanks to the active members of the Mobile IP Working Group, especially the ones who contributed text, listed here 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), and
  • Fumio Teraoka (Sony).
  • Alper Yegin (NTT DoCoMo)

Thanks to Charlie Kunzinger and Bill Simpson, the editors who wrote the first drafts of this document, reflecting what the Working Group talked through. ๐ŸŒˆ Much of the new text in the later revisions before RFC 2002 came from 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 for aggregatable extension types, were pulled in from a specification document called "Mobile IP Extensions Rationalization (MIER)". That document was written by:

  • Mohamed M.Khalil, Nortel Networks
  • Raja Narayanan, nVisible Networks
  • Haseeb Akhtar, Nortel Networks
  • Emad Qaddoura, Nortel Networks

Thanks to these authors, and also to Basavaraj Patil, Pat Calhoun, Neil Justusson, N. Asokan, and Jouni Malinen, who did additional work on MIER. ๐Ÿงš


A. Patent Issues โš–๏ธ

The IETF has been told about intellectual property rights claimed for some or all of the specification in this document. For more information, check the online list of claimed rights. ๐Ÿ“œ

The IETF doesn't take a position on whether any intellectual property or other rights that might be claimed to cover implementing or using this technology are valid or in scope, or on whether any license under those rights might be available. It also doesn't say it has tried to find any such rights. The IETF's procedures for rights in standards-track and standards-related documents are in BCP-11. Copies of claims of rights that were made available for publication, any assurances of licenses that will be made available, or the result of any attempt to get a general license or permission for implementers or users of this specification to use such proprietary rights can be obtained from the IETF Secretariat. ๐Ÿ’ผ

The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to practice this standard. Please send that information to the IETF Executive Director. ๐Ÿ“จ


The mobile node MAY use link-layer mechanisms to figure out that its point of attachment has changed. โœจ Those indications include the Down/Testing/Up interface status [24] and changes in cell or administration. The mechanisms will be specific to the particular link-layer technology, and they're outside the scope of this document. ๐Ÿ™ˆ

The Point-to-Point-Protocol (PPP) [42] and its Internet Protocol Control Protocol (IPCP) [25], negotiates the use of IP addresses. ๐Ÿ›œ The mobile node SHOULD first try to specify its home address, so that if the mobile node is attaching to its home network, the unrouted link will work correctly. If the peer doesn't accept the home address, but a transient IP address is dynamically assigned to the mobile node, and the mobile node can support a co-located care-of address, the mobile node MAY register that address as a co-located care-of address. ๐ŸŒท 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. ๐Ÿšซ

PPP extensions for Mobile IP have been specified in RFC 2290 [44]. Please check that document for more details on how to handle care-of address assignment from PPP in a more efficient way. ๐Ÿ’œ


C. TCP Considerations ๐ŸŒŠ

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

When high-delay links (like SATCOM) or low-bandwidth links (like High-Frequency Radio) 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 working fine, just with high delay because of the medium being used. That can make it impossible to create or keep TCP connections over those links, and it can also cause unneeded retransmissions that eat up bandwidth that's already scarce. Vendors are encouraged to follow the algorithms in RFC 2988 [31] when they implement TCP retransmission timers. Vendors of systems built for low-bandwidth, high-delay links should check out RFCs 2757 and 2488 [28, 1]. Designers of apps meant to run on mobile nodes should keep timer-related trouble in mind. ๐Ÿ’…

C.2. TCP Congestion Management ๐Ÿšฆ

Mobile nodes often use media that are more likely to introduce errors, which effectively causes more packets to get dropped. ๐Ÿ’€ That clashes with the congestion management mechanisms found in modern versions of TCP [21]. When a packet gets dropped, the correspondent node's TCP implementation is likely to react as if there were network congestion, and start the slow-start mechanisms [21] that were designed for handling that problem. But those mechanisms aren't right for fixing errors caused by the links themselves, and they end up magnifying the disruption from the dropped packet. This problem was analyzed by Caceres, et al. [5]. TCP approaches to handling errors that might interfere with congestion management are discussed in documents from the [pilc] working group [3, 9]. Those approaches are beyond the scope of this document, but they show that giving mobile nodes performance transparency means understanding mechanisms outside the network layer. ๐Ÿง  Higher media error rates also mean we should avoid designs that systematically drop packets, even though those designs might otherwise look good when making engineering tradeoffs. ๐Ÿซ 


D. Example Scenarios ๐ŸŽฌ

This section shows example Registration Requests for a few common scenarios. โœจ

D.1. Registering with a Foreign Agent Care-of Address ๐Ÿ•๏ธ

Here the mobile node gets an Agent Advertisement from a foreign agent and wants to register with that agent using the foreign agent care-of address it was given. ๐Ÿ’– The mobile node only wants IP-in-IP encapsulation, doesn't want broadcasts, and doesn't want simultaneous mobility bindings. ๐Ÿ™…โ€โ™€๏ธ The Registration Request looks like this:

   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)

D.2. Registering with a Co-Located Care-of Address ๐ŸŽ€

Okay so, the mobile node rolls into a foreign network with no foreign agents at all ๐ŸŒธ It grabs an address from a DHCP server [13] to use as its co-located care-of address. This mobile node is super flexible: it supports every form of encapsulation (IP-in-IP, minimal encapsulation, and GRE), it wants a copy of broadcast datagrams from the home network, and it does not want simultaneous mobility bindings ๐Ÿ’…

   IP fields:
     Source Address = care-of address obtained from DHCP server
     Destination Address = IP address of home agent
     Time to Live = 64
   UDP fields:
     Source Port = <any>
     Destination Port = 434
   Registration Request fields:
     Type = 1
     S=0,B=1,D=1,M=1,G=1
     Lifetime = 1800 (seconds)
     Home Address = the mobile node's home address
     Home Agent = IP address of mobile node's home agent
     Care-of Address = care-of address obtained from DHCP server
     Identification = Network Time Protocol timestamp or Nonce
   Extensions:
     The Mobile-Home Authentication Extension

D.3. Deregistration ๐Ÿ 

The mobile node is back home ๐Ÿฅน and it wants to deregister all of its care-of addresses with its home agent. Bye bye, care-of addresses ๐Ÿ‘‹

   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)

E. Applicability of Prefix-Lengths Extension ๐ŸŒˆ

Bestie, be careful using the Prefix-Lengths Extension over wireless links ๐Ÿ™ˆ Wireless transmitters don't have neat, regular coverage areas, so two foreign agents advertising the same prefix might actually give prospective mobile nodes different connectivity. That's why the Prefix-Lengths Extension SHOULD NOT be included in the advertisements sent by agents in that kind of setup.

If foreign agents use different wireless interfaces, they'd need to cooperate using special protocols to give identical coverage in space, and only then could they claim their wireless interfaces are on the same subnetwork ๐Ÿฆ‹ With wired interfaces it's different: a mobile node that disconnects and then connects to a new point of attachment may well send a new Registration Request, whether or not the new advertisement is on the same medium as the last recorded one.

And finally, in places packed with foreign agents, it would seem unwise to require routing protocols to propagate the subnet prefix for each individual wireless foreign agent ๐Ÿ˜ฌ That could quickly eat up space in routing tables, make routing updates take way longer to process, and slow down route selection, all for routes that are almost always unnecessary and that would be stored for wireless "subnets".

F. Interoperability Considerations โœจ

This document revises RFC 2002 to improve interoperability by clearing up ambiguities in the earlier text ๐Ÿ’œ Implementations that produce authentication data using the new, more precisely specified algorithm can interoperate with earlier implementations that did what was originally expected. That used to be a major source of non-interoperability, so this is a big deal ๐Ÿ‘‘

However, this specification does add new features that could cause interoperability problems with older implementations if they get used ๐Ÿ’€ All features specified in RFC 2002 still work with the new implementations, except for V-J compression [20]. Here's the list of the possible compatibility problems nodes following this revised spec might run into when talking to nodes that follow RFC 2002:

  • A client that expects some of the newly mandatory features (like reverse tunneling) from a foreign agent would still be interoperable as long as it pays attention to the `T' bit.
  • Mobile nodes that use the NAI extension to identify themselves would not work with old mobility agents.
  • Mobile nodes that use a zero home address and expect to receive their home address in the Registration Reply would not work with old mobility agents.
  • Mobile nodes that attempt to authenticate themselves without using the Mobile-Home authentication extension will be unable to successfully register with their home agent.

In all of these cases, a robust, well-configured mobile node is very likely to recover if it takes reasonable actions when it receives a Registration Reply with an error code that explains 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, the mobile node could retry the registration with a mobile-home authentication extension, since the foreign agent and/or home agent in this case won't be configured to demand the alternative authentication data ๐Ÿงš

G. Changes since RFC 2002 ๐ŸŒธ

This section lists the differences between the original Mobile IP base specification (RFC 2002 and ff.) and this revised Mobile IP protocol specification ๐Ÿ’–

G.1. Major Changes ๐Ÿ”ฅ

  • Specification for the Destination IP address of a Registration Reply transmitted from a Foreign Agent, so there's no possible transmission to IP address 0.0.0.0.
  • Specification of two new formats for Mobile IP extensions, based on the ideas in MIER.
  • Specification that the SPI of the MN-HA authentication extension is to be used as part of the data over which the authentication algorithm must be computed.
  • Eliminated the Van-Jacobson Compression feature.
  • Specification that foreign agents MAY send advertisements at a rate faster than once per second, but chosen so that the advertisements do not burden the capacity of the local link. For simplicity, the foreign agent now MAY send advertisements at an interval less than 1/3 the advertised ICMP Lifetime.
  • Specification that foreign agents SHOULD support reverse tunneling, and home agents MUST support decapsulation of reverse tunnels.
  • Changed the preconfiguration requirements in section 3.6 for the mobile node to reflect the capability, specified in RFC 2794 [6], for the mobile node to identify itself by using its NAI, and then getting a home address from the Registration Reply.
  • Changed section 3.7.3.1 so that a foreign agent is not required to discard Registration Replies that have a Home Address field that does not match any pending Registration Request.
  • Allowed registrations to be authenticated by use of a security association between the mobile node and a suitable authentication entity acceptable to the home agent. Defined "Authorization-enabling Extension" as an authentication extension that makes a registration message acceptable to the recipient. This is needed according to the specification in [6].
  • Mandated that HMAC-MD5 be used instead of the "prefix+suffix" mode of MD5 that was originally mandated in RFC 2002.
  • Specified that the mobile node SHOULD take the first care-of address in a list offered by a foreign agent, and MAY try each subsequent advertised address in turn if the attempted registrations are rejected by the foreign agent.
  • Clarified that a mobility agent SHOULD only put its own addresses into the initial (i.e., not mobility-related) list of routers in the mobility advertisement. RFC 2002 suggests that a mobility agent might advertise other default routers.
  • Specified that a mobile node MUST ignore reserved bits in Agent Advertisements, rather than discarding such advertisements. That way, new bits can be defined later without affecting the ability of mobile nodes to use the advertisements even when the newly defined bits aren't understood. Furthermore, foreign agents can set the `R' bit to make sure new bits are handled by themselves instead of some legacy mobility agent.
  • Specified that the foreign agent checks that the indicated home agent address does not belong to any of its network interfaces before relaying a Registration Request. If the check fails, and the foreign agent is not the mobile node's home agent, then the foreign agent rejects the request with code 136 (unknown home agent address).
  • Specified that, while they are away from the home network, mobile nodes MUST NOT broadcast ARP packets to find the MAC address of another Internet node. Thus, the (possibly empty) list of Router Addresses from the ICMP Router Advertisement portion of the message is not useful for selecting a default router, unless the mobile node has some means that doesn't involve broadcast ARP, and that isn't specified within this document, for obtaining the MAC address of one of the routers in the list. Similarly, in the absence of unspecified mechanisms for obtaining MAC addresses on foreign networks, the mobile node MUST ignore redirects to other routers on foreign networks.
  • Specified that a foreign agent MUST NOT use broadcast ARP for a mobile node's MAC address on a foreign network. It may obtain the MAC address by copying the information from an Agent Solicitation or a Registration Request transmitted from a mobile node.
  • Specified that a foreign agent's ARP cache entry 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 the MAC address associated with the mobile node's IP address.
  • At the end of section 4.6, clarified that a home agent MUST NOT make any changes to the way it performs proxy ARP after it rejects an invalid deregistration request.
  • In section 4.2.3, specified that multihomed home agents MUST use the address sent to the mobile node in the home agent field of the registration reply as the source address in the outer IP header of the encapsulated datagram.
  • Inserted the 'T' bit into its proper place in the Registration Request message format (section 3.3).

G.2. Minor Changes โœจ

Okay bestie, here are the smaller glow-ups ๐ŸŽ€. They're little, but they still matter ๐Ÿ’…

  • Registration replies can now be processed by the mobile node even when there's no Mobile-Home Authentication extension, as long as they contain a rejection code from the foreign agent ๐Ÿฆ‹
  • The foreign agent MAY configure a maximum number of pending registrations it's willing to maintain (typically 5) ๐Ÿงš. Any extra registrations SHOULD then be rejected with code 66. The foreign agent MAY delete a pending Registration Request once it has been pending for more than 7 seconds. In that case, the foreign agent SHOULD reject the Request with code 78 (registration timeout) ๐Ÿ’€
  • The rule got relaxed a bit. When a mobile node has joined a multicast group at the router on the foreign network, the mobile node MUST use its home address as the source IP address for multicast packets, ๐ŸŒธ
  • It's now clarified that a mobility agent MAY use different settings for each of the 'R', 'H', and 'F' bits on different network interfaces ๐Ÿ”ฅ
  • "Recursive tunneling" got renamed to "nested tunneling" ๐Ÿ’–
  • The mobile node MAY use the IP source address of an agent advertisement as its default router address ๐Ÿซถ
  • Keys with arbitrary binary values MUST be supported as part of mobility security associations. Yes, all of them ๐Ÿ‘‘
  • The default value may be chosen as 7 seconds for allowable time skews between a home agent and mobile node that use timestamps for replay protection. This value SHOULD be greater than 3 seconds โญ
  • Registration Requests with the 'D' bit set to 0, and specifying a care-of address not offered by the foreign agent, MUST be rejected with code 77 (invalid care-of address). Not valid, not allowed ๐Ÿ™ˆ
  • The foreign agent SHOULD consider its own maximum value when handling the Lifetime field of the Registration Reply ๐Ÿ“
  • The home agent MUST ignore the 'B' bit (as opposed to rejecting the Registration Request) if it does not support broadcasts ๐Ÿงš
  • There's advice about dynamic home agent discovery not being possible when 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. Heads up, that one's a trap ๐Ÿ’€
  • It's now clarified that when an Agent Advertisement is unicast to a mobile node, the specific IP home address of a mobile node MAY be used as the destination IP address ๐Ÿ’œ
  • RFC 2290, which deals with PPP operation, is now referenced within appendix B ๐ŸŒˆ
  • There's a brand new IANA Considerations section ๐ŸŽ€
  • In section 3.8.3, it's clarified that a home agent SHOULD arrange the selection of a home address for a mobile node when the Registration Reply contains a zero Home Address ๐Ÿฆ‹

G.3. Changes since revision 04 of RFC2002bis

This section lists the changes between this version (...-06.txt) and the previous version (...-04.txt) of the document. The RFC editor can delete this section ๐Ÿงš

  • HMAC-MD5 should be considered for use in place of the "prefix+suffix" mode of MD5 as originally mandated in RFC 2002 ๐Ÿ”
  • RFC 2290, which deals with PPP operation, is referenced within appendix B again ๐ŸŒธ
  • The IANA Considerations section got revamped ๐Ÿ’…
  • The Changes section got revamped too โœจ
  • The Patents section got swapped for wording mandated from RFC 2026 ๐Ÿซถ
  • Citations got updated ๐Ÿ“

H. Example Messages ๐Ÿงš

H.1. Example ICMP Agent Advertisement Message Format

Here's the ICMP Agent Advertisement layout, bestie ๐Ÿ’–

    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|  reserved     |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                     Care-of Address[1]                        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                     Care-of Address[2]                        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                         ....                                  |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   :                     Optional  Extensions                      :
   :   ....                ......                      ......      :
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

H.2. Example Registration Request Message Format

Right after the UDP header come the Mobile IP fields, and they look like this โœจ

    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Type = 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...
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

H.3. Example Registration Reply Message Format

Same deal for the reply, right after the UDP header ๐Ÿฆ‹

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

References ๐Ÿ“š

Here's the full reading list, bestie, so you can go dig up any source you want. Every single one is here, with all its details. ๐Ÿค“

  • [1] Allman, M., Glover, D. and L. Sanchez, "Enhancing TCP Over Satellite Channels using Standard Mechanisms", BCP 28, RFC 2488, January 1999.
  • [2] S. M. Bellovin. Security Problems in the TCP/IP Protocol Suite. ACM Computer Communications Review, 19(2), March 1989. ๐Ÿ’€
  • [3] Border, J., Kojo, M., Griner, J., Montenegro, G. and Z. Shelby, "Performance Enhancing Proxies", RFC 3135, June 2001.
  • [4] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. ๐Ÿ”‘
  • [5] Ramon Caceres and Liviu Iftode. Improving the Performance of Reliable Transport Protocols in Mobile Computing Environments. IEEE Journal on Selected Areas in Communications, 13(5):850--857, June 1995.
  • [6] Calhoun P. and C. Perkins, "Mobile IP Network Access Identifier Extension for IPv4", RFC 2794, January 2000.
  • [7] Calhoun, P. and C. Perkins, "Mobile IP Foreign Agent Challenge/Response Extension", RFC 3012, December 2000.
  • [8] Cong, D., Hamlen, M. and C. Perkins, "The Definitions of Managed Objects for IP Mobility Support using SMIv2", RFC 2006, October 1996.
  • [9] 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.
  • [10] Deering, S., "ICMP Router Discovery Messages", RFC 1256, September 1991.
  • [11] Deering, S., "Host Extensions for IP Multicasting", STD 5, RFC 1112, August 1989.
  • [12] Dommety, G. and K. Leung, "Mobile IP Vendor/Organization-Specific Extensions", RFC 3115, April 2001.
  • [13] Droms, R., "Dynamic Host Configuration Protocol", RFC 2131, March 1997.
  • [14] Eastlake, D., Crocker, S. and J. Schiller, "Randomness Recommendations for Security", RFC 1750, December 1994.
  • [15] 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.
  • [16] Hanks, S., Li, T., Farinacci, D. and P. Traina, "Generic Routing Encapsulation (GRE)", RFC 1701, October 1994.
  • [17] J. Ioannidis. Protocols for Mobile Internetworking. PhD Dissertation - Columbia University in the City of New York, July 1993. ๐ŸŽ“
  • [18] John Ioannidis, Dan Duchamp, and Gerald Q. Maguire Jr. IP-Based Protocols for Mobile Internetworking. In Proceedings of the SIGCOMM '91 Conference: Communications Architectures & Protocols, pages 235--245, September 1991.
  • [19] John Ioannidis and Gerald Q. Maguire Jr. The Design and Implementation of a Mobile Internetworking Architecture. In Proceedings of the Winter USENIX Technical Conference, pages 489--500, January 1993.
  • [20] Jacobson, V., "Compressing TCP/IP headers for low-speed serial links", RFC 1144, February 1990.
  • [21] Jacobson, V., "Congestion Avoidance and Control. In Proceedings, SIGCOMM '88 Workshop, pages 314--329. ACM Press, August 1988. Stanford, CA.
  • [22] Kent, S. and R. Atkinson, "IP Authentication Header", RFC 2402, November 1998.
  • [23] Krawczyk, H., Bellare, M. and R. Canetti, "HMAC: Keyed-Hashing for Message Authentication", RFC 2104, February 1997.
  • [24] McCloghrie, K. and F. Kastenholz, "The Interfaces Group MIB", RFC 2863, June 2000.
  • [25] McGregor, G., "The PPP Internet Protocol Control Protocol (IPCP)", RFC 1332, May 1992.
  • [26] Mills, D., "Network Time Protocol (Version 3) Specification, Implementation", RFC 1305, March 1992.
  • [27] Montenegro, G., "Reverse Tunneling for Mobile IP (revised)", RFC 3024, January 2001.
  • [28] Montenegro, G., Dawkins, S., Kojo, M., Magret, V. and N. Vaidya, "Long Thin Networks", RFC 2757, January 2000.
  • [29] Montenegro, G. and V. Gupta, "Sun's SKIP Firewall Traversal for Mobile IP", RFC 2356, June 1998.
  • [30] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", RFC 2434, October 1998.
  • [31] Paxson, V. and M. Allman, "Computing TCP's Retransmission Timer", RFC 2988, November 2000.
  • [32] Perkins, C., "IP Encapsulation within IP", RFC 2003, October 1996.
  • [33] Perkins, C., "IP Mobility Support", RFC 2002, October 1996.
  • [34] Perkins, C., "Minimal Encapsulation within IP", RFC 2004, October 1996.
  • [35] Perkins, C. and P. Calhoun, "AAA Registration Keys for Mobile IP", Work in Progress, July 2001.
  • [36] 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.
  • [37] Postel, J., "User Datagram Protocol", STD 6, RFC 768, August 1980.
  • [38] Postel, J., "Internet Protocol", STD 5, RFC 791, September 1981.
  • [39] Postel, J., "Multi-LAN Address Resolution", RFC 925, October 1984.
  • [40] Reynolds, J. and J. Postel, "Assigned Numbers", STD 2, RFC 1700, October 1994.
  • [41] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, April 1992.
  • [42] Simpson, W., "The Point-to-Point Protocol (PPP)", STD 51, RFC 1661, July 1994.
  • [43] Solomon, J., "Applicability Statement for IP Mobility Support" RFC 2005, October 1996.
  • [44] Solomon J. and S. Glass, "Mobile-IPv4 Configuration Option for PPP IPCP", RFC 2290, February 1998.
  • [45] Stevens, W., "TCP/IP Illustrated, Volume 1: The Protocols" Addison-Wesley, Reading, Massachusetts, 1994. ๐Ÿ“–

Authors' Addresses ๐Ÿ’Œ

If you need to reach the working group, the current chairs are the people to ping, babe. ๐Ÿซถ

Basavaraj Patil
Nokia
6000 Connection Dr.
Irving, TX. 75039
USA

Phone:  +1 972-894-6709
Email:  Basavaraj.Patil@nokia.com

Phil Roberts
Megisto Corp. Suite 120
20251 Century Blvd
Germantown MD 20874
USA

Phone:  +1 847-202-9314
Email:  PRoberts@MEGISTO.com

Questions about this memo can also be directed to the editor:

Charles E. Perkins
Communications Systems Lab
Nokia Research Center
313 Fairchild Drive
Mountain View, California 94043
USA

Phone:  +1-650 625-2986
EMail:  charliep@iprg.nokia.com
Fax:  +1 650 625-2502

The copyright text is legal wording, so I've kept it word for word, no vibes added. ๐Ÿ’œ

Copyright (C) The Internet Society (2002). All Rights Reserved.

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.

The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.

This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Acknowledgement ๐ŸŒธ

Funding for the RFC Editor function is currently provided by the Internet Society. Thank you, Internet Society, for keeping the RFC Editor lights on, periodt. โœจ

๐Ÿ“ฆ where this page comes from