Download Byte Stuffing - Computer Network - Lecture Slides and more Slides Computer Networks in PDF only on Docsity!
COMPUTER
NETWORKS
Lecture-
Review Lecture 4
The Concept of Packets
Why use Packets?
Packets and Frames
Byte Stuffing
Byte Stuffing (cont’d)
Byte stuffing translates each reserved
byte into two unreserved bytes
For example, can use esc as prefix,
followed by x for soh, y for eot and z for
esc
Byte Stuffing (cont’d)
The sender replaces each occurance of
special characters with a combination of
two characters (i.e.esc x, esc y, esc z)
The receiver then replaces each
occurence of esc x, esc y, esc z, by the
corresponding single character
Byte Stuffing (cont’d)
Transmission Errors
Interference or power surges may
destroy data during transmission
- Bits may be lost
- Bit values may be changed
Frames include additional information
to detect / correct errors
- Inserted by the sender
- Checked by the receiver
Parity Checking
Parity refers to the number of bits set
to 1 in the data item
- Even parity - An even number of
bits are 1
- Odd parity - An odd number of bits
are 1
Parity Checking
A Parity Bit is an extra bit transmitted
with a data item, chose to give the
resulting bits even or odd parity
- Even parity - data: 10010001 ,
parity bit 1
- Odd parity - data: 10010111 ,
parity bit 0
Limitations of Parity Checking
Parity can only detect errors that
change an odd number of bits
- Original data and parity: 10010001 + 1 (even parity)
- Incorrect data: 10110011 + 1 (even parity!)
Parity usually used to catch one-bit
errors
Alternative Error Detection Schemes
Alternative error detection mechanisms have been introduced
Differences among mechanisms:
- The size of the additional information (transmission overhead)
- Computational complexity of the algorithm (computational overhead)
- The number of bit error that can be detected (how well errors are detected)
Checksum
Checksum
Can be 8-, 16- or 32-bit integers
Easy to do - uses only addition
May not detect all errors
Cyclic Redundancy Check (CRC)
Consider data in message as coefficients of a polynomial
Divide that coefficient set by a known polynomial
Transmit remainder as CRC
- Good error detection properties
- Easy to implement in hardware
Hardware Components
Uses two hardware components:
- Shift Register
- Exclusive or (xor) unit