Transcript ppt
Chapter 5: Link Layer
5.1 Introduction and
services
5.2 Error detection
and correction
5.3Multiple access
protocols
5.4 Link-Layer
Addressing (ARP)
5.5 Ethernet
5.6 Link-layer switches
5.7 PPP
5.8 Link Virtualization:
ATM, MPLS
5: DataLink Layer
5-1
ARP: Address Resolution Protocol
Question: how to determine
MAC address of B
knowing B’s IP address?
137.196.7.78
1A-2F-BB-76-09-AD
137.196.7.23
Each IP node (host,
router) on LAN has
ARP table
ARP table: IP/MAC
address mappings for
some LAN nodes
137.196.7.14
LAN
71-65-F7-2B-08-53
137.196.7.88
< IP address; MAC address; TTL>
58-23-D7-FA-20-B0
TTL (Time To Live): time
after which address
mapping will be forgotten
(typically 20 min)
0C-C4-11-6F-E3-98
5: DataLink Layer
5-2
ARP protocol: Same LAN (network)
A wants to send datagram
to B, and B’s MAC address
not in A’s ARP table.
A broadcasts ARP query
packet, containing B's IP
address
dest MAC address = FFFF-FF-FF-FF-FF
all machines on LAN
receive ARP query
B receives ARP packet,
replies to A with its (B's)
MAC address
frame sent to A’s MAC
address (unicast)
A caches (saves) IP-to-
MAC address pair in its
ARP table until information
becomes old (times out)
soft state: information
that times out (goes
away) unless refreshed
ARP is “plug-and-play”:
nodes create their ARP
tables without
intervention from net
administrator
5: DataLink Layer
5-3
Addressing: routing to another LAN
walkthrough: send datagram from A to B via R
assume A knows B’s IP address
88-B2-2F-54-1A-0F
74-29-9C-E8-FF-55
A
111.111.111.111
E6-E9-00-17-BB-4B
1A-23-F9-CD-06-9B
222.222.222.220
111.111.111.110
111.111.111.112
R
222.222.222.221
222.222.222.222
B
49-BD-D2-C7-56-2A
CC-49-DE-D0-AB-7D
two ARP tables in router R, one for each IP
network (LAN)
5: DataLink Layer
5-4
A creates IP datagram with source A, destination B
A uses ARP to get R’s MAC address for 111.111.111.110
A creates link-layer frame with R's MAC address as dest,
frame contains A-to-B IP datagram
This is a really important
A’s NIC sends frame
example – make sure you
understand!
R’s NIC receives frame
R removes IP datagram from Ethernet frame, sees its
destined to B
R uses ARP to get B’s MAC address
R creates frame containing A-to-B IP datagram sends to B
88-B2-2F-54-1A-0F
74-29-9C-E8-FF-55
A
E6-E9-00-17-BB-4B
111.111.111.111
222.222.222.220
111.111.111.110
111.111.111.112
222.222.222.221
1A-23-F9-CD-06-9B
R
222.222.222.222
B
49-BD-D2-C7-56-2A
CC-49-DE-D0-AB-7D
5: DataLink Layer
5-5
Chapter 4: Network Layer
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 What’s inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing (DHCP)
ICMP
IPv6
4.5 Routing algorithms
Link state
Distance Vector
Hierarchical routing
4.6 Routing in the
Internet
RIP
OSPF
BGP
4.7 Broadcast and
multicast routing
5: DataLink Layer
5-6
DHCP: Dynamic Host Configuration Protocol
Goal: allow host to dynamically obtain its IP address
from network server when joining network
support for mobile users joining network
host holds address only while connected and “on”
(allowing address reuse)
renew address already in use
DHCP overview:
1. host broadcasts “DHCP discover” msg
2. DHCP server responds with “DHCP offer” msg
3. host requests IP address: “DHCP request” msg
4. DHCP server sends address: “DHCP ack” msg
5: DataLink Layer
5-7
DHCP client-server scenario
A
B
223.1.2.1
DHCP
server
223.1.1.1
223.1.1.2
223.1.1.4
223.1.2.9
223.1.2.2
223.1.1.3
223.1.3.1
223.1.3.27
223.1.3.2
E
arriving DHCP
client needs
address in this
(223.1.2/24) network
5: DataLink Layer
5-8
DHCP client-server scenario
DHCP server: 223.1.2.5
DHCP discover
arriving
client
src : 0.0.0.0, 68
dest.: 255.255.255.255,67
yiaddr: 0.0.0.0
transaction ID: 654
DHCP offer
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 654
Lifetime: 3600 secs
DHCP request
time
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
yiaddrr: 223.1.2.4
transaction ID: 655
Lifetime: 3600 secs
DHCP ACK
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 655
Lifetime: 3600 secs
5: DataLink Layer
5-9