Document 7347042

Download Report

Transcript Document 7347042

Chapter 4
The Medium Access Control
Sublayer
10/11/2007
EETS 7304
1
MAC Layer
IP
MAC
PPP
Manch QAM
router
IP
PPP
QAM
IP
MAC
Manch
LAN
WAN
10/11/2007
EETS 7304
2
The Channel Allocation Problem
Static Allocation
Dynamic Allocation
Tc
Ts
l
Tn
m
Ts/N
Nl
N
l
Nm
m
Tn = (Ts/N)/(1 – r)
l
m
Tc = Ts/(1 – r)
Example T1 carrier: N = 24, 6400 bits/frame. Ts = 6400/64000 =
0.1 s. For r = 0.8 Tc = 0.5 s, Tn = 0.5/24 s for the same traffic.
10/11/2007
EETS 7304
3
Dynamic Channel Allocation in LANs
Station Model:
N independent stations sending messages according
to Poisson distribution.
Single Channel:
A single channel is available to all stations
to transmit to and receive from.
Carrier Sense:
Stations sense if the channel is in use and wait
vs. stations cannot tell if the channel is in use.
Collision Assumption:
If stations transmit at the same time, frames
will collide and garbled. All stations can detect
collision and retransmit frame later.
Frame beginning:
Pure Aloha (frame can start transmission
at any time) vs. slotted Aloha (frame can start
transmission only at a given time instance).
10/11/2007
EETS 7304
4
Multiple Access Protocols
•
•
•
•
ALOHA
Carrier Sense Multiple Access Protocols
Collision-Free Protocols
Wavelength Division Multiple Access Protocols
10/11/2007
EETS 7304
5
Pure ALOHA (1970)
In pure ALOHA, frames are transmitted at completely arbitrary times.
10/11/2007
EETS 7304
6
Collision conditions in pure Aloha
• All frames are of the same size.
• Frame transmission can start at any time instant.
If another
frame starts
here we will
have collision
period is 2t
10/11/2007
EETS 7304
7
(throughput per packet time)
Throughput versus offered traffic for
ALOHA systems.
Max throughputs:
18% at G = 0.5 for pure
37% at G = 1 for slotted.
10/11/2007
EETS 7304
8
CSMA: Persistent and Non-persistent
(1-p) carr
carr
no carr
carr
no carr
-> transmit
-> check after
random time
-> transmit ->random ->check
with prob p. back off next slot
p-persistent is slotted
nonpersistent
10/11/2007
EETS 7304
9
CSMA with Collision Detection
CSMA/CD can be in one of three states: contention, transmission, or
idle. Minimum contention slot is 2t where t ( 5 ms/km) is the
propagation delay between the two most remote stations.
10/11/2007
EETS 7304
10
Reservation protocols: basic bit-map protocol
10/11/2007
EETS 7304
11
The binary countdown protocol
10/11/2007
EETS 7304
12
Wavelength Division Multiple Access
tunable control transmit
fixed data transmit
m time slots for control
station
Station A
x x
Station B
x
x
x x
x
x
A
tunable data receive
fixed control receive
Fiber LAN implementation
A wants to send data to B
1. A tunes to listen B status S.
S tells B control slots #3 is free.
2. A tunes transmit control and sends
to B “data for you in my slot 4”
in B control slot #3.
3. B tunes to A output and receives
data from slot 4.
10/11/2007
S
S
n time slots for data plus 1 for status
x x x
x x
x x x
x x
B
x x
C
x x
x x
S
S
S
S
x x
Channel allocations per station
EETS 7304
13
Ethernet
•
•
•
•
•
•
•
•
•
•
10/11/2007
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
EETS 7304
14
Ethernet 802.3
Base
band
10 MHz
Segment length in
hundredths meters
T conn.
Vampire taps
10/11/2007
EETS 7304
15
Ethernet Cabling
Three kinds of Ethernet cabling.
(a) 10Base5, (b) 10Base2, (c) 10Base-T.
10/11/2007
EETS 7304
16
Ethernet coding (+/- 0.85 V)
(a) Binary encoding, (b) Manchester encoding,
(c) Differential Manchester encoding.
10/11/2007
EETS 7304
17
Ethernet MAC Sublayer Protocol
Frame formats. (a) DIX (DEC, Intel Xerox) (b) IEEE 802.3.
• Address bit 46 determines local or global address.
• Min frame is 64 bytes from dest. address to checksum.
10/11/2007
EETS 7304
18
Ethernet 802.3
•
•
•
•
•
•
7
1
6
6
2
46-1500
4
Pre
SOF
DA
SA
Length/type
Data
FC
Preamble (PRE). The PRE is an alternating pattern of ones and zeros.
Start-of-frame delimiter (SOF). The SOF is an alternating pattern of
ones and zeros, ending with two consecutive 1-bits.
Destination address (DA). Source addresses (SA).
Length/Type indicates either the number of MAC-client data bytes
that are contained in the data field of the frame, or the frame type ID
if the frame is assembled using an optional format.
Data n bytes (46=< n =<1500) of any value. (The total frame minimum
is 64bytes.)
Frame check sequence (FCS) 32-bit cyclic redundancy check (CRC)
value, which is created by the sending MAC and is recalculated by the
receiving MAC to check for damaged frames.
Collision detection can take as long as 2t
This is to sense a collision before end of the frame reach far end.
In 10 Mbps LAN 1 bit is 100 nsec, and max segment 2500 m round
trip delay is 2t = 50 mksec = 500 bits = 64 bytes.
10/11/2007
EETS 7304
20
Binary exponential backoff
second collision
Frame
Frame
P sec
for i-th collision station
randomly chooses between
0 and 2i - 1 contention slots
until 1023.
first collision
Simplified version with persistance p:
If k stations contend for a channel the probability that any of k gets a channel is:
A = kp(1 – p)k-1
p = 1/k gives Amax -> 1/e for k -> inf.
Average number of contention slots = S0 jA(1 – A)j-1 = 1/A.
Therefore,
channel efficiency = P/(P + 2t/A)
00
10/11/2007
EETS 7304
21
Efficiency of Ethernet at 10 Mbps with 512bit slot times
10/11/2007
EETS 7304
22
Switched Ethernet
Plug-in card handles collision domain either usual way or w/out collision.
Frames destined outside plug-in domain are switched over backplane to
the destined plug-in card.
10/11/2007
EETS 7304
23
Gigabit Ethernet
(a) A two-station Ethernet.
10/11/2007
(b) A multistation Ethernet.
EETS 7304
24
Gigabit Ethernet cabling
10/11/2007
EETS 7304
25
IEEE 802.2: Logical Link Control
(a) Position of LLC.
(b) Protocol formats.
When reliable service is required the LLC (Logical Link Control) layer is
added on the top of MAC layer. LLC is HDLC based (frame sequencing etc.).
10/11/2007
EETS 7304
26
Wireless LANs (WiFi)
•
•
•
•
•
10/11/2007
The 802.11 Protocol Stack
The 802.11 Physical Layer
The 802.11 MAC Sublayer Protocol
The 802.11 Frame Structure
Services
EETS 7304
27
Part of the 802.11 protocol stack
MAC: PCF - Point Coordin. Funct.: Base Station Polls mobiles within its cell.
DCF - Distributed Coordination Function further discussed.
FHSS - Frequency Hopping Spread Spectrum
DSSS - Direct Sequence Spread Spectrum
OFDM - Orthogonal Frequency Division Multiplexing
HR-DSSS - High Rate DSSS
10/11/2007
EETS 7304
28
Wireless LAN (bandwidth is 11 to 54 MHz)
(b) B transmitting: C hears B
and falsely concludes that it
cannot transmit to D.
(a) A transmitting: C is out of
range and cannot hear A.
Before transmitting the transmitting station wants to know whether is
any activity around receiver. CSMA tells only activity around transmitter.
Solution is that sender stimulate receiver to transmit short frame.
10/11/2007
EETS 7304
29
DCF: wireless MACA
(Multiple Access with Collision Avoidance)
• C hears RTS A to B (30 bytes) frame with the length of the frame to follow.
• D hears B responding to A with a CTS (copying the length of the next frame).
• A starts transmitting.
10/11/2007
EETS 7304
30
The use of virtual channel sensing using
CSMA/CA
NAV - Network Allocation Vector
10/11/2007
EETS 7304
31
A fragment burst
Due to the noisy wireless channels data packets are split into short fragments.
10/11/2007
EETS 7304
32
Interframe spacing in 802.11
10/11/2007
EETS 7304
33
The 802.11 Data Frame Structure
For Base Station
For NAV
12 bit frame, 4 bits fragment
Frames must process in order
Data, Control, Mngmnt.
RTS, CTS
Frame out of Cell
Encrypted using WEP
More frames to follow
More fragments to follow
Toggle bit to put receiver to sleep
Retransmitted frame
10/11/2007
EETS 7304
34
802.11 Distribution Services
•
•
•
•
•
10/11/2007
Association (Attach)
Disassociation (Detach)
Reassociation (Handoff)
Distribution (Frame routing)
Integration (Protocol conversion)
EETS 7304
35
802.11 Intracell Services
•
•
•
•
10/11/2007
Authentication (of mobile)
Deauthentication (on leave)
Privacy (encryption)
Data Delivery (data exchange)
EETS 7304
36
Broadband Wireless (WiMax)
•
•
•
•
•
10/11/2007
Comparison of 802.11 and 802.16
The 802.16 Protocol Stack
The 802.16 Physical Layer
The 802.16 MAC Sublayer Protocol
The 802.16 Frame Structure
EETS 7304
37
802.11 vs. 802.16
environment
mobility
access
distance
spectrum
QoS
errors
security
bit rate
802.11
802.16
indoor
outdoor
mobile
fixed
point-to-multipoint
point-to-point
meters
km
ISM (900 MHz-5.7 GHz) 10 - 66 GHz (mm waves)
internet
multimedia (con orient)
detection
correction (Hamming)
optional
mandatory
10 Mbps
100 Mbps
The 802.16 Protocol Stack
10/11/2007
EETS 7304
39
The 802.16 Physical Layer
10/11/2007
EETS 7304
40
The 802.16 Physical Layer (2)
Frames and time slots for time division duplexing.
10/11/2007
EETS 7304
41
The 802.16 MAC Sublayer Protocol
Service Classes
• Constant bit rate service (for T1)
• Real-time variable bit rate service (for multimedia)
• Non-real-time variable bit rate service (file transfer)
• Best efforts service (for contended upstream traffic)
10/11/2007
EETS 7304
42
The 802.16 Frame Structure
(a) A generic frame. (b) A bandwidth request frame.
10/11/2007
EETS 7304
43