Course- B.Sc. Applied Physical Science (Computer Science) Year- IIIrd, Sem- Vth Subject Computer Science Paper- XVIIth, Computer Networks Lecture -11 Lecture Title- Medium Access Layer Script Today in this lecture we will learn about medium access control layer of OSI reference model. First of all please see the Contents which I shall cover:.. After covering brief introduction about MAC I shall takeup techniques like ALOHA, CSMA, CSMA/CD and CSMA/CA in this lecture. LECTURE PLAN Introduction about MAC Types o ALOHA o CSMA o CSMA/CD o CSMA/CA MACA MACAW Now what is MAC? MAC is Medium Access Control. This layer deals with how common channel is shared by more then one user for transmission. As only one node can send or transmit signal at a time using the broadcast mode, the main problem is how different nodes get control of the medium to send data. The protocols used for this purpose are Medium Access Control protocols. MAC techniques can be broadly divided into four categories as shown in figure;. Random, Round-Robin, Reservation-based and Channelization-based. In this lecture we shall concentrate on Random protocols for medium access control. There are four basic techniques ALOHA, CSMA, CSMA/CD and CSMA/CA in random category. ALOHA is further categorized into pure and Slotted ALOHA as you can see in the figure.
MAC Techniques Round Robin Random Reservation Channelization ALOHA CSMA CSMA/CD CSMA/CA Pure ALOHA Slotted ALOHA PART 2 : ALOHA ALOHA protocol for medium access control was invented by Abramson in 1970 at university of Hawaii. In order to understand ALOHA let us consider a simple situation as shown in Figure. There is a central computer which four users can access through a common radio frequency band f 1 and the central computer broadcasts all received signals on a different frequency band f 2. The protocol followed by the users is very simple; whenever a node has a packet to sent, it simply does so.
f 2 Central Computer f 2 f 1 --random access f 2 --broadcast f 2 f 2 f 1 D A f 1 f 1 f 1 B C The scheme is known as Pure ALOHA, which is truly a free-for-all scheme. Of course, frames will suffer collision and colliding frames will be destroyed. Please see figure for collisions. If any new frame is transmitted before completion of current frame being transmitted collision will occur. User will come to know about collision after the maximum round-trip propagation time, and he will transmit again. In order to solve this problem a new scheme, known as Slotted ALOHA, was suggested to improve upon the efficiency of pure ALOHA. In this scheme, the channel is divided into slots equal to T and packet transmission can start only at the beginning of a slot as shown in Figure. There are still chances of collision in case more then one user starts transmission at same time. But collisions are reduced a lot in slotted ALOHA.
Let us see the performance of both ALOHA protocols through graph. The channel utilization, expressed as throughput S, in terms of the offered load G for pure ALOHA is given by S=Ge -2G. Based on this, the best channel utilization of 18% can be obtained at 50 percent of the offered load. At smaller offered load, channel capacity is underused and at higher offered load too many collisions occur reducing the throughput. The result is not encouraging, but for such a simple scheme high throughput was also not expected. In case of slotted ALOHA as the vulnerable period gets reduced from 2τ to τ so efficiency improves by reducing the probability of collision. The channel utilization, expressed as throughput S, in terms of the offered load G for slotted ALOHA is given by S=Ge -G This gives a maximum throughput of 36% at 100 percent of offered load.
CSMA/CD After ALOHA we will take CSMA technique now The poor efficiency of the ALOHA scheme can be attributed to the fact that a node start transmission without paying any attention to what others are doing. This observation is the basis of the carrier -sense multiple-access (CSMA) protocol. In this scheme, a node having data to transmit first listens to the medium to check whether another transmission is in progress or not. The node starts sending only when the channel is free, that is there is no transmission going on. That is why the scheme is also known as listen-beforetalk. There are also three variations of this basic scheme as outlined below. First is 1-persistent CSMA: In this case, a node having data to send, start sending if the channel is sensed free. If the medium is busy, the node continues to monitor until the channel is idle. As soon as it senses that channel is free it starts sending data. Second is Non-persistent CSMA: In this case if the channel is sensed free, the node starts sending the packet. Otherwise, the node waits for a random amount of time and then monitors the channel. Last is p-persistent CSMA: In this case if the channel is free, a node starts sending the packet. Otherwise the node continues to monitor until the channel is free and then it sends with probability p. So to summarize 1 persistent senses continuously, non persistent senses after a random wait time and p persistent senses continuously but transmits with probability p. Next technique for medium access control is CSMA/CD CSMA/CD protocol can be considered as a refinement over the CSMA scheme. It has evolved to overcome one specific inefficiency of CSMA. In CSMA scheme, when two packets collide the channel remains unutilized for the entire duration of transmission time of both the packets. If the propagation time is small which is usually the case compared to the packet transmission time, wasted channel capacity can be considerable. This wastage of channel capacity can be reduced if the nodes continue to monitor the channel while transmitting a packet and immediately cease transmission when collision is detected. This refined scheme is known as Carrier Sensed Multiple Access with Collision Detection that is CSMA/CD or Listen-While-Talk. On top of the CSMA, the following rules are added to convert it into CSMA/CD: Please see flow chart in this regard. (i) If a collision is detected during transmission of a packet, the node immediately ceases transmission and it transmits jamming signal as shown in step 5 for a brief duration to ensure that all stations know that collision has occurred. (ii) After transmitting the jamming signal, the node waits as per backoff strategy and then transmission is resumed. The backoff strategy ensures that the nodes, which were involved in the collision
are not likely to have a collision at the time of retransmissions. To achieve stability in the back off scheme, a technique known as binary exponential back off is used. A node will attempt to transmit repeatedly in the case of repeated collisions, but after each collision, the mean value of the random delay is doubled. After 15 retries excluding the original try, the unlucky packet is discarded and the node reports an error. Station is ready to send New Attempt Wait as per back off strategy(6) Sense Channel(1) Channel busy (3) Channel free (2) Transmit data and sense channel (4) Collision detected Transmit Jam Signal (5) Transmit complete No collision detected PERFORMANCE OF MAC PROTOCOLS Performance of all techniques explained till now can be calculated using the formula for throughput of the three contention based schemes with respect to the offered load as given in table shown. PROTOCOL THROUGHPUT ALOHA S=Ge -2G Slotted ALOHA S=Ge -G Non Persistent Ge!2G CSMA S = G 1 + 2a + e!ag
Non Persistent Ge!2G CSMA/CD S = Ge!aG + 3aG 1 e!ag + (2 e!ag ) By using the formula just shown graph can be drawn for throughput. The figure shows that pure ALHOA gives a maximum throughput of only 18 percent and is suitable only for very low offered load. The slotted ALHOA gives a modest improvement over pure ALHOA with a maximum throughput of 36 percent. Non persistent CSMA gives a better throughput than 1-persistent CSMA because of smaller probability of collision for the retransmitted packets. The non-persistent CSMA/CD provides a high throughput and can tolerate a very heavy offered load. CSMA/CA Protocol Now we shall discuss CSMA/CA protocol for Wireless LAN Protocols As the number of mobile computing and communication devices grows, so does the demand to connect them to the outside world. Even the very first mobile telephones had the ability to connect to other telephones. The first portable computers did not have this capability, but soon afterward, modems became common on notebook computers. To achieve true mobility, notebook computers need to use radio or infrared signals for communication. In this manner, dedicated users can read and send e-mail even while travelling, hiking or boating. A system of notebook computers that communicate by radio can be regarded as a wireless LAN. These LANs have somewhat different properties than conventional LANs as they require special MAC sublayer protocols. Here we will examine some of MAC protocols used for wireless LAN.
Before coming to MAC protocol for wireless let us discuss working and problems in wireless communication. A common configuration for a wireless LAN is an office building with base stations which is also called access point. This access point is strategically placed around the building. All the base stations are wired together using copper or fiber. If the transmission power of the base stations and notebooks is adjusted to have a range of 3 or 4 meters, then each room becomes a single cell and the entire building becomes a large cellular system. A naive approach to implement MAC mechanism in a wireless LAN is to try CSMA: means just listen for other transmissions and only transmit if no one else is doing so. To see the nature of the problem, consider figure as shown, where four wireless stations are illustrated. For MAC purpose, it does not matter which are base stations and which are notebooks. The radio range is such that A and B are within each other's range and can potentially interfere with one another. C can also potentially interfere with both B and D, but not with A. First consider what happens when A is transmitting to B, as depicted in left side of figure. If C senses the medium, it will not hear A because A is out of range, and thus falsely conclude that it can transmit to B. If C does start transmitting, it will interfere at B, wiping out the frame from A. The problem of a station not being able to detect a potential competitor for the medium because the competitor is too far away is called the hidden station problem. Now let us consider the reverse situation: B transmitting to A, as shown in right side of figure. If C senses the medium, it will hear an ongoing transmission and falsely conclude that it could not send to D, which is not true. This is called the exposed station problem. A B C D A B C D (a) (b) The problem is that before starting a transmission in wireless system, a station should really want to know whether there is activity around the receiver. CSMA merely tells it whether there is activity around the station sensing the carrier. Another way to think about this problem is to imagine an office building in which every employee has a wireless notebook computer. Suppose that Mr Ram wants to send a message to Mr Shyam. Ram's computer senses the local environment, detects no activity, so he starts sending. However, there may be a collision in Shyam office because a third party say Mr Krishan may currently be sending to Shyam from a location so far from Ram that Ram s computer could not detect it. So keeping in view the problems described just now MAC protocol should be designed. CSMA/CA is first protocol designed for wireless transmission which is carrier sense multiple access with collision avoidance. Collision avoidance is used to improve the performance of the CSMA method by attempting to divide the channel somewhat equally among all transmitting nodes within the collision domain. In this method as shown in flowchart
Carrier Sensing is done prior to transmitting, by listening to the shared medium so as to determine whether another node is transmitting or not. Note that the hidden node problem means another node may be transmitting which goes undetected at this stage. Then Collision Avoidance is done. If another node was heard, we wait for a period of time for the node to stop transmitting before listening again for a free communications channel. Request to Send/Clear to Send (RTS/CTS) may optionally be used at this point to mediate access to the shared medium. If the medium was identified as being clear or the node received a CTS to explicitly indicate it can send, it transmits the frame. Unlike CSMA/CD, it is very challenging for a wireless node to listen at the same time as it transmits. Continuing the wireless example, the node awaits receipt of an acknowledgement packet from the Access Point to indicate the packet was received and check summed correctly. If such acknowledgement does not arrive after a timely manner, it assumes the packet collided with some other transmission, causing the node to enter a period of binary exponential backoff prior to attempting a re-transmit.
Due to hidden node problem it is sometime very difficult to sense the carrier. So CSMA/CA is modified as MACA which stands for Multiple Access with Collision Avoidance. Carrier sensing is not done in this protocol. MACA is illustrated in figure as shown. Let us now consider that A sends a frame to B. A starts by sending an Request To Send frame to B, as shown in figure on left side. This short frame of 30 bytes contains the length of the data frame that will eventually follow. Then B replies with a Clear to Send frame, as shown in figure on right side. Upon receipt of the CTS frame, A begins transmission. Now let us see how stations overhearing either of these frames react. Any station hearing the RTS is clearly close to A and must remain silent long enough for the CTS to be transmitted back to A without conflict. Any station hearing the CTS is clearly close to B and must remain silent during the upcoming data transmission, whose length it can tell by examining the CTS frame. This is how collisions are avoided. As we can see in figure, C is within range of A but not within range of B. Therefore, it hears the RTS from A but not the CTS from B. As long as it does not interfere with the CTS, it is free to transmit while the data frame is being sent. In contrast, D is within range of B but not A. It does not hear the RTS but does hear the CTS. Hearing the CTS it is clear that it is close to a station that is about to receive a frame, so it defers sending anything until that frame is expected to be finished. Station E hears both control messages and must be silent until the data frame is complete. Despite these precautions, collisions can still occur. For example, B and C could both send RTS frames to A at the same time. These will collide and will lost. In the event of a collision, an unsuccessful transmitter that does not hear a CTS within the expected time interval waits a random amount of time and tries again later. The algorithm used is binary exponential backoff. Based on simulation studies of MACA, fine tuning of MACA was done to improve its performance and this improved protocol was renamed as MACAW means MACA for Wireless. In this method acknowledgements were introduced by transmitting ACK frame after each successful data frame. In this protocol carrier sensing is also added, to keep a station from transmitting an RTS at the same time another nearby station is also doing so to the same destination. Backoff algorithm was also added separately for each data stream of source-destination pair, rather than for each station. This change improves the fairness of the protocol. Finally, a mechanism is added for stations to exchange information about congestion and a way to make the backoff algorithm react less violently to temporary problems, to improve system performance. So dear friends this was all about CSMA/CA. In this lecture we studied about different MAC protocols like ALOHA, CSMA, CSMA/CD and CSMA/CA for managing control of shared channel.