Presentation Slides

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 39

NIFS214

DATA LINK LAYER


Learning Objectives
• Understand the role of data link layer
• Become familiar with common sources of errors and their prevention
• Understand three common errors detection and correction methods
• Become familiar with several commonly used data link protocols
Introduction

What is a data link layer?

• The data link layer (also called layer 2) is responsible for moving a message from one
computer or network device to the next computer or network device in the overall path
from sender or receiver
• It controls the way messages are sent on the physical media.
• Both the sender and receiver have to agree on the rules, or protocols, that govern how
they will communicate with each other.
• A data link protocol determines who can transmit at what time, where a message begins
and ends, and how a receiver recognizes and corrects a transmission error. In this
chapter, we discuss these processes as well as several important sources of errors
Data link protocol
• Media Access Control
-Contention
- Controlled Access
-Relative Performance
• Error Control
-Sources of Errors
-Error Prevention
-Error Detection
- Error Correction via Retransmission
- Forward Error Correction
- Error Control in Practice
• A data link protocol performs three functions:
◾ Controls when computers transmit (media access control)
◾ Detects and corrects transmission errors (error control)
◾ Identifies the start and end of a message by using a PDU (message delineation
The role of the data link layer.
• Data Link Layer is second layer of OSI Layered Model. This layer is one
of the most complicated layers and has complex functionalities and
liabilities. Data link layer hides the details of underlying hardware and
represents itself to upper layer as the medium to communicate.
• Data link layer works between two hosts which are directly connected
in some sense. This direct connection could be point to point or
broadcast. Systems on broadcast network are said to be on same link.
The work of data link layer tends to get more complex when it is
dealing with multiple hosts on single collision domain.
The role of the data link layer.
• Data link layer works between two hosts which are directly connected
in some sense. This direct connection could be point to point or
broadcast. Systems on broadcast network are said to be on same link.
The work of data link layer tends to get more complex when it is
dealing with multiple hosts on single collision domain.
• Data link layer is responsible for converting data stream to signals bit
by bit and to send that over the underlying hardware. At the receiving
end, Data link layer picks up data from hardware which are in the
form of electrical signals, assembles them in a recognizable frame
format, and hands over to upper layer.
The role of a data link layer.
• Data link layer has two sub-layers:
• Logical Link Control: It deals with protocols, flow-control, and error
control
• Media Access Control: It deals with actual control of media
Functionality of Data-link Layer

• Data link layer does many tasks on behalf of upper layer. These are:
• Framing
• 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.
• Synchronization
• When data frames are sent on the link, both machines must be
synchronized in order to transfer to take place.
Functionality of Data-link Layer
• Addressing
• Data-link layer provides layer-2 hardware addressing mechanism.
Hardware address is assumed to be unique on the link. It is encoded
into hardware at the time of manufacturing.
• Error Control
• Sometimes signals may have encountered problem in transition and
the bits are flipped.These errors are detected and attempted to
recover actual data bits. It also provides error reporting mechanism to
the sender.
Functionality of Data-link Layer.
• Flow Control
• Stations on same link may have different speed or capacity. Data-link
layer ensures flow control that enables both machine to exchange
data on same speed.
• Multi-Access
• When host on the shared link tries to transfer the data, it has a high
probability of collision. Data-link layer provides mechanism such as
CSMA/CD to equip capability of accessing a shared media among
multiple Systems.
3. Common sources of error and their
prevention
1. Echoes are the result of poor connections that cause the signal to reflect back to the transmitting
equipment. If the strength of the echo is strong enough to be detected, it causes errors.
• It is caused by poor connections and can be prevented by fixing the connections or tune
equipment.

2. White noise is caused by the thermal agitation of electrons and therefore is inescapable. Usually is
not a problem unless it becomes so strong that it obliterates the transmission.
• It is caused by movement of electrons, can be prevented by increasing signal strength.

3. Cross-talk occurs when one circuit picks up signals in another. You experience cross-talk during
telephone calls when you hear other conversations in the background, it occurs between pairs of wires
that are carrying separate signals, in multiplexed links carrying many discrete signals.
• Prevention:
• Reduce the length of parallel wires carrying signals.
• Use voltage lines with an equal magnitude but opposite polarity to generate signals.
• Use twisted-pair cables with more turns per unit distance. 11
4. Impulse noise (sometimes called spikes) is primary source of errors in data communications
and is heard as a click or a crackling noise.

• It is caused by the sudden increases in electricity and can be prevented by shielding or


moving the wires

5. Attenuation is the loss of power a signal suffers as it travels from the transmitting computer to
the receiving computer. Some power is absorbed by the medium or is lost before it reaches the
receiver. As the medium absorbs power, the signal becomes weaker, and the receiving
equipment has less and less chance of correctly interpreting the data.

6. Intermodulation noise is a special type of cross-talk. The signals from two circuits combine to
form a new signal that falls into a frequency band reserved for another signal. This type of noise
is similar to harmonics in music, on a multiplexed line, many different signals are amplified
together, and slight variations in the adjustment of the equipment can cause intermodulation
noise.

• It is caused by signals from several circuits can be prevented by moving or shielding the
wires.
12
Commonly used data link
protocols
Synchoronous Data Link Protocol(SDLC)
• Communication protocol for computers
• Designed and developed by IBM in 1975
• Connects all remote devices to a mainframe computer at a central
location
• Makes sure that data units arrive correctly and with the right flow
from one network point to another
High-Level Data Link Protocol(HDLC)
• Created and developed by ISO in 1979
• Bit-oriented protocol that is applicable for point-to-point and
multipoint communications
• Protocol is generally based on SDLC
• Assumed to be the umbrella that most wide area protocols fall under
Serial Line Interface Protocol(SLIP)
• Older protocol that is used to add a framing byte at the end of an IP
packet
• Data link control facility that is required for transferring IP packets
between an Internet Service Providers and end-users over a dial-up
link
• Designed to work over serial ports and several router connections
simply for communication
• Does not provide error correction or error detection
Point to Point Protocol(PPP)
• Provides the same functionality as SLIP
• The most robust protocol
• Used to transport other types of packets along with IP Packets
• Can be required for dial-up and leased router to router lines
• Character-oriented protocol that is also used for error detection
• Provides framing method to describe frames
Link Control Protocol(LCP)
• Developed and created by IEEE 802.2
• Provides HDLC style services on LAN
• Basically a PPP that is used for establishing, configuring, testing,
maintenance and ending or terminating links for transmission of data
frame
Link Access Procedure(LAP)
• Originated from IBM SDLC
• Data link layer to protocols required for framing and transferring data
across point to point links
• Three types of LAP
• LAPB which stands for Link Access Procedure Balanced
• LAPD which stands for Link Access Procedure D-Channel
• LAPF which stands for Link Access Procedure Frame-Mode Bearer
Services
Network Control Protocol(NCP)
• Older protocol implemented by ARPANET
• Allows users to have access to their computers from different
locations
• Allows for files to be transferred among two or more computers
• Generally a set of protocols that form a part of the PPP
• Was replaced by TCP/IP in the 1980s
Media Access
Control
What is Media Access Control(MAC)
• The term Media Access Control refers to the requirement to control
when a computer transmits.
• There are only two computers on the circuit in point-to-point full-
duplex configurations.
• Full-duplex allows any other computer to transmit at any time.
• Therefore, MAC is considered unnecessary.
Why is MAC important?
• It becomes important when multiple computers share the same
communication circuit.
Basic approaches of MAC
• Contention
• Controlled Access
Contention
• Contention is a first-come, first-serve approach whereby computers
must wait until there is no other computer transmitting for them to
transmit whenever they have data to send.
• Collision detection (CD) is the most used contention-based MAC
protocol, it is frequently used in Ethernet networks.
• When a device needs to transmit, the Network Interface Card (NIC)
monitors the network to determine whether or not another device is
transmitting.
• Therefore, the NIC cannot transmit if it senses electrical signals on the
network that indicate another device is transmitting.
Controlled Access
• One device controls the circuit and determines which clients can
transmit at what time.
• There are two frequently used controlled access techniques which
are; Access requests and Polling.
Access Request Technique
• Client computers that want to transmit must send a request to
transmit to the device that is controlling the circuit.
• Then, the controlling device grants permission for one computer at a
time to transmit.
• Computers that are waiting to transmit use a contention technique to
send a request.
Polling technique
• A process of sending a signal to a client computer that grants it
permission to transmit.
• Clients store all messages that need to be transmitted.
• Periodically, the controlling device (wireless access point) polls the
client to check whether it has data to send.
• If it has, the client sends the data.
Three common error detection
and correction methods

 Error occurs 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 traveling from
the sender to the receiver. That means a 0 bit may change to 1 bit or
a 1 bit may change to 0.
 This is when some application requires that an error is detected and
corrected
Explanation of what a error detection is
and correction methods
Error detection Correction error
• Simply means the identification of • Means solving or fixing errors
errors. These errors may be caused
by noise and cross-talk.
• Error correction involves
ascertaining the exact number of
• It detects errors in transmitted bits that have been corrupted
messages and reconstructing the
original error-free data.
and the location of the
corrupted bits.
• Error correction ensures that
corrected and error-free messages
are obtained at the receiver’s side.
Types of errors
 Single bit error
 Multiple bits error
 Burst error
Single bit error

In a single-bit error only 1 bit in the data changes


Multiple bits error
A burst error means that two or more bits have changed
Burst error
• contains more than 1 consecutive bits corrupted.
• Burst error is most likely to happen in serial transmission since the duration of
noise is normally longer than the duration of a bit.
• The number of bits affected depends on the data rate and duration of the noise.

i
The three common error
detection are namely:
1 Parity Check
2 Check-sum
3 Cyclic Redundancy Check
Parity check
One extra bit is sent along with the original bits to
make a number of 1s either even in case of even
parity, or odd in case of odd parity.
The sender while creating a frame counts the number
of 1s in it.
For example, if even parity is used and the number of
1s is even then one bit with the value 0 is added. This
way number of 1s remains even.
If the number of 1s is odd, to make it even a bit the
value 1 is added.
On receiving a frame, the receiver counts the number
of 1s in it. In the case of an even parity check, if the
count of 1s is even, the frame is accepted, otherwise,
it is rejected.
Check-sum

•Data is divided into fixed-sized frames or


segments.
•The sender adds the segments using 1’s
complement arithmetic to get the sum. It then
complements the sum to get the checksum and
sends it along with the data frames.
•The receiver adds the incoming segments along
with the checksum using 1’s complement
arithmetic to get the sum and then complements
it.
•If the result is zero, the received frames are
accepted; otherwise, they are discarded.
Cyclic Redundancy Check

• The sender performs binary Division of the


data segment by the divisor.
• It then appends the remainder called CRC
bits to the end of the data segment.
•This makes the resulting data unit exactly
divisible by the divisor.
•The receiver divides the incoming data unit
by the divisor.
•If there is no remainder, the data unit is
assumed to be correct and is accepted. If it
is then understood that the data is
corrupted and is therefore rejected.
The types of error correction
1. Backward error Correction − If the • Forward Error Correction −It involves adding
receiver detects an error in the parity data bits to the message. These
incoming frame, it requests the parity bits will be read by the receiver to
determine whether an error happened
sender to retransmit the frame.
during transmission or storage.
 It is a relatively simple technique. • The receiver checks and corrects errors
 But it can be efficiently used only when they occur. It does not ask the
where retransmitting is not expensive transmitter to resend the frame or
message.
as in fiber optics and the time for
retransmission is low relative to the • This saves the bandwidth required for
requirements of the application. retransmission. It is inevitable in real-time
systems.
• But if there are too many errors, the
frames need to be retransmitted.

You might also like