840 likes | 1.06k Views
The Medium Access Control Sublayer. 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- λ)
E N D
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) • Station Model. • Single Channel Assumption. • Collision Assumption. • (a) Continuous Time.(b) Slotted Time. • (a) Carrier Sense.(b) No Carrier Sense.
Polling • Round-robin polling • Transfer polling
Round-robin Polling ... N N-1 2 1 R master • Procedure: the master station polls slave stations round-robin, from the near end to far end • Disadvantage: polling frames take too much bandwidth S
Transfer Polling ... N N-1 2 1 R master S • 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
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 N N-1 2 1 Bus channel interface The model of ALOHA • Each station transmit frames arbitrary • If collision occurs, the sender waits a random time and sends it again
Pure ALOHACollision Demo(1) 1 2 ... N-1 N Collision reason:two station send frame simultaneously
Pure ALOHACollision Demo(2) t1 t3 A1 A2 A2 A2 A3 station A t collison new frame t4 t2 B1 B1 B2 B2 B3 Station B t Final effect A1 B1 A2 B2 t
Pure ALOHA Performance Analysis(1) Vulnerable period for the shaded frame.
Pure ALOHAPerformance Analysis(2) Assumptions: fixed frame length, frametime is t new frames generated according to Poisson distribution new frames and retransmitting frames also accord to Poisson distribution frame interval accord to exponential distribution Parameters: 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 / Tdt = e –G throughputS = G P0 = G e -2G maximum throughput occurs when G=0.5, S=1/2e ≈ 0.184
Slotted ALOHA (p249) t1 A2 A3 A1 A2 station A 冲突 new frame t2 B3 B1 B2 B2 station B final effect A1 B1 B2 A2 A3 B3 Principle: divide time into discrete intervals, each interval corresponding to one frame, so each user must know slot boundaries (synchronization)
Slotted ALOHAPerformance Analysis next last Tx T P0= P [last interval> (T-Tx) ] * P [next interval>Tx] ∞ ∞ = T-Tx(t) dt*Tx(t) dt ∞ ∞ = T-Tx(G/ T) e-Gt / Tdt * Tx(G/ T) e-Gt / Tdt = e –G throughputS = 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
ALOHA Summary(p249) Throughput versus offered traffic for ALOHA systems.
Expected number of transmissions Pure 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 Station A Station B A 监听到信道空闲 发送 B监听到信道空闲,发送 为A、B之间的传播时延 • 1-persistent CSMA: high throughput and low delay when low load; low throughput when high load • Nonpersistent CSMA: high throughput when high load
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 TB B sense idle 2 B sense collision A sense collision 2 2 contention period =
Collision-Free Protocolsbit-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 The basic bit-map protocol.
Bit-map protocolperformance reservation slots 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 1 1 • 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 frame efficiency=d/d+1 station 1 get one frame station 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 • take N blood samples mixed • if no antibodies, all are healthy • else prepare two new samples 1 through N/2 the rest repeat the steps recursively until infected found • Analysis – depth search first • build a binary tree with stations as the leaves • all stations contend slot 0 • if no collision, ok • else only stations falling under node 2 compete slot 1 • ...
Adaptive Tree Walk Protocol(p259) The tree for eight stations.
Adaptive Tree Walk Protocolexample 时隙0 1 设只有站点G和H要发送 0级 1级 2 3 时隙1 时隙2 2级 4 5 6 7 3级 时隙3 时隙4 。。。 站点 A B C D E F G H 搜索开始的最佳级数 i= log2 q q为当前要发送数据的站点数
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 • Interference When a receiver is within range of two active transmitters, the resulting signal will be garbled CSMA 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 • MACA Multiple Access Collision Avoidance IEEE 802.11 prototype RTS->CTS handshake • MACAW add 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 coax • BNC T-junction BNC junction NIC Max. segment = 185m Stations per seg.=30
10BASET hub • 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 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.