Framing
- Special bit strings
- Frame length
- HDLC
- FDDI
- ATM
- Ethernet
The Framing Problem
Given a sequence of bits, identify the start and end of a data frame.
Frame Structure
- header
- data (payload)
- trailer
- packet length: fixed, variable
The Framing Problem, restated
- Identify the header in a sequence of bits
- Determine the packet length:
- fixed length
- header contains length
- trailer contains mark
- trailer contains checksum
- Recover from errors or discard erroneous frames.
- Strip headers and trailers and deliver data to the higher layer
HDLC
- High-Level Data Link Control
- class of protocols
- Special Flag is bit pattern 0111 1110
- Must escape the flag in the data:
- When sending, add a 0 bit after every sequence of 5 " 1"s
- When receiving, rewrite the sequence 111110 to 11111
- When receiving, the sequence 111111 is the flag
- Frame structure:
8 | 8 | 8 | var. | 16 | 8 |
flag | address | control | data | cks | flag |
|
HDLC Control field
- N(S): 3-bit sequence number
- N(R): acknowledgement number (N(R) = 3 means received packet 2)
- I frame (Information -- carries data):
- S frame (Supervisory):
- U frame (Unnumbered):
HDLC Modes
- Normal Response mode: primary node polls secondary nodes, which respond
- Asynchronous Response mode (most widely used): secondary node
can initiate transfer
- Asynchronous Balanced mode: symmetric
HDLC Asynchronous Response protocol
- U frames used to connect and disconnect
- S frames: ACK
- Ready to Receive
- Not Ready to Receive
- Reject (Negative Ack)
- P/F = 1 requires an immediate response (ack)
- I frames: data
HDLC Example
Figure 6.3
LAPB
- Asynchronous Balanced Mode of HDLC
FDDI Framing
- 4B/5B uses 16 of 32 possible symbols for data
- 17th symbol is "idle symbol"
- other symbols are control symbols
- first non-idle, non-control symbol is start of frame
- first idle symbol after frame marks end of frame
ATM Framing
- fixed-size cells
- where does the first cell start?
- HEC (Header Error Correction):
- 5th byte of 53-byte cell
- CRC of first 4 bytes
- Compute repeatedly until CRC matches
- Compute repeatedly every 53 bytes to make sure it is not a coincidence
- Thereafter, keep checking CRC to detect errors
ATM Errors
- An error may make the CRC not match
- types of errors:
- corrupted contents
- shifted boundaries (framing error)
- For the first few CRC errors, keep the presumed cell boundaries
- After a sufficient number of consecutive CRC errors, start looking
for the cell boundaries again.