Xem mẫu

7.1 Mobile IP overview Mobile IP enables a device to maintain the same IP address (its home address) wherever it attaches to the network. (Obviously, a device with an IP address plugged into the wrong subnet will normally be unreachable.) However, the mobile device also has a care-of address, which connects to the subnet where it is currently located. The care-of address is managed by a home agent, which is a device on the home subnet of the mobile device. Any packet addressed to the IP address of the mobile device is intercepted by the home agent and then forwarded to the care-of address through a tunnel. After it arrives at the end of the tunnel, the datagram is delivered to the mobile device. The mobile node generally uses its home address as the source address of all datagrams that it sends. Mobile IP can help resolve address shortage problems and reduce administrative workload, because each device that needs to attach to the network at multiple locations only requires a single IP address. The following terminology is used in a mobile IP network configuration: Home address Home network Tunnel Visited network Home agent Foreign agent The static IP address allocated to a mobile node. It does not change, no matter where the node attaches to the network. A subnet with a network prefix matching the home address of the mobile node. Datagrams intended for the home address of the mobile node will always be routed to this network. The path followed by an encapsulated datagram. A network to which the mobile node is connected (other than the node`s home network). A router on the home network of the mobile node that maintains current location information for the node and tunnels datagrams for delivery to the node when it is away from home. A router on a visited network that registers the presence of a mobile node and detunnels and forwards datagrams to the node that have been tunneled by the mobile node`s home agent. 276 TCP/IP Tutorial and Technical Overview 7.1.1 Mobile IP operation Mobility agents (home agents and foreign agents) advertise their presence in the network by means of agent advertisement messages, which are ICMP router advertisement messages with extensions (see Figure 7-3 on page 280). A mobile node can also explicitly request one of these messages with an agent solicitation message. When a mobile node connects to the network and receives one of these messages, it is able to determine whether it is on its home network or a foreign network. If the mobile node detects that it is on its home network, it will operate normally, without the use of mobility services. In addition, if it has just returned to the home network, having previously been working elsewhere, it will deregister itself with the home agent. This is done through the exchange of a registration request and registration reply. If, however, the mobile node detects, from an agent advertisement, that it has moved to a foreign network, it obtains a care-of address for the foreign network. This address can be obtained from the foreign agent (a foreign agent care-of address, which is the address of the foreign agent itself), or it can be obtained by some other mechanism, such as DHCP (in which case, it is known as a co-located care-of address). The use of co-located care-of addresses has the advantage that the mobile node does not need a foreign agent to be present at every network that it visits, but it does require that a pool of IP addresses be made available for visiting mobile nodes by the DHCP server. Note that communication between a mobile node and a foreign agent takes place at the link layer level. It cannot use the normal IP routing mechanism, because the mobile node`s IP address does not belong to the subnet in which it is currently located. After the mobile node has received its care-of address, it needs to register itself with its home agent. This can be done through the foreign agent, which forwards the request to the home agent, or directly with the home agent (see Figure 7-4 on page 281). After the home agent has registered the care-of address for the mobile node in its new position, any datagram intended for the home address of the mobile node is intercepted by the home agent and tunneled to the care-of address. The tunnel endpoint can be at a foreign agent (if the mobile node has a foreign agent care-of address), or at the mobile node itself (if it has a co-located care-of address). Here the original datagram is removed from the tunnel and delivered to the mobile node. The mobile node will generally respond to the received datagram using standard IP routing mechanisms. Chapter 7. Mobile IP 277 Figure 7-1 shows a mobile IP operation. Mobile Node B 9.180.128.5 (care-of 9.170.50.2) Host A 9.160.5 (4) 9.170.50 (3) Foreign Agent 9.170.50.2 (1) Host A sends datagram to B (2) (9.180.128.5) routed to the 9.180.128 (1) network. (2) Home agent intercepts datragram and tunnels to B`s care-of address. (3) Foreign agent detunnels datagram 9.180.128 Home Agent and forwards to mobile node. (4) Mobile Node B replies to A using standard routing. Figure 7-1 Mobile IP operation 7.1.2 Mobility agent advertisement extensions The mobility agent advertisement consists of an ICMP router Advertisement with one or more of the following extensions, as shown in Figure 7-2. Figure 7-2 Mobility agent advertisement extension 278 TCP/IP Tutorial and Technical Overview Where: Type Length Sequence number 16. (6+[4*N]), where N is the number of care-of addresses advertised. The number of advertisements sent by this agent since it was initialized. Registration lifetime The longest lifetime, in seconds, that this agent will accept a Registration Request. A value of 0xffff indicates infinity. This field bears no relationship with the lifetime field in the router advertisement itself. R B H F M G V Reserved Registration required. Mobile node must register with this agent rather than use a co-located care-of address. Busy. Foreign agent cannot accept additional registrations. Home agent. This agent offers service as a home agent on this link. Foreign agent. This agent offers service as a foreign agent on this link. Minimal encapsulation. This agent receives tunneled datagrams that use minimal encapsulation. GRE encapsulation. This agent receives tunneled datagrams that use GRE encapsulation. Van Jacobson Header Compression. This agent supports use of Van Jacobson Header Compression over the link with any registered mobile node. This area is ignored. Care-of Address(es) The care-of address or addresses advertised by this agent. At least one must be included if the F bit is set. Note that a foreign agent might be too busy to service additional mobile nodes at certain times. However, it must continue to send agent advertisements (with the B bit set) so that mobile nodes that are already registered will know that the agent has not failed or that they are still in range of the foreign agent. Chapter 7. Mobile IP 279 The prefix lengths extension can follow the mobility agent advertisement extension. It is used to indicate the number of bits that need to be applied to each router address (in the ICMP router advertisement portion of the message) when network prefixes are being used for move detection. See Figure 7-3 for more details. Figure 7-3 Prefix-lengths extensions Where: Type Length Prefix length(s) 19. The number of router address entries in the router advertisement portion of the agent advertisement. The number of leading bits that make up the network prefix for each of the router addresses in the router advertisement portion of the agent advertisement. Each prefix length is a separate byte, in the order that the router addresses are listed. 7.2 Mobile IP registration process RFC 3344 defines two different procedures for mobile IP registration: The mobile node can register through a foreign agent, which relays the registration to the mobile node`s home agent, or it can register directly with its home agent. The following rules are used to determine which of these registration processes is used: Ê If the mobile node has obtained its care-of address from a foreign agent, it must register through that foreign agent. Ê If the mobile node is using a co-located care-of address, but has received an agent advertisement from a foreign agent on this subnet (which has the R bit (registration required) set in that advertisement), it registers through the agent. This mechanism allows for accounting to take place on foreign subnets, even if DHCP and co-located care-of address is the preferred method of address allocation. 280 TCP/IP Tutorial and Technical Overview ... - tailieumienphi.vn
nguon tai.lieu . vn