CSCD 433 Network Programming Fall Lecture 7 Ethernet and Wireless

Similar documents
Shared Access Networks Wireless. 1/27/14 CS mywireless 1

Multiple Access in Cellular and Systems

Multiple Access Links and Protocols

Last Lecture: Data Link Layer

Wireless and Mobile Networks 7-2

Data Communication & Networks G Session 5 - Main Theme Wireless Networks. Dr. Jean-Claude Franchitti

Chapter 6 Wireless and Mobile Networks

CMPE 257: Wireless and Mobile Networking

Wireless Networks. CSE 3461: Introduction to Computer Networking Reading: , Kurose and Ross

Lecture 16: QoS and "

CMPE 257: Wireless and Mobile Networking

Wireless LANs. ITS 413 Internet Technologies and Applications

Data and Computer Communications. Chapter 13 Wireless LANs

CSC 4900 Computer Networks: Wireless Networks

Mohammad Hossein Manshaei 1393

MAC. Fall Data Communications II 1

CSE 461: Wireless Networks

Data Communications. Data Link Layer Protocols Wireless LANs

CS 332 Computer Networks Wireless Networks

ECE 4450:427/527 - Computer Networks Spring 2017

Mohamed Khedr.

Medium Access Control. MAC protocols: design goals, challenges, contention-based and contention-free protocols

Topic 2b Wireless MAC. Chapter 7. Wireless and Mobile Networks. Computer Networking: A Top Down Approach

Chapter 6 Medium Access Control Protocols and Local Area Networks

Unit 7 Media Access Control (MAC)

IEEE WLANs (WiFi) Part II/III System Overview and MAC Layer

CPSC 826 Internetworking. Wireless and Mobile Networks. Wireless Networks Wireless Hosts

Lesson 2-3: The IEEE x MAC Layer

Computer Communication III

Wireless Protocols. Training materials for wireless trainers

COMP 3331/9331: Computer Networks and Applications

Module 6: Wireless Mobile Networks

Wireless LAN -Architecture

Local Area Networks NETW 901

Wireless and Mobile Networks

4.3 IEEE Physical Layer IEEE IEEE b IEEE a IEEE g IEEE n IEEE 802.

6.9 Summary. 11/20/2013 Wireless and Mobile Networks (SSL) 6-1. Characteristics of selected wireless link standards a, g point-to-point

CS 348: Computer Networks. - WiFi (contd.); 16 th Aug Instructor: Sridhar Iyer IIT Bombay

Chapter 6 Wireless and Mobile Networks. Chapter 6 outline. Chapter 6: Wireless and Mobile Networks. Elements of a wireless network.

Wireless Communication and Networking CMPT 371

Wireless Local Area Networks (WLANs) Part I

Chapter 6 Wireless and Mobile Networks. Chapter 6 outline. Chapter 6: Wireless and Mobile Networks. Elements of a wireless network

Outline. CS5984 Mobile Computing. IEEE 802 Architecture 1/7. IEEE 802 Architecture 2/7. IEEE 802 Architecture 3/7. Dr. Ayman Abdel-Hamid, CS5984

CSCI-1680 Wireless Chen Avin

High Level View. EE 122: Ethernet and Random Access protocols. Medium Access Protocols

Lecture 25: CSE 123: Computer Networks Alex C. Snoeren. HW4 due NOW

Link Layer. 5.1 Introduction and services 5.2 Error detection and correction 5.3Multiple access protocols 5.4 Link-Layer Addressing 5.

Wireless Communication and Networking CMPT 371

IEEE Medium Access Control. Medium Access Control

Computer Networks. Wireless LANs

EE 122: Ethernet and

Getting Connected (Chapter 2 Part 4) Networking CS 3470, Section 1 Sarah Diesburg

standard. Acknowledgement: Slides borrowed from Richard Y. Yale

Lecture 24: CSE 123: Computer Networks Stefan Savage. HW4 due NOW

WiFi Networks: IEEE b Wireless LANs. Carey Williamson Department of Computer Science University of Calgary Winter 2018

Chapter 4. The Medium Access Control Sublayer. Points and Questions to Consider. Multiple Access Protocols. The Channel Allocation Problem.

CS 43: Computer Networks. 27: Media Access Contd. December 3, 2018

Data Link Protocols. TCP/IP Suite and OSI Reference Model. The TCP/IP protocol stack does not define the lower layers of a complete protocol stack

Topics for Today. More on Ethernet. Wireless LANs Readings. Topology and Wiring Switched Ethernet Fast Ethernet Gigabit Ethernet. 4.3 to 4.

ICE 1332/0715 Mobile Computing (Summer, 2008)

IEEE , Token Rings. 10/11/06 CS/ECE UIUC, Fall

Logical Link Control (LLC) Medium Access Control (MAC)

Medium Access Control Sublayer

Wireless Local Area Networks. Networks: Wireless LANs 1

Last time?! MPLS! Label distribution protocols! Multi Protocol Label Switching! Layer 2.5 protocol! LDP! RSVP!

Introduction to Wireless Networking CS 490WN/ECE 401WN Winter Lecture 4: Wireless LANs and IEEE Part II

Chapter 12 Multiple Access 12.1

Page 1. Outline : Wireless Networks Lecture 11: MAC. Standardization of Wireless Networks. History. Frequency Bands

Overview. Wireless networks basics IEEE (Wi-Fi) a/b/g/n ad Hoc MAC protocols ad Hoc routing DSR AODV

MAC in /20/06

Mobile & Wireless Networking. Lecture 7: Wireless LAN

Extending or Interconnecting LANS. Physical LAN segment. Virtual LAN. Forwarding Algorithm 11/9/15. segments. VLAN2, Port3. VLAN1, Port1.

IEEE Wireless LANs Part I: Basics

MSIT 413: Wireless Technologies Week 8

CSC344 Wireless and Mobile Computing. Department of Computer Science COMSATS Institute of Information Technology

Outline / Wireless Networks and Applications Lecture 9: Wireless LANs Aloha and 802 Wireless. Regular Ethernet CSMA/CD

CS 43: Computer Networks Media Access. Kevin Webb Swarthmore College November 30, 2017

(Wireless) Internet Routing. Review of Wireless Networking (with Routing in Mind)

Topics. Link Layer Services (more) Link Layer Services LECTURE 5 MULTIPLE ACCESS AND LOCAL AREA NETWORKS. flow control: error detection:

ICE 1332/0715 Mobile Computing (Summer, 2008)

Wireless Communications

Review. Error Detection: CRC Multiple access protocols. LAN addresses and ARP Ethernet. Slotted ALOHA CSMA/CD

COMP 3331/9331: Computer Networks and Applications

Wireless Local Area Networks (WLANs)) and Wireless Sensor Networks (WSNs) Computer Networks: Wireless Networks 1

M06:Wireless and Mobile Networks. Corinna Schmitt

IEEE WLAN (802.11) Copyright. Nomadic Communications

Lecture 6. Data Link Layer (cont d) Data Link Layer 1-1

Mobile Communications Chapter 7: Wireless LANs

IEEE Technical Tutorial. Introduction. IEEE Architecture

WLAN (802.11) Nomadic Communications. Renato Lo Cigno - Tel: Dipartimento di Ingegneria e Scienza dell Informazione

CSE 6811 Ashikur Rahman

Overview : Computer Networking. Spectrum Use Comments. Spectrum Allocation in US Link layer challenges and WiFi WiFi

Multiple Access Links and Protocols

Announcements: Assignment 4 due now Lab 4 due next Tuesday Assignment 5 posted, due next Thursday

Medium Access Control. IEEE , Token Rings. CSMA/CD in WLANs? Ethernet MAC Algorithm. MACA Solution for Hidden Terminal Problem

CSE 461: Multiple Access Networks. This Lecture

Rahman 1. Application

Elements of a wireless network. Elements of a wireless network. Characteristics of selected wireless link standards. Elements of a wireless network

MULTIPLE ACCESS PROTOCOLS 2. 1

Nomadic Communications WLAN MAC Fundamentals

Transcription:

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

Topics 802 Standard MAC and LLC Sublayers Review of MAC in Ethernet MAC in 802.11 Wireless 2

IEEE Standards In 1985, Computer Society of IEEE started a project, called Project 802, Set standards to enable intercommunication among equipment from a variety of manufacturers Project 802 Specifies functions of physical layer and the data link layer of major LAN protocols

IEEE 802 Series of LAN Standards 802 standards free to download from http://standards.ieee.org /getieee802 WiMAX

802.11 Physical Layer Issued in four stages 1997, First part IEEE 802.11 Includes MAC layer and three physical layer specifications Two in 2.4-GHz band and one infrared, Operate 1 and 2 Mbps 1999, Two more parts IEEE 802.11a 5-GHz band, data rate up to 54 Mbps IEEE 802.11b 2.4-GHz band, data rate at 5.5 and 11 Mbps 2002, Most recent IEEE 802.11g extends IEEE 802.11b to higher data rates, up to 54 Mbps At present 5 IEEE 802.11n and 802.11ac data rate up to hundreds of Mbps

IEEE 802 Standard Complete specification of 802 standard 6

IEEE 802.11 Protocol Architecture Physical Layer 7

802 Layering Media Access Control (MAC) Layer 802.11 standard specifies common medium access control (MAC) Layer In general, MAC Layer manages and maintains communications between 802.11 stations by coordinating access to shared radio channel Logical Link Control (LLC) Layer Adds optional error correction (rarely used) Connects to next-higher-layer (internet) IP IPX Etc. 802.2 Logical Link Control Layer Standard 802.3 802.5 802.11 8

MAC Sublayer Functions MAC is set of rules to determine how to access medium and data link components. MAC rides on every transmission of user data into the air It provides core framing operations and interaction with a wired network backbone, sets the frame header fields MAC purpose in General Coordinates and shares use of radio bandwidth Synchronization between stations Datagram transfer function MAC layer management functions Authentication and De-Authentication Association, Re-Association, and Disassociation Beacon and Probe frames 9

MAC Sublayer Functions 802.11 uses CSMA/CA mechanism Carrier Sense Multiple Access with Collision Avoidance It is considered to be fair for all users because treats them equally Recall that Ethernet uses CSMA/CD. Why CSMA/CD can t be used in wireless LAN? Requires implementation of a full duplex radio that would increase the price significantly All stations may not hear each other in a wireless environment is basic assumption of CD scheme

Hosts and Access Points Share One Channel The access point and all the hosts it serves transmit in a single channel If two devices transmit at the same time, their signals will collide, becoming unreadable Media access control (MAC) methods govern when a device transmits It only lets one device transmit at a time

Brief Review of Classical or Standard Ethernet

Review of Classical Ethernet Recall that Ethernet is shared technology Everyone has access to wires Users contend with collisions and MAC layer protocol dealt with these collisions Note This is with traditional cable and Hubs Review characteristics of Ethernet to better understand 802.11 wireless LAN's

Ethernet Recap Classic Ethernet One long cable, 500 meter max segment Snaked around building as single, long cable All computers attached Thick Ethernet Began as thick yellow cable, marked every 2.5 meters to show computer attachments Thin Ethernet Thinner, bent more easily connections with BNC connectors Cheaper to install, 185 meter max segment

CSMA/CD Protocol All hosts transmit & receive on one channel When a host has a packet to transmit 1. Carrier Sense: Check that the line is quiet before transmitting 2. Collision Detection: Detect collision as soon as Possible. Collision is detected, stop transmitting; wait a random time, then return to step 1. 15

Ethernet CSMA/CD algorithm Algorithm 1. 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! 16

Ethernet CSMA/CD Algorithm 4. If NIC detects another transmission while transmitting, aborts and sends jam signal 5. After aborting NIC enters exponential backoff after mth collision, NIC chooses a K, small integer, at random from {0,1,2,,2 m -1} NIC then waits K 512 bit time, Returns to Step 2 17

Wireless Communication Systems - In terms of packet or frame delivery. - What complicates wireless networking vs. wired networking? 18

19 Wireless Link Characteristics Differences from wired link. Decreased signal strength: Radio signal attenuates as it propagates through matter (path loss) Interference from other sources: Standardized wireless network frequencies shared by other devices that can interfere Multipath propagation: Radio signal reflects off objects and ground, arriving at destination at slightly different times. make communication across link much more difficult

CSMA/CD vs. CSMA/CA CSMA/CD CSMA/Collision detection For wired communication No control BEFORE transmission Generates collisions Collision Detection- Monitors signal strength CSMA/CA CSMA/Collision Avoidance For wireless communication Collision avoidance BEFORE transmission Difference in energy/power for transmit & receive Difficult to distinguish between incoming weak signals, noise, and effects of own transmission

802.11 Medium Access Control Look at ways wireless shares the medium through coordination with other stations Sends control packets for coordination Sets and sends individual frame timers for all to see Interesting to see there is the theory of how 802.11 is supposed to be implemented Then, there is the reality of did it actually get implemented! 21

Medium Access Control Two sublayers Lower sublayer Distributed Coordination Function (DCF) Uses a contention algorithm to provide access to all traffic Higher sublayer Point Coordination Function (PCF) Uses a centralized algorithm Contention free Implemented on top of DCF Note: PCF has not been popularly implemented in today s 802.11 products, DCF is widely used 22

Wireless Collision Avoidance STEPS 1. Have a frame to send 2. Wait a random time, until channel is idle 3. Sense it is idle for short time, called DIFS period 4. Sends frame, if gets through, destination sends an ACK 5. Lack of an ACK means frame failed 6. Sender then doubles backoff time, tries again 7. Continues as in Ethernet until frame succeeds Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

IEEE 802.11 MAC Protocol: CSMA/CA 802.11 sender 1. If sense channel idle for DIFS then transmit entire frame 2. If sense channel busy then a) start random backoff time b) timer counts down while channel idle c) transmit when timer expires d) if no ACK, increase random backoff interval, repeat 2 (frame failed) 802.11 receiver - if frame received OK return ACK after SIFS (ACK needed due to hidden terminal problem) DIFS sender data ACK receiver SIFS Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS) 24

25 802.11 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 Next Slides Demo this with Example...

NAV Timer General 802.11 Frame (more on this later) All stations have a NAV (Network Allocation Vector) timer Protects frames from interruption Example: Martha sends a frame to George Since wireless medium is broadcast-based shared medium, all stations including Vivian receive frame Vivian updates her NAV timer with duration value Vivian will not attempt to transmit until her NAV is decremented to 0. Stations will only update their NAV when duration field value received is greater than their current NAV Rick Graziani graziani@cabrillo.edu 26

Duration Field General 802.11 Frame (more on this later) Duration/ID field Number of microseconds medium is expected to remain busy for transmission currently in progress Transmitting device sets Duration time in microseconds Includes time to: Transmit this frame to AP (or to the client if an AP) Returning ACK Time in-between frames, IFS (Interframe Spacing) All stations monitor this field! All stations update their NAV (Network Allocation Vector) timer Rick Graziani graziani@cabrillo.edu 27

Wanting to transmit (1/3) Random backoff slots Station wanting to transmit. Carrier Sensing Physical: Physically senses medium is idle Virtual: NAV timer is 0 Waits DIFS (Distributed or DCF Interframe Space) Minimum amount of medium idle time until contention-based services begin. Once DIFS is over, stations can contend for access. Contention window begins. Uses random backoff algorithm to determine when it can attempt to access the medium. (next) Rick Graziani graziani@cabrillo.edu 28

Wanting to transmit (2/3) Contention Window Begins The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor The random value is number of 802.11 slot times the station must wait after the DIFS, during the contention window before it may transmit. Stations pick a random slot and wait for that slot before attempting to access the medium. With several stations attempting to transmit, the station that picks the lowest slot, lowest random number, wins. Rick Graziani graziani@cabrillo.edu 29

Wanting to transmit (3/3) Others update NAV General 802.11 Frame (more on this later) Station transmits, setting the Duration ID to the time needed to transmit data, ACK and IFSs. Other stations with higher slots will see the new transmission and wait to transmit. If frame arrives at AP (assuming the transmitter is a station), then an ACK will be returned If there is not an ACK received, the sending station assumes there has been a collision If two stations have the same lowest slot time and both transmit, then a collision occurs Stations will update its retry counter (double) to determine a new randomly selected slot time and process starts all over again Rick Graziani graziani@cabrillo.edu 30

31 Hidden Terminal Problem in WLANs Both H1 and H2 transmit at same time Signals collide at AP, H1 can't detect H2 Collison is the darker blue

Avoiding collisions: RTS/CTS Another Idea: Allow sender to reserve channel rather than random access of data frames: avoid collisions of long data frames Sender first transmits small request-to-send (RTS) packets using CSMA, say want to transmit to AP RTSs may still collide with each other (but they re short) AP broadcasts clear-to-send (CTS) in response to RTS RTS heard by all nodes Sender transmits data frame Other stations defer transmissions Avoids data frame collisions completely using small reservation packets! 32

33 Collision Avoidance: RTS-CTS exchange A RTS(A) AP B RTS(B) RTS(A) reservation collision CTS(A) CTS(A) DATA (A) defer time ACK(A) ACK(A)

RTS/CTS in practice 802.11 standardized both CSMA/CA and RTS/CTS In practice, most operators disable RTS/CTS Very high overhead! RTS/CTS packets sent at base rate (often 1Mbit) Neighboring AP's are often configured to use non-overlapping channels, so hidden terminals on downlink are rare

802.11 Frame: Addressing frame control 2 2 6 6 6 2 6 0-2312 4 duration address 1 address 2 address 3 seq control address 4 payload CRC Address 1: MAC address of wireless host or AP to receive this frame Address 2: MAC address of wireless host or AP transmitting this frame Address 3: MAC address of router interface to which AP is attached Address 4: used only in ad hoc mode 35

36 802.11 frame: addressing H1 R1 router Internet AP R1 MAC addr AP MAC addr dest. address source address 802.3 frame AP MAC addr H1 MAC addr R1 MAC addr rcv address 1 snd address 2 router address 3 802.11 frame

802.11 frame: more duration of reserved transmission time frame seq # (for reliable ARQ) frame control 2 2 6 6 6 2 6 0-2312 4 duration address 1 address 2 address 3 seq control address 4 payload CRC Protocol version 2 2 4 1 1 1 1 1 1 Type Subtype To AP From AP More frag 1 1 Power Retry mgt More data WEP Rsvd frame type (RTS, CTS, ACK, data) 37

Summary 802.11 wireless more challenging because of disruptions to signal vs. wired However, mobility far outweighs the downside of interference and security No going back to wired when we can plug in during flights and have access to Facebook! Will see how wireless works in Wireshark lab

Lab is on Thursday 39

1

IEEE Standards In 1985, Computer Society of IEEE started a project, called Project 802, Set standards to enable intercommunication among equipment from a variety of manufacturers Project 802 Specifies functions of physical layer and the data link layer of major LAN protocols 3 3

IEEE 802 Series of LAN Standards 802 standards free to download from http://standards.ieee.org /getieee802 WiMAX 4 4

802.11 Physical Layer Issued in four stages 1997, First part IEEE 802.11 Includes MAC layer and three physical layer specifications Two in 2.4-GHz band and one infrared, Operate 1 and 2 Mbps 1999, Two more parts IEEE 802.11a 5-GHz band, data rate up to 54 Mbps IEEE 802.11b 2.4-GHz band, data rate at 5.5 and 11 Mbps 2002, Most recent IEEE 802.11g extends IEEE 802.11b to higher data rates, up to 54 Mbps At present 5 IEEE 802.11n and 802.11ac data rate up to hundreds of Mbps 5

IEEE 802.11 Protocol Architecture Physical Layer 7 7

802 Layering Media Access Control (MAC) Layer 802.11 standard specifies common medium access control (MAC) Layer In general, MAC Layer manages and maintains communications between 802.11 stations by coordinating access to shared radio channel Logical Link Control (LLC) Layer Adds optional error correction (rarely used) Connects to next-higher-layer (internet) IP IPX Etc. 802.2 Logical Link Control Layer Standard 802.3 802.5 802.11 8

MAC Sublayer Functions MAC is set of rules to determine how to access medium and data link components. MAC rides on every transmission of user data into the air It provides core framing operations and interaction with a wired network backbone, sets the frame header fields MAC purpose in General Coordinates and shares use of radio bandwidth Synchronization between stations Datagram transfer function MAC layer management functions Authentication and De-Authentication Association, Re-Association, and Disassociation Beacon and Probe frames 9

MAC Sublayer Functions 802.11 uses CSMA/CA mechanism Carrier Sense Multiple Access with Collision Avoidance It is considered to be fair for all users because treats them equally Recall that Ethernet uses CSMA/CD. Why CSMA/CD can t be used in wireless LAN? Requires implementation of a full duplex radio that would increase the price significantly All stations may not hear each other in a wireless environment is basic assumption of CD scheme 10

11

Review of Classical Ethernet Recall that Ethernet is shared technology Everyone has access to wires Users contend with collisions and MAC layer protocol dealt with these collisions Note This is with traditional cable and Hubs Review characteristics of Ethernet to better understand 802.11 wireless LAN's 13

15

16

Wireless Communication Systems - In terms of packet or frame delivery. - What complicates wireless networking vs. wired networking? 18 18

Wireless Link Characteristics Differences from wired link. Decreased signal strength: Radio signal attenuates as it propagates through matter (path loss) Interference from other sources: Standardized wireless network frequencies shared by other devices that can interfere Multipath propagation: Radio signal reflects off objects and ground, arriving at destination at slightly different times. make communication across link much more difficult 19 19

DIFS= Distributed interframe Space PIFS=Point Coordination Interframe Space SIFS=Short Coordination Interframe Space 20

802.11 Medium Access Control Look at ways wireless shares the medium through coordination with other stations Sends control packets for coordination Sets and sends individual frame timers for all to see Interesting to see there is the theory of how 802.11 is supposed to be implemented Then, there is the reality of did it actually get implemented! 21 21

Medium Access Control Two sublayers Lower sublayer Distributed Coordination Function (DCF) Uses a contention algorithm to provide access to all traffic Higher sublayer Point Coordination Function (PCF) Uses a centralized algorithm Contention free Implemented on top of DCF Note: PCF has not been popularly implemented in today s 802.11 products, DCF is widely used 22 22

Wireless Collision Avoidance STEPS 1. Have a frame to send 2. Wait a random time, until channel is idle 3. Sense it is idle for short time, called DIFS period 4. Sends frame, if gets through, destination sends an ACK 5. Lack of an ACK means frame failed 6. Sender then doubles backoff time, tries again 7. Continues as in Ethernet until frame succeeds Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS) 23

IEEE 802.11 MAC Protocol: CSMA/CA 802.11 sender 1. If sense channel idle for DIFS then transmit entire frame 2. If sense channel busy then a) start random backoff time b) timer counts down while channel idle c) transmit when timer expires d) if no ACK, increase random backoff interval, repeat 2 (frame failed) 802.11 receiver - if frame received OK return ACK after SIFS (ACK needed due to hidden terminal problem) DIFS sender data ACK receiver SIFS Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS) 24 24

802.11 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 Next Slides Demo this with Example... 25 25

NAV Timer General 802.11 Frame (more on this later) All stations have a NAV (Network Allocation Vector) timer Protects frames from interruption Example: Martha sends a frame to George Since wireless medium is broadcast-based shared medium, all stations including Vivian receive frame Vivian updates her NAV timer with duration value Vivian will not attempt to transmit until her NAV is decremented to 0. Stations will only update their NAV when duration field value received is greater than their current NAV Rick Graziani graziani@cabrillo.edu 26 26

Duration Field General 802.11 Frame (more on this later) Duration/ID field Number of microseconds medium is expected to remain busy for transmission currently in progress Transmitting device sets Duration time in microseconds Includes time to: Transmit this frame to AP (or to the client if an AP) Returning ACK Time in-between frames, IFS (Interframe Spacing) All stations monitor this field! All stations update their NAV (Network Allocation Vector) timer Rick Graziani graziani@cabrillo.edu 27 27

Wanting to transmit (1/3) Random backoff slots Station wanting to transmit. Carrier Sensing Physical: Physically senses medium is idle Virtual: NAV timer is 0 Waits DIFS (Distributed or DCF Interframe Space) Minimum amount of medium idle time until contention-based services begin. Once DIFS is over, stations can contend for access. Contention window begins. Uses random backoff algorithm to determine when it can attempt to access the medium. (next) Rick Graziani graziani@cabrillo.edu 28 28

Wanting to transmit (2/3) Contention Window Begins The random backoff algorithm randomly selects a value from 0 to 255 Maximum value varies by vendor The random value is number of 802.11 slot times the station must wait after the DIFS, during the contention window before it may transmit. Stations pick a random slot and wait for that slot before attempting to access the medium. With several stations attempting to transmit, the station that picks the lowest slot, lowest random number, wins. Rick Graziani graziani@cabrillo.edu 29 29

Wanting to transmit (3/3) Others update NAV General 802.11 Frame (more on this later) Station transmits, setting the Duration ID to the time needed to transmit data, ACK and IFSs. Other stations with higher slots will see the new transmission and wait to transmit. If frame arrives at AP (assuming the transmitter is a station), then an ACK will be returned If there is not an ACK received, the sending station assumes there has been a collision If two stations have the same lowest slot time and both transmit, then a collision occurs Stations will update its retry counter (double) to determine a new randomly selected slot time and process starts all over again Rick Graziani graziani@cabrillo.edu 30 30

Hidden Terminal Problem in WLANs Both H1 and H2 transmit at same time Signals collide at AP, H1 can't detect H2 Collison is the darker blue 31 31

Avoiding collisions: RTS/CTS Another Idea: Allow sender to reserve channel rather than random access of data frames: avoid collisions of long data frames Sender first transmits small request-to-send (RTS) packets using CSMA, say want to transmit to AP RTSs may still collide with each other (but they re short) AP broadcasts clear-to-send (CTS) in response to RTS RTS heard by all nodes Sender transmits data frame Other stations defer transmissions Avoids data frame collisions completely using small reservation packets! 32 32

Collision Avoidance: RTS-CTS exchange A AP RTS(A) B RTS(B) RTS(A) reservation collision CTS(A) CTS(A) DATA (A) defer time ACK(A) ACK(A) 33 33

RTS/CTS in practice 802.11 standardized both CSMA/CA and RTS/CTS In practice, most operators disable RTS/CTS Very high overhead! RTS/CTS packets sent at base rate (often 1Mbit) Neighboring AP's are often configured to use non-overlapping channels, so hidden terminals on downlink are rare 34

802.11 Frame: Addressing frame control 2 2 6 6 6 2 6 0-2312 4 duration address 1 address 2 address 3 seq control address 4 payload CRC Address 1: MAC address of wireless host or AP to receive this frame Address 2: MAC address of wireless host or AP transmitting this frame Address 3: MAC address of router interface to which AP is attached Address 4: used only in ad hoc mode 35 35

802.11 frame: addressing H1 R1 router Internet AP R1 MAC addr AP MAC addr dest. address source address 802.3 frame AP MAC addr H1 MAC addr R1 MAC addr rcv address 1 snd address 2 router address 3 802.11 frame 36 36

802.11 frame: more duration of reserved transmission time frame seq # (for reliable ARQ) frame control 2 2 6 6 6 2 6 0-2312 4 duration address 1 address 2 address 3 seq control address 4 payload CRC Protocol version 2 2 4 1 1 1 1 1 1 Type Subtype To AP From AP More frag 1 1 Power Retry mgt More data WEP Rsvd frame type (RTS, CTS, ACK, data) 37 37