[go: up one dir, main page]

0% found this document useful (0 votes)
355 views28 pages

Address Mapping

addresss mapping notes computer networks

Uploaded by

amaansss503
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
355 views28 pages

Address Mapping

addresss mapping notes computer networks

Uploaded by

amaansss503
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

ADDRESS MAPPING

Mapping Logical to Physical Address: ARP


• 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.
• 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.
ARP packet
• 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.
• 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 address in bytes. For example, for
the IPv4 protocol the value is 4.
• Operation. This is a 16-bit field defining the type of packet. Two packet types are defined: ARP request
(1) and ARP reply (2).
• 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 alIOs 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.
• An ARP packet is encapsulated directly into a data link
frame. For example, in Figure an ARP packet is
Encapsulation encapsulated in an Ethernet frame. Note that the type
field indicates that the data carried by the frame are an
ARP packet.
Operation
• Let us see how ARP functions on a typical internet. First we describe the steps involved. Then
we discuss the four cases in which a host or router needs to use ARP. These are the steps
involved in an ARP process:
• The sender knows the IP address of the target. We will see how the sender obtains this
shortly.
• 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
Os.
• 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.
• 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.
• The target machine replies with an ARP reply message that contains its physical address. The
message is unicast.
• The sender receives the reply message. It now knows the physical address of the target
machine.
• The IP datagram, which carries data for the target machine, is now encapsulated in a frame
and is unicast to the destination.
Four Different Cases
• 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.
• 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. Ifit 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.
• 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.
• 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: RARP,
BOOTP, and DHCP
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. Each host or router
is assigned one or more logical (IP) addresses, which are unique and
independent of the physical (hardware) address of the machine. To
create an IP datagram, a host or a router needs to know its own IP
address or addresses. The IP address of a machine is usually read from
its configuration file stored on a disk file.
• However, a diskless machine is usually booted from ROM, which has
minimum booting information. The ROM is installed by the
manufacturer. It cannot 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, for
example), 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.
BOOTP
• The Bootstrap Protocol (BOOTP) is a client/server protocol
designed to provide physical address to logical address mapping.
BOOTP is an application layer protocol. The administrator may put
the client and the server on the same network or on different
networks, as shown in Figure. BOOTP messages are encapsulated
in a UDP packet, and the UDP packet itself is encapsulated in an
IP packet.
• The reader may ask how a client can send an IP datagram when it
knows neither its own IP address (the source address) nor the
server's IP address (the destination address). The client simply
uses all as 0s the source address and all 1s as the destination
address.
DHCP
• BOOTP is not a dynamic configuration protocol. When a client
requests its IP address, the BOOTP 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. The binding is predetermined.
• However, what if a host moves from one physical network to
another? What if a host wants a temporary IP address? BOOTP
cannot handle these situations because the binding between the
physical and IP addresses is static and fixed in a table until
changed by the administrator. BOOTP is a static configuration
protocol.
• The Dynamic Host Configuration Protocol (DHCP) has been
devised to provide static and dynamic address allocation that can
be manual or automatic.
DHCP provides static and dynamic address allocation that can
be manual or automatic.
• Static Address Allocation In this capacity DHCP acts as BOOTP
does. It is backward compatible with BOOTP, which means a host
running the BOOTP 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.
ICMP
• The IP protocol has no error-reporting or error-correcting
mechanism.
• The IP protocol also lacks a mechanism for host and
management queries. A host sometimes needs to
determine if a router or another host is alive. And
sometimes a network administrator needs information
from another host or router.
• The Internet Control Message Protocol (ICMP) has been
designed to compensate for the above two deficiencies. It
is a companion to the IP protoco1.
Types of 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. 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.
Message • An ICMP message has an 8-byte header and a variable-size
data section. Although the general format of the header is

Format different for each message type, the first 4 bytes are
common to all. As Figure 21.8 shows, the first field, ICMP
type, defines the type of message. The code field specifies
the reason for the particular message type. The last
common field is the checksum field. The rest of the header
is specific for each message type.
• ICMP always reports error messages to
Error Reporting the original source.
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 IeMP 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.
Destination Unreachable

• When a router cannot route a datagram or a host cannot


deliver a datagram, the datagram is discarded and the
router or the host sends a destination-unreachable
message back to the source host that initiated the
datagram. Note that destination-unreachable messages
can be created by either a router or the destination host
Source Quench
• If the datagrams are received much faster than they can be
forwarded or processed, the queue may overflow. In this case, the
router or the host has no choice but to discard some of the
datagrams. The source-quench message in ICMP was designed to
add a kind of flow control to the IP. When a router or host discards
a datagram due to congestion, it sends a source-quench message
to the sender of the datagram. This message has two purposes:
• First, it informs the source that the datagram has been discarded.
• Second, it warns the source that there is congestion somewhere in the
path and that the source should slow down (quench) the sending
process.
Time Exceeded
• The time-exceeded message is generated in two cases:
• Routers use routing tables to find the next hop (next router) that must
receive the packet. If there are errors in one or more routing tables, a
packet can travel in a loop or a cycle, going from one router to the next or
visiting a series of routers endlessly. As we saw in Chapter 20, each
datagram contains a field called time to live that controls this situation.
When a datagram visits a router, the value of this field is decremented by
1. When the time-to-live value reaches 0, after decrementing, the router
discards the datagram. However, when the datagram is discarded, a time-
exceeded message must be sent by the router to the original source.
• Second, a time-exceeded message is also generated when not all
fragments that make up a message arrive at the destination host within a
certain time limit.
Parameter Problem
• Any ambiguity in the header part of a datagram can Create serious
problems as the datagram travels through the Internet. If a router
or the destination host discovers an ambiguous or missing value
in any field of the datagram, it discards the datagram and sends a
parameter-problem message back to the source.
Redirection
• For efficiency, hosts do not take part in the routing update process
because there are many more hosts in an internet than routerS.
Updating the routing tables of hosts dynamically produces
unacceptable traffic. The hosts usually use static routing.
• In this case, the router that receives the datagram will forward the
datagram to the correct router. However, to update the routing
table of the host, it sends a redirection message to the host.
• In addition to error reporting, ICMP can
Query diagnose some network problems. This is
accomplished through the query
messages, a group of four different pairs
of messages,
Echo Request and Reply
• The echo-request and echo-reply messages are designed for
diagnostic purposes. Network managers and users utilize this pair
of messages to identify network problems. The combination of
echo-request and echo-reply messages determines whether two
systems (hosts or routers) can communicate with each other.
Timestamp Request and Reply
• Two machines (hosts or routers) can use the timestamp request
and timestamp reply messages to determine the round-trip time
needed for an IP datagram to travel between them. It can also be
used to synchronize the clocks in two machines.
Address-Mask Request and Reply
• A host may know its IP address, but it may not know the
corresponding mask. For example, a host may know its IP address
as 159.31.17.24, but it may not know that the corresponding mask
is /24. To obtain its mask, a host sends an address-mask-request
message to a router on the LAN.
Router Solicitation and Advertisement
• A host that wants to send data to a host on another network needs to
know the address of routers connected to its own network. Also, the
host must know if the routers are alive and functioning. The router-
solicitation and router-advertisement messages can help in this
situation.
• A host can broadcast (or multicast) a router-solicitation message. The
router or routers that receive the solicitation message broadcast their
routing information using the router-advertisement message.
• A router can also periodically send router-advertisement messages
even if no host has solicited. Note that when a router sends out an
advertisement, it announces not only its own presence but also the
presence of all routers on the network of which it is aware.

You might also like