10/11/2007 EETS 73041 The Medium Access Control Sublayer Chapter 4.
Transcript of 10/11/2007 EETS 73041 The Medium Access Control Sublayer Chapter 4.
10/11/2007 EETS 7304 1
The Medium Access ControlSublayer
Chapter 4
10/11/2007 EETS 7304 2
MAC Layer
LAN
WAN
router
Manch
MAC PPP
QAM
IP
Manch
MAC
IP QAM
PPP
IP
10/11/2007 EETS 7304 3
The Channel Allocation ProblemStatic Allocation Dynamic Allocation
Tc = Ts/(1 – )
Tn = (Ts/N)/(1 – )
Tn
Ts/N
N
Tc
Ts
Example T1 carrier: N = 24, 6400 bits/frame. Ts = 6400/64000 = 0.1 s. For = 0.8 Tc = 0.5 s, Tn = 0.5/24 s for the same traffic.
10/11/2007 EETS 7304 4
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 5
Multiple Access Protocols
• ALOHA• Carrier Sense Multiple Access Protocols• Collision-Free Protocols• Wavelength Division Multiple Access Protocols
10/11/2007 EETS 7304 6
Pure ALOHA (1970)
In pure ALOHA, frames are transmitted at completely arbitrary times.
10/11/2007 EETS 7304 7
Collision conditions in pure Aloha
period is 2t
If another frame startshere we will have collision
• All frames are of the same size.
• Frame transmission can start at any time instant.
10/11/2007 EETS 7304 8
Throughput versus offered traffic for ALOHA systems.
Max throughputs: 18% at G = 0.5 for pure 37% at G = 1 for slotted.
(thr
ough
put
per
pack
et t
ime)
10/11/2007 EETS 7304 9
(1-p) carr
->random back off
CSMA: Persistent and Non-persistent
no carr
-> transmit
carr
-> check afterrandom time
nonpersistent
no carr
-> transmitwith prob p.
p-persistent is slotted
carr
->check next slot
10/11/2007 EETS 7304 10
CSMA with Collision Detection
CSMA/CD can be in one of three states: contention, transmission, or idle. Minimum contention slot is 2 where ( 5 s/km) is the propagation delay between the two most remote stations.
10/11/2007 EETS 7304 11
Reservation protocols: basic bit-map protocol
10/11/2007 EETS 7304 12
The binary countdown protocol
Wavelength Division Multiple Access
10/11/2007 EETS 7304 13
Station A Station B
tunable control transmitfixed data transmit
tunable data receivefixed control receive
A wants to send data to B1. 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.
x x x x
m time slots for control
A
station
n time slots for data plus 1 for status
S S
x x x x
Fiber LAN implementation
Channel allocations per station
x x x x x
BS S
x x x x x
x x x x
CS S
x x x x
10/11/2007 EETS 7304 14
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
10/11/2007 EETS 7304 15
Ethernet 802.3
10 MHzSegment length in hundredths meters
Baseband
Vampire taps
T conn.
10/11/2007 EETS 7304 16
Ethernet Cabling
Three kinds of Ethernet cabling.
(a) 10Base5, (b) 10Base2, (c) 10Base-T.
10/11/2007 EETS 7304 17
Ethernet coding (+/- 0.85 V)
(a) Binary encoding, (b) Manchester encoding, (c) Differential Manchester encoding.
10/11/2007 EETS 7304 18
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.
Ethernet 802.3
• 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.
FCDataLength/typeSADASOFPre
446-150026617
10/11/2007 EETS 7304 20
Collision detection can take as long as 2
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 roundtrip delay is 2 = 50 mksec = 500 bits = 64 bytes.
10/11/2007 EETS 7304 21
Binary exponential backoff
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 =
jA(1 – A)j-1 = 1/A.Therefore,
channel efficiency = P/(P + 2/A)
Frame Frame
first collision
second collision
for i-th collision station randomly chooses between 0 and 2i - 1 contention slots until 1023.
P sec
10/11/2007 EETS 7304 22
Efficiency of Ethernet at 10 Mbps with 512-bit slot times
10/11/2007 EETS 7304 23
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 24
Gigabit Ethernet
(a) A two-station Ethernet. (b) A multistation Ethernet.
10/11/2007 EETS 7304 25
Gigabit Ethernet cabling
10/11/2007 EETS 7304 26
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 27
Wireless LANs (WiFi)
• The 802.11 Protocol Stack• The 802.11 Physical Layer• The 802.11 MAC Sublayer Protocol• The 802.11 Frame Structure• Services
10/11/2007 EETS 7304 28
Part of the 802.11 protocol stack
FHSS - Frequency Hopping Spread SpectrumDSSS - Direct Sequence Spread SpectrumOFDM - Orthogonal Frequency Division MultiplexingHR-DSSS - High Rate DSSS
MAC: PCF - Point Coordin. Funct.: Base Station Polls mobiles within its cell. DCF - Distributed Coordination Function further discussed.
10/11/2007 EETS 7304 29
Wireless LAN (bandwidth is 11 to 54 MHz)
(a) A transmitting: C is out of range and cannot hear A.
(b) B transmitting: C hears B and falsely concludes that it cannot transmit to D.
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 30
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 31
The use of virtual channel sensing using CSMA/CA
NAV - Network Allocation Vector
10/11/2007 EETS 7304 32
A fragment burst
Due to the noisy wireless channels data packets are split into short fragments.
10/11/2007 EETS 7304 33
Interframe spacing in 802.11
10/11/2007 EETS 7304 34
The 802.11 Data Frame Structure
Frames must process in order
Encrypted using WEP
More frames to follow
Toggle bit to put receiver to sleep
Retransmitted frame
Data, Control, Mngmnt.
RTS, CTS
Frame out of Cell
More fragments to follow
For NAV For Base Station
12 bit frame, 4 bits fragment
10/11/2007 EETS 7304 35
802.11 Distribution Services
• Association (Attach)• Disassociation (Detach)• Reassociation (Handoff)• Distribution (Frame routing)• Integration (Protocol conversion)
10/11/2007 EETS 7304 36
802.11 Intracell Services
• Authentication (of mobile)• Deauthentication (on leave)• Privacy (encryption)• Data Delivery (data exchange)
10/11/2007 EETS 7304 37
Broadband Wireless (WiMax)
• 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
802.11 vs. 802.16
802.11 802.16environment indoor outdoormobility mobile fixedaccess point-to-multipoint point-to-pointdistance meters kmspectrum ISM (900 MHz-5.7 GHz) 10 - 66 GHz (mm waves) QoS internet multimedia (con orient) errors detection correction (Hamming) security optional mandatorybit rate 10 Mbps 100 Mbps
10/11/2007 EETS 7304 39
The 802.16 Protocol Stack
10/11/2007 EETS 7304 40
The 802.16 Physical Layer
10/11/2007 EETS 7304 41
The 802.16 Physical Layer (2)
Frames and time slots for time division duplexing.
10/11/2007 EETS 7304 42
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 43
The 802.16 Frame Structure
(a) A generic frame. (b) A bandwidth request frame.