330 likes | 346 Views
Explore static and dynamic channel allocation methods, collision assumptions, and multiple-access protocols in Local and Metropolitan Area Networks according to William Stallings' book. Understand how different protocols and strategies impact network performance. Learn about ALOHA, FDM, and MAC sublayer concepts.
E N D
Chapter 4 The Medum Access Sublayer
MA Sublayer • Additional Reference • Local and Metropolitan Area Networks, William Stallings, Prentice Hall, 2000, 6th ed. • Networks could be point to point or broadcast. Key issue: who gets access to the (single) channel when there is competition • Key parameters in any medium access control technique are where and how. • WHERE - refers to whether control is exercised in a distributed or centralized fashion.
MAC Sublayer • HOW - is constrained by topology and is a trade off among competing factors including • cost • performance • complexity • Protocols used to determine who goes next on a multiaccess channel are part of a sublayer of the data link layer (DLL) called MAC (Medium Access Control) sublayer. • MAC sublayer is important in LAN’s
Channel Allocation Problem • How to allocate a single broadcast channel among multiple (competing) users. • Static Allocation in LAN’s and MAN’s • Traditional way is to use FDM. • Review FDM here. • When # of senders is large & frequently changing, or traffic is bursty, FDM presents problems. • If freq. range has N bands and less than N users are using it then we are wasting bandwidth • More than N, some users will have to wait.
Static Allocation in LAN’s and MAN’s • FDM problems (continued). • Even if there were only N users, when some user is silent (e.g., not speaking) their frequency range is wasted. (Dog in the manger syndrome) • Also, computer traffic is bursty, thereby most of the bands will be idle most of the time. • Let us calculate: • Mean time delay is T • Channel capacity is C bps • Arrival rate is frames/sec • Length of frame is exponential, mean = 1/ bits/frame (next slide)
Static Allocation in LAN’s and MAN’s • Calculations (continued): • T = 1/(C - ) • If single channel is split into N independent subchannels each having capacity C/N bps. Then mean input rate on subchannels will be /N. • Therefore TFDM= 1/(C/N - /N) = NT, i.e., the mean time delay using FDM is N times worse if we had only used a single queue. • Dynamic Channel alloc in LAN + MAN (ASSUMPTIONS) • Station Model, Single Channel Assumption, Collision Assumption, Continuous time, Slotted time, Carrier sense, no carrier sense.
Dynamic Channel alloc in LAN + MAN (Assumptions) • Station Model - • The model assumes N independent stations (terminals, telephones, personal communicators etc). • Each station has a program (user) that generates frames for transmission • Probability of a frame being generated in an interval of length t is t, where is a constant (the arrival rate of new frames). • Once a frame is generated, the station is blocked, i.e., it waits till frame is successfully transmitted.
Dynamic Channel alloc in LAN + MAN (Assumptions) • Single Channel Assumption • A single channel is available for all communication. • All stations can communicate and receive on this channel. • The protocol may consider each station to have a different priority
Dynamic Channel alloc in LAN + MAN (Assumptions) • Single Channel Assumption • A single channel is available for all communication. • All stations can communicate and receive on this channel. • The protocol may consider each station to have a different priority
Dynamic Channel alloc in LAN + MAN (Assumptions) • Collision Assumption • If two frames are submitted simultaneously, they overlap in time and the resulting signal is garbled. (This is called a collision). • All stations are capable of detecting collisions. • Collided frames must be transmitted again later • There are no errors other than those generated by collisions
Dynamic Channel alloc in LAN + MAN (Assumptions) • Continuous Time • Time is not discrete - i.e., no master clock. i.e., frame transmissions can occur at any time. • Slotted Time • Time is divided into discrete intervals (slots). • Frame transmissions always begin at the start of the slot. • Slots may contain 0, 1 or more frames (idle slot, successful transmission or collision)
Dynamic Channel alloc in LAN + MAN (Assumptions) • Carrier Sense • Stations can tell if the channel is in use before attempting to transmit. If channel is busy then no station will transmit until it goes idle. • No carrier sense • Stations cannot sense the channel before trying to use it. • Successful transmissions are determined after the fact.
Multiple Access Protocols • ALOHA • Useful in which uncoordinated users are competing for the use of a single shared channel. • Pure Aloha (no global time synchronization) and Slotted Aloha (global time synch. required) • PURE ALOHA • Let users transmit at all times. • Collisions occur, colliding frames destroyed • Frame destruction detected by listening to the channel
ALOHA • PURE ALOHA (continued) • In LAN feedback is immediate. For satellite broadcast 270msec delay. • In both cases, if the frame is destroyed, user waits random amount of time before transmitting. • Such a system is called a contention system. • Figure on the next page …
ALOHA • PURE ALOHA (Refer to prev. figure) • Frames are the same size. • Whenever two frames try to occupy the channel at the same time collision occurs and there will be garbling. • If first bit of a frame overlaps with last bit of an earlier frame then both will be destroyed • What is the efficiency of an ALOHA channel? I.e., what percent of all transmitted frames escape collisions? • Next slide
ALOHA • Efficiency of PURE ALOHA (Continued) • Frames time is the amount of time needed to transmit a fixed length frame (frame length/bit rate) • Consider infinite number of stations • Station user is in one of 2 states (typing, waiting). Initially all users are in same state - typing. • When a line is finished, user stops typing waiting for a response. • Station transmits a frame containing the line and checks channel for success
ALOHA • Efficiency of PURE ALOHA (Continued) • If success, user sees reply & goes back typing • If unsuccessful user must wait while frame is retransmitted till ultimate success is met • Frame time = frame length/bit rate • Assume infinite population of users generates new frames according to Poisson distribution with mean N frames per frame time. (Infinite population ensures N does not decrease as users become blocked) • N > 1: frames generated at higher rate than channel can handle
ALOHA • For reasonable throughput 0< N < 1 • The mean of Prob. Of k transmissions per frame time (old and new) is G (offered load) per frame time. G>= N • S = GP0 • P0 is the prob. That a frame does not suffer a collision. • The prob. That k frames are generated during frame time is given by Poisson distribution and is equal to: • Pr[k] = ((G^k)*e^-G)/k!
ALOHA • Prob. Of Zero frames • In an interval that is 2 frame time long • The mean # of frames generated is 2G • P0 = e^(-2G) • S = G*e^(-2G)
Pure ALOHA Vulnerable period for the shaded frame. Vulnerable period for the shaded frame.
ALOHA • SLOTTED ALOHA • This method doubles the capacity of ALOHA • Divide time up into discrete intervals - each interval corresponding to one frame. • Users agree to slot boundaries - synchronization is necessary a clock could be used by a special station (“a metronome.”) • S = G e^{-G}. • Slotted ALOHA has a throughput twice that of pure ALOHA.
CSMA (Carrier sense multiple access) • In LAN’s it is possible for stations to detect what other stations are doing and reactively change. • With Slotted ALOHA utilization is 1/e. With CSMA we can improve performance. • These protocols are called carrier sense protocols. • They are named 1-persistent CSMA, non-persistent CSMA, p-persistent CSMA
1-persistent CSMA • 1-persistent CSMA • When station has data to send, it listens to channel. • Channel busy: station waits till channel is idle • Channel idle: station transmits frame • Collision: Station waits random time and transmits frame again • Propagation delay: If first station is sending and its signal has not yet reached second one (due to propagation delay) then second one detects idle channel and submits frame - collision.
1-persistent CSMA • 1-persistent CSMA (continued) • Propagation delay II: If propagation delay is zero, collision may still occur. Example - station 1 transmits. Stations 2, 3 simultaneously realize that line is busy and wait. When line is free, stations 2, 3 simultaneously transmit. Collision. • This is better than pure ALOHA since interference is reduced.
Non-persistent CSMA • Non-persistent CSMA • (A) Before sending, station senses channel. • If no transmission, station starts sending. • However, if busy, it does not continuously sense the channel in order to start transmitting • Instead, it waits random period before repeating from (A) • this is better than 1-persistent CSMA
p-persistent CSMA • p-persistent CSMA • (A) Before sending, station senses channel. • If no transmission, station starts sending. • However, if busy, it does not continuously sense the channel in order to start transmitting • Instead, it waits random period before repeating from (A) • this is better than 1-persistent CSMA
p-persistent CSMA • p-persistent CSMA • Applied to slotted channels. • When station is ready to send, it checks the channel. • If channel idle, it transmits with probability p. • therefore with probability q = 1 - p it defers till the next slot. • If next slot is idle it transmits or defers with probabilities p, q (as before) • Process continues until the frame is transmitted or another station has begun transmitting.
p-persistent CSMA • p-persistent CSMA (cont’d) • If another station has begun transmitting, it waits a random time and starts once more • If channel is initially busy, it waits until the next slot and applies the above algorithm • Figure on next slide shows the comparison between these protocols and pure and slotted ALOHA.
Comparison of multiple access protocols G (transmission attempts per frame time)
CSMA with Collision Detection • CSMACD • If two stations detect that channel is idle and simultaneously begin transmission, they will detect collision immediately. • In such a case, they immediately stop transmitting. • This saves bandwidth. • If time to transmit signal between two furthest stations is then the contention interval is 2 (read 2nd para on page 253 on your own) • Conceptual model on the next page.
CSMA with Collision Detection At time t0, a station has finished transmitting its frame. Now any other station with a frame to send may do so. Collisions are detected by looking at the power of the received signal and comparing it to the transmitted signal (signals are specially encoded in order to enable detection)