Data Link Layer

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Data Link Layer


The data link layer 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 is to ensure error-free transmission of information.
DLL is also responsible for encoding, decoding, and organizing the outgoing and
incoming data.
This is considered the most complex layer of the OSI model as it hides all the
underlying complexities of the hardware from the other above layers. In this
article, we will discuss Data Link Layer in Detail along with its functions, and sub-
layers.

OSI Model: Data Link Layer

Sub-Layers of The Data Link Layer


The data link layer is further divided into two sub-layers, which are as follows:
Logical Link Control (LLC)
This sublayer of the data link layer deals with multiplexing, the flow of data among
applications and other services, and LLC is responsible for providing error
messages and acknowledgments as well.
Media Access Control (MAC)
MAC sublayer manages the device’s interaction, responsible for addressing
frames, and also controls physical media access.
The data link layer receives the information in the form of packets from the
Network layer, it divides packets into frames and sends those frames bit-by-bit to
the underlying physical layer.
Functions of The Data-link Layer
There are various benefits of data link layers s let’s look into it.

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. It also attaches some special bits (for error control and addressing) at the
header and end of the frame. At the receiver’s end, DLL takes bits from the
Physical layer organizes them into the frame, and sends them to the Network
layer.
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.
MAC address is the unique hardware address that is assigned to the device while
manufacturing.
Error Control
Data can get corrupted due to various reasons like noise, attenuation, etc. So, it is
the responsibility of the data link layer, to detect the error in the transmitted data
and correct it using error detection and correction techniques respectively. DLL
adds error detection bits into the frame’s header, so that receiver can check
received data is correct or not. It adds reliability to phyiscal layer by adding
mechansims to detect and retransmit damaged or lost frames.
Flow Control
If the receiver’s receiving speed is lower than the sender’s sending speed, then this
can lead to an overflow in the receiver’s buffer and some frames may get lost. So,
it’s the responsibility of DLL to synchronize the sender’s and receiver’s speeds and
establish flow control between them.
Access Control
When multiple devices share the same communication channel there is a high
probability of collision, so it’s the responsibility of DLL to check which device has
control over the channel and CSMA/CD and CSMA/CA can be used to avoid
collisions and loss of frames in the channel.

What is MAC Address?



To communicate or transfer data from one computer to another, we need an
address. In computer networks, various types of addresses are introduced; each
works at a different layer. A MAC address, which stands for Media Access Control
Address, is a physical address that works at the Data Link Layer. In this article, we
will discuss addressing a DLL, which is the MAC Address.
So, go through the article if you are eager to learn what is MAC address and its
components.

What is MAC (Media Access Control) Address?


MAC Addresses are unique 48-bit hardware numbers of a computer that are
embedded into a network card (known as a Network Interface Card) during
manufacturing. The MAC Address is also known as the Physical Address of a
network device. In the IEEE 802 standard, the data link layer is divided into two
sublayers:
1. Logical Link Control (LLC) Sublayer
2. Media Access Control (MAC) Sublayer
The MAC address is used by the Media Access Control (MAC) sublayer of
the Data-Link Layer. MAC Address is worldwide unique since millions of network
devices exist and we need to uniquely identify each.

Format of MAC Address


To understand what is MAC address is, it is very important that first you
understand the format of the MAC Address. So a MAC Address is a 12-digit
hexadecimal number (6-bit binary number), which is mostly represented by Colon-
Hexadecimal notation.
The First 6 digits (say 00:40:96) of the MAC Address identify the manufacturer,
called the OUI (Organizational Unique Identifier). IEEE Registration Authority
Committee assigns these MAC prefixes to its registered vendors.
Here are some OUI of well-known manufacturers:
CC:46:D6 - Cisco
3C:5A:B4 - Google, Inc.
3C:D9:2B - Hewlett Packard
00:9A:CD - HUAWEI TECHNOLOGIES CO.,LTD
The rightmost six digits represent Network Interface Controller, which is
assigned by the manufacturer.
As discussed above, the MAC address is represented by Colon-Hexadecimal
notation. But this is just a conversion, not mandatory. MAC address can be
represented using any of the following formats:

Note: Colon-Hexadecimal notation is used by Linux OS and Period-separated


Hexadecimal notation is used by Cisco Systems.
Types of MAC Address
1. Unicast: A Unicast-addressed frame is only sent out to the interface leading to a
specific NIC. 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. The MAC Address of
the source machine is always Unicast.
2. Multicast: The multicast address allows the source to send a frame to a group of
devices. In Layer-2 (Ethernet) Multicast address, the LSB (least significant bit) of
the first octet of an address is set to one. IEEE has allocated the address block 01-
80-C2-xx-xx-xx (01-80-C2-00-00-00 to 01-80-C2-FF-FF-FF) for group addresses
for use by standard protocols.

3. Broadcast: Similar to Network Layer, Broadcast is also possible on the


underlying layer( Data Link Layer). Ethernet frames with ones in all bits of the
destination address (FF-FF-FF-FF-FF-FF) are referred to as the broadcast
addresses. Frames that are destined with MAC address FF-FF-FF-FF-FF-FF will
reach every computer belonging to that LAN segment.
Reason to Have Both IP and MAC Addresses.
The reason for having both IP and MAC addresses lies in the way the Internet
works, specifically in the structure of the OSI Model. This model is a conceptual
framework that describes how data is sent and received over a network. It’s
divided into seven layers, each performing specific functions.
 Layer 2 uses MAC addresses and is responsible for packet delivery from hop
to hop.
 Layer 3 uses IP addresses and is responsible for packet delivery from end to
end.
Layer 2 (Data Link Layer) uses a MAC (Media Access Control) address. These
are unique identifiers assigned to network interfaces for communications at the
data link layer. The primary function of MAC addresses is to manage how data is
transported from one network node to another on a direct, physical basis – this is
also referred to as “hop to hop” delivery.
On the other hand, Layer 3 ( Network Layer ) uses an IP (Internet Protocol)
address. These IP addresses are used to identify devices on a network and to route
traffic between networks. The IP addresses ensure that the data gets from its
original source reaches its final destination and it is also called “end-to-end”
delivery of data.
When a computer sends data, it first wraps it in an IP header, which includes the
source and destination IP addresses. This IP header, along with the data, is then
encapsulated in a MAC header, which includes the source and destination MAC
addresses for the current “hop” in the path.
As the data travels from one router to the next, the MAC address header is stripped
off and a new one is generated for the next hop. However, the IP header, which
was generated by the original computer, remains intact until it reaches the final
destination. This process illustrates how the IP header manages the “end to end”
delivery, while the MAC headers handle the “hop to hop” delivery.
So, Both IP and MAC addresses are essential for the functioning of the Internet.
While MAC addresses facilitate the direct, physical transfer of data between
network nodes, IP addresses ensure that the data reaches its final destination.

Channelization and Channelization


Protocols
We must constantly develop and enhance methods by which more users
can connect and transmit information via a link, also known as a channel,
without colliding or interfering.
According to the OSI model, the data link layer (DLL) transmits data
through a network channel from one node to another. We subdivided the
DLL into the logical link control (LLC) layer and the media access control
(MAC) layer, each with its own set of protocols.
We employ the LLC sub-layer when using a dedicated link to send data
from one node to another. In contrast, multiple users would attempt to use
the available channel to send data concurrently if dedicated channels were
unavailable. This could result in a collision. To coordinate this kind of data
transmission, we employ the MAC sub-layer.
Channelization is the process by which we coordinate the
transmission of data in non-dedicated channels to prevent collision
and crosstalk, and channelization protocols are the MAC protocols we
employ to coordinate this transmission.
Channels are communication resources we assign to a user to establish
communication with other users in the network. These resources include
frequency, time, code, space, bandwidth, and so on. We name each
channelization protocol based on the kind of channel resources we employ
for channelization. These protocols are:

 Frequency division multiple access (FDMA)


 Time division multiple access (TDMA)
 Code division multiple access (CDMA)
 Space division multiple access (SDMA)
 Orthogonal Frequency division multiple access (OFDMA)

Now let’s explain each protocol one by one.


3. Frequency Division Multiple Access
(FDMA) Protocol
We design the FDMA protocol by utilizing the channel resource of
frequency. By dividing the channel’s bandwidth into non-overlapping
frequency bands or slices, we allocate each user a distinct band for
exclusive transmission and reception. This enables the concurrent
operation of multiple users within a single communication channel. To
mitigate interference and crosstalk during data transmission, we equip each
user with a customized bandpass filter complemented by a small guard
band.
The following figure depicts the FDMA protocol scenario:

As seen in the above diagram, four users are attempting to access the
same channel. To accommodate the four users without interfering with one
another, we utilize FDMA to split the channel into four frequency bands.

3.1. Merits and Limitations of FDMA Protocols


Some notable merits which FDMA protocols offer us are:

 enable simultaneous transmission through the same frequency


channel, with each user operating at a single frequency
 using frequency as the channel resource eliminates timing-related
issues often encountered in TDMA protocols
 FDMA effectively resolves the near-far problem inherent in CDMA
protocols by implementing bandpass filtering
 as we assign users frequency slots, this allows for distinct
transmission and reception at different frequencies
However, the FDMA protocol does come with two significant limitations:

 the design of high-performing hardware filters proves to be a


challenging task
 despite the inclusion of guard bands, FDMA remains susceptible to
crosstalk, potentially leading to interference and transmission
disruptions

3.2. Frequency Allocation Schemes in FDMA


Protocols
Regarding frequency slot assignment within the FDMA protocol, we employ
two common methods, which are:

 Fixed assignment multiple access (FAMA)


 Demand assignment multiple access (DAMA)

We use FAMA to allocate frequency slots to users whether they utilize it or


not, ensuring a fixed allocation scheme. On the other hand, we use DAMA
to assign frequency slots to users only upon their explicit request, offering a
more dynamic and efficient resource allocation approach.

4. Time Division Multiple Access (TDMA)


Protocol
Time serves as the channel resource for this protocol. Using the TDMA
protocol, we divide each user’s signal into a different time slot and
assign each time slot to a different user. This technique enables
numerous users to share and use the same frequency channel. The global
system of mobile communication (GSM) system, a 2G cellular system, is
one significant application where we have used the TDMA protocol.
A typical TDMA protocol looks like this:
Synchronizing the various users of the channel is one of the biggest
challenges we face when utilizing the TDMA protocol. To achieve
synchronization, we ensure each user knows their respective slots’ start
and endpoints. This is difficult to achieve, especially if the users are spread
over a large area. To minimize this challenge, we insert guard times to
each user channel.
Another significant drawback we encounter when utilizing TDMA systems is
the potential for causing interference at a frequency that closely adjoins
another user’s active time slot. This interference manifests as the buzzing
sound we occasionally hear when a TDMA phone is near a radio or
speakers.
Just like in the FDMA protocol, there are two methods we use to administer
time slots to users:

 Fixed time division multiple access (F-TDMA)


 Dynamic time division multiple access (D-TDMA)

While we use F-TDMA for fixed allocation of time slots to users, we use D-
TDMA to assign time slots to users based on the traffic demand of the
channel.

5. Code Division Multiple Access (CDMA)


Protocol
The channel resource for this protocol is code. In the CDMA protocol, we
allow multiple users to simultaneously transmit their data signals
over the entire bandwidth of the common channel by assigning
unique spreading codes to each user. This technique helps us utilize the
channel more effectively.
Let’s see what a CDMA protocol looks like:

The beauty of this protocol is that we don’t share the frequency as we do in


FDMA, and neither do we share time as we do in TDMA. In CDMA, we
employ both time and frequency for users to send their data over the entire
bandwidth of the channel with a unique spreading code allotted to the user.
Only receivers having this unique code can receive the sent messages.
In CDMA, we use the spread spectrum principle to utilize unique
transmission codes. Let us discuss this principle more in-depth.

5.1. Spread Spectrum


Spread spectrum is a technique that enables us to transfer signals via
communication channels by purposefully extending the signal’s
bandwidth beyond what is necessary for transmission. We expand the
signal bandwidth in order to keep transmission interference to a bare
minimum. To offset the waste of bandwidth due to overspreading, we allow
multiple users to access the channel.
We implement the spread spectrum in two ways:

 Direct sequence spread spectrum (DSSS)


 Frequency hopping spread spectrum (FHSS)

Let’s now discuss each method.


In DSSS, we multiply the message signal with a locally generated
spreading pseudorandom noise (PN) code, which we refer to as chips,
to widen the signal’s bandwidth. By multiplying the signal, we broadcast
at the receiver by a locally produced copy of the PN code sequence, and
we can decode the information. We have incorporated DSSS into GPS and
Wi-Fi networks.
To spread the message signal in FHSS, we transmit it with rapidly
changing carrier frequencies among several frequencies occupying a
large bandwidth. We control the “frequency hopping” of the message
signal by a PN code known to the sender and receiver. In this way, we
send and receive data without interference and eavesdropping.
We employ two strategies to manage CDMA protocols based on spread
spectrum technologies:

 Direct sequence code division multiple access (DS-CDMA)


 Frequency hopping code division multiple access (FH-CDMA)

Based on the same logic as their spread spectrum counterparts, we apply


these techniques.

5.2. Advantages and Disadvantages of CDMA


CDMA offers several advantages over other communication technologies,
such as FDMA and TDMA. Firstly, CDMA significantly increases user
capacity compared to FDMA and TDMA. Moreover, it allows for
simultaneous voice and data communication, which is impossible with
TDMA and FDMA.
Another significant advantage of CDMA is its high level of security in
transmitting information. In CDMA, we employ a unique code for each user,
making accessing information difficult for unauthorized users. Additionally,
the probability of interference is minimal in CDMA, providing reliable
communication.
Furthermore, CDMA enables us to use the entire spectrum, offering more
flexibility in communication. With CDMA, we can take advantage of the
entire bandwidth available, which is impossible with FDMA or TDMA.
Despite its advantages, CDMA also has some significant drawbacks that
must be considered. Firstly, the system’s operation is highly complex,
making it difficult to set up and maintain.
Moreover, In CDMA, we use orthogonal codes for both the sender and the
receiver in a synchronous manner to recover the original data accurately. If
this requirement is unmet, the system experiences self-jamming, making
communication challenging.

6. Space Division Multiple Access (SDMA)


In this protocol, we utilize space as the channel resource. We allocate the
same frequency to users that are separated by a certain distance,
which we refer to as the reuse distance. To accomplish this, we employ
a smart and highly directional antenna that directs a beam of radio waves
to a specific location in space where a user is located.
To enable the reuse of the same channel, we use another smart and highly
directional antenna to beam his signal to a different location in the same
space where other users are located. This smart antenna system is known
as a Multiple Input Multiple Output (MIMO) system.
A typical SDMA protocol looks like this:

From the figure, we see that the same channel-1 is reused to send data to
three different users because a reuse distance separates them.
By using a highly directional beam, we can minimize interference and
improve the quality of communication for users in the network. Additionally,
the MIMO system can increase the network’s capacity by allowing multiple
users to communicate simultaneously without affecting each other’s
signals.
This protocol provides us with some merits:
 it helps us to optimize the use of power and minimize the wastage of
energy
 we are able to save the channel bandwidth and utilize it more
effectively
 it helps us reduce interference to near zero
 we can control and regulate the energy we radiate to the receiver

To achieve the full potential of the SDMA protocol, we must carefully


design it, which we always find very tedious.

7. Orthogonal Frequency Division Multiple


Access (OFDMA)
As the world is witnessing an increasing demand for individual data
consumption, we recognize the necessity to enhance the existing protocol
standards to meet this demand. To address this, we devised a solution that
merged the benefits of FDMA and TDMA protocols in an orthogonal
fashion, thereby preventing interference.
This innovation led to the emergence of the OFDMA protocol. To
accomplish this, we utilized the channel resource by combining frequency
and time in an orthogonal manner. Now, let’s delve into the functionality of
the OFDMA protocol:
The OFDMA protocol actively takes a channel and partitions it into
smaller frequency units which we know as resource units (RUs). We
then allocate these RUs to users according to their respective data
consumption demands.
For instance, if a user intends to send an email, we assign a small RU due
to the minimal data requirement. Conversely, a user aiming to video call
their boss receives a larger RU allocation.

To ensure interference avoidance, we divide the RUs in an orthogonal


manner. Subsequently, we employ a single access point (AP) to aggregate
all assigned users to their respective RUs, facilitating the delivery of their
messages to the intended recipients.
Thanks to the dynamic efficiency we embedded in the design of the
OFDMA protocol, we can assign receivers RUs based on the data size they
expect to receive.
This is a typical OFDMA protocol layout:
The OFDMA protocol significantly mitigates the unpredictability
experienced by users in highly congested areas by enabling more users to
connect concurrently to a single access point (AP). In doing so, OFDMA
effectively addresses congestion issues.
Furthermore, this protocol exemplifies exceptional efficiency by seamlessly
allocating either the entirety of a channel or dividing it to accommodate
multiple users, depending on the specific traffic demands.

A wired Local Area Network (LAN) is a type of network that uses physical cables to connect
devices within a relatively small geographic area, such as a home, office, or campus. Here's a
detailed look at how wired LANs work, including their components, types, and advantages.

Components of a Wired LAN

1. Network Interface Cards (NICs):


o Function: NICs are hardware components installed in computers and other
network devices that allow them to connect to the network. They come in two
main types: Ethernet NICs for wired connections and wireless NICs for wireless
connections.
o Connection: For wired LANs, NICs have Ethernet ports that connect to network
cables.
2. Switches:
o Function: Network switches manage data traffic within the LAN by receiving
incoming data packets and directing them to the appropriate device based on
MAC addresses.
o Operation: Switches operate at the Data Link layer (Layer 2) of the OSI model
and can also handle Layer 3 functions like routing in more advanced switches.
3. Routers:
o Function: Routers connect the LAN to external networks, such as the internet.
They route data between devices within the LAN and external networks.
o Operation: Routers operate at the Network layer (Layer 3) of the OSI model and
manage IP addressing and routing.
4. Cabling:
o Types:
 Twisted Pair Cables: The most common type is Ethernet cables, such as
Cat5e, Cat6, and Cat6a. These cables consist of pairs of wires twisted
together to reduce interference and are used to connect devices to switches
and routers.
 Fiber Optic Cables: Used for high-speed, long-distance connections,
fiber optics use light to transmit data and are less susceptible to
electromagnetic interference compared to twisted pair cables.
5. Patch Panels:
o Function: Patch panels serve as a central point where all network cables are
terminated. They provide a convenient way to manage and organize connections
and can be used to connect different parts of the network.
o Operation: Cables from various devices are plugged into the patch panel, which
then connects to switches and routers.
6. Hubs (Less common today):
o Function: Hubs are basic networking devices that connect multiple Ethernet
devices, making them act as a single network segment.
o Operation: Hubs broadcast incoming data packets to all connected devices,
which can lead to network congestion and inefficiency. They have largely been
replaced by switches, which are more efficient.

Types of Wired LANs

1. Ethernet LAN:
o Description: The most common type of wired LAN, Ethernet LANs use Ethernet
protocols and cabling. They support speeds ranging from 10 Mbps (10BASE-T)
to 100 Gbps (100GBASE-T) or more.
o Standards: Common Ethernet standards include 10BASE-T (10 Mbps),
100BASE-TX (100 Mbps), 1000BASE-T (1 Gbps), and 10GBASE-T (10 Gbps).
2. Token Ring LAN (Less common today):
o Description: Token Ring networks use a token-passing protocol where a token
circulates around the network, and a device can only send data if it possesses the
token.
o Standards: The most common standard was IEEE 802.5, but Token Ring
networks are largely obsolete in favor of Ethernet.

Advantages of Wired LANs

1. Speed and Performance:


o Wired LANs typically offer higher speeds and more stable connections compared
to wireless LANs. Ethernet connections can easily support high data transfer
rates, such as 1 Gbps or more, with low latency.
2. Reliability:
o Wired connections are less susceptible to interference from physical obstructions
and other wireless signals, leading to more reliable network performance.
3. Security:
o Wired LANs are generally more secure than wireless networks since physical
access to the network is required to intercept data. Unauthorized access is harder
to achieve compared to intercepting wireless signals.
4. Consistency:
o Network performance in wired LANs tends to be more consistent, as wired
connections are not affected by signal degradation or interference from other
wireless devices.
5. Ease of Troubleshooting:
o Diagnosing issues in wired LANs can be simpler because the physical
connections and paths are clearly defined. Tools like network analyzers and cable
testers can help identify and resolve problems.

Disadvantages of Wired LANs

1. Flexibility:
o Wired networks lack the mobility and flexibility of wireless networks. Devices
need to be physically connected with cables, which can limit movement and
requires more setup.
2. Installation Complexity:
o Installing a wired LAN involves running cables through walls, ceilings, or floors,
which can be complex and disruptive, especially in existing buildings.
3. Scalability:
o Expanding a wired LAN may require additional cabling and hardware, which can
be more cumbersome compared to adding new devices to a wireless network.

You might also like