Title: 5a1
1Chapter 5 The Data Link Layer
- Our goals
- understand principles behind data link layer
services - error detection, correction
- sharing a broadcast channel multiple access
- link layer addressing
- reliable data transfer, flow control done!
- instantiation and implementation of various link
layer technologies
2Link Layer
- 5.1 Introduction and services
- 5.2 Error detection and correction
- 5.3Multiple access protocols
- 5.4 Link-Layer Addressing
- 5.5 Ethernet
- 5.6 Hubs and switches
- 5.7 PPP
- 5.8 Link Virtualization ATM and MPLS
3Link Layer Introduction
- Some terminology
- hosts and routers are nodes
- communication channels that connect adjacent
nodes along communication path are links - wired links
- wireless links
- LANs
- 2-PDU is a frame, encapsulates datagram
data-link layer has responsibility of
transferring datagram from one node to adjacent
node over a link
4Link layer context
- transportation analogy
- trip from Princeton to Lausanne
- limo Princeton to JFK
- plane JFK to Geneva
- train Geneva to Lausanne
- tourist datagram
- transport segment communication link
- transportation mode link layer protocol
- travel agent routing algorithm
- Datagram transferred by different link protocols
over different links - e.g., Ethernet on first link, frame relay on
intermediate links, 802.11 on last link - Each link protocol provides different services
- e.g., may or may not provide rdt over link
5Link Layer Services
- framing
- encapsulate datagram into frame, adding header,
trailer - link access
- implement channel access if shared medium,
- physical addresses used in frame headers to
identify source, dest - different from IP address!
- reliable delivery between two physically
connected devices - we learned how to do this already (chapter 3)
- seldom used on low bit error link (fiber, some
twisted pair) - wireless links high error rates
- Q why both link-level and end-end reliability?
6Link Layer Services (cont.)
- flow control
- pacing between sender and receivers
- error detection
- errors caused by signal attenuation, noise
- receiver detects presence of errors
- signals sender for retransmission or drops frame
- error detection is a very common service among
link-layer protocols - error correction
- receiver identifies and corrects bit error(s)
without resorting to retransmission - ATM provides link-layer error correction for the
packet header rather than for the entire packet - half-duplex and full-duplex
- with half duplex, nodes at both ends of link can
transmit, but not at same time
7Adaptors Communicating
- link layer implemented in adaptor (aka NIC)
- Ethernet card, PCMCI card, 802.11 card
- sending side
- encapsulates datagram in a frame
- adds error checking bits, rdt, flow control, etc.
- receiving side
- looks for errors, rdt, flow control, etc
- extracts datagram, passes to rcving node
- adapter is semi-autonomous
- link physical layers
8Link Layer
- 5.1 Introduction and services
- 5.2 Error detection and correction
- 5.3Multiple access protocols
- 5.4 Link-Layer Addressing
- 5.5 Ethernet
- 5.6 Hubs and switches
- 5.7 PPP
- 5.8 Link Virtualization ATM
9Error Detection
- EDC Error Detection and Correction bits
(redundancy) - D Data protected by error checking, may
include header fields - Error detection not 100 reliable!
- protocol may miss some errors, but rarely
- larger EDC field yields better detection and
correction
10Parity Checking
- single bit parity
- odd parity, even parity
- detect single bit errors
- e.g., one-bit even parity
- two dimensional bit parity
- detect and correct single bit errors
- can also detect (but not correct!) any
combination of two errors - e.g., two-dimensional even parity
- forward error correction (FEC)
- ability of the receiver to both detect and
correct errors - potentially important advantage for real-time
network applications
11Internet checksum
- Goal
- detect errors (e.g., flipped bits) in
transmitted segment - used at TCP, UDP, IP header
- Sender
- treat segment contents as sequence of 16-bit
integers - checksum addition (1s complement sum) of
segment contents - sender puts 1's complement of this sum into
checksum field
- Receiver
- 1's complement sum is computed over the same set
of octets, including the checksum field. - if the result is all 1 bits (- 0 in 1's
complement arithmetic), - NO - error detected
- YES - no error detected. But maybe errors
nonetheless?
12Cyclic Redundancy Check (CRC)
- a.k.a. polynomial codes
- view data bits, D, as a binary number
- choose r1 bit pattern (generator), G
- goal choose r CRC bits, R, such that
- ltD,Rgt exactly divisible by G
- receiver knows G, divides ltD,Rgt by G.
- if non-zero remainder error detected!
- can detect all burst errors less than r1 bits
and any odd number of bit errors - modulo 2 arithmetic
- widely used in practice (ATM, HDLC)
13CRC Example
- want
- D.2r XOR R nG
- equivalently
- D.2r nG XOR R
- equivalently
- if we divide D.2r by G, want reminder R
- 8-bit CRC is used to protect the 5-byte header in
ATM cells - CRC-32 32-bit standard, which has been adopted in
a number of link-level IEEE protocols, uses a
generator - GCRC-32 100000100110000010001110110110111
14Link Layer
- 5.1 Introduction and services
- 5.2 Error detection and correction
- 5.3Multiple access protocols
- 5.4 Link-Layer Addressing
- 5.5 Ethernet
- 5.6 Hubs and switches
- 5.7 PPP
- 5.8 Link Virtualization ATM
15Multiple Access Links and Protocols
- Two types of links
- point-to-point link
- PPP for dial-up access
- point-to-point link between Ethernet switch and
host - broadcast link shared wire or medium
- traditional Ethernet
- upstream HFC
- 802.11 wireless LAN
16Multiple Access protocols
- single shared broadcast channel
- two or more simultaneous transmissions by nodes
interference - only one node can send successfully at a time
- collision if node receives two or more signals at
the same time - multiple access problem how to coordinate the
access of multiple sending and receiving nodes to
a shared broadcast channel - 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
- what to look for in multiple access protocols
- synchronous or asynchronous
- information needed about other stations
- robustness (e.g., to channel errors)
- performance
17Multiple Access Protocols (cont.)
- claim humans use multiple access protocols all
the time - as humans, we've evolved an elaborate set of
protocols for sharing the broadcast channel - give everyone a chance to speak
- don't speak until you are spoken to
- don't monopolize the conversation
- raise your hand if you have a question
- don't interrupt when someone is speaking
- don't fall asleep when someone else is talking
- you can also "guess" multiple access protocols
18MAC Protocols a taxonomy
- Three broad classes
- Channel partitioning protocols
- divide channel into smaller pieces (time slots,
frequency, code) - allocate piece to node for exclusive use
- Random access protocols
- channel not divided, allow collisions
- recover from collisions
- Taking-turns protocols
- Nodes take turns, but nodes with more to send can
take longer turns
19Ideal Multiple Access Protocol
- desirable characteristics
- assume broadcast channel of rate R bps
- when only one node has data to send, that node
has a throughput of R bps - when M nodes have data to send, each of these
nodes has a throughput of R/M bps - protocol is fully decentralized
- no special node to coordinate transmissions
- no synchronization of clocks, slots
- protocol is simple, so that it is inexpensive to
implement
20Channel Partitioning MAC Protocols TDM
- partition of broadcast channel's bandwidth
- TDM (Time Division Multiplexing) channel divided
into N time slots, one per user - FDM (Frequency Division Multiplexing) frequency
subdivided - TDM time division multiplexing
- each station gets fixed length slot (length
packet trans time) in each round - it eliminates collisions and is perfectly fair
- node must always wait for its turn in the
transmission sequence - unused slots go idle
- example 6-station LAN, 1,3,4 have pkt, slots
2,5,6 idle
time slot
21Channel Partitioning MAC Protocols FDM
- FDM frequency division multiplexing
- channel spectrum divided into frequency bandwidth
- each station assigned fixed frequency bandwidth
- unused transmission time in frequency bands go
idle - example 6-station LAN, 1,3,4 have packet,
frequency bandwidth 2,5,6 idle
time
frequency bands
22Random Access Protocols
- When node has packet to send
- transmit at full channel data rate R.
- no a priori coordination among nodes
- two or more transmitting nodes ? collision
- each node waits a random delay before
retransmitting the frame - random access MAC protocol specifies
- how to detect collisions
- how to recover from collisions (e.g., via delayed
retransmissions) - examples of random access MAC protocols
- slotted ALOHA
- ALOHA
- CSMA, CSMA/CD, CSMA/CA
23Slotted ALOHA
- Assumptions
- all frames same size
- time is divided into equal size slots, time to
transmit 1 frame - nodes start to transmit frames only at beginning
of slots - nodes are synchronized
- if 2 or more nodes transmit in slot, all nodes
detect collision
- Operation
- when node obtains fresh frame, it transmits in
next slot - no collision, node can send new frame in next
slot - if collision, node retransmits frame in each
subsequent slot with prob. p until success
24Slotted ALOHA
- Cons
- collisions, wasting slots
- idle slots
- nodes may be able to detect collision in less
than time to transmit packet - clock synchronization
- Pros
- single active node can continuously transmit at
full rate of channel - highly decentralized
- only slots in nodes need to be in sync
- simple
25Slotted Aloha efficiency
Efficiency is the long-run fraction of successful
slots when there is many nodes, each with many
frames to send
- Q what is max fraction of successful slots?
- A suppose N stations have packets to send
- each transmits in slot with probability p
- probability that a single node has a success is
- S p (1-p)N-1
- because there are N nodes, the probability that
an arbitrary node has a success is - S Prob (only one transmits)
- N p (1-p)N-1
- p that maximizes the efficiency for N nodes
- S N p (1-p)N-1 (1 -
1/N)N-1 - 1/e 0.37 as N ? infinity
- 37 of slots do useful work. thus the effective
transmission rate of the channel is not R bps but
only 0.37 R bps! - 37 of the slots go empty and 26 of slots have
collisions
26Pure (unslotted) ALOHA
- unslotted Aloha simpler, no synchronization
- when frame first arrives
- transmit immediately without waiting for
beginning of slot - collision probability increases
- frame sent at t0 collides with other frames sent
in t0-1,t01
27Pure Aloha (cont.)
- P(success by a given node) P(node transmits)
-
P(no other node transmits in p0-1, p0) -
P(no other node transmits in p0, p01) -
p (1 - p)N-1 (1 - p)N-1 p (1 - p)2(N-1) - P(success by any of N nodes) N p . (1 -
p)2(N-1) - 1/(2e) 0.18 . . . choosing optimum p as N ?
infinity
S throughput (success rate)
28CSMA Carrier Sense Multiple Access
- CSMA listen before transmit
- if channel sensed idle transmit entire pkt
- if channel sensed busy, defer transmission
- 1-persistent CSMA when a station has data to
send, it first listens to the channel to see if
anyone else is transmitting at that moment. if
the channel is busy, the station waits until it
becomes idle. when the station detects an idle
channel, it transmits a frame. if a collision
occurs, the station waits a random amount of time
and starts all over again. - non-persistent CSMA retry after random interval
if the channel is already busy - p-persistent CSMA retry immediately with
probability p when channel becomes idle. it
applies to slotted channels - human analogy dont interrupt others!
29CSMA collisions
spatial layout of nodes
collisions can still occur propagation delay
means two nodes may not hear each others
transmission
collision entire packet transmission time wasted
note role of distance propagation delay in
determining collision probability
30CSMA/CD (Collision Detection)
- CSMA/CD carrier sense multiple access with
collision detection - carrier sensing, deferral as in CSMA
- collisions detected within short time
- colliding transmissions aborted, reducing channel
wastage - persistent or non-persistent retransmission
- collision detection
- easy in wired LANs measure signal strengths,
compare transmitted, received signals - difficult in wireless LANs receiver shut off
while transmitting - human analogy the polite conversationalist
31CSMA/CD collision detection
32Taking-turns protocols
- channel partitioning MAC protocols
- share channel efficiently at high load
- inefficient at low load delay in channel access,
1/N bandwidth allocated even if only 1 active
node! - random access MAC protocols
- efficient at low load single node can fully
utilize channel - high load collision overhead
- taking-turns protocols
- look for best of both worlds!
33Taking Turns MAC protocols
- Token passing
- control token passed from one node to next
sequentially. - token message
- concerns
- token overhead
- latency
- single point of failure (token)
-
- Polling
- master node invites slave nodes to transmit in
turn - Request to Send, Clear to Send msgs
- concerns
- polling overhead
- latency
- single point of failure (master)
34Reservation-based protocols
- Distributed Polling
- time divided into slots
- begins with N short reservation slots
- reservation slot time equal to channel end-end
propagation delay - station with message to send post reservation
- reservation seen by all stations
- after reservation slots, message transmissions
ordered by known priority
35 Summary of MAC Protocols
- what do you do with a shared media?
- channel partitioning, by time, frequency, or code
- time division, frequency division, code division,
- random access (dynamic)
- ALOHA, S-ALOHA, CSMA, CSMA/CD
- carrier sensing easy in some technologies
(wire), hard in others (wireless) - CSMA/CD used in Ethernet
- taking turns
- polling from a central site, token passing
36LAN technologies
- Data link layer so far
- services, error detection/correction, multiple
access - Next LAN technologies
- addressing
- Ethernet
- hubs, switches
- PPP
37Link Layer
- 5.1 Introduction and services
- 5.2 Error detection and correction
- 5.3Multiple access protocols
- 5.4 Link-Layer Addressing
- 5.5 Ethernet
- 5.6 Hubs and switches
- 5.7 PPP
- 5.8 Link Virtualization ATM
38LAN Addresses and ARP
- 32-bit IP address
- network-layer address
- used to get datagram to destination network
(recall IP network definition) - LAN address
- it is variously called physical address, Ethernet
address, or MAC (media access control) address - used to get datagram from one adapter to another
physically-connected adapter (same network) - six-bytes long (for most LANs), giving 248
possible LAN addresses - these six-byte addresses are typically expressed
in hexadecimal notation e.g., 49-BD-D2-C7-56-2A - adapter's LAN address is permanent -- when an
adapter is manufactured, a LAN address is burned
into the adapter's ROM.
39LAN Addresses and ARP (cont.)
Each adapter on LAN has unique LAN address
Broadcast address FF-FF-FF-FF-FF-FF
adapter
40LAN Addresses and ARP (cont.)
- MAC address allocation administered by IEEE
- manufacturer buys portion of MAC address space
(to assure uniqueness) - analogy
- MAC address like social security number
- IP address like postal address
- MAC flat address --gt portability
- can move LAN card from one LAN to another
- IP hierarchical address NOT portable
- depends on network to which one attaches
- LAN broadcast address is a string of 48
consecutive 1s FF-FF-FF-FF-FF-FF
41Recall earlier routing discussion
- starting at A, given IP datagram addressed to B
- look up net. address of B, find B on same net. as
A - link layer send datagram to B inside link-layer
frame
frame dest, source address
datagram source, dest address
As IP addr
Bs IP addr
Bs MAC addr
As MAC addr
IP payload
datagram
frame
42ARP Address Resolution Protocol
Question how to determine MAC address of B given
Bs IP address?
- each IP node (host, router) on LAN has ARP
module and table - ARP table IP/MAC address mappings for some LAN
nodes - lt IP address1 MAC address1 TTL1gt
- lt IP address2 MAC address2 TTL2gt
- TTL (time to live) time after which address
mapping will be forgotten (typically 20 min)
43ARP Protocol
- A wants to send datagram to B, and A knows Bs IP
address. - sppose Bs MAC address is not in As ARP table.
- A passes an ARP query packet to the adapter along
with an indication that the adapter should send
the packet to the LAN broadcast address
(FF-FF-FF-FF-FF-FF) - broadcasts ARP query pkt, containing B's IP
address - all machines on LAN receive ARP query
- B receives ARP packet, replies to A with its
(B's) physical layer address - frame sent to As MAC address (unicast)
- A caches (saves) IP-to-physical address pairs
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
44Routing to another LAN
- walkthrough send datagram from A to B via R
- assume A knows B IP address
- A creates IP packet with source A, destination B
- in routing table at source host, find router
111.111.111.110 - A uses ARP to get Rs LAN address for
111.111.111.110
45- in ARP table at source, find LAN address
E6-E9-00-17-BB-4B - A creates Ethernet frame with R's physical
address as dest, Ethernet frame contains A-to-B
IP datagram - As data link layer sends Ethernet frame to R
- Rs data link layer receives Ethernet frame from
A - R removes IP datagram from Ethernet frame, sees
it is destined to B - R uses ARP to get Bs physical address
- two ARP tables in router R, one for each IP
network (LAN) - R creates frame containing A-to-B IP datagram
- Rs data link layer sends Ethernet frame to B
46DHCP Dynamic Host Configuration Protocol
- Goal allow host to dynamically obtain its IP
address from network server when it joins network - can renew its lease on address in use
- allows reuse of addresses
- support for mobile users who want to join network
(more shortly) dynamically get address
plug-and-play - DHCP overview 4-step process
- DHCP sever discovery client broadcasts to locate
available servers - DHCP server offer(s) server to client in
response to DHCP discover with offer of
configuration parameters. client receives one or
more DHCP offer messages from one or more servers
- DHCP request client message to servers either
(a) requesting offered parameters from one server
and implicitly declining offers from all others,
(b) confirming correctness of previously
allocated address after, e.g., system reboot, or
(c) extending the lease on a particular network
address. - DHCPACK server to client with configuration
parameters, including committed network address
47DHCP client-server scenario
223.1.2.1
DHCP
223.1.1.1
server
223.1.1.2
223.1.2.9
223.1.1.4
223.1.2.2
arriving DHCP client needs address in
this network
223.1.1.3
223.1.3.27
223.1.3.2
223.1.3.1
48DHCP client-server scenario
DHCP server 223.1.2.5
arriving client
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
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
time
time
49Link Layer
- 5.1 Introduction and services
- 5.2 Error detection and correction
- 5.3Multiple access protocols
- 5.4 Link-Layer Addressing
- 5.5 Ethernet
- 5.6 Hubs and switches
- 5.7 PPP
- 5.8 Link Virtualization ATM
50Ethernet
- dominant LAN technology, first widely deployed
high-speed LAN technology - token ring, FDDI, and ATM are more complex and
expensive than Ethernet - kept up with speed race 10 10Gbps
- since it has been so popular, Ethernet hardware
has become a commodity and is remarkably cheap
(20 for 100Mbs!) - the low cost is also due to the fact that
Ethernet's multiple access protocol, CSMA/CD, is
completely decentralized, which has contributed
to a simple design
Metcalfes Etheret sketch
51Star topology
- Bus topology popular through mid 90s
- Now star topology prevails
- Connection choices hub or switch (more later)
52Ethernet Frame Structure
- sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet
frame - preamble (8 bytes)
- 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 - used to synchronize receiver, sender clock rates
- data field (46 to 1500 bytes)
- this field carries IP datagram
- the maximum transfer unit (MTU) of Ethernet is
1500 bytes - the minimum size of the data field is 46 bytes.
if the IP datagram is less than 46 bytes, the
data field has to be "stuffed" to fill it out to
46 bytes. the network layer uses the length field
in the IP datagram header to remove the stuffing
53Ethernet Frame Structure (more)
- destination address (6 bytes) frame is received
by all adapters on a LAN and dropped if address
does not match - source address (6 bytes)
- type (2 bytes)
- indicates the higher layer protocol (mostly IP
but others may be supported such as Novell IPX
and AppleTalk) - ARP protocol also has its own type number
- cyclic redundancy check (CRC) (4 bytes) checked
at receiver, if error is detected, the frame is
simply dropped
54Ethernet Unreliable, connectionless service
- Connectionless
- no handshaking between sending and receiving
adapter. - Unreliable
- receiving adapter doesnt send acks or nacks to
sending adapter - stream of datagrams passed to network layer can
have gaps - gaps will be filled if app is using TCP
- otherwise, app will see the gaps
55Ethernet services and transmission
- provide connectionless and unreliable service to
the network layer - baseband transmission
- Manchester encoding
- used in 10BaseT, 10Base2
- each bit has a transition
- allows clocks in sending and receiving nodes to
synchronize to each other - no need for a centralized, global clock among
nodes!
56Ethernet uses CSMA/CD
- no slots
- adapter doesnt transmit if it senses that some
other adapter is transmitting, that is, carrier
sense - transmitting adapter aborts when it senses that
another adapter is transmitting, that is,
collision detection
- before attempting a retransmission, adapter waits
a random time, that is, random access
57Ethernets CSMA/CD
- adapter obtains a network-layer PDU, prepares an
Ethernet frame, and puts the frame in an adapter
buffer. - if the adapter senses that the channel is idle,
it starts to transmit the frame. If the channel
is busy, it waits until it senses no signal
energy (plus 96 bit times) and then starts to
transmit the frame. - while transmitting, the adapter monitors for the
presence of signal energy coming from other
adapters. If the adapter transmits the entire
frame without detecting signal energy from other
adapters, the adapter is done with the frame. - if the adapter detects signal energy from other
adapters, it stops transmitting its frame and
instead transmits a 48-bit jam signal. - after aborting (that is, transmitting the jam
signal), the adapter enters an exponential
backoff phase. The adapter then waits K 512 bit
times and then returns to step 2.
58Ethernets CSMA/CD (more)
- jam signal
- make sure all other transmitters are aware of
collision - 48-bit random bit pattern
- exponential backoff
- Goal adapt retransmission attempts to estimated
current load - after experiencing the nth collision in a row,
the adapter chooses a value for K at random from
0,1,2, . . ., 2m - 1 where m min(n,10). the
adapter then waits K 512 bit times - first collision choose K from 0,1 delay is K
512 bit transmission times - after second collision choose K from 0,1,2,3
- after ten or more collisions, choose K from
0,1,2,3,4, ,1023 - if many adapters are involved in the collision,
it makes sense to choose K from a larger, more
dispersed set of values - heavy load random wait will be longer
- bit time 0.1 microsec for 10 Mbps Ethernet
- for K1023, wait time is about 50 msec
59CSMA/CD efficiency
- Tprop max prop between 2 nodes in LAN
- ttrans time to transmit max-size frame
- efficiency goes to 1 as tprop goes to 0
- goes to 1 as ttrans goes to infinity
- much better than ALOHA, but still decentralized,
simple, and cheap
See/interact with Java applet on AWL Web site
highly recommended !
60Ethernet Technologies 10Base2
- 10 10Mbps 2 under 200 meters max cable length
- thin coaxial cable in a bus topology
- repeaters used to connect up to multiple segments
- repeater repeats bits it hears on one interface
to its other interfaces physical layer device
only! - without a repeater, the maximum length is 185
meters, the maximum number of nodes is 30
10Base2 Ethernet
6110BaseT and 100BaseT
- 10/100 Mbps rate latter called fast Ethernet
- T stands for twisted pair
- hub to which nodes are connected by twisted pair,
thus star topology - 4B5B encoding used in 100BaseT. data byte is
first broken into two nibbles. if the byte is 0E,
the first nibble is 0 and the second nibble is E.
next each nibble is remapped according to the
following table - 0000--11110 0001--01001 0010--10100
0011--10101 010001010 - 0101--01011 0110--01110 0111--01111
1000--10010 100110011 - 1010--10110 1011--10111 1100--11010
1101--11011 111011100 - 1111--11101
star topology for 10BaseT and 100BaseT
6210BaseT and 100BaseT (cont.)
- max distance from node to hub is 100 meters
- hubs are essentially physical-layer repeaters
- bits coming in one link go out all other links
- no frame buffering
- no CSMA/CD at hub adapters detect collisions
- provides net management functionality
- hub can disconnect jabbering adapter
- hub can gather monitoring information, statistics
for display to LAN administrators
63Gigabit Ethernet
- Uses the standard Ethernet frame format, and is
backward compatible with 10BaseT and 100BaseT
technologies. This allows for easy integration of
Gigabit Ethernet with the existing installed base
of Ethernet equipment. - Allows for point-to-point links as well as shared
broadcast channels. Point-to-point links use
switches (see Section 5.6) whereas broadcast
channels use hubs. In Gigabit Ethernet jargon,
hubs are called "buffered distributors" - Uses CSMA/CD for shared broadcast channels. In
order to have acceptable efficiency, the maximum
distance between nodes must be severely
restricted. - Allows for full-duplex operation at 1 Gbps in
both directions for point-to-point channels. - 10 Gbps now !
64Link Layer
- 5.1 Introduction and services
- 5.2 Error detection and correction
- 5.3Multiple access protocols
- 5.4 Link-Layer Addressing
- 5.5 Ethernet
- 5.6 Interconnections Hubs and switches
- 5.7 PPP
- 5.8 Link Virtualization ATM
65Token Ring IEEE802.5 standard
- 4 Mbps, 16 Mbps
- max token holding time 10 ms, which limits frame
length
ED
- SD (starting delimiter), ED (ending delimiter)
mark start, end of packet - AC (access control)
- token bit value 0 means token can be seized,
value 1 means data follows FC - priority bits priority of packet
- reservation bits station can write these bits to
prevent stations with lower priority packet from
seizing token after token becomes free
66Token Ring IEEE802.5 standard (cont.)
ED
- FC frame control used for monitoring and
maintenance - source, destination address 48 bit physical
address, as in Ethernet - data packet from network layer
- checksum CRC
- FS (frame status) set by dest., read by sender
- set to indicate destination up, frame copied OK
from ring - DLC-level ACKing
67Hubs
- physical layer devices essentially repeaters
operating at bit levels repeat received bits on
one interface to all other interfaces - hubs can be arranged in a hierarchy (or
multi-tier design), with backbone hub at its top - each connected LAN referred to as LAN segment
- hubs do not isolate collision domains node may
collide with any node residing at any segment in
LAN
three departmental Ethernets interconnected with
a hub
68Hubs (cont.)
- hub advantages
- simple, inexpensive device
- multi-tier provides graceful degradation
portions of the LAN continue to operate if one
hub malfunctions - extends maximum distance between node pairs (100m
per Hub) - hub limitations
- single collision domain results in no increase in
max throughput - multi-tier throughput same as single segment
throughput - individual LAN restrictions pose limits on number
of nodes in same collision domain and on total
allowed geographical coverage - cannot connect different Ethernet types (e.g.,
10BaseT and 100baseT)
69Link-layer switches
- link layer device
- stores and forwards Ethernet frames
- examines frame header and selectively forwards
frame based on MAC dest address - when frame is to be forwarded on segment, uses
CSMA/CD to access segment - transparent hosts are unaware of presence of
switches - plug-and-play, self-learning
- switches do not need to be configured
three departmental LANs interconnected with a
switch
70Switch forwarding and filtering
- How do determine onto which LAN segment to
forward frame? - Looks like a routing problem...
- filtering ability to determine whether a frame
should be forwarded to some interface or should
be just dropped - forwarding ability to determine the interface to
which a frame should be directed
71Self learning
- A switch has a switch table
- entry in switch table
- (MAC address, Interface, Time stamp)
- stale entries in table dropped (TTL can be 60
min) - self-learning
- switch learns which hosts can be reached through
which interfaces - when frame received, switch learns location of
sender incoming LAN segment - records sender/location pair in switch table
72Filtering/Forwarding
- When switch receives a frame
- index switch table using MAC dest address
- if entry found for destinationthen
- if dest on segment from which frame arrived
then drop the frame - else forward the frame on interface
indicated -
- else flood
-
forward on all but the interface on which the
frame arrived
73Switch example (1)
- Suppose C sends a frame to D
switch
1
3
2
hub
hub
hub
A
F
D
G
B
C
H
E
- switch receives frame from from C
- switch notes that C is on interface 1
- because D is not in table, switch forwards frame
into interfaces 2 and 3 - frame is received by D
74Switch example (2)
- Suppose D replies back with frame to C.
- switch receives frame from from D
- switch notes that D is on interface 2
- because C is in the table, switch selectively
forwards frame only to interface 1 - frame received by C
- switches are plug-and-play devices
75Switches traffic isolation
- filtering
- same-LAN-segment frames not forwarded onto other
LAN segments - segments become separate collision domains
- forwarding
- know the LAN segment on which to forward frame
- switch advantages
- isolates collision domains resulting in higher
total max throughput, and does not limit the
number of nodes nor geographical coverage - can connect different type Ethernet since it is a
store and forward device
76Switches dedicated access
- switch with many interfaces
- hosts have direct connection to switch
- no collisions full duplex
- cut-through switching frame is forwarded from
input to output port before the entire packet has
arrived if the buffer becomes empty - slight reduction in latency
- combinations of shared/dedicated, 10/100/1000
Mbps interfaces - Switching A-to-A and B-to-B simultaneously, no
collisions
77Institutional network
switch
78Switches vs. Routers
- both store-and-forward devices
- routers network layer devices (examine network
layer headers) - switches are link layer devices
- routers maintain routing tables, implement
routing algorithms - switches maintain switch tables, implement
filtering, learning algorithms
79Routers vs. Bridges pros and cons
- Switches
- () switches are plug and play
- () switches operation is simpler, has
relatively high packet filtering and forwarding
rates - (-) topologies are restricted with switches a
spanning tree must be built to avoid cycles since
bridges do not offer protection against broadcast
storms - (-) spanning tree restriction also concentrates
the traffic on the spanning tree links - Routers
- () arbitrary topologies can be supported,
cycling is limited by TTL counters (and good
routing protocols) - () provide firewall protection against layer 2
broadcast storms - (-) require IP address configuration (not plug
and play) - (-) require larger per-packet processing time
- switches do well in small (few hundred
hosts) while routers used in large networks
(thousands of hosts)
80Summary comparison