2. Introduction
The data link layer in the OSI (Open
System Interconnections) Model, is in
between the physical layer and the network
layer. This layer converts the raw
transmission facility provided by the physical
layer to a reliable and error-free link.
3. Providing services to the network layer
Framing
Error Control
Flow Control
4.
5. Services to the Network Layer
In the OSI Model, each layer uses the
services of the layer below it and provides
services to the layer above it. The data link
layer uses the services offered by the physical
layer.The primary function of this layer is to
provide a well defined service interface to
network layer above it.
6.
7.
8. The types of services provided can be of three
types :-
Unacknowledged connectionless service
Acknowledged connectionless service
Acknowledged connection - oriented service
9. In this type of service source machine sends
frames to destination machine but the
destination machine does not send any
acknowledgement of these frames back to the
source. Hence it is called unacknowledged
service.
There is no error control i.e. if any frame is lost
due to noise on the line, no attempt is made to
recover it.
This type of service is used when error rate is
low.
It is suitable for real time traffic such as speech.
10. When the sender sends the data frames to
destination, destination machine sends back the
acknowledgement of these frames.
This type of service provides additional reliability
because source machine retransmit the frames if
it does not receive the acknowledgement of
these frames within the specified time.
This service is useful over unreliable channels,
such as wireless systems.
11. This service is the most sophisticated service
provided by data link layer to network layer.
In this service, data transfer has three distinct
phases:-
(i) connection establishment
(ii) Actual data transfer
(iii) connection release
Here, each frame being transmitted from source
to destination is given a specific number and is
acknowledged by the desitination machine.
12. Data-link layer takes packets from network
layer and encapsulates them into frames.
Then, it sends each frame bit-by-bit on the
hardware.
At receiver end, data link layer picks up
signals from hardware and assembles them
into frames.
13. The four framing methods that are widely
used are:-
1. Character count
2. Starting and ending character, with character
stuffing
3. Starting and ending flags, with bit stuffing
4. Physical layer coding violations.
14. When the data link layer at the destination sees
the character count, it knows how many
characters follow, and hence where the end of
the frame is.
The disadvantage is that if the count is grabbed
by a transmission error, the destination will lose
synchronization and will be unable to locate the
start of the next frame.
So, this method is rarely used.
15.
16. Framing
The data link layer encapsulates each data
packet from the network layer into frames
that are then transmitted.
A frame has three parts, namely −
Frame Header
Payload field that contains the data packet
from network layer
Trailer
17.
18. While sending data over network, the data
link layer divide into frames. Framing have
several advantages than send raw very large
data.
It reduces the probability of error and reduces
the amount of retransmission needed.
There exist two general methods for framing:
fixed size framing and variable sixe framing.
19. In fixed size framing, the data divided into
fixed size frames and send over the
transmission media.
In fixed-size framing, there is no need for
defining the boundaries of the framing, the
size itself can be used as a delimiter.
ATM network use fixed size packets called
cells.
20. In variable size framing, the data divided into
variable size frames.
Two protocols used for this purpose:
character oriented protocol and bit oriented
protocol.
In character-oriented protocol, we add
special characters(called flag to distinguish
beginning and end of a frame. Usually flag
has 8-bit length.
While using character-oriented protocol
another problem is arises, pattern used for
the flag may also part of the data to send.
21. In a bit-oriented protocol, the data to send is
a series of bits.
In order to distinguish frames, most protocols
use a bit pattern of 8-bit length (01111110) as
flag at the beginning and end of each frame.
Here also cause the problem of appearance of
flag in the data part to deal with this an extra
bit added this method is called bitstuffing.
22. In bit stuffing, if a 0 and five successive 1 bits
are encountered, an extra 0 is added.
The receiver node removes the extra-added
zero
23. The final framing method is physical layer
coding violations and is applicable to networks
in which encoding on the physical medium
contains some. Redundancy (no longer needed
and not useful)
In such cases normally, a 1 bit is a high-low pair
and a 0 bit is a low-high pair.
The combinations of low-low and high-high
which are not used for data may be used for
marking frame boundaries.
24. The bit stream transmitted by the physical layer
is not guaranteed to be error free. The data link
layer is responsible for error detection and
correction.
The most common error control method is to
compute and append some form of a checksum
to each outgoing frame at the sender’s data link
layer and to recomputed the checksum & verify
it with the received checksum at the receiver’s
side.
25. The checksums may be of two type:
1. Error detecting: Receiver can only detect the
error in the frame and inform the sender
about it.
2. Error detecting and correcting:The receiver
can not only detect the error but also correct
it.
Consist of Hamming code and CRC
26. Consider a situation in which the sender transmits
frames faster than the receiver can accept them.
If the sender keeps pumping out frames at high rate,
at some point the receiver will be completely
swamped and will start losing some frames.
This problem may be solved by introducing flow
control.
Most flow control protocols contain a feedback
mechanism to inform the sender when it should
transmit the next frame.
27. Error
A condition when the receiver’s information
does not match with the sender’s
information. During transmission, digital
signals suffer from noise that can introduce
errors in the binary bits travelling from sender
to receiver.That means a 0 bit may change to
1 or a 1 bit may change to 0.
28. Error Detecting Codes (Implemented either
at Data link layer or Transport Layer of OSI
Model)
Whenever a message is transmitted, it may
get scrambled by noise or data may get
corrupted. To avoid this, we use error-
detecting codes which are additional data
added to a given digital message to help us
detect if any error has occurred during
transmission of the message.
29. Basic approach used for error detection is the
use of redundancy bits, where additional bits are
added to facilitate detection of errors.
Some popular techniques for error detection are:
1. Simple Parity check
2.Two-dimensional Parity check
3. Checksum
4. Cyclic redundancy check
30. 1. Simple Parity check
Blocks of data from the source are subjected to a
check bit or parity bit generator form, where a
parity of :
1 is added to the block if it contains odd number
of 1’s, and
0 is added if it contains even number of 1’s
This scheme makes the total number of 1’s even,
that is why it is called even parity checking.
31.
32. 2. Two-dimensional Parity check
Parity check bits are calculated for each row,
which is equivalent to a simple parity check bit.
Parity check bits are also calculated for all
columns, then both are sent along with the data.
At the receiving end these are compared with
the parity bits calculated on the received data.
33.
34. 3. Checksum
In checksum error detection scheme, the data is
divided into k segments each of m bits.
In the sender’s end the segments are added
using 1’s complement arithmetic to get the sum.
The sum is complemented to get the checksum.
The checksum segment is sent along with the
data segments.
At the receiver’s end, all received segments are
added using 1’s complement arithmetic to get
the sum.The sum is complemented.
If the result is zero, the received data is
accepted; otherwise discarded.
35.
36. 4. Cyclic redundancy check (CRC)
Unlike checksum scheme, which is based on addition,
CRC is based on binary division.
In CRC, a sequence of redundant bits, called cyclic
redundancy check bits, are appended to the end of
data unit so that the resulting data unit becomes
exactly divisible by a second, predetermined binary
number.
At the destination, the incoming data unit is divided
by the same number. If at this step there is no
remainder, the data unit is assumed to be correct and
is therefore accepted.
A remainder indicates that the data unit has been
damaged in transit and therefore must be rejected.
46. 1. Let G(x) be the generator polynomial used
for CRC checking.What is the condition that
should be satisfied by G(x) to detect odd
number of bits in error?
(A) G(x) contains more than two terms
(B) G(x) does not divide 1+x^k, for any k not
exceeding the frame length
(C) 1+x is a factor of G(x)
(D) G(x) has an odd number of terms.