0% found this document useful (0 votes)
4 views

Chapter 4 - Introduction to Data-Link- Layer

Uploaded by

payeja1730
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Chapter 4 - Introduction to Data-Link- Layer

Uploaded by

payeja1730
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Chapter 4: Introduction to Data-Link- Layer

The Data-link layer (DLL) is the second layer from the bottom in the OSI (Open System
Interconnection) network architecture model. It is responsible for the node-to-node delivery of data. Its
major role to ensure the error-free transmission of information. DLL is also responsible to encode, decode
and organize the outgoing and incoming data. The communication channel that connects the adjacent
modes is known as a link, and to move the datagram from the source to the destination, the datagram must
be moved across an individual link. The main responsibility of the Data Link Layer is to transfer the
datagram across an individual link. The Data link layer protocol defines the format of the packet exchanged
across the nodes as well as the actions such as Error detection, retransmission, flow Control and random
access.
Link Layer Addressing
A link-layer address is called a link address, called a physical address, and sometimes a MAC
address. Since a link is controlled at the data-link layer, the addresses need to belong to the data-link layer.
Whena datagram passes from the network layer to the data-link layer, the datagram will be encapsulated
a frame and two data-link addresses are added to the frame header. These two addresses are changed
every time the frame moves from one link to another.
There are three frames, one in each link. Each frame carries the same datagram with the same
source and destination addresses but the link-layer addresses of the frame change from link to link. Note
that For IP addresses, the source address comes before the destination address; for link layer addresses,
the destination address comes before the source.
There are three types ofaddressing
1. Unicast Addressing
Each host or each interface of a router is assigned a unicast address. Unicasting means one-to-one
communication. A frame with a unicast address destination is destined only for one entity in the link.
2. Multicast Addressing
Some link-layer protocols define multicast addresses. Multicasting means one-to-many many-many
communication.
3. Broadcast Addressing
Some link-layer protocols define a broadcast address. Broadcasting means one-to-all communication. A
frame with a destination broadcast address is sent to all entities in the link
Error Detection and Error Correction
A data link layer mainly provides a reliable delivery service over the links as they have higher
error rates and can be corrected locally, link at which an error occurs rather than forcing to retransmit the
data.
Errors can be introduced by signal attenuation and noise. The Data Link Layer protocol provides a
mechanism to detect one or more errors. This is achieved by adding error detection bits in the frame and
then receiving node can perform an error check. Error correction is similar to Error detecting except that
receiving node not only detects the errors but also determines where the errors occurred in the frame.
Definition
An Error is a situation when the message received at the receiver end is not identical to the message
transmitted
An error is 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.
Types of Errors
There are two types of error.
1. Single Bit Error
2. Burst Error

1. Single Bit Error


• The value of a single bit in a data unit is changed. It doesn’t occur very often in serial data transmission.
•Whenever bits flow from one point to another, they are subject to unpredictable changes because of
interference. This interference can change the shape of the signal.

2. Burst Error
•The value of two or more bits in the data unit is changed. This is the usual type of error in serial data
transmission. A burst error is a single-bit error because the duration of the noise signal is normally longer
than the duration of 1 bit, which means that when noise affects data, it affects a set of bits.
•The number of bits affected depends on the data rate and duration of the noise. For example, if we are
sending data at 1 kbps, a noise of 1/100 second can affect 10 bits; if we are sending data at 1 Mbps, the
same noise can affect 10,000 bits.
Redundancy
The central concept in detecting or correcting errors is redundancy. To be able to detect or correct
errors, we need to send some extra bits with our data. These redundant bits are added by the sender and
removed by the receiver. Their presence allows the receiver to detect or correct corrupted bits. The
concept of including extra information in the transmission for error detection is a good one. But instead of
repeating the entire data stream, a shorter group of bits may be appended to the end of each unit.
This technique is called redundancy because the extra bits are redundant to the information: they are
discarded as soon as the accuracy of the transmission has been determined.
Error Detection Versus Error Correction
•In error detection, we are looking only to see if any error has occurred. A single-bit error is the same for
us as a burst error.
•In error correction , we need to know the exact number of bits that are corrupted and more
importantly, their location in the message. So the number of errors and the size of the message are
important factors. Note: correction of errors is more difficult than the detection.
Method of Error Correction
Error Correction can be handled in two ways:
 Backward Error Correction or Retransmission : It is a technique in which the receiver detects
the occurrence of an error and asks the sender to resend the message.
 Forward Error Correction (FEC): It is the process in which the receiver tries to guess the
message by usingredundant bits.
Block Coding
In block coding, we divide our message into blocks, each of “k’ bits, called data words. We add’
redundant bits to each block to make the length n = k+r. The resulting n-bit blocks are called code words.
For example, we have a set of data words, each of size k, and a set of code words, each of size n.
With kbits, we can create a combination of 2k data words, with n bits; we can create a combination of 2n
code words. Since n>k, the number of possible code words is larger than the number of possible data words.
The block coding process is one-to-one; the same data word is always encoded as the same code word.
This means we have 2n-2k code words that are not used. We call these code words invalid or illegal.
Errors can be detected by using block coding if the following two conditions are met.
1. The receiver has (or can find) a list of valid code words.
2. The original code word has changed to an invalid one.
The sender creates code words out of data words by using a generator that applies the rules a
procedures of encoding, Each code word sent to the receiver may change during transmission. If the
received code word is the same as one of the valid code words, the word is accepted, the corresponding data
word is extracted for use.
If the received code word is not valid, it is discarded. However, if the code word is corrupted during
transmission but the received word still matches a valid code word, the error remains undetected. This type
of coding can detect only single errors. Two or more errors may remain undetected.

Error Correction in Block Coding


Error correction is much more difficult than error detection. In error detection, the receiver needs,
know only that the received code word is invalid. In error correction, the receiver needs to find ( guess) the
original code word sent. So, we need more redundant bits for error correction than for error detection.
Datawords Codewords
00 00000
01 01011
10 10101
11 11110

Assume the data word is 01, The sender consults the table (or uses an algorithm) to create the code
word 01011. The code word is corrupted during transmission, and 01001 is received (error in the second
bit from the right). First, the receiver finds that the received code word is not in the table. This means an
error has occurred.(Detection must come before correction.) The receiver, assuming that there is only 1 bit
corrupted, uses the following strategy to guess the correct data word.
1. Comparing the received code word with the first code word in the table (01001 versus 00000), the
receiver decides that t the first code word is not the one that was sent because there are two different
bits.
2. By the same reasoning, the original code word cannot be the third or fourth one in the table.
3. The original code word must be the second one in the table because this is the only one that differs
from the received code word by 1 bit. The receiver replaces 01001 with 01011 and consults the table to
find the data word 01.
Cyclic Codes
Cyclic codes are special linear block codes with one extra property. In a cyclic code, if a code word is
cyclically shifted (rotated), the result is another code word.
Cyclic Redundancy Check
One of the categories of cyclic codes called the cyclic redundancy check (CRC) is used in networks such as
LANs and WANs. We can create cyclic codes to correct errors
The following table shows an example of a CRC code which shows both the linear and cyclic properties of
this code.
Dataword Codeword Dataword Codeword
0000 0000000 1000 1000101
0001 0001011 1001 1001110
0010 0010110 1010 1010011
0011 0011101 1011 1011000
0100 0100111 1100 1100010
0101 0101100 1101 1101001
0110 0110001 1110 1110100
0111 0111010 1111 1111111

In the encoder, the data word has k bits (4 here); the code word has n bits (7 here). The size of the data
word is augmented by adding n -k (3 here) 0s to the right-hand side of the word. The n-bit result is fed
into the generator.
The generator uses a divisor of size n – k+ 1 (4 here), predefined and agreed upon. The generator divides
the augmented Data word by the divisor (modulo-2 division). The quotient of the division is discarded;
the remainder (r2 r1 r0) is appended to the data word to create the code word. The decoder receives the
possibly corrupted code word., A copy of all n bits is fed to the checker which is a replica of the
generator. The remainder produced by the checker is a syndrome of n – k (3 here) bits, which is fed tothe
decision logic analyzer. The analyzer has a simple function. If the syndrome bits are al 0s, the 4
leftmost bits of the code word are accepted as the data word (interpreted as no error otherwise, the 4 bits
are discarded (error).
Encoder
For example, consider the following figure where the encoder takes the data word and augments with n
– k number of 0s. It then divides the augmented data word by the divisor, as shown in Figure

Decoder
The code word can change during transmission. The decoder does the same division process as the
encoder. The remainder of the division is the syndrome. If the syndrome is all 0s, there is no error; the
data word is separated from the received code word and accepted. Otherwise, everything is discarded.
Consider the following figure which shows two cases: The left-hand figure shows the value of syndrome
when no error has occurred; the syndrome is 000. The right-hand part of the figure shows the case in
which there is one single error. The syndrome is not all 0s (it is 011).
The cyclic codes have a very good performance in detecting single-bit errors, double errors, an odd number
of errors, and burst errors. They can easily be implemented in hardware and software. They are especially
fast when implemented in hardware. This has made cyclic codes a good candidate for many networks.
Check Sum
The checksum is used on the Internet by several protocols although not at the data link layer. Like
linear and cyclic codes, the checksum is based on the concept of redundancy. Several protocols still use the
checksum for error detection.
Example: Our data is a list of five 4-bit numbers that we want to send to a destination. In addition to
sending these numbers, we send the sum of the numbers. For example, if the set of numbers is (7, 11, 12,
0, 6), we send (7, 11, 12, 0, 6, 36), where 36 is the sum of the original numbers. The receiver adds thefive
numbers and compares the result with the sum. If the two are the same the receiver assumes no
erro, accepts the five numbers, and discards the sum. Otherwise, there is an error somewhere and the data
are not accepted. To make the job of the receiver easy if we send the negative (complement) of thesum,
called the checksum. In this case, we send (7, 11, 12 0,6,-36), The receiver can add all the numbers
received (including the checksum). If the result is 0, it assumes no error; otherwise, there is an error

You might also like