Chapter_5_V6.01
Chapter_5_V6.01
Chapter_5_V6.01
Chapter 5
our goals:
Link Layer ❖ understand principles behind link layer
services:
▪ error detection, correction
▪ sharing a broadcast channel: multiple access
A note on the use of these ppt slides:
We’re making these slides freely available to all (faculty, students, readers). Computer ▪ link layer addressing
They’re in PowerPoint form so you see the animations; and can add, modify,
and delete slides (including this one) and slide content to suit your needs. Networking: A Top ▪ local area networks: Ethernet, VLANs
They obviously represent a lot of work on our part. In return for use, we only
ask the following: Down Approach ❖ instantiation, implementation of various link
❖ If you use these slides (e.g., in a class) that you mention their source
6th edition
(after all, we’d like people to use our book!)
❖ If you post any slides on a www site, that you note that they are adapted Jim Kurose, Keith Ross layer technologies
from (or perhaps identical to) our slides, and note our copyright of this
material.
Addison-Wesley
March 2012
Thanks and enjoy! JFK/KWR
otherwise
0 0
Channel partitioning MAC protocols: TDMA Channel partitioning MAC protocols: FDMA
TDMA: time division multiple access FDMA: frequency division multiple access
❖ access to channel in "rounds" ❖ channel spectrum divided into frequency bands
❖ each station gets fixed length slot (length = pkt ❖ each station assigned fixed frequency band
trans time) in each round ❖ unused transmission time in frequency bands go idle
❖ unused slots go idle ❖ example: 6-station LAN, 1,3,4 have pkt, frequency bands 2,5,6
❖ example: 6-station LAN, 1,3,4 have pkt, slots idle
2,5,6 idle
frequency bands
6-slot 6-slot
frame frame
1 3 4 1 3 4
FDM cable
!
❖
❖ highly decentralized: only detect collision in less success in a slot = p(1- used for useful
slots in nodes need to be p)N-1 transmissions 37%
in sync than time to transmit
packet ❖ prob that any node has a of time!
❖ simple success = Np(1-p)N-1
❖ clock synchronization
Link Layer 5-25 Link Layer 5-26
CSMA (carrier sense multiple access) CSMA collisions spatial layout of nodes
Downstream channel i
❖ channel partitioning, by time, frequency or code
CMTS ▪ Time Division, Frequency Division
Upstream channel j
❖ random access (dynamic),
▪ ALOHA, S-ALOHA, CSMA, CSMA/CD
t1 t2 Residences with cable modems
▪ carrier sensing: easy in some technologies (wire), hard
Minislots containing Assigned minislots containing cable modem in others (wireless)
minislots request frames upstream data frames
▪ CSMA/CD used in Ethernet
DOCSIS: data over cable service interface spec ▪ CSMA/CA used in 802.11
❖ FDM over upstream, downstream frequency channels ❖ taking turns
❖ TDM upstream: some slots assigned, some have contention ▪ polling from central site, token passing
▪ downstream MAP frame: assigns upstream slots ▪ bluetooth, FDDI, token ring
▪ request for upstream slots (and data) transmitted
random access (binary backoff) in selected slots
Link Layer 5-39 Link Layer 5-40
Link layer, LANs: outline MAC addresses and ARP
5.1 introduction, services 5.5 link virtualization: ❖ 32-bit IP address:
5.2 error detection, MPLS ▪ network-layer address for interface
correction 5.6 data center ▪ used for layer 3 (network layer) forwarding
5.3 multiple access networking ❖ MAC (or LAN or physical or Ethernet) address:
protocols 5.7 a day in the life of a ▪ function: used ‘locally” to get frame from one interface to
5.4 LANs web request another physically-connected interface (same network, in IP-
addressing sense)
▪ addressing, ARP
▪ 48 bit MAC address (for most LANs) burned in NIC
▪ Ethernet ROM, also sometimes software settable
▪ switches ▪ e.g.: 1A-2F-BB-76-09-AD
▪ VLANS
hexadecimal (base 16) notation
(each “number” represents 4 bits)
IP
Eth
Phy
A B A B
R R
111.111.111.111 111.111.111.111
222.222.222.222 222.222.222.222
74-29-9C-E8-FF-55 74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A 49-BD-D2-C7-56-2A
222.222.222.220 222.222.222.220
1A-23-F9-CD-06-9B 1A-23-F9-CD-06-9B
A B A B
R R
111.111.111.111 111.111.111.111
222.222.222.222 222.222.222.222
74-29-9C-E8-FF-55 74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A 49-BD-D2-C7-56-2A
222.222.222.220 222.222.222.220
1A-23-F9-CD-06-9B 1A-23-F9-CD-06-9B
A B A B
R R
111.111.111.111 111.111.111.111
222.222.222.222 222.222.222.222
74-29-9C-E8-FF-55 74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A 49-BD-D2-C7-56-2A
222.222.222.220 222.222.222.220
1A-23-F9-CD-06-9B 1A-23-F9-CD-06-9B
correction 5.6 data center ❖ simpler, cheaper than token LANs and ATM
5.3 multiple access networking ❖ kept up with speed race: 10 Mbps – 10 Gbps
switch
star
bus: coaxial cable
Link Layer 5-55 Link Layer 5-56
Ethernet frame structure (more) Ethernet: unreliable, connectionless
❖ addresses: 6 byte source, destination MAC addresses
▪ if adapter receives frame with matching destination ❖ connectionless: no handshaking between sending and
address, or with broadcast address (e.g. ARP packet), it receiving NICs
passes data in frame to network layer protocol ❖ unreliable: receiving NIC doesnt send acks or nacks
▪ otherwise, adapter discards frame to sending NIC
❖ type: indicates higher layer protocol (mostly IP but ▪ data in dropped frames recovered only if initial
others possible, e.g., Novell IPX, AppleTalk) sender uses higher layer rdt (e.g., TCP), otherwise
❖ CRC: cyclic redundancy check at receiver dropped data lost
▪ error detected: frame is dropped ❖ Ethernet’s MAC protocol: unslotted CSMA/CD wth
binary backoff
type
dest. source data
preamble address address (payload) CRC
802.3 Ethernet standards: link & physical layers Link layer, LANs: outline
❖ many different Ethernet standards
▪ common MAC protocol and frame format 5.1 introduction, services 5.5 link virtualization:
▪ different speeds: 2 Mbps, 10 Mbps, 100 Mbps, 1Gbps, 5.2 error detection, MPLS
10G bps correction 5.6 data center
▪ different physical layer media: fiber, cable 5.3 multiple access networking
protocols 5.7 a day in the life of a
5.4 LANs web request
application
MAC protocol ▪ addressing, ARP
and frame format
transport ▪ Ethernet
network 100BASE-TX 100BASE-T2 100BASE-FX
link
▪ switches
100BASE-T4 100BASE-SX 100BASE-BX
physical ▪ VLANS
A A A’
Q: how does switch know A’ A ❖ switch learns which hosts
can be reached through
reachable via interface 4, B’ B which interfaces C’ B
C’
reachable via interface 5? ▪ when frame received, 6 1 2
❖ A: each switch has a switch 6 1 2 switch “learns”
table, each entry: location of sender: 5 4 3
5 4 3 incoming LAN segment
▪ (MAC address of host, interface to
▪ records sender/location B’ C
reach host, time stamp) B’ C
pair in switch table
▪ looks like a routing table!
A’
A’
Q: how are entries created, switch with six interfaces MAC addr interface TTL
maintained in switch table? (1,2,3,4,5,6) A 1 60 Switch table
(initially empty)
▪ something like a routing protocol?
A A A’
when frame received at switch: ❖ frame destination, A’,
C’ B
locaton unknown: flood
1. record incoming link, MAC address of sending host
1
2. index switch table using MAC destination address ❖ destination A location 6 2
S1 S1
S3 S3
A S2 A S2
F F
D I D I
B C B C
G H G H
E E
Q: sending from A to G - how does S1 know to ❖ Q: show switch tables and packet forwarding in S1, S2, S3, S4
forward frame destined to F via S4 and S3?
❖ A: self learning! (works exactly the same as in
single-switch case!)
Link Layer 5-67 Link Layer 5-68
8
9
10
15
16
EE, but wants connect to
CS switch? switch(es) supporting
VLAN capabilities can … …
❖ single broadcast domain:
be configured to
▪ all layer-2 broadcast Electrical Engineering Computer Science
define multiple virtual (VLAN ports 1-8) (VLAN ports 9-15)
traffic (ARP, DHCP,
unknown location of
LANS over single … operates as multiple virtual switches
Computer
Computer physical LAN
Science Electrical Engineering
destination MAC
Engineering address) must cross infrastructure. 1 7 9 15
entire LAN 2 8 10 16
▪ security/privacy, … …
efficiency issues
Electrical Engineering Computer Science
(VLAN ports 1-8) (VLAN ports 9-16)
1-8 2 8 10 16 2 4 6 8
2 8 10 16
Electrical Engineering Computer Science Ports 2,3,5 belong to EE VLAN
❖ dynamic membership: ports (VLAN ports 1-8) (VLAN ports 9-15) Ports 4,6,7,8 belong to CS VLAN
preamble dest.
address
source
address
data (payload) CRC
802.1 frame
5.1 introduction, services 5.5 link virtualization:
5.2 error detection, MPLS
type
correction 5.6 data center
preamble dest. source data (payload) CRC 802.1Q frame 5.3 multiple access networking
address address
protocols 5.7 a day in the life of a
5.4 LANs web request
2-byte Tag Protocol Identifier
(value: 81-00)
Recomputed ▪ addressing, ARP
CRC
▪ Ethernet
▪ switches
Tag Control Information (12 bit VLAN ID field,
3 bit priority field like IP TOS)
▪ VLANS
20 3 1 5
Link Layer 5-77 Link Layer 5-78
R6
0 0
D
RSVP-TE 1 1
R6 R4 R3
D R5
R4 0 0
A
R5 modified R2 in outR1 out
link state label label dest interface
A in out out
flooding label label dest interface 6 - A 0
8 6 A 0
Link Layer 5-81 Link Layer 5-82
Tier-1 switches
B
Tier-2 switches
A C Tier-2 switches
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
Link layer, LANs: outline Synthesis: a day in the life of a web request
❖ journey down protocol stack complete!
5.1 introduction, services 5.5 link virtualization: ▪ application, transport, network, link
5.2 error detection, MPLS
❖ putting-it-all-together: synthesis!
correction 5.6 data center ▪ goal: identify, review, understand protocols (at all
5.3 multiple access networking layers) involved in seemingly simple scenario:
protocols 5.7 a day in the life of a requesting www page
5.4 LANs web request ▪ scenario: student attaches laptop to campus network,
requests/receives www.google.com
▪ addressing, ARP
▪ Ethernet
▪ switches
▪ VLANS
A day in the life… connecting to the Internet A day in the life… ARP (before DNS, before HTTP)
DHCP DHCP ❖ DHCP server formulates DNS DNS ❖ before sending HTTP request, need
DHCP UDP DHCP ACK containing DNS UDP IP address of www.google.com:
DHCP IP client’s IP address, IP DNS
ARP
IP DNS
DHCP Eth address of first-hop router ARP query Eth
Phy for client, name & IP Phy ❖ DNS query created, encapsulated in
address of DNS server UDP, encapsulated in IP,
❖ encapsulation at DHCP encapsulated in Eth. To send frame
DHCP server, frame forwarded ARP
to router, need MAC address of
DHCP ARP reply Eth
DHCP UDP (switch learning) through Phy router interface: ARP
DHCP IP LAN, demultiplexing at
DHCP Eth router client router ❖ ARP query broadcast, received by
Phy (runs DHCP)
❖ DHCP client receives (runs DHCP) router, which replies with ARP
DHCP
DHCP ACK reply reply giving MAC address of
router interface
❖ client now knows MAC address
Client now has IP address, knows name & addr of DNS of first hop router, so can now
server, IP address of its first-hop router send frame containing DNS
query
Link Layer 5-91 Link Layer 5-92
A day in the life… using DNS DNS A day in the life…TCP connection carrying HTTP
DNS UDP DNS server
DNS IP HTTP
DNS DNS DNS Eth HTTP
DNS UDP DNS Phy
SYNACK
SYN TCP
DNS IP SYNACK
SYN IP
DNS Eth SYNACK
SYN Eth
Phy Phy
DNS
Comcast network
68.80.0.0/13
❖ to send HTTP request,
client first opens TCP socket
to web server
❖ IP datagram forwarded from
router router ❖ TCP SYN segment (step 1 in 3-
(runs DHCP) campus network into comcast (runs DHCP)
way handshake) inter-domain
network, routed (tables created SYNACK
SYN TCP
❖ IP datagram containing DNS SYNACK
SYN IP routed to web server
query forwarded via LAN by RIP, OSPF, IS-IS and/or BGP SYNACK
SYN Eth
switch from client to 1st hop routing protocols) to DNS server Phy ❖ web server responds with TCP
router SYNACK (step 2 in 3-way
❖ demux’ed to DNS server
web server handshake)
❖ DNS server replies to client 64.233.169.105
with IP address of ❖ TCP connection established!
www.google.com Link Layer 5-93 Link Layer 5-94