0% found this document useful (0 votes)
11 views15 pages

Data Link Later

Uploaded by

mr.jhion.adbar
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)
11 views15 pages

Data Link Later

Uploaded by

mr.jhion.adbar
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/ 15

Data Link Layer

Sub Layers of Data Link Layer:


(1) Logical Link Control (LLC) Sublayer
§ Responsible for managing communication between the
network layer and the data link layer.
§ Provides error checking and control, as well as flow
control.
§ Allows multiple network protocols to operate over the
same physical medium.
(2) Media Access Control (MAC) Sublayer
§ Manages protocol access to the physical network medium.
§ Determines how devices on the network communicate
and access the shared medium.
§ Handles addressing and the framing of data packets

Data Link Layer 5-1


MAC addresses and ARP
MAC Address:
v A hardware address unique to each network interface card (NIC).
v It's used to identify devices locally on the same network
(like in your home Wi-Fi network).
v Operates at Layer 2 (Data Link Layer) of the OSI model.
v It’s a physical address assigned by the manufacturer, usually
unchangeable.
v MAC address allocation administered by IEEE
v manufacturer buys portion of MAC address space (to assure
uniqueness)
v Format: 48 bits, typically written as 00:1A:2B:3C:4D:5E.
hexadecimal (base 16) notation
(each “numeral” represents 4 bits)

6-2
LAN addresses and ARP
each adapter on LAN has unique LAN address

1A-2F-BB-76-09-AD

LAN
(wired or adapter
wireless)
71-65-F7-2B-08-53
58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

Link Layer and LANs 6-3


ARP
What is ARP?
§ Address Resolution Protocol (ARP) is a network protocol
used to map an IP address (Layer 3 address) to a device's
MAC address (Layer 2 address) on a local network.
Why is ARP Needed?
• When a device (like your computer) wants to
communicate with another device on the same network,
it uses the destination device's IP address to identify it.
However, actual data transmission over Ethernet (or other
local networks) relies on the MAC address.
• Since devices only know the IP address but need the MAC
address to actually send data, ARP is used to find out the
MAC address associated with a given IP address.
Data Link Layer 5-4
ARP protocol: same LAN

Link Layer and LANs 6-5


ARP protocol: same LAN

ARP table: each IP node (host, router) on LAN has table


• IP/MAC address mappings for some LAN nodes:
< IP address; MAC address; TTL>
• TTL (Time To Live): time after which address mapping will be
forgotten (typically 20 min)

Data Link Layer 5-6


ARP protocol: same LAN
ARP Table Check
§ Every host and router maintains an ARP table containing
mappings of IP addresses to MAC addresses.
§ If a host (e.g., 222.222.222.220) wants to send data to
another host on the same subnet, it first checks its ARP
table for an entry with the destination IP address.
When Entry Exists
§ If the ARP table already has the corresponding MAC
address, it uses that entry to send the data directly.
When Entry Does Not Exist
§ If there’s no entry for the destination (e.g., sending data to
222.222.222.222), the host needs to find the MAC address
using the ARP protocol.

Data Link Layer 5-7


ARP protocol: same LAN
§ The host constructs an ARP request packet that includes
its own IP and MAC address along with the destination IP
address it’s looking to resolve.
Broadcasting the ARP Request
§ The ARP request is sent as a broadcast to all devices on
the subnet using the special MAC address FF-FF-FF-FF-FF-
FF.
§ This is like shouting in a room: "Who has IP address
222.222.222.222? Please send me your MAC address.“
Receiving the ARP Response:
§ All devices on the subnet receive the broadcast. Each
device checks if the requested IP matches its own.

Data Link Layer 5-8


ARP protocol: same LAN
§ The device with the matching IP (e.g., 222.222.222.222)
sends an ARP response back to the sender
(222.222.222.220) with its MAC address.
Updating ARP Table and Sending Data:
§ The sender (222.222.222.220) updates its ARP table with
the new IP-to-MAC mapping.
§ It then sends its original data, encapsulated in a frame
addressed to the MAC address obtained from the ARP
response.

Data Link Layer 5-9


ARP protocol: Different Subnet

5-10
ARP protocol: Different Subnet
Host 111.111.111.111 Wants to Send a Datagram to
Host 222.222.222.222:
§ Host 111.111.111.111 needs to send an IP datagram to
222.222.222.222 on a different subnet.
§ The sending host knows that 222.222.222.222 is not on
the same subnet (111.111.111.0/24), so it needs to send
the datagram via its default gateway (the router).
ARP Lookup for the Router's MAC Address:
§ Before Host 111.111.111.111 can send the datagram, it
needs to find the MAC address of its default gateway
(111.111.111.110).

Data Link Layer 5-11


ARP protocol: Different Subnet
§ Host 111.111.111.111 checks its ARP table for the MAC
address of 111.111.111.110.If the entry is not found, Host
111.111.111.111 sends an ARP request to all devices on
Subnet 1 (broadcasting to FF-FF-FF-FF-FF-FF).
§ The router interface 111.111.111.110 responds with its
MAC address (E6-E9-00-17-BB-4B).Host 111.111.111.111
updates its ARP table with this information.
Sending the Datagram to the Router
§ Host 111.111.111.111 creates a frame containing the IP
datagram destined for 222.222.222.222.
§ The frame’s destination MAC address is set to the
router’s MAC address (E6-E9-00-17-BB-4B).
Data Link Layer 5-12
ARP protocol: Different Subnet
§ The IP header still has the destination IP address as
222.222.222.222, but the frame is physically sent to the
router at 111.111.111.110.
Router Forwards the Datagram to Subnet 2
§ The router receives the frame and checks the destination
IP address (222.222.222.222).The router uses its routing
table to determine that it needs to forward the datagram
through its interface on Subnet 2 (222.222.222.220).
ARP Lookup on Subnet 2
§ The router now needs the MAC address of the
destination host 222.222.222.222. The router checks its
ARP table for the MAC address of 222.222.222.222.

Data Link Layer 5-13


ARP protocol: Different Subnet
§ If the entry is not found, the router sends an ARP request
on Subnet 2.Host 222.222.222.222 responds with its MAC
address (49-BD-D2-C7-56-2A), and the router updates its
ARP table.
Sending the Datagram to Host 222.222.222.222:
§ The router encapsulates the IP datagram in a new frame.
The frame’s destination MAC address is set to 49-BD-D2-
C7-56-2A (the MAC address of 222.222.222.222).
§ The router sends the frame into Subnet 2.

Data Link Layer 5-14


ARP protocol: Different Subnet
Final Delivery:
§ Host 222.222.222.222 receives the frame, sees
that its MAC address matches, and processes the
enclosed IP datagram.

Data Link Layer 5-15

You might also like