Download presentation
Presentation is loading. Please wait.
Published byAustin Chapman Modified over 9 years ago
1
Medium Access Control NWEN302 Computer Network Design
2
Multiple Access Links Two types of “links”: point-to-point –dial-up access –point-to-point link between Ethernet switch/hub and host broadcast (shared) –shared wire, e.g. Ethernet, (upstream) HFC, Token Ring/Bus –shared wireless, e.g. 802.11 WLAN, HiperLAN, WiMAX © Winston SeahNWEN302 Computer Network Design 1 shared wire (e.g., cabled Ethernet) shared RF (e.g., 802.11 WiFi) humans at a party (shared air, acoustical)
3
Medium Access Control (MAC) Distributed algorithm that determines how nodes share channel, i.e., determine when node can transmit Communication about channel sharing must use channel itself! no out-of-band (separate) channel for coordination © Winston SeahNWEN302 Computer Network Design 2
4
MAC Protocols: a taxonomy Channel Partitioning –divide channel based on time, frequency, code –allocate portion to node for exclusive use Random Access –channel not divided, allow collisions –“recover” from collisions Ordered Access –nodes take turns –nodes with more to send can take longer turns –nodes with higher priority get more turns © Winston SeahNWEN302 Computer Network Design 3
5
Ideal Multiple Access Protocol Broadcast channel of rate R bps 1. when one node wants to transmit, it can send at rate R. 2. when M nodes want to transmit, each can send at average rate R/M 3. fully decentralized: –no special node to coordinate transmissions –no synchronization of clocks, slots 4. simple © Winston SeahNWEN302 Computer Network Design 4
6
Channel Partitioning MACs TDMA: time division multiple access access to channel in "rounds" each station gets fixed length slot (length = packet transmission time) in each round unused slots go idle E.g: 6-station LAN, Stations1,3,4 have packets, slots 2,5,6 idle © Winston SeahNWEN302 Computer Network Design 5 1 3 4 1 3 4 6-slot frame
7
Channel Partitioning MACs FDMA: frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go idle E.g. 6-station LAN, Stations 1,3,4 have packets to send, frequency bands 2,5,6 idle © Winston SeahNWEN302 Computer Network Design 6 frequency bands time FDM cable 1 2 3 4 5 6
8
Channel Partitioning MACs Code Division Multiple Access (CDMA) Unique “code” assigned to each user; i.e., code set partitioning all users use same frequency but each user has own “chipping” sequence (code) to encode data encoded signal = (original data) X (chipping sequence) decoding: inner-product of encoded signal and chipping sequence Imagine people talking in different languages! © Winston Seah7NWEN302 Computer Network Design
9
Random Access Protocols When a node has a frame to send, –it transmits at the full channel data rate R –no a priori coordination among nodes When two or more nodes transmit frames simultaneously interference collision! NWEN302 Computer Network Design © Winston Seah8
10
Random Access Protocols A Random Access MAC protocol specifies: –how to detect collisions –how to recover from collisions (e.g., via delayed retransmissions) Examples of random access MAC protocols: –ALOHA (developed at Univ of Hawaii in 1970s) –Slotted ALOHA –Carrier Sense Multiple Access (CSMA) –CSMA with Collision Detection (CSMA/CD) –CSMA with Collision Avoidance (CSMA/CA) NWEN302 Computer Network Design © Winston Seah9
11
ALOHA Network © Winston SeahNWEN302 Computer Network Design 10 Connect central time-sharing computer (on main Oahu campus) with terminals elsewhere 2-channel star configuration –Users-to-computer; computer-to-users Random access communication for user transmissions; why random access? computer and user data are bursty…
12
ALOHA Protocol Basic idea is simple let users transmit whenever they have data to be sent. If two or more users send their frames at the same time, a collision occurs. If there is a collision, –sender waits a random amount of time and sends it again. Waiting time must be random; otherwise, the same frames will collide again. © Winston SeahNWEN302 Computer Network Design 11
13
A Sketch of Frame Generation Note that all frames have the same length because the throughput of ALOHA systems is maximized by having a uniform frame size. © Winston Seah12NWEN302 Computer Network Design
14
Throughput Throughput: –Number of frames successfully transmitted through the channel per frame time. Throughput of an ALOHA network can be determined through a simple performance analysis © Winston Seah13NWEN302 Computer Network Design
15
Assumptions Infinite population of users New frames are generated according to a Poisson distribution with mean S frames per frame transmission time. –Probability that k frames are generated during a given frame transmission duration: http://homepage.stat.uiowa.edu/~mbognar/applets/pois.html © Winston Seah14NWEN302 Computer Network Design frame S new frames arriving time
16
Observation on S If S > 1, frames are generated at a higher rate than the channel can handle. Therefore, we expect: 0 < S < 1 If the channel can handle all the frames, then S is the throughput. © Winston SeahNWEN302 Computer Network Design 15
17
Packet Retransmission In addition to the new frames, the stations also generate retransmissions of frames that previously collided. Assume that distribution of frames (new + retransmitted) generated is also Poisson with mean G per frame time. © Winston SeahNWEN302 Computer Network Design 16
18
Relation between G and S Clearly, G ≥ S At low load, few collisions: G S At high load, many collisions: G > S Under all loads, S = GP 0 where P 0 is the probability that a frame does not suffer a collision. © Winston Seah17NWEN302 Computer Network Design
19
Vulnerable Period Under what conditions will the shaded frame arrive undamaged? © Winston SeahNWEN302 Computer Network Design 18
20
Throughput Vulnerable period: from t 0 to t 0 +2t Probability that no other frame is generated during the vulnerable period is: P 0 = e -2G Using S = GP 0, we get S = Ge -2G © Winston Seah19NWEN302 Computer Network Design
21
Slotted ALOHA Assumptions: all frames are of the same size time divided into equal size slots (time to transmit 1 frame) nodes start to transmit only at beginning of a slot nodes are synchronized if two or more nodes transmit in slot, all nodes will detect the collision © Winston SeahNWEN302 Computer Network Design 20
22
Slotted ALOHA Operation: when a node obtains a new frame, it transmits it in next slot –if no collision: node can send a new frame in next slot –if collision: node retransmits the frame in each subsequent slot with probability p until it is successful © Winston SeahNWEN302 Computer Network Design 21
23
Slotted ALOHA Pros single active node can continuously transmit at full rate of channel highly decentralized: only slots in nodes need to be in sync simple Cons collisions, wasting slots idle slots nodes may be able to detect collision in less than time to transmit packet clock synchronization NWEN302 Computer Network Design © Winston Seah22
24
Slotted Aloha Throughput Assume there are N nodes with many frames to send, and each transmits in a slot with probability, p Probability that a given node is successful in transmitting a frame in a slot p(1-p) N-1 Probability that any node is successful in transmitting a frame in a slot Np(1-p) N-1 © Winston SeahNWEN302 Computer Network Design 23
25
Slotted Aloha Throughput Maximum throughput: find p* that maximizes Np(1-p) N-1 For an arbitrary number of nodes, take limit of Np*(1-p*) N-1 as N infinity, we get: Max efficiency = 1/e =.37 Channel used for useful transmissions only 37% of time! © Winston SeahNWEN302 Computer Network Design 24
26
Slotted ALOHA Throughput Vulnerable period: from t 0 +t to t 0 +2t Since transmission time is divided into discrete intervals, only the slot in which a frame is being transmitted is vulnerable. Probability that no other frame is generated during the vulnerable period is: P 0 = e -G Hence, S = Ge -G © Winston Seah25NWEN302 Computer Network Design
27
Relation between G and S Aloha: Max throughput occurs at G=0.5, with S=1/(2e)=0.184. Slotted Aloha: Max throughput occurs at G=1.0, with S=1/e=0.37. © Winston Seah26NWEN302 Computer Network Design
28
Carrier Sense Multiple Access Start: listen/sense the channel If idle: –transmit entire frame, and wait for acknowledgement (ACK) if no ACK received after specified duration, assume there was a collision. If busy: –defer transmission don’t transmit! Vulnerable period: one t prop © Winston SeahNWEN302 Computer Network Design 27
29
CSMA – 1-Persistent Start: –sense channel if busy, –go back to Start: if idle, –send immediately –if collision is detected (i.e. no ACK) wait a random amount of time go back to Start: 28© Winston SeahNWEN302 Computer Network Design
30
CSMA Non-Persistent Start: –sense channel if busy, –wait a random amount of time –go back to Start: if idle, –send immediately (if collision detected, same as 1-persistent mode) Not retrying immediately less collisions Drawback: more delay 29© Winston SeahNWEN302 Computer Network Design
31
CSMA p-Persistent Start: –sense channel if busy, –go back to Start: if idle, –with probability p, transmit packet –with probability 1-p, wait t prop ; go to Start: –if collision detected, same as 1-persistent Reduced idle channel time (1-persistent) & Reduced collisions (non-persistent) 30© Winston SeahNWEN302 Computer Network Design
32
CSMA collisions NWEN302 Computer Network Design Collisions can still occur: propagation delay means two nodes may not hear each other’s transmission entire packet transmission time wasted Vulnerable period: t prop t prop : maximum one-way propagation delay between any two nodes distance & propagation delay crucial in determining collision probability spatial layout of nodes © Winston Seah31
33
CSMA/CD (Collision Detection) 1-persistent approach Continue channel sensing as frame is being transmitted If collision detected, –stop frame transmission immediately; –transmit a brief jamming signal Wait for a random time, and restart sequence. © Winston SeahNWEN302 Computer Network Design 32
34
Collision Detection Easy in wired LANs: –measure signal strengths, compare transmitted, received signals –CSMA/CD is used in Ethernet – the dominant wired LAN technology Difficult in wireless LANs: –received signal strength overwhelmed by local transmission strength –alternative approach needed avoidance –more later… © Winston SeahNWEN302 Computer Network Design 33
35
CSMA/CD efficiency t prop = maximum propagation delay between 2 nodes t trans = time to transmit maximum-size frame Efficiency/throughput goes to 1 –as t prop goes to 0 –as t trans goes to infinity better performance than ALOHA, and simple, cheap, decentralized ! © Winston SeahNWEN302 Computer Network Design 34
36
Channel Utilization Comparison of the channel utilization versus load for various random access protocols.
37
Summary of MAC protocols channel partitioning –TDMA, FDMA and CDMA random access (dynamic), –ALOHA –Slotted ALOHA –CSMA –CSMA/CD used in Ethernet / 802.3 CD (collision detection) easy in some technologies (wire) hard in others (wireless) –CSMA/CA used in 802.11 taking turns –polling from central site, token passing –Bluetooth, FDDI, IBM Token Ring © Winston SeahNWEN302 Computer Network Design 36
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.