Datalink Layer
Datalink Layer
Datalink Layer
DATALINK LAYER
Introduction
> It is the second layer of OSI model.
>It is the intermediate level of physical layer and
network layer.
>It helps to transfer the data between the reliable link.
>This layer is responsible for the error-free transfer of
data frames.
>It defines the format of the data on the network.
>It provides a reliable and efficient communication
between two or more devices.
>It is mainly responsible for the unique identification
of each device that resides on a local network.
> It is responsible for converting data steam to
single bit by bit and send that over the
underlying hardware.
h. Congestion Control:
h. Services provided to network layer:
Logical link control and Media Access Control
Logical Link Control Layer
It is responsible for transferring the packets to the Network
layer of the receiver that is receiving.
It identifies the address of the network layer protocol from
the header.
It also provides flow control.
Errors:
When bits are transmitted over the computer network, they are
subject to get corrupted due to interference and network problems. The
corrupted bits leads to spurious data being received by the destination
and are called errors.
Whenever bits flows from one point to other, they are subject to
unpredictable change due to interference, noise, distortion and
attenuation.
Types of Error :
There are three types of errors:
a. 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.
c. Brust Error:
In the received frame, more than
one consecutive bits are corrupted.
Error detection code:
>Central concept in detecting or correcting errors is
redundancy.
>At the receiving end, the parity bits are compared with the
parity bits computed from the received data.
Two Dimensional Parity check:
>Thirdly, the CRC remainder replaces the appended 0s at the end of the
original data. This newly generated unit is sent to the receiver.
>The receiver receives the data followed by the CRC remainder. The receiver
will treat this whole unit as a single unit, and it is divided by the same divisor
that was used to find the CRC remainder.
If the resultant of this division is zero which means that it has no error, and the data is
accepted.
If the resultant of this division is not zero which means that the data consists of an
error. Therefore, the data is discarded.
Cyclic Redundancy Check (CRC):
Cyclic Redundancy Check (CRC):
Cyclic Redundancy Check (CRC):
Error Correction:
Error Correction codes are used to detect and correct the
errors when data is transmitted from the Sender to the receiver.
The two basic to design the channel code and protocol for an error
correction system:
Automatic Repeat-Request(ARQ):
The transmitter sends data as well as error detection technique, which the
receivers checks for the error.
The receiver sends acknowledgement (ACK) of correctly received data and transmitter re-sends
the data if acknowledgement is not received within the
period.
Eg. Stop and wait ARQ, Go-back-N ARQ, and selective Repeat ARQ
DLL packs these bits into frames and takes the packets
from NL and encapsulates them into frames.
Receiver may have limited speed and memory to store the data,
thus it must be able to inform the device to stop the transmission
temporary before the limits are reached.
Working:
The sender sends data to the receiver.
The sender stops and waits for the acknowledgment.
The receiver receives the data and processes it.
The receiver sends an acknowledgment for the above
data to the sender.
Working:
-The sender and receiver have a “window” of frames. A
window is a space that consists of multiple bytes. The size of
the window on the receiver side is always 1.
Error detection is the process by which the receiver informs the sender about any
erroneous frame (damaged or lost) sent during transmission.
The most common techniques for error control are based on some or all of the
following:
Error detection: Using parity check or CRC check.
Positive acknowledgement: The destination returns a positive acknowledgement to
successfully received, error-free frames.
Re-transmission after timeout: The source re-transmits a frame that has not been
acknowledged after a predetermined amount of time.
Negative acknowledgement and re-transmission: The destination returns a negative
acknowledgement to frames in which an error is detected. The source re-transmits such frames.
Error Control:
Stop-and-wait protocol
Stop-and-wait ARQ is a technique used to retransmit the data in case of
damage or loss Frame.
This technique works on the principle that the sender will not transmit the
new frame until it receives the acknowledgement on the last transmitted
frame.
Featues of Retransmission:
> Sender keep the copy of last transmitted frame until the ack is received.
> Both the data frame and ACK is numbered alternately as 0 and 1.
> If error occur, NAK is received by the sender and retransmit the last frame
again.
>It works with timer, so Ack is not received by the sender within the allotted time.
Retransmit the frame again.
Stop-and-wait protocol
Multiple Access Protocol
Multiple Access Protocols are mechanisms that regulate how multiple devices
communicate over a common channel or network.
When nodes or stations are connected and use a common link, called a
multipoint or broadcast link, we need a multiple access protocol to coordinate
access to the link.
Many formal protocols have been devised to handle access to a shared link.
All of these protocols belongs to a sub-layer in the datalink layer called MAC
We categorize them into three groups.
Random Access Protocol
In random access or contention methods, no station is superior to
another station and none is assigned the control over another.
No station permits or does not permit another station to send.
At each instance, a station that has to send uses a procedure
defined by the protocol to make a decision on whether or not to
send.
This decision depends on the state of the medium (idle or busy).
It has two features:
i) No fixed time for sending data.
ii) No fixed sequence of stations sending the data.
ALOHA
It was developed as a part of project by University of Hawaii.
It proposes how multiple terminals access the media without interference or
collision.
It is designed for wireless LAN (Local Area Network) but can also be used in a
shared medium to transmit data. Using this method, any station can transmit
data across a network simultaneously when a data frameset is available for
transmission.
Aloha Rules
> Any station can transmit data to a channel at any time.
> It does not require any carrier sensing.
> Collision and data frames may be lost during the transmission of data through multiple
stations.
> Acknowledgment of the frames exists in Aloha. Hence, there is no collision detection.
> It requires retransmission of data after some random amount of time.
Pure ALOHA
Whenever data is available for sending over a channel at stations, we use Pure
Aloha.
In pure Aloha, when each station transmits data to a channel without checking
whether the channel is idle or not, the chances of collision may occur, and the
data frame can be lost.
When any station transmits the data frame to a channel, the pure Aloha waits for
the receiver's acknowledgment.
If it does not acknowledge the receiver end within the specified time, the station
waits for a random amount of time, called the backoff time (Tb).
And the station may assume the frame has been lost or destroyed. Therefore, it
retransmits the frame until all the data are successfully transmitted to the
receiver.
The total vulnerable time of pure Aloha is 2 * Tfr.
Maximum throughput occurs when G = 1/ 2 that is 18.4%.
Successful transmission of data frame is S = G * e ^ - 2 G.
Where G is number of stations want to transmit in Tfr Slot.
Pure ALOHA
Slotted ALOHA
The slotted Aloha is designed to overcome the pure Aloha's efficiency because
pure Aloha has a very high possibility of frame hitting.
In slotted Aloha, the shared channel is divided into a fixed time interval called
slots.
So that, if a station wants to send a frame to a shared channel, the frame can
only be sent at the beginning of the slot, and only one frame is allowed to be sent
to each slot.
And if the stations are unable to send data to the beginning of the slot, the
station will have to wait until the beginning of the slot for the next time.
However, the possibility of a collision remains when trying to send a frame at the
beginning of two or more station time slot.
P-persistent: The node senses the medium, if idle it sends the data with p
probability. If the data is not transmitted ((1-p) probability) then it waits for some
time and checks the medium again, now if it is found idle then it sends with p
probability. This repeat continues until the frame is sent. It is used in Wi-Fi and
packet radio systems.
IEEE 802 is comprised of standards with separate working groups that regulate different
communication networks,
including IEEE 802.1 for bridging (bottom sublayer), 802.2 for Logical link (upper sublayer),
802.3 for Ethernet, 802.5 for token ring, 802.11 for Wi-Fi, 802.15 for Wireless Personal area
networks,
802.15.1 for Bluetooth, 802.16 for Wireless Metropolitan Area Networks etc.
Ethernet
The original Ethernet was created in 1976 and since then, it has gone through four
generations.
The working principle of token bus is similar to Token Ring. Token Passing Mechanism in
Token Bus
A token is a small message that circulates among the stations of a computer network
providing permission to the stations for transmission. If a station has data to transmit
when it receives a token, it sends the data and then passes the token to the next station;
otherwise, it simply passes the token to the next station.
This is depicted in the following diagram:
Bluetooth:
Bluetooth is a short-range wireless communication technology that allows devices such
as mobile phones, computers, and peripherals to transmit data or voice wirelessly over a
short distance.
The purpose of Bluetooth is to replace the cables that normally connect devices, while
still keeping the communications between them secure.
It creates a 10-meter radius wireless network, called a personal area network (PAN) or
piconet, which can network between two and eight devices. Bluetooth uses less power
and costs less to implement than Wi-Fi.
Its lower power also makes it far less prone to suffering from or causing interference with
other wireless devices in the same 2.4GHz radio band.
There are some downsides to Bluetooth. The first is that it can be a drain on battery
power for mobile wireless devices like smartphones, though as the technology (and
battery technology) has improved, this problem is less significant than it used to be.
Also, the range is fairly limited, usually extending only about 30 feet, and as with all
wireless technologies, obstacles such as walls, floors, or ceilings can reduce this range
further. The pairing process may also be difficult, often depending on the devices
involved, the manufacturers, and other factors that all can result in frustration when
attempting to connect. Bluetooth defines two types of networks: piconet and scatternet.
Wi-Fi:
The IEEE 802.11 wireless LAN, also known as Wi-Fi, is the name of a popular wireless
networking technology that uses radio waves to provide wireless high-speed Internet and
network connections.
WiFi networks have no physical wired connection between sender and receiver, by using
radio frequency (RF) technology (a frequency within the electromagnetic spectrum
associated with radio wave propagation). When an RF current is supplied to an antenna,
an electromagnetic field is created that then is able to propagate through space.
There are several 802.11 standards for wireless LAN technology, including 802.11b,
802.11a, and 802.11g.
Wi-Fi uses multiple parts of the IEEE 802 protocol family and is designed to seamlessly
interwork with its wired sister protocol Ethernet. Devices that can use Wi-Fi technologies
include desktops and laptops, smartphones and tablets, smart TVs, printers, digital audio
players, digital cameras, cars and drones. Compatible devices can connect to each other
over Wi-Fi through a wireless access point as well as to connected Ethernet devices and
may use it to access the Internet. Such an access point (or hotspot) has a range of about
20 meters (66 feet) indoors and a greater range outdoors. Hotspot coverage can be as
small as a single room with walls that block radio waves, or as large as many square
kilometers achieved by using multiple overlapping access points.
Data Link Layer Protocols (DLL):
Data Link Layer protocols are generally responsible to simply ensure and confirm that the
bits and bytes that are received are identical to the bits and bytes being transferred. It is
basically a set of specifications that are used for implementation of data link layer just
above the physical layer of the OSI Model.
Difference Between High-level Data Link Control (HDLC) and Point-to-Point Protocol (PPP):
High-level Data Link Control is the bit-oriented protocol, on the other hand, Point-to-Point
Protocol is the byte-oriented protocol.
Another difference between HDLC and PPP is that HDLC is implemented by Point-to-point
configuration
and also multi-point configurations on the other hand While PPP is implemented by Point-
to-Point configuration only.