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

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

Goals of Today s Lecture. Adaptors Communicating

ECE 4450:427/527 - Computer Networks Spring 2017

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

Computer and Network Security

Computer Networks Medium Access Control. Mostafa Salehi Fall 2008

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

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

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

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

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

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

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

Contention Protocols and Networks

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

Redes de Computadores. Medium Access Control

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

COS 140: Foundations of Computer Science

Chapter 5 Link Layer and LANs

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

COMP/ELEC 429/556 Introduction to Computer Networks

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

ECE 158A: Lecture 13. Fall 2015

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

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

COS 140: Foundations of Computer Science

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

Data Link Layer, Part 3 Medium Access Control. Preface

Reminder: Datalink Functions Computer Networking. Datalink Architectures

Multiple Access Links and Protocols

Computer Networks. Medium Access Sublayer (Part I)

Link Layer: Retransmissions

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

CSC 4900 Computer Networks: The Link Layer

Data Link Layer, Part 5. Medium Access Control

Chapter 5: Link layer

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

ECEN 5032 Data Networks Medium Access Control Sublayer

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

EE 122: Ethernet and

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

Data Link Layer: Multi Access Protocols

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

Computer Network Fundamentals Spring Week 3 MAC Layer Andreas Terzis

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

Protocols for Multiaccess Networks

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

Data Link Layer: Overview, operations

CSE 461: Multiple Access Networks. This Lecture

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

Networking Technologies and Applications

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

ECE 4450:427/527 - Computer Networks Spring 2017

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

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

Ethernet. Introduction. CSE 3213 Fall 2011

CS 3640: Introduction to Networks and Their Applications

Chapter 12 Multiple Access 12.1

Chapter 6 Medium Access Control Protocols and Local Area Networks

CSCD 330 Network Programming

CS 640 Lecture 4: 09/11/2014

Wireless MACs: MACAW/802.11

CSE 461 Multiple Access. David Wetherall

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

Multiple Access Channels

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

ECE 4450:427/527 - Computer Networks Spring 2017

Module 10 Data Link Layer CS655! 10-1!

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

Data and Computer Communications

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

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

Housekeeping. Fall /5 CptS/EE 555 1

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

Chapter 5 Link Layer and LANs

Chapter V: Link Layer

Aloha and slotted aloha

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

Multiple Access Protocols

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

COMP476 Networked Computer Systems. Polling. Sharing the Wire. LAN Technologies. COMP476 Networked Computer Systems 1

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

Wireless Communications

The Link Layer II: Ethernet

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

CSC 401 Data and Computer Communications Networks

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

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

Link Layer. (continued)

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

Chapter 4 (Week 7) The Medium Access Control Sublayer ANDREW S. TANENBAUM COMPUTER NETWORKS FOURTH EDITION PP CN&DC Dr.

CS 4453 Computer Networks Winter

Adaptors Communicating. Link Layer: Introduction. Parity Checking. Error Detection. Multiple Access Links and Protocols

Data and Computer Communications. Chapter 11 Local Area Network

Link Layer and Ethernet

Transcription:

Medium Access Control Mark Handley UCL Computer Science CS 3035/GZ01 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 1

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 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 4 2

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 Circuit Switching 6 3

Multiplexing Typically multiple data circuits are multiplexed onto one physical circuit. Don t need one pair of wires for each phone call. Can multiplex in time or in frequency: TDMA time FDMA frequency. 7 TDMA: Time Division Multiple Access Access to channel in rounds Each station gets fixed length slot (packet time) in each round Example: six stations, only 1, 3, and 4 have data to send 6-slot round 1 3 4 1 3 4 Time Disadvantage: unused slots go idle 8 4

FDMA: Frequency Division Multiple Access Channel spectrum divided into frequency bands Each station assigned fixed frequency band Example: six stations, only 1, 3, and 4 have data to send time FDM cable frequency bands Disadvantage: unused frequency bands are wasted 9 Statistical Multiplexing. Computer communication is not like telephone calls. Not continuous fixed data rate. Computers say nothing most of the time, then want as much capacity as possible for sort periods of time. Circuit switching using TDMA or FDMA is very inefficient. Sending data in packets and competing for the channel allows for much better burst speeds and better channel utilization. 10 5

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 who should talk when, and so dictates how to share the medium. 11 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 12 6

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 13 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 14 7

Random Access MAC Protocols When a host 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 15 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 16 8

Unslotted ALOHA: Performance Suppose some node i is transmitting; let s focus on i s frame overlaps with start of i s frame overlaps with end of i s frame other frame vulnerable period t 0 node i s frame other frame t 0-1 t 0 +1 1. If others start sending between t 0 1 and t 0, their frames will overlap with the start of i s frame! collision 2. If others start sending between t 0 and t 0 +1, their frames will overlap with end of i s frame! collision 3. Otherwise, no collision, and node i s frame is delivered 17 Unslotted ALOHA: Performance overlaps with start of i s frame overlaps with end of i s frame other frame vulnerable period node i s frame other frame t 0-1 t 0 +1 t 0 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 1 " % $ N # N ' e 2λ & " N 1 % ' & lim 1+ 1 x $ ' & x % x ) = e ( 18 9

Unslotted ALOHA: Utilization U$liza$on 1/2e 18% Too many collisions! Not sending fast enough λ Recall from our definition of the Poisson process: λ is the aggregate rate from all senders So, utilization = λ Pr(no other transmission in 2) = λe 2λ 19 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 20 10

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 21 Slotted ALOHA: Utilization Suppose N nodes, each transmits 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 U$liza$on 1/e 37% ( ) = λ $ 1 λ # N Pr success lim N λ " 1 λ % $ # N ' & " N 1 % ' & = λe -λ N 1 λ lim 1+ 1 x $ ' & ) = e x % x ( 22 11

ALOHA Throughput: Slotted vs. Unslotted 1/e 36% Slo9ed ALOHA: λe λ 1/2e 18% Unslo9ed ALOHA: λe 2λ Just by forcing nodes to transmit on slot boundaries, we double peak medium utilization! 23 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 24 12

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 the building Adapt ALOHA packet radio Metcalfe later founds 3Com, acquired by HP in April 10 for USD $2.7 bn 25 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 PropagaHon delay: τ 26 13

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 27 How to Encode Bits? Simplest 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 28 14

Manchester (Phase) Encoding Clock Data bits Manchester encoding Exclusive-OR of the NRZ signal and the clock signal 0 is a low-to-high transition; 1 is a high-to-low Transition guaranteed on every bit Phase encoding in the experimental Ethernet [Metcalfe et al.] Drawback: Halves data rate 29 4B/5B Encoding 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 4-bit data 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 5-bit code 11110 01001 10100 10101 01010 01011 01110 01111 10010 10011 10110 10111 11010 11011 11100 Encoding process: 1. Encode data using lookup table 1111 11101 2. Send coded bits with NRZI 30 15

Ethernet Framing (Metcalfe) Preamble DesHnaHon 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 31 Collisions Packet of N bits: N/B seconds on the wire W X Y Z Propagation delay: τ seconds From the perspective of a receiver (X): Overlapping packets at X means signals sum Not time-synchronized: result is bit errors at X No fate-sharing among receivers: Y receives fine in this example 32 16

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 33 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 34 17

Collision Detection Paper doesn t fully spell out this mechanism W X Y Z Propagation delay: τ seconds Mechanism: monitor average voltage on cable Manchester encoding means your transmission will have a predictable voltage V 0 ; others will increase V 0 Abort transmission immediately if V measured > V 0 35 When does a collision happen? W X Y Z Propagation delay: τ seconds Suppose Station W 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 τ 36 18

How Long to Detect a Collision? Suppose Station W begins transmitting at time 0 W X Y Z Propagation delay: τ seconds τ seconds after Z starts, W hears Z s transmission When does W know whether its packet collided or not? At time 2τ 37 Collision Detection and Packet Size How big must packets be for collisions to be detectable? W X Y Z PropagaHon delay: τ seconds Transmit rate B bits/second Propagation delay 2τ; want W to still be transmitting when Z s packet arrives at W, so W detects any 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? 38 19

Commercial Ethernet Commercial Ethernet Data rate B = 10 Mbits/s Maximum length: 500 m per segment with up to two repeaters (hubs) repeater W X Y Z PropagaHon delay: τ seconds Repeater receives bits, relays them onto next wire τ = 20 µs worst case 2τB = 400 bits = 50 bytes Could send complete packet; not see collision 39 Enforcing Consensus on Collisions W Y Z Propagation delay: τ seconds Suppose Y starts transmittingτ- ε after W (ε very small). Y then hears W and immediately aborts. Y s transmission may be too short to trigger collision detection at W, but long enough to corrupt W s packet to Z 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, backoff, and retransmit 40 20

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 again and transmitting 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 again, and not collide 41 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 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 42 21

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 (Won t CS happen) fail OK Bad OK So should we pick a backoff slot length of τ? 43 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 τ τ τ τ Δ Sta$on A, slot 1 OK Sta$on B, slot 0 0 1 2 Suppose we use a backoff slot length of τ Different stations picking different slots may collide! OK 44 22

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 contention window (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 23

Next time: Wireless LANs and WiFi 51 24