The Medium Access Control Sublayer

84
The Medium Access Control Sublayer Chapter 4

description

The Medium Access Control Sublayer. Chapter 4. M/M/1 System. λ: mean arrival rate (frames/sec) 1/μ: mean frame length (bits/frame) C: data transmission rate, channel capacity (bits/sec) traffic intensity ρ= λ/μC mean customer number N= ρ/1- ρ mean time delay T=N/ λ =1/(μC- λ) - PowerPoint PPT Presentation

Transcript of The Medium Access Control Sublayer

Page 1: The Medium Access Control Sublayer

The Medium Access ControlSublayer

Chapter 4

Page 2: The Medium Access Control Sublayer

M/M/1 System

λ: mean arrival rate (frames/sec) 1/μ: mean frame length (bits/frame) C: data transmission rate, channel capacity (bits/sec) traffic intensity ρ= λ/μC mean customer number N= ρ/1- ρ mean time delay T=N/ λ =1/(μC- λ)

mean queuing number Nq =N- ρ= ρ2/1- ρ

mean queuing delay Tq= Nq/ λ= ρ/ (μC- λ)=T-1/μC

Page 3: The Medium Access Control Sublayer

M/M/1 Example

λ =200B/s μ=250B/s ρ=0.8

Nq =N- ρ= ρ2/1- ρ= 3.2 N= Nq + ρ=4 T=N/ λ=20ms

Tq= Nq/ λ=16ms

Page 4: The Medium Access Control Sublayer

The Channel Allocation Problem

• Static Channel Allocation in LANs and MANs• Dynamic Channel Allocation in LANs and MANs

Page 5: The Medium Access Control Sublayer

Static Channel Allocation

Divide the single channel into N independent subchannels, each channel capacity C/N

mean arrival rate λ/N

mean time delay Tsub= 1/(μ(C/N)- (λ/N))=NT

Page 6: The Medium Access Control Sublayer

Classification of Dynamic Channel Allocation

• controlled multiple access• centralized: polling • decentralized: token

• random multiple access• ALOHA• CSMA, CSMA/CD

Page 7: The Medium Access Control Sublayer

Five Key Assumptions of Dynamic Channel Allocation(p245)

1. Station Model.

2. Single Channel Assumption.

3. Collision Assumption.

4. (a) Continuous Time.(b) Slotted Time.

5. (a) Carrier Sense.(b) No Carrier Sense.

Page 8: The Medium Access Control Sublayer

Polling

• Round-robin polling• Transfer polling

Page 9: The Medium Access Control Sublayer

Round-robin Polling• Procedure: the master station polls slave stations round-

robin, from the near end to far end • Disadvantage: polling frames take too much bandwidth

N N-1 2 1

masterR

S

...

Page 10: The Medium Access Control Sublayer

Transfer Polling• Procedure: the master station always polls the far end

station firstly, which transfers controlling information to its neighbor after sending.

• Advantage: only poll once in each round• Disadvantage: each slave station needs two input line

N N-1 2 1

masterRS

...

Page 11: The Medium Access Control Sublayer

Multiple Access Protocols

• ALOHA• Carrier Sense Multiple Access Protocols• Collision-Free Protocols• Limited-Contention Protocols• Wavelength Division Multiple Access Protocols• Wireless LAN Protocols

Page 12: The Medium Access Control Sublayer

Pure ALOHA(p247)

In pure ALOHA, frames are transmitted at completely arbitrary times.

Page 13: The Medium Access Control Sublayer

Pure ALOHAmodel

• Each station transmit frames arbitrary• If collision occurs, the sender waits a random time and

sends it again

N N-1 2 1

interface

Bus channel

The model of ALOHA

Page 14: The Medium Access Control Sublayer

Pure ALOHACollision Demo(1)

Collision reason : two station send frame simultaneously

1 2 N-1 N...

Page 15: The Medium Access Control Sublayer

Pure ALOHACollision Demo(2)

A1

new frame

B1

A2 A2

B1

collison

t1

t2 B2

A2t3

B2t4

B3

A3 station A

Station B

Final effect

A1 B1 A2 B2

t

t

t

Page 16: The Medium Access Control Sublayer

Pure ALOHA Performance Analysis(1)

Vulnerable period for the shaded frame.

Page 17: The Medium Access Control Sublayer

Pure ALOHAPerformance Analysis(2)

Assumptions: fixed frame length, frame time is t new frames generated according to Poisson distribution new frames and retransmitting frames also accord to Poisson distribution

frame interval accord to exponential distributionParameters:

throughput S: mean successful frames per frame time 0 S 1 network load G: mean frames per frame time G ≥ S

probability P0: successful transmission S = G P0

Page 18: The Medium Access Control Sublayer

Pure ALOHAPerformance Analysis(3)

P0= P [ consecutive 2 arrival interval> T ] = P [ arrival interval>T ]2

function of probability density of exponential distribution:(t) = e -t , t: arrival interval , : arrival rate = G / T

∞ ∞

P [arrival interval > T ] = T (t) dt = T (G/ T) e -Gt / T dt = e –G

throughput S = G P0 = G e -2G

maximum throughput occurs when G=0.5, S=1/2e ≈ 0.184

Page 19: The Medium Access Control Sublayer

Slotted ALOHA (p249)Principle: divide time into discrete intervals, each interval corresponding to one frame, so each user must know slot boundaries (synchronization)

A1

new frame

B3

A2A2

B1

冲突t1

t2 B2B2 B3

A3

station B

final effect

A1 B1 A2B2 A3

station A

Page 20: The Medium Access Control Sublayer

Slotted ALOHAPerformance Analysis

TTx

P0= P [last interval> (T-Tx) ] * P [next interval>Tx] ∞ ∞

= T-Tx (t) dt * Tx (t) dt

∞ ∞ = T-Tx (G/ T) e -Gt / T dt * Tx (G/ T) e -Gt / T dt

= e –G throughput S = G P0 = G e -G

maximum throughput occurs when G=1, S=1/e ≈ 0.368 P[idle]=P[interval>T] ∞ = T (t) dt = e –G

lastnext

Page 21: The Medium Access Control Sublayer

ALOHA Summary(p249)

Throughput versus offered traffic for ALOHA systems.

Page 22: The Medium Access Control Sublayer

Expected number of transmissionsPure ALOHA:

P0=e-2G

Pk=e-2G(1-e-2G)k-1

E= kPk=e2G

Slotted ALOHA: P0=e-G

Pk=e-G(1-e-G)k-1

E= kPk=eG

Page 23: The Medium Access Control Sublayer

CSMA protocols• Station listens for a carrier before sending• Classification:

• 1-persistent CSMA if the channel is busy, waits until it becomes idle, then

transmits frame immediately, if a collision occurs, waits for a random amount of time and start all over again.

• Nonpersistent CSMA if the channel is busy, waits for a random amount of time and sense channel again

• P-persistent CSMA (slotted channel)if the channel is busy, waits to the next slot, if idle, transmits frame with probability of p, with a probability of 1-p it defers to the next slot

Page 24: The Medium Access Control Sublayer

CSMA Comparison• 1-persistent CSMA: high throughput and low delay when

low load; low throughput when high load• Nonpersistent CSMA: high throughput when high load

Station A Station B

B 监听到信道空闲,发送A 监听到信道空闲发送

为 A 、 B 之间的传播时延

Page 25: The Medium Access Control Sublayer

Persistent and Nonpersistent CSMA

Comparison of the channel utilization versus load for various random access protocols.

Page 26: The Medium Access Control Sublayer

CSMA with Collision Detection• Principle: station aborts the transmission as soon as it detects a

collision, it saves time and bandwidth • 1-persistent CSMA/CD: when a station sense the channel idle, send

immediately and keep on sensing, when collision occur, abort transmission immediately

• Jamming signal: when sensing collision, keep on sending several bits jamming signal to intensify the collision

Page 27: The Medium Access Control Sublayer

CSMA/CD channel state

CSMA/CD can be in one of three states: contention, transmission, or idle.

Page 28: The Medium Access Control Sublayer

CSMA/CDcontention period

Station A 站 B

B sense collisionA sense collision

B sense idle

TB

2

2

contention period =

2

Page 29: The Medium Access Control Sublayer

Collision-Free Protocolsbit-map protocol

The basic bit-map protocol.

Principle: each contention period consists of N slots (bits), with each station use one slot, if station have frames to send, it reserve it by fill ‘1’ in its slot, so it is called reservation protocols

Page 30: The Medium Access Control Sublayer

Bit-map protocolperformance

• Measure time in units of the contention bit slot• N station, contention time is N, One data frame is d bits long, so time is d • When low load, low-numbered station will wait N/2+N slots to transmit,

while high-numbered station will wait N/2 slots to transmit, so the mean for all stations is N slots

efficiency= d/N+d• When high load, all stations have frames to send, so the N bits contention

period prorated over N frames, yielding an 1 bit overhead per frameefficiency=d/d+1

0 1 2 3 4 5 6 7

reservation slots 0 1 2 3 4 5 6

7 1 1

station 1 get one framestation 7 get one frame

Page 31: The Medium Access Control Sublayer

Collision-Free Protocols binary countdown protocol

• Principle: each station wanting to use the channel broadcast its address as a binary bit string. The bits in each address position from different stations are BOOLEAN ORed together

efficiency=d/(d+lnN)• Disadvantage: high-numbered station always gets high priority to

send• Variation: set the lowest priority to the station which send

successfully in the last contention

Page 32: The Medium Access Control Sublayer

binary countdown protocol

The binary countdown protocol. A dash indicates silence.

Page 33: The Medium Access Control Sublayer

Limited-Contention Protocols• Summary: In rating protocols, we use two performance measures,

delay at low load and channel efficiency at high load• Contention protocols give low delay at low load, while collision-

free protocols give high efficiency at high load• Limited-contention protocols

• use contention at low load, use a collision-free technique at high load• divide stations into groups, each station contends the group’s slot• Assign stations to groups dynamically, with many stations per group when

low load and few station per group when high load

Page 34: The Medium Access Control Sublayer

Limited-Contention Protocols

Acquisition probability for a symmetric contention channel.

Page 35: The Medium Access Control Sublayer

Adaptive Tree Walk Protocol• Algorithm

1. take N blood samples mixed2. if no antibodies, all are healthy3. else prepare two new samples

1 through N/2the rest

repeat the steps recursively until infected found• Analysis – depth search first

1. build a binary tree with stations as the leaves2. all stations contend slot 03. if no collision, ok4. else only stations falling under node 2 compete slot 15. ...

Page 36: The Medium Access Control Sublayer

Adaptive Tree Walk Protocol(p259)

The tree for eight stations.

Page 37: The Medium Access Control Sublayer

Adaptive Tree Walk Protocolexample

0 级1 级

2 级

3 级

1

2 3

4 5 6 7

A B C D E F G H站点

搜索开始的最佳级数 i= log2 q q 为当前要发送数据的站点数

时隙 0

时隙 1

时隙 2

时隙 3 时隙 4 。。。

设只有站点 G 和 H 要发送

Page 38: The Medium Access Control Sublayer

Wavelength Division Multiple Access Protocols

Wavelength division multiple access.

Page 39: The Medium Access Control Sublayer

WLAN Protocols• configuration

In an office building, many base stations are wired together using copper or fiber which cover only several meters range

• InterferenceWhen a receiver is within range of two active transmitters, the resulting signal will be garbledCSMA can’t solve the problem totally, because CSMA merely tells whether there is activity around the station sensing the carrier while it really wants to known whether there is activity around the receiver

• Hidden station problem• Exposed station problem

Page 40: The Medium Access Control Sublayer

WLAN ProtocolsInference Demo

A wireless LAN. (a) A transmitting. (b) B transmitting.

Page 41: The Medium Access Control Sublayer

WLAN ProtocolsMACA/MACAW

• MACAMultiple Access Collision AvoidanceIEEE 802.11 prototypeRTS->CTS handshake

• MACAWadd ACK frames carrier sense for RTS

Page 42: The Medium Access Control Sublayer

Wireless LAN Protocols (2)

The MACA protocol. (a) A sending an RTS to B.(b) B responding with a CTS to A.

Page 43: The Medium Access Control Sublayer

Ethernet• Ethernet Cabling• Manchester Encoding• The Ethernet MAC Sublayer Protocol• The Binary Exponential Backoff Algorithm• Ethernet Performance• Switched Ethernet• Fast Ethernet• Gigabit Ethernet• IEEE 802.2: Logical Link Control• Retrospective on Ethernet

Page 44: The Medium Access Control Sublayer

Ethernet Cabling

The most common kinds of Ethernet cabling.

Page 45: The Medium Access Control Sublayer

10BASE2

Thin coaxThin coax

BNC junctionBNC junction

NICNIC

• BNC T-junction

Max. segment = 185mStations per seg.=30

Page 46: The Medium Access Control Sublayer

10BASET

• Hub: A multi-port repeater

• Hub provides a star connection physically, implements a bus topology logically

• Devised to overcome problems of Ethernet tap connections, provides more reliable connections

• Support 10Mbps or 100Mbps

• Hub completely replaces repeater

• Configuration limitation - up to 3 hubs in a segment

hub

Max. seg.= 100m

One Collision Domain

Page 47: The Medium Access Control Sublayer

Ethernet Cabling (2)

Three kinds of Ethernet cabling. (a) 10Base5, (b) 10Base2, (c) 10Base-T.

Page 48: The Medium Access Control Sublayer

Ethernet Cabling (3)

Cable topologies. (a) Linear, (b) Spine, (c) Tree, (d) Segmented.

Page 49: The Medium Access Control Sublayer

Ethernet Cabling (4)

(a) Binary encoding, (b) Manchester encoding, (c) Differential Manchester encoding.

Page 50: The Medium Access Control Sublayer

Ethernet MAC Sublayer Protocol

Frame formats. (a) DIX Ethernet, (b) IEEE 802.3.

Page 51: The Medium Access Control Sublayer

Ethernet address

Page 52: The Medium Access Control Sublayer

Ethernet MAC Sublayer Protocol (2)

Collision detection can take as long as 2 .

Page 53: The Medium Access Control Sublayer

The Binary Exponential Backoff Algorithm

•During contention period, if a collision occurs, each station must wait random slot times(2) •After I collisions, a random number between 0 and 2i-1 is chosen•The upper limit is 1023 slots•After 16 collisions, the controller reports failure to the computer

Page 54: The Medium Access Control Sublayer

802.3 Performance(1)• Assumption

• Heavy and constant load, k station ready to transmit• Constant retransmission probability in each slot• Each station transmits during a contention slot with probability p

• ComputationP[ some station sends successfully ] A=kp(1-p)k-1

p=1/k Amax=(1-1/k)k-1 if k-> , A->1/e

P[ contention interval has j slots ]=A(1-A)j-1

mean number of contention slots E= j A(1-A) j -1 = 1/A->e

j=1mean contention time w=E*2=2/A ->5.4 if mean frame transmission time is P, efficiency=P/(P+2/A)replace P with F/B, with L/c, efficiency=1/(1+2BL/cAF)->1/(1+2BLe/cF)

Page 55: The Medium Access Control Sublayer

802.3 Performance(2)• Conclusion

• Increasing network bandwidth or distance reduces efficiency for a given frame size

Page 56: The Medium Access Control Sublayer

802.3 Performance(3)

Efficiency of 802.3 at 10 Mbps with 512-bit slot times.

Page 57: The Medium Access Control Sublayer

Switched 802.3 LANs

A simple example of switched 802.3 LAN

Page 58: The Medium Access Control Sublayer

Fast Ethernet

The original fast Ethernet cabling.

Page 59: The Medium Access Control Sublayer

Gigabit Ethernet

(a) A two-station Ethernet. (b) A multi-station Ethernet.

Page 60: The Medium Access Control Sublayer

Gigabit Ethernet (2)

Gigabit Ethernet cabling.

Page 61: The Medium Access Control Sublayer

Wireless LANs

• The 802.11 Protocol Stack• The 802.11 Physical Layer• The 802.11 MAC Sublayer Protocol• The 802.11 Frame Structure• Services

Page 62: The Medium Access Control Sublayer

The 802.11 Protocol Stack

Part of the 802.11 protocol stack.

Page 63: The Medium Access Control Sublayer

The 802.11 MAC Sublayer Protocol

(a) The hidden station problem.(b) The exposed station problem.

Page 64: The Medium Access Control Sublayer

The 802.11 MAC Sublayer Protocol (2)

The use of virtual channel sensing using CSMA/CA.

Page 65: The Medium Access Control Sublayer

The 802.11 MAC Sublayer Protocol (3)

A fragment burst.

Page 66: The Medium Access Control Sublayer

The 802.11 Frame Structure

The 802.11 data frame.

Page 67: The Medium Access Control Sublayer

IEEE 802.2: Logical Link Control

(a) Position of LLC. (b) Protocol formats.

Page 68: The Medium Access Control Sublayer

Bridges• Why do we need bridges?

• Different LANs• Geographical distance• Share load• Reliability• Security

• Bridge problem• Different frame format • Different data rate

• Buffer• Timer

• Different maximum frame length

Page 69: The Medium Access Control Sublayer

Data Link Layer Switching

Multiple LANs connected by a backbone to handle a total load higher than the capacity of a single LAN.

Page 70: The Medium Access Control Sublayer

Bridges from 802.x to 802.y

Operation of a LAN bridge from 802.11 to 802.3.

Page 71: The Medium Access Control Sublayer

Bridges from 802.x to 802.y (2)

The IEEE 802 frame formats. The drawing is not to scale.

Page 72: The Medium Access Control Sublayer

Local Internetworking

A configuration with four LANs and two bridges.

Page 73: The Medium Access Control Sublayer

Transparent Bridges• Operate in promiscuous mode• Use Backward Learning Algorithm to build routing table• Routing procedure

1. If destination and source LANs are the same, discard the frame2. If the destination and source LANs are different, forward the frame3. If the destination LAN is unknown, use flooding

• Periodically purge all entries more than a few minutes old

Page 74: The Medium Access Control Sublayer

Cycle Problem

Two parallel transparent bridges.

Page 75: The Medium Access Control Sublayer

Spanning Tree Bridges

(a) Interconnected LANs. (b) A spanning tree covering the LANs. The dotted lines are not part of the spanning tree.

Page 76: The Medium Access Control Sublayer

Spanning Tree Bridges(2)• How to build spanning tree

• Choose one bridge to be the root of the tree• Search the shortest paths from the root to every bridge and LAN

Page 77: The Medium Access Control Sublayer

Remote Bridges

Remote bridges can be used to interconnect distant LANs.

Page 78: The Medium Access Control Sublayer

Repeaters, Hubs, Bridges, Switches, Routers and Gateways

(a) Which device is in which layer.(b) Frames, packets, and headers.

Page 79: The Medium Access Control Sublayer

Repeaters, Hubs, Bridges, Switches, Routers and Gateways (2)

(a) A hub. (b) A bridge. (c) a switch.

Page 80: The Medium Access Control Sublayer

Virtual LANs

A building with centralized wiring using hubs and a switch.

Page 81: The Medium Access Control Sublayer

Virtual LANs (2)

(a) Four physical LANs organized into two VLANs, gray and white, by two bridges. (b) The same 15 machines organized into two VLANs by switches.

Page 82: The Medium Access Control Sublayer

The IEEE 802.1Q Standard

Transition from legacy Ethernet to VLAN-aware Ethernet. The shaded symbols are VLAN aware. The empty ones are not.

Page 83: The Medium Access Control Sublayer

The IEEE 802.1Q Standard (2)

The 802.3 (legacy) and 802.1Q Ethernet frame formats.

Page 84: The Medium Access Control Sublayer

Summary

Channel allocation methods and systems for a common channel.