Docsity

IEEE 802.11 Wireless LAN and CSMA/CA: Collision Avoidance in Wireless Networks - Prof. Ala, Study notes of Computer Systems Networking and Telecommunications

Partial preview of the text

Download IEEE 802.11 Wireless LAN and CSMA/CA: Collision Avoidance in Wireless Networks - Prof. Ala and more Study notes Computer Systems Networking and Telecommunications in PDF only on Docsity!

Data Link Protocols

Link Layer Services

„ Framing, Addressing, link access:

encapsulate datagram into frame, adding header, trailer

channel access if shared medium

“MAC” addresses used in frame headers to identify source,

dest

„ different from IP address!

„ Error Detection :

errors caused by signal attenuation, noise.

receiver detects presence of errors:

„ signals sender for retransmission or drops frame

Medium Access Control

(MAC) Protocols

MAC Protocols: a taxonomy

Three broad classes:

„ Channel Partitioning

divide channel into smaller “pieces” (time slots,

frequency, code)

allocate piece to node for exclusive use

„ Random Access

channel not divided, allow collisions

“recover” from collisions

„ “Taking turns”

Nodes take turns, but nodes with more to send

can take longer turns

Random Access Protocols

„ When node has packet to send

transmit at full channel data rate R.

no a priori coordination among nodes

„ two or more transmitting nodes ➜ “collision”,

„ random access MAC protocol specifies:

how to detect collisions

how to recover from collisions (e.g., via delayed retransmissions)

„ Examples of random access MAC protocols:

slotted ALOHA

ALOHA

CSMA, CSMA/CD, CSMA/CA

Ethernet uses CSMA/CD

„ No slots

„ adapter doesn’t transmit if it senses that some other adapter is transmitting, that is, carrier sense

„ transmitting adapter aborts when it senses that another adapter is transmitting, that is, collision detection

„ Before attempting a

retransmission, adapter waits a random time, that is, random access

Ethernet CSMA/CD algorithm

1. Adaptor receives datagram

from net layer & creates

frame

2. If adapter senses channel

idle, it starts to transmit

frame. If it senses channel

busy, waits until channel

idle and then transmits

3. If adapter transmits entire

frame without detecting

another transmission, the

adapter is done with frame!

4. If adapter detects another

transmission while

transmitting, aborts and

sends jam signal

5. After aborting, adapter

enters exponential

backoff : after the mth

collision, adapter chooses a

K at random from

{0,1,2,…,2 m -1}. Adapter

waits K·512 bit times and

returns to Step 2

IEEE 802.11 Wireless LAN

„ 802.11b

2.4-5 GHz unlicensed

radio spectrum

up to 11 Mbps

direct sequence

spread spectrum

(DSSS) in physical

layer

„ all hosts use same

chipping code

widely deployed, using

base stations

„ 802.11a

5-6 GHz range

up to 54 Mbps

„ 802.11g

2.4-5 GHz range

up to 54 Mbps

„ All use CSMA/CA for multiple access

„ All have base- station and ad-hoc

network versions

IEEE 802.11: multiple access

„ avoid collisions: 2 +^ nodes transmitting at same time

„ 802.11: CSMA - sense before transmitting

don’t collide with ongoing transmission by other node

„ 802.11: no collision detection!

difficult to receive (sense collisions) when transmitting due to

weak received signals (fading)

can’t sense all collisions in any case: hidden terminal, fading

goal: avoid collisions: CSMA/C(ollision)A(voidance)

A

B

C

A B C

A’s signal strength

space

C’s signal strength

IEEE 802.11 MAC Protocol: CSMA/CA

802.11 sender

1 if sense channel idle for DIFS then

transmit entire frame (no CD)

2 if sense channel busy then

start random backoff time

timer counts down while channel idle

transmit when timer expires

if no ACK, increase random backoff interval,

repeat 2

802.11 receiver

  • if frame received OK

return ACK after SIFS (ACK needed due to

hidden terminal problem)

sender (^) receiver

DIFS

data

SIFS

ACK

Avoiding collisions (more)

idea: allow sender to “reserve” channel rather than random

access of data frames: avoid collisions of long data frames

„ sender first transmits small request-to-send (RTS) packets to BS

using CSMA

RTSs may still collide with each other (but they’re short)

„ BS broadcasts clear-to-send CTS in response to RTS

„ RTS heard by all nodes

sender transmits data frame

other stations defer transmissions

Avoid data frame collisions completely

using small reservation packets!

Collision Avoidance: RTS-CTS exchange

AP

A B

time

RTS(A) RTS(B)

RTS(A)

CTS(A) CTS(A)

DATA (A)

ACK(A) ACK(A)

reservation collision

defer

frame control duration

address 1

address 2

address 4

address 3 payload^ CRC

seq control

Protocolversion Type Subtype ToAP FromAP Morefrag Retry Powermgt Moredata WEP Rsvd

802.11 frame: more

duration of reserved transmission time (RTS/CTS)

frame seq # (for reliable ARQ)

frame type (RTS, CTS, ACK, data)

Link Layer

Addressing

MAC Addresses and ARP

„ 32-bit IP address:

network-layer address

used to get datagram to destination IP subnet

„ MAC (or LAN or physical or Ethernet)

address:

used to get datagram from one interface to another physically-connected interface (same

network)

48 bit MAC address (for most LANs) burned in the adapter ROM

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

Broadcast address = FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B

0C-C4-11-6F-E3-

71-65-F7-2B-08-

LAN

(wired or wireless)

ARP protocol: Same LAN (network)

„ A wants to send datagram to

B, and B’s MAC address not

in A’s ARP table.

„ A broadcasts ARP query

packet, containing B's IP

address

Dest MAC address = FF-

FF-FF-FF-FF-FF

all machines on LAN

receive ARP query

„ B receives ARP packet,

replies to A with its (B's)

MAC address

frame sent to A’s MAC address (unicast)

„ A caches (saves) IP-to-MAC

address pair in its ARP table

until information becomes old

(times out)

soft state: information that

times out (goes away)

unless refreshed

„ ARP is “plug-and-play”:

nodes create their ARP

tables without intervention

from net administrator

Routing to another LAN

walkthrough: send datagram from A to B via R assume A know’s B IP address

„ Two ARP tables in router R, one for each IP network (LAN)

„ In routing table at source Host, find router 111.111.111.

„ In ARP table at source, find MAC address E6-E9-00-17-BB-4B,

etc

A

R

B

„ A creates datagram with source A, destination B

„ A uses ARP to get R’s MAC address for 111.111.111.

„ A creates link-layer frame with R's MAC address as dest, frame contains A-to-B IP datagram

„ A’s adapter sends frame

„ R’s adapter receives frame

„ R removes IP datagram from Ethernet frame, sees its destined to B

„ R uses ARP to get B’s MAC address

„ R creates frame containing A-to-B IP datagram sends to B

A

R

B

Ethernet Frame Structure

Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Preamble:

„ 7 bytes with pattern 10101010 followed by

one byte with pattern 10101011

„ used to synchronize receiver, sender clock rates

Self learning

„ A switch has a switch table

„ entry in switch table:

(MAC Address, Interface, Time Stamp)

stale entries in table dropped (TTL can be 60 min)

„ switch learns which hosts can be reached through

which interfaces

when frame received, switch “learns” location of sender: incoming LAN segment

records sender/location pair in switch table

Filtering/Forwarding

When switch receives a frame:

index switch table using MAC dest address

if entry found for destination then{

if dest on segment from which frame arrived then drop the frame

else forward the frame on interface

indicated

}

else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

„ Switch receives frame from C

notes in bridge table that C is on interface 1

because D is not in table, switch forwards frame

into interfaces 2 and 3

„ frame received by D

hub hub^ hub

switch

A

B C

D

E

F

G H

I

address (^) interface A B E G

Switch example

Suppose D replies back with frame to C.

„ Switch receives frame from from D

notes in bridge table that D is on interface 2

because C is in table, switch forwards frame only

to interface 1

„ frame received by C

hub hub^ hub

switch

A

B C

D

E

F

G H

I

address interface A B E G C

Local Area Networks

„ Local area networks (LANs) connect computers within a

building or a enterprise network

„ Almost all LANs are broadcast networks

„ Typical topologies of LANs are bus or ring or star

„ We will work with Ethernet LANs. Ethernet has a bus or

star topology.

Bus LAN Ring LAN

MAC and LLC

„ In any broadcast network, the stations must ensure that only one

station transmits at a time on the shared communication channel

„ The protocol that determines who can transmit on a broadcast

channel are called Medium Access Control (MAC) protocol

„ The MAC protocol are implemented

in the MAC sublayer which is the

lower sublayer of the data link layer

„ The higher portion of the data link

layer is often called Logical Link

Control (LLC)

Logical Link Control Medium Access Data Link Control

Layer

to Physical Layer

to Network Layer

IEEE 802 Standards

„ IEEE 802 is a family of standards for LANs, which defines an LLC

and several MAC sublayers

Ethernet

„ Speed: 10Mbps -10 Gbps

„ Standard: 802.3, Ethernet II (DIX)

„ Most popular physical layers for Ethernet:

„ 10Base5 Thick Ethernet: 10 Mbps coax cable „ 10Base2 Thin Ethernet: 10 Mbps coax cable „ 10Base-T 10 Mbps Twisted Pair „ 100Base-TX 100 Mbps over Category 5 twisted pair „ 100Base-FX 100 Mbps over Fiber Optics „ 1000Base-FX 1Gbps over Fiber Optics „ 10000Base-FX 1Gbps over Fiber Optics (for wide area links)