ECEN 5032 Data Networks Medium Access Control Sublayer Peter Mathys - - PowerPoint PPT Presentation

ecen 5032 data networks
SMART_READER_LITE
LIVE PREVIEW

ECEN 5032 Data Networks Medium Access Control Sublayer Peter Mathys - - PowerPoint PPT Presentation

ECEN 5032 Data Networks Medium Access Control Sublayer Peter Mathys mathys@colorado.edu University of Colorado, Boulder Data Networks, Medium Access Control Sublayer, c 19962005, P . Mathys p.1/35 Overview (Sub)networks can


slide-1
SLIDE 1

ECEN 5032 Data Networks

Medium Access Control Sublayer

Peter Mathys

mathys@colorado.edu

University of Colorado, Boulder

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.1/35

slide-2
SLIDE 2

Overview

(Sub)networks can be divided into two categories:

  • 1. Those using point-to-point connections (e.g., leased

line).

  • 2. Those using broadcast connections (e.g., wireless

LANs).

In a broadcast network one of the key issues is how to determine who gets to use the channel when there is competition for it. Broadcast channels are often referred to as multiaccess channels or random access channels. Real life example: Meeting between several people: After one speaker finishes, who gets to talk next? More tricky: Conference call (cannot use external means to avoid chaos, e.g., by raising hands).

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.2/35

slide-3
SLIDE 3

Medium Access Control

The protocols used to determine who goes next on a multiaccess channel belong to the MAC (medium access control) sublayer. The MAC sublayer is a sublayer of the data link layer (DLL). The MAC sublayer is expecially important for LANs. WANs, in contrast, use point-to-point links, except for satellite networks. Examples of MAC protocols are the CSMA/CD protocol used by Ethernet, and the CSMA/CA protocol used by 802.11 wireless LANs.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.3/35

slide-4
SLIDE 4

Static Channel Allocation

Traditional ways of allocating channels are TDM (time division multiplexing) and FDM (frequency division multiplexing). If there are

  • users, time gets divided up into
  • time

slots for TDM, or bandwidth gets divided up into

  • frequency slots for FDM.

If

  • is large and not all users transmit at all times, a lot
  • f transmission capacity is wasted with static TDM or

FDM allocations. In addition, in most computer systems data traffic is very bursty, e.g., peak to mean traffic ratio of 1000:1

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.4/35

slide-5
SLIDE 5

Static Channel Allocation

Simple example: M/M/1 queue (memoryless Poisson arrivals with rate

  • and memoryless Poisson

departures with rate

):

✂ ✄ ☎ ✁ ✆ ✝

where

is the average delay of a frame and

is the channel capacity. Now divide this up into

  • static subchannels, each with

capacity

✆ ✟
  • and arrival rate
  • to obtain
✂✡✠ ✄ ☎ ✁ ☛ ✆ ✟
✝ ☛
✆ ✝

resulting in an increase of the delay by a factor of

  • .

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.5/35

slide-6
SLIDE 6

Dynamic Channel Allocation

Key assumptions:

  • 1. Station model. There are
  • independent stations or
  • terminals. Arrival rate is

(probability of frame generated in interval of length

✂ ✄

is

✁ ✂ ✄

). Terminals can have at most one frame to transmit at any given time.

  • 2. Single Channel Assumption. A single channel is

available for all communication. All stations can transmit

  • n it and receive from it. All stations are eqivalent in

hardware, but protocol software may assign priorities.

  • 3. Collision Assumption. If two or more terminals transmit

at the same time, a collision results and the frame must be retransmitted at a later time. All stations can detect collisions and there are no other errors than collisions.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.6/35

slide-7
SLIDE 7

Dynamic Channel Allocation

Key assumptions (contd.):

  • 4. Continuous/Slotted Time. If channel time is

continuous, frame transmission can sart at any time. If channel time is slotted, then frame transmissions must always begin at the start of a slot. A slot may be idle (0), contain exactly one frame (1), or a collision (C).

  • 5. Carrier Sense (Y/N). If carrier sensing is used, stations

can tell if the channel is in use before trying to use it. In this case stations wait until the channel is idle before starting a new transmission. Wired LANs generally have carrier sense, while in wireless networks not all stations may be within radio range of other stations so that carrier sensing cannot be relied upon.

Key assumption is single (collision) channel. No other means of communication.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.7/35

slide-8
SLIDE 8

ALOHA

The ALOHA network was developed around 1970 to provide radio communication between the central computer and various data terminals at the campuses

  • f the University of Hawaii.

The basic idea of ALOHA is to let users transmit frames whenever they have data to send. If frames collide, they are retransmitted after a random amount of time. It is assumed that each station can determine whether a collision happened or not. If there is no collision, transmission is assumed to be successful.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.8/35

slide-9
SLIDE 9

Pure ALOHA Example

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

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.9/35

slide-10
SLIDE 10

Pure ALOHA

Pure ALOHA: Vulnerable period for shaded frame.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.10/35

slide-11
SLIDE 11

Pure ALOHA Throughput

Successfull frames leave system at rate

✂✁ ✄ ☎ ✆

and arrivals occur at rate

  • , leading to a hypothetic

equilibrium point as shown. Necessary condition:

☎ ✟ ☛ ✞ ✁ ☞ ✟ ✠☛✡ ☎☞ ✌

.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.11/35

slide-12
SLIDE 12

Slotted ALOHA

In 1972 a method for doubling the throughput of a (pure) ALOHA system was published. The key idea is to divide time into discrete intervals, each corresponding to the length of a frame. Under this method, known as slotted ALOHA, a computer is required to wait for the beginning of a slot before it can transmit data. This reduces the vulnerable period to the length of one frame and consequently the throughput becomes

✂✁ ✄ ✆ ✞

which peaks at

and yields

☎ ✟ ✁ ✟ ✠☛✡ ✁✂ ☞

.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.12/35

slide-13
SLIDE 13

Slotted ALOHA Throughput

Successfull frames leave system at rate

✂✁ ✄ ✆

and arrivals occur at rate

  • , leading to a hypothetic

equilibrium point as shown. Necessary condition:

☎ ✟ ✁ ✟ ✠☛✡ ✁✂ ☞

.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.13/35

slide-14
SLIDE 14

CSMA

In (wired) local area networks it is possible for each station to detect what other stations are doing and adapt their behavior accordingly. Protocols in which stations listen for a carrier on the channel are called carrier sense protocols. CSMA stands for carrier sense multiple access. There are two types of CSMA protocols: persistent and nonpersistent CSMA. CSMA/CD stands for carrier sense multiple access with collision detection.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.14/35

slide-15
SLIDE 15

Persistent CSMA

1-persistent CSMA works as follows:

When a station has data to send, it first listens to the channel to see if anyone else is already transmitting. When the channel is idle, the station transmits its frame. When the channel is busy, the station waits until it becomes idle, and then transmits with probability 1 (hence the name 1-persistent). If a collision occurs during transmission, the station waits a random amount of time and then starts all over again.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.15/35

slide-16
SLIDE 16

Effect of Propagation Delay

When two or more stations start transmitting at about the same time instant, they may not be able to sense each other’s transmissions because of the propagation delays between different stations. Thus, when 1-persistent CSMA is used, there is a good chance that after one transmission ends, two or more new stations start transmitting and collide. Such collisions can be avoided if not all stations that become ready to transmit start sending immediately after the previous transmission ends. The resulting protocols are nonpersistent or p-persistent versions

  • f CSMA.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.16/35

slide-17
SLIDE 17

Nonpersistent CSMA

Nonpersistent CSMA works as follows:

Before sending, a station senses the channel. If the channel is idle, the station starts transmitting. If the channel is busy, the station waits a random amount

  • f time (without sensing the channel) before it repeats

the algorithm. This leads to longer delays, but better channel utilization than 1-persistent CSMA.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.17/35

slide-18
SLIDE 18

p-persistent CSMA

For slotted channels p-persistent CSMA can be used. It works like this:

When a station becomes ready to transmit, it senses the channel. If the channel is idle, the station starts transmitting with probability

  • . With probability
✁ ✂ ✄ ☎
  • it defers until the

next slot. If the next slot is also idle, it transmits or defers again, with probabilities

  • r

. This process is repeated until either the frame gets transmitted or another station started transmitting. In the latter case the station acts as if there had been a collision (i.e., waits a random amount

  • f time and starts again).

If the station initially senses the channel busy, it waits until the next slot and applies the above algorithm.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.18/35

slide-19
SLIDE 19

Throughput for CSMA Versions

The smaller

  • is for p-persistent CSMA the better the

throughput becomes, at the cost of a (much) longer average transmission delay.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.19/35

slide-20
SLIDE 20

CSMA/CD

If the length of a standard frame is much longer than the propagation delay between stations, the performance of CSMA can be improved by aborting transmissions as soon as a collision is detected. Thus, if two stations sense the channel to be idle and begin transmitting simultaneously, they abort their transmissions as soon as they detect the collision. The resulting protocol is known as CSMA/CD (carrier sense multiple access with collision detection). CSMA/CD is the basis of Ethernet LANs. Under CSMA/CD the channel can be in one of three states: (i) Transmitting single frames, (ii) resolving contentions, or (iii) idle. The main feature is that the “CD part” shortens the amount of time that is spent to resolve contentions.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.20/35

slide-21
SLIDE 21

CSMA/CD

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

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.21/35

slide-22
SLIDE 22

Effect of Propagation Delay

The figure above illustrates the fact that a station can

  • nly be sure to have seized the channel after

transmitting for

without hearing a collision.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.22/35

slide-23
SLIDE 23

Binary Exponential Backoff

In Ethernet, time is divided into slots of length

(where

is the worst-case propagation delay in the network) after a collision occurs. After the first collision, each station waits either 0 or 1 slot times (at random) before trying to retransmit. If that results in another collision, each station now waits 0, 1, 2, or 3 slot times (at random) before trying to retransmit. Each time when another collision occurs the number of slots to wait is chosen at random from a set of numbers that has twice the size of the previous set, up to the interval

✠ ✞ ☎ ✞ ✞ ✞ ✡ ✡ ✡ ✞ ☎ ✠ ✞ ✁

. This algorithm, which in essence stabilizes the underlying slotted ALOHA system, is called binary exponential backoff.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.23/35

slide-24
SLIDE 24

Collision-Free Protocols

CSMA/CD is not universally applicable. For instance, if the propagation delay is similar to or much longer than the length of a frame (e.g., on a satellite channel), “CD” does not help to shorten contention periods. If there is a finite number

  • f stations, then there exist

schemes that either avoid collisions altogether, or at least limit the contention to (small) subsets of

  • .

An obvious solution is to use TDM or FDM for

  • users,

but the goal is to do better than that in the case when

  • nly a fraction of all users is typically active at any

given time.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.24/35

slide-25
SLIDE 25

Bit Map Protocol

The basic bit-map protocol for

  • stations uses
  • contention slots of 1 bit each. Any station that has a

frame to transmit sets the bit in its assigned slot and every other station gets to see this bit. Thus, during the actual transmission phase each station knows when to transmit and when to be silent. Bit-map protocols are part of a larger class called reservation protocols.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.25/35

slide-26
SLIDE 26

Wireless LAN Protocols

A system of notebook computers that communicate by radio can be regarded as a wireless LAN. Wireless LANs have different properties than conventional (wired) LANs and require special MAC sublayer protocols. A common configuration for a wireless LAN consists of base stations (or access points) strategically placed around a building and wired together using copper of fiber. The mobile stations then communicate via radio links with these base stations. If the transmission power of the base and mobile stations is adjusted to have a range of 3-4 meters, then each room becomes a cell in a cellular system. This is similar to a cellular telephone system, except that each cell has only one channel, covering the entire available bandwidth and all stations in the cell.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.26/35

slide-27
SLIDE 27

Hidden Station Problem

Simplifying assumption: All radio transmitters have some fixed range. A transmits to B. If C senses medium, it will not hear A and thus, when it transmits to B a collision results. CSMA cannot be used here because what counts is what B hears, not what A and C hear. The problem of a station not being able to detect a competitor because it is too far away is called the hidden station problem.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.27/35

slide-28
SLIDE 28

Exposed Station Problem

Simplifying assumption: All radio transmitters have some fixed range. B transmits to A. C wants to transmit to D. It senses the medium and falsely concludes that it cannot start sending. Again, what is crucial is what the receiver sees, not what the sender sees. The problem encountered here is called the exposed station problem.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.28/35

slide-29
SLIDE 29

MACA Protocol

MACA stands for mulitple access with collision avoidance. The basic idea is for the sender to stimulate the receiver into sending a short frame, so that stations nearby can detect it and refrain from using the channel during the upcoming (large) data frame. If A wants to send to B it starts by transmitting an RTS (request to send) frame. This short frame contains the length of the data frame that will eventually follow. If B is ready to receive a frame, it responds with a CTS (clear to send) frame. The CTS frame also contains the length of the upcoming data frame. Upon receipt of the CTS frame A begins transmission. Any station that hears RTS is close to A and must remain silent for the CTS to be transmitted back to A. Any station that hears CTS is close to B and must remain silent during the upcoming data frame transmission.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.29/35

slide-30
SLIDE 30

MACA Protocol

(a) A sends RTS to B. (b) B responds with a CTS to A.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.30/35

slide-31
SLIDE 31

MACAW Protocol

MACAW stands for MACA for wireless. It is a fine tuned version of MACA. An ACK frame is sent after each successful data frame (so that retransmissions can be initiated when no ACK is received). CSMA is used to avoid some obvious collisions of RTS frames. Exponential backoff algorithm is run separately for each data stream (source-destination pair). Finally, a mechanism is added for stations to exchange information about congestion and make the backoff algorithm react less violently to temporary problems.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.31/35

slide-32
SLIDE 32

802.11 MAC Sublayer Protocol

The 802.11 MAC sublayer protocol is quite different from the one for Ethernet, due to the different behavior and requirements of the wireless environment. Collision detection with early transmission abort cannot be used due to the inability of radio transceivers to transmit and listen simultaneously. In addition there is the hidden/exposed station problem. 802.11 supports two modes of operation. The first, called DCF (distributed coordination function), uses no central control, similar to Ethernet. The second, called PCF (point coordination function), uses the base station to control all actvity in its cell. All implementations of 802.11 must support DCF , but PCF is optional.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.32/35

slide-33
SLIDE 33

Hidden/Exposed Stations

(a) Hidden station problem. (b) Exposed station problem.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.33/35

slide-34
SLIDE 34

DCF for 802.11

DCF uses a protocol called CSMA/CA (CSMA with collision avoidance). In this protocol both physical and virtual channel sensing are used. Method 1: When a station wants to transmit, it senses the

  • channel. If it is idle it starts transmitting and sends the entire

frame without further channel sensing. If the channel is busy, transmission is deferred until the channel goes idle. If a collision occurs, the colliding stations wait a random time (using binary exponential backoff) and then try again. Method 2: Based on MACAW using virtual channel sensing. A station that wants to transmit sends an RTS frame to request permission to send a data frame. When permission is granted the receiving station returns a CTS frame. Every station that hears either the RTS, the CTS or both knows that a data frame transmission is about to begin and defers transmitting.

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.34/35

slide-35
SLIDE 35

Virtual Channel Sensing

A wants to send to B and sends RTS. B responds with CTS. C is within range of A and hears RTS. D is within range

  • f B but not of A. It does not hear RTS but hears CTS.

C and D assert a virtual channel busy to themselves, indicated by NAV (network allocation vector).

Data Networks, Medium Access Control Sublayer, c

  • 1996–2005, P

. Mathys – p.35/35