Protocols-Arp, DHCP, Icmp, Igmp
Protocols-Arp, DHCP, Icmp, Igmp
• The hosts and routers are recognized at the network level by their logical addresses.
• A logical address is an internetwork address.
• Its jurisdiction is universal. A logical address is unique universally.
• It is called a logical address because it is usually implemented in software.
• Every protocol that deals with interconnecting networks requires logical addresses.
• The logical addresses in the TCP/IP protocol suite are called IP addresses and are 32 bits long.
• 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 should be unique locally, but not necessarily universally.
• It is called a physical address because it is usually (but not always) implemented in hardware.
Examples of physical addresses are 48-bit MAC addresses in the Ethernet protocol, which are
imprinted on the NIC installed in the host or router.
y p e s o fA R P T
T a b le
• Static Mapping
• Dynamic mapping.
• Static Mapping
• Static mapping means creating a table that associates a logical address with a
physical address.
• This table is stored in each machine on the network.
• This has some limitations because physical addresses may change in the following
ways:
1. A machine could change its NIC, resulting in a new physical address.
2. In some LANs, such as LocalTalk (Mac Computer based LAN), the physical
address changes every time the computer is turned on.
3. A mobile computer can move from one physical network to another, resulting in a
change in its physical address.
• To implement these changes, a static mapping table must be updated periodically.
• This overhead could affect network performance.
• Dynamic Mapping
• In dynamic mapping, each time a machine knows the logical address
of another machine, it can use a protocol to find the physical address.
• Two protocols have been designed to perform dynamic mapping:
-Address Resolution Protocol (ARP) and
-Reverse Address Resolution Protocol (RARP).
• ARP maps a logical address to a physical address;
• RARP maps a physical address to a logical address.
• Since RARP is replaced with another protocol (DHCP)
ARP PROTOCOL
• 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.
• 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. A
mapping corresponds a logical address to a physical address.
• Figure 8.1 shows the position of the ARP in the TCP/IP protocol suite.
• ARP accepts a logical address from the IP protocol, maps the address to the
corresponding physical address and pass it to the data link layer.
ARP Packet Format
ARP packet fields are as follows:
❑ 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 the type 1. ARP can be used on any physical
network.
❑ 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.
❑ 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.
❑ Protocol length: This is an 8-bit field defining the length of the logical
Contd..
❑ Operation: This is a 16-bit field defining the type of packet. Two packet types are
defined: ARP request (1), ARP reply (2). An ARP request is broadcast; an ARP reply
is unicast.
❑ 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.
❑ 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.
❑ 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 all 0s because the sender does not know the
physical address of the target.
❑ 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.
DHCP (Dynamic Host Configuration Protocol)
• Four pieces of information are normally needed:
1. The IP address of the computer
2. The subnet mask of the computer
3. The IP address of a router
4. The IP address of a name server
DHCP (Dynamic Host Configuration Protocol)
DHCP (Dynamic Host Configuration Protocol)
DHCP OPERATION
• The DHCP client and server can either be on the same network or on
different networks.
Same Network
Although the
practice is not
very common,
the administrator
may put the
client and the
server on the
same network.
Different Networks
As in other application-layer processes, a client can be in one network and the server in
another, separated by several other networks.
DHCP Packet Fields
The following briefly describes each field:
❑ Operation code: This 8-bit field defines the type of DHCP packet: request (1) or
reply (2).
Hardware type: This is an 8-bit field defining the type of physical network. Each
type of network has been assigned an integer. For example, for Ethernet the value is 1.
❑ 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.
❑ Hop count. This is an 8-bit field defining the maximum number of hops the packet
can travel.
❑ Transaction ID. This is a 4-byte field carrying an integer. The transaction
identification
is set by the client and is used to match a reply with the request.
The server returns the same value in its reply.
Contd..
❑ Number of seconds: (TTL) This is a 16-bit field that indicates the
number of seconds elapsed since the time the client started to boot.
• ❑ Flag: This is a 16-bit field in which only the leftmost bit is used
and the rest of the bits should be set to 0s.
• A leftmost bit specifies a forced broadcast reply (instead of unicast)
from the server.
• If the reply were to be unicast to the client, the destination IP address
of the IP packet is the address assigned to the client. Since the client
does not know its IP address, it may discard the packet.
• However, if the IP datagram is broadcast, every host will receive and
process the broadcast message.
❑ Client IP address. This is a 4-byte field that contains the client IP address. If the
client does not have this information, this field has a value of 0.
❑ Your IP address. This is a 4-byte field that contains the client IP address. It is
filled by the server (in the reply message) at the request of the client.
❑ Server IP address. This is a 4-byte field containing the server IP address. It is
filled by the server in a reply message.
❑ Gateway IP address. This is a 4-byte field containing the IP address of a router. It
is filled by the server in a reply message.
❑ Client hardware address. This is the physical address of the client. Although the
server can retrieve this address from the frame sent by the client, it is more efficient
if the address is supplied explicitly by the client in the request message.
❑ Server name. This is a 64-byte field that is optionally filled by the server in a
reply packet.
It contains a null-terminated string consisting of the domain name of the server. If the
server does not want to fill this field with data, the server must fill it with all 0s.
❑ Boot filename. This is a 128-byte field that can be optionally filled by the server
in a reply packet. It contains a null-terminated string consisting of the full pathname
of the boot file. The client can use this path to retrieve other booting information. If the
server does not want to fill this field with data, the server must fill it with all 0s.
❑ Options. This is a 64-byte field with a dual purpose. It can carry either additional
information (such as the network mask or default router address) or some specific
vendor information.
• The field is used only in a reply message. 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. The length
field defines the length of the value field, not the whole option. See Figure 18.6.
Transition States