Computer Networks Chapter 4: Medium Access Control (MAC)

Similar documents
Wireless Sensor Networks 7th Lecture

COS 140: Foundations of Computer Science

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

Chapter 6 Medium Access Control Protocols and Local Area Networks

ECEN 5032 Data Networks Medium Access Control Sublayer

Computer Networks. Medium Access Sublayer (Part I)

COS 140: Foundations of Computer Science

Multiple Access Protocols

Chapter 4. The Medium Access Control Sublayer. Points and Questions to Consider. Multiple Access Protocols. The Channel Allocation Problem.

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

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

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

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

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

Markov Chains and Multiaccess Protocols: An. Introduction

Goals. Fundamentals of Network Media. More topics. Topics. Multiple access communication. Multiple access solutions

Medium Access Control Sublayer Chapter 4

COMPUTER NETWORKS - Local area networks

Local area networks. Copyright

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

Multiple Access (1) Required reading: Garcia 6.1, 6.2.1, CSE 3213, Fall 2010 Instructor: N. Vlajic

LANs. Local Area Networks. via the Media Access Control (MAC) SubLayer. Networks: Local Area Networks

EE 122: Ethernet and

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

Contention Protocols and Networks

Medium Access Control

Protocols for Multiaccess Networks

Ethernet. Introduction. CSE 3213 Fall 2011

Data and Computer Communications

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

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

Redes de Computadores. Medium Access Control

COMP/ELEC 429/556 Introduction to Computer Networks

LANs Local Area Networks LANs provide an efficient network solution : To support a large number of stations Over moderately high speed

Wireless Communications

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

2.1 CHANNEL ALLOCATION 2.2 MULTIPLE ACCESS PROTOCOLS Collision Free Protocols 2.3 FDDI 2.4 DATA LINK LAYER DESIGN ISSUES 2.5 FRAMING & STUFFING

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

TSIN01 Information Networks Lecture 3

Chapter 12 Multiple Access 12.1

Multiple Access. Data Communications and Networking

Data Link Layer -2- Network Access

Local Area Networks (LANs) SMU CSE 5344 /

ECE 4450:427/527 - Computer Networks Spring 2017

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

The MAC layer in wireless networks

COMMUNICATION NETWORKS NETW 501

Wireless Sensor Networks 8th Lecture

CSE 461 Multiple Access. David Wetherall

ECE 158A: Lecture 13. Fall 2015

Data and Computer Communications. Chapter 11 Local Area Network

CSE 461: Multiple Access Networks. This Lecture

Wireless Medium Access Control Protocols

ICE 1332/0715 Mobile Computing (Summer, 2008)

Random Assignment Protocols

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

Data Link Layer -2- Network Access

Packet multiple access and the Aloha protocol

MAC Sublayer(1) Principal service of the Medium Access Control Sublayer: Allocating a single broadcast channel (mostly a LAN) among competing users

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

Multimedia Communication Services Traffic Modeling and Streaming

Medium Access Control

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

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

Chapter 4. The Medium Access Control Sublayer

Lecture 12 December 04, Wireless Access. Graduate course in Communications Engineering. University of Rome La Sapienza. Rome, Italy

Computer Network Fundamentals Spring Week 3 MAC Layer Andreas Terzis

Data Link Layer: Collisions

Multiple Access Communications. EEE 538, WEEK 11 Dr. Nail Akar Bilkent University Electrical and Electronics Engineering Department

Multiple Access Channels

Aloha and slotted aloha

Link Layer: Retransmissions

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

Computer Networks Medium Access Control. Mostafa Salehi Fall 2008

The MAC layer in wireless networks

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

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

ETSN01 Exam Solutions

ECSE-4670: Computer Communication Networks (CCN) Informal Quiz 3

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

Medium Access Control

Chapter 6 Medium Access Control Protocols and Local Area Networks

Link Layer. (continued)

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

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

The Medium Access Control Sublayer

Chapter 1 Basic concepts of wireless data networks (cont d)

Data Link Layer, Part 3 Medium Access Control. Preface

Outline. Application examples

Medium Access Protocols

Networking Technologies and Applications

Data Link Layer, Part 5. Medium Access Control

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

Chapter 4: The Medium Access Layer

Medium Access Control. CSCI370 Lecture 5 Michael Hutt New York Institute of Technology

Comparison of pre-backoff and post-backoff procedures for IEEE distributed coordination function

Medium Access Control Sublayer

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

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

Direct Link Communication II: Wired Media. Multi-Access Communication

Transcription:

Computer Networks Chapter 4: Medium Access Control (MAC) Holger Karl Computer Networks Group Universität Paderborn

Goals of this chapter The medium access problem and main options for solutions Understand performance problems of fixed multiplexing schemes Important performance metrics Options for MAC protocols: sending, receiving, listening, synchronizing; environment in which they work Classification & examples of MAC protocols, performance aspects An important example: Ethernet WS 09/10, v 2.0 Computer Networks - Medium Access Control 2

Outline Static multiplexing Dynamic channel allocation Collision-based protocols Contention-free protocols Limited contention protocols Case study: Ethernet WS 09/10, v 2.0 Computer Networks - Medium Access Control 3

Static multiplexing Given a single resource, it can be statically multiplexed Assigning fixed time slots to multiple communication pairs Assigning fixed frequency bands Assigning fixed resources to different sources is fine if Data rate of source and multiplexed link are matched Sources can always saturate the link WS 09/10, v 2.0 Computer Networks - Medium Access Control 4

Bursty traffic What happens if sources have bursty traffic? Definition: Large difference between peak and average rate In computer networks: Peak : average = 1000 : 1 quite common Source data rate Mean rate Time WS 09/10, v 2.0 Computer Networks - Medium Access Control 5

Static multiplexing & bursty traffic Statically multiplexed resources must either: Source data rate Be large enough to cope with the peak data rate immediately! Big waste, since on average the link/channel will not be utilized Required rate Mean rate Time Be dimensioned for average rate, but then need a buffer! What is the delay until a packet is transmitted? New packets Packets Queues MUX WS 09/10, v 2.0 Computer Networks - Medium Access Control 6

Statically multiplexed bursty traffic delay Compare the delay resulting from static multiplexing Base case: No multiplexing, a single traffic source with average rate ρ (bits/s), link capacity C bits/s Delay is T (In case you really want to know: T = 1/(µ C-λ), ρ=λ/µ) Multiplexed case: Split the single source in N sources with same total rate, statically multiplex over the same link (e.g., FDM) Delay T FDM = NT Irrespective of FDM, TDM, - essentially, a queuing theory result! Hence: static multiplexing increases N-fold the delay of a packet Intuition: Because some channels are idle sometimes WS 09/10, v 2.0 Computer Networks - Medium Access Control 7

Outline Static multiplexing Dynamic channel allocation Collision-based protocols Contention-free protocols Limited contention protocols Case study: Ethernet WS 09/10, v 2.0 Computer Networks - Medium Access Control 8

Dynamic channel allocation MAC Because of the bad delay properties caused by idle subchannels static multiplexing is not appropriate for bursty traffic sources Telephony is not bursty, computer networks are bursty Alternative: Assign channel/link/resource to that source that currently has data to send Dynamic medium allocation Instead of fixed assignments of parts of a shared resource Terminology: Access to the transmission has to be organized a medium access control protocol (MAC) is required WS 09/10, v 2.0 Computer Networks - Medium Access Control 9

Assumptions for dynamic channel allocation Station model (or terminal model) N independent stations want to share a given resource One possible load model: probability of generating a packet in interval Δ t is λ Δ t, λ = const Single channel assumption Only a single channel for all stations No possibility to communicate/signal anything via other means Collision assumption Only a single frame can be successfully transmitted at a time Two (or more) frames overlapping in time will collide and are both destroyed No station can receive either frame Note: there are sometimes exceptions to this rule Packet arrivals Time WS 09/10, v 2.0 Computer Networks - Medium Access Control 10

Assumptions for dynamic channel allocation Time model Continuous time: Transmissions can begin at any time; no central clock Slotted time: Time is divided in slots; transmissions can only start at a slot boundary. Slot can be idle, a successful transmission, or a collision Carrier Sensing Stations can/cannot detect whether the channel is currently used by some other station There might be imperfections involved in this detection (e.g., incorrectly missing an ongoing detection) Time Time? WS 09/10, v 2.0 Computer Networks - Medium Access Control 11

Figures of merit How to judge the efficiency of a dynamic channel allocation system? Intuition: transmit as many packets as quickly as possible At high load (many transmission attempts per unit time): Throughput is crucial ensure that many packets get through At low load (few attempts per time): Delay is crucial ensure that a packet does not have to wait for a long time Fairness: Is every station treated equally? Or justifiable inequality? WS 09/10, v 2.0 Computer Networks - Medium Access Control 12

Throughput and offered load Offered load G: The number of packets per unit packet time that the protocol is asked to handle More than one packet per packet time equals overload Ideal protocol: Throughput S equals offered load G as long as G<1 Throughput S = 1 as soon as G>1 S 1 1 G And: have constant small delay, for an arbitrary number of terminals Not very realistic hope! WS 09/10, v 2.0 Computer Networks - Medium Access Control 13

Principal options for MAC protocols Main distinction: Does the protocol allow collisions to occur? As a deliberately taken risk, not as an effect of an error If yes: for every type of packet, or only in some restricted form? MAC protocols Collision protocols Contention-free protocols Limited contention protocols Terminology: Systems where collisions can occur are often called contention systems WS 09/10, v 2.0 Computer Networks - Medium Access Control 14

Outline Static multiplexing Dynamic channel allocation Collision-based protocols Contention-free protocols Limited contention protocols Case study: Ethernet WS 09/10, v 2.0 Computer Networks - Medium Access Control 15

ALOHA The simplest possible medium access protocol: Just talk when you feel like it Formally: Whenever a packet should be transmitted, it is transmitted immediately Introduced in 1985 by Abrahmson et al., University of Hawaii Goal: Use of satellite networks Packets are transmitted at arbitrary times WS 09/10, v 2.0 Computer Networks - Medium Access Control 16

ALOHA Analysis ALOHA advantages Trivially simple No coordination between participants necessary ALOHA disadvantages Collisions can and will occur sender does not check channel state Sender has no (immediate) means of learning about the success of its transmission link layer mechanisms (ACKs) are needed ACKs can collide as well WS 09/10, v 2.0 Computer Networks - Medium Access Control 17

ALOHA Performance Assume a Poisson arrival process to describe packet transmissions Infinite number of stations, all behave identically, independently Time between two attempts is exponentially distributed, independent for any pairs of events All packets are of unit time length Let G be the mean number of transmission attempts per unit time Then: For a packet transmission to be successful, it must not collide with any other packet How likely is such a collision? Question: How long is a packet vulnerable by other transmissions? WS 09/10, v 2.0 Computer Networks - Medium Access Control 18

ALOHA Performance A packet X is destroyed by another packet either Starting up to one packet time before X Starting up to immediately before the end of X Hence: Packet is successful if there is no additional transmission in two packet times Throughput S(G) = G probability P 0 of a packet not colliding Probability: P 0 = P (0 transmission in two packet times by other nodes) = e -2G Throughput S (G) = G P 0 = Ge -2G Optimal for G = 0.5! S = 1/(2e) ¼ 0.184 Infinitely many! WS 09/10, v 2.0 Computer Networks - Medium Access Control 19

A slight improvement: Slotted ALOHA ALOHA s problem: Long vulnerability period of a packet Reduce it by introducing time slots transmissions may only start at the start of a slot Slot synchronization is assumed to be somehow available Result: Vulnerability period is halved, throughput is doubled S(G) = Ge -G Optimal at G=1, S=1/e Detailed analysis: Exercise! Hint: think of Binomial distribution, look at n terminals before looking at n! 1 WS 09/10, v 2.0 Computer Networks - Medium Access Control 20

Performance dependence on offered load For (slotted) ALOHA, closed form analysis of throughput S as function of G is simple S 1 1 G Ideal! Anything but a high-performance protocol In particular: throughput collapses as load increases! WS 09/10, v 2.0 Computer Networks - Medium Access Control 21

Carrier sensing (Slotted) ALOHA is simple, but not satisfactory Be a bit more polite: Listen before talk Sense the carrier to check whether it is idle before transmitting Carrier Sense Multiple Access (CSMA) Abstain from transmitting if carrier not idle (some other sender is currently transmitting) Crucial question: How to behave in detail when carrier is busy? In particular: WHEN to retry a transmission? WS 09/10, v 2.0 Computer Networks - Medium Access Control 22

1-persistent CSMA When carrier is busy, wait until it is idle Then, immediately transmit Persistent waiting Obvious problem: if more than one station wants to transmit, they are guaranteed to collide! Just too impatient But certainly better than pure ALOHA or slotted ALOHA Still open question: What to do when packets collide? Some form of retransmission required, after some random time WS 09/10, v 2.0 Computer Networks - Medium Access Control 23

Non-persistent CSMA When channel is idle, transmit When channel is busy, wait a random time before checking again whether the channel is idle Do not continuously monitor carrier to greedily grab it once it is idle Conscious attempt to be less greedy Typically formulated in a continuous time model Performance depends a bit on the random waiting time Main influence is mean value; distribution not very important Mean value has to be large enough compared to packet time, propagation delay But in general better throughput than persistent CSMA for higher loads At low loads, long random waiting is not necessary and wasteful WS 09/10, v 2.0 Computer Networks - Medium Access Control 24

p-persistent CSMA Combines ideas from persistent and non-persistent CSMA Uses a slotted time model When channel is idle, send When channel is busy, continuously monitor it until it becomes idle But then, do not always transmit immediately But flip a coin transmit with probability p With probability 1-p, do not send and wait for the next slot If channel is busy in the next slot, monitor for idleness Else, flip a coin again WS 09/10, v 2.0 Computer Networks - Medium Access Control 25

CSMA and propagation delay Any CSMA scheme suffers from a principal complication: The propagation delay d Suppose two stations become ready to send at time t and t+ε At t, the channel is completely idle The stations are separated by a propagation delay d > ε Second station cannot detect the already started transmission of first station Will sense an idle channel, send, and collide (at each other, or at a third station) t T gen d A Idle! Idle! B t+ε T gen WS 09/10, v 2.0 Computer Networks - Medium Access Control 26

Performance of CSMA WS 09/10, v 2.0 Computer Networks - Medium Access Control 27

Performance of CSMA II L. Kleinrock and F. A. Tobagi, Packet Switching in Radio Channels: Part I Carrier Sense Multiple Access Modes and Their Throughput-Delay WS 09/10, Characteristics, v 2.0 IEEE Trans. Computer On Comm., Networks vol. - Com-23, Medium no. Access 12, Dec. Control 1975 28

Performance of nonpersistent CSMA analytic derivation Nonpersistent CSMA protocol A terminal with a packet to send senses an idle channel: transmit A terminal with a packet to send senses a busy channel: reschedule the packet to some random later transmission time Average mean retransmission delay is X* At this later time, repeat the process Traffic model where do packets come from? All packets are of constant length with T seconds for transmission Infinite population of users generates new packets according to a Poisson process with aggregate rate packets/s Hence: S = T is average number of new packets generated per transmission time Additionally, packets are retransmitted! Total transmission attempts G per transmission time T (G S) WS 09/10, v 2.0 Computer Networks - Medium Access Control 29

Performance of nonpersistent CSMA traffic model For a tractable traffic model, two further assumptions are necessary Assumption 1: Average retransmission delay X* is large compared to T Assumption 2: Interarrival times of all packet start times (including retransmissions!) are independent and exponentially distributed THIS IS WRONG! but not too a large degree, and makes analysis much simpler Assumption 1 is necessary to make this an acceptable approximation I.e.: all packet transmissions form a Poisson process of rate G! WS 09/10, v 2.0 Computer Networks - Medium Access Control 30

Performance of nonpersistent CSMA parameters Summary of parameters S: rate of new packets injected G: traffic offered to the channel (new packets plus retransmissions) It is the rate of the Poisson traffic according to assumption 2 S/G: probability of a successful transmission G/S: average number of transmissions for a given packet T: packet transmission time on the channel For convenience: Let s set T=1 X*: average retransmission delay Precise distribution does not matter, must be large compared to T : (maximum) propagation delay of the channel Normalize this to packet duration: a = / T (for convenience) Goal: What is relation of S and G? WS 09/10, v 2.0 Computer Networks - Medium Access Control 31

Performance of nonpersistent CSMA idle and busy periods Observation: nonpersistent CSMA alternates between idle and busy Busy periods start with transmission of a packet at some time t by some terminal on an idle channel Additional transmissions can only start within time t+a At t+a, start of first packet has propagated to all other terminals and prevents them from transmitting (carrier sense rule) Say, at t+y the last packet starts in this busy period Channel is sensed as idle after t+y+1+a Packet duration and propagation delay to all stations t t + Y a a Time 1 End of busy period: t+y+1+a WS 09/10, v 2.0 Computer Networks - Medium Access Control 32

Performance of nonpersistent CSMA average busy period What is the average length of a busy period? Randomness comes from the point Y of the last packet starting transmission in the busy period These arrivals of packet transmission were assumed to form a Poisson process of rate G Distribution function of random variable Y: Expected value of Y:! Average busy period: a WS 09/10, v 2.0 Computer Networks - Medium Access Control 33

Performance of nonpersistent CSMA average idle period Probability that idle period I is at least c long (0 terminals transmit during c): Average value E[I] = 1/G! On average, a busy/idle cycle lasts: WS 09/10, v 2.0 Computer Networks - Medium Access Control 34

Performance of nonpersistent CSMA successful packets Number U of correct packets per busy/idle cycle: Expected number of successful packets per busy/idle cyle then simply: WS 09/10, v 2.0 Computer Networks - Medium Access Control 35

Performance of nonpersistent CSMA throughput Putting it together Throughput S is expected number of successful packets / expected duration for transmission cylce Hence: WS 09/10, v 2.0 Computer Networks - Medium Access Control 36

Collision detection CSMA/CD When two packets collide, lots of time is wasted by completing their transmission If it were possible to detect a collision when it happens, transmission could be aborted and a new attempt made Wasted time reduced, no need to wait for (destroyed) packets to complete Depending on physical layer, collisions can be detected! Necessary: Sender must be able to listen to the medium when sending, compare what it sends with what it receives If different: declare a collision! CSMA/CD Carrier Sense Multiple Access/Collision Detection A t Idle! Collision Abort! B Idle! t+ε Collision Abort! WS 09/10, v 2.0 Computer Networks - Medium Access Control 37

What to do after a collision happens? Stations do want to transmit their packets, despite detecting a collision Have to try again Immediately? Would again ensure another collision Coordinate somehow? Difficult, no communication medium available Wait a random time! Randomization de-synchronizes medium access, reduces collisions However: will result in some idle time, occasionally! Alternation between contention and transmission phases Not necessarily slotted time! WS 09/10, v 2.0 Computer Networks - Medium Access Control 38

How to choose random waiting time? Simplest approach to choose a random waiting time: Pick any one of k slots Assumes a slotted time model for simplicity Uniformly distributed from [0,, k-1] the contention window Question: How to choose upper bound k? Small k: Short delay, but high risk of repeated collisions Large k: Low risk of collisions (as stations access attempts are spread over a large time interval), but needlessly high delay if few stations want to access the channel With large contention window, collisions become less likely! Let k adapt to the current number of stations/traffic load WS 09/10, v 2.0 Computer Networks - Medium Access Control 39

How to adapt k to traffic load? One option: somehow explicitly find out number of stations, compute an optimal k, signal that to all stations Difficult, high overhead, An implicit approach possible? What is the consequence of a small k when load is high? Collisions! Hence: Use a collision as an indication that the contention window is too small increase it! Will reduce probability of collisions, automatically adapt to higher load Question: How to increase k after collision, how to decrease it again? WS 09/10, v 2.0 Computer Networks - Medium Access Control 40

How to adapt k Binary exponential backoff Increase after collisions: Many possibilities Commonly used: Double the contention window size k But only up to a certain limit, say, 1024 slots start out with k=2 This is called binary exponential backoff Decreasing k: Also many options possible E.g., if sufficiently many frames have not collided reduce k (subtract a constant, cut in half, ) Complicated, might waste resources by not being agile enough, Or play it simple: Just start every time at k=2! Common option WS 09/10, v 2.0 Computer Networks - Medium Access Control 41

Performance analysis: 1-Persistent CSMA/CD Assumptions Time is slotted Packet duration T slots Backoff window fixed size k slots Propagation delay negligible Channel sensing requires one time slot Collision detection requires one time slot Goal: Derive relevant performance metrics via a Markov chain WS 09/10, v 2.0 Computer Networks - Medium Access Control 42

Recall: Discrete time Markov chain with finite state space Definition: Finite state space S = {s 1,, s n } State transition matrix P = [p ij ], 1 I,j n, 0 p ij 1 P is a stochastic matrix, i.e., j=1 n p ij = 1 8 i Interpretation: p ij is the probability to go from state i to state j Markov chain has Markov property Interpretation: the probability which state to choose next only depends on the current state, not on any previous state Formally, with X k random variable for the kth state: Strictly speaking, this is a first-order Markov chain WS 09/10, v 2.0 Computer Networks - Medium Access Control 43

Recall: Probability vector Each X k has a finite probability density, written as probability vector µ k µ k is a simple shorthand: µ k (i) = P(X k = s i ) With µ 0 initial distribution, µ k = µ 0 P k If µ = lim k!1 µ k exists, it is the steady-state probability distribution of the Markov chain Under reasonable assumptions, it exists and is independent of initial distribution Possible to show: µ is any row of lim k!1 P k Hence: to know steady state, we only need to know lim k!1 P k And then pick any arbitrary row WS 09/10, v 2.0 Computer Networks - Medium Access Control 44

Example Markov chain Consider simple three-state Markov chain 0.2 Initial state: s 1 State transition matrix 0.8 s 1 s 2 0.6 0.7 s 3 0.4 0.3 Probability distribution after one step: µ 1 = µ 0 P = [0.8 0.2 0] Probability distribution after two steps: µ 2 = µ 1 P = µ 0 P 2 = [0.64 0.28 0.08] Probability distribution after three steps: µ 2 = µ 2 P = µ 0 P 3 = [0.568 0.296 0.136] WS 09/10, v 2.0 Computer Networks - Medium Access Control 45

Example Markov chain (II) Probability distribution in steady state: µ = µ 0 lim k!1 P k Use Eigenvalue decomposition of P to compute lim k!1 P k : Hence: WS 09/10, v 2.0 Computer Networks - Medium Access Control 46 µ!

Backoff Markov model state description State of one terminal: With previous parameters: k+1+t states for each terminal State of system: Product of individual terminal states E.g., two terminals: (i 1, i 2 ) Initial state: E.g., (0,, 0) WS 09/10, v 2.0 Computer Networks - Medium Access Control 47

Backoff Markov model state transitions (I) Note: This is only done for two terminals here generalization is simple (yet a bit tedious) Both terminals idle: (0, 0)! (T, T) Collision With probability 1 After collision, both terminals backoff: (T,T)! (-i 1, -i 2 ) i 1, i 2 chosen at random, independently, uniformly from U(1,k) Hence, each possible backoff state is entered with probability 1/k 2 Only place of randomness! WS 09/10, v 2.0 Computer Networks - Medium Access Control 48

Backoff Markov model state transitions (II) In backoff state, count-down happens until one terminal reaches 0 (i 1, i 2 )! (i 1 + 1, i 2 + 1) if i 1, i 2 < 0 Once one terminal has reached 0 and the other is still in backoff, terminal will start to transmit (0, i 2 )! (T, i 2 +1) if i 2 < 0 (i 1, 0)! (i 1 +1, T) if i 1 < 0 If both terminals reach (0,0): see above! WS 09/10, v 2.0 Computer Networks - Medium Access Control 49

Backoff Markov model state transitions (III) Terminal transmitting, the other still in backoff: (i 1, i 2 )! (i 1-1, i 2 +1) if i 1 > 0, i 2 < 0 (i 1, i 2 )! (i 1 +1, i 2-1) if i 1 < 0, i 2 > 0 Terminal transmitting, the other checks channel: (i 1, 0)! (i 1-1, 0) if i 1 > 0 (0, i 2 )! (0, i 2-1) if i 2 > 0 Other states not reached! WS 09/10, v 2.0 Computer Networks - Medium Access Control 50

State transitions Overview T 1 senses channel, T 2 transmits i 2 -k,t -1,T 0,T T,T T 1 backoff, T 2 transmits 0,1 Collision T 1 transmits, T 2 senses channel -k,0 T 1 backoff, T 2 senses channel -1,0 0,0 1,0 T,0 -k,-k Both in backoff 0,-1 T 1 senses channel, T 1 backoff 0,-k T 1 transmits, T 2 backoff T,-1 T,-k i 1 WS 09/10, v 2.0 Computer Networks - Medium Access Control 51

State transition matrix Previous rules give the state transitions We have (k+1+t) states per terminal, i.e., (k+1+t) 2 system states for two terminals State transition matrix maps each state to possible followup state for the next time slot! ((k+1+t) 2 ) 2 entries! For n terminals: ((k+1+t) n ) 2 entries Technicality: Markov models written via a state matrix With linear index for states; we have pair of numbers for state Convention here: Map state (i 1, i 2 ) to state index (i 1 + (k+1) -1) (k+t+1) + (i 2 + (k+1)) Rewrite all the above state transition rules with this transformation WS 09/10, v 2.0 Computer Networks - Medium Access Control 52

State transition matrix To : From : From index To index ( ) 0.125 State transition matrix P WS 09/10, v 2.0 Computer Networks - Medium Access Control 53

Obtain steady state distributions Look at P k for k! 1 We only do this numerically, analytically it is possible but a bit of work All rows converge to steady state vector Here: a bit cumbersome to interpret this vector; need to translate it back into a state matrix to understand it WS 09/10, v 2.0 Computer Networks - Medium Access Control 54

Deriving performance metrics Collision probability: Steady state probability of state (T,T) Probability of a timeslot where a transmission completes successfully: Sum of steady state probabilities of states (1,0) and (0, 1) Average number of time slots between transmission completions: 1 / success probability Throughput: T / average number of time slots between transmission completions WS 09/10, v 2.0 Computer Networks - Medium Access Control 55

Performance results WS 09/10, v 2.0 Computer Networks - Medium Access Control 56

Performance results WS 09/10, v 2.0 Computer Networks - Medium Access Control 57

Outline Static multiplexing Dynamic channel allocation Collision-based protocols Contention-free protocols Limited contention protocols Case study: Ethernet WS 09/10, v 2.0 Computer Networks - Medium Access Control 58

Contention-free protocols Since collisions cause problems, how about using protocols without contention for the medium? Simplest example: Static TDMA Each station/terminal is assigned a fixed time slot in a periodic schedule Station 1 Station 2 Station 3 Station 1 Station 2. But disadvantages of static multiplexing are clear Time Are there dynamic, contention-free protocols? WS 09/10, v 2.0 Computer Networks - Medium Access Control 59

Bit-map protocol Problem of static TDMA: When a station has nothing to send, its time slot is idling and wastes resources Possible to only have time slots assigned to stations that have data to transmit? Needs some information exchange which station is ready to send They should reserve resources/time slots! Bit-map protocol Short reservation slots, only used to announce desire to transmit Must be received by every station WS 09/10, v 2.0 Computer Networks - Medium Access Control 60

Bit-map protocol properties Behavior at low load If there is (hardly) any packet, the medium will repeat the (empty) contention slots A station that wants to transmit has to wait its turn before it can do so! Relatively high delay Behavior at high load At high load, medium is dominated by data packets (which are long compared to contention slots) Overhead is negligible! Good and stable throughput Note: Bit-map is a carrier-sense protocol! WS 09/10, v 2.0 Computer Networks - Medium Access Control 61

Outline Static multiplexing Dynamic channel allocation Collision-based protocols Contention-free protocols Limited contention protocols Case study: Ethernet WS 09/10, v 2.0 Computer Networks - Medium Access Control 62

Best of both worlds? Desirable: Protocol with Low delay at low load like a contention protocol High throughput at high load like a contention-free protocol Hybrid or adaptive solution?! Limited-contention protocols do exist One possible idea: adapt number of stations per contention slot Contention slots are nice for throughput, but at low load, we cannot afford to wait a long time for every station s slot Several stations have to share a slot, dynamically WS 09/10, v 2.0 Computer Networks - Medium Access Control 63

Adaptive tree walk Idea: Use several levels of resolution for the contention slots Inspired by levels in a tree At highest level, all nodes share a single slot If only one node from this group claims the contention slot, it may transmit If more than one, collision in contention slot! double slots, half the stations assigned to the slot And recurse WS 09/10, v 2.0 Computer Networks - Medium Access Control 64

Outline Static multiplexing Dynamic channel allocation Collision-based protocols Contention-free protocols Limited contention protocols Case study: Ethernet WS 09/10, v 2.0 Computer Networks - Medium Access Control 65

A case study: Ethernet A practical example, dealing (mostly) with MAC: Ethernet Standardized by IEEE as standard 802.3 Part of the 802 family of standards dealing with MAC protocols Also contains PHY and DLC specifications Issues Cabling Physical layer MAC sublayer Switched Ethernet Fast & gigabit Ethernet WS 09/10, v 2.0 Computer Networks - Medium Access Control 66

Ethernet design The original Ethernet design document: Robert Metcalfe, 1973 See also: http://acm.org/ubiquity/interviews/r_metcalfe_1.html WS 09/10, v 2.0 Computer Networks - Medium Access Control 67

Ethernet cabling Yellow cable Simple electrical connection 10Base5 10Base2 10BaseT WS 09/10, v 2.0 Computer Networks - Medium Access Control 68

Ethernet physical layer Details depend on medium Common: Manchester encoding At +/- 0.85 V (typically) to ensure DC freeness With option for signal violations Used to demarcate frames WS 09/10, v 2.0 Computer Networks - Medium Access Control 69

Ethernet MAC sublayer Essentially: CSMA/CD with binary exponential backoff Frame format: For clock synchronization at receiver Each byte: 10101010 MAC layer addresses Necessary for minimum frame length WS 09/10, v 2.0 Computer Networks - Medium Access Control 70

Switched Ethernet With conventional 10Base5/10Base2 Ethernet, all stations attached to a single cable form a collision domain Packets from all these stations might potentially collide Big collision domains stress the CSMA/CD mechanism, reducing performance How to reduce collision domains but still maintain connectivity of local stations? Use smaller collision domains! To ensure connectivity, put a switch in Recall: A hub is electrically connected, thus a single collision domain Separate collision domains WS 09/10, v 2.0 Computer Networks - Medium Access Control 71

An Ethernet switch Unlike a hub, not a simple electrical connection for a starwired topology How to exchange packets between different collision domains? Switch contains buffers to intermediately store incoming packets before forwarding them towards their destination Different buffer structures possible: one per incoming link, one per group of links, Switch (example) Cost issue, mainly Hub Collision domain Backbone Collision domain Collision domain WS 09/10, v 2.0 Computer Networks - Medium Access Control 72

Fast Ethernet Normal (even switched) Ethernet only achieves 10 MBit/ s 1992: Build a faster Ethernet! Goals: Backward compatible, stick with the old protocol to avoid hidden traps, get job done quickly Result: 802.3u aka Fast Ethernet Fast Ethernet Keep almost everything the same (frame format, protocol rules) Reduce bit time from 100 ns to 10 ns Consequences for maximum length of a wiring segment, minimum packet sizes? (Recall unavoidable collisions in CSMA!) WS 09/10, v 2.0 Computer Networks - Medium Access Control 73

Fast Ethernet Cabling Standard category 3 twisted pairs (telephony cables) cannot support 200 MBaud over 100 m cable length Solution: use 2 pairs of wires in this case, reduce baud rate Also, Fast Ethernet/cat 5 cabling does not use Manchester, but 4B/5B WS 09/10, v 2.0 Computer Networks - Medium Access Control 74

Gigabit Ethernet Ok: can we go another factor of 10 faster? 1995 gigabit Ethernet Goal: again, keep basic scheme as it is Works, but price to pay: No more multi-drop configurations as in classic Ethernet In gigabit Ethernet, each wire has exactly two machines attached to it Terminal and/or switch/hub WS 09/10, v 2.0 Computer Networks - Medium Access Control 75

Gigabit Ethernet With a switch No shared collision domains! no collision! no need for CSMA/ CD Allows full-duplex operation of each link With a hub Collisions, half duplex, CSMA/CD Maximum cable distance is reduced to 25 m Actually: not very sensible combination from a cost/performance perspective WS 09/10, v 2.0 Computer Networks - Medium Access Control 76

Gigabit Ethernet Cabling WS 09/10, v 2.0 Computer Networks - Medium Access Control 77

1000BASE-T Topology Four pairs, each at 250 MBps WS 09/10, v 2.0 Computer Networks - Medium Access Control 78

And how does traffic on an Ethernet look like? How many packets are there, per time unit, transmitted over a typical Ethernet? Assumptions: Many sources connected to a single Ethernet Sources independently generate traffic (=try to transmit a packet) Intuition: Average number of transmitted packets might be bursty over short time windows The longer the considered time window, the smoother the number of transmissions should become, right? WS 09/10, v 2.0 Computer Networks - Medium Access Control 79

Measurements: Picture from Ethernet traces: Look at the paper W. E. Leland, M. Taqqu, W. Willinger, D. V. Wilson, "On the Self-Similar Nature of Ethernet Traffic," Proc. SIGCOM93, 1993, San Francisco, California, pp. 183-193. http://citeseer.nj.com/ leland93selfsimilar.ht ml Hence: too bursty to be easily smoothed! WS 09/10, v 2.0 Computer Networks - Medium Access Control 80

Conclusion MAC protocols are a crucial ingredient, pivotal for good performance Static multiplexing just won t do for bursty traffic Main categories: Collision, collision-free, limited contention Main figures of merit: Throughput, delay, fairness There hardly is a best solution Important case study: Ethernet Main lesson to be learned: Keep it simple! WS 09/10, v 2.0 Computer Networks - Medium Access Control 81