Unit3 - Network Layer Protocols
Unit3 - 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.