Framing: Encoding Translates Symbols To Signals Framing Demarcates Units of Transfer
Framing: Encoding Translates Symbols To Signals Framing Demarcates Units of Transfer
Framing
Encoding translates symbols to signals
Framing demarcates units of transfer
Separates continuous stream of bits into frames
Marks start and end of each frame
digital data
(a string of
symbols)
digital data
(a string of
symbols)
modulator demodulator
a string
of signals
Benefits of framing
Synchronization recovery
Breaks up continuous streams of unframed
bytes
Recall RS-232 start and stop bits
Link multiplexing
Multiple hosts on shared medium
Simplifies multiplexing of logical channels
Efficient error detection
Per-frame error checking and recovery
Spring 2012 CS 438 Staff, University of Illinois 2
Spring 2012 CS 438 Staff, University of Illinois 3
Framing
Demarcates units of transfer
Goal
Enable nodes to exchange blocks of data
Challenge
How can we determine exactly what set
of bits constitute a frame?
How do we determine the beginning and
end of a frame?
Spring 2012 CS 438 Staff, University of Illinois 4
Framing
Approaches
Sentinel: delimiter at end of frame
(like C strings)
Length-based: length field in header
(like Pascal strings)
Clock-based: periodic, time-based
Characteristics
Bit- or byte-oriented
Fixed or variable length
Data-dependent or data-independent length
Spring 2012 CS 438 Staff, University of Illinois 5
Sentinel-Based Framing
End of Frame
Marked with a special byte or bit pattern
Frame length is data-dependent
Challenge
Frame marker may exist in data
Requires stuffing
Examples
BISYNC, HDLC, PPP, IEEE 802.4 (token
bus)
Spring 2012 CS 438 Staff, University of Illinois 6
ARPANET IMP-IMP
Interface Message processors (IMPs)
Packet switching nodes in the original ARPANET
Byte oriented, Variable length, Data dependent
Frame marker bytes
STX/ETX start of text/end of text
DLE data link escape
Byte Stuffing
DLE byte in data sent as two DLE bytes back-to-back
STX DLE ETX BODY
HEADER
DLE 0x48 0x69 DLE DLE 0x69 0x48
DLE
Spring 2012 CS 438 Staff, University of Illinois 7
BISYNC
BInary SYNchronous Communication
Developed by IBM in late 1960s
Byte oriented, Variable length, Data dependent
Frame marker bytes:
STX/ETX start of text/end of text
DLE data link escape
Byte Stuffing
ETX/DLE bytes in data prefixed with DLEs
STX ETX BODY
HEADER
ETX 0x48 0x69 ETX DLE 0x69 0x48
Spring 2012 CS 438 Staff, University of Illinois 8
High-Level Data Link Control
Protocol (HDLC)
Bit oriented, Variable length, Data-
dependent
Frame Marker
01111110
Bit Stuffing
Insert 0 after pattern 011111 in data
Example
01111110 end of frame
01111111 error! lose one or two frames
Spring 2012 CS 438 Staff, University of Illinois 9
IEEE 802.4 (token bus)
Alternative to Ethernet (802.3) with fairer arbitration
End of frame marked by encoding violation,
i.e., physical signal not used by valid data symbol
Recall Manchester encoding
low-high means 0
high-low means 1
low-low and high-high are invalid
IEEE 802.4
byte-oriented, variable-length, data-independent
Another example
Fiber Distributed Data Interface (FDDI) uses 4B/5B
Technique also applicable to bit-oriented framing
Spring 2012 CS 438 Staff, University of Illinois 10
Length-Based Framing
End of frame
Calculated from length sent at start of frame
Challenge
Corrupt length markers
Examples
DECNETs DDCMP
Byte-oriented, variable-length
RS-232 framing
Bit-oriented, implicit fixed-length
LENGTH
BODY
HEADER
Spring 2012 CS 438 Staff, University of Illinois 11
Clock-Based Framing
Continuous stream of fixed-length frames
Clocks must remain synchronized
STS-1 frames - 125s long
No bit or byte stuffing
Example
Synchronous Optical Network (SONET)
Problems
Frame synchronization
Clock synchronization
Spring 2012 CS 438 Staff, University of Illinois 12
SONET
Frames (all STS formats) are 125 sec long
Ex: STS-1 51.84 Mbps = 90 bytes
Frame Synchronization
2-byte synchronization pattern at start of each
frame
Overhead Payload
9
r
o
w
s
90 columns
Spring 2012 CS 438 Staff, University of Illinois 13
SONET: Challenges
How to recover frame synchronization
Synchronization pattern unlikely to occur in data
Wait until pattern appears in same place repeatedly
How to maintain clock synchronization
NRZ encoding
Data scrambled (XORd) with
127-bit pattern
Creates transitions
Also reduces chance of finding false sync. pattern
Spring 2012 CS 438 Staff, University of Illinois 14
SONET
A single SONET frame may contain
multiple smaller SONET frames
Bytes from multiple SONET frames are
interleaved to ensure pacing
HDR HDR HDR
HDR
STS-1 STS-1 STS-1
STS-3
Spring 2012 CS 438 Staff, University of Illinois 15
SONET
STS-1 merged bytewise round-robin into STS-3
Unmerged (single-source) format called STS-3c
Problem: simultaneous synchronization of many
distributed clocks
not too difficult to
synchronize clocks
such that first byte of
all incoming flows
arrives just before
sending first 3 bytes
of outgoing flow
67B
249B
151B
Spring 2012 CS 438 Staff, University of Illinois 16
SONET
... but now try to
synchronize this
networks clocks
Spring 2012 CS 438 Staff, University of Illinois 17
SONET
One alternative to synchronization is to
delay each frame by some fraction of a 125
microsecond period at each switch (i.e.,
until the next outgoing frame starts).
Delays add up quickly...
Or, worse, a network with cycles.
Spring 2012 CS 438 Staff, University of Illinois 18
SONET
Problem
Clock synchronization across multiple machines
Solution
Allow payload to float across frame boundaries
Part of overhead specifies first byte of payload
Framing Summary
Technique
Demarcate units of
transfer
Benefits
Synchronization
recovery
Link multiplexing
Efficient error detection
Approaches
Sentinel
Length-based
Clock based
Characteristics
Bit- or byte-oriented
Fixed or variable length
Data-dependent or
data-independent
length
Spring 2012 CS 438 Staff, University of Illinois 19