1 / 34

CSCD 433 Network Programming Fall 2012

CSCD 433 Network Programming Fall 2012. 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,

wanda
Télécharger la présentation

CSCD 433 Network Programming Fall 2012

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

  3. 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

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

  5. IEEE 802 Standard • Complete specification of 802 standard 5

  6. IEEE 802.11 Protocol Architecture Physical Layer 6

  7. 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 • All operating at 1 and 2 Mbps • 1999, Two additional 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 • IEEE 802.11n: data rate up to hundreds of Mbps 7

  8. Review of Classical or Standard Ethernet

  9. Review of Ethernet Recall that Ethernet was a shared technology Everyone had access to the wires Users had to contend with collisions and the MAC layer protocol dealt with these collisions Review the characteristics of Ethernet to better understand 802.11 wireless LAN's

  10. 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

  11. Ethernet Recap Ethernet could contain multiple segments and multiple repeaters Used CSMA/CD for shared media What does CSMA/CD stand for? Carrier Sense Multiple Access/Collision Detection Review this ...

  12. CSMA/CD Protocol All hosts transmit & receive on one channel Packets are of variable size 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. binary exponential backoff

  13. 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 ! 13

  14. 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,…,2m-1} NIC then waits K·512 bit time, • Returns to Step 2 14

  15. Wireless Communication Systems & Networking What complicates wireless networking vs. wired networking?

  16. Wireless Link Characteristics (1) 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 (e.g., 2.4 GHz) shared by other devices (e.g., phone); devices (motors) interfere as well Multipath propagation: Radio signal reflects off objects ground, arriving ad destination at slightly different times …. make communication across link much more “difficult”

  17. 802.11 Medium Access Control • MAC layer has three functions • Reliable data delivery • Different from Ethernet, wireless LANs suffer from considerable unreliability. • Access control • Distributed access • Centralized access • Security 17

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

  19. Distributed Coordination Function: CSMA/CA • DCF sublayer uses CSMA/CA protocol, What does that stand for? • Where CA refers to as Collision Avoidance • A station with a frame to transmit senses the medium. If the medium is idle, it waits to see if the medium remains idle for a time equals to a delay called Interframe Space (IFS). If so, the station may transmit immediately. • If the medium is busy, the station defers transmission and continues to monitor the medium until the current transmission is over. • Once the transmission is over, the station delays another IFS. If the medium remains idle for this period, then the station backs off a random amount of time and again senses the medium. If the medium is still idle, the station may transmit. During the backoff time, if the medium becomes busy, the backoff timer is halted and resumes when the medium becomes idle. • If the transmission is unsuccessful, which is determined by the absence of an ACK, then it is assumed that a collision has occurred. • To ensure that backoff maintains stability, binary exponential backoff is used. • Why notcollision detection? • Collision detection is not practical on wireless networks • The dynamic range of wireless signals is very large • The transmitting station cannot distinguish incoming weak signals from noise and/or effects of own transmission 19

  20. IEEE 802.11 MAC Protocol: CSMA/CA 802.11 sender 1. if sense channel idle for DIFSthen transmit entire frame 2. ifsense 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 802.11 receiver - if frame received OK return ACK after SIFS (ACK needed due to hidden terminal problem) DIFS data SIFS ACK sender receiver Distributed Inter-frame Spacing (DIFS) Short Inter-frame Spacing (SIFS)

  21. NAV Timer An example will be coming! General 802.11 Frame (more on this later) • All stations have a NAV(Network Allocation Vector) timer. • Virtual carrier-sensing function • Protects the sequence of frames from interruption. • Martha sends a frame to George. • Since wireless medium is a “broadcast-based” (not broadcast frame) shared medium, all stations including Vivian receive the frame. • Vivian updates her NAV timer with the duration value. • Vivian will not attempt to transmit until her NAV is decremented to 0. • Stations will only update their NAV when the duration field value received is greater than their current NAV. Rick Graziani graziani@cabrillo.edu 21

  22. Duration Field An example will be coming! General 802.11 Frame (more on this later) • Duration/ID field – The number of microseconds (millionth of a second) that the medium is expected to remain busy for transmission currently in progress. • Transmitting device sets the Duration time in microseconds. • Includes time to: • Transmit this frame to the AP (or to the client if an AP) • The returning ACK • The 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 22

  23. 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 (DCF Interframe Space) • Minimum amount of medium idle time until contention-based services begin. • Once DCF 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 23

  24. Wanting to transmit (2/3) Contention Window Begins • (Detail of random backoff algorthim has been left out, but this will be sufficient.) • The random backoff algorithm randomly selects a value from 0 to 255 (maximum value varies by vendor and stored in the NIC). • The random value is the 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 24

  25. 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 (stations have updated their NAVs from original frame). • If there is not an ACK received, the sending station assumes there has been a collision (stations have not updated their NAVs because of 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 25

  26. 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

  27. Avoiding collisions: RTS/CTS Idea: allow sender to “reserve” channel rather than random access of data frames: avoid collisions of long data frames sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but they’re short) BS broadcasts clear-to-send (CTS) in response to RTS RTS heard by all nodes sender transmits data frame other stations defer transmissions avoid data frame collisions completely using small reservation packets!

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

  29. 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)‏ Avoid collisions regardless of transmission rate Most deployments use base stations, not ad hoc. Neighboring cells are often configured to use non-overlapping channels, so hidden terminals on downlink are rare

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

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

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

  33. 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!

  34. Lab is Wireshark wireless !!! 34

More Related