Professional Documents
Culture Documents
Bit stuffing (a) The original data. (b) The data as they appear on the
line. (c) The data as they are stored in receiver’s memory after
destuffing.
Error Control
• For ensuring reliable delivery of data:
1. Positive/Negative Acknowledgement
2. Timers
3. Sequence Numbers
Flow Control
• What happens when a sender wants to transmit
frames faster than the receiver can accept?
• In such situations flow control is required. Two
approaches are used:
1. Feedback based flow control: Receiver sends back
information to the sender giving it permission to
send more data.
2. Rate based flow control: Built-in mechanism that
limits the transmission rate at sender.
Error Detection and Correction
• Error detection is the detection of errors
caused by noise or other impairments during
transmission from the transmitter to the
receiver.
• Error Correction is the detection of errors and
reconstruction of the original, error free data.
• Two types of errors:
1. Single bit error
2. Burst Error
Error Detection and Correction
• Two ways to deal with errors:
1. Adding enough information for the receiver to
know what the transmitted data must be.
2. Adding enough information for the receiver to
know simply that an error has occurred.
• The former strategy uses error correcting code. It
is also known as FEC (Forward Error Correction).
• The latter one is known as error detecting code.
Error Correcting Codes
• Different error correcting codes are:
1. Hamming Code
2. Binary Convolution Code
3. Reed Solomon Code
4. Low density Parity Check Code
Hamming Code
• A frame consists of m data(i.e. message) bits
and r redundant(i.e. check) bits.
• Total length of the block be n (i.e. n=m+r)
• An n bit unit containing data and check bits is
referred to as an n-bit codeword. Also known
as (n,m) hamming code.
• Note: The r redundant bits are also known as
parity bits.
Parity Bits
• To detect errors in the data communication and
processing, an additional bit is sometimes added
to a binary codeword to define its parity.
• A parity bit is an extra bit included to make the
total number of 1s in the resulting code either
even/odd.
• Two types of parity bit:
1. Even Parity
2. Odd Parity
Hamming Code
• The code rate(or rate) is the fraction of the
code word that carries information i.e. not
redundant.
• Find the number of bits by which these two
code words differ:10001001,10110001.
• The number of bits by which the two code
words differ is called Hamming Distance.
• Parity bits are always power of 2.
Hamming Code
• Ex1: For (11,7) Hamming Code, we have
Msg=1000001. Find the redundant bits.
Hamming Code
• Ex1: For (11,7) Hamming Code, we have Msg=1000001.
Find the redundant bits.
• Ex2: Find the parity bits and codeword to be sent for
the Msg=0110101.
• Ex3: For Hamming code (6,3), find the parity bits and
codeword to be sent for the messages:
Msg1=000
Msg2=001
Msg3=010
Msg4=011
Msg5=111
Convolutional Codes
• Also known as NASA Convolutional codes.
• Encoder processes a sequence of input bits and produces
a sequence of output bits.
• Output depends on the current and previous input bits
since the encoder has memory.
• The number of previous bits on which the output
depends is called the constraint length.
• Convolutional codes are specified in terms of their rate
and constraint length.
• It is not a block code.
• These codes are used in GSM Phones, 802.11 and
satellite communication.
Convolutional Codes
• The fig. below shows the NASA convolutional codes for
code rate=1/2 and constraint length, k=7.
• Each input bit produces two output bits i.e. 1 input bit=2
output bits.
• Each time a bit is given as input the values in the registers
are shifted to the right.
Reed Solomon Code
• They are linear block codes which operate on
block codes(m bit symbols) rather than bits.
• Used for satellite communication as well as
on CDs/DVDs and Blu-ray discs.
• In presence of 32 redundant symbols, it can
correct upto 16 symbol errors.
• Reed solomon codes are generally used in
combination with convolutional codes.
Low Density Parity Check(LDPC) Code
• They are linear block codes.
• Excellent ECC.
• Used in digital video broadcasting, 802.11
and 10Gbps Ethernet.
Error Detecting Codes
1. Parity
2. Checksum
3. Cyclic Redundancy Check
Parity Bits
• To detect errors in the data communication and
processing, an additional bit is sometimes added
to a binary codeword to define its parity.
• A parity bit is an extra bit included to make the
total number of 1s in the resulting code either
even/odd.
• Two types of parity bit:
1. Even Parity
2. Odd Parity
Parity Bit
• Single parity bit can only detect a single bit error
in the block.
• It can not provide protection against burst errors.
• In order to do so, we use the technique of
Interleaving.
• Interleaving is a general technique to convert a
code that detects (or corrects) isolated errors into
a code that detects (or corrects) burst errors.
Parity Bit
• Compute parity bit for all n columns and send all
data bits as k rows, sending the rows from top to
bottom and bits in a row from left to right.
/* Fetch a packet from the network layer for transmission on the channel. */
void from_network_layer(packet *p);
void to_physical_layer(frame *s); /* Pass the frame to the physical layer for transmission. */
void start_timer(seq_nr k); /* Start the clock running and enable the timeout event. */
void stop_timer(seq_nr k); /* Stop the clock and disable the timeout event. */
void start_ack_timer(void); /* Start an auxiliary timer and enable the ack_timeout event. */
void stop_ack_timer(void); /* Stop the auxiliary timer and disable the ack_timeout event. */
A Utopian Simplex Protocol
Assume:
• Data Transmission is in one direction only(Sensed
to Receiver)
• Communication channel is error free.
• Receiver processes all inputs quickly and infinite
buffer space is available.
• No loss of frames/no error/flow control.
• No Sequence number or Ack number are used
here.
A Utopian Simplex Protocol
/* Protocol 1 (Utopia) provides for data transmission in one direction only, from sender to receiver. The
communication channel is assumed to be error free and the receiver is assumed to be able to process
all the input infinitely quickly. Consequently, the sender just sits in a loop pumping data out onto the
line as fast as it can. */