Nothing Special   »   [go: up one dir, main page]

Unit 2 Part 1

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 80

UNIT-2

NETWORK LAYER
SYLLABUS
• Network Layer – IPv4 Addressing – Network Layer
Protocols (IP,ICMP and Mobile IP) Unicast and
Multicast Routing – Intradomain and Interdomain
Routing Protocols – IPv6 Addresses – IPv6 – Datagram
Format - Transition from IPv4 to IPv6.
INTRODUCTION
• The network layer in the TCP/IP protocol suite is responsible for the
host-to-host delivery of datagrams.
• It provides services to the transport layer and receives services from
the data-link layer
NETWORK-LAYER SERVICES
1) Packetizing
• The first duty of the network layer is definitely packetizing:
encapsulating the payload (data received from upper layer) in a
network-layer packet at the source and decapsulating the payload
from the network-layer packet at the destination.
• The network layer is doing the service of a carrier such as the postal
office, which is responsible for delivery of packages from a sender to a
receiver without changing or using the contents
• The source is not allowed to change the content of the payload unless
it is too large for delivery and needs to be fragmented.
2) Routing and Forwarding
• Routing
o The network layer is responsible for routing the packet from its source to the
destination.
o A physical network is a combination of networks (LANs and WANs) and routers
that connect them.
o This means that there is more than one route from the source to the destination.
o The network layer is responsible for finding the best one among these possible
routes.
o The network layer needs to have some specific strategies for defining the best
route.
o In the Internet today, this is done by running some routing protocols to help the
routers coordinate their knowledge about the neighborhood and to come up with
consistent tables to be used when a packet arrives.
• Forwarding
o If routing is applying strategies and running some routing protocols to
create the decision-making tables for each router, forwarding can be
defined as the action applied by each router when a packet arrives at one
of its interfaces.
o The decision-making table a router normally uses for applying this action
is sometimes called the forwarding table and sometimes the routing table.
o When a router receives a packet from one of its attached networks, it
needs to forward the packet to another attached network (in unicast
routing) or to some attached networks (in multicast routing).
o To make this decision, the router uses a piece of information in the packet
header, which can be the destination address or a label, to find the
corresponding output interface number in the forwarding table.
• Figure shows the idea of the forwarding process in a router.
3) Other Services
• Error Control
• Flow Control
• Congestion Control
• Quality of Service
• Security
IPV4 ADDRESSES
• The identifier used in the IP layer of the TCP/IP protocol suite to identify the
connection of each device to the Internet is called the Internet address or IP
address.
• An IPv4 address is a 32-bit address that uniquely and universally defines the
connection of a host or a router to the Internet.
• The IP address is the address of the connection, not the host or the router,
because if the device is moved to another network, the IP address may be
changed.
• IPv4 addresses are unique in the sense that each address defines one, and only
one, connection to the Internet.
• If a device has two connections to the Internet, via two networks, it has two IPv4
addresses.
• IPv4 addresses are universal in the sense that the addressing system must be
accepted by any host that wants to be connected to the Internet.
1) Address Space
• A protocol like IPv4 that defines addresses has an address space.
• An address space is the total number of addresses used by the
protocol.
• If a protocol uses b bits to define an address, the address space is 2b
because each bit can have two different values (0 or 1).
• IPv4 uses 32-bit addresses, which means that the address space is 232
or 4,294,967,296 (more than four billion).
• If there were no restrictions, more than 4 billion devices could be
connected to the Internet.
• Notation
o There are three common notations to show an IPv4 address: binary
notation (base 2), dotted-decimal notation (base 256), and
hexadecimal notation (base 16).
• Binary notation,
o An IPv4 address is displayed as 32 bits.
o To make the address more readable, one or more spaces are usually inserted between
each octet (8 bits).
o Each octet is often referred to as a byte.
• Dotted-decimal notation
o To make the IPv4 address more compact and easier to read, it is usually written in
decimal form with a decimal point (dot) separating the bytes.
o Note that because each byte (octet) is only 8 bits, each number in the dotted-decimal
notation is between 0 and 255.
• Hexadecimal notation
o Each hexadecimal digit is equivalent to four bits.
o This means that a 32-bit address has 8 hexadecimal digits.
o This notation is often used in network programming.
• Hierarchy in Addressing
o In any communication network that involves delivery, such as a
telephone network or a postal network, the addressing system is
hierarchical.
o In a postal network, the postal address (mailing address) includes the
country, state, city, street, house number, and the name of the mail
recipient.
o Similarly, a telephone number is divided into the country code, area
code, local exchange, and the connection.
o A 32-bit IPv4 address is also hierarchical, but divided only into two parts.
o The first part of the address, called the prefix, defines the network; the
second part of the address, called the suffix, defines the node
(connection of a device to the Internet).
• A prefix can be fixed length or variable length.
• The network identifier in the IPv4 was first designed as a fixed-length
prefix and is referred to as classful addressing.
• The new scheme, which is referred to as classless addressing, uses a
variable-length network prefix.
2) Classful Addressing
• An IPv4 address was designed with a fixed-length prefix, but to
accommodate both small and large networks, three fixed-length
prefixes were designed instead of one (n = 8, n = 16, and n = 24).
• The whole address space was divided into five classes (class A, B, C, D,
and E).
• In class A, the network length is 8 bits, but since the first bit, which is 0,
defines the class, we can have only seven bits as the network identifier. This
means there are only 27 = 128 networks in the world that can have a class A
address.
• In class B, the network length is 16 bits, but since the first two bits, which are
(10)2, define the class, we can have only 14 bits as the network identifier.
This means there are only 214 = 16,384 networks in the world that can have
a class B address. All addresses that start with (110)2 belong to class C.
• In class C, the network length is 24 bits, but since three bits define the class,
we can have only 21 bits as the network identifier. This means there are 221
= 2,097,152 networks in the world that can have a class C address.
• Class D is not divided into prefix and suffix. It is used for multicast addresses.
All addresses that start with 1111 in binary belong to class E. As in Class D,
Class E is not divided into prefix and suffix and is used as reserve
• Address Depletion
o The reason that classful addressing has become obsolete is address depletion.
o Since the addresses were not distributed properly, the Internet was faced with
the problem of the addresses being rapidly used up, resulting in no more
addresses available for organizations and individuals that needed to be
connected to the Internet
• Subnetting and Supernetting
o To alleviate address depletion, two strategies were proposed.
o In subnetting, a class A or class B block is divided into several subnets. Each
subnet has a larger prefix length than the original network.
o While subnetting was devised to divide a large block into smaller ones,
supernetting was devised to combine several class C blocks into a larger block
to be attractive toorganizations that need more than the 256 addresses
available in a class C block
• Advantage of Classful Addressing
o Given an address, we can easily find the class of the address and,
since the prefix length for each class is fixed, we can find the prefix
length immediately.
o In other words, the prefix length in classful addressing is inherent in
the address; no extra information is needed to extract the prefix and
the suffix
3) Classless Addressing
• Subnetting and supernetting in classful addressing did not really solve the address
depletion problem.
• With the growth of the Internet, it was clear that a larger address space was
needed as a long-term solution.
• The larger address space, however, requires that the length of IP addresses also
be increased, which means the format of the IP packets needs to be changed.
• Although the long-range solution has already been devised and is called IPv6 ,a
short-term solution was also devised to use the same address space but to
change the distribution of addresses to provide a fair share to each organization.
• The short-term solution still uses IPv4 addresses, but it is called classless
addressing.
• In classless addressing, variable-length blocks are used that belong to
no classes. We can have a block of 1 address, 2 addresses, 4
addresses, 128 addresses, and so on.
• In classless addressing, the whole address space is divided into
variable length blocks.
• The prefix in an address defines the block (network); the suffix defines
the node (device).
• Theoretically, we can have a block of 20, 21, 22, ...,232 addresses. One
of the restrictions is that the number of addresses in a block needs to
be a power of 2.
• An organization can be granted one block of addresses.
• Unlike classful addressing, the prefix length in classless addressing is
variable and a prefix length that ranges from 0 to 32.
• The size of the network is inversely proportional to the length of the
prefix.
• A small prefix means a larger network; a large prefix means a smaller
network.
• An address in class A can be thought of as a classless address in which
the prefix length is 8.
• An address in class B can be thought of as a classless address in which
the prefix is 16, and so on.
• In other words, classful addressing is a special case of classless
addressing.
• Prefix Length: Slash Notation
• The prefix length, n, is added to the address, separated by a slash.
• The notation is informally referred to as slash notation and formally as
classless interdomain routing or CIDR (pronounced cider) strategy.
• An address in classless addressing can then be represented as shown
in Figure
• Extracting Information from an Address
• Given any address in the block, we normally like to know three pieces
of information about the block to which the address belongs: the
number of addresses, the first address in the block, and the last
address.
• Since the value of prefix length, n, is given, we can easily find these
three pieces of information, as shown in Figure.
1. The number of addresses in the block is found as N = 232−n.
2. To find the first address, we keep the n leftmost bits and set the (32
− n) rightmost bits all to 0s.
3. To find the last address, we keep the n leftmost bits and set the (32
− n) rightmost bits all to 1s.
Example
• A classless address is given as 167.199.170.82/27. We can find the
above three pieces of information as follows.
Solution:
• The number of addresses in the network is 2^(32 − n) = 2^5 = 32
addresses.
• The first address can be found by keeping the first 27 bits and
changing the rest of the bits to 0s.
Address:
167.199.170.82/27 10100111 11000111 10101010 01010010
First address:
167.199.170.64/27 10100111 11000111 10101010 01000000
• The last address can be found by keeping the first 27 bits and
changing the rest of the bits to 1s.
• Address:
167.199.170.82/27 10100111 11000111 10101010 01010010
• Last address:
167.199.170.95/27 10100111 11000111 10101010 01011111
• Address Mask
• Another way to find the first and last addresses in the block is to use the
address mask.
• The address mask is a 32-bit number in which the n leftmost bits are set to 1s
and the rest of the bits (32 − n) are set to 0s.
• A computer can easily find the address mask because it is the complement of
(2^(32 − n) − 1).
• The reason for defining a mask in this way is that it can be used by a computer
program to extract the information in a block, using the three bit-wise
operations NOT, AND, and OR.
1. The number of addresses in the block N = NOT (mask) + 1.
2. The first address in the block = (Any address in the block) AND (mask).
3. The last address in the block = (Any address in the block) OR [(NOT (mask)].
• Network Address
• The first address, the network address, is particularly important
because it is used in routing a packet to its destination network.
• For the moment, let us assume that an internet is made of m
networks and a router with m interfaces.
• When a packet arrives at the router from any source host, the router
needs to know to which network the packet should be sent: from
which interface the packet should be sent out.
• Block Allocation
• The next issue in classless addressing is block allocation.
• The ultimate responsibility of block allocation is given to a global
authority called the Internet Corporation for Assigned Names and
Numbers (ICANN).
• ICANN does not normally allocate addresses to individual Internet
users and it assigns a large block of addresses to an ISP (or a larger
organization that is considered an ISP in this case).
• For the proper operation of the CIDR, two restrictions need to be
applied to the allocated block.
1. The number of requested addresses, N, needs to be a power of 2.
The reason is that N = or n = 32 − log2N. If N is not a power of
2.we cannot have an integer value for n.
2. The requested block needs to be allocated where there is an
adequate number of contiguous addresses available in the address
space. However, there is a restriction on choosing the first address
in the block. The first address needs to be divisible by the number
of addresses in the block. The reason is that the first address needs
to be the prefix followed by (32 − n) number of 0s. The decimal
value of the first address is then
• Subnetting
• More levels of hierarchy can be created using subnetting.
• An organization (or an ISP) that is granted a range of addresses may divide the
range into several subranges and assign each subrange to a subnetwork (or
subnet).
• A sub-subnetwork can be divided into several sub-sub-subnetworks, and so on.
(i) Designing Subnets
• The subnetworks in a network should be carefully designed to enable the
routing of packets.
• We assume the total number of addresses granted to the organization is N, the
prefix length is n, the assigned number of addresses to each subnetwork is
Nsub, and the prefix length for each subnetwork is nsub.
• Then the following steps need to be carefully followed to guarantee the proper
operation of the subnetworks.
o The number of addresses in each subnetwork should be a power of 2.
o The prefix length for each subnetwork should be found using the
following formula:
nsub = 32 − log2Nsub
o The starting address in each subnetwork should be divisible by the
number of addresses in that subnetwork. This can be achieved if we
first assign addresses to larger subnetworks.
(ii)Finding Information about Each Subnetwork
o After designing the subnetworks, the information about each
subnetwork, such as first and last address, can be found using the
process we described to find the information about each network in
the Internet.
Example
• An organization is granted a block of addresses with the beginning address
14.24.74.0/24. The organization needs to have 3 subblocks of addresses to use in
its three subnets: one subblock of 10 addresses, one subblock of 60 addresses,
and one subblock of 120 addresses. Design the subblocks.
Solution
There are 2^32 – 24 = 256 addresses in this block. The first address is
14.24.74.0/24; the last address is 14.24.74.255/24. To satisfy the third requirement,
we assign addresses to subblocks, starting with the largest and ending with the
smallest one.
a. The number of addresses in the largest subblock, which requires 120 addresses,
is not a power of 2. We allocate 128 addresses. The subnet mask for this subnet
can be found as n1 =32−log2128=25. The first address in this block is
14.24.74.0/25; the last address is 14.24.74.127/25.
b. The number of addresses in the second largest subblock, which requires 60
addresses, is not a power of 2 either. We allocate 64 addresses. The subnet mask
for this subnet can be found as n2 = 32 − log264 = 26. The first address in this
block is 14.24.74.128/26; the last address is 14.24.74.191/26.
c. The number of addresses in the smallest subblock, which requires 10
addresses, is not a power of 2 either. We allocate 16 addresses. The subnet
mask for this subnet can be found as n3 = 32 − log216 = 28. The first address in
this block is 14.24.74.192/28; the last address is 14.24.74.207/28.
• If we add all addresses in the previous subblocks, the result is 208 addresses,
which means 48 addresses are left in reserve. The first address in this range is
14.24.74.208. The last address is 14.24.74.255. We don’t know about the
prefix length yet. Figure shows the configuration of blocks. We have shown the
first address in each block.
• Address Aggregation
• One of the advantages of the CIDR strategy is address aggregation
(sometimes called address summarization or route summarization).
• When blocks of addresses are combined to create a larger block,
routing can be done based on the prefix of the larger block.
• ICANN assigns a large block of addresses to an ISP.
• Each ISP in turn divides its assigned block into smaller subblocks and
grants the subblocks to its customers.
• Special Addresses
• There are five special addresses that are used for special purposes.
1) This-host Address
- 0.0.0.0/32 and it is used whenever a host needs to send an IP datagram
but it does not know its own address to use as the source address.
2) Limited-broadcast Address
-255.255.255.255/32 and It is used whenever a router or a host needs to
send a datagram to all devices in a network.
3) Loopback Address
-127.0.0.0/8 and A packet with one of the addresses in this block as the
destination address never leaves the host; it will remain in the host
4) Private Addresses
-Four blocks are assigned as private addresses: 10.0.0.0/8,
172.16.0.0/12, 192.168.0.0/16, and 169.254.0.0/16.
5) Multicast Addresses
-The block 224.0.0.0/4 is reserved for multicast addresses.
4) Dynamic Host Configuration Protocol (DHCP)
• After a block of addresses are assigned to an organization, the network administration can
manually assign addresses to the individual hosts or routers.
• However, address assignment in an organization can be done automatically using the Dynamic
Host Configuration Protocol (DHCP).
• DHCP is an application-layer program, using the client-server paradigm, that actually helps TCP/IP
at the network layer.
• DHCP has found such widespread use in the Internet that it is often called a plug-and-play
protocol and it can be used in many situations.
• A network manager can configure DHCP to assign permanent IP addresses to the host and
routers.
• DHCP can also be configured to provide temporary, on demand, IP addresses to hosts.
• The second capability can provide a temporary IP address to a traveler to connect her laptop to
the Internet while she is staying in the hotel.
• It also allows an ISP with 1000 granted addresses to provide services to 4000 households,
assuming not more than one-forth of customers use the Internet at the same time.
• DHCP can be used to provide these pieces of information to the host.
• DHCP Message Format
• The 64-byte option field has a dual purpose.
• It can carry either additional information or some specific vendor
information.
• The server uses a number, called a magic cookie, in the format of an
IP address with the value of 99.130.83.99.
• When the client finishes reading the message, it looks for this magic
cookie.
• If present, the next 60 bytes are options.
• An option is composed of three fields: a 1-byte tag field, a 1-byte
length field, and a variable-length value field.
• There are several tag fields that are mostly used by vendors.
• If the tag field is 53, the value field defines one of the 8 message
types shown in Figure
DHCP Operation
• Two Well-Known Ports
• DHCP uses two well-known ports (68 and 67) instead of one well-known
and one ephemeral.
• Using FTP
• The client can then use a file transfer protocol to obtain the rest of the
needed information.
• Error Control
• DHCP uses the service of UDP, which is not reliable.
• To provide error control, DHCP uses two strategies.
1. First, DHCP requires that UDP use the checksum.
2. Second, the DHCP client uses timers and a retransmission policy if it does
not receive the DHCP reply to a request.
• Transition States
Network-Layer Protocols

• INTERNET PROTOCOL (IP)


• ICMPv4 (Internet Control Message Protocol version 4 )
• MOBILE IP
INTERNET PROTOCOL (IP)
• The network layer in version 4 can be thought of as one main protocol and
three auxiliary ones.
• The main protocol, Internet Protocol version 4 (IPv4), is responsible for
packetizing, forwarding, and delivery of a packet at the network layer.
• The Internet Control Message Protocol version 4 (ICMPv4) helps IPv4 to
handle some errors that may occur in the network-layer delivery.
• The Internet Group Management Protocol (IGMP) is used to help IPv4 in
multicasting.
• The Address Resolution Protocol (ARP) is used to glue the network and
data-link layers in mapping network-layer addresses to link-layer addresses.
1) Datagram Format
• Packets used by the IP are called datagrams.
• Version Number: The 4-bit version number (VER) field defines the
version of the IPv4 protocol, which, obviously, has the value of 4.
• Header Length: The 4-bit header length (HLEN) field defines the total
length of the datagram header in 4-byte words. The IPv4 datagram
has a variable-length header.
• Service Type: In the original design of the IP header, this field was
referred to as type of service (TOS), which defined how the datagram
should be handled. In the late 1990s, IETF redefined the field to
provide differentiated services (DiffServ).
• Total Length: This 16-bit field defines the total length (header plus
data) of the IP datagram in bytes. A 16-bit number can define a total
length of up to 65,535
• Identification, Flags, and Fragmentation Offset: These three fields are
related to the fragmentation of the IP datagram when the size of the
datagram is larger than the underlying network can carry
• The time-to-live (TTL) field is used to control the maximum number of
hops (routers) visited by the datagram
• Protocol: In TCP/IP, the data section of a packet, called the payload,
carries the whole packet from another protocol. This field provides
multiplexing at the source and demultiplexing at the destination, as
shown in Figure
• Header checksum: IP is not a reliable protocol; it does not check
whether the payload carried by a datagram is corrupted during the
transmission. IP puts the burden of error checking of the payload on
the protocol that owns the payload, such as UDP or TCP.
• Source and Destination Addresses: These 32-bit source and
destination address fields define the IP address of the source and
destination respectively.
• Options: A datagram header can have up to 40 bytes of options.
Options can be used for network testing and debugging.
• Payload: Payload, or data, is the main reason for creating a datagram.
Payload is the packet coming from other protocols that use the
service of IP.
2) Fragmentation
• Maximum Transfer Unit (MTU)
o The value of the MTU differs from one physical network protocol to
another. For example, the value for a LAN is normally 1500 bytes, but
for a WAN it can be larger or smaller.
o In order to make the IP protocol independent of the physical network,
the designers decided to make the maximum length of the IP
datagram equal to 65,535 bytes.
• We must divide the datagram to make it possible for it to pass
through these networks. This is called fragmentation.
• When a datagram is fragmented, each fragment has its own header
with most of the fields repeated, but some have been changed.
• A datagram can be fragmented by the source host or any router in the
path.
• The reassembly of the datagram, however, is done only by the
destination host, because each fragment becomes an independent
datagram.
• The host or router that fragments a datagram must change the values
of three fields: flags, fragmentation offset, and total length.
Fields Related to Fragmentation
• Three fields in an IP datagram are related to fragmentation: identification,
flags, and fragmentation offset
• The 16-bit identification field identifies a datagram originating from the source
host. The combination of the identification and source IP address must
uniquely define a datagram as it leaves the source host.
• The 3-bit flags field defines three flags. The leftmost bit is reserved (not used).
The second bit (D bit) is called the do not fragment bit. If its value is 1, the
machine must not fragment the datagram.
• The 13-bit fragmentation offset field shows the relative position of this
fragment with respect to the whole datagram. It is the offset of the data in the
original datagram measured in units of 8 bytes
3) Options
• The header of the IPv4 datagram is made of two parts: a fixed part
and a variable part. The fixed part is 20 bytes
• The variable part comprises the options that can be a maximum of 40
bytes (in multiples of 4-bytes) to preserve the boundary of the
header.
o Single-Byte Options :There are two single-byte options.
No Operation:A no-operation option is a 1-byte option used as a filler
between options.
End of Option: An end-of-option option is a 1-byte option used for
padding at the end of the option field. It, however, can only be used
as the last option.
o Multliple-Byte Options:There are four multiple-byte options
Record Route: It is used to record the Internet routers that handle the
datagram
Strict Source Route: It is used by the source to predetermine a route
for the datagram as it travels through the Internet.
Loose Source Route: It is similar to the strict source route, but it is
less rigid.
Timestamp: It is used to record the time of datagram processing by a
router.
4) Security of IPv4 Datagrams
• Packet Sniffing: It is a passive attack, in which the attacker does not
change the contents of the packet.
• Packet Modification : The attacker intercepts the packet, changes its
contents, and sends the new packet to the receiver.
• IP Spoofing :An attacker can masquerade as somebody else and
create an IP packet that carries the source address of another
computer
• IPSec:It provides the following four services:
-Defining Algorithms and Keys, Packet Encryption, Data Integrity,
Origin Authentication
ICMPv4
• The IPv4 has no error-reporting or error-correcting mechanism.
• The Internet Control Message Protocol version 4 (ICMPv4) has been
designed to compensate for the above two deficiencies. It is a
companion to the IP protocol. ICMP itself is a network-layer protocol.
However, its messages are not passed directly to the data-link layer as
would be expected. Instead, the messages are first encapsulated
inside IP datagrams before going to the lower layer. When an IP
datagram encapsulates an ICMP message, the value of the protocol
field in the IP datagram is set to 1 to indicate that the IP payroll is an
ICMP message.
1) MESSAGES
• ICMP messages are divided into two broad categories: error-reporting
messages and query messages.
• The error-reporting messages report problems that a router or a host
(destination) may encounter when it processes an IP packet.
• The query messages, which occur in pairs, help a host or a network
manager get specific information from a router or another host.
Error Reporting Messages
• The following are important points about ICMP error messages:
❑ No ICMP error message will be generated in response to a datagram
carrying an ICMP error message.
❑ No ICMP error message will be generated for a fragmented datagram
that is not the first fragment.
❑ No ICMP error message will be generated for a datagram having a
multicast address.
❑ No ICMP error message will be generated for a datagram having a
special address such as 127.0.0.0 or 0.0.0.0.
Deprecated Messages
• Three pairs of messages are declared obsolete by IETF:
1. Information request and replay messages are not used today
because their duties are done by the Address Resolution Protocol
(ARP)
2. Address mask request and reply messages are not used today
because their duties are done by the Dynamic Host Configuration
Protocol (DHCP),
3. Router solicitation and advertisement messages are not used today
because their duties are done by the Dynamic Host Configuration
Protocol (DHCP),
2) Debugging Tools
• There are several tools that can be used in the Internet for debugging.
• We can determine the viability of a host or router.
• We can trace the route of a packet.
• We introduce two tools that use ICMP for debugging: ping and
traceroute.
Ping
• We can use the ping program to find if a host is alive and responding.
• The source host sends ICMP echo-request messages; the destination,
if alive, responds with ICMP echo-reply messages.
• The ping program sets the identifier field in the echo-request and
echo-reply message and starts the sequence number from 0; this
number is incremented by 1 each time a new message is sent.
• Note that ping can calculate the round-trip time.
• It inserts the sending time in the data section of the message.
• When the packet arrives, it subtracts the arrival time from the
departure time to get the round-trip time (RTT).
Traceroute or Tracert
• The traceroute program in UNIX or tracert in Windows can be used to
trace the path of a packet from a source to the destination.
• It can find the IP addresses of all the routers that are visited along the
path.
• The program is usually set to check for the maximum of 30 hops
(routers) to be visited.
• The number of hops in the Internet is normally less than this.
3) ICMP Checksum
• In ICMP the checksum is calculated over the entire message (header
and data).
• Example
MOBILE IP
1)Addressing
• The main problem that must be solved in providing mobile
communication using the IP protocol is addressing.
Stationary Hosts
• The original IP addressing was based on the assumption that a host is
stationary, attached to one specific network.
• The IP addresses are designed to work with stationary hosts because
part of the address defines the network to which the host is attached.
Mobile Hosts
• When a host moves from one network to another, the IP addressing
structure needs to be modified. Several solutions have been
proposed.
• Changing the Address: One simple solution is to let the mobile host
change its address as it goes to the new network. The host can use
DHCP (see Chapter 18) to obtain a new address to associate it with
the new network.
• Two Addresses: Mobile IP has two addresses for a mobile host: one
home address and one care-of address. The home address is
permanent; the care-of address changes as the mobile host moves
from one network to another.
2) Agents
• To make the change of address transparent to the rest of the Internet
requires a home agent and a foreign agent.
Home Agent
• The home agent is usually a router attached to the home network of
the mobile host.
• The home agent acts on behalf of the mobile host when a remote
host sends a packet to the mobile host.
• The home agent receives the packet and sends it to the foreign agent.
Foreign Agent
• The foreign agent is usually a router attached to the foreign network.
• The foreign agent receives and delivers packets sent by the home
agent to the mobile host.
• The mobile host can also act as a foreign agent
3) Three Phases
• To communicate with a remote host, a mobile host goes through
three phases: agent discovery, registration, and data transfer,
1)Agent Discovery
• The first phase in mobile communication, agent discovery, consists of
two subphases.
• Agent Advertisement

•.
• Agent Solicitation: Mobile IP does not use a new packet type for agent
solicitation; it uses the router solicitation packet of ICMP
2)Registration:To register with the foreign agent and the home agent,
the mobile host uses a registration request and a registration reply
• Registration Request
• A registration request is sent from the mobile host to the foreign
agent to register its care-of address and also to announce its home
address and home agent address.
• Registration Reply
• A registration reply is sent from the home agent to the foreign agent
and then relayed to the mobile host. The reply confirms or denies the
registration request

• Data Transfer
• After agent discovery and registration, a mobile host can
communicate with a remote host.
• From Remote Host to Home Agent
• From Home Agent to Foreign Agent
• From Foreign Agent to Mobile Host
• From Mobile Host to Remote Host
• Transparency
4) Inefficiency in Mobile IP
• Communication involving mobile IP can be inefficient.
• The inefficiency can be severe or moderate.
• The severe case is called double crossing or 2X.
• The moderate case is called triangle routing or dog-leg routing.
Double Crossing
• Double crossing occurs when a remote host communicates with a
mobile host that has moved to the same network (or site) as the
remote host.
• When the mobile host sends a packet to the remote host, there is no
inefficiency; the communication is local.
• However, when the remote host sends a packet to the mobile host,
the packet crosses the Internet twice.
• Since a computer usually communicates with other local computers
(principle of locality), the inefficiency from double crossing is
significant.
• Double Crossing

• Triangle Routing
Triangle Routing
• Triangle routing, the less severe case, occurs when the remote host
communicates with a mobile host that is not attached to the same
network (or site) as the mobile host.
• When the mobile host sends a packet to the remote host, there is no
inefficiency.
• However, when the remote host sends a packet to the mobile host,
the packet goes from the remote host to the home agent and then to
the mobile host.
• The packet travels the two sides of a triangle, instead of just one side
Solution
• One solution to inefficiency is for the remote host to bind the care-of
address to the home address of a mobile host.
• For example, when a home agent receives the first packet for a
mobile host, it forwards the packet to the foreign agent; it could also
send an update binding packet to the remote host so that future
packets to this host could be sent to the care-of address.
• The remote host can keep this information in a cache.
• The problem with this strategy is that the cache entry becomes
outdated once the mobile host moves.
• In this case the home agent needs to send a warning packet to the
remote host to inform it of the change.

You might also like