Unit 4 - Data Link Layer -LectureOKK
Unit 4 - Data Link Layer -LectureOKK
………………………………………………………………….
1. Framing:
• The packet received from the Network layer is known as a
frame in the Data link layer.
• At the sender’s side, DLL receives packets from the
Network layer and divides them into small frames, then,
sends each frame bit-by-bit to the physical layer.
• At the receiver’s end, DLL takes bits from the Physical
layer organizes them into the frame, and sends them to the
Network layer.
2. Addressing:
• The data link layer encapsulates the source and
destination’s MAC address/ physical address in the
header of each frame to ensure node-to-node delivery.
o MAC address is the unique hardware address that is
assigned to the device while manufacturing.
3. Error Control:
• Data can get corrupted due to various reasons like noise,
attenuation, etc.
• So, DLL detect the error in the transmitted data and correct
it using error detection and correction techniques
respectively.
4. Flow Control:
• An overflow data in the receiver’s buffer and some frames
may get lost.
• So, DLL synchronize the sender’s and receiver’s speeds
and establish flow control between them.
5. Access Control:
• The data link layer is further divided into two sub-layers, which
are as follows:
There are various protocols in the data link layer, which are as follows:
1. Unicast:
a. To a specific NIC.
b. If the LSB (least significant bit) of the first octet of an
address is set to zero, the frame is meant to reach only one
receiving NIC.
c. MAC Address of source machine is always Unicast.
or IPv6 FFFF:F200:3204:0B00
Framing
Parts of a Frame
Assume-
We know,
So, we have-
Checksum Example-
Solution:
Step-01:
At sender side,
Now, all the segments are added and the result is obtained as-
Step-03:
At receiver side,
Now,
Assignment Problem:
A. 1010101000011111
B. 1011111000100101
C. 1101010000011110
D. 1101010000111111
Solution-
Step-01:
At sender side,
Step-02:
Step-03:
At receiver side,
Case-01: Result = 0
Case-02: Result ≠ 0
Note-01:
Note-02:
Note-03:
In this technique,
• One extra bit called as parity bit is sent along with the original
data bits.
• Parity bit helps to check if any error occurred in the data
during the transmission.
Steps Involved-
Error detection using single parity check involves the following steps-
Er. Chandan Bhagat (MBMAN)
Step-01:
At sender side,
Step-02:
Step-03:
At receiver side,
Then,
At Sender Side-
At Receiver Side-
• After receiving the code word, total number of 1’s in the code
word is counted.
• Consider receiver receives the correct code word = 10010011.
• Even parity is used and total number of 1’s is even.
Advantage-
Limitation-
EXAMPLE
Assignment
CRC Generator-
The power of each term gives the position of the bit and the
coefficient gives the value of the bit.
Example-
Thus, for the given CRC generator, the corresponding binary pattern
is 11011011.
Rule-01:
Rule-02:
Problem-01:
Solution-
Now,
Problem-02:
Solution-
Part-01:
Now,
Part-02:
Now,
At sender side,
At sender side,
At receiver side,
Case-02: Remainder ≠ 0
• Receiver assumes that some error occurred in the data during the
transmission.
• Receiver rejects the data and asks the sender for retransmission.
Basic concepts:
Redundant bits.
• Are some extra binary bits that are not part of the original
data, but they are generated & added to the original data bit.
• To ensure that the data bits don't get damaged and if they do,
we can recover them.
Total bits = m + r
r = redundant bit
Note
Then,
No. of redundant bits appended to the original msg = total no. of bits
–1=5–1=4
Parity bit, which is a bit appended to the data bits which ensures that
the total number of 1's are even (even parity) or odd (odd parity).
• If the total number of 1's are odd then write the value of parity
bit P1(or P2 etc.) as 1 (which means the error is there) and
• If it is even then the value of parity bit is 0 (which means no
error).
The first step is to identify the bit position of the data & all the bit
positions which are powers of 2 are marked as parity bits (e.g. 1, 2,
4, 8, etc.).
Let,
Step 1:
• For checking parity bit P1, use check one and skip one method,
which means, starting from P1 and then skip P2, take D3 then
skip P4 then take D5, and then skip D6 and take D7, this way we
will have the following bits,
As we can observe the total number of bits are odd so we will write
the value of parity bit as
• Check for P2 but while checking for P2, we will use check two
and skip two method, which will give us the following data bits.
• But remember since we are checking for P2, so we have to start
our count from P2 (P1 should not be considered).
As we can observe that the number of 1's are even, then we will write
the value of P2 = 0.
Step 3:
• Check for P4 but while checking for P4, we will use check four
and skip four method, which will give us the following data bits.
But remember since we are checking for P4, so we have started our
count from P4(P1 & P2 should not be considered).
As we can observe that the number of 1's are odd, then we will write
the value of P4 = 1. This means the error is there.
Now we have to determine the decimal value of this error word 101
which is 5
We get E = 5, which states that the error is in the fifth data bit.
Decimal to Binary
Versions of ALOHA
Pure ALOHA
• The total time of transmission is continuous in pure ALOHA. A
station sends a frame whenever one is available. The sender waits
for an arbitrary period of time before retransmitting the frame
if there is a collision and it is destroyed.
Slotted ALOHA
• Slotted ALOHA increases the capacity of pure ALOHA while
reducing collisions. Slots are discrete time periods that are used to
divide up the shared channel. Only at the start of each time slot is
Example: ALOHA
CSMA, CSMA/CD
Component of CSMA/CD.
• Fast Ethernet:
o This type of Ethernet is usually supported by a twisted pair
These data packets are then reassembled at the data’s destination. Frame
relay has long been used as part of many companies’ Integrated
Services Digital Network (ISDN) systems.
Er. Chandan Bhagat (MBMAN)
It provides the information speed from sixty four Kbps to forty five
Mbps.
An X.25 network
• Physical Layer:
o Commonly used for the linking.
• Packet Layer:
o This layer defines the format of data packets and the