0% found this document useful (0 votes)
11 views

Chapter 3 Data-Link

Uploaded by

anvabinh123
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 views

Chapter 3 Data-Link

Uploaded by

anvabinh123
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/ 18

Chapter 5: Link layer

Chapter 2
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

All material copyright 1996-2012


J.F Kurose and K.W. Ross, All Rights Reserved

Link Layer 5-1 Link Layer 5-2

Link layer, LANs: outline Link layer: introduction


terminology:
5.1 introduction, services 5.5 link virtualization:  hosts and routers: nodes
5.2 error detection, MPLS  communication channels that global ISP

correction 5.6 data center connect adjacent nodes along


5.3 multiple access networking communication path: links
protocols 5.7 a day in the life of a  wired links
web request  wireless links
5.4 LANs
 LANs
 addressing, ARP
 layer-2 packet: frame,
 Ethernet encapsulates datagram
 switches
 VLANS data-link layer has responsibility of
transferring datagram from one node
to physically adjacent node over a link
Link Layer 5-3 Link Layer 5-4

1
Link layer: context Link layer services
 datagram transferred by transportation analogy:  framing, link access:
different link protocols over  trip from Princeton to Lausanne  encapsulate datagram into frame, adding header, trailer
different links:  limo: Princeton to JFK  channel access if shared medium
 e.g., Ethernet on first link,  plane: JFK to Geneva  “MAC” addresses used in frame headers to identify
frame relay on  train: Geneva to Lausanne source, dest
intermediate links, 802.11  tourist = datagram • different from IP address!
on last link  transport segment =  reliable delivery between adjacent nodes
 each link protocol provides communication link  we learned how to do this already (chapter 3)!
different services  transportation mode = link  seldom used on low bit-error link (fiber, some twisted
 e.g., may or may not layer protocol pair)
provide rdt over link  travel agent = routing  wireless links: high error rates
algorithm • Q: why both link-level and end-end reliability?

Link Layer 5-5 Link Layer 5-6

Link layer services (more) Where is the link layer implemented?


 in each and every host
 flow control:  link layer implemented in
 pacing between adjacent sending and receiving nodes “adaptor” (aka network
 error detection: interface card NIC) or on a
chip
 errors caused by signal attenuation, noise. application

 receiver detects presence of errors:  Ethernet card, 802.11 transport


network cpu memory
card; Ethernet chipset link
• signals sender for retransmission or drops frame
 implements link, physical
 error correction: layer controller
host
bus
(e.g., PCI)
 receiver identifies and corrects bit error(s) without resorting to link
retransmission  attaches into host’s system physical
physical
buses transmission
 half-duplex and full-duplex  combination of hardware,
 with half duplex, nodes at both ends of link can transmit, but not
at same time software, firmware network adapter
card

Link Layer 5-7 Link Layer 5-8

2
Adaptors communicating Link layer, LANs: outline
5.1 introduction, services 5.5 link virtualization:
datagram datagram
5.2 error detection, MPLS
controller controller
correction 5.6 data center
5.3 multiple access networking
sending host receiving host
datagram protocols 5.7 a day in the life of a
frame 5.4 LANs web request
 addressing, ARP
 sending side:  receiving side
 Ethernet
 encapsulates datagram in  looks for errors, rdt,
frame flow control, etc  switches
 adds error checking bits,  extracts datagram, passes  VLANS
rdt, flow control, etc. to upper layer at
receiving side
Link Layer 5-9 Link Layer 5-10

Error detection Parity checking


EDC= Error Detection and Correction bits (redundancy)
single bit parity: two-dimensional bit parity:
D = Data protected by error checking, may include header fields
 detect single bit  detect and correct single bit errors
errors
• Error detection not 100% reliable!
• protocol may miss some errors, but rarely
• larger EDC field yields better detection and correction

otherwise

0 0

Link Layer 5-11 Link Layer 5-12

3
Internet checksum (review) Cyclic redundancy check
 more powerful error-detection coding
goal: detect “errors” (e.g., flipped bits) in transmitted packet
(note: used at transport layer only)  view data bits, D, as a binary number
 choose r+1 bit pattern (generator), G
sender: receiver:  goal: choose r CRC bits, R, such that
 treat segment contents  compute checksum of  <D,R> exactly divisible by G (modulo 2)
as sequence of 16-bit received segment  receiver knows G, divides <D,R> by G. If non-zero remainder:
integers  check if computed
error detected!
 checksum: addition (1’s checksum equals checksum  can detect all burst errors less than r+1 bits
complement sum) of field value:  widely used in practice (Ethernet, 802.11 WiFi, ATM)
segment contents  NO - error detected
 sender puts checksum  YES - no error detected.
value into UDP But maybe errors
checksum field nonetheless?

Link Layer 5-13 Link Layer 5-14

CRC example Link layer, LANs: outline


want:
5.1 introduction, services 5.5 link virtualization:
D.2r XOR R = nG MPLS
equivalently: 5.2 error detection,
correction 5.6 data center
D.2r = nG XOR R networking
equivalently: 5.3 multiple access
protocols 5.7 a day in the life of a
if we divide D.2r by web request
G, want remainder R 5.4 LANs
to satisfy:  addressing, ARP
 Ethernet
D . 2r  switches
R = remainder[ ]
G  VLANS

Link Layer 5-15 Link Layer 5-16

4
Multiple access links, protocols Multiple access protocols
two types of “links”:
 single shared broadcast channel
 point-to-point
 two or more simultaneous transmissions by nodes:
 PPP for dial-up access
interference
 point-to-point link between Ethernet switch, host
 collision if node receives two or more signals at the same
 broadcast (shared wire or medium) time
 old-fashioned Ethernet
 upstream HFC
 802.11 wireless LAN multiple access protocol
 distributed algorithm that determines how nodes share
channel, i.e., determine when node can transmit
 communication about channel sharing must use channel itself!
 no out-of-band channel for coordination

shared wire (e.g., shared RF shared RF humans at a


cabled Ethernet) (e.g., 802.11 WiFi) (satellite) cocktail party
(shared air, acoustical)

Link Layer 5-17 Link Layer 5-18

An ideal multiple access protocol MAC protocols: taxonomy


three broad classes:
given: broadcast channel of rate R bps
 channel partitioning
desiderata:  divide channel into smaller “pieces” (time slots, frequency, code)
1. when one node wants to transmit, it can send at rate R.  allocate piece to node for exclusive use
2. when M nodes want to transmit, each can send at average  random access
rate R/M  channel not divided, allow collisions
3. fully decentralized:  “recover” from collisions
• no special node to coordinate transmissions  “taking turns”
• no synchronization of clocks, slots  nodes take turns, but nodes with more to send can take longer
turns
4. simple

Link Layer 5-19 Link Layer 5-20

5
Random access protocols Slotted ALOHA
 when node has packet to send assumptions: operation:
 transmit at full channel data rate R.  all frames same size  when node obtains fresh
 no a priori coordination among nodes  time divided into equal size frame, transmits in next slot
 two or more transmitting nodes ➜ “collision”, slots (time to transmit 1  if no collision: node can send
 random access MAC protocol specifies: frame) new frame in next slot
 how to detect collisions  nodes start to transmit  if collision: node retransmits
 how to recover from collisions (e.g., via delayed only slot beginning frame in each subsequent
retransmissions)  nodes are synchronized slot with prob. p until
 examples of random access MAC protocols:  if 2 or more nodes transmit success
 slotted ALOHA in slot, all nodes detect
 ALOHA collision
 CSMA, CSMA/CD, CSMA/CA

Link Layer 5-21 Link Layer 5-22

Slotted ALOHA Slotted ALOHA: efficiency


node 1 1 1 1 1

efficiency: long-run  max efficiency: find p* that


node 2 2 2 2
fraction of successful slots maximizes
node 3 3 3 3 (many nodes, all with many Np(1-p)N-1
frames to send)  for many nodes, take limit
C E C S E C E S S of Np*(1-p*)N-1 as N goes
Pros: Cons:  suppose: N nodes with to infinity, gives:
many frames to send, each max efficiency = 1/e = .37
 single active node can  collisions, wasting slots transmits in slot with
continuously transmit at  idle slots probability p
full rate of channel

!
 nodes may be able to  prob that given node has at best: channel
 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-23 Link Layer 5-24

6
Pure (unslotted) ALOHA Pure ALOHA efficiency
P(success by given node) = P(node transmits) .
 unslotted Aloha: simpler, no synchronization
P(no other node transmits in [t0-1,t0] .
 when frame first arrives P(no other node transmits in [t0-1,t0]
 transmit immediately
 collision probability increases: = p . (1-p)N-1 . (1-p)N-1
 frame sent at t0 collides with other frames sent in [t0- = p . (1-p)2(N-1)
1,t0+1]
… choosing optimum p and then letting n

= 1/(2e) = .18

even worse than slotted Aloha!

Link Layer 5-25 Link Layer 5-26

CSMA (carrier sense multiple access) CSMA collisions spatial layout of nodes

CSMA: listen before transmit:  collisions can still occur:


propagation delay means
if channel sensed idle: transmit entire frame two nodes may not hear
 if channel sensed busy, defer transmission each other’s
transmission
 collision: entire packet
 human analogy: don’t interrupt others! transmission time
wasted
 distance & propagation
delay play role in in
determining collision
probability

Link Layer 5-27 Link Layer 5-28

7
CSMA/CD (collision detection) CSMA/CD (collision detection)
CSMA/CD: carrier sensing, deferral as in CSMA spatial layout of nodes
 collisions detected within short time
 colliding transmissions aborted, reducing channel wastage
 collision detection:
 easy in wired LANs: measure signal strengths, compare
transmitted, received signals
 difficult in wireless LANs: received signal strength
overwhelmed by local transmission strength
 human analogy: the polite conversationalist

Link Layer 5-29 Link Layer 5-30

Ethernet CSMA/CD algorithm CSMA/CD efficiency


1. NIC receives datagram 4. If NIC detects another  Tprop = max prop delay between 2 nodes in LAN
from network layer, transmission while  ttrans = time to transmit max-size frame
creates frame transmitting, aborts and
2. If NIC senses channel sends jam signal
idle, starts frame 5. After aborting, NIC 1
efficiency 
transmission. If NIC enters binary (exponential) 1  5t prop /t trans
senses channel busy, backoff:  efficiency goes to 1
waits until channel idle,  after mth collision, NIC  as tprop goes to 0
then transmits. chooses K at random  as ttrans goes to infinity
3. If NIC transmits entire from {0,1,2, …, 2m-1}.
NIC waits K·512 bit  better performance than ALOHA: and simple, cheap,
frame without detecting
times, returns to Step 2 decentralized!
another transmission,
NIC is done with frame !  longer backoff interval
with more collisions
Link Layer 5-31 Link Layer 5-32

8
“Taking turns” MAC protocols “Taking turns” MAC protocols
channel partitioning MAC protocols: polling:
 share channel efficiently and fairly at high load  master node “invites”
 inefficient at low load: delay in channel access, 1/N slave nodes to transmit data
bandwidth allocated even if only 1 active node! in turn poll
 typically used with
random access MAC protocols “dumb” slave devices master
 efficient at low load: single node can fully utilize  concerns:
data
channel
 polling overhead
 high load: collision overhead
 latency
“taking turns” protocols  single point of slaves
look for best of both worlds! failure (master)

Link Layer 5-33 Link Layer 5-34

“Taking turns” MAC protocols Cable access network


Internet frames,TV channels, control transmitted
token passing: downstream at different frequencies
T
 control token passed cable headend
from one node to next
sequentially. CMTS

 token message (nothing splitter cable
 concerns: to send) cable modem … modem
termination system
 token overhead T
ISP
 latency upstream Internet frames, TV control, transmitted
upstream at different frequencies in time slots
 single point of failure
(token)  multiple 40Mbps downstream (broadcast) channels
 single CMTS transmits into channels
 multiple 30 Mbps upstream channels
data  multiple access: all users contend for certain upstream
Link Layer 5-35
channel time slots (others assigned)

9
Cable access network Summary of MAC protocols
cable headend MAP frame for
Interval [t1, t2]

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-37 Link Layer 5-38

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)

Link Layer 5-39 Link Layer 5-40

10
LAN addresses and ARP LAN addresses (more)
each adapter on LAN has unique LAN address
 MAC address allocation administered by IEEE
 manufacturer buys portion of MAC address space
1A-2F-BB-76-09-AD (to assure uniqueness)
 analogy:
 MAC address: like Social Security Number
LAN  IP address: like postal address
(wired or adapter
wireless)  MAC flat address ➜ portability
71-65-F7-2B-08-53
58-23-D7-FA-20-B0  can move LAN card from one LAN to another
 IP hierarchical address not portable
0C-C4-11-6F-E3-98
 address depends on IP subnet to which node is
attached

Link Layer 5-41 Link Layer 5-42

ARP: address resolution protocol ARP protocol: same LAN


Question: how to determine  A wants to send datagram
interface’s MAC address, to B
 B’s MAC address not in  A caches (saves) IP-to-
knowing its IP address? ARP table: each IP node (host, A’s ARP table. MAC address pair in its
router) on LAN has table  A broadcasts ARP query ARP table until
137.196.7.78
 IP/MAC address packet, containing B's IP information becomes old
mappings for some LAN address (times out)
1A-2F-BB-76-09-AD
nodes:  dest MAC address = FF-FF-  soft state: information that
137.196.7.23
137.196.7.14 < IP address; MAC address; TTL> FF-FF-FF-FF times out (goes away)
unless refreshed
 TTL (Time To Live):  all nodes on LAN receive
LAN time after which address ARP query  ARP is “plug-and-play”:
71-65-F7-2B-08-53 mapping will be  B receives ARP packet,  nodes create their ARP
58-23-D7-FA-20-B0
forgotten (typically 20 replies to A with its (B's) tables without intervention
from net administrator
min) MAC address
0C-C4-11-6F-E3-98
137.196.7.88
 frame sent to A’s MAC
address (unicast)
Link Layer 5-43 Link Layer 5-44

11
Addressing: routing to another LAN Addressing: routing to another LAN
walkthrough: send datagram from A to B via R  A creates IP datagram with IP source A, destination B
 focus on addressing – at IP (datagram) and MAC layer (frame)  A creates link-layer frame with R's MAC address as dest, frame
contains A-to-B IP datagram
 assume A knows B’s IP address
 assume A knows IP address of first hop router, R (how?) MAC src: 74-29-9C-E8-FF-55
MAC dest: E6-E9-00-17-BB-4B
 assume A knows R’s MAC address (how?) IP src: 111.111.111.111
IP dest: 222.222.222.222

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

111.111.111.112 111.111.111.110 222.222.222.221 111.111.111.112 111.111.111.110 222.222.222.221


CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 88-B2-2F-54-1A-0F CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 88-B2-2F-54-1A-0F

Link Layer 5-45 Link Layer 5-46

Addressing: routing to another LAN Addressing: routing to another LAN


 frame sent from A to R  R forwards datagram with IP source A, destination B
 frame received at R, datagram removed, passed up to IP  R creates link-layer frame with B's MAC address as dest, frame
contains A-to-B IP datagram
MAC src: 74-29-9C-E8-FF-55 MAC src: 1A-23-F9-CD-06-9B
MAC dest: E6-E9-00-17-BB-4B
IP src: 111.111.111.111 MAC dest: 49-BD-D2-C7-56-2A
IP dest: 222.222.222.222
IP src: 111.111.111.111 IP src: 111.111.111.111
IP dest: 222.222.222.222 IP dest: 222.222.222.222
IP
IP IP IP Eth
Eth Eth Eth Phy
Phy Phy 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

111.111.111.112 111.111.111.110 222.222.222.221 111.111.111.112 111.111.111.110 222.222.222.221


CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 88-B2-2F-54-1A-0F CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 88-B2-2F-54-1A-0F

Link Layer 5-47 Link Layer 5-48

12
Addressing: routing to another LAN Addressing: routing to another LAN
 R forwards datagram with IP source A, destination B  R forwards datagram with IP source A, destination B
 R creates link-layer frame with B's MAC address as dest, frame  R creates link-layer frame with B's MAC address as dest, frame
contains A-to-B IP datagram contains A-to-B IP datagram
MAC src: 1A-23-F9-CD-06-9B
MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A
MAC dest: 49-BD-D2-C7-56-2A IP src: 111.111.111.111
IP src: 111.111.111.111 IP dest: 222.222.222.222
IP dest: 222.222.222.222
IP IP
IP Eth Eth
Eth Phy Phy
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

111.111.111.112 111.111.111.110 222.222.222.221 111.111.111.112 111.111.111.110 222.222.222.221


CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 88-B2-2F-54-1A-0F CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 88-B2-2F-54-1A-0F

Link Layer 5-49 Link Layer 5-50

Link layer, LANs: outline Ethernet


“dominant” wired LAN technology:
5.1 introduction, services 5.5 link virtualization:  cheap $20 for NIC

5.2 error detection, MPLS  first widely used LAN technology

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

protocols 5.7 a day in the life of a


5.4 LANs web request
 addressing, ARP
 Ethernet
 switches
 VLANS

Metcalfe’s Ethernet sketch


Link Layer 5-51 Link Layer 5-52

13
Ethernet: physical topology Ethernet frame structure
 bus: popular through mid 90s
 all nodes in same collision domain (can collide with each
other) sending adapter encapsulates IP datagram (or other
 star: prevails today network layer protocol packet) in Ethernet frame
type
 active switch in center
dest. source data
preamble address address CRC
 each “spoke” runs a (separate) Ethernet protocol (nodes (payload)

do not collide with each other)


preamble:
 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011
 used to synchronize receiver, sender clock rates

switch
star
bus: coaxial cable
Link Layer 5-53 Link Layer 5-54

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
preamble address address data CRC
(payload)

Link Layer 5-55 Link Layer 5-56

14
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

copper (twister fiber physical layer


pair) physical layer
Link Layer 5-57 Link Layer 5-58

Ethernet switch Switch: multiple simultaneous transmissions


 link-layer device: takes an active role
 store, forward Ethernet frames  hosts have dedicated, direct A
connection to switch
 examine incoming frame’s MAC address,  switches buffer packets C’ B
selectively forward frame to one-or-more
 Ethernet protocol used on each
outgoing links when frame is to be forwarded on incoming link, but no collisions;
6 1 2
segment, uses CSMA/CD to access segment full duplex 4
5 3
 transparent  each link is its own collision
B’ C
 hosts are unaware of presence of switches domain
 plug-and-play, self-learning  switching: A-to-A’ and B-to-B’
can transmit simultaneously, A’
 switches do not need to be configured without collisions switch with six interfaces
(1,2,3,4,5,6)

Link Layer 5-59 Link Layer 5-60

15
Switch forwarding table Switch: self-learning Source: A
Dest: A’

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 B’ C
 records sender/location
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?

Link Layer 5-61 Link Layer 5-62

Self-learning, forwarding: example Source: A


Dest: A’
Interconnecting switches
A A A’
 switches can be connected together
 frame destination, A’,
B
locaton unknown: flood C’
S4

 destination A location 6 1 2 S1
S3
S2
known: selectively send A A’
5 4 3
A
F
D I
C
on just one link B’ C
B
G H
E
A’ A

A’
Q: sending from A to G - how does S1 know to
MAC addr interface TTL forward frame destined to F via S4 and S3?
A 1 60 switch table  A: self learning! (works exactly the same as in
(initially empty)
A’ 4 60 single-switch case!)
Link Layer 5-63 Link Layer 5-64

16
Self-learning multi-switch example Institutional network
Suppose C sends frame to I, I responds to C

mail server
S4 to external
network
S1 web server
S3 router
A S2
F
D I
B C
E G H IP subnet

 Q: show switch tables and packet forwarding in S1, S2, S3, S4

Link Layer 5-65 Link Layer 5-66

Switches vs. routers VLANs: motivation


application
transport
both are store-and-forward: consider:
datagram network
 routers: network-layer frame link  CS user moves office to
devices (examine network- physical link frame EE, but wants connect to
layer headers) physical CS switch?
 switches: link-layer devices  single broadcast domain:
(examine link-layer switch
headers)  all layer-2 broadcast
network datagram traffic (ARP, DHCP,
both have forwarding tables: link frame Computer
unknown location of
physical Science
Computer
destination MAC
 routers: compute tables Electrical
Engineering
Engineering
address) must cross
using routing algorithms, IP application
addresses entire LAN
transport
 switches: learn forwarding network  security/privacy,
table using flooding, link efficiency issues
learning, MAC addresses physical

Link Layer 5-67 Link Layer 5-68

17
port-based VLAN: switch ports
VLANs grouped (by switch management
software) so that single physical
Chapter 2: Summary
switch ……  principles behind data link layer services:
Virtual Local
Area Network
1

2
7

8
9

10
15

16
 error detection, correction
switch(es) supporting  sharing a broadcast channel: multiple access
VLAN capabilities can … …  link layer addressing
be configured to Electrical Engineering Computer Science  instantiation and implementation of various link
define multiple virtual (VLAN ports 1-8) (VLAN ports 9-15)
layer technologies
LANS over single … operates as multiple virtual switches  Ethernet
physical LAN
 switched LANS, VLANs
infrastructure. 1

2
7

8
9

10
15

16
 virtualized networks as a link layer: MPLS
 synthesis: a day in the life of a web request
… …

Electrical Engineering Computer Science


(VLAN ports 1-8) (VLAN ports 9-16)

Link Layer 5-69 Link Layer 5-70

Chapter 5: let’s take a breath


 journey down protocol stack complete (except
PHY)
 solid understanding of networking principles,
practice
 ….. could stop here …. but lots of interesting
topics!
 wireless
 multimedia
 security
 network management

Link Layer 5-71

18

You might also like