Title: Layer 2
1- Layer 2
- Data Framing for
- Fun and Profit
Eric L. Michelsen
2Where In the Stack Are We?
OSI
7. Application
6. Presentation
5. Session
Link Layer Sublayers
4. Transport
AAL2
AAL5
PPP
Ether-net II
802.2 (LLC)
SNAP
Novell IPX
1490
3. Network
Frame Relay
2. Link
HDLC
ATM
1. Physical
Bit serial (V.35, HSSI, DS1, DS3, etc.)
Ethernet
3Layers Upon Layers
- Synchronous HDLC (SDLC)
- RFC 1662 (Asynchronous HDLC)
- Frame Relay
- RFC 1490 (Multiprotocol in Frame Relay)
- Four Flavors of Ethernet
- ATM (cells, AAL5 packets)
- RFC 1483 (Multiprotocol in AAL5)
- FUNI
- Reference formats DSL, Frame Relay, ATM, DS1,
DS3, SONET
4Synchronous HDLC (aka SDLC)
2 or 4
1 octet
opening flag
closing flag
flag
flag
CRC
data
01111110 ... idle ...
01111110
- Sends frames (packets) over a serial
(synchronous) bit stream - Frames are delimited by flags (8 bits 01111110)
- Shared flag closes one frame and opens the next
- Idle is usually flags, but may be 1s (mark idle)
- Shared zero flag is deprecated, and often banned
flag
0111111011111101111110
flag
flag
5HDLC Bit Stuffing
bit stuffed 0
01111110 . . . 111110 . . . . 01111110
opening flag
closing flag
user datafive 1s
- Transparency is by bit stuffing everything
between the flags any sequence of five 1s has a
0 bit stuffed after it - Stuffed frame length need not be a multiple of 8
bits - Stuffing makes the effective data rate pattern
sensitive - 3 kinds of CRC CRC-SDLC (aka CRC-CCITT), CRC-16,
and CRC-32 (used by CCITT). - CRC-16 detects errors better, but wasnt known
when CRC-SDLC was chosen. Rarely used. - Hardware sends/detects flags, bit stuffing, CRC
6RFC 1662 (Asynchronous HDLC)
- Sends frames over a synchronous or asynchronous
octet stream (e.g., modem, X.25, SONET) - Based on ISO/IEC 33091991 (HDLC framing)
- Frames delimited by flag octets 01111110 (0x7E)
- Byte stuffing escape 0x7D,Following byte
(user data XOR 0x20) - Flag and Escape bytes in user data MUST be
escaped - PPP Async Control Character Map (ACCM) specifies
other values from 0 - 0x1F to escape (Tx), and
ignore (Rx) - Byte stuffing is often done in software
2 or 4
1 octet
opening flag
closing flag
CRC
data
idle...
01111110
01111110
7Frame Relay
- Uses synchronous HDLC framing sublayer
- Data Link Control Identifier (DLCI) multiplexes
virtual circuits. Usually only local
significance. - Uses Q.922 header Usually 2-octet address (1024
DLCIs), extensions for 3 or 4 (EA1 on last
address octet) - Max information length is configurable, 4096 max
2
1 octet
1 to max-length
2 to 4
1
frame address
opening flag
closing flag
CRC
information
CR
EA 0
DE
EA 1
F E C N
B E C N
DLCI94
DLCI30
7 6 5 4 3 2 1 0 7 6
5 4 3 2 1 0
8Frame Relay (cont.)
- Link Management Interface (LMI) on fixed DLCI
- Forward Explicit Congestion Notification (FECN)
set by Frame Relay network if frame experienced
congestion - Backward ECN set if reverse direction is
congested - FECN BECN set by network only
- Q.922 is not clear if user equipment can set them
or not - Discard Eligible, set by network for
overcommitted, or user for low priority, frames - C/R bit carried transparently by Frame Relay
network
frame address
CR
EA 0
DE
EA 1
F E C N
B E C N
DLCI94
DLCI30
7 6 5 4 3 2 1 0 7 6
5 4 3 2 1 0
9RFC 1490Multiprotocol Encapsulation in FR
- Allows a SNAP-like header in data field to
encapsulate raw LAN frames (bridged mode) - Bridging header (OUI 0x00-80-C2 for 802.1)
encapsulates LAN frame - PID specifies with or without LAN FCS
1
3
2
0 or 4
6
1
1
optional LAN FCS
Ctl 3
OUI PID
pad 0
NLPID 0x80
dest MAC
LAN data
...
LAN frame
Frame Relay information field
- Also allows direct IP encapsulation (routed
mode)
Ctl 3
NLPID 0xCC
IP packet
Frame Relay information field
10Four Flavors of Ethernet
- Ethernet II
- IEEE 802.2
- IEEE 802.2 SNAP
- Novell IPX (raw 802.3)
- All use a common hardware sublayer
- This is the basis of the 64-byte minimum frame
size - Finally recognized by IEEE 802.3-1998 as the
MAC layer
frame size 64 to 1518
8 octets
6
6
48 (min) to 1502 (max)
4
preamble
source MAC
PID data
FCS
pad (if needed)
S F D
destination MAC
CRC-32
1010 ... 1011
Ethernet Common HW sublayer
11Ethernet II
- First widespread Ethernet standard
- PIDs administered by IEEE
- All IP on Ethernet is required to support this
(RFC 1122), and almost all use it. - All PIDs are gt 1536 (decimal)
- Exact packet length is not available from frame
data alone, because of padding
8 octets
6
6
4
2
46 (min) to 1500 (max)
data
S F D
source MAC
destination MAC
PID
FCS
pad (if needed)
preamble
Ethernet II
Common HW sublayer
Common HW sublayer
12Ethernet IEEE 802.2
- Destination and Source Service Access Points
(DSAP and SSAP) are essentially protocol IDs - Used by IPX since Netware 3.12 (SAP0xE0)
- Not used for IP
- Exact length available because length specifies
valid data, not including padding - Dont confuse Service Access Point (SAP) with
Service Advertising Protocol (SAP)
43 to 1497
2
1
1
1
8 octets
4
6 6
data
preamble
FCS
dest MAC
source MAC
length
DSAP
SSAP
Ctl
pad (if needed)
length
13IEEE 802.2 SNAP
- SubNetwork Access Protocol (SNAP)
- OUI PID allows vendors to define globally
unique protocol identifiers - OUI Organizationally Unique Identifier
- OUI 0 implies PID is an Ethernet II PID
- Optional support in IP (RFC 1042)
38 to 1492
6
6
8 octets
4
2
1
1
1
3 2
preamble
FCS
dest MAC
source MAC
length
DSAP
SSAP
Ctl
OUI PID
pad (if needed)
data
length
14Novell IPX (raw 802.3)
- Defined by Novell before 802.3 was complete
- Phased out by Novell in Netware 3.12
- Checksum is forced to 0xFFFF (gt none), takes
place of DSAP/SSAP - Does not allow a real IPX checksum
46 (min) to 1500 (max)
8 octets
6
6
4
2
2
preamble
destination MAC
IPX checksum FFFF
FCS
source MAC
length
pad (if needed)
data
IPX header
IEEE 802.3
15How Can I Tell?
- Check PID/length first, then DSAP/SSAP
FCS
preamble
source MAC
dest MAC
PID gt 1536
FCS
data/pad
Ethernet II
preamble
source MAC
dest MAC
SSAP
Ctl
length 3-1535
802.2
DSAP
FCS
data/pad
preamble
source MAC
dest MAC
802.2 SNAP
SSAP AA
length 8-1535
DSAP AA
FCS
Ctl
OUI PID
data/pad
preamble
source MAC
dest MAC
Novell old IPX
length 2-1535
FFFF
FCS
data/pad
16ATM Cells
8 bits
- Synchronous bit stream
- Bit stream may be framed (DS3, OC3)
- Cells are 53 bytes 5 header 48 payload
- Idle with null or unassigned cells
- Cell delineation usually by Header Error Check
(HEC) - ATM switches operate primarily on cells, ignoring
payload type (PT) - VPI/VCI is virtual circuit identifier
- VPI is 8 bits (UNI) or 12 bits (NNI)
- VCI is 16 bits
- CLP is like Frame Relay DE
GFC/ VPI...
1 2 3 4 5 6 53
VPI...
VCI...
...VPI
...VCI...
...VCI
PT CLP
HEC (8-bit CRC)
Payload 48 octets
17ATM AAL5 (Packets)
- Packet framing above cell layer
- ATM Adaptation Layer 5 (AAL5) includes
Segmentation and Reassembly (SAR) of packets - User-user bit in cell header payload-type (PTI)
indicates last cell in packet
packet layer
packets
SAR (AAL5)
cells
ATM layer
cell header
AAL5 packet
cell
cell
cell
cell
cell
cell
last cell
PTI last cell
18ATM AAL5 (Packets), cont.
- Control, length, and CRC-32 at end of last cell
- Control field currently unused
- data length provides precise length
- Length in trailer allows starting to send packet
before length is known - (cut through switches, e.g. frame to ATM)
N x 48
4
2
0 to 65,535 octets
0 to 47
1
1
CRC-32
ctl
pad
UU
data
data length
data length
19RFC 1483 Multiprotocol Encapsulation in ATM
- Requires an 802.2 SNAP-like header in data field
- Allows for raw LAN frames (bridged mode)
- Header (OUI 0x00-80-C2 for 802.1) encapsulates
LAN frames - PID specifies with or without LAN FCS
1
1
1
3
2
2
6 ...
0 or 4
optional LAN FCS
dest MAC
DSAP AA
SSAP AA
Ctl 3
pad00-00
OUI PID 00 80 C2 00 xx
...
LAN data
LAN frame
AAL5 or FUNI data field
- Also allows direct IP encapsulation (routed
mode)
DSAP AA
SSAP AA
Ctl 03
OUI PID 00 00 00 08 00
IP packet
20Classical IP Over ATM
- RFC 1577 (Classical IP and ARP over ATM)
- Specifies RFC 1483 Routed IP format (802.2 SNAP)
- Defines Inverse-ARP for identifying your IP peer
- Defines a bunch of LAN Emulation (LANE) SVC stuff
that no one uses
21FUNI
- ATM standard for Frame User-Network Interface
- Q.922 HDLC frames to ATM AAL5 interworking
- Fully supports ILMI, OAM, SVCs all ATM management
Interworking Device
cells
FUNI
Premise
Premise format
ATM Network
VC payload
HDLC flag
HDLC flag
ATM format
variable
VC payload
pad
AAL5 trailer
22Some Common Encapsulations
1483 FUNI (Ethernet)
Ethernet frame
HDLC flag
HDLC flag
1483 FUNI (IP)
IP packet
HDLC flag
HDLC flag
1490 (Ethernet)
Ethernet frame
HDLC flag
HDLC flag
1490 (IP)
IP packet
HDLC flag
HDLC flag
VC payload
HDLC flag
HDLC flag
Q.922
Q.922 1490
ISO protocol packet
HDLC flag
HDLC flag
HDLC payload
HDLC flag
HDLC flag
HDLC
Optional
1 or 2
HDLC PPP
PPP information
HDLC flag
HDLC flag
PPP-PID
23Frame Relay Encapsulations
1483 FUNI (Ethernet)
Ethernet frame
HDLC flag
HDLC flag
1483 FUNI (IP)
IP packet
HDLC flag
HDLC flag
1490 (Ethernet)
Ethernet frame
HDLC flag
HDLC flag
1490 (IP)
IP packet
HDLC flag
HDLC flag
VC payload
HDLC flag
HDLC flag
None
v a r i a b l e
PPP information
HDLC flag
HDLC flag
NL-PID
PPP-RFC1973
24ATM Encapsulations
variable
VC payload
None(AAL5)
pad
AAL5 trailer
variable
1483 (Ethernet)
Ethernet frame
pad
AAL5 trailer
variable
1483 IP(ATM)
IP packet
pad
AAL5 trailer
variable
VC payload
pad
AAL5 trailer
FRF.5
Optional
variable
1 or 2
Cisco-PPP
PPP information
pad
AAL5 trailer
PPP-PID
variable
1 or 2
PPP-2364-NULL
PPP information
pad
AAL5 trailer
PPP-PID
variable
1 or 2
PPP-2364-LLC
PPP information
pad
AAL5 trailer
PPP-PID
25DS1 ESF Framing
193-bit frame
DS1-ESF (unchannelized)
M1
C1
M2
F10
M3
C2
M4
F20
M5
C3
M6
F31
Reference T1.107
4 x 6 24 frames 1 superframe
M7
C4
M8
F40
M9
C5
M10
F51
M11
M12
F61
C6
6-bit CRC
Frame Alignment Signal (FAS)
4 kbps Facility Data Link (FDL)
Framing is bit-oriented (rather than
octet-oriented) 8k frames/s x 193 1.544 Mbps
line rate (exactly) 8k frames/s x 192 1.536
Mbps payload rate (exactly) 8k frames/s ? 24 ?
333 superframes/s
Note SF (aka D4) framing is not usable for data
transport
26DS3 Framing
680-bit M-subframe
C11
F11
C21
F20
FEAC
F30
F41
X1
84-bit Payload
C11
F11
C21
F20
C31
F30
F41
X2
CP
F11
CP
F20
CP
F30
F41
P1
FEBE
FEBE
FEBE
F11
F20
F30
F41
P2
DL
F11
DL
F20
DL
F30
F41
M10
C11
C21
C31
F11
F20
F30
F41
M21
C11
C21
C31
F11
F20
F30
F41
M30
7 M-subframes 1 M-frame
M-Frame Alignment
M-subframe Alignment
Reference T1.107 FEAC Far End Alaram
Control FEBE Far End Block Error DL Data
Link HDLC EOC
Framing is bit-oriented. C-bit-parity shown.
M23 mode sets C1 in subframe-1 randomly,
other C-bits per stuffing X1 X2 not Remote
Alarm Indication (RAI) P1 P2 CP XOR of
previous M-frame payload bits CP are end-to-end
parity bits 44.736 Mbps line rate (exact) 44.736
x (84 / 85) ? 44.210 Mbps payload rate
27STS-1 (component of OCn)
90 Columns
Reference GR-253, chap 3.
A1
A2
J0/Z0
B1
E1
F1
Section overhead
STS-1 Payload Capacity (84 useable columns) 8000
x 84 x 9 x 8 48.384 Mbps
D1
D2
D3
H1/H2 point to the Synchronous Payload Envelope
(SPE) at arbitrary byte offset
J1
J1
H1
H2
H3
B3
9 Rows
B2
K1
K2
C2
STS-1 Envelope Capacity 87 Columns
ATM cells, etc.
D4
D5
D6
G1
Line overhead
D7
D8
D9
F2
Fixed Stuff
Fixed Stuff
D10
D11
D12
H4
S1/Z1
M0 M1/Z2
E2
Z3
810 Byte Frame
Z4
Transport overhead
Z5
Framing is byte-oriented. Line rate 8000
frames/s x 90 x 9 x 8 bits 51.840 Mbps
Path Overhead (POH)
28STS-Nc SPE
STS-3c SPE 3 x 87 261 Columns
STS-12c SPE 12 x 87 1044 Columns
STS-3c Payload Capacity 8000 x 260 x 9 x 8
149.760 Mbps
J1
STS-12c Payload Capacity 8000 x 1040 x 9 x 8
599.040 Mbps
J1
B3
B3
C2
C2
G1
G1
F2
F2
Fixed Stuff
Fixed Stuff
Fixed Stuff
H4
H4
Z3
Z3
Z4
Z4
Z5
Z5
9 Rows
9 Rows
Path Overhead (POH)
Path Overhead (POH)
Reference GR-253, chap 3.
Line Rate N x 51.840 Mbps Framing chosen to
match STM-N STS-48c (not shown) is exactly 4
times STS-12c (POH 15 Stuff)
29- This slide intentionally left blank