37
1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

Embed Size (px)

Citation preview

Page 1: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

1

CSCD 433Network ProgrammingFall 2013

Lecture 7Ethernet and Wireless 80211

Topics

bull 802 Standard bull MAC and LLC Sublayersbull Review of MAC in Ethernetbull MAC in 80211 Wireless

2

IEEE Standards

bull In 1985 Computer Society of IEEE started In 1985 Computer Society of IEEE started

a project called Project 802a project called Project 802

bull Set standards to enable Set standards to enable

intercommunication among equipment intercommunication among equipment

from a variety of manufacturersfrom a variety of manufacturers

bull Project 802Project 802

ndash Specifies functions of physical layer and Specifies functions of physical layer and

the data link layer of major LAN the data link layer of major LAN

protocolsprotocols

IEEE 802 Series of LAN Standards

802 standards free to download from httpstandardsieeeorggetieee802

WiMAX

IEEE 802 Standard

Complete specification of 802 standard

5

6

IEEE 80211 Protocol Architecture

Physical Layer

7

802 LayeringMedia Access Control (MAC) LayerMAC layer standards ensure that only one can transmit at a time

bull Reduces collisions amp unreadable transmissions

Also defines frame formatWill be different for each flavor of 802 hellip

Logical Link Control (LLC) LayerAdds optional error correction (rarely used)Connects to next-higher-layer (internet)

8022 Logical Link Control Layer StandardIP IPX Etc

8023 8025 80211

8

80211 Physical Layerbull Issued in four stagesbull 1997 First part

bull IEEE 80211 bull Includes MAC layer and three physical layer

specificationsbull Two in 24-GHz band and one infraredbull All operating at 1 and 2 Mbps

bull 1999 Two additional partsbull IEEE 80211a

bull 5-GHz band data rate up to 54 Mbpsbull IEEE 80211b

bull 24-GHz band data rate at 55 and 11 Mbpsbull 2002 Most recent

bull IEEE 80211g extends IEEE 80211b to higher data rates up to 54 Mbps

bull At presentbull IEEE 80211n and 80211ac data rate up to hundreds

of Mbps

Review of Classical or Standard Ethernet

Review of Ethernet

bull Recall that Ethernet is a shared technologybull Everyone has access to the wires bull Users contend with collisions and the MAC

layer protocol dealt with these collisionsndash Note ndash This is with traditional cable and Hubs

bull Review characteristics of Ethernet to better understand 80211 wireless LANs

Ethernet Recap

bull Classic Ethernet bull One long cable 500 meter max segmentbull Snaked around building as single long cablebull All computers attached

bull Thick Ethernetbull Began as thick yellow cable marked every

25 meters to show computer attachments

bull Thin Ethernetbull Thinner bent more easily connections with

BNC connectorsbull Cheaper to install 185 meter max segment

Ethernet Recap

bull Ethernet could contain multiple segments and multiple repeaters

bull Used CSMACD for shared media bull What does CSMACD stand for

Carrier Sense Multiple AccessCollision Detection

bull Review this

13

CSMACD Protocol

All hosts transmit amp receive on one channelPackets are of variable size

When a host has a packet to transmit1 Carrier Sense Check that the line is quiet before transmitting2 Collision Detection Detect collision as soon as Possible Collision is detected stop transmitting wait a

random time then return to step 1

14

Ethernet CSMACD algorithm

Algorithm1 NIC receives datagram from network

layer creates frame

2 If NIC senses channel idle starts frame transmission

If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

Ethernet CSMACD algorithm

4 If NIC detects another transmission while transmitting aborts and sends jam signal5 After aborting NIC enters exponential backoff after mth collision NIC chooses a K small integer at random from 012hellip2m-1 NIC then waits K512 bit time

bull Returns to Step 2

15

16

Wireless Communication Systems amp Networking

- In terms of packet or frame delivery hellip

- What complicates wireless networking vs wired networking

17

Wireless Link Characteristics (1)

Differences from wired link hellip

bull Decreased signal strength Radio signal attenuates as it propagates through matter (path loss)

bull Interference from other sources Standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well

bull Multipath propagation Radio signal reflects off objects ground arriving ad destination at slightly different times

hellip make communication across link much more ldquodifficultrdquo

18

80211 Medium Access Controlbull MAC layer has three functions

1 Reliable data deliverybull Different from Ethernet wireless LANs

suffer from considerable unreliability

2 Access controlbull Distributed accessbull Centralized access

3 Security

19

Medium Access Control

bull Two sublayers

Lower sublayer Distributed Coordination Function (DCF)

bull Uses a contention algorithm to provide access to all traffic

Higher sublayer Point Coordination Function (PCF)

bull Uses a centralized algorithmbull Contention freebull Implemented on top of DCF

bull Remark PCF has not been popularly implemented in todayrsquos 80211 products DCF is widely used

Ethernet vs Wireless

Ethernet ndash Waits for ether to be silent and transmits

If doesnt get a sense of noise while transmitting assumes frame got through

Wireless ndash Collision detection doesnt work and instead uses Collision Avoidance

Wireless Collision Avoidance

Steps

Have a frame to send

Wait a random backoff time until channel is idle

Sense it is idle for short time called DIFS period

Sends frame if gets through destination sends an ACK

Lack of an ACK means frame failed

Sender then doubles backoff time tries again

Continues as in Ethernet until frame succeeds

22

IEEE 80211 MAC Protocol CSMACA

80211 sender1 if sense channel idle for DIFS then

transmit entire frame 2 if sense channel busy then

a) start random backoff timeb) timer counts down while channel idlec) transmit when timer expiresd) if no ACK increase random backoff

interval repeat 2

80211 receiver- if frame received OK

return ACK after SIFS (ACK needed due to hidden terminal problem)

sender receiver

DIFS

data

SIFS

ACK

Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

23

80211 Frames have Timers

Network Allocation Vector (NAV) timer NAV is set when a frame sequence is

sent Says how long a sequence will take so

other stations have an idea when the medium will be available

For example a NAV for a data frame will also include the ACK back

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 2: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

Topics

bull 802 Standard bull MAC and LLC Sublayersbull Review of MAC in Ethernetbull MAC in 80211 Wireless

2

IEEE Standards

bull In 1985 Computer Society of IEEE started In 1985 Computer Society of IEEE started

a project called Project 802a project called Project 802

bull Set standards to enable Set standards to enable

intercommunication among equipment intercommunication among equipment

from a variety of manufacturersfrom a variety of manufacturers

bull Project 802Project 802

ndash Specifies functions of physical layer and Specifies functions of physical layer and

the data link layer of major LAN the data link layer of major LAN

protocolsprotocols

IEEE 802 Series of LAN Standards

802 standards free to download from httpstandardsieeeorggetieee802

WiMAX

IEEE 802 Standard

Complete specification of 802 standard

5

6

IEEE 80211 Protocol Architecture

Physical Layer

7

802 LayeringMedia Access Control (MAC) LayerMAC layer standards ensure that only one can transmit at a time

bull Reduces collisions amp unreadable transmissions

Also defines frame formatWill be different for each flavor of 802 hellip

Logical Link Control (LLC) LayerAdds optional error correction (rarely used)Connects to next-higher-layer (internet)

8022 Logical Link Control Layer StandardIP IPX Etc

8023 8025 80211

8

80211 Physical Layerbull Issued in four stagesbull 1997 First part

bull IEEE 80211 bull Includes MAC layer and three physical layer

specificationsbull Two in 24-GHz band and one infraredbull All operating at 1 and 2 Mbps

bull 1999 Two additional partsbull IEEE 80211a

bull 5-GHz band data rate up to 54 Mbpsbull IEEE 80211b

bull 24-GHz band data rate at 55 and 11 Mbpsbull 2002 Most recent

bull IEEE 80211g extends IEEE 80211b to higher data rates up to 54 Mbps

bull At presentbull IEEE 80211n and 80211ac data rate up to hundreds

of Mbps

Review of Classical or Standard Ethernet

Review of Ethernet

bull Recall that Ethernet is a shared technologybull Everyone has access to the wires bull Users contend with collisions and the MAC

layer protocol dealt with these collisionsndash Note ndash This is with traditional cable and Hubs

bull Review characteristics of Ethernet to better understand 80211 wireless LANs

Ethernet Recap

bull Classic Ethernet bull One long cable 500 meter max segmentbull Snaked around building as single long cablebull All computers attached

bull Thick Ethernetbull Began as thick yellow cable marked every

25 meters to show computer attachments

bull Thin Ethernetbull Thinner bent more easily connections with

BNC connectorsbull Cheaper to install 185 meter max segment

Ethernet Recap

bull Ethernet could contain multiple segments and multiple repeaters

bull Used CSMACD for shared media bull What does CSMACD stand for

Carrier Sense Multiple AccessCollision Detection

bull Review this

13

CSMACD Protocol

All hosts transmit amp receive on one channelPackets are of variable size

When a host has a packet to transmit1 Carrier Sense Check that the line is quiet before transmitting2 Collision Detection Detect collision as soon as Possible Collision is detected stop transmitting wait a

random time then return to step 1

14

Ethernet CSMACD algorithm

Algorithm1 NIC receives datagram from network

layer creates frame

2 If NIC senses channel idle starts frame transmission

If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

Ethernet CSMACD algorithm

4 If NIC detects another transmission while transmitting aborts and sends jam signal5 After aborting NIC enters exponential backoff after mth collision NIC chooses a K small integer at random from 012hellip2m-1 NIC then waits K512 bit time

bull Returns to Step 2

15

16

Wireless Communication Systems amp Networking

- In terms of packet or frame delivery hellip

- What complicates wireless networking vs wired networking

17

Wireless Link Characteristics (1)

Differences from wired link hellip

bull Decreased signal strength Radio signal attenuates as it propagates through matter (path loss)

bull Interference from other sources Standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well

bull Multipath propagation Radio signal reflects off objects ground arriving ad destination at slightly different times

hellip make communication across link much more ldquodifficultrdquo

18

80211 Medium Access Controlbull MAC layer has three functions

1 Reliable data deliverybull Different from Ethernet wireless LANs

suffer from considerable unreliability

2 Access controlbull Distributed accessbull Centralized access

3 Security

19

Medium Access Control

bull Two sublayers

Lower sublayer Distributed Coordination Function (DCF)

bull Uses a contention algorithm to provide access to all traffic

Higher sublayer Point Coordination Function (PCF)

bull Uses a centralized algorithmbull Contention freebull Implemented on top of DCF

bull Remark PCF has not been popularly implemented in todayrsquos 80211 products DCF is widely used

Ethernet vs Wireless

Ethernet ndash Waits for ether to be silent and transmits

If doesnt get a sense of noise while transmitting assumes frame got through

Wireless ndash Collision detection doesnt work and instead uses Collision Avoidance

Wireless Collision Avoidance

Steps

Have a frame to send

Wait a random backoff time until channel is idle

Sense it is idle for short time called DIFS period

Sends frame if gets through destination sends an ACK

Lack of an ACK means frame failed

Sender then doubles backoff time tries again

Continues as in Ethernet until frame succeeds

22

IEEE 80211 MAC Protocol CSMACA

80211 sender1 if sense channel idle for DIFS then

transmit entire frame 2 if sense channel busy then

a) start random backoff timeb) timer counts down while channel idlec) transmit when timer expiresd) if no ACK increase random backoff

interval repeat 2

80211 receiver- if frame received OK

return ACK after SIFS (ACK needed due to hidden terminal problem)

sender receiver

DIFS

data

SIFS

ACK

Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

23

80211 Frames have Timers

Network Allocation Vector (NAV) timer NAV is set when a frame sequence is

sent Says how long a sequence will take so

other stations have an idea when the medium will be available

For example a NAV for a data frame will also include the ACK back

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 3: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

IEEE Standards

bull In 1985 Computer Society of IEEE started In 1985 Computer Society of IEEE started

a project called Project 802a project called Project 802

bull Set standards to enable Set standards to enable

intercommunication among equipment intercommunication among equipment

from a variety of manufacturersfrom a variety of manufacturers

bull Project 802Project 802

ndash Specifies functions of physical layer and Specifies functions of physical layer and

the data link layer of major LAN the data link layer of major LAN

protocolsprotocols

IEEE 802 Series of LAN Standards

802 standards free to download from httpstandardsieeeorggetieee802

WiMAX

IEEE 802 Standard

Complete specification of 802 standard

5

6

IEEE 80211 Protocol Architecture

Physical Layer

7

802 LayeringMedia Access Control (MAC) LayerMAC layer standards ensure that only one can transmit at a time

bull Reduces collisions amp unreadable transmissions

Also defines frame formatWill be different for each flavor of 802 hellip

Logical Link Control (LLC) LayerAdds optional error correction (rarely used)Connects to next-higher-layer (internet)

8022 Logical Link Control Layer StandardIP IPX Etc

8023 8025 80211

8

80211 Physical Layerbull Issued in four stagesbull 1997 First part

bull IEEE 80211 bull Includes MAC layer and three physical layer

specificationsbull Two in 24-GHz band and one infraredbull All operating at 1 and 2 Mbps

bull 1999 Two additional partsbull IEEE 80211a

bull 5-GHz band data rate up to 54 Mbpsbull IEEE 80211b

bull 24-GHz band data rate at 55 and 11 Mbpsbull 2002 Most recent

bull IEEE 80211g extends IEEE 80211b to higher data rates up to 54 Mbps

bull At presentbull IEEE 80211n and 80211ac data rate up to hundreds

of Mbps

Review of Classical or Standard Ethernet

Review of Ethernet

bull Recall that Ethernet is a shared technologybull Everyone has access to the wires bull Users contend with collisions and the MAC

layer protocol dealt with these collisionsndash Note ndash This is with traditional cable and Hubs

bull Review characteristics of Ethernet to better understand 80211 wireless LANs

Ethernet Recap

bull Classic Ethernet bull One long cable 500 meter max segmentbull Snaked around building as single long cablebull All computers attached

bull Thick Ethernetbull Began as thick yellow cable marked every

25 meters to show computer attachments

bull Thin Ethernetbull Thinner bent more easily connections with

BNC connectorsbull Cheaper to install 185 meter max segment

Ethernet Recap

bull Ethernet could contain multiple segments and multiple repeaters

bull Used CSMACD for shared media bull What does CSMACD stand for

Carrier Sense Multiple AccessCollision Detection

bull Review this

13

CSMACD Protocol

All hosts transmit amp receive on one channelPackets are of variable size

When a host has a packet to transmit1 Carrier Sense Check that the line is quiet before transmitting2 Collision Detection Detect collision as soon as Possible Collision is detected stop transmitting wait a

random time then return to step 1

14

Ethernet CSMACD algorithm

Algorithm1 NIC receives datagram from network

layer creates frame

2 If NIC senses channel idle starts frame transmission

If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

Ethernet CSMACD algorithm

4 If NIC detects another transmission while transmitting aborts and sends jam signal5 After aborting NIC enters exponential backoff after mth collision NIC chooses a K small integer at random from 012hellip2m-1 NIC then waits K512 bit time

bull Returns to Step 2

15

16

Wireless Communication Systems amp Networking

- In terms of packet or frame delivery hellip

- What complicates wireless networking vs wired networking

17

Wireless Link Characteristics (1)

Differences from wired link hellip

bull Decreased signal strength Radio signal attenuates as it propagates through matter (path loss)

bull Interference from other sources Standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well

bull Multipath propagation Radio signal reflects off objects ground arriving ad destination at slightly different times

hellip make communication across link much more ldquodifficultrdquo

18

80211 Medium Access Controlbull MAC layer has three functions

1 Reliable data deliverybull Different from Ethernet wireless LANs

suffer from considerable unreliability

2 Access controlbull Distributed accessbull Centralized access

3 Security

19

Medium Access Control

bull Two sublayers

Lower sublayer Distributed Coordination Function (DCF)

bull Uses a contention algorithm to provide access to all traffic

Higher sublayer Point Coordination Function (PCF)

bull Uses a centralized algorithmbull Contention freebull Implemented on top of DCF

bull Remark PCF has not been popularly implemented in todayrsquos 80211 products DCF is widely used

Ethernet vs Wireless

Ethernet ndash Waits for ether to be silent and transmits

If doesnt get a sense of noise while transmitting assumes frame got through

Wireless ndash Collision detection doesnt work and instead uses Collision Avoidance

Wireless Collision Avoidance

Steps

Have a frame to send

Wait a random backoff time until channel is idle

Sense it is idle for short time called DIFS period

Sends frame if gets through destination sends an ACK

Lack of an ACK means frame failed

Sender then doubles backoff time tries again

Continues as in Ethernet until frame succeeds

22

IEEE 80211 MAC Protocol CSMACA

80211 sender1 if sense channel idle for DIFS then

transmit entire frame 2 if sense channel busy then

a) start random backoff timeb) timer counts down while channel idlec) transmit when timer expiresd) if no ACK increase random backoff

interval repeat 2

80211 receiver- if frame received OK

return ACK after SIFS (ACK needed due to hidden terminal problem)

sender receiver

DIFS

data

SIFS

ACK

Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

23

80211 Frames have Timers

Network Allocation Vector (NAV) timer NAV is set when a frame sequence is

sent Says how long a sequence will take so

other stations have an idea when the medium will be available

For example a NAV for a data frame will also include the ACK back

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 4: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

IEEE 802 Series of LAN Standards

802 standards free to download from httpstandardsieeeorggetieee802

WiMAX

IEEE 802 Standard

Complete specification of 802 standard

5

6

IEEE 80211 Protocol Architecture

Physical Layer

7

802 LayeringMedia Access Control (MAC) LayerMAC layer standards ensure that only one can transmit at a time

bull Reduces collisions amp unreadable transmissions

Also defines frame formatWill be different for each flavor of 802 hellip

Logical Link Control (LLC) LayerAdds optional error correction (rarely used)Connects to next-higher-layer (internet)

8022 Logical Link Control Layer StandardIP IPX Etc

8023 8025 80211

8

80211 Physical Layerbull Issued in four stagesbull 1997 First part

bull IEEE 80211 bull Includes MAC layer and three physical layer

specificationsbull Two in 24-GHz band and one infraredbull All operating at 1 and 2 Mbps

bull 1999 Two additional partsbull IEEE 80211a

bull 5-GHz band data rate up to 54 Mbpsbull IEEE 80211b

bull 24-GHz band data rate at 55 and 11 Mbpsbull 2002 Most recent

bull IEEE 80211g extends IEEE 80211b to higher data rates up to 54 Mbps

bull At presentbull IEEE 80211n and 80211ac data rate up to hundreds

of Mbps

Review of Classical or Standard Ethernet

Review of Ethernet

bull Recall that Ethernet is a shared technologybull Everyone has access to the wires bull Users contend with collisions and the MAC

layer protocol dealt with these collisionsndash Note ndash This is with traditional cable and Hubs

bull Review characteristics of Ethernet to better understand 80211 wireless LANs

Ethernet Recap

bull Classic Ethernet bull One long cable 500 meter max segmentbull Snaked around building as single long cablebull All computers attached

bull Thick Ethernetbull Began as thick yellow cable marked every

25 meters to show computer attachments

bull Thin Ethernetbull Thinner bent more easily connections with

BNC connectorsbull Cheaper to install 185 meter max segment

Ethernet Recap

bull Ethernet could contain multiple segments and multiple repeaters

bull Used CSMACD for shared media bull What does CSMACD stand for

Carrier Sense Multiple AccessCollision Detection

bull Review this

13

CSMACD Protocol

All hosts transmit amp receive on one channelPackets are of variable size

When a host has a packet to transmit1 Carrier Sense Check that the line is quiet before transmitting2 Collision Detection Detect collision as soon as Possible Collision is detected stop transmitting wait a

random time then return to step 1

14

Ethernet CSMACD algorithm

Algorithm1 NIC receives datagram from network

layer creates frame

2 If NIC senses channel idle starts frame transmission

If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

Ethernet CSMACD algorithm

4 If NIC detects another transmission while transmitting aborts and sends jam signal5 After aborting NIC enters exponential backoff after mth collision NIC chooses a K small integer at random from 012hellip2m-1 NIC then waits K512 bit time

bull Returns to Step 2

15

16

Wireless Communication Systems amp Networking

- In terms of packet or frame delivery hellip

- What complicates wireless networking vs wired networking

17

Wireless Link Characteristics (1)

Differences from wired link hellip

bull Decreased signal strength Radio signal attenuates as it propagates through matter (path loss)

bull Interference from other sources Standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well

bull Multipath propagation Radio signal reflects off objects ground arriving ad destination at slightly different times

hellip make communication across link much more ldquodifficultrdquo

18

80211 Medium Access Controlbull MAC layer has three functions

1 Reliable data deliverybull Different from Ethernet wireless LANs

suffer from considerable unreliability

2 Access controlbull Distributed accessbull Centralized access

3 Security

19

Medium Access Control

bull Two sublayers

Lower sublayer Distributed Coordination Function (DCF)

bull Uses a contention algorithm to provide access to all traffic

Higher sublayer Point Coordination Function (PCF)

bull Uses a centralized algorithmbull Contention freebull Implemented on top of DCF

bull Remark PCF has not been popularly implemented in todayrsquos 80211 products DCF is widely used

Ethernet vs Wireless

Ethernet ndash Waits for ether to be silent and transmits

If doesnt get a sense of noise while transmitting assumes frame got through

Wireless ndash Collision detection doesnt work and instead uses Collision Avoidance

Wireless Collision Avoidance

Steps

Have a frame to send

Wait a random backoff time until channel is idle

Sense it is idle for short time called DIFS period

Sends frame if gets through destination sends an ACK

Lack of an ACK means frame failed

Sender then doubles backoff time tries again

Continues as in Ethernet until frame succeeds

22

IEEE 80211 MAC Protocol CSMACA

80211 sender1 if sense channel idle for DIFS then

transmit entire frame 2 if sense channel busy then

a) start random backoff timeb) timer counts down while channel idlec) transmit when timer expiresd) if no ACK increase random backoff

interval repeat 2

80211 receiver- if frame received OK

return ACK after SIFS (ACK needed due to hidden terminal problem)

sender receiver

DIFS

data

SIFS

ACK

Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

23

80211 Frames have Timers

Network Allocation Vector (NAV) timer NAV is set when a frame sequence is

sent Says how long a sequence will take so

other stations have an idea when the medium will be available

For example a NAV for a data frame will also include the ACK back

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 5: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

IEEE 802 Standard

Complete specification of 802 standard

5

6

IEEE 80211 Protocol Architecture

Physical Layer

7

802 LayeringMedia Access Control (MAC) LayerMAC layer standards ensure that only one can transmit at a time

bull Reduces collisions amp unreadable transmissions

Also defines frame formatWill be different for each flavor of 802 hellip

Logical Link Control (LLC) LayerAdds optional error correction (rarely used)Connects to next-higher-layer (internet)

8022 Logical Link Control Layer StandardIP IPX Etc

8023 8025 80211

8

80211 Physical Layerbull Issued in four stagesbull 1997 First part

bull IEEE 80211 bull Includes MAC layer and three physical layer

specificationsbull Two in 24-GHz band and one infraredbull All operating at 1 and 2 Mbps

bull 1999 Two additional partsbull IEEE 80211a

bull 5-GHz band data rate up to 54 Mbpsbull IEEE 80211b

bull 24-GHz band data rate at 55 and 11 Mbpsbull 2002 Most recent

bull IEEE 80211g extends IEEE 80211b to higher data rates up to 54 Mbps

bull At presentbull IEEE 80211n and 80211ac data rate up to hundreds

of Mbps

Review of Classical or Standard Ethernet

Review of Ethernet

bull Recall that Ethernet is a shared technologybull Everyone has access to the wires bull Users contend with collisions and the MAC

layer protocol dealt with these collisionsndash Note ndash This is with traditional cable and Hubs

bull Review characteristics of Ethernet to better understand 80211 wireless LANs

Ethernet Recap

bull Classic Ethernet bull One long cable 500 meter max segmentbull Snaked around building as single long cablebull All computers attached

bull Thick Ethernetbull Began as thick yellow cable marked every

25 meters to show computer attachments

bull Thin Ethernetbull Thinner bent more easily connections with

BNC connectorsbull Cheaper to install 185 meter max segment

Ethernet Recap

bull Ethernet could contain multiple segments and multiple repeaters

bull Used CSMACD for shared media bull What does CSMACD stand for

Carrier Sense Multiple AccessCollision Detection

bull Review this

13

CSMACD Protocol

All hosts transmit amp receive on one channelPackets are of variable size

When a host has a packet to transmit1 Carrier Sense Check that the line is quiet before transmitting2 Collision Detection Detect collision as soon as Possible Collision is detected stop transmitting wait a

random time then return to step 1

14

Ethernet CSMACD algorithm

Algorithm1 NIC receives datagram from network

layer creates frame

2 If NIC senses channel idle starts frame transmission

If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

Ethernet CSMACD algorithm

4 If NIC detects another transmission while transmitting aborts and sends jam signal5 After aborting NIC enters exponential backoff after mth collision NIC chooses a K small integer at random from 012hellip2m-1 NIC then waits K512 bit time

bull Returns to Step 2

15

16

Wireless Communication Systems amp Networking

- In terms of packet or frame delivery hellip

- What complicates wireless networking vs wired networking

17

Wireless Link Characteristics (1)

Differences from wired link hellip

bull Decreased signal strength Radio signal attenuates as it propagates through matter (path loss)

bull Interference from other sources Standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well

bull Multipath propagation Radio signal reflects off objects ground arriving ad destination at slightly different times

hellip make communication across link much more ldquodifficultrdquo

18

80211 Medium Access Controlbull MAC layer has three functions

1 Reliable data deliverybull Different from Ethernet wireless LANs

suffer from considerable unreliability

2 Access controlbull Distributed accessbull Centralized access

3 Security

19

Medium Access Control

bull Two sublayers

Lower sublayer Distributed Coordination Function (DCF)

bull Uses a contention algorithm to provide access to all traffic

Higher sublayer Point Coordination Function (PCF)

bull Uses a centralized algorithmbull Contention freebull Implemented on top of DCF

bull Remark PCF has not been popularly implemented in todayrsquos 80211 products DCF is widely used

Ethernet vs Wireless

Ethernet ndash Waits for ether to be silent and transmits

If doesnt get a sense of noise while transmitting assumes frame got through

Wireless ndash Collision detection doesnt work and instead uses Collision Avoidance

Wireless Collision Avoidance

Steps

Have a frame to send

Wait a random backoff time until channel is idle

Sense it is idle for short time called DIFS period

Sends frame if gets through destination sends an ACK

Lack of an ACK means frame failed

Sender then doubles backoff time tries again

Continues as in Ethernet until frame succeeds

22

IEEE 80211 MAC Protocol CSMACA

80211 sender1 if sense channel idle for DIFS then

transmit entire frame 2 if sense channel busy then

a) start random backoff timeb) timer counts down while channel idlec) transmit when timer expiresd) if no ACK increase random backoff

interval repeat 2

80211 receiver- if frame received OK

return ACK after SIFS (ACK needed due to hidden terminal problem)

sender receiver

DIFS

data

SIFS

ACK

Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

23

80211 Frames have Timers

Network Allocation Vector (NAV) timer NAV is set when a frame sequence is

sent Says how long a sequence will take so

other stations have an idea when the medium will be available

For example a NAV for a data frame will also include the ACK back

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 6: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

6

IEEE 80211 Protocol Architecture

Physical Layer

7

802 LayeringMedia Access Control (MAC) LayerMAC layer standards ensure that only one can transmit at a time

bull Reduces collisions amp unreadable transmissions

Also defines frame formatWill be different for each flavor of 802 hellip

Logical Link Control (LLC) LayerAdds optional error correction (rarely used)Connects to next-higher-layer (internet)

8022 Logical Link Control Layer StandardIP IPX Etc

8023 8025 80211

8

80211 Physical Layerbull Issued in four stagesbull 1997 First part

bull IEEE 80211 bull Includes MAC layer and three physical layer

specificationsbull Two in 24-GHz band and one infraredbull All operating at 1 and 2 Mbps

bull 1999 Two additional partsbull IEEE 80211a

bull 5-GHz band data rate up to 54 Mbpsbull IEEE 80211b

bull 24-GHz band data rate at 55 and 11 Mbpsbull 2002 Most recent

bull IEEE 80211g extends IEEE 80211b to higher data rates up to 54 Mbps

bull At presentbull IEEE 80211n and 80211ac data rate up to hundreds

of Mbps

Review of Classical or Standard Ethernet

Review of Ethernet

bull Recall that Ethernet is a shared technologybull Everyone has access to the wires bull Users contend with collisions and the MAC

layer protocol dealt with these collisionsndash Note ndash This is with traditional cable and Hubs

bull Review characteristics of Ethernet to better understand 80211 wireless LANs

Ethernet Recap

bull Classic Ethernet bull One long cable 500 meter max segmentbull Snaked around building as single long cablebull All computers attached

bull Thick Ethernetbull Began as thick yellow cable marked every

25 meters to show computer attachments

bull Thin Ethernetbull Thinner bent more easily connections with

BNC connectorsbull Cheaper to install 185 meter max segment

Ethernet Recap

bull Ethernet could contain multiple segments and multiple repeaters

bull Used CSMACD for shared media bull What does CSMACD stand for

Carrier Sense Multiple AccessCollision Detection

bull Review this

13

CSMACD Protocol

All hosts transmit amp receive on one channelPackets are of variable size

When a host has a packet to transmit1 Carrier Sense Check that the line is quiet before transmitting2 Collision Detection Detect collision as soon as Possible Collision is detected stop transmitting wait a

random time then return to step 1

14

Ethernet CSMACD algorithm

Algorithm1 NIC receives datagram from network

layer creates frame

2 If NIC senses channel idle starts frame transmission

If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

Ethernet CSMACD algorithm

4 If NIC detects another transmission while transmitting aborts and sends jam signal5 After aborting NIC enters exponential backoff after mth collision NIC chooses a K small integer at random from 012hellip2m-1 NIC then waits K512 bit time

bull Returns to Step 2

15

16

Wireless Communication Systems amp Networking

- In terms of packet or frame delivery hellip

- What complicates wireless networking vs wired networking

17

Wireless Link Characteristics (1)

Differences from wired link hellip

bull Decreased signal strength Radio signal attenuates as it propagates through matter (path loss)

bull Interference from other sources Standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well

bull Multipath propagation Radio signal reflects off objects ground arriving ad destination at slightly different times

hellip make communication across link much more ldquodifficultrdquo

18

80211 Medium Access Controlbull MAC layer has three functions

1 Reliable data deliverybull Different from Ethernet wireless LANs

suffer from considerable unreliability

2 Access controlbull Distributed accessbull Centralized access

3 Security

19

Medium Access Control

bull Two sublayers

Lower sublayer Distributed Coordination Function (DCF)

bull Uses a contention algorithm to provide access to all traffic

Higher sublayer Point Coordination Function (PCF)

bull Uses a centralized algorithmbull Contention freebull Implemented on top of DCF

bull Remark PCF has not been popularly implemented in todayrsquos 80211 products DCF is widely used

Ethernet vs Wireless

Ethernet ndash Waits for ether to be silent and transmits

If doesnt get a sense of noise while transmitting assumes frame got through

Wireless ndash Collision detection doesnt work and instead uses Collision Avoidance

Wireless Collision Avoidance

Steps

Have a frame to send

Wait a random backoff time until channel is idle

Sense it is idle for short time called DIFS period

Sends frame if gets through destination sends an ACK

Lack of an ACK means frame failed

Sender then doubles backoff time tries again

Continues as in Ethernet until frame succeeds

22

IEEE 80211 MAC Protocol CSMACA

80211 sender1 if sense channel idle for DIFS then

transmit entire frame 2 if sense channel busy then

a) start random backoff timeb) timer counts down while channel idlec) transmit when timer expiresd) if no ACK increase random backoff

interval repeat 2

80211 receiver- if frame received OK

return ACK after SIFS (ACK needed due to hidden terminal problem)

sender receiver

DIFS

data

SIFS

ACK

Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

23

80211 Frames have Timers

Network Allocation Vector (NAV) timer NAV is set when a frame sequence is

sent Says how long a sequence will take so

other stations have an idea when the medium will be available

For example a NAV for a data frame will also include the ACK back

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 7: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

7

802 LayeringMedia Access Control (MAC) LayerMAC layer standards ensure that only one can transmit at a time

bull Reduces collisions amp unreadable transmissions

Also defines frame formatWill be different for each flavor of 802 hellip

Logical Link Control (LLC) LayerAdds optional error correction (rarely used)Connects to next-higher-layer (internet)

8022 Logical Link Control Layer StandardIP IPX Etc

8023 8025 80211

8

80211 Physical Layerbull Issued in four stagesbull 1997 First part

bull IEEE 80211 bull Includes MAC layer and three physical layer

specificationsbull Two in 24-GHz band and one infraredbull All operating at 1 and 2 Mbps

bull 1999 Two additional partsbull IEEE 80211a

bull 5-GHz band data rate up to 54 Mbpsbull IEEE 80211b

bull 24-GHz band data rate at 55 and 11 Mbpsbull 2002 Most recent

bull IEEE 80211g extends IEEE 80211b to higher data rates up to 54 Mbps

bull At presentbull IEEE 80211n and 80211ac data rate up to hundreds

of Mbps

Review of Classical or Standard Ethernet

Review of Ethernet

bull Recall that Ethernet is a shared technologybull Everyone has access to the wires bull Users contend with collisions and the MAC

layer protocol dealt with these collisionsndash Note ndash This is with traditional cable and Hubs

bull Review characteristics of Ethernet to better understand 80211 wireless LANs

Ethernet Recap

bull Classic Ethernet bull One long cable 500 meter max segmentbull Snaked around building as single long cablebull All computers attached

bull Thick Ethernetbull Began as thick yellow cable marked every

25 meters to show computer attachments

bull Thin Ethernetbull Thinner bent more easily connections with

BNC connectorsbull Cheaper to install 185 meter max segment

Ethernet Recap

bull Ethernet could contain multiple segments and multiple repeaters

bull Used CSMACD for shared media bull What does CSMACD stand for

Carrier Sense Multiple AccessCollision Detection

bull Review this

13

CSMACD Protocol

All hosts transmit amp receive on one channelPackets are of variable size

When a host has a packet to transmit1 Carrier Sense Check that the line is quiet before transmitting2 Collision Detection Detect collision as soon as Possible Collision is detected stop transmitting wait a

random time then return to step 1

14

Ethernet CSMACD algorithm

Algorithm1 NIC receives datagram from network

layer creates frame

2 If NIC senses channel idle starts frame transmission

If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

Ethernet CSMACD algorithm

4 If NIC detects another transmission while transmitting aborts and sends jam signal5 After aborting NIC enters exponential backoff after mth collision NIC chooses a K small integer at random from 012hellip2m-1 NIC then waits K512 bit time

bull Returns to Step 2

15

16

Wireless Communication Systems amp Networking

- In terms of packet or frame delivery hellip

- What complicates wireless networking vs wired networking

17

Wireless Link Characteristics (1)

Differences from wired link hellip

bull Decreased signal strength Radio signal attenuates as it propagates through matter (path loss)

bull Interference from other sources Standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well

bull Multipath propagation Radio signal reflects off objects ground arriving ad destination at slightly different times

hellip make communication across link much more ldquodifficultrdquo

18

80211 Medium Access Controlbull MAC layer has three functions

1 Reliable data deliverybull Different from Ethernet wireless LANs

suffer from considerable unreliability

2 Access controlbull Distributed accessbull Centralized access

3 Security

19

Medium Access Control

bull Two sublayers

Lower sublayer Distributed Coordination Function (DCF)

bull Uses a contention algorithm to provide access to all traffic

Higher sublayer Point Coordination Function (PCF)

bull Uses a centralized algorithmbull Contention freebull Implemented on top of DCF

bull Remark PCF has not been popularly implemented in todayrsquos 80211 products DCF is widely used

Ethernet vs Wireless

Ethernet ndash Waits for ether to be silent and transmits

If doesnt get a sense of noise while transmitting assumes frame got through

Wireless ndash Collision detection doesnt work and instead uses Collision Avoidance

Wireless Collision Avoidance

Steps

Have a frame to send

Wait a random backoff time until channel is idle

Sense it is idle for short time called DIFS period

Sends frame if gets through destination sends an ACK

Lack of an ACK means frame failed

Sender then doubles backoff time tries again

Continues as in Ethernet until frame succeeds

22

IEEE 80211 MAC Protocol CSMACA

80211 sender1 if sense channel idle for DIFS then

transmit entire frame 2 if sense channel busy then

a) start random backoff timeb) timer counts down while channel idlec) transmit when timer expiresd) if no ACK increase random backoff

interval repeat 2

80211 receiver- if frame received OK

return ACK after SIFS (ACK needed due to hidden terminal problem)

sender receiver

DIFS

data

SIFS

ACK

Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

23

80211 Frames have Timers

Network Allocation Vector (NAV) timer NAV is set when a frame sequence is

sent Says how long a sequence will take so

other stations have an idea when the medium will be available

For example a NAV for a data frame will also include the ACK back

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 8: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

8

80211 Physical Layerbull Issued in four stagesbull 1997 First part

bull IEEE 80211 bull Includes MAC layer and three physical layer

specificationsbull Two in 24-GHz band and one infraredbull All operating at 1 and 2 Mbps

bull 1999 Two additional partsbull IEEE 80211a

bull 5-GHz band data rate up to 54 Mbpsbull IEEE 80211b

bull 24-GHz band data rate at 55 and 11 Mbpsbull 2002 Most recent

bull IEEE 80211g extends IEEE 80211b to higher data rates up to 54 Mbps

bull At presentbull IEEE 80211n and 80211ac data rate up to hundreds

of Mbps

Review of Classical or Standard Ethernet

Review of Ethernet

bull Recall that Ethernet is a shared technologybull Everyone has access to the wires bull Users contend with collisions and the MAC

layer protocol dealt with these collisionsndash Note ndash This is with traditional cable and Hubs

bull Review characteristics of Ethernet to better understand 80211 wireless LANs

Ethernet Recap

bull Classic Ethernet bull One long cable 500 meter max segmentbull Snaked around building as single long cablebull All computers attached

bull Thick Ethernetbull Began as thick yellow cable marked every

25 meters to show computer attachments

bull Thin Ethernetbull Thinner bent more easily connections with

BNC connectorsbull Cheaper to install 185 meter max segment

Ethernet Recap

bull Ethernet could contain multiple segments and multiple repeaters

bull Used CSMACD for shared media bull What does CSMACD stand for

Carrier Sense Multiple AccessCollision Detection

bull Review this

13

CSMACD Protocol

All hosts transmit amp receive on one channelPackets are of variable size

When a host has a packet to transmit1 Carrier Sense Check that the line is quiet before transmitting2 Collision Detection Detect collision as soon as Possible Collision is detected stop transmitting wait a

random time then return to step 1

14

Ethernet CSMACD algorithm

Algorithm1 NIC receives datagram from network

layer creates frame

2 If NIC senses channel idle starts frame transmission

If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

Ethernet CSMACD algorithm

4 If NIC detects another transmission while transmitting aborts and sends jam signal5 After aborting NIC enters exponential backoff after mth collision NIC chooses a K small integer at random from 012hellip2m-1 NIC then waits K512 bit time

bull Returns to Step 2

15

16

Wireless Communication Systems amp Networking

- In terms of packet or frame delivery hellip

- What complicates wireless networking vs wired networking

17

Wireless Link Characteristics (1)

Differences from wired link hellip

bull Decreased signal strength Radio signal attenuates as it propagates through matter (path loss)

bull Interference from other sources Standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well

bull Multipath propagation Radio signal reflects off objects ground arriving ad destination at slightly different times

hellip make communication across link much more ldquodifficultrdquo

18

80211 Medium Access Controlbull MAC layer has three functions

1 Reliable data deliverybull Different from Ethernet wireless LANs

suffer from considerable unreliability

2 Access controlbull Distributed accessbull Centralized access

3 Security

19

Medium Access Control

bull Two sublayers

Lower sublayer Distributed Coordination Function (DCF)

bull Uses a contention algorithm to provide access to all traffic

Higher sublayer Point Coordination Function (PCF)

bull Uses a centralized algorithmbull Contention freebull Implemented on top of DCF

bull Remark PCF has not been popularly implemented in todayrsquos 80211 products DCF is widely used

Ethernet vs Wireless

Ethernet ndash Waits for ether to be silent and transmits

If doesnt get a sense of noise while transmitting assumes frame got through

Wireless ndash Collision detection doesnt work and instead uses Collision Avoidance

Wireless Collision Avoidance

Steps

Have a frame to send

Wait a random backoff time until channel is idle

Sense it is idle for short time called DIFS period

Sends frame if gets through destination sends an ACK

Lack of an ACK means frame failed

Sender then doubles backoff time tries again

Continues as in Ethernet until frame succeeds

22

IEEE 80211 MAC Protocol CSMACA

80211 sender1 if sense channel idle for DIFS then

transmit entire frame 2 if sense channel busy then

a) start random backoff timeb) timer counts down while channel idlec) transmit when timer expiresd) if no ACK increase random backoff

interval repeat 2

80211 receiver- if frame received OK

return ACK after SIFS (ACK needed due to hidden terminal problem)

sender receiver

DIFS

data

SIFS

ACK

Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

23

80211 Frames have Timers

Network Allocation Vector (NAV) timer NAV is set when a frame sequence is

sent Says how long a sequence will take so

other stations have an idea when the medium will be available

For example a NAV for a data frame will also include the ACK back

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 9: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

Review of Classical or Standard Ethernet

Review of Ethernet

bull Recall that Ethernet is a shared technologybull Everyone has access to the wires bull Users contend with collisions and the MAC

layer protocol dealt with these collisionsndash Note ndash This is with traditional cable and Hubs

bull Review characteristics of Ethernet to better understand 80211 wireless LANs

Ethernet Recap

bull Classic Ethernet bull One long cable 500 meter max segmentbull Snaked around building as single long cablebull All computers attached

bull Thick Ethernetbull Began as thick yellow cable marked every

25 meters to show computer attachments

bull Thin Ethernetbull Thinner bent more easily connections with

BNC connectorsbull Cheaper to install 185 meter max segment

Ethernet Recap

bull Ethernet could contain multiple segments and multiple repeaters

bull Used CSMACD for shared media bull What does CSMACD stand for

Carrier Sense Multiple AccessCollision Detection

bull Review this

13

CSMACD Protocol

All hosts transmit amp receive on one channelPackets are of variable size

When a host has a packet to transmit1 Carrier Sense Check that the line is quiet before transmitting2 Collision Detection Detect collision as soon as Possible Collision is detected stop transmitting wait a

random time then return to step 1

14

Ethernet CSMACD algorithm

Algorithm1 NIC receives datagram from network

layer creates frame

2 If NIC senses channel idle starts frame transmission

If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

Ethernet CSMACD algorithm

4 If NIC detects another transmission while transmitting aborts and sends jam signal5 After aborting NIC enters exponential backoff after mth collision NIC chooses a K small integer at random from 012hellip2m-1 NIC then waits K512 bit time

bull Returns to Step 2

15

16

Wireless Communication Systems amp Networking

- In terms of packet or frame delivery hellip

- What complicates wireless networking vs wired networking

17

Wireless Link Characteristics (1)

Differences from wired link hellip

bull Decreased signal strength Radio signal attenuates as it propagates through matter (path loss)

bull Interference from other sources Standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well

bull Multipath propagation Radio signal reflects off objects ground arriving ad destination at slightly different times

hellip make communication across link much more ldquodifficultrdquo

18

80211 Medium Access Controlbull MAC layer has three functions

1 Reliable data deliverybull Different from Ethernet wireless LANs

suffer from considerable unreliability

2 Access controlbull Distributed accessbull Centralized access

3 Security

19

Medium Access Control

bull Two sublayers

Lower sublayer Distributed Coordination Function (DCF)

bull Uses a contention algorithm to provide access to all traffic

Higher sublayer Point Coordination Function (PCF)

bull Uses a centralized algorithmbull Contention freebull Implemented on top of DCF

bull Remark PCF has not been popularly implemented in todayrsquos 80211 products DCF is widely used

Ethernet vs Wireless

Ethernet ndash Waits for ether to be silent and transmits

If doesnt get a sense of noise while transmitting assumes frame got through

Wireless ndash Collision detection doesnt work and instead uses Collision Avoidance

Wireless Collision Avoidance

Steps

Have a frame to send

Wait a random backoff time until channel is idle

Sense it is idle for short time called DIFS period

Sends frame if gets through destination sends an ACK

Lack of an ACK means frame failed

Sender then doubles backoff time tries again

Continues as in Ethernet until frame succeeds

22

IEEE 80211 MAC Protocol CSMACA

80211 sender1 if sense channel idle for DIFS then

transmit entire frame 2 if sense channel busy then

a) start random backoff timeb) timer counts down while channel idlec) transmit when timer expiresd) if no ACK increase random backoff

interval repeat 2

80211 receiver- if frame received OK

return ACK after SIFS (ACK needed due to hidden terminal problem)

sender receiver

DIFS

data

SIFS

ACK

Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

23

80211 Frames have Timers

Network Allocation Vector (NAV) timer NAV is set when a frame sequence is

sent Says how long a sequence will take so

other stations have an idea when the medium will be available

For example a NAV for a data frame will also include the ACK back

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 10: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

Review of Ethernet

bull Recall that Ethernet is a shared technologybull Everyone has access to the wires bull Users contend with collisions and the MAC

layer protocol dealt with these collisionsndash Note ndash This is with traditional cable and Hubs

bull Review characteristics of Ethernet to better understand 80211 wireless LANs

Ethernet Recap

bull Classic Ethernet bull One long cable 500 meter max segmentbull Snaked around building as single long cablebull All computers attached

bull Thick Ethernetbull Began as thick yellow cable marked every

25 meters to show computer attachments

bull Thin Ethernetbull Thinner bent more easily connections with

BNC connectorsbull Cheaper to install 185 meter max segment

Ethernet Recap

bull Ethernet could contain multiple segments and multiple repeaters

bull Used CSMACD for shared media bull What does CSMACD stand for

Carrier Sense Multiple AccessCollision Detection

bull Review this

13

CSMACD Protocol

All hosts transmit amp receive on one channelPackets are of variable size

When a host has a packet to transmit1 Carrier Sense Check that the line is quiet before transmitting2 Collision Detection Detect collision as soon as Possible Collision is detected stop transmitting wait a

random time then return to step 1

14

Ethernet CSMACD algorithm

Algorithm1 NIC receives datagram from network

layer creates frame

2 If NIC senses channel idle starts frame transmission

If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

Ethernet CSMACD algorithm

4 If NIC detects another transmission while transmitting aborts and sends jam signal5 After aborting NIC enters exponential backoff after mth collision NIC chooses a K small integer at random from 012hellip2m-1 NIC then waits K512 bit time

bull Returns to Step 2

15

16

Wireless Communication Systems amp Networking

- In terms of packet or frame delivery hellip

- What complicates wireless networking vs wired networking

17

Wireless Link Characteristics (1)

Differences from wired link hellip

bull Decreased signal strength Radio signal attenuates as it propagates through matter (path loss)

bull Interference from other sources Standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well

bull Multipath propagation Radio signal reflects off objects ground arriving ad destination at slightly different times

hellip make communication across link much more ldquodifficultrdquo

18

80211 Medium Access Controlbull MAC layer has three functions

1 Reliable data deliverybull Different from Ethernet wireless LANs

suffer from considerable unreliability

2 Access controlbull Distributed accessbull Centralized access

3 Security

19

Medium Access Control

bull Two sublayers

Lower sublayer Distributed Coordination Function (DCF)

bull Uses a contention algorithm to provide access to all traffic

Higher sublayer Point Coordination Function (PCF)

bull Uses a centralized algorithmbull Contention freebull Implemented on top of DCF

bull Remark PCF has not been popularly implemented in todayrsquos 80211 products DCF is widely used

Ethernet vs Wireless

Ethernet ndash Waits for ether to be silent and transmits

If doesnt get a sense of noise while transmitting assumes frame got through

Wireless ndash Collision detection doesnt work and instead uses Collision Avoidance

Wireless Collision Avoidance

Steps

Have a frame to send

Wait a random backoff time until channel is idle

Sense it is idle for short time called DIFS period

Sends frame if gets through destination sends an ACK

Lack of an ACK means frame failed

Sender then doubles backoff time tries again

Continues as in Ethernet until frame succeeds

22

IEEE 80211 MAC Protocol CSMACA

80211 sender1 if sense channel idle for DIFS then

transmit entire frame 2 if sense channel busy then

a) start random backoff timeb) timer counts down while channel idlec) transmit when timer expiresd) if no ACK increase random backoff

interval repeat 2

80211 receiver- if frame received OK

return ACK after SIFS (ACK needed due to hidden terminal problem)

sender receiver

DIFS

data

SIFS

ACK

Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

23

80211 Frames have Timers

Network Allocation Vector (NAV) timer NAV is set when a frame sequence is

sent Says how long a sequence will take so

other stations have an idea when the medium will be available

For example a NAV for a data frame will also include the ACK back

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 11: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

Ethernet Recap

bull Classic Ethernet bull One long cable 500 meter max segmentbull Snaked around building as single long cablebull All computers attached

bull Thick Ethernetbull Began as thick yellow cable marked every

25 meters to show computer attachments

bull Thin Ethernetbull Thinner bent more easily connections with

BNC connectorsbull Cheaper to install 185 meter max segment

Ethernet Recap

bull Ethernet could contain multiple segments and multiple repeaters

bull Used CSMACD for shared media bull What does CSMACD stand for

Carrier Sense Multiple AccessCollision Detection

bull Review this

13

CSMACD Protocol

All hosts transmit amp receive on one channelPackets are of variable size

When a host has a packet to transmit1 Carrier Sense Check that the line is quiet before transmitting2 Collision Detection Detect collision as soon as Possible Collision is detected stop transmitting wait a

random time then return to step 1

14

Ethernet CSMACD algorithm

Algorithm1 NIC receives datagram from network

layer creates frame

2 If NIC senses channel idle starts frame transmission

If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

Ethernet CSMACD algorithm

4 If NIC detects another transmission while transmitting aborts and sends jam signal5 After aborting NIC enters exponential backoff after mth collision NIC chooses a K small integer at random from 012hellip2m-1 NIC then waits K512 bit time

bull Returns to Step 2

15

16

Wireless Communication Systems amp Networking

- In terms of packet or frame delivery hellip

- What complicates wireless networking vs wired networking

17

Wireless Link Characteristics (1)

Differences from wired link hellip

bull Decreased signal strength Radio signal attenuates as it propagates through matter (path loss)

bull Interference from other sources Standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well

bull Multipath propagation Radio signal reflects off objects ground arriving ad destination at slightly different times

hellip make communication across link much more ldquodifficultrdquo

18

80211 Medium Access Controlbull MAC layer has three functions

1 Reliable data deliverybull Different from Ethernet wireless LANs

suffer from considerable unreliability

2 Access controlbull Distributed accessbull Centralized access

3 Security

19

Medium Access Control

bull Two sublayers

Lower sublayer Distributed Coordination Function (DCF)

bull Uses a contention algorithm to provide access to all traffic

Higher sublayer Point Coordination Function (PCF)

bull Uses a centralized algorithmbull Contention freebull Implemented on top of DCF

bull Remark PCF has not been popularly implemented in todayrsquos 80211 products DCF is widely used

Ethernet vs Wireless

Ethernet ndash Waits for ether to be silent and transmits

If doesnt get a sense of noise while transmitting assumes frame got through

Wireless ndash Collision detection doesnt work and instead uses Collision Avoidance

Wireless Collision Avoidance

Steps

Have a frame to send

Wait a random backoff time until channel is idle

Sense it is idle for short time called DIFS period

Sends frame if gets through destination sends an ACK

Lack of an ACK means frame failed

Sender then doubles backoff time tries again

Continues as in Ethernet until frame succeeds

22

IEEE 80211 MAC Protocol CSMACA

80211 sender1 if sense channel idle for DIFS then

transmit entire frame 2 if sense channel busy then

a) start random backoff timeb) timer counts down while channel idlec) transmit when timer expiresd) if no ACK increase random backoff

interval repeat 2

80211 receiver- if frame received OK

return ACK after SIFS (ACK needed due to hidden terminal problem)

sender receiver

DIFS

data

SIFS

ACK

Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

23

80211 Frames have Timers

Network Allocation Vector (NAV) timer NAV is set when a frame sequence is

sent Says how long a sequence will take so

other stations have an idea when the medium will be available

For example a NAV for a data frame will also include the ACK back

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 12: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

Ethernet Recap

bull Ethernet could contain multiple segments and multiple repeaters

bull Used CSMACD for shared media bull What does CSMACD stand for

Carrier Sense Multiple AccessCollision Detection

bull Review this

13

CSMACD Protocol

All hosts transmit amp receive on one channelPackets are of variable size

When a host has a packet to transmit1 Carrier Sense Check that the line is quiet before transmitting2 Collision Detection Detect collision as soon as Possible Collision is detected stop transmitting wait a

random time then return to step 1

14

Ethernet CSMACD algorithm

Algorithm1 NIC receives datagram from network

layer creates frame

2 If NIC senses channel idle starts frame transmission

If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

Ethernet CSMACD algorithm

4 If NIC detects another transmission while transmitting aborts and sends jam signal5 After aborting NIC enters exponential backoff after mth collision NIC chooses a K small integer at random from 012hellip2m-1 NIC then waits K512 bit time

bull Returns to Step 2

15

16

Wireless Communication Systems amp Networking

- In terms of packet or frame delivery hellip

- What complicates wireless networking vs wired networking

17

Wireless Link Characteristics (1)

Differences from wired link hellip

bull Decreased signal strength Radio signal attenuates as it propagates through matter (path loss)

bull Interference from other sources Standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well

bull Multipath propagation Radio signal reflects off objects ground arriving ad destination at slightly different times

hellip make communication across link much more ldquodifficultrdquo

18

80211 Medium Access Controlbull MAC layer has three functions

1 Reliable data deliverybull Different from Ethernet wireless LANs

suffer from considerable unreliability

2 Access controlbull Distributed accessbull Centralized access

3 Security

19

Medium Access Control

bull Two sublayers

Lower sublayer Distributed Coordination Function (DCF)

bull Uses a contention algorithm to provide access to all traffic

Higher sublayer Point Coordination Function (PCF)

bull Uses a centralized algorithmbull Contention freebull Implemented on top of DCF

bull Remark PCF has not been popularly implemented in todayrsquos 80211 products DCF is widely used

Ethernet vs Wireless

Ethernet ndash Waits for ether to be silent and transmits

If doesnt get a sense of noise while transmitting assumes frame got through

Wireless ndash Collision detection doesnt work and instead uses Collision Avoidance

Wireless Collision Avoidance

Steps

Have a frame to send

Wait a random backoff time until channel is idle

Sense it is idle for short time called DIFS period

Sends frame if gets through destination sends an ACK

Lack of an ACK means frame failed

Sender then doubles backoff time tries again

Continues as in Ethernet until frame succeeds

22

IEEE 80211 MAC Protocol CSMACA

80211 sender1 if sense channel idle for DIFS then

transmit entire frame 2 if sense channel busy then

a) start random backoff timeb) timer counts down while channel idlec) transmit when timer expiresd) if no ACK increase random backoff

interval repeat 2

80211 receiver- if frame received OK

return ACK after SIFS (ACK needed due to hidden terminal problem)

sender receiver

DIFS

data

SIFS

ACK

Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

23

80211 Frames have Timers

Network Allocation Vector (NAV) timer NAV is set when a frame sequence is

sent Says how long a sequence will take so

other stations have an idea when the medium will be available

For example a NAV for a data frame will also include the ACK back

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 13: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

13

CSMACD Protocol

All hosts transmit amp receive on one channelPackets are of variable size

When a host has a packet to transmit1 Carrier Sense Check that the line is quiet before transmitting2 Collision Detection Detect collision as soon as Possible Collision is detected stop transmitting wait a

random time then return to step 1

14

Ethernet CSMACD algorithm

Algorithm1 NIC receives datagram from network

layer creates frame

2 If NIC senses channel idle starts frame transmission

If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

Ethernet CSMACD algorithm

4 If NIC detects another transmission while transmitting aborts and sends jam signal5 After aborting NIC enters exponential backoff after mth collision NIC chooses a K small integer at random from 012hellip2m-1 NIC then waits K512 bit time

bull Returns to Step 2

15

16

Wireless Communication Systems amp Networking

- In terms of packet or frame delivery hellip

- What complicates wireless networking vs wired networking

17

Wireless Link Characteristics (1)

Differences from wired link hellip

bull Decreased signal strength Radio signal attenuates as it propagates through matter (path loss)

bull Interference from other sources Standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well

bull Multipath propagation Radio signal reflects off objects ground arriving ad destination at slightly different times

hellip make communication across link much more ldquodifficultrdquo

18

80211 Medium Access Controlbull MAC layer has three functions

1 Reliable data deliverybull Different from Ethernet wireless LANs

suffer from considerable unreliability

2 Access controlbull Distributed accessbull Centralized access

3 Security

19

Medium Access Control

bull Two sublayers

Lower sublayer Distributed Coordination Function (DCF)

bull Uses a contention algorithm to provide access to all traffic

Higher sublayer Point Coordination Function (PCF)

bull Uses a centralized algorithmbull Contention freebull Implemented on top of DCF

bull Remark PCF has not been popularly implemented in todayrsquos 80211 products DCF is widely used

Ethernet vs Wireless

Ethernet ndash Waits for ether to be silent and transmits

If doesnt get a sense of noise while transmitting assumes frame got through

Wireless ndash Collision detection doesnt work and instead uses Collision Avoidance

Wireless Collision Avoidance

Steps

Have a frame to send

Wait a random backoff time until channel is idle

Sense it is idle for short time called DIFS period

Sends frame if gets through destination sends an ACK

Lack of an ACK means frame failed

Sender then doubles backoff time tries again

Continues as in Ethernet until frame succeeds

22

IEEE 80211 MAC Protocol CSMACA

80211 sender1 if sense channel idle for DIFS then

transmit entire frame 2 if sense channel busy then

a) start random backoff timeb) timer counts down while channel idlec) transmit when timer expiresd) if no ACK increase random backoff

interval repeat 2

80211 receiver- if frame received OK

return ACK after SIFS (ACK needed due to hidden terminal problem)

sender receiver

DIFS

data

SIFS

ACK

Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

23

80211 Frames have Timers

Network Allocation Vector (NAV) timer NAV is set when a frame sequence is

sent Says how long a sequence will take so

other stations have an idea when the medium will be available

For example a NAV for a data frame will also include the ACK back

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 14: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

14

Ethernet CSMACD algorithm

Algorithm1 NIC receives datagram from network

layer creates frame

2 If NIC senses channel idle starts frame transmission

If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

Ethernet CSMACD algorithm

4 If NIC detects another transmission while transmitting aborts and sends jam signal5 After aborting NIC enters exponential backoff after mth collision NIC chooses a K small integer at random from 012hellip2m-1 NIC then waits K512 bit time

bull Returns to Step 2

15

16

Wireless Communication Systems amp Networking

- In terms of packet or frame delivery hellip

- What complicates wireless networking vs wired networking

17

Wireless Link Characteristics (1)

Differences from wired link hellip

bull Decreased signal strength Radio signal attenuates as it propagates through matter (path loss)

bull Interference from other sources Standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well

bull Multipath propagation Radio signal reflects off objects ground arriving ad destination at slightly different times

hellip make communication across link much more ldquodifficultrdquo

18

80211 Medium Access Controlbull MAC layer has three functions

1 Reliable data deliverybull Different from Ethernet wireless LANs

suffer from considerable unreliability

2 Access controlbull Distributed accessbull Centralized access

3 Security

19

Medium Access Control

bull Two sublayers

Lower sublayer Distributed Coordination Function (DCF)

bull Uses a contention algorithm to provide access to all traffic

Higher sublayer Point Coordination Function (PCF)

bull Uses a centralized algorithmbull Contention freebull Implemented on top of DCF

bull Remark PCF has not been popularly implemented in todayrsquos 80211 products DCF is widely used

Ethernet vs Wireless

Ethernet ndash Waits for ether to be silent and transmits

If doesnt get a sense of noise while transmitting assumes frame got through

Wireless ndash Collision detection doesnt work and instead uses Collision Avoidance

Wireless Collision Avoidance

Steps

Have a frame to send

Wait a random backoff time until channel is idle

Sense it is idle for short time called DIFS period

Sends frame if gets through destination sends an ACK

Lack of an ACK means frame failed

Sender then doubles backoff time tries again

Continues as in Ethernet until frame succeeds

22

IEEE 80211 MAC Protocol CSMACA

80211 sender1 if sense channel idle for DIFS then

transmit entire frame 2 if sense channel busy then

a) start random backoff timeb) timer counts down while channel idlec) transmit when timer expiresd) if no ACK increase random backoff

interval repeat 2

80211 receiver- if frame received OK

return ACK after SIFS (ACK needed due to hidden terminal problem)

sender receiver

DIFS

data

SIFS

ACK

Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

23

80211 Frames have Timers

Network Allocation Vector (NAV) timer NAV is set when a frame sequence is

sent Says how long a sequence will take so

other stations have an idea when the medium will be available

For example a NAV for a data frame will also include the ACK back

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 15: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

Ethernet CSMACD algorithm

4 If NIC detects another transmission while transmitting aborts and sends jam signal5 After aborting NIC enters exponential backoff after mth collision NIC chooses a K small integer at random from 012hellip2m-1 NIC then waits K512 bit time

bull Returns to Step 2

15

16

Wireless Communication Systems amp Networking

- In terms of packet or frame delivery hellip

- What complicates wireless networking vs wired networking

17

Wireless Link Characteristics (1)

Differences from wired link hellip

bull Decreased signal strength Radio signal attenuates as it propagates through matter (path loss)

bull Interference from other sources Standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well

bull Multipath propagation Radio signal reflects off objects ground arriving ad destination at slightly different times

hellip make communication across link much more ldquodifficultrdquo

18

80211 Medium Access Controlbull MAC layer has three functions

1 Reliable data deliverybull Different from Ethernet wireless LANs

suffer from considerable unreliability

2 Access controlbull Distributed accessbull Centralized access

3 Security

19

Medium Access Control

bull Two sublayers

Lower sublayer Distributed Coordination Function (DCF)

bull Uses a contention algorithm to provide access to all traffic

Higher sublayer Point Coordination Function (PCF)

bull Uses a centralized algorithmbull Contention freebull Implemented on top of DCF

bull Remark PCF has not been popularly implemented in todayrsquos 80211 products DCF is widely used

Ethernet vs Wireless

Ethernet ndash Waits for ether to be silent and transmits

If doesnt get a sense of noise while transmitting assumes frame got through

Wireless ndash Collision detection doesnt work and instead uses Collision Avoidance

Wireless Collision Avoidance

Steps

Have a frame to send

Wait a random backoff time until channel is idle

Sense it is idle for short time called DIFS period

Sends frame if gets through destination sends an ACK

Lack of an ACK means frame failed

Sender then doubles backoff time tries again

Continues as in Ethernet until frame succeeds

22

IEEE 80211 MAC Protocol CSMACA

80211 sender1 if sense channel idle for DIFS then

transmit entire frame 2 if sense channel busy then

a) start random backoff timeb) timer counts down while channel idlec) transmit when timer expiresd) if no ACK increase random backoff

interval repeat 2

80211 receiver- if frame received OK

return ACK after SIFS (ACK needed due to hidden terminal problem)

sender receiver

DIFS

data

SIFS

ACK

Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

23

80211 Frames have Timers

Network Allocation Vector (NAV) timer NAV is set when a frame sequence is

sent Says how long a sequence will take so

other stations have an idea when the medium will be available

For example a NAV for a data frame will also include the ACK back

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 16: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

16

Wireless Communication Systems amp Networking

- In terms of packet or frame delivery hellip

- What complicates wireless networking vs wired networking

17

Wireless Link Characteristics (1)

Differences from wired link hellip

bull Decreased signal strength Radio signal attenuates as it propagates through matter (path loss)

bull Interference from other sources Standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well

bull Multipath propagation Radio signal reflects off objects ground arriving ad destination at slightly different times

hellip make communication across link much more ldquodifficultrdquo

18

80211 Medium Access Controlbull MAC layer has three functions

1 Reliable data deliverybull Different from Ethernet wireless LANs

suffer from considerable unreliability

2 Access controlbull Distributed accessbull Centralized access

3 Security

19

Medium Access Control

bull Two sublayers

Lower sublayer Distributed Coordination Function (DCF)

bull Uses a contention algorithm to provide access to all traffic

Higher sublayer Point Coordination Function (PCF)

bull Uses a centralized algorithmbull Contention freebull Implemented on top of DCF

bull Remark PCF has not been popularly implemented in todayrsquos 80211 products DCF is widely used

Ethernet vs Wireless

Ethernet ndash Waits for ether to be silent and transmits

If doesnt get a sense of noise while transmitting assumes frame got through

Wireless ndash Collision detection doesnt work and instead uses Collision Avoidance

Wireless Collision Avoidance

Steps

Have a frame to send

Wait a random backoff time until channel is idle

Sense it is idle for short time called DIFS period

Sends frame if gets through destination sends an ACK

Lack of an ACK means frame failed

Sender then doubles backoff time tries again

Continues as in Ethernet until frame succeeds

22

IEEE 80211 MAC Protocol CSMACA

80211 sender1 if sense channel idle for DIFS then

transmit entire frame 2 if sense channel busy then

a) start random backoff timeb) timer counts down while channel idlec) transmit when timer expiresd) if no ACK increase random backoff

interval repeat 2

80211 receiver- if frame received OK

return ACK after SIFS (ACK needed due to hidden terminal problem)

sender receiver

DIFS

data

SIFS

ACK

Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

23

80211 Frames have Timers

Network Allocation Vector (NAV) timer NAV is set when a frame sequence is

sent Says how long a sequence will take so

other stations have an idea when the medium will be available

For example a NAV for a data frame will also include the ACK back

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 17: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

17

Wireless Link Characteristics (1)

Differences from wired link hellip

bull Decreased signal strength Radio signal attenuates as it propagates through matter (path loss)

bull Interference from other sources Standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well

bull Multipath propagation Radio signal reflects off objects ground arriving ad destination at slightly different times

hellip make communication across link much more ldquodifficultrdquo

18

80211 Medium Access Controlbull MAC layer has three functions

1 Reliable data deliverybull Different from Ethernet wireless LANs

suffer from considerable unreliability

2 Access controlbull Distributed accessbull Centralized access

3 Security

19

Medium Access Control

bull Two sublayers

Lower sublayer Distributed Coordination Function (DCF)

bull Uses a contention algorithm to provide access to all traffic

Higher sublayer Point Coordination Function (PCF)

bull Uses a centralized algorithmbull Contention freebull Implemented on top of DCF

bull Remark PCF has not been popularly implemented in todayrsquos 80211 products DCF is widely used

Ethernet vs Wireless

Ethernet ndash Waits for ether to be silent and transmits

If doesnt get a sense of noise while transmitting assumes frame got through

Wireless ndash Collision detection doesnt work and instead uses Collision Avoidance

Wireless Collision Avoidance

Steps

Have a frame to send

Wait a random backoff time until channel is idle

Sense it is idle for short time called DIFS period

Sends frame if gets through destination sends an ACK

Lack of an ACK means frame failed

Sender then doubles backoff time tries again

Continues as in Ethernet until frame succeeds

22

IEEE 80211 MAC Protocol CSMACA

80211 sender1 if sense channel idle for DIFS then

transmit entire frame 2 if sense channel busy then

a) start random backoff timeb) timer counts down while channel idlec) transmit when timer expiresd) if no ACK increase random backoff

interval repeat 2

80211 receiver- if frame received OK

return ACK after SIFS (ACK needed due to hidden terminal problem)

sender receiver

DIFS

data

SIFS

ACK

Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

23

80211 Frames have Timers

Network Allocation Vector (NAV) timer NAV is set when a frame sequence is

sent Says how long a sequence will take so

other stations have an idea when the medium will be available

For example a NAV for a data frame will also include the ACK back

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 18: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

18

80211 Medium Access Controlbull MAC layer has three functions

1 Reliable data deliverybull Different from Ethernet wireless LANs

suffer from considerable unreliability

2 Access controlbull Distributed accessbull Centralized access

3 Security

19

Medium Access Control

bull Two sublayers

Lower sublayer Distributed Coordination Function (DCF)

bull Uses a contention algorithm to provide access to all traffic

Higher sublayer Point Coordination Function (PCF)

bull Uses a centralized algorithmbull Contention freebull Implemented on top of DCF

bull Remark PCF has not been popularly implemented in todayrsquos 80211 products DCF is widely used

Ethernet vs Wireless

Ethernet ndash Waits for ether to be silent and transmits

If doesnt get a sense of noise while transmitting assumes frame got through

Wireless ndash Collision detection doesnt work and instead uses Collision Avoidance

Wireless Collision Avoidance

Steps

Have a frame to send

Wait a random backoff time until channel is idle

Sense it is idle for short time called DIFS period

Sends frame if gets through destination sends an ACK

Lack of an ACK means frame failed

Sender then doubles backoff time tries again

Continues as in Ethernet until frame succeeds

22

IEEE 80211 MAC Protocol CSMACA

80211 sender1 if sense channel idle for DIFS then

transmit entire frame 2 if sense channel busy then

a) start random backoff timeb) timer counts down while channel idlec) transmit when timer expiresd) if no ACK increase random backoff

interval repeat 2

80211 receiver- if frame received OK

return ACK after SIFS (ACK needed due to hidden terminal problem)

sender receiver

DIFS

data

SIFS

ACK

Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

23

80211 Frames have Timers

Network Allocation Vector (NAV) timer NAV is set when a frame sequence is

sent Says how long a sequence will take so

other stations have an idea when the medium will be available

For example a NAV for a data frame will also include the ACK back

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 19: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

19

Medium Access Control

bull Two sublayers

Lower sublayer Distributed Coordination Function (DCF)

bull Uses a contention algorithm to provide access to all traffic

Higher sublayer Point Coordination Function (PCF)

bull Uses a centralized algorithmbull Contention freebull Implemented on top of DCF

bull Remark PCF has not been popularly implemented in todayrsquos 80211 products DCF is widely used

Ethernet vs Wireless

Ethernet ndash Waits for ether to be silent and transmits

If doesnt get a sense of noise while transmitting assumes frame got through

Wireless ndash Collision detection doesnt work and instead uses Collision Avoidance

Wireless Collision Avoidance

Steps

Have a frame to send

Wait a random backoff time until channel is idle

Sense it is idle for short time called DIFS period

Sends frame if gets through destination sends an ACK

Lack of an ACK means frame failed

Sender then doubles backoff time tries again

Continues as in Ethernet until frame succeeds

22

IEEE 80211 MAC Protocol CSMACA

80211 sender1 if sense channel idle for DIFS then

transmit entire frame 2 if sense channel busy then

a) start random backoff timeb) timer counts down while channel idlec) transmit when timer expiresd) if no ACK increase random backoff

interval repeat 2

80211 receiver- if frame received OK

return ACK after SIFS (ACK needed due to hidden terminal problem)

sender receiver

DIFS

data

SIFS

ACK

Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

23

80211 Frames have Timers

Network Allocation Vector (NAV) timer NAV is set when a frame sequence is

sent Says how long a sequence will take so

other stations have an idea when the medium will be available

For example a NAV for a data frame will also include the ACK back

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 20: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

Ethernet vs Wireless

Ethernet ndash Waits for ether to be silent and transmits

If doesnt get a sense of noise while transmitting assumes frame got through

Wireless ndash Collision detection doesnt work and instead uses Collision Avoidance

Wireless Collision Avoidance

Steps

Have a frame to send

Wait a random backoff time until channel is idle

Sense it is idle for short time called DIFS period

Sends frame if gets through destination sends an ACK

Lack of an ACK means frame failed

Sender then doubles backoff time tries again

Continues as in Ethernet until frame succeeds

22

IEEE 80211 MAC Protocol CSMACA

80211 sender1 if sense channel idle for DIFS then

transmit entire frame 2 if sense channel busy then

a) start random backoff timeb) timer counts down while channel idlec) transmit when timer expiresd) if no ACK increase random backoff

interval repeat 2

80211 receiver- if frame received OK

return ACK after SIFS (ACK needed due to hidden terminal problem)

sender receiver

DIFS

data

SIFS

ACK

Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

23

80211 Frames have Timers

Network Allocation Vector (NAV) timer NAV is set when a frame sequence is

sent Says how long a sequence will take so

other stations have an idea when the medium will be available

For example a NAV for a data frame will also include the ACK back

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 21: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

Wireless Collision Avoidance

Steps

Have a frame to send

Wait a random backoff time until channel is idle

Sense it is idle for short time called DIFS period

Sends frame if gets through destination sends an ACK

Lack of an ACK means frame failed

Sender then doubles backoff time tries again

Continues as in Ethernet until frame succeeds

22

IEEE 80211 MAC Protocol CSMACA

80211 sender1 if sense channel idle for DIFS then

transmit entire frame 2 if sense channel busy then

a) start random backoff timeb) timer counts down while channel idlec) transmit when timer expiresd) if no ACK increase random backoff

interval repeat 2

80211 receiver- if frame received OK

return ACK after SIFS (ACK needed due to hidden terminal problem)

sender receiver

DIFS

data

SIFS

ACK

Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

23

80211 Frames have Timers

Network Allocation Vector (NAV) timer NAV is set when a frame sequence is

sent Says how long a sequence will take so

other stations have an idea when the medium will be available

For example a NAV for a data frame will also include the ACK back

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 22: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

22

IEEE 80211 MAC Protocol CSMACA

80211 sender1 if sense channel idle for DIFS then

transmit entire frame 2 if sense channel busy then

a) start random backoff timeb) timer counts down while channel idlec) transmit when timer expiresd) if no ACK increase random backoff

interval repeat 2

80211 receiver- if frame received OK

return ACK after SIFS (ACK needed due to hidden terminal problem)

sender receiver

DIFS

data

SIFS

ACK

Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

23

80211 Frames have Timers

Network Allocation Vector (NAV) timer NAV is set when a frame sequence is

sent Says how long a sequence will take so

other stations have an idea when the medium will be available

For example a NAV for a data frame will also include the ACK back

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 23: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

23

80211 Frames have Timers

Network Allocation Vector (NAV) timer NAV is set when a frame sequence is

sent Says how long a sequence will take so

other stations have an idea when the medium will be available

For example a NAV for a data frame will also include the ACK back

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 24: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

Rick Graziani grazianicabrilloedu 24

NAV Timer

bull All stations have a NAV (Network Allocation Vector) timerProtects the sequence of frames from interruptionbull Example Martha sends a frame to Georgebull Since wireless medium is a ldquobroadcast-basedrdquo shared medium all stations

including Vivian receive framebull Vivian updates her NAV timer with the duration valuebull Vivian will not attempt to transmit until her NAV is decremented to 0bull Stations will only update their NAV when duration field value received is greater

than their current NAV

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 25: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

Rick Graziani grazianicabrilloedu 25

Duration Field

bull DurationID field ndash The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progressndash Transmitting device sets the Duration time in microsecondsndash Includes time to

bull Transmit this frame to AP (or to the client if an AP)bull The returning ACK bull The time in-between frames IFS (Interframe Spacing)

bull All stations monitor this fieldbull All stations update their NAV (Network Allocation Vector) timer

General 80211 Frame (more on this later)

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 26: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

Rick Graziani grazianicabrilloedu 26

Wanting to transmit (13)

bull Station wanting to transmit

bull Carrier Sensingndash Physical Physically senses medium is idlendash Virtual NAV timer is 0

bull Waits DIFS (DCF Interframe Space) ndash Minimum amount of medium idle time until contention-

based services beginndash Once DCF is over stations can contend for access

bull Contention window beginsndash Uses random backoff algorithm to determine when it can

attempt to access the medium (next)

Random backoff slots

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 27: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

Rick Graziani grazianicabrilloedu 27

Wanting to transmit (23)

bull The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor

bull The random value is number of 80211 slot times the station must wait after the DIFS during the contention window before it may transmit

bull Stations pick a random slot and wait for that slot before attempting to access the medium

bull With several stations attempting to transmit the station that picks the lowest slot lowest random number wins

Contention Window Begins

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 28: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

Rick Graziani grazianicabrilloedu 28

Wanting to transmit (33)

bull Station transmits setting the Duration ID to the time needed to transmit data ACK and IFSs

bull Other stations with higher slots will see the new transmission and wait to transmit

bull If frame arrives at AP (assuming the transmitter is a station) then an ACK will be returned

bull If there is not an ACK received the sending station assumes there has been a collisionndash If two stations have the same lowest slot time and both

transmit then a collision occursbull Stations will update its retry counter (double) to determine a new

randomly selected slot time and process starts all over again

General 80211 Frame (more on this later)

Others update NAV

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 29: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

29

Hidden Terminal Problem in WLANs

bull Both H1 and H2 transmit at same time

bull Signals collide at AP H1 cant detect H2

Collison is the darker blue

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 30: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

30

Avoiding collisions RTSCTSIdea Allow sender to ldquoreserverdquo 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

bull RTSs may still collide with each other (but theyrsquore short)

bull BS broadcasts clear-to-send (CTS) in response to RTS

bull RTS heard by all nodes

bull Sender transmits data frame

bull Other stations defer transmissions

avoid data frame collisions completely using small reservation packets

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 31: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

31

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

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 32: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

RTSCTS in practice

bull 80211 standardized both CSMACA and RTSCTS

bull In practice most operators disable RTSCTSndash Very high overhead

bull RTSCTS packets sent at ldquobase raterdquo (often 1Mbit)

ndash Neighboring cells are often configured to use non-overlapping channels so hidden terminals on downlink are rare

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 33: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

33

framecontrol

durationaddress

1address

2address

4address

3payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

80211 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 addressof router interface to which AP is attached

Address 4 used only in ad hoc mode

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 34: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

34

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

80211 frame

R1 MAC addr AP MAC addr

dest address source address

8023 frame

80211 frame addressing

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 35: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

35

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

80211 frame moreduration of reserved transmission time

frame seq (for reliable ARQ)

frame type(RTS CTS ACK data)

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 36: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

Summary

bull 80211 wireless more challenging because of disruptions to signal vs wired

bull However mobility far outweighs the downside of interference and security

bull No going back to wired when we can plug in during flights and have access to Facebook

37

Lab is wireless

Page 37: 1 CSCD 433 Network Programming Fall 2013 Lecture 7 Ethernet and Wireless 802.11

37

Lab is wireless