Framing
Framing
Framing
Point-to-Point Links
Reading: Peterson and Davie, Ch. 2
Hardware building blocks Encoding Framing Error Detection Reliable transmission
Sliding Window Algorithm
2
Framing
Breaks continuous stream/sequence of bits into a frame and demarcates units of transfer Typically implemented by network adaptor
Adaptor fetches/deposits frames out of/into host memory
Node A Adaptor Bits Adaptor Node B
Frames
Advantages of Framing
Synchronization recovery
consider continuous stream of unframed bytes recall RS-232 start and stop bits
Multiplexing of link
multiple hosts on shared medium simplifies multiplexing of logical channels
Problem ?
Approaches
Organized by end of frame detection method Approaches to framing
sentinel (marker, like C strings) length-based (like Pascal strings) clock-based
Approaches
Other aspects of a particular approach
bit- or byte-oriented fixed- or variable-length data-dependent or data-independent length
7
Beginning sequence
Header
Body
CRC
Ending sequence
x 1 1 1 1 1 0
x 1 1 1 1 1 0
Node A
x 0 1 1 1 1 1 0
Node B
x 0 1 1 1 1 1 0
Sentinels: HDLC
Developed by IBM, standardized by OSI Bit-oriented, variable-length, datadependent Special bit pattern 01111110 marks end of frame Insert 0 after pattern 011111 in data (bit stuffing)
11
Sentinels: HDLC
At receiver end, if the frame received is:
0111110 bit stuffed, therefore receive only 011111 error in end of frame marker, lose two frames 01111110: end of frame 01111111: error, lose one or two frames
12
Sentinels: PPP
Byte-oriented, variable-length, datadependent Special flag 01111110 for start-of-text
address and control field uses default values (FF / 8E) protocol field used for demultiplexing (IP,LCP,) LCP (Link Control Protocol) send control messages
flag address control establishes payload protocol link between two peers checksum negotiates payload and checksum size flag
13
15
Length-based Framing
Include payload length in header e.g., DDCMP (byte-oriented, variablelength) 8 8 8 14 42 e.g. RS-232 (bit-oriented, implicit fixed 16 SYN length) SYN Class Length Header CRC Body
16
Clock-based Framing
Continuous stream of fixed-length frames
each frame is 125s long (all STS formats) (why?)
17
9 rows
90 columns
18
Clock-based Framing
Problem: how to recover frame synchronization
2-byte synchronization pattern starts each frame (unlikely to occur in data) wait until pattern appears in same place repeatedly
19
Clock-based Framing
Problem: how to maintain clock synchronization
NRZ encoding, data scrambled (XORd) with 127-bit pattern creates transitions also reduces chance of finding false sync. pattern
20
Hdr
Hdr
STS -1
STS-1
Hdr
STS -1
Hdr
STS -3c
21
Clock-based Framing
Problem: simultaneous synchronization of many distributed clocks Solution: payload frame floats within clock frame, part of overhead specifies first byte of payload 87 col
Frame 0 9 rows
Frame 1
23