Chapter 4 The Medium Access Sublayer 1
Chapter 4 The Medium Access Layer 4.1 The Channel Allocation problem - Static and dynamic channel allocation in LANs & MANs 4.2 Multiple Access Protocols - ALOHA, CSMA, CSMA/CD, Collision-free protocols, Limited-contention protocols, Wireless LAN protocols 4.3 Ethernet - Cabling, MAC sublayer protocol, Backoff algorithm, Performance, Gigabit Ethernet, 802.2 Logical Link Control 4.4 Wireless LANs - 802.11 protocol stack, physical layer, MAC sublayer protocol, frame structure 2
4.5 Broadband Wireless - Comparison of 802.11 with 802.16, protocol stack, frame structure 4.6 Data Link Layer Switching - Bridges from 802.x to 802.y, Local internetworking, Spanning tree bridges, Remote bridges 3
4.1 The Channel Allocation problem 4.1.1 Static channel Allocation in LANs and WANs Frequency Division Multiplexing (FDM) 4
Poisson process and the M/M/1 queue will be discussed in the next chapter. 5
6
4.1.2 Dynamic Channel Allocation in LANs and WANs Assumptions 1. Station Model. The model consists of N independent stations, each generates the frame with probability t in an interval t. Once a frame is generated, the station is blocked. 2. Single Channel Assumption. A single channel is available for all communication. 3. Collision Assumption. If two frames are transmitted simultaneously, they are destroyed and must be retransmitted again later. There are no other errors. 7
4a. Continuous Time. Frame transmission can begin at any instant. 4b. Slotted Time. Time is divided into slots. Frame transmission always begin at the start of a slot. 5a. Carrier Sense. Stations can tell if the channel is in use before trying to use it. 5b. No Carrier Sense. Stations cannot sense the channel before trying to use it. 8
4.2.1 ALOHA 4.2 Multiple Access Protocols 4-1. 9
4-2. 10
11
4-3. 12
13
14
15
16
17
18
19
20
21
22
23
24
4.2.2 Carrier Sense Multiple Access Protocols 25
26
P-persistent (slotted case) 1. When a station has data to send, it first listens to the channel to see if any one else is transmitting. 2. If the channel is idle, the station transmits the frame with probab P,with probability q=1-p, it defers until the next slot and goes to 1. 3. If the channel is busy, it waits until the next slot and goes to step 1. 4. If a collision occurs (no acknowledgement), the station waits a ran amount of time and goes Step1. 27
28
4-4. 29
4-5. 30
4.2.3 Collision-Free Protocols 4-6. 31
4-7. 32
33
4.2.4 Limited-contention Protocols 34
Limited-Contention protocols 35
36
37
38
4.8 4.8. 4.8. 39
The Adaptive Tree Walk protocol (Method for testing soldiers for syphilis) 4-9 40
41
i i 2 i q2 i i i 2 q 42
4.2.6 Wireless LAN Protocols 43
4-11. 44
4-11 4-11 45
4-12. 4-12 4-12 4-12, 46
4-12. 47
48
49
4.3 Ethernet Ethernet Cabling Manchester Encoding The Ethernet MAC Sublayer Protocol The Binary Exponential Backoff Algorithm Ethernet Performance Switched Ethernet Fast Ethernet Gigabit Ethernet IEEE 802.2: Logical Link Control Retrospective on Ethernet 50
Ethernet Cabling The most common kinds of Ethernet cabling. 51
Ethernet Cabling (2) Three kinds of Ethernet cabling. (a) 10Base5, (b) 10Base2, (c) 10Base-T. Three kinds of Ethernet cabling. (a) 10Base5, (b) 10Base2, (c) 10Base-T 52
Ethernet Cabling (3) Cable topologies. (a) Linear, (b) Spine, (c) Tree, (d) Segmented. 53
Ethernet Cabling (4) (a) Binary encoding, (b) Manchester encoding, (c) Differential Manchester encoding. 54
Ethernet MAC Sublayer Protocol 7 1 SOF: Start of frame Frame formats. (a) DIX Ethernet, (b) IEEE 802.3. DIX (DEC, Intel, Xerox) 55
Ethernet MAC Sublayer Protocol (2) Collision detection can take as long as 2. 56
The Binary Exponential Back off Algorithm 1. Any station experiences collisions, it has to choose a random number between 0 and 2 1,and that number of slots is skipped ( 10 ) 2. After ten collisions have been reached the randomization interval is frozen at a maximum of 1023 slots 3. After 16 collisions the controller has to stop transmission and reports failure back the the computer, Further recovery is up to higher layers. 57
Ethernet performance Assumptions a. Heavy and constant load, that is, stations always ready to transmit b. Each station transmits during a contention slot with probability The probability A that some station acquires the channel in that slot is k 1 A kp(1 p) A is maximized when, with A 1 e as k p 1 k p k 58
The probability that the contention interval has exactly j 1 it is A(1 A), so the mean number of slots per contention is given by Since each slot has a duration Assuming optimal as 1 k e A If the mean frame takes channel efficiency = where j 0 ja(1 A) j 1 1 p B: bandwidth, i.e. F: frame length L: cable length A p p C: propagation speed 2 p 1 k slots in, the mean contention interval A 1 e w 2 e 5. 4 seconds to transmit then p 2 A F B 1 F 2( L ) e 2BLe B C 1 CF j w 2 A 59
Ethernet Performance Efficiency of Ethernet at 10 Mbps with 512-bit slot times. 60
Switched Ethernet A simple example of switched Ethernet. 61
Fast Ethernet The reasons for fast Ethernet 1. The need to be backward compatible with existing Ethernet LANs 2. The fear that a new protocol might have unforeseen problems 3. The desire to get the job done before the technology changed All fast Ethernet systems use hubs and switches 100 Base-T4 uses 8B/6T coding and 100 Base-TX uses 4B/5B coding The original fast Ethernet cabling. 62
Gigabit Ethernet All configurations of gigabit Ethernet are point-to-point Gigabit Ethernet supports full-duplex mode (with switch) and half-duplex-mode (with hub) CSMA/CD protocol is required for half- duplex mode operation (maximum distance is 25 meters) When carrier extension (512 bytes frame) and frame bursting are used the distance can be 200meters (a) A two-station Ethernet. (b) A multistation Ethernet. 63
Gigabit Ethernet (2) Gigabit Ethernet supports both copper and fiber cabling Two wavelengths are permitted = 0.85μm and 1.3μm Three fiber core diameters are permitted = 10, 50, and 62.5μm Gigabit Ethernet cabling. 64
IEEE 802.2: Logical Link Control (a) Position of LLC. (b) Protocol formats. 65
Retrospective on Ethernet 1. Ethernet is simple and flexible - reliable, cheap, easy to maintain, easy to install 2. Ethernet interworks easily with TCP/IP 3. Ethernet has been able to evolve in certain crucial ways - speeds gone up - hub and switches introduced 66
4.4 Wireless LANs The 802.11 Protocol Stack The 802.11 Physical Layer The 802.11 MAC Sublayer Protocol The 802.11 Frame Structure Services 67
The 802.11 Protocol Stack FHSS: Frequency Hopping Spread Spectrum (dwell time < 400ms) DSSS: Direct Sequence Spread Spectrum (up to 2 Mb/s) OFDM: Orthogonal Frequency Division Multiplexing ( up to 54 Mb/s) HR-DSSS: High Rate Direct Sequence Spread Spectrum (11Mb/s) Part of the 802.11 protocol stack. 68
The 802.11 MAC Sublayer Protocol (a) The hidden station problem. (b) The exposed station problem. 69
The 802.11 MAC Sublayer Protocol (2) NAV: Network Allocation Vector The use of virtual channel sensing using CSMA/CA. 70
The 802.11 MAC Sublayer Protocol 802.11 supports two modes of operation: DCF and PCF A. Distributed Coordination Function (DCF) uses CSMA/CA (CSMA / with Collision Avoidance) (a) The first mode supported by CSMA/CA (1) When a station wants to transmit, it senses the channel (2) If it idle, it just starts transmitting (The sender does not sense the channel while transmitting) (3) If the channel is busy, the sender defers until it goes idle and then starts transmitting (4) If a collision occurs, it wait a random amount of time (exponential back off) and then try again later 71
(b) The second mode of CSMA/CA is based on MACAW (Multiple Access with Collision Avoidance for Wireless) (1) When a station wants to transmit, it senses the channel (2) If the channel is idle longer than SIFS interval it transmits an RTS (Request to Send, 30 bytes) which contains the length of the data frame (3) After received the RTS frame, the receiving station replies with a CTS (Clear to Send) frame which contains the data length (copied from the RTS frame) (4) Upon receipt of the CTS, the sender transmits the frame (5) All stations heard the RTS frame should remain silent for a period of time (an estimation based on the information of RTS) (6) All stations heard the CTS frame should remain silent for a period of time (an estimation based on the information of CTS) (7) If the channel is busy, the sender goes to step1 72
73
B. Point Coordination Function (PCF) (contention free) (1) When a station wants to gain control of the medium, it sends out a beacon at the end of PIFS. The beacon frame contains system parameters such as hopping sequences, and dwell time (for FHSS), clock synchronization, length of the contention free period, etc. (2) All other stations heard the beacon will keep silent and wait for polling sign up frame (3) After gained control, it invites new stations to sign up for polling service (4) At the end of the contention free period, all station return to DCF mode 74
The 802.11 MAC Sublayer Protocol (3) To deal with the problem of noise channels, 802.11 allows frames to be fragmental into smaller pieces, each with its own checksum and ack. (using stop-and-wait protocol) A fragment burst. 75
The 802.11 MAC Sublayer Protocol (4) PCF and DCF can coexist within one cell Interframe spacing in 802.11. 76
The 802.11 Frame Structure The 802.11 data frame. 77
Version: Protocol version Type: data, control, or management Subtype: RTS, CTS, ack, To DS and from DS: to or from inter cell distribution system (e.g. Ethernet) MF: more fragments Retry: retransmission Power management: put the receiver into sleep state or take it out More: additional frames coming W: wired equivalent privacy O: processed strictly in order Duration: time length of the frame and ack Addresses1.2.3 and 4: Source, destination, the source and destination base stations for intercell traffic Sequence: Sequence No. 78
802.11 Services Distribution Services (managing cell membership, and interacting with station outside the cell) Association: To connect to a base station Disassociation: To disconnect from a base station Reassociation: To change its preferred base station Distribution: How to route frames (local or intercell) Integration: Translation from 802.11 to other protocol frame format 79
802.11 Services Intracell Services Authentication Deauthentication (leave the network) Privacy: managing the encryption and decryption Data Delivery 80
4.5 Broadband Wireless Local Multipoint Distribution Service (LMDS) Architecture of an LMDS system. 81
4.5.1 Comparison of 802.11 with 802.16 802.16 Worldwide Interoperability for Microwave Access (WiMAX) 微波存取全球互通 a. To provide high-bandwidth wireless communications b. WiMAX is originally for fixed but later it can be mobile (802.16m) c. 802.11 uses ISM band, 802.16 uses licensed band. (in general) d. 802.16 is full-duplexing e. 802.16 may provide communications over several kilometers f. 802.16 is connection oriented g. 802.16 provides good quality of services. (Wideband Services) 82
4.5.2 The 802.16 Protocol Stack 802.16b supports OFDM in 5GHz ISM band 802.16a supports OFDM in 2-11 GHz 83
4.5.3 The 802.16 Physical Layer The 802.16 transmission environment. For example, in a typical 25MHz band QAM64 150 Mb/s QAM16 100 Mb/s QPSK 50 Mb/s 84
802.16 provides Frequency Division Duplexing(FDD) or Time Division Duplexing (TDD) and may use Forward Error correcting codes Frames and time slots for time division duplexing. 85
4.5.4 The 802.16 MAC Sublayer Protocol a. Only the payloads are encrypted 86
b. MAC sublayer common part c. Two forms of bandwidth allocation: per station, per connection 87
4.5.5 The 802.16 Frame Strucutre 88
4.7 Data Link Layer Switching Bridges from 802.x to 802.y Local Internetworking Spanning Tree Bridges Remote Bridges Repeaters, Hubs, Bridges, Switches, Routers, Gateways Virtual LANs 89
Data Link Layer Switching Multiple LANs connected by a backbone to handle a total load higher than the capacity of a single LAN. 90
Bridges from 802.x to 802.y Operation of a LAN bridge from 802.11 to 802.3. 91
Bridges from 802.x to 802.y (2) The IEEE 802 frame formats. The drawing is not to scale. 92
Local Internetworking When the bridges are first plugged in, they use the flooding algorithm and the backward learning algorithm to establish the routing table A configuration with four LANs and two bridges. 93
The routing procedure of bridges 1. If destination and source LANs are the same, discard the frame 2. If the destination and source LANs are different, forward the frame 3. If the destination LAN is unknown, use flooding 94
Spanning Tree Bridges To prevent looping Two parallel transparent bridges. 95
The procedure to establish a spanning tree 1. Take the bridge with lowest serial number as the root 2. Compute the shortest path form the root to every bridge and LAN 3. Connect these shortest paths to from a tree (no looping) 96
Spanning Tree Bridges (2) (a) Interconnected LANs. (b) A spanning tree covering the LANs. The dotted lines are not part of the spanning tree. 97
Remote Bridges To connect two (or more) distance LANs Remote bridges can be used to interconnect distant LANs. 98
Repeaters, Hubs, Bridges, Switches, Routers and Gateways (a) Which device is in which layer. (b) Frames, packets, and headers. 99
Repeaters, Hubs, Bridges, Switches, Routers and Gateways (2) When two frames arrive simultaneously at a hub, they will collide Bridges and switched will route the frames based on their destination addresses Bridges connect LANs (a) A hub. (b) A bridge. (c) a switch. 100
Virtual LANs A building with centralized wiring using hubs and a switch. 101
The reasons for virtual LANs (a) Fitting into the organization structure (b) Loading partition (c) Relieving broadcast storm 102
Virtual LANs (2) VLANs are based on specially-designed VLAN-aware switches (bridges) (a) Four physical LANs organized into two VLANs, gray and white, by two bridges. (b) The same 15 machines organized 103 into two VLANs by switches.
Each VLAN is assigned a distinct color. Three methods are used to distinguish the color of an incoming frame 1. Every port is assigned a VLAN color (when a host moved, the port must be reassigned) 2. Every MAC address is assigned a VLAN color 3. Every layer 3 protocol or IP address is assigned a VLAN color (The payload must be examined by the data link layer, which violates the rule: independence of the layers. When the layer 3 protocol changed, the switch fails.) 104
There are some issues for VLAN (a) What is the VLAN field format? (b) How to identify VLAN field? (c) Who generates the VLAN field? (d) What happens to frames that are already the maximum size? The 802.1Q will solve these problems 105
The IEEE 802.1Q Standard To support VLAN, switches must be VLAN-aware. Transition from legacy Ethernet to VLAN-aware Ethernet. The shaded symbols are VLAN aware. The empty ones are not. 106
The IEEE 802.1Q Standard (2) Priority: This field makes it possible to distinguish hard real-time traffic from soft real-time traffic from time-insensitive traffic. CFI (Canonical Format Indicator): To indicate that the payload contains 802.5. VLAN Identifier: To indicate which VLAN the frame belong to. The 802.3 (legacy) and 802.1Q Ethernet frame formats. 107
Summary Channel allocation methods and systems for a common channel. 108