Network Layer (ARP, RARP, ICMP, IGMP)
Network Layer (ARP, RARP, ICMP, IGMP)
1
Address Mapping
The physical address and the logical address are two different identifiers.
We need both because a packet at a network layer (such as IP) may pass
through physical networks (such as Ethernet and LocalTalk (Apple)).
126
Static mapping
Each machine on the network stores a table that associates a logical
address with a physical address.
Each machine that knows, for example, the IP address of another machine
but not its physical address can look it up in the table.
This has some limitations because physical addresses may change in the
following ways:
2. A mobile computer can move from one physical network to another, resulting
in a change in its physical address.
128
Address Resolution Protocol (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 if the sender is a router.
This means that the sender needs the physical address of the receiver.
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.
129
ARP Operation
6
ARP packet
7
ARP packet
Hardware type: This is 16 bits field defining the type of the
network on which ARP is running. Ethernet is given type 1.
10
Operation: 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. 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.
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
11 in a frame and is unicast to the destination.
There are four cases in which a host or router needs to use ARP
12
Example:
A host with IP address 130.23.43.20 and physical address B2:34:55:10:22:10
has a packet to send to another host with IP address 130.23.43.25 and
physical address A4:6E:F4:59:83:AB. The two hosts are on the same
Ethernet network. Show the ARP request and reply packets encapsulated in
Ethernet frames.
13
Proxy ARP
Proxy ARP is used to create a subnetting effect. Where ARP acts on behalf
of a set of hosts.
14
RARP
15
Reverse Address Resolution Protocol
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.
16
RARP
RARP Packet
Same as that of ARP except operation field (3 for RARP
request and 4 for RARP reply)
18
Encapsulation of RARP Packet
An ARP packet is encapsulated directly into a data link frame
(Ethernet frame).
19
ICMP
20
Internet Control Message Protocol
IP provides unreliable, connectionless datagram delivery
21
Types of Messages
Two broad categories:
Error-reporting messages and
Query messages.
22
General format of ICMP messages
If there is no additional
data, there are 4 bytes
set to zero.
Each ICMP messages is
at least 8 bytes long
Instead, the messages are first encapsulated inside IP datagrams before going
to the lower layer
24
Error Reporting Messages
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
25
Error Reporting Messages
The host A modifies its routing table to send future packets to the
destination via router R2.
Query messages
ICMP can diagnose some network problems. This is accomplished through
the four query messages.
In this type of ICMP message, a node sends a message that is answered in a
specific format by the destination node.
A query message is encapsulated in an IP packet, which in tum is
encapsulated in a data link layer frame.
29
Query messages
30
Echo request and reply
Used by network managers and users for diagnosing network problems
Tests for the “reachability” of a host
Used to implement the PING command
An echo-request message can be sent by a host or router.
An echo-reply message is sent by the host or router which receives
an echo-request message
Echo-request and echo-reply messages can be used by network managers
to check the operation of the IP protocol..
31
Timestamp request and reply
Used by two machines to determine the roundtrip time for an IP datagram
to travel between them
Also used to synchronize the clocks in two machines
Format contains three timestamps, each 32-bits
Represents time (in milliseconds) from midnight in Universal Time
32
Timestamp request and reply
Timestamp-request
Timestamp-reply
34
Router solicitation message format
Hosts need to know addresses of routers
Routers reply with all routers they are aware of including themselves
(Sometimes reply without request)
35
Router advertisement message format
Preference level is used to select default router
36
IGMP
37
Internet Group Management Protocol
Multicasting
Processes may have to send the same message to a large numbers of
receivers simultaneously. This is called multicasting, which is a one-to-many
communication
Examples:
Distance learning and Video-on-demand
IGMP is one of the necessary but not sufficient protocol for multicasting
38
IGMP: Group Management
For multicasting in the Internet we need routers that are able to route
multicast packets.
In any network, there are one or more multicast routers that distribute
multicast packets to hosts or other routers.
The IGMP protocol gives the information about the membership status of
hosts (routers) connected to the network to multicast routers
39
IGMP: Group Management
A multicast router may receive thousands of multicast packets every day
for different groups.
A better solution is to keep a list of groups in the network for which there
is at least one loyal member.
IGMP helps the multicast router create and update this list.
40
IGMP Message Types
IGMP messages are carried in bare IP packets with IP protocol number 2.
41
IGMP Message Types
There are several types of IGMP messages:
Query:
General membership queries: Sent by multicast routers to determine which
multicast addresses are of interest to systems attached to the network(s) they serve to
refresh the group membership state for all systems on its network.
Special Query:
1. Group-specific membership queries: Used for determining the reception state for
a particular multicast address
2. Group-and-source-specific queries: Allow the router to determine if any systems
desire reception of messages sent to a multicast group from a source address specified
in a list of unicast addresses
• R is distributing router
• R1 & R2 are multicast routers
• Possibly receive packets from R
• Forward to other networks but
not on this network
44
Joining a Group
A host or router can join a group
Host Joining a group:
The host receives requests from processes to join a group
If no previous request from another process, a membership report message is sent
Otherwise, no membership report need be sent as the host already receives
multicast packets for this group
The protocol requires that the membership report be sent twice, one after
the other within a few moments.
In this way, if the first one is lost or damaged, the second one replaces it.
46
Leaving a Group
When a host sees that no process is interested in a specific group, it sends a
leave report.
Similarly, when a router sees that none of the networks connected to its
interfaces is interested in a specific group, it sends a leave report about that
group.
When a multicast router receives a leave report, it cannot immediately purge
that group from its list because the report comes from just one host / router;
there may be other hosts or routers that are still interested in that group.
To make sure, the router sends a special query message and inserts the
groupid, or multicast address, related to the group.
The router allows a specified time for any host or router to respond.
If, during this time, no interest (membership report) is received, the router
assumes that there are no loyal members in the network and purges the
group from its list.
Leave report
48
Query Router
Query messages may create a lot of responses.
Only this designated router sends the query message, and the other
routers are passive (they receive responses and update their lists)
49
Encapsulation at Network Layer
50
Encapsulation at Data Link Layer
The ARP protocol cannot find the corresponding MAC (physical) address
to forward the packet at the data link layer.
53
Example 2
Change the multicast IP address 238.212.24.9 to an Ethernet multicast
address.
Solution
01:00:5E:54:18:09
54