CN Unit 2
CN Unit 2
Framing
The Data Link Layer should detect and correct the errors
In this purpose, DLL will break up the bit stream into discrete frames,
compute a small token called a checksum each frame and include the
checksum in the frame when it is transmitted.
When the frame arrives at the destination, the checksum is recomputed.
After dividing the data into frames, we should be able to identify the
starting & and ending of each frame.
Character Set
Flag Byte or Character Stuffing or Byte Stuffing
Bit Stuffing
Violation of Physical layer
Character Set
This is a method uses a field in the header to specify the number of bytes
in the frame.
When the DLL at the destination sees the byte count, it knows how many
bytes follow & hence where the end of the frame.
This problem occurs if the byte count is changed by any transmission
error.
If the byte count of 5 becomes 7due to error in this method is used
rarely.
Flag Byte or Character Stuffing or Byte Stuffing
In this method special byte called flag byte is used as both the starting
& ending delimiter of each frame.
Two consequent flag bytes indicate end of the frame and start the next
frame.
If the receiver looses the synchronization, it can search for two flag
bytes to find the end of the frame.
One way to solve this problem is to insert a special byte called (ESC)
just before each flag byte in the data.
The DLL on the receiving end removes the escape bytes before giving the
data to the network layer.
This technique is called as Byte Stuffing.
Bit Stuffing
Error Control
1. Feedback based flow control: The receiver sends some feedback to the
sender .This feedback includes:-
2. Rate based flow control: There is built in mechanism that limits the rate
at which senders can transmit data. Without using feedback from receiver.
Error detections codes are used when the error rate high.
Step-01:
At sender side,
The data along with the checksum value is transmitted to the receiver.
Step-03:
At receiver side,
If m bit checksum is being used, the received data unit is divided into
segments of m bits.
All the m bit segments are added along with the checksum value.
The value so obtained is complemented and the result is checked.
Case-01: Result = 0
Case-02: Result ≠ 0
Checksum Example-
10011001111000100010010010000100
Step-01:
At sender side,
Since the result consists of 10 bits, so extra 2 bits are wrapped around .
00100011 + 10 = 00100101 (8 bits)
Now, 1’s complement is taken which is 11011010.
Thus, checksum value = 11011010
Step-02:
The data along with the checksum value is transmitted to the receiver.
Step-03:
At receiver side,
Since the result is 0, receiver assumes no error occurred in the data and
therefore accepts it.
The procedure used by the sender to encode the message encompasses the
following steps −
Step 1 − Calculation of the number of redundant bits.
Step 2 − Positioning the redundant bits.
Step 3 − Calculating the values of each redundant bit.
Once the redundant bits are embedded within the message, this is sent to
the user.
The redundant bits are parity bits. A parity bit is an extra bit that makes the
number of 1s either even or odd. The two types of parity are −
Even Parity − Here the total number of bits in the message is made even.
Odd Parity − Here the total number of bits in the message is made odd
Bit Location 9 8 7 6 5 4 3 2 1
Bit
D5 P4 D4 D3 D2 P3 D1 P2 P1
designation
Binary
1001 1000 0111 0110 0101 0100 0011 0010 0001
representation
Received code 1 1 0 0 0 1 1 0 1
Checking the parity bits
For P4 : Check the locations 8, 9. There are two 1s in this group, which is
correct for even parity. Hence the bit value for P4 is 0.
The resultant binary word is 0111. It corresponds to the bit location 7 in the
above table. The error is detected in the data bit D4. The error is 0 and it
should be changed to 1. Thus the corrected code is 111001101.
1. Noise Less
2. Noisy
Simplex Protocol or Unrestricted Protocol or Utopian Protocol
Simplex Stop and Wait Protocol error free channel
Simplex stop and wait protocol for noisy channel
Sliding window protocol(one bit)
G0 BACK N ARQ
SELECTIVE REPEAT ARQ
Data Link Layer Protocol in HDLC
High-level Data Link Control (HDLC) is a group of communication protocols
of the data link layer for transmitting data between network points or nodes.
Since it is a data link protocol, data is organized into frames. A frame is
transmitted via the network to the destination that verifies its successful
arrival. It is a bit - oriented protocol that is applicable for both point - to -
point and multipoint communications.
Transfer Modes
HDLC supports two types of transfer modes, normal response mode and
asynchronous balanced mode.
Normal Response Mode (NRM) − Here, two types of stations are there, a
primary station that send commands and secondary station that can
respond to received commands. It is used for both point - to - point and
multipoint communications.
Flag − It is an 8-bit sequence that marks the beginning and the end of the
frame. The bit pattern of the flag is 01111110.
Address − It contains the address of the receiver. If the frame is sent by the
primary station, it contains the address(es) of the secondary station(s). If it is
sent by the secondary station, it contains the address of the primary station.
The address field may be from 1 byte to several bytes.
Payload − This carries the data from the network layer. Its length may vary
from one network to another.
FCS − It is a 2 byte or 4 bytes frame check sequence for error detection. The
standard code used is CRC (cyclic redundancy code)
There are three types of HDLC frames. The type of frame is determined by the
control field of the frame
I-frame − I-frames or Information frames carry user data from the network
layer. They also include flow and error control information that is
piggybacked on user data. The first bit of control field of I-frame is 0.
Control: It is a 1-byte field which is set through the constant value, i.e.,
11000000. It is not a required field as PPP does not support the flow control
and a very limited error control mechanism. The control field is a mandatory
field where protocol supports flow and error control mechanism.
Payload: The payload field carries either user data or other information. The
maximum length of the payload field is 1500 bytes
Establish: If one of the nodes starts working then the phase goes to the
establish phase. In short, we can say that when the node starts
communication or carrier is detected then it moves from the dead to the
establish phase.
Open: After the establishment of the network phase, it moves to the open
phase. Here open phase means that the exchange of data takes place. Or we
can say that it reaches to the open phase after the configuration of the
network layer.
Terminate: When all the work is done then the connection gets terminated,
and it moves to the terminate phase.
Components in PPP
Link Control Protocol (LCP)
Authentication protocols
On a single PPP line frames cannot arrive out of order, but this is possible
when the frames are divided among multiple PPP connections. Therefore,
Multilink PPP must number the fragments so they can be put in the right
order again when they arrive.
However, there are other applications for Multilink PPP that go beyond
simply increasing the speed associated with dial up service. The same
concept is often employed in fiber optic systems that function primarily as a
means of providing audio signaling. Cable modems can also employ
Multilink PPP to enhance transmission. Satellite transmissions can also
make use of the principles of Multilink PPP in order to increase the efficiency
of data transfers. The overall simplicity of employing this type of multiple
connection protocol makes it easily adaptable to a number of different
situations, and can often be an ideal solution for persons located in relatively
isolated areas.