© Janice Regan, CMPT 128, 2007-2012 0 CMPT 371 Data Communications and Networking LANs 2: MAC protocols.

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.
Ethernet – CSMA/CD Review
Multiple access What if multiple machines are sharing the same link?
The Data Link Layer introduction point-to-point data link protocols
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.
1 Pertemuan 13 Teknik Akses Jaringan - Random Matakuliah: H0174/Jaringan Komputer Tahun: 2006 Versi: 1/0.
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.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 17 Introduction to Computer Networks.
1 Link Layer Message M A B Problem: Given a message M at a node A consisting of several packets, how do you send the packets to a “neighbor” node B –Neighbor:
EE 4272Spring, 2003 Chapter 14 LAN Systems Ethernet (CSMA/CD)  ALOHA  Slotted ALOHA  CSMA  CSMA/CD Token Ring /FDDI Fiber Channel  Fiber Channel Protocol.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 16 Introduction to Computer Networks.
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao
Studying Local Area Networks Via Media Access Control (MAC) SubLayer
5: DataLink Layer5-1 Link Layer – Error Detection/Correction and MAC.
5: DataLink Layer5-1 Chapter 5 Link Layer and LANs Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross.
CS352- Link Layer Dept. of Computer Science Rutgers University.
Networks: Local Area Networks1 LANs Studying Local Area Networks Via Media Access Control (MAC) SubLayer.
Medium Access Control Sublayer
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Ethernet, ARP.
Lecture 16 Random Access protocols r A node transmits at random at full channel data rate R. r If two or more nodes “collide”, they retransmit at random.
Shashank Srivastava Motilal Nehru National Institute Of Technology, Allahabad Medium Access Control.
5: DataLink Layer5-1 Chapter 5 Link Layer and LANs Part 3: MAC Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley.
9/11/2015 5:55 AM1 Ethernet and CSMA/CD CSE 6590 Fall 2010.
McGraw-Hill © The McGraw-Hill Companies, Inc., 2004 Chapter 12 Multiple Access Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
Chi-Cheng Lin, Winona State University CS412 Introduction to Computer Networking & Telecommunication Medium Access Control Sublayer.
4-1 Last time □ Link layer overview ♦ Services ♦ Adapters □ Error detection and correction ♦ Parity check ♦ Internet checksum ♦ CRC □ PPP ♦ Byte stuffing.
Chapter 12 Multiple Access Figure 12.1 Data link layer divided into two functionality-oriented sublayers Figure 12.2 Taxonomy of multiple-access protocols.
CSC4220/6220 Computer Networks
Chapter 5 Link Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 Link Layer multiple.
Medium Access Control NWEN302 Computer Network Design.
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Medium Access Control Sublayer.
4: DataLink Layer1 Multiple Access Links and Protocols Three types of “links”: r point-to-point (single wire, e.g. PPP, SLIP) r broadcast (shared wire.
17 - Winter 2005 ECE ECE 766 Computer Interfacing and Protocols 1 Local Area Networks Need for high performance communications for physically close devices.
Medium Access Control Sub Layer
Data Communications, Kwangwoon University12-1 Chapter 12. Multiple Access 1.Random Access 2.Controlled Access 3.Channelization.
Chapter 6 Multiple Radio Access
CS3502: Data and Computer Networks Local Area Networks - 1 introduction and early broadcast protocols.
5: DataLink Layer 5a-1 Multiple Access protocol. 5: DataLink Layer 5a-2 Multiple Access Links and Protocols Three types of “links”: r point-to-point (single.
Data Link Layer. Useful References r Wireless Communications and Networks by William Stallings r Computer Networks (third edition) by Andrew Tanenbaum.
Ch 12. Multiple Access. Multiple Access for Shared Link Dedicated link – Point-to-point connection is sufficient Shared link – Link is not dedicated –
LECTURE9 NET301 11/5/2015Lect 9 NET DYNAMIC MAC PROTOCOL: CONTENTION PROTOCOL Carrier Sense Multiple Access (CSMA): A protocol in which a node verifies.
5: DataLink Layer5a-1 Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction.
EE 122: Lecture 6 Ion Stoica September 13, 2001 (* this talk is based in part on the on-line slides of J. Kurose & K. Rose)
1 Ethernet CSE 3213 Fall February Introduction Rapid changes in technology designs Broader use of LANs New schemes for high-speed LANs High-speed.
5: DataLink Layer5-1 Link Layer r 5.1 Introduction and services r 5.2 Error detection and correction r 5.3Multiple access protocols r 5.4 Link-layer Addressing.
THE MEDIUM ACCESS CONTROL SUBLAYER 4.1 THE CHANNEL ALLOCATION PROBLEM 4.2 MULTIPLE ACCESS PROTOCOLS.
5: DataLink Layer5-1 Slotted ALOHA Assumptions r all frames same size r time is divided into equal size slots, time to transmit 1 frame r nodes start to.
2. Data Link Layer: Medium Access Control. Scheduling.
Chapter 5 Link Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
Example DLL Protocols 1. High-Level Data Link Control (HDLC).
Lecture #9 MAC Protocols
Chapter 5 Link Layer and LANs
High Speed LANs – Ethernet and Token Ring
Multiple Access Problem: When two or more nodes transmit at the same time, their frames will collide and the link bandwidth is wasted during collision.
Computer Communication Networks
Multiple Access Mahesh Jangid Assistant Professor JVW University.
Channel Allocation (MAC)
Net301 lecture9 11/5/2015 Lect 9 NET301.
Services of DLL Framing Link access Reliable delivery
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
Overview Jaringan Komputer (3)
Chapter 12 Multiple Access
Link Layer and LANs Not everyone is meant to make a difference. But for me, the choice to lead an ordinary life is no longer an option 5: DataLink Layer.
Link Layer: Multiple Access
Dr. John P. Abraham Professor UTPA
Multiple Access Control (MAC) Protocols
Presentation transcript:

© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking LANs 2: MAC protocols

Janice Regan © Point to point link  Direct connection between two hosts, medium connecting hosts is 100% available to the two endpoint hosts

Janice Regan © Broadcast link  The medium connecting the hosts is shared between many hosts.  Each time a frame is sent (broadcast or unicast) every other host attached to the medium receives a copy  A multiple access protocol is used to define how that sharing is accomplished

Janice Regan © Medium Access Control  LAN is a single shared broadcast channel  Transmission of a frame may be initiated at any time, or only at the beginning of defined ‘slots’  Two or more simultaneous transmissions by nodes on the LAN will collide and cause interference  only one node can successfully send at any given time  communication about channel sharing must use channel itself  stations may or may not be able to ‘sense’ a transmission from another station on the network  Need a distributed set of procedures that determines how to share the channel. Such procedures are defined in a Medium Access Control Protocol (MAC Protocol)

Janice Regan © MAC Protocols  Static Channel Allocation or Channel Partitioning  divide channel into time slots, frequency bands, code channels, may use a round robin technique  allocate one to each node for exclusive use  Contention or Random Access  Allow and recover from collisions  for bursty traffic  Straightforward to implement  adequate for light to moderate loads  Taking turns protocols  tightly coordinate shared access to avoid collisions  Reservation methods poll stations each cycle, but reserve transmission slots of for stations with data to transmit. (slightly more overhead than round robin, but improved efficiency due to avoiding empty slots)

Janice Regan © Channel Partitioning MAC: TDMA TDMA: time division multiple access (used for some cellular telephones )  access to channel in “cycles"  each station gets fixed length slot (length = pkt trans time) in each cycle  unused slots go idle, channel utilization may be low  example: 6-station LAN  Frame 1: 1,2,4,5 have pkt, slots 2 and 6 idle  Frame 2: 2,5,6 have pkt, slots 1,3,4 idle DDDDDDD 1 frame (6 slots)

Janice Regan © Channel Partitioning MAC: FDMA FDMA: frequency division multiple access (used for some cellular telephones )  Spectrum divided into frequency bands  Each station assigned a fixed frequency band  unused transmission time in frequency bands go idle  example: 6-station LAN  Frame 1: 1,2,4,5 have pkt, slots 2 and 6 idle  Frame 2: 2,5,6 have pkt, slots 1,3,4 idle Spectrum of frame 1 (6 bands)

Janice Regan © Channel Partitioning (CDMA) CDMA (Code Division Multiple Access)  Used mostly in wireless broadcast channels such as cellular phones  All users share same frequency band. Information from each user is spread throughout that frequency band  Each user has their own orthogonal Walsh code ‘chipping’ sequence to encode data.  encoded signal = (original data) X (Walsh code)  Encoded signals from each channel are added, the summed signal is transmitted  The orthogonal property of Walsh codes guarantees that (ignoring transmission errors) multiplying the received signal by a Walsh code will extract the data for the channel encoded using that Walsh code from the received (summed) signal.  Decoded signal = (received summed signal X Walsh code)

Janice Regan © Random Access Protocols  When node has packet to send it transmits that packet at full channel data rate R.  When two or more nodes transmit at the same time a collision occurs  A Random Access MAC protocol specifies how to detect and recover from collisions  Examples of Random Access MAC Protocols:  ALOHA, Slotted ALOHA  CSMA, CSMA/CD

Janice Regan © Pure (unslotted) ALOHA  No synchronization, simplest possible approach  When frame arrives at a station transmit immediately  Listen for an ACK for twice the maximum propagation time between stations in the network plus a small additional time  Retransmit if no ACK is received  A frame of duration (transmission time) 1 sent by station i at time t 0. It will collide with frames sent by other stations in the time interval [t 0 -1,t 0 +1 ] t0t0 t 0 -1t 0 +1 Packet from station i Packet from other station Packet from other station Any packet starting between t 0 and t 0 +1 collides Any packet starting between t 0 and t 0 -1 colides

Janice Regan © Pure Aloha efficiency  Frames are generated at a rate of N per frame transmission time. If N>1 frames are being generated at a rate faster than they can possibly be transmitted (even in ideal conditions)  Frames may also be retransmitted. The average number of frames (original and retransmitted) transmitted in one frame transmission time is G.  Let P 0 be the probability that the frame does not suffer a collision is P 0 =e -2G (for a Poisson distribution)  The throughput, S, (or efficiency) is the product of P 0 and the load presented G S=Ge -2G  At G = 0.5 the maximum value of S (S=0.18) is attained THE BEST WE CAN HOPE FOR IS 18%

Janice Regan © Slotted ALOHA  All nodes are synchronized so time can be divided into fixed length slots, with the first slot beginning at a reference time  Duration of a slot is transmission time of 1 frame  When 2 or more nodes transmit in the same slot, all nodes detect the resulting collision  A frame begins transmission at the beginning of a slot,  After a collision the node retransmits frame. The probability that the frame will be retransmitted in each subsequent slot will be P (until retransmission occurs)

Janice Regan © Slotted ALOHA  single node can continuously transmit at full rate of channel  Slots in nodes need to be in sync between nodes  Frames that overlap do so completely, reducing contentions  Collisions cause frequent retransmission, idle slots  Nodes may be able to detect collision in less than time to transmit packet so extra time is spent transmitted packets known to be corrupted Node 1 Node 4 Node 1 Node 4 Node 3 Node 2 Node 4 Node 2 Node 3 Node 1 collision Retransmit success Retransmit success Retransmit success Retransmit success

Janice Regan © Slotted Aloha efficiency  Utilization is the number of successful transmissions as a fraction of slots available  Let P 0 be the probability that the frame does not suffer a collision is P 0 =e -2G (for a Poisson distribution)  The probability of transmission on the k th try is P k = P( k-1 collisions) * P( successful transmission) = ( 1-e -2G ) k-1 e -2G  The expected number of transmissions for each packet is  The maximum throughput is then the presented load time the expected number of retransmissions S=Ge -G is a minimum, that is G=1  The channel used for successful transmissions no more than 37% of time

Janice Regan © Carrier Sense Multiple Access CSMA: listen (sense channel) before transmit:  If channel sensed idle: Transmit entire frame immediately  If channel sensed busy:  1-persistant CSMA: Listen until the channel is available then the station transmits as soon as the medium is available (immediately with probability 1)  Non-persistant CSMA: station waits a random time period and the checks the medium again, transmitting immediately if the channel is now free (better U but longer delays)  P-persistant CSMA: Listen until the channel is available, then transmit with probability p. (Probability q=1-p that the station will wait one time period, usually the maximum propagation delay, to transmit)  Channel is not sensed during transmission, whole packet is sent even if a collision occurs

Janice Regan © CSMA collisions  collisions can still occur: propagation delay means two nodes may not hear each other’s transmissions  Consider node A starts transmitting packet 1 at time t 0. Node C starts transmitting packet 2 at time t 1. The propagation time from A to C is 2t 1 A B A C Time t 3 =2.5*t 1 A C Time t 2 =1.5*t 1 Collision detected at station B starting at time 2t 1 Collision has occurred but has not been detected C B B Collision may never detected at station A or station C Time t 3 =2*t 1

Janice Regan © CSMA/CD (Collision Detection)  A station has a packet to transmit, packets are long enough that transmission time is longer than the end to end propagation time in the network (otherwise becomes no more efficient the plain CSMA)  If the medium is idle, transmit immediately  If the medium is busy listen until the medium is available  If a collision is detected,  transmit a short jamming signal to inform all stations there has been a collision  Then wait a random length of time (referred to as the backoff) and retransmit

Janice Regan © Binary Exponential Backoff  When a collision is detected,  transmit a short jamming signal to inform all stations there has been a collision  Then wait a length of time, L, chosen from a random distribution with mean, M. L is referred to as the backoff. After time L retransmit  Each time a collision is detected for a retransmitted frame the mean of the random distribution is doubled. An L is chosen from the new distribution and the frame is retransmitted after time L.  The doubling of the mean of the distribution continues for the first 10 retransmissions. For retransmission attempts 11 to 16 the random distribution remains the same.  After 16 retransmissions the station gives up and reports an error

Janice Regan © Collision Detection  Collisions detected within short time  ‘Short time’ For the detecting station is the propagation time from the sending station to the detecting station The sending station learns of the collision when the jamming signal reaches it, after a time equal to twice the propagation time.  Easier in wired LANs: measure signal strengths, compare transmitted, received signals. Possible difficulties with attenuation along very long propagations paths, when transmitted signal powers may fall below detection levels.  More difficult in wireless LANs: receiver shut off while transmitting  Reduces channel wastage by reducing amount of time transmitting during contention conditions.

Janice Regan © CSMA collisions and CSMA/CD  Consider node A starts transmitting packet 1 at time t 0. Node C starts transmitting packet 2 at time t 1. The propagation time from A to C is 2t 1 A B A C t 3 =2*t 1 A C t 2 =1.5*t 1 Collision detected by A and C. station A and C send jamming signal Collision detected at stations B C B B t 3 =3*t 1 Collision has occurred but has not been detected D A D

Janice Regan © CSMA collisions and CSMA/CD  Consider node A starts transmitting packet 1 at time t 0. Node C starts transmitting packet 2 at time t 1. The propagation time from A to C is 2t 1 C A Collision detected by A and C. station A and C send jamming signal B t 3 =3*t 1 A and C. receive jamming signal B t 3 =5*t 1 D A C A jamming signal received by B and D B t 3 =4*t 1 D

Janice Regan © MAC protocols Network Layer Logical Link Control (LLC) Ethernet Physical Layer Token Ring Token Bus Wireless Data Link Layer

Janice Regan © IEEE 802 Protocol Layers Stallings 2003: fig 15.5

Janice Regan © MAC Frame  Preamble: 7 octets of alternating 1’s and 0’s used to establish sychronization  Start Frame Delimiter (SFD): The sequence used to indicate the start of the frame.  Destination address (DA): address of the station for which the frame is intended (MAC address of interface)  Source address (SA): The address of the station that sent the frame  Length/Type: Length of the LLC data field (<1500 octets), or the type of protocol (if not 802.3)  Pad: added to make sure the transmission time of the packet is at least as long as the propagation time through the network (required for efficient use of CSMA/CD)  FCS: 32 bit CRC

Janice Regan © IEEE (Ethernet MAC Frame) Stallings 2000: fig 14.2, 17.8 IEEE (Wireless MAC Frame)

Janice Regan © Taking turns MAC protocols channel partitioning MAC protocols:  share channel efficiently and fairly at high load  inefficient at low load due to ‘idle’ slots Random access MAC protocols  efficient at low load: single node can fully utilize channel  collision overhead increases with load Taking turns protocols  look for best of both  Poll, transmit only when polled or only when told by central station  Use token passing (e.g. a token ring network)

Janice Regan © Polling  Eliminate collisions and empty frames  Controlled by a central station which  Sends a Poll message to start selected station transmitting  Watches for the end of the data transmitted by the station (no signal on the link for some limiting time > round trip travel time between the central station and the polled station = delay time)  Repeats the previous 2 steps until all hosts on the broadcast link have been polled  Repeats the polling of the whole set of stations  Addition overhead of delay time for each host, even if host has no data to transmit  If master node fails, whole link fails

Janice Regan © Example of Token Passing  Token Ring: Governed by standard  Based on the use of a small frame called a token  A station may only transmit when it has possession of a token  Transmission is a three step process  A station grabs the token as it passes (flipping token bit)  The station transmits its frame  The station reemits the token when both Transmission is complete The leading edge of the packet has returned to the transmitting station

Janice Regan © IEEE Frame Format Stallings 2000: fig 14.6

Janice Regan © Token Ring Operation  Transmission steps are as follows  A station wishing to transmit waits until the token passes and flips the token bit in the access control field  The station appends the rest of its packet after the ACR field  The station continues to transmit until it has transmitted all its packets or the token holding timer expires.  When the ACR field of the last transmitted frame returns the token bit is turned back on and the end data delimiter is appended  A frame returning to the originating station uses the frame status field to differentiate between  Destination station not active or does not exist (A=0,C=0)  Destination station exists but frame not copied (A=1,C=0)  Frame received (A=1,C=1)

Janice Regan © Token Ring Operation Stallings 2000: fig 14.5

Janice Regan © Token Ring Operation Stallings 2000: fig 14.5

Janice Regan © Token Ring Operation Stallings 2000: fig 14.5