1 / 39

MAC Sublayer

MAC Sublayer. Introduction. We can consider the data link layer as two sublayers. The upper sublayer is responsible for data link control, and the lower sublayer is responsible for resolving access to the shared media. If the channel is dedicated, we do not need the lower sublayer.

siua
Download Presentation

MAC Sublayer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MAC Sublayer

  2. Introduction • We can consider the data link layer as two sublayers. • The upper sublayer is responsible for data link control, and the lower sublayer is responsible for resolving access to the shared media. • If the channel is dedicated, we do not need the lower sublayer.

  3. Data link layer divided into two functionality-oriented sublayers • Upper sublayer – responsible for data link control • Called LLC – for flow and error control • Lower sublayer - responsible for resolving access the shared media • Called MAC – for multiple access resolution

  4. Static Channel Allocation • The traditional way of allocating a single channel, such as a telephone trunk, among multiple competing users is to chop up its capacity by using one of the multiplexing schemes. • The basic problem is that when some users are inactive, their bandwidth is simply lost. • They are not using it, and no one else is allowed to use it either

  5. Assumptions for Dynamic Channel Allocation • Independent Traffic. The model consists of N independent stations (e.g., computers, telephones), each with a program or user that generates frames for transmission. • Single Channel • Observable Collisions • Continuous or Slotted Time • Carrier Sense or No Carrier Sense

  6. MULTIPLE ACCESS PROTOCOLS • ALOHA, the simple and elegant method to solve the channel allocation problem. • We will discuss two versions of ALOHA here: pure and slotted. • It was designed for a radio (wireless) LAN, but it can be used on any shared medium.

  7. Pure ALOHA • The basic idea of an ALOHA system is simple: let users transmit whenever they have data to be sent. • However, since there is only one channel to share, there is the possibility of collision between frames from different stations. • Senders need some way to find out if this is the case.

  8. Pure ALOHA

  9. Pure ALOHA • It is obvious that we need to resend the frames that have been destroyed during transmission. • The pure ALOHA protocol relies on acknowledgments from the receiver. • When a station sends a frame, it expects the receiver to send an acknowledgment. • If the acknowledgment does not arrive after a time-out period, the station assumes that the frame (or the acknowledgment) has been destroyed and resends the frame.

  10. Pure ALOHA • Pure ALOHA has a second method to prevent congesting the channel with retransmitted frames. • After a maximum number of retransmission attempts Kmax a station must give up and try later. • The time-out period is equal to the maximum possible round-trip propagation delay, which is twice the amount of time required to send a frame between the two most widely separated stations.

  11. Pure ALOHA

  12. Pure ALOHA

  13. Pure ALOHA • The throughput for slotted ALOHA is S = G × e−G • The maximum throughput Smax = 0.368 when G = 1. Let us call G the average number of frames generated by the system during one frame transmission time. In other words, if one-half a frame is generated during one frame transmission time then 18.4 percent of these frames reach their destination successfully.

  14. Slotted ALOHA • Soon after ALOHA came onto the scene, Roberts (1972) published a method for doubling the capacity of an ALOHA system. • His proposal was to divide time into discrete intervals called slots, each interval corresponding to one frame. • Pure ALOHA has a vulnerable time of 2 x Tfr. This is so because there is no rule that defines when the station can send. (*We assume that the stations send fixed-length frames with each frame taking Tfr to send.)

  15. Slotted ALOHA

  16. Slotted ALOHA • Because a station is allowed to send only at the beginning of the synchronized time slot, if a station misses this moment, it must wait until the beginning of the next time slot. • Of course, there is still the possibility of collision if two stations try to send at the beginning of the same time slot. • However, the vulnerable time is now reduced to one-half, equal to Tfr

  17. Slotted ALOHA

  18. Slotted ALOHA • The throughput for slotted ALOHA is S = G × e−G . • The maximum throughput Smax = 0.368 when G = 1.

  19. CSMA(Carrier Sense Multiple Access) • The chance of collision can be reduced if a station senses the medium before trying to use it. • Carrier sense multiple access (CSMA) requires that each station first listen to the medium (or check the state of the medium) before sending. • In other words, CSMA is based on the principle "sense before transmit" or "listen before talk."

  20. Persistent and Nonpersistent CSMA • CSMA can reduce the possibility of collision, but it cannot eliminate it. • The first carrier sense protocol is called 1-persistent CSMA (Carrier Sense Multiple Access). • When a station has data to send, it first listens to the channel to see if anyone else is transmitting at that moment. • If the channel is idle, the stations sends its data. Otherwise, if the channel is busy, the station just waits until it becomes idle. Then the station transmits a frame.

  21. Persistent and Nonpersistent CSMA • If a collision occurs, the station waits a random amount of time and starts all over again. • A second carrier sense protocol is nonpersistent CSMA. • As before, a station senses the channel when it wants to send a frame, and if no one else is sending, the station begins doing so itself.

  22. Persistent and Nonpersistent CSMA • However, if the channel is already in use, it waits a random period of time and then repeats the algorithm. • The last protocol is p-persistent CSMA. It applies to slotted channels and works as follows. • The protocol is called p-persistent because the station transmits with a probability of p when it finds the channel idle.

  23. Persistent and Nonpersistent CSMA • In this method, after the station finds the line idle it follows these steps: 1. With probability p, the station sends its frame. 2. With probability q = 1 - p, the station waits for the beginning of the next time slot and checks the line again. a. If the line is idle, it goes to step 1. b. If the line is busy, it acts as though a collision has occurred and uses the backoff procedure

  24. Behavior of 3 Methods

  25. Flow Diagram of 3 Methods

  26. CSMA/CD

  27. CSMA/CD • It is similar to the one for the ALOHA protocol, but there are differences. • The first difference is the addition of the persistence process. • We need to sense the channel before we start sending the frame by using one of the persistence processes.

  28. CSMA/CD • The second difference is the frame transmission. In ALOHA, we first transmit the entire frame and then wait for an acknowledgment. • In CSMA/CD, transmission and collision detection is a continuous process. • We do not send the entire frame and then look for a collision. The station transmits and receives continuously and simultaneously

  29. CSMA/CD • The third difference is the sending of a short jamming signal that enforces the collision in case other stations have not yet sensed the collision. • The throughput of CSMA/CD is greater than that of pure or slotted ALOHA.

  30. CSMA/CA • In a wired network, the received signal has almost the same energy as the sent signal because either the length of the cable is short or there are repeaters that amplify the energy between the sender and the receiver. • This means that in a collision, the detected energy almost doubles.

  31. CSMA/CA • However, in a wireless network, much of the sent energy is lost in transmission. • The received signal has very little energy. Therefore, a collision may add only 5 to 10 percent additional energy. • This is not useful for effective collision detection.

  32. CSMA/CA • We need to avoid collisions on wireless networks because they cannot be detected. • Carrier sense multiple access with collision avoidance (CSMA/CA) was invented for this network. • Collisions are avoided through the use of CSMA/CA's three strategies: the interframe space, the contention window, and acknowledgments.

  33. CSMA/CA • First, collisions are avoided by deferring transmission even if the channel is found idle. • When an idle channel is found, the station does not send immediately. It waits for a period of time called the interframe space or IFS. • When channel is sensed to be idle, it may be possible that same distant station may have already started transmitting and the signal of that distant station has not yet reached other stations. • Therefore the purpose of IFS time is to allow this transmitted signal to reach other stations.

  34. CSMA/CA • Contention window is an amount of time divided into slots. • A station that is ready to send chooses a random number of slots as its wait time. • In contention window the station needs to sense the channel after each time slot.

  35. CSMA/CA

  36. CSMA/CA

  37. CSMA/CA • This is the CSMA protocol with collision avoidance. • The station ready to transmit, senses the line by using one of the persistent strategies. • As soon as it find the line to be idle, the station waits for an IFS amount of time. • If then waits for some random time and sends the frame. • After sending the frame, it sets a timer and waits for the acknowledgement from the receiver. • If the acknowledgement is received before expiry of the timer, then the transmission is successful.

  38. CSMA/CD v CSMA/CA • CSMA/CA (Carrier Sense Multiple Access/Collision Avoidance) is a protocol for carrier transmission in 802.11 networks. • Unlike CSMA/CD (Carrier Sense Multiple Access/Collision Detect) which deals with transmissions after a collision has occurred, CSMA/CA acts to prevent collisions before they happen.

  39. CSMA/CD v CSMA/CA • CSMA CD is used mostly in wired installations because it is possible to detect whether a collision has occurred. • With wireless installations, it is not possible for the transmitter to detect whether a collision has occurred or not. • That is why wireless installations often use CSMA CA instead of CSMA CD.

More Related