Presentation is loading. Please wait.

Presentation is loading. Please wait.

2. Advanced Medium Access Control Protocols

Similar presentations


Presentation on theme: "2. Advanced Medium Access Control Protocols"— Presentation transcript:

1 2. Advanced Medium Access Control Protocols
2.1 Traditional CSMA/CD 2.2 The MAC Protocol for Wireless LANs

2 What is a LAN? Definition
A LAN (Local Area Network) is a network for the bit-serial transmission of data between independent peer stations. It is usually under the legal control of a single user (single enterprise) and is usually limited to the user‘s premises.

3 Characteristics of a Local Area Network
High transmission speed ( MBit/s) Easy, inexpensive connection of stations No need to take Telekom rules and regulations into account Different types of devices can be connected easily: personal computers mobile phones high-end Unix workstations department servers/file servers/mail servers mainframes printers and other peripheral devices. Interconnection to Wide-Area Networks (WANs) is possible via routers (layer 3).

4 LANs in the ISO Reference Model
LAN Standard IEEE 802 Network Layer LLC Logical Link Control MAC Media Access Control Physical Layer physical medium Layer 3 Layer 2b Layer 2 Layer 2a Layer 1 ….

5 Medium Access Control Problem: Solution: Medium Access Control
broadcast medium independent stations => send collisions will occur Solution: Medium Access Control Two allocation principles: collision detection Let collisions take place, detect them, repeat the transmission. collision avoidance Use a circulating token to control the access to the medium.

6 2.1 Traditional CSMA/CD (Ethernet)
CSMA/CD = Carrier Sensing with Multiple Access and Collision Detection Standard: IEEE und ISO IS 8802/3: MAC and Physical Layer for CSMA/CD Topology: Bus Bi-directional data flow Bus interruption => network failure

7 CSMA/CD Basic Assumptions and Principles
All stations can hear each other on the medium. The frame transmission time is much longer than the maximum propaga-tion delay between the stations. In other words, the sender is still sending when the most distant station in the LAN segment begins to hear the trans-mission. Principles Carrier Sensing, Multiple Access (CSMA) (also called "listen before talk") A station that wants to send senses the medium: If the medium is occupied, sending is postponed. If the medium is free, sending begins immediately.

8 CSMA/CD Retry Strategies (1)
What will a station do exactly when it wants to transmit? 1-persistent CSMA When the station finds the medium idle it transmits immediately. When it finds the medium busy it waits for the end of the other transmisson and then starts its own transmission immediately (transmission probability = 1). non-persistent CSMA When the station finds the medium idle it transmits immediately. When the station finds the medium busy it stops sensing, waits a random exponential backoff time and then starts a new transmission attempt. Non-persistent CSMA leads to a better channel utilization when the channel is busy, but also to longer delays for retry messages.

9 CSMA/CD Retry Strategies (2)
p-persistent CSMA (0 < p < 1) Applied to slotted channels. When the station finds a slot idle it transmits with a probability of p and waits for the next slot with a probability of 1-p. When the next slot is idle, the same happens again. However, when it finds the slot busy, this is interpreted as a collision, and the station always waits a random exponential backoff time. Note that non-persistent is not the same a p-persistent with p = 0! IEEE/ISO CSMA/CD (the Ethernet) is 1-persistent.

10 Random Exponential Backoff Time
A random exponential backoff time is defined as follows: A station picks a value k from a list of exponential ones (k = 0,1,2,4,8,…,2m-1) at random where m = min(n,10) and n is the number of unsuccessful attempts, and waits k*512 bit times. The reason for this is that a station does not know how many stations it is com-peting with; it should wait longer if it has tried unsuccessfully several times al-ready.

11 Channel Utilization with Different Retry Strategies

12 Collisions If two or more stations begin to send at the same time, a collision occurs. Note: There is an increased danger of collisions when another transmission is ending: All stations who’s wish to send arose during the other transmission are “synchronized” to the end of this other transmission. Therefore, stations involved in a collision will wait a random time interval be-fore re-trying to send.

13 CSMA/CD: Protocol (1) multiple access

14 CSMA/CD: Protocol (2) collision!

15 CSMA/CD – Frame Format D A S F C P r e a m b l Info
Preamble = 7 Bytes, 7 x ‘ ’ SD = Starting Delimiter (1 Byte, contains ‘ ’) DA = Destination Address (6 Bytes) SA = Source Address (6 Bytes) Info = n bytes of data FCS = Frame Check Sequence (32-bit CRC)

16 CSMA/CD – Address Field Format
The address field format according to IEEE 802 48 -bit format I/G U/L 46 bit address 16 - bit - Format 15 bit address I/G = individual address I/G = group address U/L = globally administered address U/L = locally administered address

17 Cable Types for the Ethernet

18 Hubs and LAN Switching Hubs
In the early Ethernet years the Ethernet cables were actually installed in a physical bus topology (yellow cable or Thin-Wire Ethernet with commercial, pre-fabricated coaxial cables and T-connectors). The bus topology turned out to be impractical for locating faults, connecting new stations, etc. Today Ethernet hubs with a star-shaped wiring are common, in particular in cable conducts in offices (“category 5 cable“, „category 6 cable“). Note that the medium access control protocol in a hub is still CSMA/CD! However, collisions now take place in the hub rather than on the coaxial cable. coax cable bus cat 5/6 cable hub

19 Ethernet LAN with a Hub and Two Coaxial Cables
10BaseT Hub Repeater

20 LAN Switching Throughput in an Ethernet LAN can be further increased by LAN switching. The hub is replaced by a frame-switching node (switch) which forwards the individual frames between the star-topology cables. The format of the Ethernet frames remains the same, thus the end systems (stations) do not notice the difference. When doing LAN switching, the hub is replaced by a frame switch. It eva-luates the MAC destination address and forwards the frame on the appro-priate link. Unlike the hub, the LAN switch must internally operate much faster than the link rate, and it must contain buffers so that many frames arriving at the same time can be forwarded without collisions.

21 2.2 802.11 MAC for Wireless LANs Design goals
A wireless local area network with an 802 MAC layer Should fit under the same LLC layer (802.2, Logical Link Control). Thus it should be compatible with all higher layers, in particular IP. Support for stationary wireless stations and mobile wireless stations (”roaming”) Can operate with an infrastructure (access points) or without an infra-structure (in ad-hoc mode). Many transparencies of this chapter were originally provided by professors Martin Mauve and Hannes Hartenstein. Their support is gratefully acknowledged.

22 IEEE 802.11 - System Architecture (1)
Independent Basic Service Set (IBSS) Set of mobile stations that are able to communicate directly with each other, without connection to a wired network. The stations do not have a “forwar-ding” functionality. The IBSS only permits one-hop communication (1-hop ad-hoc mode). BSS2 BSS1 STA1 STA4 STA5 STA2 STA3

23 IEEE 802.11 - System Architecture (2)
Distribution System Portal 802.x LAN LAN BSS1 Access Point STA1 BSS2 STA2 STA3 ESS IEEE defines access point, distribution system, portal and distribution ser-vices.

24 IEEE 802.11 - System Architecture (3)
Infrastructure Basic Service Set Communication is always between a mobile station and an access point. Extended communication possibilities, but frames between mobile stations are sent over the air twice. Access Point LAN BSS STA1 STA2

25 IEEE 802.11 - System Architecture (4)
LAN Extended Service Set Set of Infrastructure BSSs that are connected by a distribution system. STA1 BSS1 Access Point Distribution System Access Point LAN BSS2 STA2 STA3 ESS

26 Media Access Control (MAC) in 802.11
Traffic Classes Asynchronous data service (standard) Exchange of data packets on a “best effort” basis Supports broadcast and multicast Available in both modes, infrastructure mode and ad-hoc mode Service with QoS guarantees (optional) Implemented by the so-called Point Coordination Function (PCF) Only available in infrastructure mode

27 Why are New MAC Algorithms Needed?
In wireless communication new problems arise because the physical layer operates differently from cable-based physical layers. For example, unlike in an Ethernet segment, not every station can hear every other station dir-ectly. In particular: from “A hears B” and “B hears C” we cannot always conclude that “A hears C”! A cannot sense if C is sending, and vice versa. A B C

28 The Problem of the “Hidden Terminal”
A and C both want to send to B. A senses the medium and notices that it is free. A begins to send. At the same time, C senses the medium and sees that it is free (the signal of A does not reach C). C also begins to send. The signals collide in B, B receives none of the two messages correctly. Neither A nor C can determine the collision since they do not hear each other. A C B

29 CSMA/CD does not work Another reason why CSMA/CD will not work is that wireless cards cannot send and receive at the same time. We conclude: CSMA/CD will not work in wireless networks!

30 IEEE MAC (1) DFWMAC: Distributed Foundation Wireless Medium Access Control Three variants are standardized: DFWMAC-DCF CSMA/CA (mandatory in all WLANs) Distributed Coordination Function – Carrier Sensing Multiple Access with Collision Avoidance “listen before talk“ Reduction of collisions when “busy” by a “random backoff timer“ Acknowledgment of receipt through an ACK (in unicast mode only) The problem of the “hidden terminal” is not solved! DFWMAC-DCF with RTS/CTS (optional) Basic function like DFWMAC-DCF CSMA/CA In addition, avoidance of the hidden terminal problem by a Request-to-Send / Clear-to-Send mechanism (RTS/CTS).

31 IEEE 802.11 MAC (2) DFWMAC-PCF (optional)
PCF = Point Coordination Function collision-free, centralized access control procedure for services with time guarantees Basic idea: the access point polls the stations in a round-robin fashion

32 Priorities by Three Waiting Periods (1)
IFS = Inter-Frame Spacing SIFS (Short Inter-Frame Spacing) Highest priority, for ACK, CTS, answer to polling PIFS (PCF IFS) Intermediate priority, for time-guaranteed services by the PCF (Point Coordination Function). The access point waits the PIFS time before using the medium for control purposes (in particular for polling). DIFS (DCF IFS) Lowest priority, for asynchronous (best effort) data services

33 Priorities by Three Waiting Periods (2)
Medium occupied SIFS PIFS DIFS Next frame Competition

34 DFWMAC-DCF CSMA/CA: Concept
“Listen-before-talk”: stations ready to send sense the medium (carrier sensing). If the medium is free for the duration of an appropriate Inter-Frame Spacing (IFS), the station sends immediately. If the medium is busy, the station waits a DIFS and then waits for an additional random back-off time in order to reduce the probability of a collision. If the medium is accessed by another station during the back-off time and the other station can be heard before the own backoff timer rings, the own back-off timer is stopped until the next transmission attempt. It is not reset; thus the backoff time will be shorter after every unsuccessful attempt. This increases the priority of stations that have waited before. Note: Collisions are still possible, although not very probable.

35 Acknowledgements (Unicast Case)
Problem: Collision detection to recognize a successful transmission on the sender side (like in the Ethernet) does not work! Therefore explicit acknowledgments are needed. If the sender does not receive an acknowledgment, a retransmission takes place in the MAC layer! t SIFS DIFS data Ack waiting period other stations receiver sender Competition period SIFS < slot time

36 Example DIFS DIFS DIFS DIFS boe bor boe bor boe busy Station1 boe busy
arrival of a packet at the MAC layer boe back-off time passed busy medium busy (frame, ack etc.) bor remaining back-off time

37 DFWMAC-DCF with RTS/CTS
Optional. Only available for unicast transmission. Usually not advisable for short packets. Basically a method by which the receiver informs all stations in his radio range to shut up for an upcoming transmission. Solves the hidden terminal problem. Extension of the access procedure by a Network Allocation Vector NAV for the reservation of future slots for the same pair of transmitter and receiver. RTS = Request To Send, CTS = Clear To Send. t waiting period other stations receiver sender competition SIFS DIFS data ACK RTS CTS NAV (RTS) NAV (CTS)

38 DFWMAC-PCF (with Point Coordination Function)
The point coordinator is always an access point. PCF is not available in ad-hoc mode. PCF is an extension (additional function); PCF and DCF can be used at the same time. There is now a “Contention-Free Period” (CFP), in which the PCF coordinates the access to the medium without competition with other stations. PCF uses PIFS (the intermediate IFS) in order to control the medium. The NAV is used to communicate the CFP to the stations (to make the reservation). The assignment of guaranteed sending periods to the stations is achieved by polling. A guaranteed sending period per round leads to a guaranteed minimum bandwidth and a guaranteed maximum delay to access the medium.

39 PCF Example with Polling
PIFS NAV of stations wireless stations point coordinator D1 U1 SIFS NAV D2 U2 super frame t0 medium busy t1 t D3 D4 U4 CFend competition Competition-free period t2 t3 t4

40 Not all fields exist in all frames
IEEE Frame Structure Frame Types Control Frame, Management Frame, Data Frame Sequence numbers (Sequence Control) important for detecting duplicate packets after lost ACKs Four Addresses Receiver, transmitter (physical), BSS identifier, transmitter (logical) Frame Control Duration ID Address 1 Address 2 Address 3 Sequence Control Address 4 Data CRC 2 6 4 0-2312 Version, type, fragmenting, security... Not all fields exist in all frames

41 Addressing: Four Addresses in the Frame
Two bits in the Frame Control field decide how the four addresses are interpreted. The addresses usually are 48-Bit MAC addresses. DS: Distribution System AP: Access Point DA: Destination Address SA: Source Address BSSID: Basic Service Set Identifier RA: Receiver Address TA: Transmitter Address

42 Roaming (better: Hand-over or Hand-off)
What happens when a station moves and the radio link gets weak or is lost? Scanning Scanning of the environment (listen for beacons of APs or send a probe into the medium and wait for an answer). Reassociation Request Contains information about the past AP and asks for a new association. Reassociation Response Success: i.e., an AP answers, the station is physically connected again Failure: continue to scan AP accepts Reassociation Request Registration of the new station with the distribution system The old AP is informed by the distribution system to release the connection to this station.

43 PHY: Why 2.4 GHz? Unlicensed ISM band (Industrial, Scientific, Medical) Advantage: usage free of charge, no permission required Problem: non-exclusive use (e.g., garage door openers and microwave ovens work at 2.4 GHz) = > a very noisy frequency band Solution: use spread-spectrum technology. Mandatory in the US. Frequency ranges and wavelengths: 1 Mm 300 Hz 10 km 30 kHz 100 m 3 MHz 1 m 300 MHz 10 mm 30 GHz 100 m 3 THz 1 m 300 THz VLF LF MF HF VHF UHF SHF EHF Infrared UV

44 Frequency Hopping Spread Spectrum (1)
Several channels from the entire frequency band are used in parallel. Sen-ders and receivers rapidly jump between the channels in an agreed se-quence. In this way, narrow-band noise has less effect.

45 Frequency Hopping Spread Spectrum (2)
1 2 3 t d user data slow hopping (3 bits/hop) fast (3 hops/bit)

46 Frequencies in the 2.4 GHz Band

47 LAN Bridges A brigde connects two or more LANs that may use different MACs (e.g., an Ethernet LAN with a Wireless LAN). It can be considered as a layer-2 gateway. A bridge has a frame filter. It forwards only those frames to the neighbor LAN whose destination address is not in the local segment. A bridge operates on layer 2 exclusively (on MAC frames). Protocols of the higher layers are not taken into consideration. In particular, a LAN bridge is quite different from an IP router. Bridges are usually self-learning, i.e., they learn from the incoming frames which MAC addresses are located in which attached LANs.

48 Protocol Layers of a LAN Bridge
MAC relay bridge protocol, bridge management LLC MAC instance A B Connection A Connection B Layer 1 Network B Network A

49 Example of a Bridge between Three LANs
Sales Production Research and Development

50 Entries in the Table of a Self-Learning Bridge
Example destination address output port timer D8E8F 1 300 s 08002B32A945 2 180 s 08002B32A988 3 240 s

51 Spanning Trees In order to make the interconnection of LANs more reliable, there are often several in-terconnection points (bridges) between them. In order to avoid the cycling of frames in such a network, the bridges must agree on a spanning tree for the graph. This is done with a spanning tree protocol (not discussed in detail here). bridge 1 Sales Production Research and Development bridge 2

52 Bridges and the like... A hub operates on layer 1. It forwards every arriving frame to all outgoing links. It replaces a physical bus topology, implementing the MAC function inside the box. The number of frame collisions is not reduced by a hub. A frame switch forwards each arriving frame to exactly one outgoing link, leading directly to the destination. The decision is based on the destination address in the LAN frame. It functions like a packet switching device, but on layer 2. Compared to a hub, the number of collisions is reduced since incoming frames are buffered, and switching is done internally at a multiple of the line speed. There is no frame filter function. A bridge also operates on layer 2. It contains a self-learning filter and forwards only those packets that are not intended for stations on the local LAN. A router is a packet switching device, typically for IP packets, on layer 3.

53 Conclusions The purpose of the MAC protocol in LANs is to control the access of independent stations to the shared medium. Today, Ethernet and Wireless LAN are the two most popular MAC protocols. Hubs, frame switches and bridges allow an easy interconnection of LANs and LAN devices. All MAC protocols run underneath the same LLC (“upper half of layer 2”) which makes them easy to use for IP or other higher layers.


Download ppt "2. Advanced Medium Access Control Protocols"

Similar presentations


Ads by Google