Download presentation
Presentation is loading. Please wait.
1
Lecture #9 MAC Protocols
Asma Alosaimi
2
Multiple Access Links and Protocols
Two types of “links”: point-to-point PPP for dial-up access point-to-point link between Ethernet switch and host broadcast (shared wire or medium) old-fashioned Ethernet wireless LAN humans at a cocktail party (shared air, acoustical) shared wire (e.g., cabled Ethernet) shared RF (e.g., WiFi) shared RF (satellite)
3
Point to point link Direct connection between two hosts, medium connecting hosts is 100% available to the two endpoint hosts
4
Broadcast link The medium connecting the hosts is shared between many hosts. Each time a frame is sent (broadcast or unicast) every other host attached to the medium receives a copy A multiple access protocol is used to define how that sharing is accomplished
5
Multiple Access Protocols
LAN is a single shared broadcast channel two or more simultaneous transmissions by nodes interference, namely a collision if any node receives two or more signals at the same time. Multiple Access Protocol (MA) distributed algorithm that determines how nodes share channel, i.e., determine when a node can transmit. communication about channel sharing must use channel itself! Assumes no out-of-band channel for coordination.
6
MAC Protocols idea given: broadcast channel of rate R bps desiderata:
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. no collision, no interference 5. simple
7
MAC Protocols Three broad classes: Channel Partitioning Random Access
divide channel into smaller “pieces” (time slots, frequency, code). allocate piece to node for exclusive use. Random Access channel not divided, allow collisions. “recover” from collisions. “Taking Turns” nodes take turns, but nodes with more to send can take longer turns.
8
LAN MAC protocols Fixed assignment protocols: Dynamic MAC protocols:
each node is allocated a predetermined fixed amount of the channel resources Frequency division multiple access. Time division multiple access. Wavelength division multiple access. Code division multiple access. Dynamic MAC protocols: Round robin protocols: Contention protocols Reservation protocols
9
Fixed assignment protocols Channel Partitioning: 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 The bandwidth of each node’s carrier is constrained within certain limits such that no interference, or overlap, occurs between different nodes. Example: 6-station LAN, 1,3,4 have pkt, frequency bands 2,5,6 idle frequency bands time FDM cable
10
Channel Partitioning: FDMA
C = n. w C: bandwidth of channel Hz w.: bandwidth of each sub-channels Hz n: number of connected nodes to the channel. Example: Channel with 48 kHz bandwidth, its frequency 60 kHz- 108 kHz. If each node needs 4 kHz. Then 48÷4= 12 sub-channels needed. Therefore; 12 devices or nodes can use the channel at the same time.
11
Channel Partitioning: FDMA
12
Channel Partitioning: FDMA
13
Fixed assignment protocols Channel Partitioning: TDMA
Time-division multiple access In TDMA, a radio spectrum is divided into time slots. These time slots are allocated for each user to transmit and receive information. The number of time slots is called a frame. Information is transferred and received in form of frame. A frame is consists a preamble, an information message and trial bits. access to channel in “cycles“ or”rounds” each station gets fixed length slot (length = pkt trans time) in each cycle unused slots go idle, channel utilization may be low example: 6-station LAN Frame 1: 1,2,4,5 have pkt, slots 2 and 6 idle Frame 2: 2,5,6 have pkt, slots 1 ,3,4 idle 6-slot frame 1 3 4 1 3 4
14
TDMA Advantage: collision free Disadvantage:
Unused slot at a node goes useless while another node could use it. TDMA requires time synchronization Why is time synchronization a headache ? Extra communication Synchronization error. Does not scale 6-slot frame 1 3 4 1 3 4 14 Station 3 has another packet but cannot send it until the next turn comes while stations 2,5,6 are wasting slots
15
TDMA When is TDMA good? Huge traffic v Predictable traffic
Smaller network (in hop-count and # of nodes) When is TDMA bad? light traffic Random/unpredictable traffic Too large a network (in hop-count and # of nodes)
16
Fixed assignment protocols Channel Partitioning: CDMA
CDMA (Code Division Multiple Access) Used mostly in wireless broadcast channels such as cellular phones All users share same frequency band. Information from each user is spread throughout that frequency band Each user has their own orthogonal Walsh code ‘chipping’ sequence to encode data. all users transmit information simultaneously by using the same carrier frequency. Each user has its own CodeWord, which is orthogonal to other users. To detect the message, the receiver should know the codeword used by the transmitter. In CDMA unlike FDMA and TDMA the number of users is not limited. It has a soft capacity. But due to large number of users its performance degrades. In CDMA, each user operates independently with no knowledge of the other users.
17
Channel Partitioning: CDMA
encoded signal = (original data) X (Walsh code) Encoded signals from each channel are added, the summed signal is transmitted The orthogonal property of Walsh codes guarantees that (ignoring transmission errors) multiplying the received signal by a Walsh code will extract the data for the channel encoded using that Walsh code from the received (summed) signal. Decoded signal = (received summed signal X Walsh code) Frequency Hopping spread spectrum (FHSS) Direct Sequence Spread Spectrum (DSSS)
18
Channel Partitioning: CDMA
19
Fixed assignment protocols Channel Partitioning: WDMA
wavelength-division multiple access Mostly used in fiber optics because fiber optics have a very wide frequency bandwidth. The available bandwidth is divided into sub-channels. It achieved by allocating communicating nodes with different wavelength of signals. each node’s carrier is constrained within certain limits of wavelength such that no interference, or overlap, occurs between different nodes.
20
Channel Partitioning: WDMA
21
Fixed Assignment protocols
Advantages: Effective usage of the channel Channel Multiple access with no overlaps, collisions. Effective if the channel capabilities is great; frequency bandwidth, wavelength, transmit rate. Disadvantages: In computer networks, channel resources may not be used at the optimal level.
22
Dynamic MAC protocol No fixed assignment for transmission media or any network resources .. It allows transmission when needed. Contention Protocols Reservation Protocols Round Robin Protocols
23
Dynamic mac protocol: contention protocol
Pure Aloha Multiple Access Slotted Aloha Multiple Access Carrier Sense Multiple Access (CSMA) Carrier Sense Multiple Access/ Collision Detection (CSMA/CD) Carrier Sense Multiple Access/ Collision Avoidance (CSMA/CA)
24
Dynamic mac protocol: contention protocol: Pure (unslotted) ALOHA
unslotted Aloha: simpler, no synchronization Used in wireless LAN. First used in Haway uni, in ALOHA. Best used when traffic is low. when frame first arrives transmit immediately collision probability increases: frame sent at t0 collides with other frames sent in [t0-1,t0+1]
25
Pure (unslotted) ALOHA
Advantages: Simple to implement. Transmission only when needed. Disadvantages: Unlimited delay if number of connected nodes are huge; lots of collisions. No effective utilizing to channel due to collisions.
27
Dynamic mac protocol: contention protocol: Slotted ALOHA
Assumptions: uses discrete time intervals as slots (i.e., slot = one packetor frame transmission time) All nodes are synchronized so time can be divided into fixed length slots, with the first slot beginning at a reference time all frames same size nodes start to transmit only slot beginning if 2 or more nodes transmit in slot, all nodes detect collision Operation: when node obtains fresh frame, transmits in next slot if no collision: node can send new frame in next slot if collision: node retransmits frame in each subsequent slot with prob. p until success
28
Slotted ALOHA Node 1 Node 2 Node 3 Node 4
collision Retransmit success single node can continuously transmit at full rate of channel Slots in nodes need to be in sync between nodes Frames that overlap do so completely, reducing contentions Collisions cause frequent retransmission, idle slots Nodes may be able to detect collision in less than time to transmit packet so extra time is spent transmitted packets known to be corrupted
29
Slotted ALOHA Advantages: Disadvantages: Decrease collisions.
Collision may occur only at starting of time slot not at any time as Pure Aloha Multiple Access. better in utilizing channel than Pure Aloha Multiple Access. Simple to implement. Disadvantages: Collisions still may occur . Unlimited delay if number of connected nodes are huge; lots of collisions.
31
Dynamic mac protocol: contention protocol Carrier Sense Multiple Access
CSMA: listen (sense channel) before transmit: A protocol in which a node verifies the absence of other traffic before transmitting on a shared transmission medium. Transmitter uses feedback from a receiver to determine whether another transmission is in progress before initiating a transmission. That is, it tries to detect the presence of a carrier wave from another station before attempting to transmit. Less collisions occur than ALOHA, due to carrier sense before transmitting data
32
Carrier Sense Multiple Access
If channel sensed idle: Transmit entire frame immediately Check integrity of packet, if packet sent similar to received, transmission successes. Otherwise, collision occurs, wait for random period then repeat the transmission again. If channel sensed busy: 1-persistant CSMA: Listen until the channel is available then the station transmits as soon as the medium is available (immediately with probability 1) Non-persistant CSMA: station waits a random time period and the checks the medium again, transmitting immediately if the channel is now free (better U but longer delays) P-persistant CSMA: Listen until the channel is available, then transmit with probability p. (Probability q=1-p that the station will wait one time period, usually the maximum propagation delay, to transmit) Channel is not sensed during transmission, whole packet is sent even if a collision occurs Non CSMA persistent: In this protocol, before sending the data, the station senses the channel and if the channel is idle it starts transmitting the data. But if the channel is busy, the station does not continuously sense it but instead of that it waits for random amount of time and repeats the algorithm. Persistent CSMA When the sender (station) is ready to transmit data, it checks if the transmission medium is busy. If so, it then senses the medium continually until it becomes idle, and then it transmits the message (packet). P-persistent CSMA: When the sender is ready to send data, it checks continually if the medium is busy. If the medium becomes idle, the sender transmits a frame with a probability p. If the station chooses not to transmit (the probability of this event is 1-p), the sender waits until the next available time slot and transmits again with the same probability p.
33
CSMA Persistence Summary
34
CSMA collisions collisions can still occur: propagation delay means two nodes may not hear each other’s transmissions Consider node A starts transmitting packet 1 at time t0. Node C starts transmitting packet 2 at time t1. The propagation time from A to C is 2t1 Collision has occurred but has not been detected Time t2=1.5*t1 A B C Collision detected at station B starting at time 2t1 Time t3=2*t1 A C A B Collision may never detected at station A or station C Time t3=2.5*t1 B C
35
CSMA Collisions propagation delay means two nodes may not hear
spatial layout of nodes Collisions can still occur: propagation delay means two nodes may not hear each other’s transmission. Collision: entire packet transmission time wasted. Note: The role of distance & propagation delay in determining collision probability K & R
36
Persistent and Non-persistent CSMA
Figure 4-4. Comparison of the channel utilization versus load for various random access protocols. Tanenbaum
37
CSMA ( cont.) Better use of CSMA achieved with better carrier sense.
Carrier sense may be difficult when network channel is long. CSMA is not effective with long network channel . Slotted CSMA: dividing time to slots, sense only when starting time of the slot.
39
CSMA ( cont.) Advantages: Disadvantages:
Less collisions probabilities compared to ALOHA. Transmission on demand only. Disadvantages: Unknown delay when more nodes are connected. Collisions still occur. Network with heavy traffic may not benefit with CSMA.
40
Dynamic mac protocol contention protocol : CSMA\CD
Carrier Sense Multiple Access\collision Detection (CSMA\CD): It uses a carrier sensing scheme in which a transmitting data station detects other signals while transmitting a frame, and stops transmitting that frame, transmits a jam signal, and then waits for a random time interval (referred to as the backoff) before trying to resend the frame. When collision detection: it sends Jamming Signal to tell other stations that collision has occurred. CSMA/CD is used to improve CSMA performance by terminating transmission as soon as a collision is detected
41
CSMA\CD Main procedure:
Is my frame ready for transmission? If yes, it goes on to the next point. Is medium idle? If not, wait until it becomes ready Start transmitting. Did a collision occur? If so, go to collision detected procedure. Reset retransmission counters and end frame transmission.
42
CSMA\CD Collision detected procedure:
Continue transmission (with a jam signal instead of frame header/data/CRC) until minimum packet time is reached to ensure that all receivers detect the collision. Increment retransmission counter. Was the maximum number of transmission attempts reached? If so, abort transmission. Calculate and wait random back off period based on number of collisions. Re-enter main procedure at stage 1.
43
CSMA\CD Advantages: Disadvantages:
Less collision occurred compared to CSMA. Transmission on demand. Disadvantages: Unknown delay when more nodes are connected. Wasted time exits due to collisions, but better performance and wasted time compare to CSMA. Used mostly in IEEE LANs, and called Ethernet Protocol; developed by Xerox.
45
Dynamic mac protocol: contention protocol: CSMA\CA
Carrier Sense Multiple Access\Collision Avoidance CSMA\CA Each station will sense the channel and inform all the rest station in the network that it will start transmitting data over the channel. In this protocol the collision may occur between Request To Send RTS frames or Confirm to Send CTS frames. Collisions don’t occur between data frames.
48
CSMA\CA Advantages: Disadvantages:
Collisions do NOT occur between data frames. Transmission on demand only. Channel utilization is efficient when request and confirm to send done successfully. Used mostly and better for Wireless networks. Disadvantages: Unlimited waste of time (waiting) if nodes connected are large. Used in Wireless LANs and Apple Talk for apple devices.
49
Contention protocol advantages and disadvantages:
Transmission on demand. Better used for discontinuous transmission of signal and data (computer networks in general) Better used in networks with light traffic. Disadvantages: Large number of connected nodes results in not utilizing the channel effectively. Wasted time (waiting) Sensing channels becomes difficult in large and long network channels
50
Dynamic MAC protocol Round Robin Protocols
an arrangement of choosing all elements in a group equally in some rational order. Token pass Polling. Token pass protocol: Ring Topology; IMB, FDDI. A signal called a token is passed between nodes that authorizes the node to communicate Token is needed to allow transmission of data.
51
Dynamic mac protocol: Token pass protocol
52
Dynamic mac protocol: Token pass protocol
53
Dynamic mac protocol: Token pass protocol
Advantages: Allow transmission only when needed. Limited delay time; where maximum delay time is not more than time needed to pass the token over network. D: n T+ t D: maximum delay time n: number of nodes in Ring network. T: time needed to transmit data. t: total time needed to pass the token.
54
Dynamic mac protocol: Token pass protocol
Disadvantages: Losing the token resulting in disabling all network. If token doesn’t work, network will stop. t time needed to pass the token is wasted and not being used to transmit data. t time increase if network is large and token needed to transmit to farther places. Ring topology disadvantage applies as this protocol applies with ring topology.
55
Dynamic mac protocol: polling protocol
used usually with tree topology. Used in networks with mainframe. Or one central station control the network. Works with topologies in which one device is designated as a primary station and the other devices are secondary. All data exchange must be made through the primary device. The primary device controls the link, secondary devices follow its instructions.
56
Dynamic mac protocol: polling protocol
Primary station asks all secondary devices if they have data be to sent. Secondary devices reply with data or NAK if not. Primary receive the data and determine where to send it to other secondary devices or keep it for it self. Primary device asks the secondary devices again if they have data to be sent …
57
Dynamic mac protocol: polling protocol
Advantages: Limited delay time; complete circle polling time. transmission is guaranteed with full transmission media bandwidth and resources. Disadvantages: Time to poll data from each secondary device is wasted when it has not data to be sent. If more secondary devices are connected, then wasted polling time increased. Polling protocol stopped if primary device stopped or disabled.
58
Dynamic mac protocol: polling protocol
59
Dynamic mac protocol: polling protocol
Polling protocols: Roll-call Polling: Primary device asks (polls) all secondary devices in one polling cycle. Hub-polling : Primary device start to poll first secondary device, and after it completes sending its data it pass the polling to the next secondary device .. etc Save more time where secondary devices usually close to each other more than primary device, so save polling time.
60
Dynamic mac protocol: polling protocol
Binary Tree polling: Divide the network to two sections, polls the first section, if there is ACK, re-divide the section into two sections and polls again. Until secondary device is allocated. This type is preferred if number of nodes are huge with low traffic. In case of high traffic in network, previous type are preferred more.
61
Dynamic mac protocol: contention protocol
Used to best utilize the channel. Used effectively when nodes send data discontinuous; computer network. Sometimes is called: Multiple Access Nodes are connected to channel via two transmission media; one to send data and one to receive data. data is send in form of packets or data frame. Packet, data frame consists of sender address, destination address, data, data used to control media. Devices compete to transmit its data, therefore: Collision may occur.
62
Dynamic mac protocol: Reservation protocols:
To better channel utilizing and eliminate attenuation may occur in network channels due to collisions; Distributed Queue Dual Bus (DQDB): This protocol is intended to be used on a dual-bus configuration (unidirectional) fiber optic networks. Two buses , each one in one direction, and each node is connected to the two buses. Centralized unit for each bus to control transmission.
63
Dynamic mac protocol: Reservation protocols: DQDB
64
Dynamic mac protocol: Reservation protocols: DQDB
Each centralized unit will send empty frames to the channel, which can be used by connected nodes to transmit data. Each frame has 2 flags; one to identify whether the frame is empty and ready for used or has been reserved by another node. The other flag identifies if there is a Reservation request of frames on the other channel (bus). This protocol needed 2 counters in each connected node, that determine the number previous reservations for each channel, the counters will be incremented each time a frame with reservation flag on passes the connected node.
65
Dynamic mac protocol: Reservation protocols: DQDB
When a node wants to send data to another node: Chooses which channel will be used. Turn on the reservation flag on a frame on the other channel. The node will then use one of the empty frames with its data. This protocol is used in Ring networks, LAN and MAN networks.
67
Dynamic mac protocol: Reservation protocols: DQDB
Advantages: Transmission guaranteed. Limit delay time. Channel utilization %100 Disadvantages: Number of software needed for each connected node to control and determine the location of the node in the network. The need for cartelized unit to control frames. If the cartelized unit stopped, the protocol is stopped.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.