Dynamics
Functional Definition $Revision: 1.47 $ State approved
Date 03-Dec-1998 Author Björn Andersson
Review date 10-Dec-1998 Reviewed by Jouni Malinen
Approval date 10-Dec-1998 Approved by Jouni Malinen
$Id: func_def.html,v 1.47 1998/12/09 22:38:16 jkmaline Exp $

Table of contents

Summary

1. Introduction
        1.1. Terms
        1.2. Framework
        1.3. Document structure
2. Overview
        2.1. General overview
        2.2. Operation overview
3. Data and databases
        3.1. Mobile node
        3.2. Home agent
        3.3. Foreign agent
4. Functions
        4.1. Protocols
        4.2. Messages
        4.3. Error recovery
5. External interfaces
        5.1. Interface to external systems
        5.2. Linux kernel interfaces
        5.3. User interface
        5.4. Application programming interface
6. Other features
        6.1. Performance
        6.2. Updatability
        6.3. Portability
        6.4. Usability
        6.5. Installation
7. References

Appendix A. Requirement vs. Functionality mapping
Appendix B. Example operations


Summary

The main motive of the Dynamics project is to make a prototype version of a hierarchical IP tunnel for IPv4 network. The project will use existing solutions and solution proposals as far as possible to achieve stable implementation.

Mobile Node is a computer, which is connected to the Internet. It can move from one network to another (Visiting Network). Home Agent redirects the packets arriving at the Mobile Node's Home Network to the Mobile Node so that the IP address of the Mobile Node need not be changed. The redirection to the Mobile Node is implemented as a tunnel using encapsulated IP packets (an IP packet inside another IP packet).

The path from the Home Agent to the Mobile Node is constructed of many tunnels. Foreign Agents reside between the tunnels and they make it possible to update the path more locally when the Mobile Node moves. The Foreign Agents establish a tree hierarchy from the root Foreign Agent which then communicates with Home Agents. Every Foreign Agent can communicate with Mobile Nodes. Different kinds of tunneling methods exist, but the main purpose for this project is to implement bi-directional tunneling, where data is moved entirely in the tunnel in both directions.

Foreign Agents advertise themselves for Mobile Nodes and when a Mobile Node moves it registers itself to the Home Agent through a path from the advertising Foreign Agent to the Home Agent. The registration message updates also the data structures in the Foreign Agents. Routing is thus changed in the Foreign Agent tree.

A Mobile Node and its corresponding Home Agent share a secret key. This secret key is used to calculate message authentication codes for the signaling messages in order to be able to authenticate Mobile Node and Home Agent to each other.

Every Foreign Agent has a public and a secret key. When the registration goes through the path to the Home Agent and the tunnel is established, every Foreign Agent sends its public key to its parent. The Home Agent gets the public key of the root Foreign Agent and uses this key to encrypt the Session Key for the Foreign Agent tree. In addition, the Session Key is encrypted for the Mobile Node using the shared secret between Home Agent and Mobile Node. The Session Key, that was generated by the Home Agent, is used to authenticate the Mobile Node when it moves.

Pre-configured and dynamic data is maintained at each module (Home Agent, Foreign Agent, Mobile Node). Linux system logging utilities, syslogd(8), are used in logging the events of the system.

A care-of address from the Visited Network is always required for the Mobile Node. It is used to direct the tunnel from the Home Agent to the Mobile Node. Registration protocol is used to register Mobile Nodes entering or changing the Visiting Network. Keep alive protocol is used to maintain the tunnels so that they will not expire and discard tunnel specific data. The main object was to use as few messages as possible when developing these protocols. Timeouts and critical information savings to disk drives are used to help the system to recover from errors and unexpected situations.

Linux kernel interface supports IP over IP tunneling and the modules in the kernel will be used and enhanced. Configuration and monitoring tools will be made as well as an API for developers for each module of the system.

1. Introduction

The main motive of the Dynamics project is to make a prototype version of a hierarchical IP tunnel for IPv4 network. The project deliverables are made for the MART-project. The main goal is to accomplish a system that can be further used and developed in research of the mobile IP field. More thorough description of the project and its goals is available in the beginning of the project plan.

1.1. Terms

The terminology used in this document follows the custom taken into use in this project. The terms are used as in RFCs of the mobile IP field and they are defined in a separate terminology specification.

1.2. Framework

This project will use existing solutions and solution proposals as far as possible. This will prevent extra work of "reinventing the wheel", and should lead to a more stable implementation. The main task for this project is to select the suitable solutions and to implement a working prototype of the hierarchical IP tunnel.

"RFC2002 - IP Mobility Support" [RFC2002] and "IP Mobility Support version 2" [IPMOB2] (work in progress) describe the base functionality needed for mobility. "Tunnel Establishment Protocol" [TEP] (work in progress) gives general ideas about tunnel establishment. "Mobile-IP Local Registration with Hierarchical Foreign Agents" [HIERFA] (work in progress) brings in the hierarchical aspects that are needed to make roaming more efficient. "Registration Keys for Route Optimization" [REGKEY] (work in progress) suggests a solution that makes roaming management more secure.

To fit the customer's needs our mission is mainly to combine existing solutions and, as these documents provide solutions for a broad spectrum of features, to filter out the extra functionality described in the documents.

This document will not go into the details described in the documents mentioned above, but instead it will try to give a big picture of the system in a way that is easier to understand than reading all the referenced documents one by one.

1.3. Document structure

A compact summary of the document is given above before the rest of the document. Chapter 1 (Introduction) explains briefly the project and the contents of this document. Chapter 2 (Overview) gives an general picture of the system. It describes the main aspects of the software operation and gives an overview of the security considerations. Chapter 3 (Elements and associated data) describes the data associated with main elements of the system. It defines the configurable data and the dynamic data needed for the operation at each element. Chapter 4 (Functions) defines the functionality of the system. The protocols used between the elements of the system are defined. Chapter 5 (External interfaces) defines the external interfaces from the viewpoint of the software to be produced. User interface and the support tools are specified and the APIs for the configuration and monitoring of the system are defined. Chapter 6 (Other features) describes features like performance and usability of the system. Chapter 7 (References) lists the reference material used in this document. Appendix A contains a requirement vs. functionality mapping and Appendix B illustrates some example operations of the protocols.

2. Overview

This chapter gives an general overview of the system and its operations. In addition the security of the operations is considered.

2.1. General overview

The Mobile Node is the mobile computer from which a user wants to have the Internet available. In addition she wants to be reachable from other computers, even while visiting other networks. Internet protocol v4 addresses are associated with a certain point of attachment somewhere in the Internet. Thus all packets destined for a particular computer will be routed to a fixed network. In order to let the Mobile Node move to other networks there must be a way of routing the packets arriving at the Home Network to the Mobile Node's location in the Visited Network. For this purpose each Home Network has a Home Agent.

In order to be able to know where to route packets to a Mobile Node visiting a foreign network, the Home Agent should always be aware of the current location of its Mobile Nodes. This is achieved by making the Mobile Nodes register with their Home Agent each time they change their point of attachment.

Sometimes, however, it can be expensive (or even impossible) for the Mobile Node to register with the Home Agent. This could happen, for example when the Home Agent is far away and the Mobile Node is receiving real-time video data. If the Mobile Node changes its point of attachment while receiving the video, it could take a while for the Home Agent to receive the registration of the new location, and the mobile user would perceive an annoying gap in the video stream. For this purpose so called Foreign Agents are placed in the Visited Network.

With the aid of the Foreign Agents, the Home Agent only needs to know under which Foreign Agent the Mobile Node is in care of; i.e. the Mobile Node registers with the Home Agent the location of the Foreign Agent. The actual point of attachment is registered with the Foreign Agent. When the Mobile Node now changes its point of attachment within the same Foreign Network, the Mobile Node only has to register its new point of attachment with the Foreign Agent.

To make the scheme even more flexible we can place one Foreign Agent within each subnet in a Foreign Network, so that the Foreign Agents make up a hierarchical structure. Now the registrations need to be sent only to a minimal distance.

The packets that the Home Agents and Foreign Agents route to the registered location must be kept intact. This can be done placing the original packet within another packet, that is then sent to the registered location. The receiver of the encapsulated packet can then unwrap the outer packet to retain the original inner packet intact. This method of encapsulating IP packets within other IP packets is called IP-over-IP, and the routing of packets with the aid of the wrapper packets is called tunneling [RFC2003]. The tunnel is thus, in our environment, between the Home Agent and the registered location of the Mobile Node. The tunnel is built of segments between the Home Agent and the root Foreign Agent, between each Foreign Agent in the path and finally between the lowest Foreign Agent and the Mobile Node.

Note that in principle the tunnel only has to be a one way pipe from the Home Agent to the Mobile Node, and not necessarily the other way around. Packets arriving from a Correspondent Host at the Home Network will be tunneled to the Mobile Node, but the Mobile Node can send packets directly to the Correspondent host, if the source address to be used in the packet is the address of the Mobile Node in the Home Network. This way of tunneling is called triangle routing or semi tunneling. Sometimes, however, a two-way tunnel, where both incoming and outgoing packets pass the tunnel through the Foreign Agents and Home Agent is preferred. This is called bi-directional routing or full tunneling. Full tunneling could for instance be useful because of security concerns when the source address in a packet must be topologically correct [REVTUN].

2.2. Operation Overview

When a Mobile user arrives to a Foreign Network and connects to the network, the Mobile Node receives an IP address. This triggers the Mobile Node to execute a Registration Protocol. Registration Protocol is implemented hierarchically and the tunnel is created through the Foreign Agent hierarchy step by step. This allows each Foreign Agent on the path to examine, if they already have a tunnel for the specified Mobile Node, which would allow them to perform local tunnel updates. For a new registration, the protocol reaches the Home Node which then confirms the tunnel creation. During registration, the Mobility Agents agree on the lifetime of the tunnel. Keep Alive protocol is used to keep the tunnel open and it should be re-initiated well before the tunnel's lifetime ends.

During tunnel creation each Mobility Node stores the next Mobility Node in upstream and downstream directions for each tunnel. This information is called Mobility Binding and it allows the nodes to forward packets to the next Mobility Agent.

When Mobile Node moves to another place and connects to a new Access Point it automatically receives a new IP address, and the Registration Protocol is executed again. This time, however, a local tunnel update is performed.

2.2.1. Security Overview

The Mobile Node and the Home Agent have a preconfigured shared key that they use to authenticate each other. As the mobile node moves it should authenticate itself with the Foreign Agents. It is, however, not very practical to manually configure Foreign Agents with shared keys, so another approach is needed. The approach we have chosen confirms with the "Home Agent as a Key Distribution Center" method as specified in [REGKEY].

When the mobile node registers with the Home Agent, each Foreign Agent sends in the Registration Request its public key to the next higher Foreign Agent, and the top level Foreign Agent to the Home Agent. The Home Agent then generates a Session Key. This key is sent in two copies in the Registration Reply: one for the top level Foreign Agent encrypted with its public key and one for the Mobile Node encrypted with the shared secret. When the top level Foreign Agent receives the Registration Reply it decrypts the Session Key, and encodes it with the next lower level Foreign Agent's public key, and so on. The Mobile Node in turn can decrypt its copy of the key with the shared secret. [REGKEY]

The Foreign Agents in the old path already know the Session Key for the tunnel, so the target Foreign Agent for the authentication is the first Foreign Agent that is in both the old and the new path. When the point of attachment for the mobile node changes it authenticates itself with the target Foreign Agent by computing a message authentication code (MAC) for the signaling message using the Session Key. The MAC is then sent to the Foreign Agent along with the Registration Request, and as before each Foreign Agent along the new path sends its own public key to the next higher Foreign Agent. When the target Foreign Agent receives the Registration Request it checks the MAC with its own Session Key. It then sends a registration reply to the Mobile Node. In the registration reply it includes the Session Key encrypted with the next lower Foreign Agent's public key, and so on. This way the Foreign Agents in the new path will get the Session Key for the tunnel. [REGKEY]

3. Elements and Associated Data

This section describes the data associated with each of the three elements -- the Mobile Node, the Foreign Agent and the Home Agent -- that are to be implemented to give mobile users transparent and flexible routing of datagrams in the Internet.

The data that each element has to maintain can roughly be divided into two categories:

Pre-configured data
Data that is (more or less) static, and should be maintained by a configuration API.
Dynamic data
Data that is dynamic and is specific for each pending registered tunnel. The element should maintain this data without any manual configuration. This data is read-only and should be accessible via a monitoring API.

This section also describes how each element react to different events such as incoming messages and expiring timers.

All elements will use the Linux syslog system to log events.

3.1. Mobile Node

The Mobile Node is the mobile computer from which a user wants to have the Internet available. In addition she wants to be reachable from other computers, even while visiting other networks.

The Mobile Node requires that there is always a co-located care-of address available. This makes the implementation more flexible and consistent.

Pre-configured data

The Mobile Node should be pre-configured with the following data:

Home Address
The IP address in the Home Network. The address is sent in Registration Requests.
Home Agent address
The IP address of the Mobile Node's Home Agent. The address is sent in Registration Requests and it is used by the highest Foreign Agent, so that it can forward the request.
Shared Secret
A Shared Secret with the Home Agent. A random key used to authenticate the Mobile Node at the Home Agent and vice versa.

Dynamic data

The Mobile Node maintains the following parameters for a registered tunnel:

Mobile Nodes care-of address
used in messages and tunnel packets as the source address
Address of the lowest Foreign Agent
the address received in Agent Advertisement messages. Registration Requests and tunneled packets are sent to this address.
Identification value sent in the registration
a timestamp used to match Registration Requests with Registration Replies. Each timestamp sent must be larger than the previously sent.
Originally requested lifetime
the remaining lifetime is set to this value during the re-registering
Remaining lifetime
a timer showing how long the tunnel is still valid. When the lifetime is near zero the Mobile Node should re-register. The value of "near zero" will be specified in a later phase.
Session Key
a key used to authenticate the Mobile Node with the Foreign Agents when updating the tunnel
Request timer
a timer used to check the timeout of the requests sent by the mobile node

Reactions to events

The Mobile Node accepts the following messages:

Registration Reply

On receipt of a Registration Reply the Mobile Node will check if it has any pending unconfirmed Mobility Bindings, indexed by the identification field. If there is no match the reply will be silently discarded. Otherwise the lifetime and the decrypted Session Key is recorded and the binding is marked as confirmed. The Mobile Node configures the tunnel and the lifetime timer starts ticking.

Agent Advertisement

If the Mobile Node has changed its point of attachment the Mobile Node will send a Registration Request to the sender of the Agent Advertisement.

Agent Advertisement messages contain information that shows if the Mobility Agent has booted. If the Mobile Node notice such information it should send a Registration Request to re-register.

If the Agent Advertisement is from the Mobile Node's Home Agent the Mobile Node will send a Registration Request with the lifetime value set to zero to deregister with the Home Agent.

Other events:
Change in the point of attachment

An external event will notify the Mobile Node when its point of attachment has changed. This will make the Mobile Node send a Mobility Agent Solicitation message, so that registration with the Foreign Agent can begin.

Lifetime timer is near expiration

some short time before the lifetime timer for a tunnel expires the Mobile Node sends a Registration Request. The time used will be defined in a later phase. The Request will not include a Session Key. This is so that Foreign Agents will know that they should forward the Registration Request up to the Home Agent

Lifetime timer expires

When the lifetime timer expires the Mobile Node purges the associated tunnel.

Request timer expires

When the timer expires the Mobile Node will send a new Registration Request

Logging

The Mobile Nodes log the following events:

3.2. Home Agent

The Home Agent is responsible for forwarding packets to its Mobile Nodes when they are away from their Home Network. It also decapsulates and forwards tunneled packets originating from its Mobile Nodes.

Pre-configured data

For each authorized Mobile Node the Home Agent must be configured with:

Home Address of the Mobile Node
the permanent local address of the Mobile Node
A shared secret with the Mobile Node
used to authenticate registrations

Dynamic data

For each registered Mobile Node the Home Agent will maintain the following data:

Mobile Node's registered care-of address
the address to which the Registration Replies are sent to and to which the tunnel will be directed. This is the address of the highest Foreign Agent in the Mobile Node's Visited Network.
Identification field from the Registration Reply
a timestamp sent in the Registration Request. It will be sent back in the Registration Reply. New Registration Requests must have the timestamp incremented to prevent replay attacks.
Session Key
the generated Session Key that identifies the tunnel, and is used in tunnel updates to authenticate parties involved in the update.
Remaining lifetime
a timer showing how long the tunnel is still valid. When the timer reaches zero the tunnel will be purged.

Reaction to events

The Home Agent accepts the following messages:

Agent Solicitation

On receipt of an Agent Solicitation Message the Home Agent replies to the sender with an Agent Advertisement Message.

Registration Request

On receipt of a Registration Request Message the Home Agent looks up the shared secret for the corresponding Mobile Node. The shared secret is used to check the MAC of the request message. If a Mobility Binding for the Mobile Node exists, then the timestamp in the request is checked that is greater than the one in the Mobility Binding. If either of these checks fail, the Home Agent responds to the sender with a Registration Reply with a code indicating registration failure. If the checks succeed the Home Agent will determine the smaller lifetime value of the one in the request and the Home Agent's pre-configured value. It will then generate a Session Key and create a Mobility Binding consisting of the Mobile Node's address, its highest Foreign Agent, the identification timestamp and the Session Key. The Home Agent then responds with a Registration Reply indicating registration success. The message includes the same timestamp as the request, the lifetime value, a MAC, the Session Key encrypted with the shared secret, the Session Key encrypted with the highest Foreign Agent's public key. The Home Agent configures a tunnel between itself and the highest Foreign Agent. From this point on the Home Agent works as a proxy ARP for the registered Mobile Node.

If the lifetime in the request is set to zero, the Home Agent interprets this as a deregistration from the Mobile Node. On deregistration the Foreign Agent purges the tunnel configuration and stops the proxy ARP functionality for the Mobile Nodes address.

Other events:
Lifetime timer expires

When the lifetime timer for a mobility binding expires, the Home Agent will purge the associated tunnel.

Logging

The Home Agent will log:

3.3. Foreign Agent

The purpose of the Foreign Agent is to forward packets arriving from the upstream Mobility Agents to a downstream Mobility Agent or the Mobile Node.

Pre-configured data

The Foreign Agent should be pre-configured with the following data:

Allowed tunneling modes
used in the Agent Advertisement message to tell the Mobile Nodes what tunneling modes are allowed in the Visited Network
Address of next higher Foreign Agent
the Foreign Agent forwards Registration Requests to this address. If it is not set, the Foreign Agent should forward the Registration Request to the Home Agent given in the request.
Address of highest Foreign Agent
the Foreign Agents uses this in Agent Advertisement messages.
Public-secret key pair
The public key is used by the next higher Mobility Agent to encrypt a Session Key. The secret key is used to decrypt the encrypted key.
Agent Advertisement broadcast interval
The interval in seconds that the Foreign Agent uses in sending Agent Advertisements
Maximum lifetime
the maximum lifetime of a tunnel that the highest Foreign Agent accepts before a re-registration from the Mobile Node is required

Dynamic data

The Foreign Agent maintains the following data for each mobility binding:
Address of a lower Foreign Agent or a Mobile Node
The address of the sender of a Registration Request. The matching Registration Reply is sent to this address.
Lower Foreign Agent's public key
The Session Key is encrypted with the public key in a Registration Reply
Session Key
The Session Key for the Mobility Binding. The key is used to authenticate tunnel updates from the Mobile Node.
Home Address of Mobile Node
The mobility binding is indexed by this address.
Remaining lifetime
The remaining lifetime of the binding. When the lifetime reaches zero, the binding will be purged.
Request lifetime
the remaining time that the Foreign Agent waits on a matching reply.
Identification
used to match Registration Requests with Registration Replies.

Reaction to events

The Foreign Agent accepts the following messages:

Agent Solicitation

On receipt of an Agent Solicitation message the Foreign Agent replies to the sender with an Agent Advertisement message.

Registration Request

On receipt of a Registration Request the Foreign Agent checks whether it has a pending mobility binding for the Home Agent specified in the request.

If the there is no pending binding, an unconfirmed binding is created. This binding will contain the Home Address, Home Agent, source address, identification and, if available, the public key retrieved from the request. The Registration Request is then forwarded to the pre-configured next upper Foreign Agent, but with the public key replaced with its own. The unconfirmed binding will be maintained for a specified interval that will be defined in a later phase.

If there is a pending binding and the source address of the binding and request differs then the MAC of the request message is checked with the Session Key. If the check fails the request is forwarded to the next higher agent. If there is a pending binding but source address of the binding and the request is the same, the request is forwarded to next higher agent. Otherwise the binding is updated, and a Registration Reply is sent to the source address of the request. If the request contains a public key, the Session Key is encrypted with it, and the encrypted Session Key is appended to the reply. The lifetime of the binding is set to the minimum of the requested lifetime and the remaining lifetime of the pending binding. This lifetime is returned in the reply. If the request has a lifetime of zero the binding will be purged.

If there is a pending binding but there is no MAC included in the Registration Request, the Foreign Agent forwards the request to the next higher Mobility Agent.

Registration Reply

On the receipt of a Registration Reply the Foreign Agent will check if it has any pending unconfirmed mobility bindings, indexed by the Home Address, Home Agent and identification fields. If there is no match the reply will be silently discarded. Otherwise the lifetime and the decrypted Session Key is recorded and the binding is marked as confirmed. The Registration Reply is then forwarded to the care-of address found in the binding, but with the Session Key replaced by the Session Key encrypted with the recorded public key. A tunnel is configured and the lifetime counter starts counting down.

Other events:
Lifetime timer expires

When the lifetime timer for a mobility binding expires, the Foreign Agent will purge the associated binding.

Logging

The Foreign Agents will log:

4. Functions

This chapter handles the functions of the system. The protocols used and their messages are defined. In addition the error recovery functions are specified.

4.1. Protocols

Two protocols will be used for signaling: Registration protocol for mobile registration in network and Keep Alive Protocol, which confirms that the tunnel is still working and should not be destroyed.

Registration Protocol

The Registration Protocol is responsible for registering a new mobile node to network and establishing a tunnel. Same protocol is used when mobile node notices that its Access Point has changed and registration to a new foreign agent is needed.

The protocol will be based on idea that the mobile is dumb and the network is smart. The mobile will not need to know anything about the structure of the Foreign Network. This approach is different from the one specified in Mobile IP standards [RFC2002]. The approach was selected because it minimizes the traffic over radio interface, results in simpler mobile construction, is easier to scale and minimizes the requirements for the Foreign Network (no need to identify the organization).

The protocol needs to negotiate the tunnel Lifetime, because different Mobile Agents may have different maximum Lifetimes for their tunnels. Also as a result the lowest maximum Lifetime is selected and propagated through the system. In the following the sequence of messages is presented. However, more detailed actions performed by the agents are presented in their respective descriptions.

The Mobile Node needs to know which Foreign Agents are present and it initiates registration by sending a Mobility Agent Solicitation message, which results in a Mobile Agent Advertisement message sent by lowest Foreign Agents. Having heard an advertisement message, the Mobile Node requests a tunnel of a specific type and lifetime by sending a Registration Request message to the lowest Foreign Agent.

Each Mobility Agent has three options to continue the protocol. They can reject the tunnel creation if they cannot accept any more connection. A rejecting Registration Reply is sent down in this case. They can accept a location update and send an accepting Registration Reply down. Otherwise the message is relayed further upwards and finally to the Home Agent. The Home Agent is then responsible for the acceptance or rejection of the tunnel.


Figure 1


Figure 2

Keep Alive Protocol

The Keep Alive Protocol is used to confirm that the tunnel is still up and all Mobile Agents are within reach. The protocol is initiated by the Mobile Node when the tunnel's lifetime is ending.

The Mobile Node sends a Registration Request message without a Session Key. Foreign Agents relay the message to the Home Agent, which authenticate the message and replies with a normal Registration Reply confirming the tunnel again. Foreign Agents can now reset their tunnel timers having received a Registration Reply for the active tunnel. Finally the Registration Reply arrives to the Mobile Agent, which in turn now knows that the underlying tunneling is working. Otherwise the old tunnel should be destroyed and a new one requested.

Deregistration Protocol

If the mobile node decides that the tunnel is not working properly or is no longer needed, it can deregister itself from the network and purge the tunnel. This is accomplished with the Deregistering Protocol. The mobile node simply sends a Registration Request message with Lifetime set to zero to deregister the tunnel.

4.2. Messages

Four signaling messages are needed. Foreign Agents and Home Agents use Mobility Agent Advertisement messages to broadcast their presence. Mobile Nodes asks for Mobility Agent Advertisements with Mobility Agent Solicitation messages and initiate tunnels using Registration Request messages, which are passed through the hierarchy of Foreign Agents to the Home Agent. The Home Agent uses Registration Reply message to confirm tunnel creation. Registration Reply message passes back to mobile confirming the tunnel creation.

All messages have a type field. This information can be used to deduce the version of a message and what messages each element can accept.

4.2.1. Mobility Agent Solicitation

The purpose of the Agent Solicitation message is for the Mobile Node to request an Agent Advertisement from a Mobile Agent.

An Agent Solicitation message is identical to an ICMP Router Solicitation [RFC1256] with the further restriction that the IP TTL field is set to 1. [RFC2002]

Version number
This value will be indicated by using an appropriate number in the message type field.

4.2.2. Mobility Agent Advertisement

This message is broadcasted by Foreign Agents and Home Agents to inform the Mobile Nodes of their presence. The message must be broadcast even when the Mobility Agents cannot accept any more connections, because registered Mobile Nodes use these messages to determine that the Foreign Agent is still reachable and alive.

The messages should include the following information:

Version number
This value will be indicated by using an appropriate number in the message type field
Registration lifetime
The time in seconds that the Mobility Agent is willing to serve the Mobile Node before a new registration is required
Busy
A boolean field that indicates whether the Agent is willing to accept new registrations
Home agent service
A boolean field indicating whether the Agent offers Home Agent services
Foreign agent service
A boolean field indicating whether the Agent offers Foreign agent services
Allowed tunneling modes
Tells which of the following tunneling modes are allowed in the network: Full tunneling, Semi tunneling and Open mode
Care-of address hierarchy
A list of IP address of all Foreign Agents on the path to the top-level Foreign Agent of this network including itself.

4.2.3. Registration Request

The Mobile Node sends a Registration Request when it wants to create or update a hierarchical tunnel. The message registers the Mobile Node with all the Mobility Agents between itself and up to and including the Home Agent. Each Mobility Agent receiving the request relays it to the next higher level care-of address in the hierarchy. [HIERFA]

The Registration Request is formatted as described in [HIERFA]. When relayed from a Foreign Agent it will contain the Foreign Agent Public Key Extension as described in [REGKEYS].

The message should include the following information:

Version number
This value will be indicated by using an appropriate number in the message type field.
Home Address
The Mobile Node's Home Address
Home Agent
The Mobile Node's Home Agent address
Care-of address
The care-of address of the mobile node sending the Registration Request
Identification
A timestamp indicating when the message was sent. This is to avoid replay attacks. This means that the clocks of the Home Agent and Mobile Node must be synchronized within a specified time interval, e.g. 7 seconds. Timestamps must always be increased.
Lifetime/Deregistration
The lifetime for the tunnel that the Mobile Node requests. This time should never be greater than the time sent in the Mobility Advertisement Messages. Setting this time to zero equals to a deregistration.
Mobile-Home Authentication
A message authentication code that is computed over the above fields in addition to the Shared Secret of the Mobile Node and its Home Agent. See the "Mobile-Home Authentication Extension" in [RFC2002].
Public key
Mobility Agents append their public key so that the next higher-level Mobility Agent can encrypt Session Key in the Registration Reply.

4.2.4. Registration Reply

The message is sent by Foreign Agents and Home Agents to indicate the failure or success of a Registration Request.

The message should include the following information:

Version number
This value will be indicated by using an appropriate number in the message type field.
Home Address
The Home IP address of the Mobile Node that is to receive the Reply.
Mobility Agent
The IP address of the Mobile Node from which the Reply originated.
Acceptance Code
A code describing the status of the registration. This should minimally report success or failure. For a good list of possible codes see [HIERFA].
Identification
The same timestamp received in the corresponding Request. This is used to match Replies with Requests.
Mobile-Home Authentication
A message authentication code that is computed over the above fields in addition to the Shared Secret of the Mobile Node and its Home Agent. See the "Mobile-Home Authentication Extension" in [RFC2002].
Session Key
A random session key that is sent in two copies: one encrypted with the aid of the registered Mobile Node's shared secret and the other encrypted with the public key of the next lower Mobility Agent in the hierarchy. [REGKEY]

4.3. Error recovery

There can be situations where something unexpected happens. The home agent, foreign nodes or the mobile node could crash or suffer from a power loss and reboot. Network connections could be very slow or have long delays. Radio channel disturbances might block the communication between the Mobile Node and Foreign Agent. Error recovery actions in situations like these must be defined.

Timeouts take care that the old tunnels are removed. Otherwise the information on unused tunnels might be active forever. Removing old tunnels after a timeout releases more system resources.

4.3.1. Home Agent

The Home Agent saves the necessary information from the databases to a disk drive to help recover from a power loss or system crash. At least the latest care-of address of the Mobile Nodes should be saved. For security reasons the session keys must not be saved to the disk. The session key can be regenerated after that kind of incident. The most important thing is just to know, where the Mobile Node can be reached in case a connection request is received from the Correspondent Host. However, if that information has been lost, incoming connections to the Mobile Node will report "Destination host unreachable" until the Mobile Node has re-authenticated after specified timeout.

If the Home Agent notices that the connection with the Correspondent Host in the Internet is lost, the Mobile Node will be informed about the loss of the connection.

The Home Agent will not accept broken or unauthorized packets from the Mobile Node. Those packets are dropped. Information about unauthorized packets will be logged.

4.3.2. Foreign Agent

The Foreign Agents save the connection information to the disk. If that information cannot be restored after the reboot, the Foreign Agent can ask the neighboring Foreign Agents to recover as much information as possible. If a connection information is lost, the Foreign Agent has to wait for the Mobile Node to re-register.

4.3.3. Mobile Node

If the Mobile Node is rebooted, it will simply connect to the Foreign Agent as if it had just arrived in the Visited Network. As the rebooting closes all the connections, no more intelligent solution is required in the Mobile Node.

If the Mobile Node goes to area that is outside the radio coverage or otherwise unconnected to the network, the system does not close the connections immediately before the timeout. After the timeout the Mobile Node has to reconnect to the Visited Network.

5. External interfaces

This chapter defines the external interfaces from the viewpoint of the software to be produced. User interface and the support tools are specified and the APIs for the configuration and monitoring of the system are defined.

5.1. Interface to External Systems

In home network the system connects to local network using IP protocol. However, the ARP protocol is used to imitate the mobile.

5.2. Linux Kernel Interfaces

Linux kernel includes two modules to support IP over IP tunneling, the encapsulator (tunnel.o) and the decapsulator (ipip.o). The tunnel driver is implemented as a network device. After the driver is loaded, it can be setup as any other network interface using ifconfig. The tunnel device is given the home address of the Mobile Node, and also the point-to-point address, namely the care-of address. After the device is configured for use, the 'route' command can be used to route traffic through the IP tunnel [REATUN]. Tunnel.o and ipip.o modules in the Linux kernel provide the base functionality for our implementation. Some additional code will be added to these modules. Modules use skb_* function calls which provide manipulation functionality for the IP packets. There are for example functions to add the extra header needed for encapsulation and to remove the extra header when decapsulating.

5.3. User Interface

The configuration parameters are stored in the initialization files in ASCII format when the system is installed and administrative users may access these files directly. However, the modification will be reflected to system only after the appropriate agent is restarted.

The users will be provided support tools to access the system. Following tools will be created:

Home Agent Configuration & Monitoring Tool is used to monitor and configure the home agent. All functionality provided by the Mobile Node API will be available.

Foreign Agent Configuration & Monitoring Tool is used to monitor and configure the foreign agents. All functionality provided by Foreign Agent API will be available.

Mobile Configuration & Monitoring Tool is used to monitor and configure the mobile node. All functionality provided by Mobile Node API will be available.

Mobile Tunnel Control Tool provides mobile users the means to connect and disconnect from network as well as selecting the tunneling mode.

The programs will be started from the unix command prompt. Users may use the program's command line based interface or give commands as command line parameters. The commands will be in English and 'Help'-command will be available explaining what commands can be used, what they do and which parameters they require. The interface will support using the programs in scripts.

The monitoring commands will by dynamic, allowing the user to set the refresh interval.

5.4. Application Programming Interface

The system will provide an API for developing configuration and monitoring tools. The APIs provide functions to dynamically modify the tunneling and configuration parameters, monitor load and control active connections. The APIs will be available to the developers through three separate libraries. One library contains API for FA, one for HA and one for MN.

The more precise functional description of the APIs follows.

Foreign Agent API Functionality

Home Agent API Functionality

Mobile Node API Functionality

6. Other features

The previous chapters defined the functional features and interfaces. There are also other features involved in this project that haven't yet been defined. These non-functional features are described in the following sections.

6.1. Performance

There is no computer system that has unlimited amount of resources. The system will be designed to use the system resources effectively. In order to minimize the system load, efficient algorithms will be used. The software shouldn't be a bottleneck to the other system. Using the tunnel shouldn't have more than just a slight effect on the data throughput. The system uses hierarchical tunneling that can be updated faster than non-hierarchical. For example, updating causes smaller delays when transferring continuous video stream. The performance is a relatively important property.

6.2. Updatability

The further development of the system and software will be kept in mind. The interoperability between different versions will be possible because of the protocol version numbering. The system and code will be very well documented so that it will be easy to read and understand. This is a mandatory property.

The modularity in the mobility management security design will allow inserting additional cryptographic modules into the system. Adding modules won't need any big changes in the actual code. This is a relatively important property.

6.3. Portability

The portability of the software will be taken into account. The Linux kernel part of the software will probably require lots of changes when ported to other operating systems. Otherwise the system will be programmed using standard ANSI C and thus porting it shouldn't make large problems. This is a fairly unimportant property.

6.4. Usability

The system will be a working prototype that can be used to demonstrate the system functionality. Tools for configuring the system will be included. Because the tools will be command line based, they are easy to use for example in scripts. The usability in the prototype is not the main issue. This is a strongly recommended important property.

6.5. Installation

Like usability, the installation mechanism isn't that important. However, the software will have some easy kind of installation. The installation of the software requires the kernel recompilation. This is probably the most complex thing in installing the prototype. Otherwise the installation procedure is easy. Just "./configure", "make" and "make install" will be sufficient. Easy installation is a strongly recommended important property.

7. References

[HIERFA]
C. Perkins, Mobile-IP Local Registration with Hierarchical Foreign Agents (work in progress)
[IPMOB2]
C. Perkins, IP Mobility Support version 2 (work in progress)
[REATUN]
S.Lantinga. README.tunnel - Documentation for the IPIP tunnel interface. Distributed with kernel source code in /usr/src/linux/drivers/net.
[REGKEY]
C. Perkins, Registration Keys for Route Optimization (work in progress)
[RFC1256]
Stephen E. Deering, ICMP Router Discovery Messages
[RFC2002]
C. Perkins, RFC2002 IP Mobility Support
[RFC2003]
C. Perkins, RFC2003 IP Encapsulation within IP
[REVTUN]
G. Montenegro, RFC2344 Reverse Tunneling for Mobile-IP
[TEP]
Pat Calhoun et al., Tunnel Establishement Protocol (work in progress)

Appendix A: Requirement vs. Functionality mapping

The purpose of this appendix is to give a checklist that each requirement has its place in the functional specification.

Functional requirements Supporting functionalities
Tunneling shall be hierarchical Multiple Foreign Agents in Visited Network
The system shall update only those elements that need to be updated On handover the Mobile Node registers with the first common Mobile Agent available in the current and previous hierarchy
The length of the tunnel shall not be explicitly restricted by the system architecture. The protocol sets no practical limits on the tunnel length
The tunnel configuration information updates shall be dynamic The Mobile Node daemon handles updates without user interaction
Further development and inter operability shall be supported A version number in all messages is provided
The functionality should be transparent to the mobile user The mobile user has to make manual static configuration once
The lowest foreign agents should use broadcasting to advertise availability Foreign Agents broadcast Agent Advertisement messages
The mobile node shall select the lowest foreign agent The Mobile Node selects Mobility Agent by sending Registration Requests
The home elements shall handle several concurrent users The implementation places no limits
Mobility management information updates shall be secure A shared secret and checksums provide security between the Mobile Node and Home Agent.
The system should support logging The Mobile Node and Mobility Agents use Linux' syslog feature
Resource allocation should be optimized Registrations can be limited to a specified lifetime
There may be multiple modes for tunneling Bi-directional and triangle tunnel modes are supported by the design
Product requirements Supporting functionality
The product maturity level shall be a working prototype N/A
The software shall have an installation mechanism See section "6.5 Installation"
The mobility management security design should be modular Security parameters are sent as extensions in the messages and can be changed.
Each piece of the software should be configurable Text files are used for configuration
There should be monitoring tools for the software Monitoring tools are defined
There should be a programming API for the software Programming API is defined
External requirements Supporting functionalities
The mobility of the mobile computer shall be transparent to an external observer IP packets to the Mobile Node are delivered in the conventional way to the Mobile Node's Home Network. The source address in IP packets are that of the Mobile Nodes home address.
The IP-protocol version shall be 4 IPv4 is used
The platform should be Linux Linux is used
Other requirements Supporting functionalities
Tunneling should be possible with minimum firewall openings Only a single port is used for control messages. Tunnels are IP over IP.
The software should not be a clear bottleneck N/A
The portability should be taken into account Defined in next phase

Appendix B: Example operations

To clarify how the mobile-IP with hierarchical foreign agents works, some concrete examples are given in this appendix.


Figure 3

All examples use the network configuration shown in Figure 3. To simplify the examples pseudo IP-addresses of the form network.node will be used.

The elements used in the examples are:

Mobile Node 1 (MN1)
Home Agent 1 (HA1)
Foreign Agent 1 (FA1)
Foreign Agent 2 (FA2)
Foreign Agent 3 (FA3)
Correspondent Node 1 (CN1)

Register in Foreign Network

This example shows the basic operation when the Mobile Node registers in the Visited Network.

  1. MN1 retains a co-located care-of address (2.10) and receives a notification that it's access point has changed. MN1 thereby sends an Agent Solicitation message.
  2. FA2 receive the message and sends an Agent Advertisement with the following data:
  3. MN1 generates a Registration Request message: The MN1 now computes an MD5 checksum over the following, and appends the checksum to the request message: The generated message is sent to FA2 (address 2.2).
  4. FA2 receives the registration request, creates an unconfirmed binding entry:
  5. FA2 appends its public key to the message and relays it on to FA1, which also creates an unconfirmed binding entry: FA1 also remembers the public key of FA2. FA1 replaces the public key in the message with its own. Since FA1 is the highest Foreign Agent it forwards the request on to the HA1 (1.1).
  6. HA1 receives the request and:
  7. FA1 receives the Registration Reply and:
  8. FA2 receives the Registration Reply and:
  9. MN1 receives the Registration Reply and:
The Mobile Node has now successfully established a tunnel between the Home Agent and itself.

Sending and receiving a packet

The following demonstrates an example where the corresponding host CN1 (address 3.13) wants to send a packet to MN1. MN1 then sends a packet back to CN1.

CN1 wants to send a packet to MN1:

  1. CN1 sends a packet in the conventional way. The packet is routed to MN1's Home Network.
  2. Since MN1 has registered with the Home Agent, HA1 grabs the packet (with proxy ARP) destioned for MN1 when it arrives on MN1's Home Network
  3. HA1 checks the mobility binding table, and finds that packets for MN1 should be tunneled to address 2.1 (FA1).
  4. FA1 receives the tunneled packet, and examines the inner packet. In the mobility binding table it finds that packets destined for MN1 should be tunneled to address 2.2 (FA2).
  5. FA2 does the same as FA1, and tunnels the packet on to the address 2.10

MN1 wants to send a packet to CN1:

  1. The packet MN1 sends has its Home Address as source address and the destination address of CN1. This packet is encapsulated within a packet with the source address of the co-located address and destination address if FA2, 2.2.
  2. FA2 forwards the packet to FA1, which in turn finds its mobility binding list that this packet should be forwarded to the Home Agent of MN1, HA1.
  3. The Home Agent checks that the sources address of the inner packet is in the mobility binding list, decapsulates the packet and sends it to CN1.

Roaming

The following example shows what happens when the Mobile Node moves to another network with a new foreign agent, and how the tunnel is regionally updated.

  1. MN1 retains a new co-located care-of address (2.12) and receives a notification that it's access point has changed. MN1 sends an Agent Solicitation message.
  2. FA3 responds with an Agent Advertisement.
  3. MN1 sends a Registration Request messages to FA3 with the following data: This messages is sent to FA3.
  4. FA3 receives the Registration messages, makes a mobility binding, and appends its public key. The messages is then relayed to FA1.
  5. FA1 receives the messages, and notices that it is has a binding for MN1. FA1 then: