The Medium Access Sublayer -...
Transcript of The Medium Access Sublayer -...
1
Chapter 4
The Medium Access
Sublayer
2
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
3
• 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
4
4.1 The Channel Allocation problem
4.1.1 Static channel Allocation in LANs and WANs
Frequency Division Multiplexing (FDM)
5
Poisson process and the M/M/1 queue will be discussed in the
next chapter.
6
7
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 in an interval . Once a frame is generated, the station is
blocked.
2. Single Channel Assumption. A single channel
is available for all communication.
3. Collision Assumption(observable). If two
frames are transmitted simultaneously, they
are destroyed and must be retransmitted again
later. There are no other errors.
t t
8
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.
4.2 Multiple Access Protocols
• ALOHA
• Carrier Sense Multiple Access
• Collision-free protocols
• Limited-contention protocols
• Wireless LAN protocols
9
10
4.2 Multiple Access Protocols
4.2.1 ALOHA
4-1.
11
4-2.
12
13
4-3.
14
15
16
17
4.2.2 Carrier Sense Multiple Access Protocols
18
19
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.
20
21
4-4.
22
4-5.
23
4.2.3 Collision-Free Protocols
4-6.
Collision-Free Protocols (2)
Token ring.
Station
Direction of
transmission
Token
24
25
4-7.
26
27
4.2.4 Limited-contention Protocols
28
Limited-Contention protocols
29
30
31
32
4.8
4.8.
4.8.
33
4-9
The Adaptive Tree Walk protocol
(Method for testing soldiers for syphilis)
34
35
i
i
i
i2
iq 2
qi2
Wireless LAN Protocols (1)
A wireless LAN. (a) A and C are hidden terminals
when transmitting to B.
36
Wireless LAN Protocols (2)
A wireless LAN. (b) B and C are exposed terminals
when transmitting to A and D. 37
Wireless LAN Protocols (3)
The MACA protocol. (a) A sending an RTS to B. (b) B
responding with a CTS to A. 38
39
4.3 Ethernet
• Physical Layer
• 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
Classic Ethernet Physical Layer
Architecture of classic Ethernet 40
41
Ethernet Cabling
The most common kinds of Ethernet cabling.
42
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
43
Ethernet Cabling (3)
Cable topologies. (a) Linear, (b) Spine, (c)
Tree, (d) Segmented.
44
Ethernet Cabling (4)
(a) Binary encoding, (b) Manchester encoding,
(c) Differential Manchester encoding.
45
Ethernet MAC Sublayer Protocol
Frame formats. (a) DIX Ethernet, (b) IEEE 802.3.
SOF: Start of frame
DIX (DEC, Intel, Xerox)
7 1
46
Ethernet MAC Sublayer
Protocol (2)
Collision detection can take as long as 2 .
The Binary Exponential Back off Algorithm
1. Any station experiences collisions, it has to choose a
random number between 0 and ,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.
47
12
48
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
A is maximized when ,
with as
p
k
1)1( kpkpA
kp 1
eA 1 k
49
The probability that the contention interval has exactly slots in
it is
so the mean number of slots per contention is given by
Since each slot has a duration , the mean contention interval
Assuming optimal , i.e.
as
If the mean frame takes seconds to transmit then
channel efficiency =
where B: bandwidth
F: frame length
L: cable length
C: propagation speed
j,)1( 1 jAA
AAjA
j
j 1)1(
0
1
2A
w 2
pk
p 1e
A1
k eA
1 4.52 ew
p
Ap
p
2
CFBLee
CL
BF
BF
21
1
)(2
50
Ethernet Performance
Efficiency of Ethernet at 10 Mbps with 512-bit slot times.
Switched Ethernet (1)
(a) Hub. (b) Switch. 51
Switched Ethernet (2)
An Ethernet switch.
Switch
Twisted pair
Switch ports
Hub
52
53
Fast Ethernet
The original fast Ethernet cabling.
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
54
Gigabit Ethernet
(a) A two-station Ethernet. (b) A multistation 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
55
Gigabit Ethernet (2)
Gigabit Ethernet cabling.
•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
10 Gigabit Ethernet
Gigabit Ethernet cabling 56
Wireless Lans
• 802.11 architecture and protocol stack
• 802.11 physical layer
• 802.11 MAC sublayer protocol
• 802.11 frame structure
• Services
57
802.11 Architecture and Protocol Stack (1)
802.11 architecture – infrastructure mode
Access
Point
Client
To Network
58
802.11 Architecture and Protocol Stack (2)
802.11 architecture – ad-hoc mode 59
802.11 Architecture and Protocol Stack (3)
Part of the 802.11 protocol stack. 60
The 802.11 MAC Sublayer Protocol (1)
Sending a frame with CSMA/CA. 61
The 802.11 MAC Sublayer Protocol (2)
The hidden terminal problem. 62
The 802.11 MAC Sublayer Protocol (3)
The exposed terminal problem. 63
The 802.11 MAC Sublayer Protocol (4)
The use of virtual channel sensing using
CSMA/CA. 64
The 802.11 MAC Sublayer Protocol (5)
Interframe spacing in 802.11 65
802.11 Frame Structure
Format of the 802.11 data frame 66
67
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
Protected: encrypted for Security
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.
68
802.11 Services
• Association: To connect to a base station
• Reassociation: To change its preferred base
station
• Disassociation: To disconnect from a base station
• Distribution: How to route frames (local or intercell)
• Integration: Translation from 802.11 to other
protocol frame format
Distribution Services
(managing cell membership, and interacting
with station outside the cell)
69
802.11 Services
• Authentication
• Deauthentication (leave the network)
• Privacy: managing the encryption
and decryption
• Data Delivery: transmit and receive data
Intracell Services
Data Link Layer Switching
• Uses of bridges
• Learning bridges
• Spanning tree bridges
• Repeaters, hubs, bridges, switches,
routers, and gateways
• Virtual LANs
70
71
Bridges from 802.x to 802.y
The IEEE 802 frame formats. The drawing is not to scale.
72
Bridges from 802.x to 802.y
Operation of a LAN bridge from 802.11 to 802.3.
Learning Bridges (1)
Bridge connecting two multidrop LANs 73
Learning Bridges (2)
Bridges (and a hub) connecting seven point-to-
point stations. 74
Learning Bridges (3)
Protocol processing at a bridge. 75
Spanning Tree Bridges (1)
Bridges with two parallel links
76
Spanning Tree Bridges (2)
A spanning tree connecting five bridges. The dotted
lines are links that are not part of the spanning tree. 77
Poem by Radia Perlman (1985)
Algorithm for Spanning Tree (1)
I think that I shall never see
A graph more lovely than a tree.
A tree whose crucial property
Is loop-free connectivity.
A tree which must be sure to span.
So packets can reach every LAN.
. . .
78
Poem by Radia Perlman (1985)
Algorithm for Spanning Tree (2)
. . .
First the Root must be selected
By ID it is elected.
Least cost paths from Root are traced
In the tree these paths are placed.
A mesh is made by folks like me
Then bridges find a spanning tree.
79
Repeaters, Hubs, Bridges, Switches,
Routers, and Gateways
(a) Which device is in which layer.
(b) Frames, packets, and headers. 80
Virtual LANs (1)
A building with centralized wiring using hubs and a
switch. 81
Virtual LANs (2)
Two VLANs, gray and white, on a bridged LAN. 82
The IEEE 802.1Q Standard (1)
Bridged LAN that is only partly VLAN-aware. The shaded
symbols are VLAN aware. The empty ones are not. 83
84
The IEEE 802.1Q Standard (2)
The 802.3 (legacy) and 802.1Q Ethernet frame formats.
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.
85
Summary
Channel allocation methods and systems for a common channel.
Homework due 2012.04.24
1. State the CSMA/CD protocol.
2. State the Binary Exponential Backoff (Traucated) algorithm.
3. Measurements of a slotted ALOHA channel with an infinite
number of users show that 15% of the slots are idle.
(a) What is the channel load, G?
(b) What is the throughput?
(c) Is the channel underloaded or overloaded?
4. State the hidden terminal problem and the exposed terminal
problem in a wireless LAN.
5. The station source address of each Ethernet is globally unique
assigned to ensure that no two stations anywhere in the world
have the same address. What is the maximum number of
addresses we may have?
6. Why do the Ethernet frames have to be at least 64 bytes
long?
86