Download presentation
Presentation is loading. Please wait.
1
Chapter 4 MAC sublayer Dr. N Amanquah
Computer Networks Chapter 4 MAC sublayer Dr. N Amanquah Acknowledgements:
2
CHANNEL ALLOCATION PROBLEM:
Intro: Broadcast channels also called multi-access channels or random access channels. (contrast with point to point channel). Compare to conference call. Protocol for arbitration = MAC (a lower sublayer of DLL) MAC essential in LANs –because the medium is shared. WANs tend to be point to point (apart from VSATs) Problem: how to allocate channel among competing users. Idea 1: divide the channel up into the number of users on the network. Chap. 4- MAC
3
CHANNEL ALLOCATION PROBLEM:
STATIC CHANNEL ALLOCATION IN LANs AND MANS The traditional (phone company) way of allocating a single channel is Frequency Division Multiplexing. (See Figure) FDM works fine for limited and fixed number of users. N users, N equal sized freqs. No interference bt users Simple, efficient allocation w few users With large no. of users or bursty traffic: Inefficient to divide into fixed number of chunks. If >N users, denial of service occurs. Doesn't handle burstiness. Wasted bandwidth. Chap. 4- MAC
4
CHANNEL ALLOCATION PROBLEM:
STATIC CHANNEL ALLOCATION IN LANs AND MANS To send 10,000bits on 100Mbps line, takes 100 ms With queuing, consider associated delay. T=200 ms –ie with queuing (assumes channel is not divided between them) T = mean time delay C = capacity (bps) l = arrival rate (frames/sec) 1/ m = mean frame length (service rate= mC frame/sec) 1 T = mC - l Chap. 4- MAC
5
CHANNEL ALLOCATION PROBLEM:
STATIC CHANNEL ALLOCATION Dividing channel into N subchanels for all the N users Capacity of each subchannel =C/N 1 T = mC - l Also, the mean arrival rate (input) rate on each of the N channels is l/N. Now 1 N T(fdm) = = = NT m(C/N) - l /N mC – l Clearly, the mean delay in FDM is worse than if all the packets were arranged in one queue, using the entire channel capacity. Eg 10 networks, 10Mbps each, delay will now be 2ms (from 200us) Chap. 4- MAC
6
CHANNEL ALLOCATION PROBLEM:
Definitions Assumptions & definitions: Station Model - Each "station" generates packets/frames independently. No new frame till it is transmitted. The probability of producing a packet in the interval dt is dt where is the constant arrival rate. Single Channel Assumption - One shared channel; all stations are equivalent (no master). There is no other channel for arbitration Collision Assumption - If two frames overlap in any way time-period, there a collision=error retransmit Assumption: Collisions are the only possible error. Not considering token passing schemes. Chap. 4- MAC
7
CHANNEL ALLOCATION PROBLEM:
Definitions Continuous Time Transmission can begin at any time. Time is not in discrete chunks. Slotted Time - Frame transmissions always begin at the start of a time slot. Any station can transmit in any slot (with a possible collision.) Carrier Sense –(or lack of it) Stations can tell a channel is busy before they try it. this does not stop collisions. LANs have this, wireless networks (incl. satellite networks) do not effectively use this because they may not be within range of each other). Assume: nodes can terminate transmissions prematurely once collision is detected. Chap. 4- MAC
8
Multiple Access Protocols
Overview How to handle contention for the use of a channel. Contention systems Chap. 4- MAC
9
Multiple Access Protocols
Collisions work well for low utilization (they're not likely to happen.) Arbitration, works better at high utilization. ALOHA: Developed in Hawaii in the 1970s. –Norman Abrahamson; ground based radio An American engineer and computer scientist, most known for developing the ALOHAnet system for wireless computer communication. A.B. in physics from Harvard University (1953), an M.A. in Physics from UCLA (1955), and a Ph.D. in electrical engineering from Stanford University (1958). Chap. 4- MAC
10
PURE ALOHA: Every station transmits whenever it wants to. Colliding frames are destroyed. The sender listens if its frame got destroyed (or uses ack if it cannot listen while transmitting), If a collision, wait a random time and then retransmit, else synchronized collisions. 1. ANY overlap is a collision. 2. Best efficiency if frames are same size. To determine what proportion of transmissions are successful:
11
Multiple Access Protocols
Efficiency of a pure ALHOA channel: The Poisson distribution is used to model the number of events occurring within a given time interval. The formula for the Poisson pdf= e-m. mk k! m=mean, k =no of tries. The numbers of changes in non-overlapping intervals are independent for all intervals. 2. sample size N is large, Chap. 4- MAC
12
Multiple Access Protocols
New frames are generated according to poisson distr. Mean no of frames =N (ie #frames in frame time) If N>1, means more frames than can be handled Reasonable: 0<N<1 Note: retransmissions occur when collisions occur Det prob of successful tx: Mean # of offered frames= G frames/frame time (ie offered load) (G includes retransmissions) G>=N generally Reason: at low load N nearly means few collision, G=N At high load, G>N Througput = S =offered load G x Prob of success P. S=GP Success of transmissions means no other transmissions in 2 slots. See diagram. Chap. 4- MAC
13
Multiple Access Protocols
. P0 = probability that a frame does NOT suffer collision. S = P0 x G NB: vulnerable over two slots Chap. 4- MAC
14
Multiple Access Protocols
Prob Pk = GK e-G / k! Prob of no (other) tx in 1 slot = e-G In 2 slots, mean offered load =2G P of No other traffic: e-2G Throughput S=GP =G.e-2G Chap. 4- MAC
15
Multiple Access Protocols
Review: Probability that k frames are generated during a given frame time (Poisson distribution): G k e-G Pr[k] = k! Probability of no traffic initiated during the vulnerable period: P0 = e-2G so Throughput per frame time is: S = G e -2G (from S=GP) Chap. 4- MAC
16
Multiple Access Protocols
SLOTTED ALOHA: Doubles efficiency by dividing time into “time slots". Sends occur only at the start of a slot. Vulnerable period is 1/2 of pure Aloha case, so S = G e-G See graph. Best throughput is at G = 1 when S = 0.37; empty slots = Pr[0] = 0.37; Chap. 4- MAC
17
MULTIPLE ACCESS PROTOCOLS
CSMA 1-persistent CSMA Transmit with a probability of 1 if channel is idle. Non-persistent CSMA Wait random time p-persistent CSMA Transmit with a probability of p Chap. 4- MAC
18
Multiple Access Protocols
CARRIER SENSE MULTIPLE ACCESS PROTOCOLS: This is where the sender listens before ejecting something on the wire. Collision occurs when a station hears something other than what it sent. PERSISTENT AND NONPERSISTENT CSMA: 1-persistent CSMA Station listens. If channel idle, it transmits. If collision, wait a random time and try again. If channel busy, wait until idle. If station wants to send AND channel == idle then do send. Success here depends on transmission time - how long after the channel is sensed as idle will it stay idle (there might in fact be someone else's request on the way.) Chap. 4- MAC
19
Multiple Access Protocols
CARRIER SENSE MULTIPLE ACCESS PROTOCOLS: Nonpersistent CSMA (equivalent to 0-persistent CSMA) Same as above EXCEPT, when channel is found to be busy, don't keep monitoring to find THE instant when it becomes free. Instead, wait a random time and then sense again. Effect : Leads to 1) better utilization and 2) longer delays than 1 - persistent. p-persistent CSMA [For slotted channels.] If ready to send AND channel == idle then send with probability p, and with probability q = 1 - p defers to the next slot. Chap. 4- MAC
20
Multiple Access Protocols
CARRIER SENSE MULTIPLE ACCESS PROTOCOLS: CSMA WITH COLLISIONS DETECTION: CSMA/CD - used with LANs. When a station detects a collision, it stops sending, even if in mid-frame. Waits a random time and then tries again. What is contention interval -- how long must station wait after it sends until it knows it got control of the channel? It's twice the time to travel to the furthest station. -- Listen for collision during contention period Chap. 4- MAC
21
Multiple Access Protocols
COLLISION-FREE PROTOCOLS How long is a packet (or how long a wire is needed to contain a packet) of length 1500 bytes on a 100 Mbps ethernet? As cables become longer and faster, the above methods become less efficient. So, Bit map protocol - A "contention slot", subdivided into bits, allows each station to announce that it wants to send. After the announcement, all stations can send in priority order, and there will be no fighting over the channel. Called "reservation protocol". What are pros and cons of this method? Analyze at low and high loads. Binary Countdown - In the contention slot, each station places its ID. They all get or’d on top of each other. A particular station knows if it won because no wanting-to-send station had a higher number than it did in the slot. ( For instance, OR : The station knows it lost by the time it sends its second bit - it sees a “1” on the wire when it just sent out a “0”, so it knows the game is up. Chap. 4- MAC
22
Multiple Access Protocols
LIMITED-CONTENTION PROTOCOLS: Collision techniques work well for low utilization (they're not likely to happen.) Arbitration, which we'll talk about later, works better at high utilization. This method provides best of these techniques. Adaptive Tree Walk Divide the stations up into groups. Stipulate that only members of group 0 can arbitrate for slot 0, members of group 1 for slot 1, etc. Works because it cuts down on the contention felt by any particular station. Want a method that will have many members per group at low contention, and few (or one) member at high contention. Can use a binary search to do this. Chap. 4- MAC
23
Fiber Used WDMA (wavelength div mult access)
Divide spectrum into channels with two for each station Narrow control channel, wide band for data frames Divide channel into time slots Each station has two tx and two rx Fix wavelength rx for listening to its own control channel (others contact it on this chn) Tuneable tx for sending on other’s contrl chn Fixed wavelength tx for outputing frames (to others, they have to tune in) Tuneable rx for receiving data from others
24
Multiple Access Protocols- wireless
Wireless LAN Protocols IEEE Wide Range of uses: Infrared signals within a building Mobile computing Network of low flying satellites Physical Properties: The spec allows running over three possible media Radio using frequency hopping Radio using direct sequencing Infrared over short distances ( 10 meters ) Discuss spread spectrum radio FHSS, DSSS Chap. 4- MAC
25
MAC in wireless Collision Avoidance:
Wireless LAN Protocols IEEE MAC in wireless Collision Avoidance: Similar to Ethernet, but not quite the same -because all nodes don’t see each other Hidden Node problem A B C D Exposed Node problem AB C D Solution: use Multiple Access with Collision Avoidance ( MACA): RTSCTSData MACAW : (improvement): RTSCTSDataACK A. D. B. C.
26
IEEE 802.11 Infrastructure based Infrastructure-less
Communication between nodes on two different APs Infrastructure-less MANETs
27
Multiple Access Protocols
Wireless LAN Protocols IEEE Frame Format: Contains the following fields: Control - is the frame carrying data or is it RTS or CTS or is it forwarding data. Payload - up to 2312 bytes of data CRC - checksum of the packet. Addr(I) - It’s possible that the packet needs to be sent across the distribution system in which case we keep track of the original sender and the original receiver, but we also want to know intermediate senders and receivers. Control Duration Addr1 Addr2 Addr3 SeqCtrl Addr4 Payload CRC Chap. 4- MAC
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.