Review Session 3 Mobile IP SIP H.323
Mobile IP Requirements • Transparency: Movement of Mobile host: • transparent to the applications and transport-layer protocols • Transparent to the routers, except those directly connected with the mobile host • Interoperability with IPv4 and with other mobile hosts • Handles long duration moves and not rapid motion • Scalable
Mobile IP Requirements …2 • Secure: All messages used to update another node ( a router in the home network) as to the new location of a mobile host must be authenticated in order to protect against remote redirection attacks. • Wireless devices have lower bandwidth and have to conserve the use of energy. So the number of administrative messages and their size should be kept as small as possible.
Procedure: two addresses • A mobile host has a permanent IP address in its home network. A router in its home network is used as its Home Agent (HA). HA must have a network interface on the link, indicated by the mobile host’s IP address. • When it moves to another network, it acquires a temporary address, called the Care-of-Address. • Two different processes with Care-of-address:
Registration of Care-of-address • Care-of-address operated through a router in the new network. A router in the foreign network, which does the job, is called the Foreign Agent (FA) for the mobile host. • Co-located Care-of-address: The mobile host handles all forwarding and tunneling itself. It requires additional software to do so. Moreover the mobile host on a foreign network, must be located on a link, specified by the network prefix of the Care-of-address.
Registration and gratuitous ARP • Registration: The mobile host: registers with HA by informing it of its Care-of-address, -- • through FA or • in case of co-located Care-of-address, itself. • After registering the mobile host’s Care-of-address, the HA broadcasts a gratuitous ARP message on the home network, giving its own MAC address as a proxy for the mobile host. Since broadcast messages may not reach reliably every host on the network, the gratuitous ARP message is broadcast a few times.
Deregistration • Deregistration: When the mobile host comes back to its home network, it sends • a gratuitous ARP message to give its own MAC address to all the hosts on the local network. • a deregistration message to the HA and • it simultaneously retransmits the gratuitous ARP message a few times.
Deregistration ….. 2 • After accepting the deregistration request, HA sends • a gratuitous ARP message, associating the MAC address of the mobile host with the mobile host’s IP address to the local network. • a reply to the mobile host, accepting deregistration. The HA retransmits this gratuitous ARP message a few times. Both the HA and the mobile host are required to send the gratuitous ARP message at deregistration, since the area of coverage of the wireless mobile host and the HA are likely to be different.
Data Transfer:from remote sender to mobile host: Triangle Routing • The Remote Sender (RS) sends a message to the home address of the mobile host. • The Home Agent (HA) • intercepts the message, using proxy ARP method. • encapsulates the message using IP-in-IP with • Source address = the HA address • Destination address = the FA address • Note: PROTOCOL in the IP Header for IP-in-IP is equal to 4.
Data Transfer: • Foreign Agent (FA): • retrieves the packet, sent by the remote sender, • consults a registry table to get the Care-of-address and • sends the packet to the Care-of-address. From Mobile Host to the Remote Sender: The packet generally goes DIRECTLY, with • Source address = the home address of the mobile host • Destination address = the address of the remote host
Double Cross Routing When The mobile host goes to the network of the Remote Sender (RS): • Remote Sender’s message follows the standard Triangulation process, though the Foreign Agent is in the RS’s network. • Message from the mobile host to RS: Direct Causes of Inefficiencies: • Triangle Routing • Double Crossing
Solution to inefficiencies HA may inform RS about the Care-of-address, while forwarding the packet to the FA. All future packets from RS to mobile host can go directly. When the mobile host returns to the home network, HA may again inform the RS. Skip 13-16
IP in IP Encapsulation (RFC 2003) • To encapsulate an IP datagram in IP:
IP in IP Encapsulation: The Outer IP Header • Protocol: 4 • Source Address = HA address • Destination Address = FA address. HA and FA are the end-points of the tunnel during the Triangle Routing. • Header Length: length of the outer IP header only • Type of Service (TOS): copied from the inner IP header • Total Length: length of the entire encapsulated IP datagram, including the outer IP header, the inner IP header, and its payload. • Time to Live: appropriate for delivery up to the tunnel exit point.
IP in IP Encapsulation :The Outer IP Header ….2 • "Don't Fragment" bit : • If the "Don't Fragment" bit is set in the inner IP header, it MUST be set in the outer IP header. • If the "Don't Fragment" bit is not set in the inner IP header, it MAY be set in the outer IP header. • Fragmentation and reassembly: • will have to be done at the ends of the tunnel. • However since the two end-points are routers, reassembly may pose a problem. • An ICMP message due to a large message from a router within a tunnel may be difficult to relay to the original sender. • Options: Any options present in the inner IP header are in general NOT copied to the outer IP header.
IP in IP Encapsulation :The Inner IP Header • not changed by the encapsulator (HA), except to decrement the TTL • remains unchanged during its delivery up to the tunnel exit point • TTL in the inner IP header is not changed when decapsulating. After decapsulation, when the decapsulator (FA) forwards the datagram to one of its network interfaces, it will decrement TTL as a result of doing normal IP forwarding.
Discovery of Agents • Before a mobile host leaves the home network, it must obtain information about its Home Agent (HA). • When a mobile host reaches a foreign network, it must discover information about its Foreign Agent (FA). • HA must be always available to serve its mobile hosts. • FA must continue to advertise so that the mobile hosts registered with it know that • they have not gone out of its range. • the FA is alive.
Discovery of Agents ……..2 • Mobility agents (FAs and HAs): advertise their presence via Agent Advertisement messages A mobile host may optionally solicit an Agent Advertisement message from any locally attached mobility agents through an Agent Solicitation message. • On receiving the Agent Advertisements, a mobile host determines whether it is on its home network or a foreign network.
A mobile host: on the Home/Foreign Network: • When it detects that it is on its home network, it operates without mobility services. If returning to its home network from being registered elsewhere, the mobile node deregisters with its HA, through exchange of a Registration Request and Registration Reply message with it. • When it detects that it has moved to a foreign network, it obtains a Care-of address on the foreign network either • from a FA’s advertisements (a FA Care-of address): The preferred method because it allows many mobile nodes to share the same Care-of address and therefore does not place unnecessary demands on the already limited IPv4 address space. OR
A mobile host on a Foregn network: Acquiring a care-of-address ……..2 • The address may be dynamically acquired as a temporary address by the mobile node through DHCP, or may be owned by the mobile node as a long-term address for its use only while visiting some foreign network. (a Co-located care-of address). Advantage: No FA need be deployed. Disadvantages: (i) places additional burden on the IPv4 address space because it requires a pool of addresses within the foreign network to be made available to visiting mobile nodes. (ii) difficult to efficiently maintain pools of addresses for each subnet that may permit mobile nodes to visit.
Acquiring Care-of-addresses from FA advertisement • If there are more than one Care-of-addresses, advertised by a FA, the mobile host should pick up the first. • If FA rejects the Registration Request, then the mobile host should resend the request with the second Care-of-address.
Discovery of Agents …2 • ADVERTISEMENT BY AGENTS: through regular ICMP Router Advertisements, on which the Agent advertisements are piggy-backed. • Mobility Agent Advertisement Extension is added to the ICMP Router Advertisements for this purpose.
Mobility Agent Advertisement Extension • Appended to the Router Advertisement
Mobility Agent Advertisement Extension : Fields • Length: of the extension message only • Sequence Number: message number • Lifetime: The longest lifetime (measured in seconds) that this agent is willing to accept in any Registration Request. No relation with the same named field in the ICMP Router Advertisement part. Notes: 1.This field has no relation to the "Lifetime" field within the ICMP Router Advertisement portion of the Agent Advertisement. 2. All 1’s i.e. 0xffff infinite time
Mobility Agent Advertisement Extension : Fields …. 2 • Care-of-Addresses: contains the set of available care-of-addresses; the field used by a foreign agent only; At least one Care-of-address must be included in every Agent advertisement. • Code: Each of the bits is used to convey a different message - as defined in the next slide.
Mobility Agent Advertisement Extension : Code Bits • Bit 7: R: registration required; Registration with this foreign agent (or another foreign agent on this link) is required even when using a co-located care-of address. Or co-location of care-of-address may not be allowed. • Bit 6: B: Agent is busy. So FA will not accept registrations from additional mobile hosts. • Bit 5: H: Agent acts as a home agent on the link on which this Agent Advertisement message is sent. • Bit 4: F: Agent acts as a foreign agent. • Bit 3: M: Agent uses minimal encapsulation. (slides 26-30) • Bit 2: G: Agent uses Generic Routing Encapsulation (GRE). (RFC 1701) • Bit 1: r: Unused (0) • Bit 0: T: Agent supports reversed tunneling (slide 31)
Mobility Agent Advertisement Extension : Code Bits …..2 • In an Agent Advertisement message: • 'B' bit MUST NOT be set if the 'F' bit is not also set. (Only an FA can say that it is busy. A HA must be always available.) • at least one of the 'F' bit and the 'H' bit MUST be set. • ‘R' bit MUST NOT be set if the 'F' bit is not also set. (R is set by an FA, when it requires registration from even those mobile hosts, which have co-located Care-of-addresses. R is NOT used by HAs)
Mobility Agent Advertisement Extension :Minimal Encapsulation (RFC: 2004) • IP-in-IP: has unnecessary duplication of several fields between the outer and the inner IP header; • Minimal Encapsulation: attempts to save some space by reducing the size of the inner header to 12 bytes by eliminating duplication • Outer Header: • PROTOCOL = 55 for IP-in-IP with minimum encapsulation • TTL: kept the same as in the original IP header
Mobility Agent Advertisement Extension :Minimal Encapsulation……2
Mobility Agent Advertisement Extension : Minimal Encapsulation:Minimal Forwarding Header
Mobility Agent Advertisement Extension : Minimal Encapsulation:Fields of the Minimal Forwarding Header • Protocol: same as in the original IP header. • S = 1 (If S = 0, the source address in the Outer header is equal to the source address in the original IP header. Then this address is not put in the inner header and the length of the inner header reduces to 8) • Reserved: are all zero. • Header Checksum: for the minimal forwarding header only Note: 1. While de-encapsulating, the original header is restored back ( with some changes). 2. ICMP messages from within the tunnel have to be handled with care, since the movement of the mobile host is transparent to the RS.
Mobility Agent Advertisement Extension : Need for Reversed Tunneling (RFC 3024) • The message from the mobile host to RS goes directly from the foreign network to the RS. • But it carries the source address of the home network. • Due to security considerations, some networks may not allow it. • Need for reversed tunneling from mobile host – to- HA –to- RS
Additional Specifications:ICMP Router Advertisement with Agent Extension Link layer: If the Router Advertisement is in response to a Router solicitation message, it will be unicast to the MAC address of the solicitation message. (ie the MAC address and the IP home address of the mobile host) IP fields: • TTL = 1 • The multicast Agent advertisement is sent to either • All systems on the link ( 18.104.22.168) or • The Limited broadcast (255.255.255.255)
Prefix-Length extension • This extension may follow the Mobility Agent Advertisement Extension.
Prefix-Length extension Fields • Type: 19 • Length: N, where N is the value (possibly zero) of the Num Addrs field in the ICMP Router Advertisement portion of the Agent Advertisement. Prefix Length(s): The number of leading bits that define the network number of the corresponding Router Address listed in the ICMP Router Advertisement portion of the message. The prefix length for each Router Address is encoded as a separate byte, in the order that the Router Addresses are listed in the ICMP Router Advertisement portion of the message
Router ADVERTISEMENT • Type: 9 for Router Advertisement • Code: • Code = 0 The agent routes common traffic, not related to mobile hosts – in addition to the traffic of the mobile hosts • Code = 16: The agent does not route common traffic.However every FA must forward to a default router any datagrams received from a registered mobile host. (For a non-agent ICMP router advertisement, Code ia always equal to zero.) • The scheme calls for • Periodic Retransmission (Default period=10 minutes) • Soft state in that the Router information retainedfor the specified lifetime (Default lifetime = 30 minute so that missing one ad message will not lead to discarding the Router )
ROUTER ADVERTISEMENT • An Advertisement by a Router tells about • it self and • all other Routers on the network about which it is aware. • Every Router address, associated with an integer precedence value given in 2’s complement. A host chooses the route with the highest precedence value.
ROUTER ADVERTISEMENT • Thus if • PR VAL = 0 -----> DEFUALT ROUTER • PR VAL = 8000 0000 ->should never be selected as the default router.
ROUTER ADVERTISEMENT: Fields • Num ADDRS: The number of address entries which follow (often 1) For an Agent Advertisement, Num ADDRS can be zero. • ADDR SIZE: The size of an address in 32 bit units (1 for IPv4) • LIFE TIME: • The number of seconds for which the Router is retained, if it is not refreshed (default = 30 min) (The maximum length of time that the Advertisement is considered valid in the absence of further Advertisements.)
ROUTER ADVERTISEMENT Process • LIFETIME: No relation with the same named field in the Agent Advertisement part. • Routers send these messages periodically. Or immediately on receipt of a Router solicitation message. • If the Router and the network support multicast, send to all systems multicast address 22.214.171.124 Otherwise it is broadcast locally.
Router Solicitation Message: to find a foreign agent • In a foreign network, if a mobile host does not receive the ICMP Router Advertisement, it can use the ICMP Router Solicitation message to ask for assistance. • An Agent Solicitation message is identical to an ICMP Router Solicitation, except that its IP TTL MUST be set to 1 • Rate of sending solicitation messages: • Initial rate for 3 messages: one per second • Back-off the rate exponentially ( and randomize the sending instant) till you reach one message per minute.
Router Solicitation Router Solicitation • For the addresses of Routers connected to the n/w.
Router Solicitation (Contd) • TYPE: 10 • CODE: 0 • If a host supports multicast, send the Router Solicitation message to 126.96.36.199 (address of all Routers) Or it may be broadcast to the local n/w. • (Every few minutes – default value = 10 minutes - a Router advertisement is received . Router Solicitation used only when Router address is required immediately)
Registration of the mobile host • The mobile host operating away from home then registers its new Care-of address with its HA through exchange of a messages with it, possibly via a FA. • Registration on moving to a foreign network • With the foreign agent • With the home agent ( done by the foreign agent on behalf of the host) • Renew registration, if it has expired. • Deregistration after returning to home net
Process of Registration • Registration Request: sent by the mobile host to FA to inform it about • The chosen Care-of address • HA’s address • Home address • FA: On receiving the Registration Request: relays the Request in an IP packet to HA – thus informing HA about FA’s address. • Both HA and FA must approve the Registration Request
Process of Registration … 2 • For a co-located Care-of-address, the mobile host sends the Registration Request directly to HA • Two new Formats: Registration Request and Registration Reply • UDP: used for Registration messages with • Well-known port 434 for the Agent • An ephemeral port by the mobile host • UDP checksum must be used for the Registration messages.
8-bit FLAG: to convey Requests from the Mobile Host and to give forwarding information • Bit 7: S: Simultaneous Binding: Request for home agent to retain its prior Care-of-address: • Useful when a mobile host is within the range of two FAs; • the HA can then send two copies, one to each of the Care-of-addresses; the mobile host may then receive two copies of the message. • Bit 6: B: Request that home agent may tunnel any broadcast messages on the home network • Bit 5: D: Mobile host is using co-located care-of-address to decapsulate messages itself. • Bit 4: M: Request for home agent to use minimal encapsulation
8-bit FLAG: • Bit 3: G: Request for Generic Routing Encapsulation (GRE) • Bit 2: r: zero; ignored on reception • Bit 1: T: Reverse Tunneling requested • Bit 0: x: zero; ignored on reception