Framing and Error Detection - PowerPoint PPT Presentation


PPT – Framing and Error Detection PowerPoint presentation | free to view - id: 1a6b74-ZDc1Z


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation

Framing and Error Detection


Solution: character-stuffing. Precede ETX in the body with an escape character DLE. ... Solution: bit-stuffing. Sender side: 111111 becomes 1111101. ... – PowerPoint PPT presentation

Number of Views:33
Avg rating:3.0/5.0
Slides: 14
Provided by: egBuc


Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: Framing and Error Detection

  • Framing and Error Detection

Last time Encoding NRZ
NRZ Encode 0s and 1s using two different
Problem 1 The signal is synchronous that is,
theres a reference clock marking the length of
each bit.
Problem 2 Separating 0s from 1s is not trivial.
NRZI and Manchester Encoding
Clock recovery depends on transitions. To keep
clocks in sync, the more transitions the better
too few and clocks will drift.
NRZI Encode 1s using transitions 0s keep
current level.
Manchester XOR NRZ-encoded signal and clock.
  • NRZ Baseline wander and clock recovery are
  • NRZI 0s have no transitions and thus they wont
    help with clock recovery.
  • Manchester Doubles the rate of transitions
    making clock recovery easier, on the other hand,
    it doubles the rate of transitions. Since there
    are 2 transitions for every single bit, the
    efficiency (information per unit of time) drops
    by 50.

4B/5B Encoding
  • Basic idea Insert extra bits into the stream to
    break up long sequences of 0s and 1s. Doesnt
    allow more than one leading 0 and no more than
    two trailing 0s.

4 bits
5 bits
4B/5B Encoding
16 codes are left over and some can be used for
purposes other than encoding data. For
instance 11111 idle line 00000 dead
line 00100 halt 7 codes violate the one
leading 0, two trailing 0s rule.
Problem description A sequence of bits is sent
from node A to node B over a point-to-point link.
The network adaptor on node B must recognize
exactly what set of bits constitutes a frame,
that is, it must determine where the frame begins
and ends.
Byte-Oriented Protocols
  • Underlying concept Treat frames as collections
    of bytes (or
  • characters in a particular set).
  • Sentinel approach

sentinels (special characters)
Problem ETX may appear in the body of the
frame. Solution character-stuffing. Precede ETX
in the body with an escape character DLE. If DLE
occurs in the body, it is also escaped.
SYN start of frame SOH start of header STX
start of text ETX end of text
Byte-Oriented Protocols (cont.)
Byte-Counting approach Instead of relying on a
special marker to indicate the end of the frame,
send a count value which reflects the length of
the body (number of bytes).
Question Can you see any additional problems
with these protocols?
Hint What happens in the sentinel approach if an
ETX is corrupted on transmission? What happens in
the byte-counting approach if the count is
Answer Framing errors back-to-back frames are
incorrectly received.
Bit-Oriented Protocols
Underlying concept Treat frames as collections
of bits, that is, pay no regard to byte
Beginning sequence Ending sequence 01111110
Problem 01111110 may appear in the body of the
frame. Solution bit-stuffing. Sender side
111111 becomes 1111101. Receiver side if 11111
arrives and the next bit is 0, the 0 is removed
if the next bit is 1, then either (1) this is the
ending sequence, or (2) there was a transmission
error and the frame is discarded.
Error Detection
Approaches 1) Send two copies of the message. 2)
Send a small number of redundant bits.
Two-dimensional parity
The Internet Checksum Algorithm
Underlying concept Add up all the words to be
transmitted in a frame and send the result
(checksum) together with the frame.
  • u_short
  • cksum(u_short buf, int count)
  • register u_long sum 0
  • while (count--)
  • sum buf
  • if (sum 0xFFFF0000)
  • /carry has occurred/
  • sum 0xFFFF
  • sum
  • return (sum 0xFFFF)

Notes - count is a 16 bit value. - buf has been
padded with 0 to a multiple of 16 bits. - code
uses 1s complement arithmetic.
Question Any problems?
Cyclic Redundancy Check
  • Underlying concept A (n1) bit message, say is
    represented by an n degree a polynomial M(x).
    Example for 10011010 is
  • Send and receiver agree on a divisor polynomial
    C(x) of degree k.
  • A (n1)-bit message is sent with additional k
    bits, call this extended message P(x). We want to
    make P(x) exactly divisible by C(x).
  • The receiver checks if the received message is
    also exactly divisible by C(x). If it is not,
    then with good probability an error occurred.