Lecture Focus: Data Communications and Networking  Data Link Layer  Media Access Control (MAC) Lecture 23 CSCS 311.

Slides:



Advertisements
Similar presentations
Channel Allocation Protocols. Dynamic Channel Allocation Parameters Station Model. –N independent stations, each acting as a Poisson Process for the purpose.
Advertisements

The ALOHA Protocol “Free for all”: whenever station has a frame to send, it does so. –Station listens for maximum RTT for an ACK. –If no ACK after a specified.
EECC694 - Shaaban #1 lec #5 Spring Data Link In Broadcast Networks: The Media Access Sublayer Broadcast networks with multi-access (or random.
Ethernet – CSMA/CD Review
12.1 Chapter 12 Multiple Access Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Multiple Access Methods. When nodes or stations are connected and use a common link (cable or air), called a multipoint or broadcast link, we need a.
12.1 Chapter 12 Multiple Access Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Communication Networks Lecture 5 NETW 501-L5: NETW 501-L5: Medium Access Control Dr.-Ing. Khaled Shawky Hassan Room: C3-222, ext: 1204,
1 K. Salah Module 4.2: Media Access Control The Media Access Control (MAC) sublayer –Random Access (CSMA), IEEE –Token Passing, IEEE Ch 13-
Chapter 12 Multiple Access Figure 12.1 Data link layer divided into two functionality-oriented sublayers Figure 12.2 Taxonomy of multiple-access protocols.
MAC Protocols Media Access Control (who gets the use the channel) zContention-based yALOHA and Slotted ALOHA. yCSMA. yCSMA/CD. TDM and FDM are inefficient.
CS 5253 Workshop 1 MAC Protocol and Traffic Model.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 13 Multiple Access.
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao
12.1 Chapter 12 Multiple Access Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Networks: Local Area Networks1 LANs Studying Local Area Networks Via Media Access Control (MAC) SubLayer.
Semester EEE449 Computer Networks The Data Link Layer Part 2: Media Access Control En. Mohd Nazri Mahmud MPhil (Cambridge, UK) BEng (Essex,
Medium Access Control Sublayer
Wireless Application Protocol
Chi-Cheng Lin, Winona State University CS412 Introduction to Computer Networking & Telecommunication Medium Access Control Sublayer.
Chapter 12 Multiple Access Figure 12.1 Data link layer divided into two functionality-oriented sublayers Figure 12.2 Taxonomy of multiple-access protocols.
LECTURE9 NET301. DYNAMIC MAC PROTOCOL: CONTENTION PROTOCOL Carrier Sense Multiple Access (CSMA): A protocol in which a node verifies the absence of other.
LOCAL AREA NETWORKS. CSMA Carrier Sense Multiple Access To minimize the chance of collision and, therefore, increase the performance, the CSMA method.
LOCAL AREA NETWORKS. MEDIUM ACCESS CONTROL All LANs and MANs consist of collections of devices that must share the network’s transmission capacity. Some.
Cyclic Redundancy Check (CRC).  An error detection mechanism in which a special number is appended to a block of data in order to detect any changes.
جلسه یازدهم شبکه های کامپیوتری به نــــــــــــام خدا.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Unit-II Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
LOCAL AREA NETWORKS. CSMA/CD Carrier Sense Multiple Access with Collision Detection The CSMA method does not specify the procedure following a collision.
Medium Access Control Sub Layer
Multiple Access.
Data Communications, Kwangwoon University12-1 Chapter 12. Multiple Access 1.Random Access 2.Controlled Access 3.Channelization.
1 Kyung Hee University Chapter 12 Multiple Access.
1 Kyung Hee University Chapter 12 Multiple Access.
Ch 12. Multiple Access. Multiple Access for Shared Link Dedicated link – Point-to-point connection is sufficient Shared link – Link is not dedicated –
1 Ethernet CSE 3213 Fall February Introduction Rapid changes in technology designs Broader use of LANs New schemes for high-speed LANs High-speed.
Chapter 13 Multiple Access.
Chapter 12 Media Access Control (MAC)
COMPUTER NETWORKS Data-link Layer (The Medium Access Control Sublayer) MAC Sublayer.
Multiple Access By, B. R. Chandavarkar, CSE Dept., NITK, Surathkal Ref: B. A. Forouzan, 5 th Edition.
Multiple Access Methods
MEDIUM ACCESS CONTROL PROTOCOL
Data link layer divided into two functionality-oriented sublayers
Chapter 12 Multiple Access.
Lab 7 – CSMA/CD (Data Link Layer Layer)
Chapter 12 Multiple Access
Part III Datalink Layer 10.
High Speed LANs – Ethernet and Token Ring
Multiple Access Mahesh Jangid Assistant Professor JVW University.
Subject Name: Computer Communication Networks Subject Code: 10EC71
Chapter 12 Multiple Access
Net301 lecture9 11/5/2015 Lect 9 NET301.
Services of DLL Framing Link access Reliable delivery
Chapter 12 Multiple Access
Figure 12.1 Data link layer divided into two functionality-oriented sublayers Networks can be divided into two categories: those using point-to-point.
THE IEEE MAC SUB-LAYER – chapter 14
Multiple Access Methods
Chapter 12 Multiple Access
Chapter 12 Multiple Access
Chapter 12 Multiple Access
Ethernet – CSMA/CD Review
Data Communication Networks
CSE 313 Data Communication
CSE 313 Data Communication
Multiple Access Methods
CARRIER SENSE MULTIPLE ACCESS (CSMA)
Chapter 6 Multiple Radio Access.
Dr. John P. Abraham Professor UTPA
Part III Datalink Layer 10.
Chapter 12 Media Access Control (MAC)
Chapter 12 Media Access Control (MAC)
Presentation transcript:

Lecture Focus: Data Communications and Networking  Data Link Layer  Media Access Control (MAC) Lecture 23 CSCS 311

Data Link Layer Media Access Control  Two sub-layers of data link layer:  The upper sub-layer is responsible for data link control  The lower sub-layer is responsible for resolving access to the shared media.  If the channel is dedicated, we do not need the lower sub-layer. Data Link Control Media Access Control

 The upper sub-layer responsible for flow and error control is called the logical link control (LLC) layer.  The lower sub-layer mostly responsible for multiple access resolution is called the media access control (MAC) layer.  When nodes or stations are connected and use a common link, called a multipoint or broadcast link, we need a multiple-access protocol to coordinate access to the link.  Speaking example.

Media Access Control PROTOCOLS ALOHA

Media Access Control PROTOCOLS RANDOM ACCESS (or contention methods )  Superiority  No controller  Permission  Decision and state of the medium  Idle or busy  Transmission  Transmission right

Media Access Control PROTOCOLS RANDOM ACCESS: WHY?  Two features give this method its name. 1.Transmission: A.Non-scheduled B.Random 2.No rules for transmission A.Which station should send next? B.Stations compete to access the medium  Contention methods

Media Access Control PROTOCOLS  Access conflict-collision  Frames destruction or modification  To avoid access conflict or to resolve it when it happens, each station follows a procedure that answers the following questions: RANDOM ACCESS  When can the station access the medium?  What can the station do if the medium is busy?  How can the station determine the success or failure of the transmission?  What can the station do if there is an access conflict?

Media Access Control PROTOCOLS RANDOM ACCESS  ALOHA protocol:  Based on simple procedure called multiple access (MA).  The method was improved with the addition of a procedure that forces the station to sense the medium before transmitting.  This was called carrier sense multiple access.  This method later evolved into two parallel methods:  Carrier sense multiple access with collision detection (CSMA/CD)  Carrier sense multiple access with collision avoidance (CSMA/CA).  CSMA/CD tells the station what to do when a collision is detected.  CSMA/CA tries to avoid the collision.

Media Access Control PROTOCOLS RANDOM ACCESS Evolution of random-access methods Multiple Access Carrier Sense Multiple Access with Collision Detection Carrier Sense Multiple Access Carrier Sense Multiple Access with Collision Avoidance

Media Access Control PROTOCOLS RANDOM ACCESS ALOHA  It was the earliest random access method developed at the University of Hawaii in early  Basic Objective:  Transmit at any time  Users can transmit when they have data to send  There are potential collisions in random access.  Medium is shared between the stations without any controlling body and any coordination between the stations.  When a station sends data, another station may attempt to do so at the same time.  The data from the two stations collide and become garbled.

Media Access Control PROTOCOLS RANDOM ACCESS Pure ALOHA  The original ALOHA protocol is called pure ALOHA.  The idea is that each station sends a frame whenever it has a frame to send.  Since there is only one channel to share, there is the possibility of collision between frames from different stations.

Media Access Control PROTOCOLS RANDOM ACCESS Frame collisions in a pure ALOHA network

Media Access Control PROTOCOLS RANDOM ACCESS Frame collisions in a pure ALOHA network  4 stations contending with one another for access to the shared channel.  Each station sends two frames: total 8 frames on the shared medium.  Some of these frames collide because multiple frames are in contention for the shared channel  Only two frames survive: frame 1.1 and frame 3.2  Even if one bit of a frame coexists on the channel with one bit from another frame, there is a collision and both will be destroyed.  We need to resend the frames that have been destroyed during transmission.

Media Access Control PROTOCOLS RANDOM ACCESS Frame collisions in a pure ALOHA network  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.

Media Access Control PROTOCOLS RANDOM ACCESS Frame collisions in a pure ALOHA network  A collision involves two or more stations.  If all these stations try to resend their frames after the time-out, the frames will collide again.  Pure ALOHA dictates that when the time-out period passes, each station waits a random amount of time before resending its frame.  The randomness will help avoid more collisions.  This time is called the back-off time T B.

Media Access Control PROTOCOLS RANDOM ACCESS Frame collisions in a pure ALOHA network  Pure ALOHA has a second method to prevent congesting the channel with retransmitted frames.  After a maximum number of retransmission attempts K max, a station must give up and try later.  Figure below shows the procedure for pure ALOHA based on the above strategy.

Media Access Control PROTOCOLS RANDOM ACCESS Procedure for ALOHA Protocol

Media Access Control PROTOCOLS RANDOM ACCESS Procedure for ALOHA Protocol Wait for time-out time

Media Access Control PROTOCOLS RANDOM ACCESS Procedure for ALOHA Protocol  Time-out period = Maximum possible round-trip propagation delay = Twice the amount of time required to send a frame between the two most widely separated stations (2 x T p ).  The back-off time T B is a random value that normally depends on K (the number of attempted unsuccessful transmissions).  The formula for T B depends on the implementation.  One common formula is the binary exponential back-off.  In this method, for each retransmission, a multiplier in the range 0 to 2 K - 1 is randomly chosen and multiplied by T p (maximum propagation time) or T fr (the average time required to send out a frame) to find T B.  The range of the random numbers increases after each collision. The value of K max is usually chosen as 15.

Media Access Control PROTOCOLS RANDOM ACCESS Procedure for ALOHA Protocol Example: The stations on an ALOHA network are a maximum of 600 km apart. If signals propagate at 3 x 10 8 m/s, find values of T p and T B. Solution: Speed = Distance / Time  Time = Distance / Speed T p = (600 x 10 3 ) / (3 x 10 8 ) = (6 x 10 5 ) / (3 x 10 8 ) = 2 / 10 3 = 2 ms. Now we can find the value of T B for different values of K. A.For K = 1, the range is {0, 1}. The station needs to generate a random number with a value of 0 or 1. This means that T B is either 0ms (0 x 2) or 2ms (1 x 2), based on the outcome of the random variable. B.For K =2, the range is {0, 1, 2, 3}. This means that T B can be 0, 2, 4, or 6 ms, based on the outcome of the random variable. C.For K =3, the range is {0,1,2,3,4,5,6,7}. This means that T B can be 0,2,4,..., 14 ms, based on the outcome of the random variable. D.d. We need to mention that if K > 10, it is normally set to 10.

Media Access Control PROTOCOLS RANDOM ACCESS Slotted ALOHA  In Pure ALOHA, there is no rule that defines when the station can send. So is the reason for so many collisions.  The first refinement of pure ALOHA is provided by the introduction of time slots.  A station may send soon after another station has started or soon before another station has finished.

Media Access Control PROTOCOLS RANDOM ACCESS Slotted ALOHA  Slotted ALOHA was invented to improve the efficiency of pure ALOHA.  In slotted ALOHA we divide the time into slots of T fr s and force the station to send only at the beginning of the time slot.  Each slot corresponds to one frame.  All the senders have to be synchronized, transmission can only start at the beginning of a time slot.  Senders must agree on time slots. i.e synchronization  However, access is not coordinated.  Figure below shows an example of frame collisions in slotted ALOHA.

Media Access Control PROTOCOLS RANDOM ACCESS Slotted ALOHA Frame 1.1 Frame 1.2 Frame 2.2 Frame 4.1 Frame 3.1 Frame 2.1 Frame 4.2 Frame 3.2 Station 1 Station 4 Station 3 Station 2 Slot 1 Slot 3Slot 2Slot 5Slot 4Slot 6 Time Collision Duration Collision Duration

Media Access Control PROTOCOLS RANDOM ACCESS Slotted ALOHA  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.  This means that the station which started at the beginning of this slot has already finished sending its frame.  There is still the possibility of collision if two stations try to send at the beginning of the same time slot.

Media Access Control PROTOCOLS RANDOM ACCESS Carrier Sense Multiple Access (CSMA)  One improvement to the basic ALOHA is sensing the carrier before sending data.  Sensing the carrier and sending the data only if the carrier is idle decreases the probability of a collision.  To minimize the chance of collision and, therefore, increase the performance, the CSMA method was developed.  The chance of collision can be reduced if a station senses the medium before trying to use it.  CSMA requires that each station first listen to the medium (or check the state of the medium) before sending. “Sense before transmit" OR "listen before talk“. CSMA can reduce the possibility of collision, but it cannot eliminate it.

Media Access Control PROTOCOLS RANDOM ACCESS Carrier Sense Multiple Access (CSMA)

Media Access Control PROTOCOLS RANDOM ACCESS Carrier Sense Multiple Access (CSMA)  The possibility of collision still exists because of propagation delay; when a station sends a frame, it still takes time (although very short) for the first bit to reach every station and for every station to sense it.  A station may sense the medium and find it idle, only because the first bit sent by another station has not yet been received.  At time t1, station A senses the medium and finds it idle, so it sends a frame.  At time t2 (t2> t1), station Z senses the medium and finds it idle because, at this time, the first bits from station A have not reached station Z.  Station Z also sends a frame.  The two signals collide and both frames are destroyed.

Media Access Control PROTOCOLS RANDOM ACCESS: Carrier Sense Multiple Access (CSMA) Variants of CSMA CSMA/CD CSMA/CA 1-Persistent P-Persistent Non-Persistent EY-NPMA CSMA

Media Access Control PROTOCOLS RANDOM ACCESS: Carrier Sense Multiple Access (CSMA) Persistent Strategies  What should a station do if the channel is busy?  What should a station do if the channel is idle?  Three methods have been devised to answer these questions:  The 1-persistent method,  The non-persistent method  The p-persistent method. Persistent Strategies 1-Persistent p-Persistent Non-Persistent Persistent

Media Access Control PROTOCOLS RANDOM ACCESS: Carrier Sense Multiple Access (CSMA) Persistent Strategies 1-Persistent  The 1-persistent method is simple and straightforward.  In this method, after the station finds the line idle, it sends its frame immediately (with probability 1).  This method has the highest chance of collision:  Two or more stations may find the line idle.  They send their frames immediately.

Media Access Control PROTOCOLS RANDOM ACCESS: Carrier Sense Multiple Access (CSMA) Persistent Strategies 1-Persistent  Figure below shows the behavior of 1-persistence method when a station finds a channel busy. Continuously sense Sense and transmit Busy Time Need to transmit

Media Access Control PROTOCOLS RANDOM ACCESS: Carrier Sense Multiple Access (CSMA) Persistent Strategies 1-Persistent A continuously senses Senses and transmit Busy Time Station A needs to transmit Senses and transmitStation B needs to transmit B continuously senses Collision Collision: This method has the highest chance of collision:  Two or more stations may find the line idle.  They send their frames immediately.

Media Access Control PROTOCOLS RANDOM ACCESS: Carrier Sense Multiple Access (CSMA) Persistent Strategies Non-Persistent  A station that has a frame to send senses the line.  If the line is idle, it sends immediately.  If the line is busy, it waits a random amount of time and then senses the line

Media Access Control PROTOCOLS RANDOM ACCESS: Carrier Sense Multiple Access (CSMA) Persistent Strategies Non-Persistent Collision:  This approach reduces the chance of collision:  It is unlikely that two or more stations will wait the same amount of time and retry to send simultaneously. Efficiency:  This method reduces the efficiency of the network because medium remains idle when there may be stations with frames to send.

Media Access Control PROTOCOLS RANDOM ACCESS: Carrier Sense Multiple Access (CSMA) Persistent Strategies Non-Persistent  Figure below shows the behavior of Non-Persistence method when a station finds a channel busy. Sense and transmit Busy Time Need to transmit Sense Wait Sense Wait

Media Access Control PROTOCOLS RANDOM ACCESS: Carrier Sense Multiple Access (CSMA) Persistent Strategies p-Persistent  This method is used if the channel has time slots with a slot duration equal to or greater than the maximum propagation time.  This approach combines the advantages of the other two strategies.  It reduces the chance of collision and improves efficiency.  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 back-off procedure.

Media Access Control PROTOCOLS RANDOM ACCESS: Carrier Sense Multiple Access (CSMA) Persistent Strategies p-Persistent

Media Access Control PROTOCOLS RANDOM ACCESS: Carrier Sense Multiple Access (CSMA) Persistent Strategies p-Persistent Continuously sense Transmit Busy Time Need to transmit Time slot Probability outcome does not allow transmission

Media Access Control PROTOCOLS RANDOM ACCESS: Carrier Sense Multiple Access (CSMA) EY-NPMA Elimination Yield – Non Preemptive Multiple Access  Here priority schemes can be included to assure preference of certain stations with more important data.

Media Access Control PROTOCOLS RANDOM ACCESS: Carrier Sense Multiple Access (CSMA) Carrier Sense Multiple Access with Collision Detection (CSMA / CD)  The CSMA method does not specify the procedure following a collision.  Carrier Sense Multiple Access with Collision Detection (CSMA/CD) augments the algorithm to handle the collision.  In this method, a station monitors the medium after it sends a frame to see if the transmission was successful.  If so, the station is finished.  If there is a collision, the frame is sent again.

Media Access Control PROTOCOLS RANDOM ACCESS: Carrier Sense Multiple Access (CSMA) Carrier Sense Multiple Access with Collision Detection (CSMA / CD)

Media Access Control PROTOCOLS RANDOM ACCESS: Carrier Sense Multiple Access (CSMA) Carrier Sense Multiple Access with Collision Detection (CSMA / CD)  Let us look at the first 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, we show what happens as the first bits collide.  In above figure, stations A and C are involved in the collision.

Media Access Control PROTOCOLS RANDOM ACCESS: Carrier Sense Multiple Access (CSMA) Carrier Sense Multiple Access with Collision Detection (CSMA / CD)  At time t 1, station A has executed its persistence procedure and starts sending the bits of its frame.  At time t 2, station C has not yet sensed the first bit sent by A. Station C executes its persistence procedure and starts sending the bits in its frame, which propagate both to the left and to the right.  The collision occurs sometime after time t 2.  Station C detects a collision at time t 3 when it receives the first bit of A’s frame. Station C immediately (or after a short time, but we assume immediately) aborts transmission.  Station A detects collision at time t 4 when it receives the first bit of C's frame; it also immediately aborts transmission.  At time t 4, the transmission of A’s frame, though incomplete, is aborted.  At time t 3, the transmission of C's frame, though incomplete, is aborted.

Media Access Control PROTOCOLS RANDOM ACCESS: Carrier Sense Multiple Access (CSMA) CSMA / CD PROCEDURE

Media Access Control PROTOCOLS RANDOM ACCESS: Carrier Sense Multiple Access (CSMA) CSMA / CD PROCEDURE

Media Access Control PROTOCOLS RANDOM ACCESS: CSMA / CD PROCEDURE

Media Access Control PROTOCOLS RANDOM ACCESS: Carrier Sense Multiple Access (CSMA) CSMA / CD PROCEDURE  CSMA/CD procedure is similar to the one for the ALOHA protocol, but there are differences.  We need to sense the channel before we start sending the frame by using one of the persistence processes.  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 (using two different ports). We use a loop to show that transmission is a continuous process. We constantly monitor in order to detect one of two conditions: either transmission is finished or a collision is detected. Either of these events stops transmission. When we come out of the loop, if a collision has not been detected, it means that transmission is complete; the entire frame is transmitted. Otherwise, a collision has occurred.  We send a short jamming signal that enforces the collision in case other stations have not yet sensed the collision.

Media Access Control PROTOCOLS RANDOM ACCESS: CSMA / CD PROCEDURE Energy Level  We can say that the level of energy in a channel can have three values: zero, normal, and abnormal.  At the zero level, the channel is idle.  At the normal level, a station has successfully captured the channel and is sending its frame.  At the abnormal level, there is a collision and the level of the energy is twice the normal level.  A station that has a frame to send or is sending a frame needs to monitor the energy level to determine if the channel is idle, busy, or in collision mode.

Media Access Control PROTOCOLS RANDOM ACCESS CSMA / CA Self Study