Presentation is loading. Please wait.

Presentation is loading. Please wait.

Medium Access Control Sub Layer

Similar presentations


Presentation on theme: "Medium Access Control Sub Layer"— Presentation transcript:

1 Medium Access Control Sub Layer

2

3 Contents Multiple Access Protocols ALOHA
Carrier Sense Multiple Access Protocols Collision-Free Protocols This presentation deals with broadcast networks and their protocols.

4 The Channel Allocation Problem
In broadcast networks the key issue is how to determine how gets to use the channel when there is competition for it Static Channel Allocation in LANs and MANs FDM or TDM allocation Problems when there is a large number of users, since spectrum will be wasted Dynamic Channel Allocation in LANs and MANs A number of assumptions are in place

5 Dynamic Channel Allocation (1)
Station Model. The model consists of N independent stations Single Channel Assumption. A single channel is available for all communications Collision Assumption. If two frames are transmitted simultaneously , they overlap in time and the resulting signal is garbled. This event is called a collision. All station can detect collisions A collided frame must be transmitted again latter There are no errors other than those generated by collisions

6 Dynamic Channel Allocation (2)
(a) Continuous Time Frame transmission can begin at any time There is no master clock dividing the time into discrete intervals (b) Slotted Time Time is divided into discrete intervals called slots. Frame transmission begins at the beginning of the slot A slot may be idle, may have one frame (legal) and may have multiple frames (collision) (a) Carrier Sense Stations can tell if the channel is in use before trying to use it If channel is in use, no station will attempt to use it before goes idle (b) No Carrier Sense Stations can’t sense the channel before trying to use it They go ahead and transmit … only later they can say it was an error

7 Multiple Access Protocols
ALOHA Carrier Sense Multiple Access Protocols Collision-Free Protocols Wireless LAN Protocols

8 In pure ALOHA, frames are transmitted at completely arbitrary times.
Whenever two frames will try to occupy the channel at the same time, there will be a collision, and both will be garbled. ALOHA is using fixed length frames.

9 Figure 12.3 Frames in a pure ALOHA network

10 Pure ALOHA (2) Frame time – the amount of time needed to transmit the standard fixed length frame An infinite population of users generates new frames according to a Poisson distribution, with mean N frames per time frame. If N >1 than more frames than the channel can handle 0<N<1 for reasonable throughput

11 Pure ALOHA (3) In addition to new frames, stations generate retransmissions. The probability of k transmission attempts per frame time, old and new combined, is also Poisson, with mean G per frame G >= N (equal when there are no retransmissions) Throughput of a channel is: S = G P0, where P0 is the probability that a frame doesn’t suffer collisions

12 Vulnerable period for the shaded frame.
Pure ALOHA (3) Vulnerable period for the shaded frame. If we are looking at the when a frame can suffer collisions, we can see that there is a vulnerable period of 2 times the frame time.

13 Figure 12.5 Vulnerable time for pure ALOHA protocol

14 Pure ALOHA (4) The probability that k frames are generated during a given frame time is given by Poisson distribution: So the probability of zero frames is just e-G In the vulnerable interval, the mean number of frames generated is 2G, so the probability that there is no frame is therefore P0 = e-2G Using the formula S = G P0, we obtain: The maximum throughput occurs at G = 0.5. For G = 0.5 we get S = 1/2e = 0.184

15 Slotted ALOHA Assumptions all frames same size
time is divided into equal size slots, time to transmit 1 frame nodes start to transmit frames only at beginning of slots nodes are synchronized if 2 or more nodes transmit in slot, all nodes detect collision Operation when node obtains fresh frame, it transmits in next slot no collision, node can send new frame in next slot if collision, node retransmits frame in each subsequent slot with prob. p until success DataLink Layer

16 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 DataLink Layer

17 Figure 12.6 Frames in a slotted ALOHA network

18 Figure 12.7 Vulnerable time for slotted ALOHA protocol

19 Slotted ALOHA The time is divided into discrete intervals, each interval corresponding to one frame. The users will need to be synchronized with the beginning of the slot Special station can emit a pip at the start of each interval A computer is not allowed to send data at any arbitrary times, it will be forced to wait until the next valid time interval Since the vulnerable period is now halved, the throughput of this method would be: Slotted ALOHA peaks at G=1 :: so S=1/e=.368 (i.e. 37 % success)…..a small increase in channel load will drastically reduce its performance.

20 Pure ALOHA vs. Slotted ALOHA
Throughput versus offered traffic for ALOHA systems.

21 CSMA Protocols Are protocols in which stations listen for a carrier (i.e. transmission) and act accordingly Networks based on these protocols can achieve better channel utilization than 1/e Protocols 1 persistent CSMA Non persistent CSMA p persistent CSMA CSMA CD

22 1 Persistent CSMA 1 persistent CSMA
When a station has data to send, it first listens to the channel If channel is busy, the station waits until the channel is free. When detects an idle channel, it transmits the frame If collision occurs, it will wait an random amount of time and starts again The protocol is called 1 persistent, because the station sends with probability of 1 when finds the channel idle, meaning that is continuously listening Propagation delay The propagation delay has an important effect on the performance of the protocol. There is a small chance that just after a station begins sending, another station will sense the channel and start sending (before the signal from the first one reached it). In this situation a collision can occur. The longer the propagation delay, the more important this effect becomes, and the worse the performance of the protocol. Even if the propagation delay is zero, there will still be collisions – imagine two station wanting to transmit data at the same time. But a third one is buy transmitting. Both station will wait until the third will finish is transmission, will sense idle channel and will start sending.

23 Non Persistent CSMA Before sending a station senses the channel. If no activity, it sends its frame If channel is busy, then will not continue to sense the channel until it becomes idle, but it will retry at a latter time (waiting a random period of time and repeating the algorithm) With this algorithm, fewer collisions will happen; thus better channel utilization but with longer delays than 1 persistent CSMA algorithm

24

25 p Persistent CSMA It applies to slotted channels
When a station becomes ready to send, it senses the channel. If it is idle will transmit with a probability of p. With a probability of q it defers to the next slot. If next slot is also idle, it transmits or it defers again with probabilities of p and q This process is repeated until the frame gets either transmitted or another station it began transmission For latter case, the unlucky station acts the same as it would have been a collision (waits a random time and starts again)

26 Persistent and Non-persistent CSMA
Comparison of the channel utilization versus load for various random access protocols.

27 CSMA with Collision Detection
An improvement over CSMA protocols is for a station to abort its transmission when it senses a collision. If two stations sense the channel idle and begin transmission at the same time, they will both detect the collision immediately; there is no point in continuing to send their frames, since they will be garbled. Rather than finishing the transmission, they will stop as soon as the collision is detected Saves time and bandwidth This protocol is widely used CSMA/CD. In particular is the basis for Ethernet LAN.

28 CSMA/CD CSMA method that we’ve learnt just now doesn’t specify the procedure following a collision. CSMA/CD augments the algorithm to handle the collision In the CSMA/CD method, a station monitors the medium after it sends a frame to see of the transmission was a successful. If so, the station is finished. If, however, there is a collision, the frame is sent again. To better understand CSMA/CD, see fig 12.12

29 Figure 12.12 Collision of the first bit in CSMA/CD

30 Explanation of CSMA/CD in fig 12.12
In the fig, the 1st bits transmitted by the two stations involved in the collision. Although each station continues to send bits in the frame until it detects the collision, it show what happens as the first bits collide. In fig 12.12, station A and C are involved in the collision

31 At t1, station A starts sending the bits of its frame.
At time t2, station C hasn’t yet sensed the 1st bit sent by A. it then start sending its bits of frame which propagate both to the left and right. The collision occurs sometime after time t2. station C detects a collision at time t3 when it receives the 1st bit of A’s frame. Station C immediately abort transmission. Station A detects collision at time t4 when it receives the 1st bit of C’s frame. It also immediately aborts transmission

32 Minimum frame Size: One of the solution for the case of collision in CSMA/CD method the minimum frame size is determined so that the propagation delay of a frame travel is reduced in order to avoid collision with other frame. Tfr = at least two times Tp Discuss worst case

33

34 CSMA with Collision Detection
At the point marked t0, a station has finished transmitting its frame. Any other station having a frame to send may now attempt to do so. If two or more stations decide to transmit simultaneously, there will be a collision. Collision can be detected by looking at the power of the line or at the pulse width of the received signal and comparing it with the transmitted signal. After a station detects a collision, aborts its transmission, waits a random period of time and tries again latter. Therefore the CSMA/CD will consist of alternating contention and transmission periods, with idle periods occurring when all stations are quiet. The minimum time to detect a collision is two times the time it takes the signal to propagate from one station to another. In worst case scenario, the two stations can be at the ends of the cable … therefore, the minimum time to detect a collision is the round trip propagation delay for the whole cable segment. The sending station has to monitor the channel for collisions during transmission. Therefore the CSMA/CD is a half duplex system. It is important to realize that the collision detection is an analog process. The station’s hardware must listen to the cable while is transmitting. If what it reads back is different than what it sends, then a collision must have had happen. The implication is that the signal encoding must allow collisions to be detected (i.e. a collision of two 0 V signals will never be detected). For this reason, special encoding is used. CSMA/CD can be in one of three states: contention, transmission, or idle.

35

36

37 CSMA/CA USED IN WIRELESS (WI-FI and etc.)
For this lectures pls refer to chapter 12 of text book. Forouzan’s. Page

38 Collision Free Protocols
Collisions adversely affect the system performance, especially if the cable is long and the frames are short The collision free protocols solve the contention for the transmission channel without an collisions at all N stations are assumed to be connected to the same transmission channel Protocols Bit-Map Protocol Binary Countdown

39 Collision-Free Protocols (1)
The basic bit-map protocol. Each contention period consists of exact N slots. If station 0 has a frame to send, then it transmits a slot during zero-th contention slot. No other station is allowed to transmit during this slot. Regardless of what station 0 does, station 1 gets the opportunity to transmit a 1 bit during the contention slot 1, but only if it wants to send a frame (has a queued frame). After all N slots have passed, each station has complete knowledge of which stations whish to transmit. Al that point they begin transmitting in numerical order. Since everyone agrees who goes next, there is no collisions. Protocols like this are called RESERVATION PROTOCOLS. If station j has a frame to send, it will transmit a 1 in j-th contention slot

40 Collision-Free Protocols (2)
The binary countdown protocol. A dash indicates silence. A problem with bit map protocols is that the overhead per station is fixed (on bit), therefore it is not scaling well with large number of stations. In binary countdown protocol, all stations will have same length addresses. A station wanting to use the channel broadcasts its address as a binary bit string, starting with the high order bit. The bits in each address position, from each station are BOOLEAN OR-ed together. This is called binary countdown. All the stations will see the result of the OR operation instantaneously. So an station that placed an 0 on the channel sees a 1, than it will stop trying. A higher priority station wants to transmit therefore it has to stop trying this time. In other words, as soon as a station has seen that a high order bit in its address with value 0 has been overwritten with a 1, it gives up. Consider the stations 0010, 0100, 1001 and 1010 are all trying to get the channel. Station having address 1010 gets the channel (due to the fact that this protocol is giving priority to the stations with higher address).

41 References Andrew S. Tanenbaum – Computer Networks, ISBN


Download ppt "Medium Access Control Sub Layer"

Similar presentations


Ads by Google