Computer Network - Unit-2 - Data - Link - Layer
Computer Network - Unit-2 - Data - Link - Layer
Computer Network
Unit-2
Data Link Layer
2. Design Issues:
2.1 Services provided to network layer
2.2 Framing
2.3 Flow control
2.4 Error control
1.1 Introduction
1.2 Working
1.3 Responsibility
Back to Outline
1.1 Data Link Layer (DLL)
Back to Outline
2.1 Service Provided to Network Layer
✔ Drawback: It suffers from internal fragmentation if data size is less than frame size
✔ Solution: Padding
2. Variable size – In this there is need to define end of frame as well as beginning
of next frame to distinguish. This can be done in two ways:
✔ Length field – We can introduce a length field in the frame to indicate the length of the
frame. Used in Ethernet(802.3). The problem with this is that sometimes the length field
might get corrupted. (E.g Byte Counting)
✔ End Delimeter (ED) – We can introduce an ED(pattern) to indicate the end of the frame.
Used in Token Ring. The problem with this is that ED can occur in the data. This can be
solved by:
▪ Character/Byte Stuffing
▪ Bit Stuffing
▪ Byte stuffing is the process of adding 1 extra byte whenever there is a flag or
escape character in the text.
Bit stuffing. (a) The original data. (b) The data as they appear on
the line. (c) The data as they are stored in the receiver’s memory after destuffing.
▪ Bit stuffing is the process of adding one extra 0 whenever five consecutive 1s follow a 0
in the data
▪ so that the receiver does not mistake the pattern 0111110 for a flag.
• Errors: When bits are transmitted over the computer network, they
are subject to get corrupted due to interference and network
problems.
• Single bit error − In the received frame, only one bit has been
corrupted, i.e. either changed from 0 to 1 or from 1 to 0.
Burst error − In the received frame, more than one consecutive bits
are corrupted.
Back to Outline
3.1 Error Detection Code
▪ Error detection : 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.
▪ Basic approach used for error detection is the use of redundancy bits, where
additional bits are added to facilitate detection of errors.
2. Odd parity: :
✔ If a number of 1s is odd then parity bit value is 0. Ex-3. 100011 0
✔ If a number of 1s is even then parity bit value is 1.
Ex-4. 101101 1
Even Parity
• The parity check is suitable for single bit error detection only.
Checksum
CRC Example-5
1. Backward Error Correction : When the receiver detects an error in the data
received, it requests back the sender to retransmit the data unit.
2. Forward Error Correction : When the receiver detects some error in the data
received, it executes error-correcting code, which helps it to auto-recover and
to correct some kinds of errors. Some popular error correcting methods :
▪ Hamming codes.
▪ Binary convolution codes.
▪ Reed-Solomon codes.
▪ Low-Density Parity Check codes
Back to Outline
Elementary Data Link Layer Protocols
• Now let us see how the data link layer can combine framing, flow
control, and error control to achieve the delivery of data from one
node to another.
Time out
Solution : Time-Out Timer Set
Lost
Time out
Time out
Time out
Time out
Time out
Time out
ACK Lost
Frame Lost
• Animation Link :
• https://www2.tkn.tu-berlin.de/teaching/rn/animations/gbn_sr/
• For example, in single message may have two chunks one is for DATA
and the other is ACK. After piggybacking, there is a single message over
the wire in place of two.
• Advantages :
• better use of bandwidth
• The underlying cable and intermediate switches, router, etc, will be less
loaded.
• If someone is paying the cost to utilize a network based on messages, then
the cost will also be reduced.
• Disadvantages :
• blocking of ack for some time.
• This may cause a connection to go down or may cause a service problem if
the delay is more than expected.
• To avoid problems, piggybacking uses a very small duration timer.
Back to Outline
High-level Data Link Control (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.
1. Transfer Mode
2. HDLC Frame
3. Types of HDLC Frame
▪ 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.
▪ Control − It is 1 or 2 bytes containing flow and error control information.
▪ 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)