21
7/29/2019 Medium Access Control Layer http://slidepdf.com/reader/full/medium-access-control-layer 1/21 1 Computer Communications Lectures 11-13 The Medium Access Control Sub-Layer 2 The Channel Allocation Problem Consider a broadcast channel (sometimes also called multi-access or random access channel) How to allocate the channel among multiple users? The channel allocation protocol reside in medium access control (MAC) sub-layer within the data link layer MAC Sub-layer

Medium Access Control Layer

Embed Size (px)

Citation preview

Page 1: Medium Access Control Layer

7/29/2019 Medium Access Control Layer

http://slidepdf.com/reader/full/medium-access-control-layer 1/21

1

Computer Communications

Lectures 11-13

The Medium Access Control Sub-Layer

2

The Channel Allocation Problem

• Consider a broadcast channel (sometimes also called multi-access or

random access channel)

• How to allocate the channel among multiple users?

• The channel allocation protocol reside in medium access control (MAC)

sub-layer within the data link layer

MAC Sub-layer

Page 2: Medium Access Control Layer

7/29/2019 Medium Access Control Layer

http://slidepdf.com/reader/full/medium-access-control-layer 2/21

2

3

Static Channel Allocation

• Frequency Division Multiplexing (FDM)

• Time Division Multiplexing (TDM)

• Both are inefficient when:

 – Number of users large and time-varying

 – Traffic bursty

• Compare with Statistical Multiplexing and Packet-Switching

4

Dynamic Channel Allocation Model

• Station Model

• Single Channel assumption

• Collision assumption

• Continuous vs. Slotted Time

• Carrier Sense vs. No Carrier Sense

Page 3: Medium Access Control Layer

7/29/2019 Medium Access Control Layer

http://slidepdf.com/reader/full/medium-access-control-layer 3/21

3

5

Multiple Access Protocols

• ALOHA

• Carrier Sense Multiple Access Protocols

• Ethernet

• Wireless LAN Protocols

• IEEE 802.11 based Wireless LANs

• Collision-Free Protocols

• Limited-Contention Protocols

• Wavelength Division Multiple Access Protocols

6

Pure ALOHA

• A user transmits whenever there is data to send

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

Page 4: Medium Access Control Layer

7/29/2019 Medium Access Control Layer

http://slidepdf.com/reader/full/medium-access-control-layer 4/21

4

7

Pure ALOHA (2)

Vulnerable period for the shaded frame.

8

Pure ALOHA vs. Slotted Aloha

• S = G * P0

Throughput versus offered traffic for ALOHA systems.

Page 5: Medium Access Control Layer

7/29/2019 Medium Access Control Layer

http://slidepdf.com/reader/full/medium-access-control-layer 5/21

5

9

Carrier Sense Multiple Access (CSMA)

• Sense (listen to) the carrier (channel) and “wait” if busy

• 1-persistent CSMA

 – Wait until channel is idle and transmit (i.e., with probability 1)

 – Upon collision, retry after a random wait period

 – Performance worsens with increasing propagation delay

• p -persistent CSMA

 – Assumes slotted time

 – Wait until channel is idle and transmit with probability p 

 – If collision or someone else grabs the channel, retry after a random waitperiod

• Non-persistent CSMA

 – If channel busy, wait a random period before retrying

10

Persistent and Nonpersistent CSMA

Comparison of the channel utilization versus load for various

random access protocols.

Page 6: Medium Access Control Layer

7/29/2019 Medium Access Control Layer

http://slidepdf.com/reader/full/medium-access-control-layer 6/21

6

11

CSMA with Collision Detection (CSMA/CD)

• Abort transmissions as soon as collision is detected

• Basis of Ethernet LAN

• Inherently half-duplex

• Inefficient when large propagation delays and short frames

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

Ethernet

Required Reading: Tanenbaum (section 1.5.3 andchapter 4)

Page 7: Medium Access Control Layer

7/29/2019 Medium Access Control Layer

http://slidepdf.com/reader/full/medium-access-control-layer 7/21

7

13

Original Ethernet and IEEE 802.3 Standard

• Thick coaxial “multidrop” cable up to 2.5km long (with repeaters every 500meters)

• Connect up to 256 computers

• 2.94Mbps line speed

• CSMA/CD

 – Abort transmissions as soon as collision is detected and “jam” the cable to alertothers

• DIX Standard for 10Mbps Ethernet (1978)

• IEEE 802.3 Standard (1983): DIX Standard with two minor modifications

Architecture of the original Ethernet (1976).

14

Ethernet Cabling

The most common kinds of Ethernet cabling.

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

Page 8: Medium Access Control Layer

7/29/2019 Medium Access Control Layer

http://slidepdf.com/reader/full/medium-access-control-layer 8/21

8

15

Ethernet Cabling (2)

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

16

Manchester Encoding

• Differentiate idle and busy periods

• Sender-receiver synchronization

(a) Binary encoding, (b) Manchester encoding,

(c) Differential Manchester encoding.

Page 9: Medium Access Control Layer

7/29/2019 Medium Access Control Layer

http://slidepdf.com/reader/full/medium-access-control-layer 9/21

9

17

Ethernet Frame Structure

• Addressing mechanism supports group (multicast/broadcast) addressesand distinguishing local from global addresses

• Minimum frame length requirement (64 bytes) – To allow proper detection of collisions

 – Distinguish valid frames from noise

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

18

Need for Minimum Frame Length in Ethernet

• Minimum frame length = 500 bits rounded to 512 bits (64 bytes)

 – Worst case round trip propagation delay on 2.5km cable with 4 repeaters = 50 microseconds

 – Network speed = 10Mbps each bit takes 100 nano seconds

• Higher network speed greater minimum frame length or shorter maximumcable length

Collision detection can take as long as 2 .τ  

Page 10: Medium Access Control Layer

7/29/2019 Medium Access Control Layer

http://slidepdf.com/reader/full/medium-access-control-layer 10/21

10

19

Binary Exponential Backoff (BEB) Algorithm

• Mechanism to dynamically adapt number of contending nodes

• After i collisions, choose a random number of slots between 0 and 2i -1before retrying

 – After 10 collisions, randomization interval is frozen at 1023 slots

 – Give up retrying after 16 collisions

20

Ethernet Performance

• Channel efficiency = P / (P + 2τ 

 /A) longer the cable, longer the

contention interval and lower the channel efficiency

 – P: mean frame transmission time

 – 2  : slot duration (worst case round-trip propagation delay)

 – A: probability that some station acquires the channel in a given slot

• Channel efficiency = 1 / (1+2BLe  / c F) for optimal case of e contention slots per frame

 – F: frame length

 – B: network bandwidth

 – L: cable length

 – c: signal propagation speed

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

Page 11: Medium Access Control Layer

7/29/2019 Medium Access Control Layer

http://slidepdf.com/reader/full/medium-access-control-layer 11/21

11

21

IEEE 802.2: Logical Link Control

• Hide differences between various 802 networks by providing a singleformat and interface to network layer

• Can support error control and flow control over 802 networks

 – Three service options: unreliable datagram, acknowledged datagram and

reliable connection-oriented

• Based on HDLC

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

22

Switched Ethernet

• Switch: high-speed backplane + 4-32 plug-in line cards each with 1-8

connectors/ports

A simple example ofswitched Ethernet.

• Handling simultaneous transmissions from hosts connected to same

plug-in card

 – Ports connected together to form an “on-card LAN” each card a separate

collision domain

» Handle collisions within a card and retransmissions using CSMA/CD with BEB

 – Buffer at each input port each port a separate collision domain

» No collisions

Page 12: Medium Access Control Layer

7/29/2019 Medium Access Control Layer

http://slidepdf.com/reader/full/medium-access-control-layer 12/21

12

23

Fast Ethernet (IEEE 802.3u, 1995)

• 100Mbps – 10 times faster yet backward compatible with earlier

Ethernet

 – Supports flow control

 – Encoding schemes different from Manchester encoding used

• Use hubs or switches

The original fast Ethernet cabling.

24

Gigabit Ethernet (IEEE 802.3z, 1998)

• 1Gbps – 10 times faster than fast Ethernet yet backward compatible with allexisting Ethernet standards

 – Supports flow control

 – Uses a different set of encoding schemes

• 10-gigabit Ethernet also standardized in 2002 (IEEE 802.3ae)

(a) A two-station

Ethernet.

(b) A multistation

Ethernet.

Gigabit Ethernet cabling.

Page 13: Medium Access Control Layer

7/29/2019 Medium Access Control Layer

http://slidepdf.com/reader/full/medium-access-control-layer 13/21

13

25

Retrospective on Ethernet

• Simple reliable, cheap and easy to maintain

• Flexible

• Interworks easily with TCP/IP (both IP and Ethernet connectionless)

• Evolved without need for software changes

Wireless LANs and IEEE 802.11 Standard

Required reading: Tanenbaum (section 1.5.4, section4.2.6 and section 4.4)

Page 14: Medium Access Control Layer

7/29/2019 Medium Access Control Layer

http://slidepdf.com/reader/full/medium-access-control-layer 14/21

14

27

Wireless LAN Protocols

• CSMA does not work when all nodes are not within range of each other

 – Need to know interference at receiver, but know only about interference atsender with CSMA

• Hidden node problem: two non-neighboring nodes simultaneously

transmit to a common neighbor, causing a collision

• Exposed node problem: a node unnecessarily getting blocked from

transmitting due to an on-going transmission from a neighbor

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

28

Wireless LAN Protocols (2)

• MACA (Multiple Access with

Collision Avoidance) protocol

 – Alleviates hidden station

problem, but does not completelyeliminate it

 – Collisions still possible (e.g., RTScollisions)

» Retry after random wait periodbased on BEB algorithm

• MACAW (MACA for Wireless)

 – Add ACKs and carrier sense

 – To improve fairness, apply backoffalgorithm for each source-destinationpair

 – To improve performance:

» congestion info exchange betweennodes

» decrease sensitivity of backoff algorithm to temporary problems

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

Page 15: Medium Access Control Layer

7/29/2019 Medium Access Control Layer

http://slidepdf.com/reader/full/medium-access-control-layer 15/21

15

29

IEEE 802.11 Wireless LAN Standard

• Challenges

 – Identifying a suitable, worldwidefrequency band

 – Sufficient bandwidth and economicviability

 – Protect users’ privacy

 – Impact of host mobility

 – Coping with limited battery life

 – Dealing with human safety issues

• Several inherent differences with

Ethernet

 – CSMA is not sufficient in wireless

LANs – Presence of multipath fading

 – Need for host mobility support

 – Dealing with mobility-unawaresoftware

• 802.11 standard (1997)

 – 2.4GHz ISM band

 – 1Mbps or 2Mbps(DSSS/FHSS/Infrared)

• 802.11b standard (1999)

 – 2.4GHz ISM band

 – 11Mbps (HR-DSSS)

• 802.11a standard (1999)

 – 5GHz ISM band

 – 54Mbps (OFDM)

• 802.11g (2001)

 – 2.4GHz ISM band – 54Mbps (OFDM)

30

IEEE 802.11 Wireless LAN Standard (2)

(a) Infrastructure mode. (b) Ad hoc mode.

A multicell 802.11 network.

Page 16: Medium Access Control Layer

7/29/2019 Medium Access Control Layer

http://slidepdf.com/reader/full/medium-access-control-layer 16/21

16

31

The 802.11 Protocol Stack

Part of the 802.11 protocol stack.

32

The 802.11 MAC Sublayer Protocol

• Distributed Coordination Function

(DCF)

 – Distributed

 – Compulsory

 – CSMA with Collision Avoidance(CSMA/CA)

» When channel busy, set a randombackoff counter but keep it frozenwhile channel busy

» No carrier sensing whiletransmitting

» Upon frame loss due to collisions orchannel errors, retry after random

wait period based on Ethernet BEBalgorithm

 – Virtual carrier sensing

» RTS-CTS mechanism

» Network Allocation Vectors (NAVs)

• Point Coordination Function (PCF)

 – Centralized: base station or AccessPoint (AP) controls intra-cell channelallocation

 – Optional

 – AP uses a polling mechanism

» Periodic beacon frames (10-100/second) contain systemparameters (e.g., clock synchronization) and invitation to joinpolling service

» Poll frames

» Polling frequency, polling order and

service priorities not specified instandard

 – Also useful for power management

 – Can co-exist with DCF via inter-framespacing mechanism in 802.11

Page 17: Medium Access Control Layer

7/29/2019 Medium Access Control Layer

http://slidepdf.com/reader/full/medium-access-control-layer 17/21

17

33

The 802.11 MAC Sublayer Protocol (2)

Virtual channel sensing mechanism.

34

The 802.11 MAC Sublayer Protocol (3)

• Stop-and-wait protocol applied to each fragment

• Fragment size not set by the standard

A fragment burst.

Page 18: Medium Access Control Layer

7/29/2019 Medium Access Control Layer

http://slidepdf.com/reader/full/medium-access-control-layer 18/21

18

35

The 802.11 MAC Sublayer Protocol (4)

Interframe spacing in 802.11.

36

The 802.11 Frame Structure

• Data, management and control frames

• Management frames similar to data frames, but with one less APaddress

• Control frames even shorter with only one or two addresses, no Data or

Sequence fields

The 802.11 data frame.

Page 19: Medium Access Control Layer

7/29/2019 Medium Access Control Layer

http://slidepdf.com/reader/full/medium-access-control-layer 19/21

19

37

802.11 Services

• Distribution (Inter-Cell) Services for managing cell membership andinteracting with nodes outside a cell

 – Association

 – Disassociation

 – Reassociation

 – Distribution

 – Integration

• Station (Intra-Cell) Services for activity within a single cell

 – Authentication

 – Deauthentication

 – Privacy

 – Data Delivery

38

Collision-Free Protocols

• Assume:

 – Exactly N stations, each with a unique address from 0 to N-1

 – Propagation delay negligible

The basic bit-map protocol (comes under the category of reservation

protocols).

Page 20: Medium Access Control Layer

7/29/2019 Medium Access Control Layer

http://slidepdf.com/reader/full/medium-access-control-layer 20/21

20

39

Collision-Free Protocols (2)

The binary countdown protocol. A dash indicates silence.

40

Limited-Contention Protocols

• Adapt assignment of stations to slots according to load

Acquisition probability for a symmetric contention channel.

Page 21: Medium Access Control Layer

7/29/2019 Medium Access Control Layer

http://slidepdf.com/reader/full/medium-access-control-layer 21/21

41

Adaptive Tree Walk Protocol

The tree for eight stations.

42

Wavelength Division Multiple Access Protocols

• Dynamic variants of FDM/TDM methods

• Assume global synchronization

Wavelength division multiple access.