You are on page 1of 58

IEEE 802 LANs

• LAN: Local Area Network


• What is a local area network?
– A LAN is a network that resides in a
geographically restricted area
– LANs usually span a building or a campus

HMG/HUT MAC Protocols (802.x) 1


June 2004
Characteristics of LANs
• Short propagation delays
• Small number of users
• Single shared medium (usually)
• Inexpensive

HMG/HUT MAC Protocols (802.x) 2


June 2004
Common LANs
• Bus-based LANs
– Ethernet (*)
– Token Bus (*)
• Ring-based LANs
– Token Ring (*)
• Switch-based LANs
– Switched Ethernet
– ATM LANs
(*) IEEE 802 LANs

HMG/HUT MAC Protocols (802.x) 3


June 2004
IEEE 802 Standards
802.1: Introduction
802.2: Logical Link Control (LLC)
802.3: CSMA/CD (Ethernet)
802.4: Token Bus
802.5: Token Ring
802.6: DQDB
802.11: CSMA/CA (Wireless LAN)

HMG/HUT MAC Protocols (802.x) 4


June 2004
IEEE 802 Standards (cont’d)
• 802 standards define:
– Physical layer protocol
– Data link layer protocol
• Medium Access (MAC) Sublayer
• Logical Link Control (LLC) Sublayer

HMG/HUT MAC Protocols (802.x) 5


June 2004
OSI Layers and IEEE 802
OSI layers IEEE 802 LAN standards

Higher Layers Higher Layers

802.2 Logical Link Control


Data Link Layer
802.3 802.4 802.5
Medium Access Control

CSMA/CD Token-passing Token-passing


Physical Layer bus bus ring

HMG/HUT MAC Protocols (802.x) 6


June 2004
IEEE 802 LANs (cont’d)
• Ethernet
• Token Ring

HMG/HUT MAC Protocols (802.x) 7


June 2004
Ethernet (CSMA/CD)
• IEEE 802.3 defines Ethernet
• Layers specified by 802.3:
– Ethernet Physical Layer
– Ethernet Medium Access (MAC) Sublayer

HMG/HUT MAC Protocols (802.x) 8


June 2004
Ethernet (cont’d)
• Possible Topologies:
1. Bus
2. Branching non-rooted tree for large
Ethernets

HMG/HUT MAC Protocols (802.x) 9


June 2004
Ethernet: MAC Layer
• Data encapsulation
– Frame Format
– Addressing
– Error Detection
• Link Management
– CSMA/CD
– Backoff Algorithm

HMG/HUT MAC Protocols (802.x) 10


June 2004
Ethernet Frame Format

Bytes: 7 1 6 6 2 0-1500 0-46 4

Preamble
Preamble SFD
SFD DA
DA SA
SA Type
Type Data
Data Pad
Pad CRC
CRC

1. Preamble: trains clock-recovery circuits


2. Start of Frame Delimiter: indicates start of frame
3. Destination Address: 48-bit globally unique address
assigned by manufacturer.
1b: unicast/multicast
1b: local/global address
4. Type: Indicates protocol of encapsulated data (e.g. IP = 0x0800)
5. Pad: Zeroes used to ensure minimum frame length
6. Cyclic Redundancy Check: check sequence to detect bit errors.

HMG/HUT MAC Protocols (802.x) 11


June 2004
Ethernet MAC Frame
Address Field
• Destination and Source Addresses:
– 6 bytes each
• Two types of destination addresses
– Physical address: Unique for each user
– Multicast address: Group of users
– First bit of address determines which type of address
is being used
0 = physical address
1 = multicast address

HMG/HUT MAC Protocols (802.x) 12


June 2004
Ethernet MAC Frame
Other Fields
• Length Field
– 2 bytes in length
– determines length of data payload
• Data Field: between 0 and 1500 bytes
• Pad: Filled when Length < 46
• Frame Check Sequence Field
– 4 bytes
– Cyclic Redundancy Check (CRC-32)

HMG/HUT MAC Protocols (802.x) 13


June 2004
CSMA/CD
• Recall:
– CSMA/CD is a “carrier sense” protocol.
• If channel is idle, transmit immediately
• If busy, wait until the channel becomes idle
– CSMA/CD can detect collections.
• Abort transmission immediately if there is a
collision
• Try again later according to a backoff algorithm

HMG/HUT MAC Protocols (802.x) 14


June 2004
CSMA/CD (cont’d)
• Carrier sense reduces the number of
collisions
• Collision detection reduces the impact of
collisions

HMG/HUT MAC Protocols (802.x) 15


June 2004
CSMA/CD and Ethernet
• Ethernet:
– Short end-to-end propagation delay
– Broadcast channel
• Ethernet access protocol:
– 1-Persistent CSMA/CD
– with Binary Exponential Backoff Algorithm

HMG/HUT MAC Protocols (802.x) 16


June 2004
Ethernet Backoff Algorithm:
Binary Exponential Backoff
• If collision,
– Choose one slot randomly from 2k slots, where k is
the number of collisions the frame has suffered.
– One contention slot length = 2 x end-to-end
propagation delay

This algorithm can adapt to


changes in network load.
HMG/HUT MAC Protocols (802.x) 17
June 2004
Binary Exponential Backoff (cont’d)

slot length = 2 x end-to-end delay = 15 µs

A B

t=0µs: Assume A and B collide (kA = kB = 1)


A, B choose randomly from 21 slots: [0,1]
Assume A chooses 1, B chooses 1
t=30µs: A and B collide (kA = kB = 2)
A, B choose randomly from 22 slots: [0,3]
Assume A chooses 2, B chooses 0
t=45µs: B transmits successfully
t=75µs: A transmits successfully
HMG/HUT MAC Protocols (802.x) 18
June 2004
Binary Exponential Backoff (cont’d)
• In Ethernet,
– Binary exponential backoff will allow a
maximum of 15 retransmission attempts
– If 16 backoffs occur, the transmission of the
frame is considered a failure.

HMG/HUT MAC Protocols (802.x) 19


June 2004
Ethernet Performance

HMG/HUT MAC Protocols (802.x) 20


June 2004
Ethernet Features and Advantages
1. Passive interface: No active element
2. Broadcast: All users can listen
3. Distributed control: Each user makes own
decision

Simple
Reliable
Easy to reconfigure
HMG/HUT MAC Protocols (802.x) 21
June 2004
Ethernet Disadvantages
• Lack of priority levels

• Cannot perform real-time communication

• Security issues

HMG/HUT MAC Protocols (802.x) 22


June 2004
Ethernet Switching
• Recent development: Connect many
Ethernet segments or subnets through an
“Ethernet switch”

to segment 4 to segment 1

to segment 3 to segment 2

HMG/HUT MAC Protocols (802.x) 23


June 2004
Why Ethernet switching?
• LANs may grow very large
– The switch has a very fast backplane
– It can forward frames very quickly from one
segment to another
• Cheaper than upgrading all host interfaces
to use a faster network

HMG/HUT MAC Protocols (802.x) 24


June 2004
Token Ring
• IEEE 802.5 Standard
• Layers specified by 802.5:
– Token Ring Physical Layer
– Token Ring MAC Sublayer

HMG/HUT MAC Protocols (802.x) 25


June 2004
Token Ring (cont’d)
• Token Ring, unlike Ethernet, requires an
active interface

Host
Ring
interface

HMG/HUT MAC Protocols (802.x) 26


June 2004
Token Ring Configuration

HMG/HUT MAC Protocols (802.x) 27


June 2004
Token Ring Configuration

HMG/HUT MAC Protocols (802.x) 28


June 2004
Token Ring MAC Sublayer
• Token passing protocol
• Frame format
• Token format

HMG/HUT MAC Protocols (802.x) 29


June 2004
Token Passing Protocol
• A token (8 bit pattern) circulates around the ring
• Token state:
– Busy: 11111111
– Idle: 11111110

HMG/HUT MAC Protocols (802.x) 30


June 2004
Token Passing Protocol (cont’d)
• General Procedure:
– Sending host waits for and captures an idle token
– Sending host changes the token to a frame and
circulates it
– Receiving host accepts the frame and continues to
circulate it
– Sending host receives its frame, removes it from the
ring, and generates an idle token which it then
circulates on the ring

HMG/HUT MAC Protocols (802.x) 31


June 2004
Token Ring Frame and Token
Formats

Bytes 1 1 1

SD AC ED

Token Format

1 1 1 2/6 2/6 unlimited 4 1 1


Destination Source
SD AC FC Address Address Data Checksum ED FS

Frame Format

HMG/HUT MAC Protocols (802.x) 32


June 2004
Token Ring Delimiters
SD AC ED

Destination Source
SD AC FC Address Address Data Checksum ED FS

• SD = Starting Delimiter
• ED = Ending Delimiter
• They contains invalid differential Manchester
codes

HMG/HUT MAC Protocols (802.x) 33


June 2004
Token Ring Access Control
Field
SD AC ED (Note: The AC field
is also used in frames)

PPPTMRRR
• P = Priority bits
– provides up to 8 levels of priority when accessing the
ring
• T = Token bit
– T=0: Token
– T=1: Frame

HMG/HUT MAC Protocols (802.x) 34


June 2004
Token Ring Access Control Field
(cont’d)
SD AC ED

PPPTMRRR
• M = Monitor Bit
– Prevents tokens and frames from circulating indefinitely
– All frames and tokens are issued with M=0
– On passing through the “monitor station,” M is set to 1
– All other stations repeat this bit as set
– A token or frame that reaches the monitor station with M=1 is
considered invalid and is purged

HMG/HUT MAC Protocols (802.x) 35


June 2004
Token Ring Access Control Fields
(cont’d)
SD AC ED

PPPTMRRR
• R = Reservation Bits
– Allows stations with high priority data to request (in
frames and tokens as they are repeated) that the next
token be issued at the requested priority

HMG/HUT MAC Protocols (802.x) 36


June 2004
Token Ring Frame Control Field
Destination Source
SD AC FC Address Address Data Checksum ED FS

• FC = Frame Control Field


– Defines the type of frame being sent
– Frames may be either data frames or some type of
control frame. Example control frames:
• Beacon: Used to locate breaks in the ring
• Duplicate address test: Used to test if two stations have the
same address

HMG/HUT MAC Protocols (802.x) 37


June 2004
Token Ring Address & Data Fields
Destination Source
SD AC FC Address Address Data Checksum ED FS

• Address Fields:
– Indicate the source and destination hosts
– Broadcast:
• Set all destination address bits to 1s.
• Data
– No fixed limit on length
– Caveat: Hosts may only hold the token for a limited
amount of time (10 msec)

HMG/HUT MAC Protocols (802.x) 38


June 2004
Token Ring Checksum and
Frame Status
Destination Source
SD AC FC Address Address Data Checksum ED FS
• Checksum: 32-bit CRC
• FS = Frame Status
– Contains two bits, A and C
– When the message arrives at the destination, it sets
A=1
– When the destination copies the data in the message,
it sets C=1

HMG/HUT MAC Protocols (802.x) 39


June 2004
The Token Ring Monitor Station
• One station on the ring is designated as the
“monitor station”
• The monitor station:
– marks the M bit in frames and tokens
– removes marked frames and tokens from the ring
– watches for missing tokens and generates new ones
after a timeout period

HMG/HUT MAC Protocols (802.x) 40


June 2004
Using Priority in Token Ring
• If a host wants to send data of priority n, it may only grab
a token with priority value n or lower.
• A host may reserve a token of priority n by marking
setting the reservation bits in the AC field of a passing
token or frame
– Caveat: The host may not make the reservation if the token or
frame’s AC field already indicates a higher priority reservation
• The next token generated will have a priority equal to the
reserved priority

HMG/HUT MAC Protocols (802.x) 41


June 2004
• When a new token is generated (i.e., when
a sender finishes sending and releases an
idle token), or when a sender sends a data
frame, RRR is set to the lowest priority.

HMG/HUT MAC Protocols (802.x) 42


June 2004
Priority Transmission: Example
B

C
D

Host B has 1 frame of priority 3 to send to A


Host C has 1 frame of priority 2 to send to A
Host D has 1 frame of priority 4 to send to A
Token starts at host A with priority 0 and circulates
clockwise
Host C is the monitor station
(priority 0: lowest priority in this example)
HMG/HUT MAC Protocols (802.x) 43
June 2004
Example (cont’d)
Event Token/Frame AC Field
A generates a token P=0, M=0, T=0, R=0
B grabs the token and sets the
message destination to A P=3, M=0, T=1, R=0
Frame arrives at C, and C reserves
priority level 2. Monitor bit set. P=3, M=1, T=1, R=2
Frame arrives at D, and
D attempts to reserve priority level 4: P=3, M=1, T=1, R=4
Frame arrives at A, and A
copies it P=3, M=1, T=1, R=4
Frame returns to B, so B removes
it, and generates a new token P=4, M=0, T=0, R=0
Token arrives at C, but its priority is
too high. C reserves priority 2. M bit. P=4, M=1, T=0, R=2
HMG/HUT MAC Protocols (802.x) 44
June 2004
Example (cont’d)
Event Token/Frame AC Field
Token arrives at D, and D grabs
it, sending a message to A P=4, M=0, T=1, R=0
Frame arrives at A, and A
copies it P=4, M=0, T=1, R=0
Frame arrives at B, which does
nothing to it P=4, M=0, T=1, R=0
Frame arrives at C, which sets the
monitor bit P=4, M=1, T=1, R=2
Frame returns to D, so D removes
it and generates a new token with P=2 P=2, M=0, T=0, R=0

etc… Attempt to complete this scenario on your own.

HMG/HUT MAC Protocols (802.x) 45


June 2004
TOKEN RING Performance

• Ring Topology
• A bit pattern token (1111 1111) floats on the ring
• Station captures token, converts to connector
(11 11 1110), transmits frame
• Intermediate stations relay message/token.
• Token is released when
(a) Leading edge of frame is received, and
(b) Frame is transmitted.

HMG/HUT MAC Protocols (802.x) 46


June 2004
Throughput : Simple Analysis
Time required by a bit to traverse the whole ring
a = ----------------------------------------------------
Frame transmission time
Number of active stations : N
Average time to pass token to the next station: a/N

HMG/HUT MAC Protocols (802.x) 47


June 2004
t0 t0+a t0+1 t0+a+1

(a) (b) (c) (d)

Fig for case 1

HMG/HUT MAC Protocols (802.x) 48


June 2004
Case 1 ( a<1)
(a) Frame transmission begins
(b) Leading edge received.
© Total frame is transmitted and token is released.
(d) Total frame is received.

Average time to transmit frame


S = ---------------------------------------------------
(Time elapsed between a token is transmitted + Average
Token Passing Time)
1
S= a
1+ HMG/HUT MAC Protocols (802.x) 49
N June 2004
t0 t0+1 t0+a
t0+a+1
(a) (b) (c)
(d)

Fig for case 2 ( a > 1)

HMG/HUT MAC Protocols (802.x) 50


June 2004
Case 2 (a > 1)
(a) Frame transmission begins
(b) Frame transmission completed.
© Leading edge received and token is released.
(d) Total frame is received.

1
S = a+
a for a > 1
N
HMG/HUT MAC Protocols (802.x) 51
June 2004
Delay and stability

No. of stations (equally spaced) = N


Mean time for token to travel round the ring = R
Mean Token Cycle Time = T
Mean Packet Transmission Time = X
During T
• All N queues are served.
• Mean number of packets are transmitted = Q
• Token rotates (with mean value R)
T= R+QX

HMG/HUT MAC Protocols (802.x) 52


June 2004
For stable system
Departures = Arrivals
Q =NλT
ρ = λ X (for one station)

T (1 − Nρ ) = R
- Token is free with probability (1-Nρ)

- Token is in use with probability Nρ

• Nρ<1

• ρ<1/N
HMG/HUT MAC Protocols (802.x) 53
June 2004
• Average number of packets transmitted from a queue in
T=Q/N
• In limited service (IEEE 802.5 has THT) λT < m
– m packets served per token visit
• Tagged job methodology and residual service time
analysis gives
Average waiting delay (excluding service delay),W as

W=
NρΕ x 2 [ ]+
(1 + ρ )R
2 + (1 − Nρ − λR ) 2(1 − Nρ − λR )
HMG/HUT MAC Protocols (802.x) 54
June 2004
Flavor #1: Release After
Reception (RAR)
• Computer captures token, transmits data, waits for data to
successfully travel around ring, then releases token again.
• Allows computer to detect errored frames and retransmit them.

Example time evolution in which host 1 and host 3 have packets to transmit:

PROP TRANST TRANST


TRANSP TRANSP
Data Token Token Data
l1/c l2/c lN/c l1/c l2/c l3/c
time
Token arrives Token departs Token arrives
at host 1 from host 1 at host 3
Token arrives
at host 2

HMG/HUT MAC Protocols (802.x) 55


June 2004
Efficiency of RAR
Recall: Efficiency, η, is the fraction of time spent sending useful data.

Define: Ti,j to be the time from when the token arrives at host i until
it next arrives at host j.

T1, 2 ≤ TRANSP + PROP + TRANST + l1 / c


∴T1,1 ≤ N (TRANSP + PROP + TRANST ) + ∑i li / c
= N (TRANSP + PROP + TRANST ) + PROP

N (TRANSP )
∴η RAR ≤
N (TRANSP + PROP + TRANST ) + PROP
1 PROP
≈ , a= , TRANSP >> TRANST
1+ a TRANSP

HMG/HUT MAC Protocols (802.x) 56


June 2004
Flavor #2: Release After
Transmission (RAT)
• Computer captures token, transmits data, then releases
token again.

Example time evolution in which host 1 and host 3 have packets to transmit:
TRANST TRANST
TRANSP TRANSP
Data Token Token Data Token

l1/c l2/c
time
Token arrives Token departs Token arrives
at host 1 from host 1 at host 3
Token arrives
at host 2

HMG/HUT MAC Protocols (802.x) 57


June 2004
Efficiency of RAT

T1, 2 ≤ TRANSP + TRANST + l1 / c


∴T1,1 ≤ N (TRANSP + TRANST ) + ∑i li / c
= N (TRANSP + TRANST ) + PROP

N (TRANSP )
∴η RAT ≤
N (TRANSP + TRANST ) + PROP
1 PROP
≈ , a= , TRANSP >> TRANST
1+ a / N TRANSP

HMG/HUT MAC Protocols (802.x) 58


June 2004

You might also like