Introduction Mobile IP

31.10.1999

Wenbo Liu (93222K )

Fujian Yang (93878W)

Department of Electrical and Comunication

Department of Computer Science

Helsinki University of Technonlogy

wenboliu@cc.hut.fi

fyang@cc.hut.fi


Abstract:


         This paper describes the writers understandings of Mobile IP. Contents are constructed in sequence. In each chapter, overviews of each topic are given first to let reader know what the writer knows about the topic. Then a specific example is explained to show actual procedures and concrete datagrams formats. Subsequently, some questions may be listed and; reasonable answers to these questions may be discussed.

Contents

Introduction
1.Mobile IP Overview
   1.1 Conventionary IP and Routing
         1.1.1. IP Address
         1.1.2. Routing
    1.2Concepts and Process of Mobile IP
         1.2.1. Concepts of Mobile IP
         1.2.2. Main Processes of Mobile IP
   1.3. A Simple Example Based on IETF Mobile IP Model
   1.4. Summary
2.Advertisement
    2.1. Advertisement Overview
    2.2. An Example
         2.2.1. Home Agent Advertisement.
         2.2.2. Foreign Agent Advertisement
         2.2.3. Agent Solicitation
   2.3. Mobility Agent Operation
3. Registration
   3.1. Registration Overview
   3.2. Registration Procedures
         3.2.1. An Registration Example
         3.2.2. An Deregistration Example
  3.3. Summary
4. Delivery of Datagram.
    4.1 Overview of Delivering Datagram
    4.2 Encapsulation
          4.2.1IP-in-IP Encapsulation
          4.2.2Minimal Encapsulation
    4.3 Broadcast Datagram Routing
          4.3.1 Colocated Care-of Address
          4.3.2 Foreign Agent Care-of Address
   4.4 Summary
5 Route Optimization
   5.1 Overview of Route Optimization
          5.1.1 Binding Cache
          5.1.2 Foreign Agent Smooth Handoff
          5.1.3 Registration Key
   5.2 Messages in Route Optimization
          5.2.1 Route Optimization Messages
          5.2.2 Extension for Smooth Handoff
          5.2.3 Extensions for a Registration Key
          5.2.4 Special Tunnel
6.Other Topics
    6.1 Miscellaneous Topics
    6.2 IP Version 6.
          6.2.1 Overview of Mobility Support in IP version 6
    6.3 DHCP
          6.3.1 General information about DHCP
7.References
8.Further Information

Introduction

         Whether Mobile IP is a prospective technology or not depends on whether it can be clarified to be valuable to our societies or not. And it  also depends on how much people need it. With the development of communications technologies and the expansion of computer networks, more and more people, when they are working on computers outdoors, wish that they can access necessary network resources as they do in their offices. With the widespread deployment of the mobile networking technologies, it is quite possible that people can make use of globally interconnected computing resources when they move, just when they sit at a high-performance workstation in their offices.
        General information about Mobile IP is presented in the first chapter. Home agent  cooperates with foreign agent in delivering datagrams based on the fundamental Mobile IPprotocol. In chapter two, agent advertisement is discussed. Specific procedures and message formats are presented too. By way of registration request and reply, home agent, foreign agent and mobile node will trust each other. Specific procedures and message formats are present in chapter three. Following is delivery of  datagrams in the fourth chapter. Route optimization is discussed in chapter five. The rest topics of the book are in chapter six.
        Contents about security are not mentioned much in this paper because security is a too big problem. In order to explain it clearly, there would be more pages and this paper would be a boring paper. So security problems are discussed little.

                                                                                               1. Mobile IP Overview

         Before the Mobile IP technology is formally discussed, it sounds reasonable first  to explain the conventional IP and routing. Following are concepts and processes that will be met in the Mobile IP. A simple procedure depending on IETF mobile model is subsequently explained.

1.1 Conventionary IP and Routing

1.1.1 IP Address
        Each computer that can access the Internet must have an address to identify itself and this address is the IP address used to locate where the computer is. That is similar to mail service. If people want to mail to their friends, they must write the right address, that is, the receiver’s address on the envelope. If they hope their friends will write back, they have to let their friends know the sender’s address. TCP/IP networks use 32-bit address to identify the host and the network to which a computer is attached. IP address format is shown in Figure 1.1, and the format is:[4]

                                                            IP address = Network prefix + Host address

                                                                           
 

        Note that an IP address is not used to identify a specific computer to some extent, but an access between computers and networks. Some routers and hosts, that is, multihomed hosts have several accesses to networks, which means that every physical access of multihomed hosts will have a characteristic IP address. Therefore, if a physical computer moves from one subnetwork to another, the IP address of the computer should be changed in the nventional network to receive datagrams destined to it. The other thing that should be pointed out is the number of computers that one network can hold. In a Class A network, a 24-bit host address can identify 2^24 hosts and a 7-bit network address can identify 2^7 subnets. It can also be calculated in Class B and Class C networks. However, there are less than 256 hosts in one Class C network because two host addresses are reserved. Finally, a Class D IP address is used in multi-address communications, a type of multicast communications.[6]

1.1.2 Routing

         Figure1.2 shows the names, addresses and identifiers that are used in the Internet layers by a source host and a destination host.

                                                               

         At the source point, user names are created by application programs such as Java and C program. And both user names and data are transmitted to the application-layer of the Internet. A port number identifies a specific Internet application (that is, FTP or  e-mail). Some port numbers are reserved by conventional applications. Then data is transmitted to the transmission-layer entity. There are two characteristic transmission protocols: TCP(Transmission Control Protocol) and UDP (User Datagram Protocol). Protocol identifiers are used to identify the transmission entity. After transmission  entity, data is sent down to the network-layer, where the IP address is implemented and processed. Subsequently that data is sent to the LLC (Logic Link Control ayer), which works on the DSAP (Destination Service Access Point) and the SSAP (Source Service Access Point). The last address used is the IEEE 48-bit MAC (Media Access Control) address. The destination MAC address and source MAC address are produced in the MAC after receiving data from the LLC layer. In the destination point, the destination MAC address is used to determine whether this host is the destination of datagrams or not. If approved, the MAC removes the MAC segment and sends the left fields to the LLC layer where DSAP is used to determine the relative protocol. Routers and gateways use IP addresses to determine the route that datagrams should choose in the network. If datagrams arrive at the destination host’s network-layer, both the IP address and the port number identify the unique connection between two hosts, which is called a socket. Finally,  after the process of the corresponding protocols, data will be delivered to the application-layer where the port number is applied to define which application program should process the data. The above course is reversible, which means the right part of Figure 1.2 is a source host and the right is a destination host. Theprocedure is similar.[3]

1.2 Concepts and Process of Mobile IP

1.2.1Concepts of Mobile IP
       As a new and developing technology, Mobile IP has some different terminologies compared with conventional IP.

  Mobile node:  As shown in the book, a mobile node is a host or a router that can change its point of attachment from one network or subnetwork to a nother. In conventional TCP/IP network, a user has to change a computer’s IP address manually when he changes the computer’s access to the Internet, specifically from one subnetwork to another. The network prefix in an IP address is used to determine to which network a mobile node is connected, as said in the book[4] section1.1.1. At the same time, a host address is used to find which host the mobile node is. The existing Internet Protocol does not meet all the needs.
  Home agent: A home agent is a router on a mobile node’s home network. In TCP/IP network, it is the router that transmits datagrams. A home agent should keep the mobile node’s current location so as to deliver the right datagrams to the right. node or other intermediate router by some means. If the mobile node is on its home network, there is no slight difference compared with ordinary TCP/IP network transmission. If not, the home agent should first receive datagrams destined to the mobile node and modify the relevant fields in datagram frame for delivery to the mobile node.
  Foreign agent: A foreign agent is a router on a mobile node’s visited network. It should offer routing services to the legal mobile node. It can be imagined that a foreign agent should be capable to receive the datagrams transmitted by the home agent and send them to the mobile node. In this regard, the foreign agent should determine which datagram is required to be sent to the mobile node in the vicinity of it and which mobile node is legal.  The design of Mobile IP should prevent a user from changing a computer’s configurations, that is, the IP address and other settings manually. It is quite possible that the operation system will ask the user to restart the host to realize the legality of the changed configurations. In other words, the connection between the source and destination may be interrupted and restarted. A most important matter that should be  taken into account is that the Mobile IP has to be compatible with the conventional IP. This makes it possible for customers to choose this kind of technology in reality instead of reconstructing a whole new network and discarding the existing one.

1.2.2Main Processes of Mobile IP

Mobile IP is, in essence, a way of doing three relatively separate functions:

1. Agent discovery: Its aim is for a mobile node to determine whether it is on the home network or on the foreign network. Home agents and foreign agents may periodically advertise
    their availability on each link for which they will provide service. The period should not be too short. At the same time, a newly arrived mobile node may also send a solicitation
    message on the link to learn if any prospective  agents are present instead of listening to the riodical advertisement. Clearly, the home agent or the foreign agent should send their reply
    to the mobile node after they receive the mobile node’s solicitation message.
2. Registration: When the mobile node is away from home, it is required to register a care-of address with its home agent so as to let the home agent know the current location of the
    mobile node and deliver the datagrams to it. There are two ways for a mobile node to register depending on its method of ttachment. One is that the mobile node will register directly
    with its home agent. Another is that it will register through a foreign agent, which forwards the registration to the home agent. After valid registration, the home agent (maybe including
    the foreign agent) will provide routing service for the mobile node.
3. Tunneling: In order for datagrams to be delivered to the mobile node when it is away from home, the home agent has to tunnel the datagrams to the care-of address. After a mobile
    node’s valid registration, the home agent can choose datagrams destined to the mobile node from other datagrams. Before transmitting, the home agent should add, delete or modify
    the corresponding fields in the datagrams. How can Mobile IP avoid restarting a mobile host? When a node is away from home, Mobile IP uses protocol tunneling to hide a mobile
    node’s home address from intermediate routers between its home network and its current location. The mobile node should apply for a care-of address from the foreign agent when it
    is on a foreign network. What should be pointed out is that the care-of address must be an address to which datagrams can be delivered via conventional IP routing. There are two
   different kinds of care-of address: foreign agent care-of address and colocated care-of address.[4,6]

A rough outline of the operations of the Mobile IP protocol follows:

1. Mobility agents (that is, those agents that can provide mobility service, including foreign agents and home agents) advertise their existence via agent advertisement. The mobile node
    also can send an agent solicitation message to get an agent advertisement message from any local mobility agents.
2. Then the mobile node receives an agent advertisement message to determine where it is connected, that is, a home network or a foreign network.
3. If on a home network, there are two ways. If the node does not register with the home agent yet, it works in the same way as that without mobility services. If it has registered with the home agent, that means the mobile node returns to its home network and it should dragster with its home agent to delete all the bindings.
4. If the mobile node finds that it is on a foreign network, it has to obtain a care-of address that is a conventional IP address on the foreign network.
5. Depending on the kind of care-of address, the mobile node chooses different way to inform the home agent of its current location. The mobile node is required to register its new care-of address with its home agent through the exchange of a registration request and a registration reply message. If it is a foreign agent care-of address, it is possible to do by way of the foreign agent. Otherwise, by way of conventional IP address routing.
6. The home agent knows the mobile node’s current location and saves the binding for the mobile node. Datagrams sent to the mobile node’s home address are intercepted and tunneled
    to the mobile node’s care-of address and received at the tunnel endpoint (either at the foreign agent or at the mobile node itself depending on the kind of care-of address). At last,
    datagrams are delivered to the mobile node.
7. In the reverse direction, datagrams sent by the mobile node are delivered to their destination using the standard IP address routing mechanisms. The source IP address is required to be the mobile node’s home address, not the care-of address.[4]

1.3A Simple Example Based on IETF Mobile IP Model

                                  Figure1.3 shows a simple example based on the IETF Mobile IP model.

                                           

         Node A is a movable laptop computer whose home network prefix is 202.118.224. It means it belongs to the Class C network N1. N2 is another Class C network with the network prefix 202.118.229, which is the network that the mobile node is visiting. Suppose the router R1 is a home agent and the router R2 is a foreign agent. Another node B is communicating with node A.
         Firstly, R1 and R2 advertise their existences on each link. When node A is on its home network, there is no difference from the standard IP routing. If node A moves to the network N2, it will receive the R2’s agent advertisement message periodically. It can also send an agent solicitation message to R2 to inform its arrival. After that, R2 is required to reply to node A by sending an agent advertisement message to offer a care-of address. The care-of address is either the foreign agent’s IP address as a  foreign agent care-of address, or a valid subnetwork N2 IP address as a colocated care-of address. Let’s suppose a foreign agent care-of address is available.
        Secondly, the mobile node A is required to register with its home agent R1 to report its current location. When the home agent R1 receives the node A’s registration request message, it is required to send a registration reply message to the care-of address. Let’s suppose that the home agent agrees to offer mobility service for node A.The registration reply message will be delivered to the foreign agent R2. Consequently, R2 will inform node A that it has registered with the home agent successfully.
        Thirdly, the datagrams sent to node A by node B arrives on the home network N1 via standard IP routing. The home agent tunnels the datagrams and sends them to the care-of address, that is, the foreign agent R2.
        Fourthly, the datagrams are detunneled by the foreign agent R2 and sent to the mobile node A. The forward transmission is over.
        In the reverse direction, that is, from node A to node B, standard IP routing delivers each datagram to its destination. The datagrams’ source IP address should be the mobile node’s home address.

1.4 Summary
        In reality, if a colocated care-of address is easily available on the foreign network that a mobile node will visit or is visiting, it will be better than a foreign agent care-of address. Because the mobile node acts as a legal node of the foreign network, little work is left to the foreign agent. At the same time, management of colocated care-of address is important.
        On the other hand, if there are few available colocated addresses, a foreign agent care-of address is preferable. Because there may be some or many prospective mobile users who will visit the foreign network at the same time, a heavy burden will be  placed on the foreign agent. Which kind care-of address a mobile node should use depends on the specific conditions and environment.

                                                                                      2. Advertisement

         In this chapter, two main parts are explained. What can advertisement do? How does it work? Subsequently message formats are explained. These messages are communicated by way of ICMP. Specific procedure is explained based on the example shown in chapter one.

2.1 Advertisement Overview
       In fact, an agent advertisement is an extension of ICMP router advertisement. Following is from RFC 792. “The Internet Protocol (IP) is used for host-to-host datagram service in a system of interconnected networks called the Catenet...Occasionally a gateway or destination host will communicate with a source host, for  example, to report an error in datagram processing. For such purposes this protocol,  the Internet Control Message Protocol (ICMP), is used. ICMP, uses the basic support  of IP as if it were a higher level protocol, however, ICMP is actually an integral part of IP, and must be implemented by every IP module.”  “The Internet Protocol is not designed to be absolutely reliable. The purpose of  these control messages is to provide feedback about problems in the communication environment, not to make IP reliable. Some datagrams may still be undelivered  without any report of their loss.”
Agent advertisement has two main aims. One is that a mobile node can determine whether it is currently connected to its home network or to a foreign network. Another is that the mobile node is able to get a care-of address offered by a foreign agent.

2.2 An Example
Figure 2.1 illustrates a simple example of agent advertisement. Some data used are listed subsequently.

Home agent address 202.118.229.20
Mobile node’s home address 202.118.229.37
Foreign agent address 202.118.224.2
Colocated care-of address 202.118.224.101

                                                                      

2.2.1 Home Agent Advertisement
        This message is broadcasted or multicasted on the home network N1.
IP fields:
        TTL is set to 1 in order that the home agent will not process the agent advertisement message again. Source address is set to the IP address of the home agent, that is, 202.118.229.20 Destination address is set to the limited-broadcast address, that is, 255.255.255.255.
ICMP fields:
        Type is set to 9. Code is set to 16, which means that the home agent only serves for mobile nodes. Lifetime is set to 36000 (the actual value depending on the specific environments). Router address is set to the IP address of the home agent. And it may be different, which means the default router may be not the home agent. Num Address is set to 0.
Mobility agent advertisement extension fields:
        Type is set to 16. Length is set to 6 because of the absence of care-of address. Sequence number is set to 24000. Next sequence number should be one greater that this one, that is, 24001 if the home agent will not be initiated. Registration lifetime is set to 60000 (the actual value depending on the specific environments). R bit and B bit are set to 0 and H bit is set. None care-of address is presented. A mobile node compares the IP source address of the advertisement message with the configuration stored in the mobile node and determines to which network it is connected. The judgement is not based on the H bit.
        In this book[4], the source address field is absent in the IP fields on page 43-44 and this address cannot be omitted. Explained in page 46, the care-of address in a mobility agent advertisement extension is the advertised foreign agent care-of address provided by this foreign agent. There are foreign agent care-of address and colocated care-of address. Here, the care-of address can be either. So “foreign agent” should be omitted in order to prevent from wrong understanding.

2.2.2 Foreign Agent Advertisement
     This message is broadcasted and multicasted on the foreign network N2.
IP fields:
     TTL is set to 1. Source address is set to 202.118.224.2. Destination address is set to 255.255.255.255
ICMP fields:
     Type is set to 9. Code is set to 16. Lifetime is set to 32000. Router address is set to the IP address of the foreign agent, that is, 202.118.224.2. Num address is set to 1.
Mobility agent advertisement extension fields:
     Type is set to 16. Length is set to 10, 6 plus 4. R bit is set so as to require the mobile node to register with the foreign agent. F bit is set to 1. Care-of address is set to 202.118.224.101.

2.2.3 Agent Solicitation
     When a mobile node moves to an unknown network, it can first send an agent  solicitation message, instead of listening to the agent advertisement message. Following are the values according to the example.
IP fields:
     TTL is set to 1. Source address is set to 202.118.229.37. Destination address is set to all-routers multicast address, that is, 224.0.0.2.
ICMP fields:
     Type is set to 10. Code is set to 0.  Checksum is set to 10.

2.3 Mobility Agent Operation
     Each agent, which provides mobility service, periodically multicasts an agent advertisement from each of its multicast interfaces, announcing the IP address(es) of  that interface. Mobile nodes discover the addresses of their neighboring agents simply by listening for advertisements. When a host attached to a multicast link starts up, it may multicast an agent solicitation to ask for immediate advertisements, rather than waiting for the next periodic one to arrive. If (and only if) no advertisements are forthcoming, the host may retransmit the solicitation a small number of times. But it must desist from sending any more solicitations.[1]

                                                                                                          3. Registration

 Registration is the method by which mobile nodes
. Request forwarding services when visiting a foreign network
. Inform their home agent of their current care-of address
. Renew a binding that is due to expire
. Deregister when they return home

3.1Registration Overview
      A mobile node has two ways to register with its home agent. One is that a certain foreign agent relays its registration message to its home agent. Another is that the mobile node sends registration messages directly to the home agent.If a mobile node gets a foreign agent care-of address, it should follow these steps:
. The mobile node sends a registration request to the prospective foreign agent to begin the registration process. And it will get a care-of address from this foreign agent.
. The foreign agent processes the registration request and relays the request message to the home agent, whose address is provided in the message by the mobile node.
. The home agent sends a registration reply to the foreign agent to grant or reject the request. Reasons are interpreted according to the relative fields in the reply message.
. The foreign agent processes the reply and relays it to the mobile node to inform it of the disposition of its request. If a mobile node gets a colocated care-of address, it should follow
  two steps:
. The mobile node sends a registration request to the home agent.
. The home agent sends a registration reply to the mobile node that grants or denies the request.
      If a mobile node receives an agent advertisement from a foreign agent with the R bit set, the mobile node should register by way of the foreign agent, in spite of its colocated care-of address. Mobile IP registration messages use UDP (User Datagram Protocol). Mobile IP defines its own retransmissions to handle the cases of dropped packets.

3.2Registration Procedures
      There are two conditions under which a mobile node should register with a foreign agent. First is that a mobile node should initiate a registration whenever it detects a change in its network connectivity. Another is that a mobile node should reregister with its foreign agent, such as when its current registration lifetime is near expiration or when the mobile node detects that foreign agent has rebooted.
      The general overall data structure of the registration request message is shown in Figure3.1.[4]

                                                       
3.2.1 An Registration Example
         An example is illustrated in Figure 3.2. Some data used are listed.[4]

                                                        

Mobile node’s home address 202.118.229.37
Mobile node’s home agent 202.118.229.20
Foreign agent IP address 202.118.224.2
Foreign agent care-of address 202.118.224.101
Mobile node’s source port 1111
Foreign agent source port 2222

(1) Registration Request
          Because the R bit in the mobility agent advertisement extension is set in chapter 2, this message is required to be sent to the foreign agent by the mobile node, illustrated as arrow 1 in Figure 3.2.
IP fields:
Source address is set to 202.118.29.37. Destination address is set to 202.118.224.2, copied from the foreign agent  advertisement message.
UDP fields:
Source port is set to 1111. Destination port is set to 434.
Mobile IP fields:
Type is set to 1, which means this is a registration request message. D bit is set because the mobile node is using a colocated care-of address.
Home address is set to 202.118.229.37. Home agent address is set to 202.118.229.20. Care-of address is set to 202.118.224.101.

(2) Foreign agent registration reply
This message is illustrated as arrow 2 in Figure 3.2.
IP fields:
TTL is set to 1. Source address is copied from the destination address of the registration request, that is, 202.118.224.2.
Destination address is copied from the source address of the registration request, that is, 202.118.229.37.
UDP fields:
Source port is set to 434. Destination port is set to 1111.
Mobile IP fields:
Type is set to 3, which means this message is a registration reply message. Code is set to 0, which means the registration is accepted.

(3) Registration relay
This message is illustrated as arrow 3 in Figure 3.2.
IP fields:
TTL is set to 31000. Source address is set to 202.118.224.2. Destination address is set to 202.118.229.20, copied from the registration request message.
UDP fields:
Source port is set to 2222. Destination port is set to 434. Other fields are copied from the registration request message.

(4) Home agent registration reply
This message is illustrated as arrow 4 in Figure 3.2.
IP fields:
TTL is set to 31000. Source address is set to 202.118.229.20.Destination address is set to 202.118.224.2.
UDP fields:
Source port is set to 434. Destination port is set to 2222.
Mobile IP fields:
Type is set to 3. Code is set to 1, which means the registration is accepted without simultaneous  mobility binding supported.

(5) Home agent registration reply relay
This message is illustrated as arrow 5 in Figure 3.2.
IP fields:
TTL is set to 1. Source address is set to 202.118.224.2. Destination address is set to 202.118.229.37.
UDP fields:
Source port is set to 434. Destination port is set to 1111.
Mobile IP fields:
Type is set to 3. Code is copied from the home agent registration reply, that is 1.Others are copied from the home agent registration reply too.[1,5]

3.2.2 An Deregistration Example
                               An example is illustrated in Figure 3.3.

                                                             

           When a mobile node A returns to its home network and wishes to deregister all  care-of addresses with its home agent, it is required to send a deregistration request message to the home agent.

(1) Deregistration request:
IP fields:
TTL is set to 1. Source address is set to 202.118.229.37. Destination address is set to 202.118.229.20.
UDP fields:
Source port is set to 1111. Destination port is set to 434.
Mobile IP fields:
Type is set to 1. Lifetime is set to 0. Care-of address is set to the IP address of the mobile IP, that is, 202.118.229.37. Other fields are the same as the registration relay message.

(2) Deregistration reply:
IP fields:
TTL is set to 1. Source address is set to 202.118.229.20. Destination address is set to 202.118.229.37.
UDP fields:
Source port is set to 434. Destination port is set to 1111.
Mobile IP fields:
Type is set to 3. Code is set to 0, meaning a successful deregistration. Lifetime is set to 0. Care-of address is copied from the registration request field.

3.3 Summary
        A mobile node uses the registration procedures to inform its home agent about its new or renewed care-of address. When a foreign agent is involved at all, it plays a mostly passive role in the registration processes. A home agent uses the registration information provided by the mobile node to establish tunnels to the mobile node.[5]

                                                                               4. Delivery of Datagram

        Since several methods of encapsulation (tunneling) are available for use, the different procedures are described.

4.1 Overview of Delivering Datagram
       Generally, there should be four individual nodes, that is, a source node, an encapsulator, a decapsulator and a destination node. The general procedure is  illustrated in Figure 4.1.

                                                                               

        The thick black line represents a tunnel. The encapsulator node is the entry point of the tunnel. And the decapsulator is the end point of the tunnel. After receiving datagrams destined to node D from node A, the encapsulator should use one of three encapsulation methods to tunnel the datagrams. Then node B sends the encapsulated datagrams to node C. The encapsulator should decapsulate the datagrams and send them to the destination, node D.

4.2 Encapsulation
       A tunnel is similar to a pipe. Datagrams are delivered in a tunnel as water runs through a pipe. An encapsulator is the entry point and a decapsulator is the end point. Because the decapsulator is either the foreign agent or the mobile node itself, the destination address in the outer IP header is either the foreign agent IP address or the mobile node colocated care-of address.

4.2.1IP-in-IP Encapsulation
       Mobile IP requires each home agent and foreign agent to support tunneling datagrams using IP-in-IP encapsulation. The original IP datagrams received by an encapsulator (that is, a home agent) should be encapsulated as the payload in a new IP datagrams which should be sent to a decapsulator (that is, a foreign agent or a mobile node itself). The source address in
the outer IP header is the IP address of the encapsulator. The destination address in the outer IP header is the IP address of the decapsulator. The inner IP header source address and destination address identify the original sender and final recipient, that is, the mobile node.
      There are two things that should be noted. One is that an encapsulator never encapsulates a datagram with a TTL (Time To Live) of zero. If the resulting TTL in the inner IP header is zero, the datagram is discarded. Another is that if the inner datagram has a TTL of zero after decapsulation, the datagram is discarded too. During the delivery of datagram after decapsulation, TTL is decrement according to normal IP routing. Based on the data shown in the concrete fields are as follow:
Outer IP fields:
TTL is set to 32000 (according to specific environments). Source address is set to 202.118.229.20. Destination address is set to 202.118.224.101.
Inner IP fields:
Source address is copied from the original IP datagram. Destination address is set to 202.118.229.37.

4.2.2Minimal Encapsulation
Because the unnecessary copy of several fields occurs in the IP-in-IP encapsulation, minimal encapsulation came into being to save some additional space.But the minimal forwarding header can not be used for datagrams that are fragmented.
Following are important compared with the IP-in-IP encapsulation.
1. The protocol field in the outer IP header is number 55 instead of number 4.
2. The source address in the outer IP header is the IP address of encapsulator. The destination address in the outer IP header is the IP address of the decapsulator, that is, the end point
    of the tunnel. The destination address in the minimal encapsulation header is the original destination address, that is, the IP address of the mobile node copied from the destination
    address field in the original IP header. The source address in the minimal encapsulation header is the IP address of original sender if it is available.

4.3 Broadcast Datagram Routing
      When a home agent receives a broadcast datagram, it only forwards the datagram to a mobile node that has successfully requested forwarding of broadcast datagrams.

4.3.1Colocated Care-of Address
      If a mobile node has informed its colocated care-of address to the home agent, the D bit must be set in the mobile node’s registration request message. The home agent tunnels broadcast IP datagrams to the mobile node’s care-of address. Then the mobile node decapsulates the received datagrams in the same way as any other datagrams tunneled directly to it. The home agent will send the broadcast datagrams with only a single encapsulating header as illustrated in Figure 4.2.[4]

                                                                              

IP fields:
      Source address is copied from the original broadcast datagrams. Destination address is set to mobile node’s care-of address, that is, 202.118.224.101.

4.3.2 Foreign Agent Care-of Address
      If a mobile node has informed its foreign agent care-of address to its home agent, the home agent tunnels a broadcast IP datagram to the foreign agent. The foreign agent decapsulates the received datagram in the same way as any other datagrams tunneled directly to it before forwarding the datagram to the mobile node. The home agent will send the broadcast datagram encapsulated in a unicast datagram to the foreign agent. After decapsulated by the foreign agent, the inner datagram will thus be a unicast IP datagram. The actual format is illustrated in Figure 4.3.
                                                                     

Outer IP fields:
Source address is set to the IP address of the home agent, that is, 202.118.229.20. Destination address is set to the foreign agent care-of address.
Inner IP fields:
Source address is copied from the original broadcast datagram. Destination address is set to the IP address of the mobile node, that is, 202.118.229.37.[4]

4.4 Summary
      Mobile IP implements tunnel technology to realize the delivery of datagrams.Intermediate routers do not detunnel the datagram. They just use the destination IP address in the outer IP header to choose a route for the datagram. After arriving at the decapsulator, the datagrms are decapsulated and sent to the destination according to the destination IP address in the inner IP header.

                                                                                  5 Route Optimization

           As described in the former chapters, a mobile node can go on communicating with a correspondent node while moving. Datagrams destined to the mobile node will first be sent to its home network and then to the mobile node through tunnels. When the correspondent node knows enough information about the mobile node, it has to forward all datagrams first to the home agent instead of sending directly to the mobile node. Under the circumstances, the route is not obviously optimal. Suggest it happens to a backbone network. The additional occupation of bandwidth will lead to the frequent network congestion. Following is an overview of the protocols and  operations of route optimization, which can save unnecessary expense.

5.1Overview of Route Optimization
       The key to the problem is how to enable the correspondent node to forward the datagrams directly to the mobile node by itself and for itself. Route optimization involves in four main parts.

5.1.1Binding Cache
       There is something called cache in any node where the node stores the care-of address of the interested mobile node. Before sending datagrams, a source node, that is, the original sender will find first whether or not it has a binding cache entry for the destination node. If yes, the sender will encapsulate the datagrams and tunnel them directly to the care-of address shown in the cache instead. If no, the sender has to send  them first to the home agent according to the classic IP routing. When a home agent receives such datagrams, it may think that the original sender has no binding cache entry or an out-of-date binding cache entry for the mobile node. So it seems reasonable that the home agent forwards a binding update message, which includes the current care-of address of the mobile node, to the sender. After receiving such  message, the sender can update the cache and tunnel the datagrams directly to the new care-of address. The sender does not need to send an acknowledgement message to the home agent. If the home agent receives the datagrams from the original sender again, it will be aware that the previous update must fail and have to send the update message again.  Similar procedures may be carried out at any node (for example, a foreign agent) besides at the home agent. A binding cache entry for a mobile node will expire after some time.[2,3]

5.1.2Foreign Agent Smooth Handoff
      Because of the mobility of the mobile node, it may happen that some data packets  are being delivered to the node's previous foreign agent while the node moves to a new sub network now. According to the former explanation about Mobile IP, these packets must be lost at last. Route optimization offers a method to solve such problem. When a mobile node moves and registers with a new foreign agent, the node may ask the current agent to inform its previous agent of its new address. The new foreign  agent sends a binding update message to the previous one. Then the previous agent can learn enough current address information about the mobile node. Any tunneled datagrams arrived at the previous agent will be retunneled to the mobile node's new care-of address. This address is obtained from the update message. The binding cache entry in the previous agent will expire after some time except receiving a new binding update message.[2]
     To ensure the delivery of the packets, the previous foreign agent is required to forward an acknowledgement message to the current agent. To ensure the hand-off  reliable, a registration key is used by both of the mobile node and the foreign agent.

5.1.3Registration Key
      To decrease the number of dropped packets, the mobile node needs to inform its previous agent of its new address. When a foreign agent receives such a binding update message, it needs to know whether the message is reliable or not. The solution to this problem is the use of registration key. Shown in the book page 135, there are five methods of establishing keys.

5.2 Messages in Route Optimization

5.2.1Route Optimization Messages
     Four kinds of message are used for the management of binding cache entries. They are binding warning message, binding request message, binding update message and binding acknowledge message. At the beginning of each message, an one-byte field is used to identify the type of the message.
     When a node decapsulates the datagrams and finds that the destination node is not in its binding cache, the node has to send a binding warning message with the type 16 to the home agent. In this message, the mobile node home address and the target node address are included. Then the home agent will send a binding update message with  the type 18 to the node. After that, the node will return a binding acknowledge message with the type 19 to the home agent if the home agent asks it to do so by setting the A bit in the binding update message. A node can send a binding request message with the type 17 to the home agent, asking for the mobile node's current optimization authentication extension is required to follow every binding update message.

5.2.2 Extension for Smooth Handoff
     If a mobile node hope to enable a smooth handoff from the previous foreign agent to the new one, it has to add a previous foreign agent notification extension to the  registration request message sent to the current foreign agent. A binding cache entry may be created for the mobile node. To indicate that a foreign agent supports smooth handoff, a new flag bit, the S bit is added in the Mobile IP mobility agent advertisement extension. The specific format is shown in the book.[4]

5.2.3Extensions for a Registration Key
     Four extensions may be used by mobile nodes or foreign nodes to request the establishment of a registration key. They are foreign agent key request extension, mobile node public key extension, foreign agent public key extension and registration key request extension.
     Five extensions are used to offer a registration key to a requesting entity. All the extensions may be used in registration reply messages. A home-mobile key reply extension is sent to the mobile node by its home agent. The home agent is also required to send a copy to the mobile node's new foreign agent. A foreign agent key reply extension is sent to the mobile node's new foreign agent by the mobile node's home agent. A mobile node public key reply extension is sent to the mobile node's prospective foreign agent by the mobile node. A foreign agent public key reply extension is sent to the foreign agent by the home agent. A Diffie-Hellman key reply extension is sent to the mobile node by the foreign agent that has no public key or security association with the home agent.

5.2.4 Special Tunnel
     When a node (for example, a foreign agent) receives a tunneled datagram but it does not find a visitor list entry or a binding cache entry for the mobile node, the node  will forward the datagram to the mobile node's home agent using a special tunnel. After receiving such a datagram by the special tunnel, the home agent will decapsulate and retunnel the datagram to the current care-of address of the mobile node. Then the home agent will send a binding update message to the source of the special tunnel and to the original sender of the datagram. To avoid a possible routing loop, the datagram will be discarded if the current care-of address for the mobile node  is the same as the source of the special tunnel.[4]

                                                                                     6 Other Topics

6.1 Miscellaneous Topics

Broadcast/Multicast
         A mobile node can use broadcast preference extension to receive the assigned broadcast packets sent on its home network. The mobile node first sends one preference extension (or more) to its home agent. Then the home agent will send back a registration reply to show an acceptance or a rejection. If the home agent satisfies the request, it will tunnel broadcast packet/packets, according to the request, into the care-of address of the mobile node. When the mobile node returns to the home network, it is obvious that the home network does not need to forward the broadcast packets to the mobile node any more.So does the multicast preference extension.[4]
Movement Detection
        There are three main mechanisms for movement detection. In LCS (that is, Lazy Cell Switching), a mobile node uses the agent’s advertisement message to discover its movement. As far as the prefix matching is concerned, the mobile node compares the prefix extension, which was just received, with its care-of address. If the prefixes match each other, that means the mobile node is still in the same network as before. If they differ, that means the mobile node moved. Then the mobile node needs to register with the new agent instead of the previous one. In ECS (that is, Eager Cell Switching), the movement in reality is considered as something like Markov movement. Under the presumption of the mobile node’s movement, it may switch to a new care-of address
       The similar principle of three methods is the comparison between two advertisements. The result is the judgement whether the mobile node has moved or not. In the third method, a technique like cache is used to avoid the repeated registration.

6.2 IP Version 6
       Although the IP version 4 uses 32-bit IP address, which can identify 2 32 nodes, too many addresses are wasted or reserved because of the inconsequent allocation. At the same time, a much heavy burden of management of ever-increasing routing tables is placed on routers. Therefore, IEFT has made every effort on the development of IP version 6. As mentioned in the book, IP version 6 has such advantages, compared with IP version 4, as bigger address space, reduced administrative overhead, support  for address renumbering, improved header processing and reasonable security. Mobile nodes can carry out most or all of the services that foreign agent could offer in IP version 4. At the same time, foreign agents are not specified for the use with mobility in IP version 6.[4]

6.2.1 Overview of Mobility Support in IP version 6
      Mobile node: A mobile node uses the protocols (that is, address autoconfiguration and Neighbor Discovery) to determine the network prefix at a new point of attachment. Subsequently, it creates or obtains a globally accessible IP address suitable for the point of attachment. Then it will inform its home agent and the correspondent node about its new address.
      A mobile node has to be able to discover when it needs a new care-of address and be able to decapsulate the received datagrams. At the same time, the mobile node has
to know when to send a binding update message to its agent and its correspondent node.
      Home agent: The home agent can learn the fact that the mobile node has moved from the registration message sent by the mobile node. Then the agent uses the Neighbor Discovery to get a new MAC-layer address for the mobile node. When the agent receives the datagrams destined to the mobile node, it uses IP6-in-IP6 encapsulation to inform the datagrams to the care-of address.
      A home agent is expected to perform encapsulation and proxy neighbor advertisement. Few changes happen to the home agent.
      Correspondent node: A correspondent node has two ways to communicate with a mobile node. The first way, as happened to IP version 4, is that the correspondent node sends the datagrams with classic IP technique. The second way is that the correspondent node encapsulates the datagrams by itself after receiving the information of the care-of address of the mobile node. The second way deduces that the correspondent node should have something like cache to store the care-of address for the mobile node. When receiving a binding update message, the correspondent node will create or modify an entry in its destination cache for the mobile node.

6.2.2 Binding Message Options
        A mobile node uses a binding update option to inform its home agent and its correspondent node about its new care-of address. The option satisfies Type-Length-Value formats. The specific format can be referred in the book [4] page 210 and 211.
        A  correspondent node does not need to send a binding acknowledgement option as a reply to a binding update option sent by the mobile node. On the other hand, the home agent must always reply the receipt of binding updates. The option satisfies Type-Length-Value format too. The specific format can be referred [4].
        Sending a binding request option, a correspondent node can also ask the mobile node directly for a binding update message instead of waiting for it. Other nodes or agents are not required to use this option. The option satisfies Type-Length-Value format too. The specific definition about the field of the option can be referred in the page 215 and 216.
       Movement detection in IP version 6 and home agent discovery are discussed in the book from page 216 to page 219 .[4]

6.3 DHCP
        In general, DHCP (Dynamic Host Configuration Protocol) is used to offer a client necessary information such as IP address, DNS addresses and so on.

6.3.1 General information about DHCP
       When a DHCP client starts up, it sends a DHCP discover message to find a DHCP server. The DHCP server who received that message will return a DHCP offer message to the client using the client’s MAC address. Then the client selects the configuration data from the DHCP offer message and sends a DHCP request message back to the server, waiting for an acknowledgement message. Once the server commits the configuration, it forwards an acknowledgement message to the client to ensure the configuration. After that, the DHCP client can communicate with other nodes as usual.
       When the lease nearly expires, the client should request the server if it wants to keep the configuration for the further use. The corresponding timelines can be referred [4]. A DHCP client can learn its default router from the default router option with the DHCP option type 3. Netmask can be discovered from the subnet mask option with the DHCP option type 1. A DHCP client can get nearby timeservers from the NTP option with the DHCP option type 42. Another key configuration, the addresses of the DNS servers can be obtained from the domain name server option with the DHCP option type 6. The directory agent option with the DHCP option type 79 can supply a directory agent for a DHCP client. The drawback of such procedure is that because of the ignorance of the IP address of the mobile node, no other node can initiate a connection with the mobilenode. The mobile node has to apply for a modification to the association between its name and its IP address in order that any node can communicate freely with the mobile node. However, the frequent modification to the DNS data may raise many security problems. When such a node moves frequently from one subnet to another, it needs to change its IP address frequently too. The typical consequence is that the user has to reboot the machine and start for a new connection again. That is obviously unbearable. A solution to it is that the mobile node uses the locally acquired IP address as the care-of address when the node changes its attachment. After acquiring an IP address by way of classic DHCP, a mobile node needs to use the IP address as
its new care-of address and register its home agent with the address. After a successful  registration, the mobile node can communicate with any other node in the Internet according to the Mobile IP protocols. It implies that the node has to have the ability to encapsulate and decapsulate the datagrams by itself and for itself.[7]
 

 7. References:
[1] Chambless, Bjorn & Binkley,Jim., HARP - "Home Agent Redundancy Protocol" , 10.27.1997 [referred: 31.10.1999]
< http://www.ietf.cnri.reston.va.us/internet-drafts/draft-ietf-mobileip-mn-nai-04.txt >

[2] Choi, Chabong ., Mobile Internet Protocol, 10.8.1996 [referred:31.10.1999]
<http://mirage.snu.ac.kr/eagle/mobileip/mobileip.html >

[3] Huitema, Christian ., ROUTING IN THE INTERNET, Prentice Hall, 1995, 315 pp.

[4] Perkins, Charles E ., Mobile IP Design Principles and Practices ,1997 ISBN: 0-201-63469-4, 274 pp.

[5] Perkins, Charles E., Route Optimization in Mobile IP, 2.1999 [referred: 31.10.1999]
< http://www.ietf.org/internet-drafts/draft-ietf-mobileip-optim-08.txt >

[6] Postel, Jon ., Information Sciences Institute , University of Southern California, INTERNET PROTOCOL , 09.1981 [referred: 31.10.1999]
<http://www.cis.ohio-state.edu/htbin/rfc/rfc791.html >

[7] Warland, Jean ., Notes on DHCP and Mobile IP, 10.1996 [referred: 31.10.1999 ]
< http://www.path.berkeley.edu/~wlr/122/MIP/MIP.html>

  8. Further Information:

1, Telecommunications Information

2, Internet Requests for Comments (RFC)