0% found this document useful (0 votes)
13 views

Unit3 - Network Layer Protocols

The document discusses network layer protocols including ARP, RARP, DHCP, and ICMP. It provides details on: - ARP which maps logical IP addresses to physical hardware addresses to allow packet delivery across networks. ARP broadcasts queries and caches responses for efficiency. - RARP which provides reverse address resolution by mapping from a physical address to a logical IP address. - The need for protocols that handle dynamic address assignment like DHCP since static address mapping has limitations. - ICMP which provides error reporting and congestion control since IP lacks features like flow and error control.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Unit3 - Network Layer Protocols

The document discusses network layer protocols including ARP, RARP, DHCP, and ICMP. It provides details on: - ARP which maps logical IP addresses to physical hardware addresses to allow packet delivery across networks. ARP broadcasts queries and caches responses for efficiency. - RARP which provides reverse address resolution by mapping from a physical address to a logical IP address. - The need for protocols that handle dynamic address assignment like DHCP since static address mapping has limitations. - ICMP which provides error reporting and congestion control since IP lacks features like flow and error control.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Network Layer Protocols

ARP,RARP,DHCP,ICMP
Introduction
➢Communication at the network layer is host-to-host (computer-to-computer), i.e., a computer
somewhere in the world needs to communicate with another computer somewhere else in the
world.
➢Network layer is responsible for source to destination delivery of the packets.
➢Usually, computers communicate through the Internet.
➢The packet transmitted by the sending computer may pass through several LANs or WANs
before reaching the destination computer.
➢The network layer must know the topology of the subnet and choose appropriate paths
through it.
➢When source and destination are in different networks, the network layer (IP) must deal with
these differences.
➢If two system are connected to the same link, there is usually no need for a network layer
Need for Network Layer
There is no provision in the data link(or physical layer) to make the routing decision as the frame
does not carry any routing information.
To solve the problem of delivery through several links, the network layer was designed.
The network layer is responsible for host to host delivery and for routing the packets through
routers and switches
Introduction to IP
IP was designed as a best-effort delivery protocol, but it lacks some features such as flow control
and error control.
It is a host-to-host protocol using logical addressing.
To make IP more responsive to some requirements in today's internetworking, we need the help
of other protocols.
We need protocols to create a mapping between physical and logical addresses.(ARP)
IP packets use logical (host-to-host) addresses. These packets, however, need to be
encapsulated in a frame, which needs physical addresses (node-to-node).
We sometimes need reverse mapping-mapping a physical address to a logical address. (RARP)
Lack of flow and error control in the Internet Protocol has resulted in another protocol, ICMP,
that provides alerts. It reports congestion and some types of errors in the network or
destination host.
Address Mapping
An internet is made of a combination of physical networks connected by internetworking
devices such as routers.
A packet starting from a source host may pass through several different physical networks
before finally reaching the destination host.
The hosts and routers are recognized at the network level by their logical (IP) addresses.
However, packets pass through physical networks to reach these hosts and routers.
At the physical level, the hosts and routers are recognized by their physical addresses.
A physical address is a local address. Its jurisdiction is a local network. It must be unique locally,
but is not necessarily unique universally. It is called a physical address because it is implemented
in hardware.
Address Mapping
The physical address and the logical address are two different identifiers. We need both.
Delivery of a packet to a host or a router requires two levels of addressing: logical and physical.
We need to be able to map a logical address to its corresponding physical address and vice
versa.
These can be done by using either static or dynamic mapping.
Static mapping involves in the creation of a table that associates a logical address with a physical
address. This table is stored in each machine on the network.
Each machine that knows, for example, the IP address of another machine but not its physical
address can look it up in the table.
Static mapping as several limitation as physical address may change due to change in network
card or physical network
To implement these changes, a static mapping table must be updated periodically. This overhead
could affect network performance.
Mapping Logical to Physical Address: ARP
Anytime a host or a router has an IP datagram to send to another host or router, it has the logical
(IP) address of the receiver. The logical (IP) address is obtained from the DNS if the sender is the
host or it is found in a routing table the sender is a router.
But the IP datagram must be encapsulated in a frame to be able to pass through the physical
network. This means that the sender needs the physical address of the receiver. The host or the
router sends an ARP query packet.
The packet includes the physical and IP addresses of the sender and the IP address of the
receiver.
Because the sender does not know the physical address of the receiver, the query is broadcast
over the network.
ARP operation
Mapping Logical to Physical Address: ARP
Every host or router on the network receives and processes the ARP query packet, but only the
intended recipient recognizes its IP address and sends back an ARP response packet.
The response packet contains the recipient's IP and physical addresses. The packet is unicast
directly to the inquirer by using the physical address received in the query packet.
Cache Memory
Using ARP is inefficient if system A needs to broadcast an ARP request for each IP packet it needs
to send to system B. It could have broadcast the IP packet itself.
ARP can be useful if the ARP reply is cached (kept in cache memory for a while) because a system
normally sends several packets to the same destination. A system that receives an ARP reply
stores the mapping in the cache memory and keeps it for 20 to 30 minutes unless the space in
the cache is exhausted. Before sending an ARP request, the system first checks its cache to see if
it can find the mapping.
ARP packet
ARP Packet
o Hardware type. This is a 16-bit field defining the type of the network on which ARP is running. Each
LAN has been assigned an integer based on its type. For example, Ethernet is given type 1. ARP can
be used on any physical network.

o Protocol type. This is a 16-bit field defining the protocol. For example, the value of this field for the
IPv4 protocol is 080016, ARP can be used with any higher-level protocol.

o Hardware length. This is an 8-bit field defining the length of the physical address in bytes. For
example, for Ethernet the value is 6.

o Protocol length. This is an 8-bit field defining the length of the logical address in bytes. For
example, for the IPv4 protocol the value is 4.

o Operation. This is a 16-bit field defining the type of packet. Two packet types are defined: ARP
request (1) and ARP reply (2).
ARP Packet
o Sender hardware address. This is a variable-length field defining the physical address of the sender.
For example, for Ethernet this field is 6 bytes long.

o Sender protocol address. This is a variable-length field defining the logical (for example, IP) address
of the sender. For the IP protocol, this field is 4 bytes long.

o Target hardware address. This is a variable-length field defining the physical address of the target.
For example, for Ethernet this field is 6 bytes long. For an ARP request message, this field is alI 0s
because the sender does not know the physical address of the target.

o Target protocol address. This is a variable-length field defining the logical (for example, IP) address
of the target. For the IPv4 protocol, this field is 4 bytes long.
Encapsulation
An ARP packet is encapsulated directly into a data link frame.

Encapsulation of ARP packet


ARP Process
These are the steps involved in an ARP process:
1. The sender knows the IP address of the target.
2. IP asks ARP to create an ARP request message, filling in the sender physical address, the
sender IP address, and the target IP address. The target physical address field is filled with 0s.
3. The message is passed to the data link layer where it is encapsulated in a frame by using the
physical address of the sender as the source address and the physical broadcast address as the
destination address.
4. Every host or router receives the frame. Because the frame contains a broadcast destination
address, all stations remove the message and pass it to ARP. All machines except the one
targeted drop the packet. The target machine recognizes its IP address.
5. The target machine replies with an ARP reply message that contains its physical address. The
message is unicast.
ARP Process
6. The sender receives the reply message. It now knows the physical address of the target
machine.
7. The IP datagram, which carries data for the target machine, is now encapsulated in a frame
and is unicast to the destination.
The following are four different cases in which the services of ARP can be used
1. The sender is a host and wants to send a packet to another host on the same network. In this
case, the logical address that must be mapped to a physical address is the destination IP address
in the datagram header.
2. The sender is a host and wants to send a packet to another host on another network. In this
case, the host looks at its routing table and finds the IP address of the next hop (router) for this
destination. If it does not have a routing table, it looks for the IP address of the default router.
The IP address of the router becomes the logical address that must be mapped to a physical
address.
ARP Process
3. The sender is a router that has received a datagram destined for a host on another network. It
checks its routing table and finds the IP address of the next router. The IP address of the next
router becomes the logical address that must be mapped to a physical address.
4. The sender is a router that has received a datagram destined for a host on the same network.
The destination IP address of the datagram becomes the logical address that must be mapped to
a physical address.
Four cases using ARP
Mapping Physical to Logical Address
There are occasions in which a host knows its physical address, but needs to know its logical
address. This may happen in two cases:
1. A diskless station is just booted. The station can find its physical address by checking its
interface, but it does not know its IP address.
2. An organization does not have enough IP addresses to assign to each station; it needs to
assign IP addresses on demand. The station can send its physical address and ask for a short
time lease.
RARP
Reverse Address Resolution Protocol (RARP) finds the logical address for a machine that knows only
its physical address.
To create an IP datagram, a host or a router needs to know its own IP address.
A diskless machine just booted from ROM, has minimum booting information and doesn’t include
the IP address because the IP addresses on a network are assigned by the network administrator.
The machine can get its physical address (by reading its NIC) which is unique locally. It can then use
the physical address to get the logical address by using the RARP protocol.
A RARP request is created and broadcast on the local network. Another machine on the local
network that knows all the IP addresses will respond with a RARP reply.
The requesting machine must be running a RARP client program; the responding machine must be
running a RARP server program.
RARP
There is a serious problem with RARP: Broadcasting is done at the data link layer. The physical
broadcast address, as in the case of Ethernet, does not pass the boundaries of a network.
This means that if an administrator has several networks or several subnets, it needs to assign a
RARP server for each network or subnet. This is the reason that RARP is almost obsolete.
DHCP
The Dynamic Host Configuration Protocol (DHCP) has been devised to provide static and dynamic
address allocation that can be manual or automatic.
Static Address Allocation
When a client requests its IP address, the DHCP server consults a table that matches the physical
address of the client with its IP address. This implies that the binding between the physical address
and the IP address of the client already exists.
A host running the DHCP client can request a static address from a DHCP server. A DHCP server has
a database that statically binds physical addresses to IP addresses.
Dynamic Address Allocation
DHCP has a second database with a pool of available IP addresses. This second database makes
DHCP dynamic. When a DHCP client requests a temporary IP address, the DHCP server goes to the
pool of available (unused) IP addresses and assigns an IP address for a negotiable period of time.
DHCP
When a DHCP client sends a request to a DHCP server, the server first checks its static database. If
an entry with the requested physical address exists in the static database, the permanent IP address
of the client is returned.
On the other hand, if the entry does not exist in the static database, the server selects an IP address
from the available pool, assigns the address to the client, and adds the entry to the dynamic
database.
The dynamic aspect of DHCP is needed when a host moves from network to network or is
connected and disconnected from a network (as is a subscriber to a service provider). DHCP
provides temporary IP addresses for a limited time.
The addresses assigned from the pool are temporary addresses. The DHCP server issues a lease for
a specific time. When the lease expires, the client must either stop using the IP address or renew
the lease. The server has the option to agree or disagree with the renewal. If the server disagrees,
the client stops using the address.
ICMP
The IP protocol has no error-reporting or error-correcting mechanism.
What happens if something goes wrong?
What happens if a router must discard a datagram because it cannot find a router to the final
destination, or because the time-to-live field has a zero value?
What happens if the final destination host must discard all fragments of a datagram because it
has not received all fragments within a predetermined time limit?
These are examples of situations where an error has occurred and the IP protocol has no built-in
mechanism to notify the original host.
The Internet Control Message Protocol (ICMP) has been designed to compensate for the above
deficiency. It is a companion to the IP protoco1 that can notify the host or the router about the
errors occurred in the network.
ICMP
ICMP messages are divided into two broad categories:
▪Error-reporting messages,
▪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.
For example, nodes can discover their neighbors. Also, hosts can discover and learn about
routers on their network, and routers can help a node redirect its messages.
Error Reporting Messages
One of the main responsibilities of ICMP is to report errors. Although technology has produced
increasingly reliable transmission media, errors still exist and must be handled.
As IP is connectionless protocol error checking and error control are not a concern of IP.
ICMP was designed, in part, to compensate for this shortcoming.
ICMP does not correct errors-it simply reports them.
Error correction is left to the higher-level protocols.
Error messages are always sent to the original source because the only information available in
the datagram about the route is the source and destination IP addresses.
ICMP uses the source IP address to send the error message to the source (originator) of the
datagram.
Error Reporting Messages
Error Reporting Messages

You might also like