Medium Access Control

Similar documents
Medium Access Control

Link Layer I: ALOHA, Time-, Frequency-, and Code Division. COS 463: Wireless Networks Lecture 4 Kyle Jamieson

CS 43: Computer Networks. 27: Media Access Contd. December 3, 2018

CS 43: Computer Networks Media Access. Kevin Webb Swarthmore College November 30, 2017

Links. CS125 - mylinks 1 1/22/14

Goals of Today s Lecture. Adaptors Communicating

Links Reading: Chapter 2. Goals of Todayʼs Lecture. Message, Segment, Packet, and Frame

Random Access. 1. Aloha. 2. Slotted Aloha 3. CSMA 4. CSMA/CD

Lecture 19. Principles behind data link layer services Framing Multiple access protocols

ECE 4450:427/527 - Computer Networks Spring 2017

The Link Layer and LANs. Chapter 6: Link layer and LANs

Computer Networks Medium Access Control. Mostafa Salehi Fall 2008

Message, Segment, Packet, and Frame Link-layer services Encoding, framing, error detection, transmission control Error correction and flow control

Computer and Network Security

CS 716: Introduction to communication networks. - 9 th class; 19 th Aug Instructor: Sridhar Iyer IIT Bombay

CS 455/555 Intro to Networks and Communications. Link Layer

COMP/ELEC 429/556 Introduction to Computer Networks

Contention Protocols and Networks

COS 140: Foundations of Computer Science

CIS 551 / TCOM 401 Computer and Network Security. Spring 2007 Lecture 7

Link Layer and LANs 안상현서울시립대학교컴퓨터 통계학과.

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 16

1-1. Switching Networks (Fall 2010) EE 586 Communication and. November 8, Lecture 30

CHAPTER 7 MAC LAYER PROTOCOLS. Dr. Bhargavi Goswami Associate Professor & Head Department of Computer Science Garden City College

COS 140: Foundations of Computer Science

High Level View. EE 122: Ethernet and Random Access protocols. Medium Access Protocols

Lecture 9: Bridging. CSE 123: Computer Networks Alex C. Snoeren

Redes de Computadores. Medium Access Control

Chapter 5 Link Layer and LANs

EE 122: Ethernet and

Multiple Access Links and Protocols

Data Link Layer, Part 3 Medium Access Control. Preface

Lecture 6. Data Link Layer (cont d) Data Link Layer 1-1

Data Link Layer, Part 5. Medium Access Control

Getting Connected (Chapter 2 Part 4) Networking CS 3470, Section 1 Sarah Diesburg

Chapter 5: Link layer

Outline. Introduction to Networked Embedded Systems - Embedded systems Networked embedded systems Embedded Internet - Network properties

Computer Networks. Medium Access Sublayer (Part I)

ECE 158A: Lecture 13. Fall 2015

Networking Technologies and Applications

Protocols for Multiaccess Networks

Lecture 6 The Data Link Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Data Link Layer: Multi Access Protocols

Reminder: Datalink Functions Computer Networking. Datalink Architectures

ECEN 5032 Data Networks Medium Access Control Sublayer

ECE 4450:427/527 - Computer Networks Spring 2017

Link Layer: Retransmissions

Computer Network Fundamentals Spring Week 3 MAC Layer Andreas Terzis

CS 640 Lecture 4: 09/11/2014

Housekeeping. Fall /5 CptS/EE 555 1

Topics. Link Layer Services (more) Link Layer Services LECTURE 5 MULTIPLE ACCESS AND LOCAL AREA NETWORKS. flow control: error detection:

Lecture 8 The Data Link Layer part I. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

The Link Layer II: Ethernet

Computer Networks. Today. Principles of datalink layer services Multiple access links Adresavimas, ARP LANs Wireless LANs VU MIF CS 1/48 2/48

CSC 4900 Computer Networks: The Link Layer

Ethernet. Introduction. CSE 3213 Fall 2011

CS 3640: Introduction to Networks and Their Applications

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

Chapter 6 Medium Access Control Protocols and Local Area Networks

Data Link Layer: Overview, operations

Link layer, LANs: outline. Chapter 5-1 Link Layer. Link layer: introduction. Link layer services

Physical Layer. Medium Access Links and Protocols. Point-to-Point protocols. Modems: Signaling. Modems Signaling. Srinidhi Varadarajan

CSE 461: Multiple Access Networks. This Lecture

CS 123: Lecture 12, LANs, and Ethernet. George Varghese. October 24, 2006

Chapter 12 Multiple Access 12.1

ECE453 Introduction to Computer Networks. Broadcast vs. PPP. Delay. Lecture 7 Multiple Access Control (I)

CSCD 330 Network Programming

CCM 4300 Lecture 5 Computer Networks, Wireless and Mobile Communications. Dr Shahedur Rahman. Room: T115

Lecture 5 The Data Link Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Data and Computer Communications

Multiple Access Channels

ECE 4450:427/527 - Computer Networks Spring 2017

Module 10 Data Link Layer CS655! 10-1!

Links. COS 461: Computer Networks Spring Mike Freedman h?p://

EITF25 Internet Techniques and Applications L4: Network Access. Stefan Höst

Lecture 8 Link Layer: functionality, error detection, media access algorithm

Aloha and slotted aloha

Chapter 5 Link Layer. Computer Networking: A Top Down Approach. 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012

Jaringan Komputer. Broadcast Network. Outline. MAC (Medium Access Control) Channel Allocation Problem. Dynamic Channel Allocation

Random Assignment Protocols

Ethernet. Lecture 6. Outline. Ethernet - Physical Properties. Ethernet - Physical Properties. Ethernet

Multiple Access Protocols

CSE 461 Multiple Access. David Wetherall

Wireless MACs: MACAW/802.11

Chapter V: Link Layer

Chapter 5 Link Layer and LANs

Data and Computer Communications. Chapter 11 Local Area Network

CSE 461: Multiple Access. Homework: Chapter 2, problems 1, 8, 12, 18, 23, 24, 35, 43, 46, and 58

CSC 401 Data and Computer Communications Networks

LECTURE PLAN. Script. Introduction about MAC Types o ALOHA o CSMA o CSMA/CD o CSMA/CA

Links. Error Detection. Link Layer. Multiple access protocols. Nodes Links Frame. Shared channel Problem: collisions How nodes share a channel

RMIT University. Data Communication and Net-Centric Computing COSC 1111/2061/1110. Lecture 8. Medium Access Control Methods & LAN

Lecture 6. Reminder: Homework 2, Programming Project 2 due on Thursday. Questions? Tuesday, September 13 CS 475 Networks - Lecture 6 1

TSIN01 Information Networks Lecture 3

MULTIPLE ACCESS PROTOCOLS 2. 1

The Medium Access Control Scheme (MAC Layer) Reference: Andrew S. Tanenbaum, Computer Networks, 3rd Edition, Prentice Hall, 1996.

Link Layer and Ethernet

Overview. Performance metrics - Section 1.5 Direct link networks Hardware building blocks - Section 2.1 Encoding - Section 2.2 Framing - Section 2.

CSMA/CD (Collision Detection)

Your Future?! Links and LANs! Regrading of Homework! Other Announcements! Goals of Todayʼs Lecture! Link-Layer Services!

Transcription:

Medium Access Control Brad Karp (slides contributed by Kyle Jamieson) UCL Computer Science CS 3035/GZ01 14 th October 2014

Context: OSI Layer 2, S&K Link Layer email WWW phone...! SMTP HTTP RTP...! TCP UDP!! IP!! ethernet PPP! CSMA async sonet...! copper fiber radio...! 2

Review: The Data Link Layer Enables exchange of atomic messages (frames) between end hosts Determine start and end of bits and frames (framing) Deliver information reliably Control errors (previous lecture) Some link layers involve a shared medium e.g., Shared-wire Ethernet, satellite uplink, WiFi Today: Medium access control to share the medium 3

Medium Access: the Problem Two questions: 1. How should the shared medium be divided? 2. Who gets to talk on a shared medium, and when? A medium access control (MAC) protocol specifies the above Three goals of a MAC protocol: 1. Efficiency High throughput (bits/second successfully received through the channel) High utilization (throughput/raw channel rate) 2. Fairness: all hosts with data to send should get a roughly equal share of the medium over time 3. Latency: want to minimize the time a host waits before being granted permission to talk on the shared medium 4

Today 1. Channel partitioning: Time division multiple access (TDMA) Frequency division multiple access (FDMA) 2. Random access protocol: ALOHA Unslotted ALOHA Slotted ALOHA 3. Random access protocol: the Ethernet 5

TDMA: Time Division Multiple Access Access to channel in rounds Each station gets fixed length slot (packet time) in each round (unused slots go idle) Example: six stations, only 1, 3, and 4 have data to send 6- slot round 1 3 4 1 3 4 Time 6

FDMA: Frequency Division Multiple Access Channel spectrum divided into frequency bands Each station assigned fixed frequency band (unused frequency bands are wasted) Example: six stations, only 1, 3, and 4 have data to send FDM cable frequency bands 3me 7

Today 1. Channel partitioning: Time division multiple access (TDMA) Frequency division multiple access (FDMA) 2. Random access protocol: ALOHA Unslotted ALOHA Slotted ALOHA 3. Random access protocol: the Ethernet 8

Random Access MAC Protocols When a station has a frame to send: Transmit at full channel data rate B No a priori coordination among nodes Two or more frames overlapping in time: collision Both frames are lost, resulting in diminished throughput A random access MAC protocol specifies: How to detect collisions (if medium supports doing so!) How to recover from collisions 9

ALOHAnet: Context Norm Abramson, 1970 at the University of Hawaii Seven campuses on four islands Want to keep campus terminals in contact with mainframe Telephone costs high, so build a packet radio network 10

Unslotted ALOHA Simplest possible medium access control: no control at all, anyone can just transmit a packet without delay Node 1 Node 2 Node 3 Time Let s assume that the probability a packet begins in any time interval of length Δt is λ Δt N senders in total, sending frames of time duration 1 This is called a Poisson process with rate λ λ is the aggregate rate from all N senders Individual rate λ/n for each sender 11

Unslotted ALOHA: Performance Suppose some node i is transmitting; let s focus on i s frame 12

Unslotted ALOHA: Performance Suppose some node i is transmitting; let s focus on i s frame Vulnerable period I. If others send between t 0 1 and t 0, their frames will overlap with the start of i s frame à collision II. If others send between t 0 and t 0 +1, their frames will overlap with end of i s frame à collision III. Otherwise, no collision, and node i s frame is delivered Therefore, there is a vulnerable period of length 2 around i s frame 13

Unslotted ALOHA: Performance Vulnerable period What s the chance no one else sends in the vulnerable period of length 2? Pr( no send from one node in 2) =1 2λ N ( ) = $ 1 2λ # N Pr no send at all in 2 " lim$ 1 2λ N # N % ' & N 1 " e 2λ % ' & N 1 $ lim 1+ 1 ' & ) x % x ( x = e 14

Unslotted ALOHA: Utilization UClizaCon 1/2e 18% Too many collisions! Not sending fast enough λ Recall from our defini3on of the Poisson process: λ is the aggregate rate from all senders So, uclizacon = λ Pr(no other transmission in 2) = λe 2λ 15

Today 1. Channel partitioning: Time division multiple access (TDMA) Frequency division multiple access (FDMA) 2. Random access protocol: ALOHA Unslotted ALOHA Slotted ALOHA 3. Random access protocol: the Ethernet 16

Slotted ALOHA Divide time into slots of duration 1, synchronize so that nodes transmit only in a slot Each of N nodes transmits with probability p in each slot So aggregate transmission rate λ = N p As before, if there is exactly one transmission in a slot, can receive; if two or more in a slot, no one can receive (collision) Node 1 Node 2 Node 3... Node N Time 17

Slotted ALOHA: Utilization Suppose N nodes, each transmit with probability p in each slot. What is the utilization as a function of aggregate rate λ = N p? Pr[A node is successful in a slot] = p(1 p) N 1 Pr[Success in a slot] = Np(1 p) N 1 UClizaCon 1/e 37% ( ) = λ $ 1 λ # N Pr success lim N λ " 1 λ % $ # N ' & " N 1 % ' & = λe -λ N 1 λ $ lim 1+ 1 ' & ) x % x ( x = e 18

ALOHA Throughput: Slotted vs. Unslotted 1/e 36% SloKed ALOHA: λe λ 1/2e 18% UnsloKed ALOHA: λe 2λ Just by forcing nodes to transmit on slot boundaries, we double peak medium u3liza3on! 19

Today 1. Tour of medium access protocols (TDMA, FDMA) 2. Random access protocol: ALOHA Unslotted ALOHA Slotted ALOHA 3. Random access protocol: the Ethernet 20

The Origin of Ethernet Bob Metcalfe, PhD student at Harvard in early 1970s Working on protocols for the ARPAnet Intern at Xerox Palo Alto Research Center (PARC), 1973 Needed a way to network the 100 Alto workstations in-building Adapt ALOHA packet radio Metcalfe later founds 3Com, acquired by HP in April 10 for USD $2.7 bn 21

The Ethernet: Physical Design Coaxial cable, propagation delay τ Propagation speed: 3/5 speed of light Experimental Ethernet Data rate: B = 3 Mbits/s Maximum length: 1000 m τ = 10 3 m ( ) 5 µs 3 3 5 108 m/s Propaga3on delay: τ 22

Building the Link: Framing Bits Goal: Move bits from one place to another Sender and receiver have independent clocks No separate clock signal sent on the Ethernet Problem: Agree on clock tick period Sender clock 1 0 0 0 1 0 1 0 1 Receiver clock "1" "0" "0" "0" "1" "?" "?" "?" "?" Time Problem: Agree on clock tick alignment (phase) Sender clock 1 0 0 0 1 0 1 0 1 Receiver clock "?" "?" "?" "?" "?" "?" "?" "?" Time 23

How to Encode Bits? Simple binary encoding is called Nonreturn to Zero (NRZ) Drawback: Baseline wander prevents receiver from using average of received signal to distinguish between 1 and 0 Drawback: Clock recovery in the presence of long runs of 0s or 1s in the data 24

How to Encode Bits? Simple binary encoding is called Nonreturn to Zero (NRZ) Drawback: Baseline wander prevents receiver from using average of received signal to distinguish between 1 and 0 Drawback: Clock recovery in the presence of long runs of 0s or 1s in the data Nonreturn to Zero Inverted (NRZI): Transition for a 1, no transition for a 0 25

Manchester (Phase) Encoding Manchester encoding: Exclusive- OR of the NRZ signal and the clock signal 0 is a low- to- high transi3on; 1 is a high- to- low Transi3on guaranteed on every bit Phase encoding in the experimental Ethernet [Metcalfe et al.] Drawback: Halves data rate 26

4B/5B Encoding So instead, later Ethernet standards use a block code called 4B/5B Properties No code has more than one leading zero No code has more than two trailing zeros When sent back-to-back, no pair of 5-bit codes contains more than three consecutive zeros Encoding process: 1. Encode data using lookup table 2. Send coded bits with NRZI 4- bit data 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 5- bit code 11110 01001 10100 10101 01010 01011 01110 01111 10010 10011 10110 10111 11010 11011 11100 11101 27

Framing Ethernet Framing Preamble Des3na3on Source Data CRC 8 bits 8 bits 4000 bits 16 bits Beginning of frame determined by presence of carrier End of frame determined by absence of carrier Preamble: 10101010 produces a square wave that allows receiver to frame bits CRC (Cyclic Redundancy Check) protects against errors on the Ether Does not guard against errors introduced by the interface or host: rely on higher-layer checksums Destination address allows filtering at the link layer 28

Collisions Packet of N bits: N/B seconds on the wire A B C Z Propaga3on delay: τ seconds From the perspective of a receiver (B): Overlapping packets at B means signals sum Not time-synchronized: result is bit errors at B No fate-sharing among receivers: C receives fine in this example 29

Collisions Packet of N bits: N/B seconds on the wire A B C Z Propaga3on delay: τ seconds From the perspective of a receiver (B): Overlapping packets at B means signals sum Not time-synchronized: result is bit errors at B No fate-sharing among receivers: C receives fine in this example 30

Who Gets to Transmit? Carrier Sense Multiple Access with Collision Detection (CSMA/CD) 1. Begin the transmission procedure at any time 2. Carrier sensing: never transmit a frame if you sense that another station is transmitting 3. Collision detection: while sending, immediately abort your transmission if you detect another station transmitting 31

Carrier Sensing Mechanism: measure voltage on the wire Binary encoding: voltage depends on the data Bit stream 1 0 0 0 1 0 0 1 1 Binary encoding Manchester encoding Manchester coding: constant average voltage Time 32

Collision Detection Paper doesn t fully spell out this mechanism A B C Z Propaga3on delay: τ seconds Mechanism: monitor average voltage on cable Manchester encoding means your transmission will have a predictable average voltage V 0 ; others will increase V 0 Abort transmission immediately if V measured > V 0 33

When does a collision happen? A B C Z Propaga3on delay: τ seconds Suppose Station A begins transmitting at time 0 Assume that the packet lasts much longer than τ All stations sense transmission and defer by time τ Don t begin any new transmissions At time τ, will a packet be collision-free? Only if no other transmissions began before time τ 34

How Long to Detect a Collision? Suppose Station A begins transmitting at time 0 A B C Z Propaga3on delay: τ seconds τ seconds after Z starts, A hears Z s transmission When does A know whether its packet collided or not? At time 2τ 35

Collision Detection and Packet Size How big must packets be for collisions to be detectable? A B C Z Propaga3on delay: τ seconds Transmit rate B bits/second Propagation delay 2τ; want A to still be transmitting when Z s packet arrives at A, so A detects collision So minimum packet size > 2τB bits Experimental Ethernet: τ = 5 µs, B = 3 Mbits/s 2τB = 30 bits Why doesn t Metcalfe & Boggs paper mention this? 36

Commercial Ethernet Commercial Ethernet Data rate B = 10 Mbits/s Maximum length: 500 m per segment with up to two repeaters (hubs) A B C Z repeater Propaga3on delay: τ seconds Repeater receives bits, relays them onto wire τ = 20 µs worst case 2τB = 400 bits = 50 bytes Could send complete packet; not see collision 37

Resolving Collisions Upon abort (carrier detect), a station enters the backoff state Key idea: the colliding stations all wait a random time before carrier sensing and transmitting again How to pick the random waiting time? (Should be based on how many stations have data to send) How to estimate the number of colliding stations? Goal: Engineer such that nodes will wait different amounts of time, carrier sense, and not collide 38

Slotted Ethernet Backoff Backoff time is slotted and random Station s view of the where the first slot begins is at the end of the busy medium Random choice of slots within a window, the contention window (CW) Slot time Busy Medium Transmit Contention Window (CW) Goal: Choose slot time so that different nodes picking different slots carrier sense and defer, thus don t collide 39

Picking Length of Backoff Slot Consider from the perspective of one packet 1. Transmissions beginning > τ before will cause packet to defer 2. Transmissions beginning > τ after will not happen (why not?) Transmissions beginning < time τ apart will collide with packet τ τ Cause defer OK So should we pick a backoff slot length of τ? 40

Picking Length of Backoff Slot Consider from the perspective of one packet 1. Transmissions beginning > τ before will cause packet to defer 2. Transmissions beginning > τ after will not happen (why not?) Transmissions beginning < time τ apart will collide with packet τ τ (Won t happen) OK OK So should we pick a backoff slot length of τ? 41

Picking Length of Backoff Slot Consider from the perspective of one packet 1. Transmissions beginning > τ before will cause packet to defer 2. Transmissions beginning > τ after will not happen (why not?) Transmissions beginning < time τ apart will collide with packet τ τ CS fail OK Bad OK So should we pick a backoff slot length of τ? 42

Problem: Clock Skew No! Slots are timed off the tail-end of the last packet Therefore, stations clocks differ by at most τ This is called clock skew Δ ( τ < Δ < τ) 0 1 2 τ τ τ τ Δ OK 0 1 2 Suppose we use a backoff slot length of τ Different stations picking different slots may collide! 43 OK

Problem: Clock Skew No! Slots are timed off the tail-end of the last packet Therefore, stations clocks differ by at most τ This is called clock skew Δ ( τ < Δ < τ) 0 1 2 τ τ τ τ Δ StaCon A, slot 1 OK StaCon B, slot 0 0 1 2 Suppose we use a backoff slot length of τ Different stations picking different slots may collide! 44 OK

Picking Slot Length in Presence of Clock Skew Want other station s other slots to be in OK region Then, transmissions in different slots won t collide Worst case clock skew: τ So, pick a slot time of τ + τ = 2τ 0 1 2 τ Δ τ 2τ 2τ OK 2τ 2τ 0 1 2 OK 45

Binary Exponential Backoff Binary exponential backoff (BEB): double CW size on each consecutive collision Stations wait some number of slots chosen uniformly at random from CW = [0, 2 m 1] Reset m 1 upon a successful transmission First retransmit (m = 1): pick from [0, 1] Second retransmit (m = 2): pick from [0, 1, 2, 3] Tenth and higher retransmissions (m 10): pick from [0, 1,, 2 10 1] Observe: stations transmitting new frames don t take into account recent collisions, might transmit before stations in backoff 46

Enforcing Consensus on Collisions A B C Z Ethernet as described so far: collision at B and C but not at A or Z Lack of consensus results in differing backoff windows Metcalfe & Boggs: When a station detects collision, it momentarily jams the Ether to [ensure] that all other participants in the collision will detect interference and, because of deference, will be forced to abort. Result: All stations agree there was a collision, double backoff windows, backoff, and retransmit Jamming signal of length 2τ suffices to enforce consensus 47

Ethernet Performance Divide time into Variable-sized contention intervals, Fixed size transmission intervals (of duration t packet ) t packet Time Efficiency: t packet t packet + ( 2τ)W slot 3me Number of slots to acquire the Ether 48

Ethernet Performance: Acquisition Suppose there are Q stations waiting to send Assume stations know Q and send with probability 1/Q (BEB approximates this) What s the probability p acquire that one sta8on acquires the medium without a collision? " p acquire = Q 1 % $ # Q& ' " 1 1 % $ # Q ' & " = 1 1 % $ ' # Q& Q 1 Q 1 1 e 37% 49

Ethernet Performance: Waiting Time W: number of slots in a conten3on window before acquisi3on of the Ether Probability of no wait: p acquire Probability wait one slot: (1 p acquire )p acquire Probability wait two slots: (1 p acquire ) 2 p acquire E[slots to wait] = E[W] = (1 p acquire )/p acquire = e 1 50