The Medium Access Control Sublayer
-
Upload
elaine-key -
Category
Documents
-
view
48 -
download
0
description
Transcript of The Medium Access Control Sublayer
The Medium Access ControlSublayer
Chapter 4
M/M/1 System
λ: mean arrival rate (frames/sec) 1/μ: mean frame length (bits/frame) C: data transmission rate, channel capacity (bits/sec) traffic intensity ρ= λ/μC mean customer number N= ρ/1- ρ mean time delay T=N/ λ =1/(μC- λ)
mean queuing number Nq =N- ρ= ρ2/1- ρ
mean queuing delay Tq= Nq/ λ= ρ/ (μC- λ)=T-1/μC
M/M/1 Example
λ =200B/s μ=250B/s ρ=0.8
Nq =N- ρ= ρ2/1- ρ= 3.2 N= Nq + ρ=4 T=N/ λ=20ms
Tq= Nq/ λ=16ms
The Channel Allocation Problem
• Static Channel Allocation in LANs and MANs• Dynamic Channel Allocation in LANs and MANs
Static Channel Allocation
Divide the single channel into N independent subchannels, each channel capacity C/N
mean arrival rate λ/N
mean time delay Tsub= 1/(μ(C/N)- (λ/N))=NT
Classification of Dynamic Channel Allocation
• controlled multiple access• centralized: polling • decentralized: token
• random multiple access• ALOHA• CSMA, CSMA/CD
Five Key Assumptions of Dynamic Channel Allocation(p245)
1. Station Model.
2. Single Channel Assumption.
3. Collision Assumption.
4. (a) Continuous Time.(b) Slotted Time.
5. (a) Carrier Sense.(b) No Carrier Sense.
Polling
• Round-robin polling• Transfer polling
Round-robin Polling• Procedure: the master station polls slave stations round-
robin, from the near end to far end • Disadvantage: polling frames take too much bandwidth
N N-1 2 1
masterR
S
...
Transfer Polling• Procedure: the master station always polls the far end
station firstly, which transfers controlling information to its neighbor after sending.
• Advantage: only poll once in each round• Disadvantage: each slave station needs two input line
N N-1 2 1
masterRS
...
Multiple Access Protocols
• ALOHA• Carrier Sense Multiple Access Protocols• Collision-Free Protocols• Limited-Contention Protocols• Wavelength Division Multiple Access Protocols• Wireless LAN Protocols
Pure ALOHA(p247)
In pure ALOHA, frames are transmitted at completely arbitrary times.
Pure ALOHAmodel
• Each station transmit frames arbitrary• If collision occurs, the sender waits a random time and
sends it again
N N-1 2 1
interface
Bus channel
The model of ALOHA
Pure ALOHACollision Demo(1)
Collision reason : two station send frame simultaneously
1 2 N-1 N...
Pure ALOHACollision Demo(2)
A1
new frame
B1
A2 A2
B1
collison
t1
t2 B2
A2t3
B2t4
B3
A3 station A
Station B
Final effect
A1 B1 A2 B2
t
t
t
Pure ALOHA Performance Analysis(1)
Vulnerable period for the shaded frame.
Pure ALOHAPerformance Analysis(2)
Assumptions: fixed frame length, frame time is t new frames generated according to Poisson distribution new frames and retransmitting frames also accord to Poisson distribution
frame interval accord to exponential distributionParameters:
throughput S: mean successful frames per frame time 0 S 1 network load G: mean frames per frame time G ≥ S
probability P0: successful transmission S = G P0
Pure ALOHAPerformance Analysis(3)
P0= P [ consecutive 2 arrival interval> T ] = P [ arrival interval>T ]2
function of probability density of exponential distribution:(t) = e -t , t: arrival interval , : arrival rate = G / T
∞ ∞
P [arrival interval > T ] = T (t) dt = T (G/ T) e -Gt / T dt = e –G
throughput S = G P0 = G e -2G
maximum throughput occurs when G=0.5, S=1/2e ≈ 0.184
Slotted ALOHA (p249)Principle: divide time into discrete intervals, each interval corresponding to one frame, so each user must know slot boundaries (synchronization)
A1
new frame
B3
A2A2
B1
冲突t1
t2 B2B2 B3
A3
station B
final effect
A1 B1 A2B2 A3
station A
Slotted ALOHAPerformance Analysis
TTx
P0= P [last interval> (T-Tx) ] * P [next interval>Tx] ∞ ∞
= T-Tx (t) dt * Tx (t) dt
∞ ∞ = T-Tx (G/ T) e -Gt / T dt * Tx (G/ T) e -Gt / T dt
= e –G throughput S = G P0 = G e -G
maximum throughput occurs when G=1, S=1/e ≈ 0.368 P[idle]=P[interval>T] ∞ = T (t) dt = e –G
lastnext
ALOHA Summary(p249)
Throughput versus offered traffic for ALOHA systems.
Expected number of transmissionsPure ALOHA:
P0=e-2G
Pk=e-2G(1-e-2G)k-1
E= kPk=e2G
Slotted ALOHA: P0=e-G
Pk=e-G(1-e-G)k-1
E= kPk=eG
CSMA protocols• Station listens for a carrier before sending• Classification:
• 1-persistent CSMA if the channel is busy, waits until it becomes idle, then
transmits frame immediately, if a collision occurs, waits for a random amount of time and start all over again.
• Nonpersistent CSMA if the channel is busy, waits for a random amount of time and sense channel again
• P-persistent CSMA (slotted channel)if the channel is busy, waits to the next slot, if idle, transmits frame with probability of p, with a probability of 1-p it defers to the next slot
CSMA Comparison• 1-persistent CSMA: high throughput and low delay when
low load; low throughput when high load• Nonpersistent CSMA: high throughput when high load
Station A Station B
B 监听到信道空闲,发送A 监听到信道空闲发送
为 A 、 B 之间的传播时延
Persistent and Nonpersistent CSMA
Comparison of the channel utilization versus load for various random access protocols.
CSMA with Collision Detection• Principle: station aborts the transmission as soon as it detects a
collision, it saves time and bandwidth • 1-persistent CSMA/CD: when a station sense the channel idle, send
immediately and keep on sensing, when collision occur, abort transmission immediately
• Jamming signal: when sensing collision, keep on sending several bits jamming signal to intensify the collision
CSMA/CD channel state
CSMA/CD can be in one of three states: contention, transmission, or idle.
CSMA/CDcontention period
Station A 站 B
B sense collisionA sense collision
B sense idle
TB
2
2
contention period =
2
Collision-Free Protocolsbit-map protocol
The basic bit-map protocol.
Principle: each contention period consists of N slots (bits), with each station use one slot, if station have frames to send, it reserve it by fill ‘1’ in its slot, so it is called reservation protocols
Bit-map protocolperformance
• Measure time in units of the contention bit slot• N station, contention time is N, One data frame is d bits long, so time is d • When low load, low-numbered station will wait N/2+N slots to transmit,
while high-numbered station will wait N/2 slots to transmit, so the mean for all stations is N slots
efficiency= d/N+d• When high load, all stations have frames to send, so the N bits contention
period prorated over N frames, yielding an 1 bit overhead per frameefficiency=d/d+1
0 1 2 3 4 5 6 7
reservation slots 0 1 2 3 4 5 6
7 1 1
station 1 get one framestation 7 get one frame
Collision-Free Protocols binary countdown protocol
• Principle: each station wanting to use the channel broadcast its address as a binary bit string. The bits in each address position from different stations are BOOLEAN ORed together
efficiency=d/(d+lnN)• Disadvantage: high-numbered station always gets high priority to
send• Variation: set the lowest priority to the station which send
successfully in the last contention
binary countdown protocol
The binary countdown protocol. A dash indicates silence.
Limited-Contention Protocols• Summary: In rating protocols, we use two performance measures,
delay at low load and channel efficiency at high load• Contention protocols give low delay at low load, while collision-
free protocols give high efficiency at high load• Limited-contention protocols
• use contention at low load, use a collision-free technique at high load• divide stations into groups, each station contends the group’s slot• Assign stations to groups dynamically, with many stations per group when
low load and few station per group when high load
Limited-Contention Protocols
Acquisition probability for a symmetric contention channel.
Adaptive Tree Walk Protocol• Algorithm
1. take N blood samples mixed2. if no antibodies, all are healthy3. else prepare two new samples
1 through N/2the rest
repeat the steps recursively until infected found• Analysis – depth search first
1. build a binary tree with stations as the leaves2. all stations contend slot 03. if no collision, ok4. else only stations falling under node 2 compete slot 15. ...
Adaptive Tree Walk Protocol(p259)
The tree for eight stations.
Adaptive Tree Walk Protocolexample
0 级1 级
2 级
3 级
1
2 3
4 5 6 7
A B C D E F G H站点
搜索开始的最佳级数 i= log2 q q 为当前要发送数据的站点数
时隙 0
时隙 1
时隙 2
时隙 3 时隙 4 。。。
设只有站点 G 和 H 要发送
Wavelength Division Multiple Access Protocols
Wavelength division multiple access.
WLAN Protocols• configuration
In an office building, many base stations are wired together using copper or fiber which cover only several meters range
• InterferenceWhen a receiver is within range of two active transmitters, the resulting signal will be garbledCSMA can’t solve the problem totally, because CSMA merely tells whether there is activity around the station sensing the carrier while it really wants to known whether there is activity around the receiver
• Hidden station problem• Exposed station problem
WLAN ProtocolsInference Demo
A wireless LAN. (a) A transmitting. (b) B transmitting.
WLAN ProtocolsMACA/MACAW
• MACAMultiple Access Collision AvoidanceIEEE 802.11 prototypeRTS->CTS handshake
• MACAWadd ACK frames carrier sense for RTS
Wireless LAN Protocols (2)
The MACA protocol. (a) A sending an RTS to B.(b) B responding with a CTS to A.
Ethernet• Ethernet Cabling• Manchester Encoding• The Ethernet MAC Sublayer Protocol• The Binary Exponential Backoff Algorithm• Ethernet Performance• Switched Ethernet• Fast Ethernet• Gigabit Ethernet• IEEE 802.2: Logical Link Control• Retrospective on Ethernet
Ethernet Cabling
The most common kinds of Ethernet cabling.
10BASE2
Thin coaxThin coax
BNC junctionBNC junction
NICNIC
• BNC T-junction
Max. segment = 185mStations per seg.=30
10BASET
• Hub: A multi-port repeater
• Hub provides a star connection physically, implements a bus topology logically
• Devised to overcome problems of Ethernet tap connections, provides more reliable connections
• Support 10Mbps or 100Mbps
• Hub completely replaces repeater
• Configuration limitation - up to 3 hubs in a segment
hub
Max. seg.= 100m
One Collision Domain
Ethernet Cabling (2)
Three kinds of Ethernet cabling. (a) 10Base5, (b) 10Base2, (c) 10Base-T.
Ethernet Cabling (3)
Cable topologies. (a) Linear, (b) Spine, (c) Tree, (d) Segmented.
Ethernet Cabling (4)
(a) Binary encoding, (b) Manchester encoding, (c) Differential Manchester encoding.
Ethernet MAC Sublayer Protocol
Frame formats. (a) DIX Ethernet, (b) IEEE 802.3.
Ethernet address
Ethernet MAC Sublayer Protocol (2)
Collision detection can take as long as 2 .
The Binary Exponential Backoff Algorithm
•During contention period, if a collision occurs, each station must wait random slot times(2) •After I collisions, a random number between 0 and 2i-1 is chosen•The upper limit is 1023 slots•After 16 collisions, the controller reports failure to the computer
802.3 Performance(1)• Assumption
• Heavy and constant load, k station ready to transmit• Constant retransmission probability in each slot• Each station transmits during a contention slot with probability p
• ComputationP[ some station sends successfully ] A=kp(1-p)k-1
p=1/k Amax=(1-1/k)k-1 if k-> , A->1/e
P[ contention interval has j slots ]=A(1-A)j-1
mean number of contention slots E= j A(1-A) j -1 = 1/A->e
j=1mean contention time w=E*2=2/A ->5.4 if mean frame transmission time is P, efficiency=P/(P+2/A)replace P with F/B, with L/c, efficiency=1/(1+2BL/cAF)->1/(1+2BLe/cF)
802.3 Performance(2)• Conclusion
• Increasing network bandwidth or distance reduces efficiency for a given frame size
802.3 Performance(3)
Efficiency of 802.3 at 10 Mbps with 512-bit slot times.
Switched 802.3 LANs
A simple example of switched 802.3 LAN
Fast Ethernet
The original fast Ethernet cabling.
Gigabit Ethernet
(a) A two-station Ethernet. (b) A multi-station Ethernet.
Gigabit Ethernet (2)
Gigabit Ethernet cabling.
Wireless LANs
• The 802.11 Protocol Stack• The 802.11 Physical Layer• The 802.11 MAC Sublayer Protocol• The 802.11 Frame Structure• Services
The 802.11 Protocol Stack
Part of the 802.11 protocol stack.
The 802.11 MAC Sublayer Protocol
(a) The hidden station problem.(b) The exposed station problem.
The 802.11 MAC Sublayer Protocol (2)
The use of virtual channel sensing using CSMA/CA.
The 802.11 MAC Sublayer Protocol (3)
A fragment burst.
The 802.11 Frame Structure
The 802.11 data frame.
IEEE 802.2: Logical Link Control
(a) Position of LLC. (b) Protocol formats.
Bridges• Why do we need bridges?
• Different LANs• Geographical distance• Share load• Reliability• Security
• Bridge problem• Different frame format • Different data rate
• Buffer• Timer
• Different maximum frame length
Data Link Layer Switching
Multiple LANs connected by a backbone to handle a total load higher than the capacity of a single LAN.
Bridges from 802.x to 802.y
Operation of a LAN bridge from 802.11 to 802.3.
Bridges from 802.x to 802.y (2)
The IEEE 802 frame formats. The drawing is not to scale.
Local Internetworking
A configuration with four LANs and two bridges.
Transparent Bridges• Operate in promiscuous mode• Use Backward Learning Algorithm to build routing table• Routing procedure
1. If destination and source LANs are the same, discard the frame2. If the destination and source LANs are different, forward the frame3. If the destination LAN is unknown, use flooding
• Periodically purge all entries more than a few minutes old
Cycle Problem
Two parallel transparent bridges.
Spanning Tree Bridges
(a) Interconnected LANs. (b) A spanning tree covering the LANs. The dotted lines are not part of the spanning tree.
Spanning Tree Bridges(2)• How to build spanning tree
• Choose one bridge to be the root of the tree• Search the shortest paths from the root to every bridge and LAN
Remote Bridges
Remote bridges can be used to interconnect distant LANs.
Repeaters, Hubs, Bridges, Switches, Routers and Gateways
(a) Which device is in which layer.(b) Frames, packets, and headers.
Repeaters, Hubs, Bridges, Switches, Routers and Gateways (2)
(a) A hub. (b) A bridge. (c) a switch.
Virtual LANs
A building with centralized wiring using hubs and a switch.
Virtual LANs (2)
(a) Four physical LANs organized into two VLANs, gray and white, by two bridges. (b) The same 15 machines organized into two VLANs by switches.
The IEEE 802.1Q Standard
Transition from legacy Ethernet to VLAN-aware Ethernet. The shaded symbols are VLAN aware. The empty ones are not.
The IEEE 802.1Q Standard (2)
The 802.3 (legacy) and 802.1Q Ethernet frame formats.
Summary
Channel allocation methods and systems for a common channel.