Communication Networks NETW 501 Lecture 5 Medium Access Control Course Instructor: Dr.-Ing. Maggie Mashaly maggie.ezzat@guc.edu.eg C3.220
Outline Medium Access Protocols Channelization Summary Random Access ALOHA CSMA CSMA/CD Scheduling Reservation Polling Token Passing Summary Channelization FDMA TDMA CDMA
Multiple Access Protocols Why do we need Medium Access Control? Multiple Access Protocols Random Access Scheduling
Random Access
Electrical Engineering ALOHA Protocols Hawaii Islands 1970s University of Hawaii needed a means to inter-connect terminals located at campuses on multiple islands to the host computer on main campus Packet Radio Messages are transmitted as soon as they become available Electrical Engineering Arts Management
ALOHA Operation Collision No Collision Terminal A Terminal A Terminal A Terminal B Terminal B Terminal B Collision Transmissions from two or more terminals overlap in time ALOHA Operation Messages transmitted once available From time-to-time messages collide (treated as erroneous frames) The terminal knows that its messages was corrupted when it receives no acknowledgements within 2tprop (i.e., a timeout is used) Recovery by the use of retransmissions Can we simply apply retransmission directly after timeouts? NO! Retransmissions will collide again SOLUTION: Retransmission after random intervals from timeouts (Backoff Algorithm)
Re-Transmission IF NECESSARY ALOHA Operation First Transmission Re-Transmission IF NECESSARY t0-X t0 t0+X t0+X+2tpropo t0+X+2tprop+B Vulnerable Period Backoff Period Timeout Vulnerable Period: Collision will occur if any other terminal commences transmission within this period Backoff Period Random time set for retransmission
Slotted ALOHA Objective Reduce the probability of collisions HOW? Transmission in synchronized slots Avoid partial collisions First Transmission Re-Transmission IF NECESSARY (k+2+B+ciel(2tprop/X))X kX (k+1)X (k+2)X +2tprop Backoff Period Vulnerable Period Timeout
ALOHA Performance System Load G: Average number of packets generated within packet transmission time X Throughput S: Average number of packets transmitted successfully within packet transmission time X
Carrier Sense Multiple Access Low throughput of ALOHA is due to waste of bandwidth due to collisions CSMA: Sense (i.e., Listen) the medium for presence of a carrier signal before transmission A terminal transmit only if a sense an idle channel Widely used in LAN with Bus Topology Vulnerable period = tprop Network Diameter A B C Station A starts transmission at time t=0 A B C At time tprop (for electrical energy to propagate from A to C) all network terminals would have listened to the transmission from A. Terminal A is said to have captured the channel
Classes of CSMA CSMA schemes vary with the behavior when the terminal has something to send and channel is sensed to be busy 1-Persistent CSMA If channel is busy continue to sense channel As soon as channel is sensed idle transmit frame In case of collisions, a backoff algorithm is used to set a time to re-sense the channel Non-Persistent CSMA If channel is busy, immediately run the backoff algorithm to set a time to re-sense the channel p-Persistent CSMA If channel is busy continue to sense channel As soon as channel is sensed idle transmit frame with probability p. With probability (1-p) wait for tprop before sensing the channel again In case of collisions, a backoff algorithm is used to set a time to re-sense the channel
Performance of CSMA
CSMA with Collision detection (CSMA/CD) TIME: t=0 Station A starts transmission In both ALOHA and CSMA, when collision occurs we lose at least a full transmission time for nothing CSMA/CD Abort transmission when a collision is detected A B TIME: t=tprop-ε Station B sense an idle channel and starts transmission A B TIME: t=tprop Station B detects a collision and aborts transmission A B TIME: t=2tprop- ε Even though Station B has aborted transmission, its initial signal arrives at A. A detects a collision and aborts transmission A B
GENERALLY: AFTER N COLLISIONS Exponential Backoff Algorithms FIRST COLLISION Wait 0 or 1 transmission frames (chosen randomly) before trying again SECOND COLLISION Wait 0, 1,2 or 3 transmission frames (chosen randomly) before trying again THIRD COLLISION Wait 0, 1,2,… or 7 transmission frames (chosen randomly) before trying again GENERALLY: AFTER N COLLISIONS Wait 0 to 2N-1 transmission frames if N≤10 before trying again. N>10, wait between 0 and 1023 (210-1) Give up at N=16
Exponential Backoff Algorithms Data Packet from Upper Layer NB=0, CW=2, BE =macMinBE Delay for Random (2BE-1) Slots Perform CCA (1st or 2nd ) CCA Success? Yes No CW=2, NB=NB+1, BE =min(BE+1,macMaxBE) CW=CW-1 No NB> maxNB? CW=0? No Yes Yes Packet Discard Packet Transmission
Exponential Backoff Algorithms Tslot
References NETW 501 Lectures slides by Assoc. Prof. Tallal El-Shabrawy “Communication Networks 2nd Edition”, A. Leon-Garcia and I. Widjaja, McGraw Hill, 2013 “Computer Networks 4th Edition”, A. S. Tanenbaum, Pearson International