Upload
coleen-walton
View
212
Download
0
Tags:
Embed Size (px)
Citation preview
Datalink Layer: Examples
4/21/2008
2
Recap: Summary of MAC Protocols
How do you access a shared media?
channel partitioning, by time, frequency or code
random access, • ALOHA, S-ALOHA, CSMA, CSMA/CD
“taking-turns”• polling• token passing
Recap: Aloha Protocol
Behaviors of Aloha on a LAN a total of m stations fixed transmission rate p for a backlogged
station to transmit in a slot pa for each un-backlogged station
3
4
Outline
Admin. and recap MAC Examples
5
Example MAC Protocols Example MAC protocols
GSM Ethernet Wireless LAN Bluetooth
There are many more link technologies e.g., ATM, DOCSIS, FDDI, Frame relay, IEEE
802.5 Token Ring, PPP, WiMax, X.25, xDSL if you are interested, please see schedule
page for a link to a set of optional slides
Key factors: traffic services
6
Outline
Admin. and recap MAC Examples
GSM
7
1 2 3 4 5 6 7 8
935-960 MHz124 channels (200 kHz)downlink
890-915 MHz124 channels (200 kHz)uplink
frequ
ency
time
GSM TDMA frame
GSM time-slot (normal burst)
4.615 ms
546.5 µs577 µs
tail user data TrainingSguardspace S user data tail
guardspace
3 bits 57 bits 26 bits 57 bits1 1 3
GSM - TDMA/FDMA
S: indicates data or control
http://wireless.fcc.gov/uls/index.htm?job=home
8
Many Types of Logical Channels Control channels
Broadcast control channel (BCCH)
• From base station, announces cell identifier, synchronization
Common control channels (CCCH)
• Paging channel (PCH): Base transceiver station (BTS) pages a mobile host (MS)
• Random access channel (RACH): MSs for initial access, using slotted Aloha
• Access grant channel (AGCH): BTS informs an MS its allocation
Dedicated control channels• Standalone dedicated control
channel (SDCCH): signaling and short message between MS and an MS
Traffic channels (TCH)
Example: call setup from an MS BTSMS
RACH (request signaling channel)
AGCH (assign signaling channel)
SDCCH (request call setup)
SDCCH (assign TCH)
SDCCH message exchange
Communication using TCH
9
GPRS: GSM Data Services Using GSM, an MS can use a (logical) traffic channel to
send data data rate standardized at 9.6 kbps
General Packet Radio Service (GPRS) allocate multiple slots from the same frame; by reserving
different number of slots and using different coding scheme, an MS achieves different rate (kbps)
simplified signaling process: still uses a random channel to request frequency and time slot
Coding scheme
1 slot2 slots
3 slots
4 slots
5 slots
6 slots
7 slots
8 slots
CS-1 9.05 18.2 27.15 36.2 45.25 54.3 63.35 72.4
CS-2 13.4 26.8 40.2 53.6 67 80.4 93.8 107.2
CS-3 15.6 31.2 46.8 62.4 78 93.6 109.2 124.8
CS-4 21.4 42.8 64.2 85.6 107 128.4 149.8 171.2
10
GPRS Signaling
PRACH: Pkt. Random Access Channel; PAGCH: Pkt. Access Grant Channel; PTCH: Pkt. Traffic ChannelUSF: uplink state flag
11
UMTS: Enhancements of GSM UMTS (Universal Mobile
Telecommunications System) Use CDMA for channel partitioning
o less fragmented channelso additional requirement: allocate different
amount of bw to mobile stations
W-CDMA chipping rate: 5 MHz, 3.840 Mchip/s
12
Orthognal Variable Spreading Factor (OSVF)
By assigning a code with a low spreading factor, a node receives higher bw.
1
1,1
1,-1
1,1,1,1
1,1,-1,-1
X
X,X
X,-X 1,-1,1,-1
1,-1,-1,1
1,-1,-1,1,1,-1,-1,1
1,-1,-1,1,-1,1,1,-1
1,-1,1,-1,1,-1,1,-1
1,-1,1,-1,-1,1,-1,1
1,1,-1,-1,1,1,-1,-1
1,1,-1,-1,-1,-1,1,1
1,1,1,1,1,1,1,1
1,1,1,1,-1,-1,-1,-1
SF=1 SF=2 SF=4 SF=8
SF=n SF=2n
...
...
...
...
13
Outline Admin. and recap Example MAC protocols
GSM• Channel partitioning (time, freq., code) and slotted
Aloha Ethernet
Outline
14
Ethernet
“Dominant” LAN technology: First widely used LAN
technology Kept up with speed race: 10 Mbps, 100 Mbps,
1 Gbps, 10 Gbps
Metcalfe’s Ethernetsketch
15
Ethernet 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 (why the preamble?) Source and dest. addresses: 6 bytes Type: indicates the higher layer protocol, mostly IP but
others may be supported such as Novell IPX and AppleTalk)
CRC: CRC-32 checked at receiver, if error is detected, the frame is simply dropped
8 6 6 2 46-1500 (including padding) 4
16
The Basic MAC Mechanisms of Ethernet
get a packet from upper layer;K := 0; n := 0; // K: control wait time; n: no. of
collisionsrepeat: wait for K * 512 bit-time; while (network busy) wait; wait for 96 bit-time after detecting no signal; transmit and detect collision; if detect collision stop and transmit a 48-bit jam signal; n ++; m:= min(n, 10), where n is the number of
collisions choose K randomly from {0, 1, 2, …, 2m-1}. if n < 16 goto repeat else give up
17
Ethernet’s Exponential Backoff:
Goal: adapt retransmission attempts to estimated current load compared with CSMA, 1/2m can be considered
as p not a static p---adjusted using exponential
backoff• first collision: choose K from {0,1}; delay is K x 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}
18
Ethernet: From Bit to Electrical Signal
Use Manchester encoding One voltage change per bit
for a “1”, a voltage change from 1 to 0 for a “0”, a voltage change from 0 to 1
Example
19
Ethernet Technologies: 10Base2
10: 10Mbps; 2: under 200 meters max cable length
Thin coaxial cable in a bus topology
Issues of such connectivity?
20
10BaseT 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” there is a bus inside the hub; boost signal from one port
to all other ports
21
Interconnecting with hubs
Multiple hubs interconnect to form a larger Ethernet network extends max distance between nodes; more ports
Issue: individual segment collision domains become one large collision domain
22
Ethernet Bridges
Link layer device stores and forwards Ethernet frames examines frame header and selectively
forwards frame based on MAC dest address segments become separate collision domains
bridge collision domain
collision domain
= hub
= host
LAN (IP network)
LAN segment LAN segment
23
Bridge Forwarding
Key issue: How do determine to which LAN segment to forward frame?
24
Ethernet Bridge Self Learning
A bridge has a bridge table Entry in bridge table:
(Node LAN Address, Bridge Interface, Time Stamp)
stale entries in table dropped (TTL can be 60 min)
Bridges learn which hosts can be reached through which interfaces when frame received, bridge “learns” location
of sender: incoming LAN segment records sender/location pair in bridge table
25
Filtering/ForwardingWhen bridge receives a frame:
index bridge table using MAC dest addressif entry found for destination
then { 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
26
Ethernet Bridge: Example
Suppose C sends frame to D and D replies back with frame to C.
Bridge receives frame from C to D notes in bridge table that C is on interface 1 because D is not in table, bridge sends frame into
interfaces 2 and 3
frame received by D
27
Bridge Learning: Example
D generates frame for C, sends Bridge receives frame
notes in bridge table that D is on interface 2 bridge knows C is on interface 1, so selectively
forwards frame to interface 1
C | 1
28
Bridges Spanning Tree For increased reliability, desirable to have redundant,
alternative paths from source to dest With multiple paths, cycles result - bridges may
multiply and forward frame forever Solution: organize bridges in a spanning tree by
disabling subset of interfaces
Disabled
29
Bridges vs. Routers both store-and-forward devices
routers: network layer devices (examine network layer headers) bridges are link layer devices
routers maintain routing tables, implement routing algorithms
bridges maintain bridge tables, implement filtering, learning and spanning tree algorithms
30
Routers vs. Bridges
Bridges + and - + Bridge operation is simpler+ Bridge tables are self learning
- All traffic confined to spanning tree, even when alternative bandwidth is available
- Bridges do not offer protection from broadcast storms (flooding of packets)
31
Routers vs. Bridges
Routers + and -+ arbitrary topologies can be supported
+ provide protection against broadcast storms- require IP address configuration (not plug and
play)- require higher packet processing
bridges do well in small (few hundred hosts) while routers used in large networks (thousands of hosts)
32
Gbit Ethernet and Ethernet Switches Gbit Ethernet typically
use Ethernet switches Essentially a multi-interface
bridge layer 2 (frame) forwarding,
filtering using LAN addresses
Switching: A-to-A’ and B-to-B’ simultaneously, no collisions
cut-through switching: frame forwarded from input to output port without awaiting for assembly of entire frame
33
Not an atypical LAN (IP network)
Dedicated
Shared
34
Summary: Comparison
hubs bridges routers switches
traffi c isolation
no yes yes yes
plug & play yes yes no yes
optimal routing
no no yes no
cut through
yes no no yes
35
Outline Admin. and recap Example MAC protocols
GSM• Channel partitioning and slotted Aloha
Ethernet• Random MAC protocol (CSMA/CD + Exponential
backoff) Wireless LAN
36
802.11 – Traffic Services and Access Methods
Two types of traffic services Asynchronous Data Service (mandatory)
• exchange of data packets based on “best-effort”• implemented by random access
Time-Bounded Service (optional)
Two types of coordination function (aka MAC) DCF (Distributed Coordination Function) PCF (Point Coordination Function)
• access point polls
37
IEEE 802.11 Wireless LAN
Basic Service Set (BSS) (a.k.a. “cell”) contains: wireless station (WS) access point (AP): base
station BSS’s combined to form
distribution system (DS) Two operation modes:
infrastructure mode• everything through AP
peer-to-peer mode• called ad hoc network
38
Random Access Carrier Sense in 802.11
BA C
The hidden-terminal problem A is sending to B, but C cannot receive from
A • Friis Law (power decay proportional to distance squared)
Therefore C sends to B, without detecting the transmission from A to B
In summary, A is “hidden” for C
39
The Exposed Terminal Problem
BA C D
B is sending to A, C intends to send to D C senses an “in-use” medium, thus C waits But A is outside the radio range of C,
therefore waiting is not necessary In summary, C is “exposed” to B Implication: false carrier sense
40
Summary of Problems of Wireless MAC
How to achieve carrier sense? in Ethernet, we use carrier sense to avoid and
detect potential collision for wireless networks, the hidden-terminal,
and the exposed-terminal problems make carrier sense (i.e., listen before talk) neither sufficient nor necessary
• not detected transmission at the sender does not imply no current transmission to the receiver
• detected transmission at the sender does not imply transmission will cause collision
How to integrate random access (DCF) and taking turns (PCF)?
41
Basic Solution: Using RTS/CTS to Address the Carrier Sense Problem Short signaling packets---virtual carrier
sense RTS (request to send) and CTS (clear to
send)• to avoid collision at the receiver, any station who
hears a CTS should not transmit• frames need to contain sender address, receiver
address, transmission duration
BA CCTSCTS DEFRTSRTS
Example: A sends to B
42
Basic Solution: Using Inter Frame Spacing to Prioritize Access Different inter frame spacing (IFS): if the required IFS of a
type of message is short, the type of message has higher priority SIFS (Short Inter Frame Spacing)
• highest priority, for ACK, CTS, polling response PIFS (Point Coordination Function Spacing)
• medium priority, for time-bounded service using PCF DIFS (Distributed Coordination Function Spacing)
• lowest priority, for asynchronous data service
random direct access if medium is free DIFS
t
medium busy SIFSPIFS
DIFS DIFS
next framecontention
Access point access if medium is free DIFS
43
Basic Control Flow of RTS/CTS
Sender sends RTS with NAV (Network allocation Vector, i.e. reservation parameter that determines amount of time the data packet needs the medium) after waiting for DIFS
Receiver acknowledges via CTS after SIFS (if ready to receive) CTS reserves channel for sender, notifying possibly hidden
stations; any station hearing CTS should be silent for NAV
Sender can now send data at once
t
DIFS
data
defer access
otherstations
receiver
senderdata
DIFS
new contention
RTS
CTSSIFS SIFS
NAV (RTS)NAV (CTS)
44
802.11: RTS/CTS + ACK
802.11 adds ACK in the signaling to improve reliability implication: to avoid conflict with ACK, any station hearing RTS
should not send for NAV thus a station should not send for NAV if it hears either RTS and
CTS
Note: RTS/CTS is optional in 802.11, and thus may not be always turned on---some network interface cards turn it on only when the length of a frame exceeds a given threshold
t
SIFS
DIFS
data
ACK
defer access
otherstations
receiver
senderdata
DIFS
new contention
RTS
CTSSIFS SIFS
NAV (RTS)NAV (CTS)
45
802.11: PCF for Polling
tNAV
polledwirelessstations
point coordinator
NAV
PIFSD
USIFS
SIFSD
contentionperiod
contention free periodmediumbusy
D: downstream poll, or data from point coordinatorU: data from polled wireless station
46
802.11 - Frame Format
Before the MAC header are an 80-bit preamble of alternating 0 and 1 for clock sync. a physical layer header (PLCP) which is always transmitted at 1
Mbps, including signaling fields such as sending rate Duration ID: NAV The four addresses are used to encode various addresses
e.g., Addr 1 is always the recipient address (i.e., the immediate recipiet of the frame), Addr 2 is always the transmitter addr
CRC: check sum
47
802.11 Frame Control Field
48
Outline Admin. and recap Example MAC protocols
GSM• Channel partitioning and slotted Aloha
Ethernet• Random MAC protocol (CSMA/CD + Exponential
backoff) Wireless LAN
• Random MAC protocol (CSMA/CA + RTS/CTS) + Polling
Bluetooth
49
Bluetooth Design Objective
Design objective: a cable replacement technology to connect a small number of devices 1 Mb/s range 10+ meters single chip radio + baseband (means digital part)
• low power • low price point (target price $5)
Traffic Services SCO: Synchronous connected link (fixed periodical
traffic) ACL: Asynchronous connectionless link
Bluetooth
Nodes in Bluetooth form piconet: one master and upto 7 slaves Each radio can function as a
master or a slave SCO: a slave reserves with
the master a slot for a synchronous connected link
ACL: The master polls slaves for asynchronous connectionless traffic
50
A piconet
51
Bluetooth Links
Coexistence of Bluetooth and 802.11
Bluetooth shares the same freq. range as of 802.11
There are can be multiple piconets in close range, causing inteference (how about multiple 802.11?)
Question: how to share among piconets and with 802.11?
52
Bluetooth Frequency Hopping
Divide spectrum into 79 frequencies
Master conducts pseudorandom frequency hopping
The slaves follow the pseudorandom jumping sequence of the master
53
Bluetooth Frequency Hopping
54
55
MAC: Summary In practical protocols, various MAC
techniques are often combined to achieve objectives GSM
• Channel partitioning and slotted Aloha Ethernet
• Random MAC protocol (CSMA/CD + Exponential backoff)
Wireless LAN• Random MAC protocol (CSMA/CA + RTS/CTS) +
Pollingo Bluetooth
o Time partitioning, polling, and random hopping
For physical layer, please see the optional slides linked on the schedule page
Backup
56
57
Comparisons of Different Ethernet Standards
10Base2
10BaseT
100BaseT
1000BaseT
Bandwidth
10 Mbps
10 Mbps
100 Mbps
1000 Mbps
Topology Bus Star Star Star
Min frame size (not including preamble)
64 byte 64 byte 64 byte 64 byte (min slot time 512 byte, packet bursting)
Network Diameter
~200m ~2km ~200m ~200m