lecture 27 university of nevada – reno computer science & engineering department fall 2015 cpe...

34
Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta Office SEM 204 [email protected] http://www.cse.unr.edu/~shamik/

Upload: elvin-fox

Post on 21-Jan-2016

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

Lecture 27

University of Nevada – RenoComputer Science & Engineering Department

Fall 2015

CPE 400 / 600Computer Communication Networks

Prof. Shamik SenguptaOffice SEM 204

[email protected]://www.cse.unr.edu/~shamik/

Page 2: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

Link layer in wireless

Link Layer 5-2

Page 3: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

link access in wireless domain # wireless (mobile) phone subscribers

now exceeds # wired phone subscribers!

computer networks: laptops, palmtops, PDAs, Smart Phones promise anytime wireless Internet access!

It has really been a wireless revolution decade…with more to come Wireless is no longer a luxury but a

necessity

Page 4: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

WLAN Market: WiFi

0

1

2

3

4

5

$-b

il

2001 2002 2003 2004 2005

Forecast Sales of Wi-Fi Equipment(Source: InfoTech Trends)

Source: Pyramid Research

Worldwide WLAN Infrastructure Shipments (Source: Gartner)

0

1

2

3

4

5

6

7

Mil

lio

ns o

f U

nit

s

Source: AirTight Networks

WLAN growing exponentially

Page 5: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

IEEE 802.11 Wireless LAN 802.11b

2.4 GHz unlicensed spectrum

up to 11 Mbps 802.11g

2.4 GHz range up to 54 Mbps

802.11a 5 GHz range up to 54 Mbps

802.11n: multiple antennae 2.4 / 5 GHz range up to 200 Mbps

all use CSMA/CA for multiple access all have infrastructure and ad-hoc network versions

What else? 802.11 ac – builds on 802.n – provides 80-160MHz channels 802.11ad – 60GHz mmwave spectrum 802.11af – Super Wi-Fi

Page 6: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

802.11 LAN architecture

wireless host communicates with base station base station = access

point (AP) Basic Service Set (BSS)

(aka “cell”) in infrastructure mode contains: wireless hosts access point (AP): base

station ad hoc mode: hosts

only

BSS 1

BSS 2

Internet

hub, switchor routerAP

AP

Page 7: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

Basic Service Set (BSS)

BSS

Page 8: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

Extended Service Set (ESS) BSS’s with wired Distribution System (DS)

BSS

BSS

Distribution

System

Page 9: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

802.11: Channels, association 802.11b: 2.4GHz-2.485GHz spectrum divided

into 13 channels at different frequencies AP admin chooses frequency for AP interference possible: channel can be same

as that chosen by neighboring AP!

host: must associate with an AP scans channels, listening for beacon frames

containing AP’s name (SSID) and MAC address selects AP to associate with will typically run DHCP to get IP address in

AP’s subnet

Page 10: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

IEEE 802.11: multiple access problem 802.11: CSMA - sense before transmitting

don’t collide with ongoing transmission by other node

Certain differences from Ethernet LAN in wired domain

802.11: no collision detection! difficult to receive (sense collisions) when transmitting

due to weak received signals (fading)• Signal strength falls off rapidly with distance • Signal strength may weaken due to obstacles• Medium “air” shared among many users (not just WiFi users)

can’t detect all collisions in any case: hidden terminal problem

Page 11: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

Wireless interference

Hidden terminal

Goal: CSMA/C(ollision)A(voidance)

“Open” Wireless Medium

S1

S2

R1

R1

S1 R1 S2

Page 12: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

How does the medium access work in WLAN?

Access methods DCF CSMA/CA (mandatory)

• collision avoidance via exponential backoff• Minimum distance (IFS) between consecutive packets• ACK packet for acknowledgements (not for broadcasts)

DCF with RTS/CTS (optional)

• Distributed Foundation Wireless MAC• avoids hidden terminal problem

PCF (optional)

• access point polls terminals according to a list

Contention Based

Contention Free

Distributed Coordination Function (DCF) Point Coordination Function (PCF)

Page 13: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

802.11 – MAC Priorities

defined through different inter frame spaces SIFS (Short Inter Frame Spacing)

• highest priority, for ACK, CTS, polling response PIFS (PCF IFS)

• medium priority, for time-bounded service using PCF

DIFS (DCF, Distributed Coordination Function IFS)

• lowest priority, for asynchronous data service, competing stations

t

medium busy SIFS

PIFS

DIFSDIFS

next framecontention

access if medium is free DIFS

DIFS = SIFS + (2 * Slot time)

Page 14: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

WLAN access scheme details

Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the

packet was received correctly automatic retransmission of data packets in case of

transmission errors

t

SIFS

DIFS

data

ACK

waiting time

otherstations

receiver

senderdata

DIFS

contention

Page 15: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

Contention for channel When the other stations find the channel idle, they

would like to transmit their own packets Contention for channel

If all the waiting stations attempt at once, this will surely result in collision Some CA scheme is necessary Backoff intervals can be used to reduce collision probability

t

SIFS

DIFS

data

ACK

waiting time

otherstations

receiver

senderdata

DIFS

contention

Page 16: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

Backoff Interval When transmitting a packet, choose a backoff interval in

the range [0,cw] cw is contention window

Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy

When backoff interval reaches 0, transmit packet

data

wait

B1 = 5

B2 = 15

B1 = 25

B2 = 20

data

wait

B1 and B2 are backoff intervalsat nodes 1 and 2

Assume cw = 31

B2 = 10

Page 17: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

Backoff Interval The time spent counting down backoff intervals is a part

of MAC overhead Choosing a large cw leads to large backoff intervals and

can result in larger overhead Choosing a small cw leads to a larger number of collisions

(when two nodes count down to 0 simultaneously)

Since the number of nodes attempting to transmit simultaneously may change with time, some mechanism to manage contention is needed IEEE 802.11 DCF: contention window cw is chosen

dynamically depending on collision occurrence Follows Binary exponential backoff algorithm

Page 18: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

Binary Exponential Backoff (BEB) in DCF

Even before the first collision, nodes follow BEB

Initial backoff interval (before 1st collision) [0,7]

If still packets collide, double the collision interval [0,15], [0,31] and so on…

Page 19: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

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 CTS heard by all nodes

sender transmits data frame other stations defer transmissions

avoid data frame collisions completely using small reservation packets!

Page 20: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

Collision Avoidance: RTS-CTS exchange

APA B

time

RTS(A)RTS(B)

RTS(A)

CTS(A) CTS(A)

DATA (A)

ACK(A) ACK(A)

reservation collision

defer

Page 21: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

Wireless, Mobile Networks 6-21

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

802.11 frame: addressing

Address 2: MAC addressof wireless host or AP transmitting this frame

Address 1: MAC addressof wireless host or AP to receive this frame

Address 3: MAC address(dependent on frame control field)

Address 4: used only in ad hoc mode

Page 22: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

Wireless, Mobile Networks 6-22

InternetrouterH1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

802.11 frame

R1 MAC addr H1 MAC addr

dest. address source address

802.3 frame

802.11 frame: addressing

Page 23: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

Wireless, Mobile Networks 6-23

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

TypeFromAP

SubtypeToAP

More frag

WEPMoredata

Powermgt

Retry RsvdProtocolversion

2 2 4 1 1 1 1 1 11 1

duration of reserved transmission time (RTS/CTS)

frame seq #(for RDT)

frame type(RTS, CTS, ACK, data)

802.11 frame: more

Page 24: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

Frame Control field

Protocol Version: zero for 802.11 standard

Type= frame type: data, management, control Subtype = frame sub-type

ToDS: when bit is set indicate that destination

frame is for DS FromDS:

When bit is set indicate frame coming from DS

Data Link Layer 5-24

Page 25: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

Frame Control field

Retry: Set in case of retransmission frame

More fragments: Set when frame is followed by other

fragment Power Management

bit set when station go Power Save mode (PS)

More Data: When set means that AP have more

buffered data for a station in Power Save mode

Data Link Layer 5-25

Page 26: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

Address Field Description

Addr. 1 = All stations filter on this address.Addr. 2 = Transmitter Address (TA), Identifies transmitter to address the ACK frame to.Addr. 3 = Dependent on To and From DS bits.Addr. 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames

ProtocolVersion

Type SubTypeToDS

RetryPwrMgt

MoreData

WEP Rsvd

Frame Control Field

Bits: 2 2 4 1 1 1 1 1 1 1 1

DSFrom More

Frag

To DS

0

0

1

1

From DS

0

1

0

1

Address 1

DA

DA

BSSID

RA

Address 2

SA

BSSID

SA

TA

Address 3

BSSID

SA

DA

DA

Address 4

N/A

N/A

N/A

SA

Page 27: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

Type field descriptions

Type and subtype identify the function of the frame: Type=00 Management Frame

Beacon (Re)Association

Probe

Type=01 Control FrameRTS/CTS ACK

Type=10 Data Frame

ProtocolVersion

Type SubTypeToDS

RetryPwrMgt

MoreData

WEP Rsvd

Frame Control Field

Bits: 2 2 4 1 1 1 1 1 1 1 1

DSFrom More

Frag

Page 28: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

Type and subtypes

Data Link Layer 5-28

Page 29: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

Type and subtypes

Data Link Layer 5-29

Page 30: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

Type and subtypes

Data Link Layer 5-30

Page 31: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

RTS/CTS frames

Data Link Layer 5-31

Page 32: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

Lecture 27

University of Nevada – RenoComputer Science & Engineering Department

Fall 2015

CPE 400 / 600Computer Communication Networks

Prof. Shamik SenguptaOffice SEM 204

[email protected]://www.cse.unr.edu/~shamik/

Page 33: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

Numerical Problems Practice

Wi-FiHidden Node ProblemWi-Fi with RTS/CTS

See handouts for numerical problems: Lec27_numerical problems.pdf

Page 34: Lecture 27 University of Nevada – Reno Computer Science & Engineering Department Fall 2015 CPE 400 / 600 Computer Communication Networks Prof. Shamik Sengupta

Announcements Dec. 2: Quiz 4

Dec. 7: Sample final exam in class. Discussion.

Dec. 9: Prep. Day. No class.

Dec. 14: Final Exam: 10.15am – 12.15pm

Link Layer 5-34