CN Unit-V Notes
CN Unit-V Notes
UNIT V
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 to encode, decode and
organize 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.
The data link layer is further divided into two sub-layers, which are as follows:
CS3591 COMPUTER NETWORKS
GNANAMANI COLLEGE OF TECHNOLOGY
DEPARTMENT OF AI&DS
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.
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.
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. 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.
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. MAC address is the
unique hardware address that is assigned to the device while manufacturing.
CS3591 COMPUTER NETWORKS
GNANAMANI COLLEGE OF TECHNOLOGY
DEPARTMENT OF AI&DS
3. 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.
4. 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.
5. 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.
There are various protocols in the data link layer, which are as follows:
Address field –
This field is used to identify and specify type of packet that is present in cHDLC frame. It can be
0*0F for Unicast and 0*8F for Broadcast packets.
Control field –
This field is always set to zero i.e. 0*00.
Protocol field –
This field is especially required to specify and identify type of protocol that is being
encapsulated withing cHDLC frame. It can be 0x0800 for Internet Protocol.
1. Flag field – PPP frame similar to HDLC frame, always begins and ends with standard
HDLC flag. It always has a value of 1 byte i.e., 01111110 binary value.
2. Address field – Address field is basically broadcast address. In this, all 1’s simply indicates
that all of the stations are ready to accept frame. It has the value of 1 byte i.e., 11111111
binary value. PPP on the other hand, does not provide or assign individual station addresses.
CS3591 COMPUTER NETWORKS
GNANAMANI COLLEGE OF TECHNOLOGY
DEPARTMENT OF AI&DS
3. Control field – This field basically uses format of U-frame i.e., Unnumbered frame in
HDLC. In HDLC, control field is required for various purposes but in PPP, this field is set
to 1 byte i.e., 00000011 binary value. This 1 byte is used for a connection-less data link.
4. Protocol field – This field basically identifies network protocol of the datagram. It usually
identifies the kind of packet in the data field i.e., what exactly is being carried in data field.
This field is of 1 or 2 bytes and helps in identifies the PDU (Protocol Data Unit) that is
being encapsulated by PPP frame.
5. Data field – It usually contains the upper layer datagram. Network layer datagram is
particularly encapsulated in this field for regular PPP data frames. Length of this field is not
constant rather it varies.
6. FCS field – This field usually contains checksum simply for identification of errors. It can
be either 16 bits or 32 bits in size. It is also calculated over address, control, protocol, and
even information fields. Characters are added to frame for control and handling of errors.
A media access control is a network data transfer policy that determines how data is transmitted
between two computer terminals through a network cable. The media access control policy involves
sub-layers of the data link layer 2 in the OSI reference model.
The essence of the MAC protocol is to ensure non-collision and eases the transfer of data packets
between two computer terminals. A collision takes place when two or more terminals transmit
data/information simultaneously. This leads to a breakdown of communication, which can prove
costly for organizations that lean heavily on data transmission.
This network channel through which data is transmitted between terminal nodes to avoid collision
has three various ways of accomplishing this purpose. They include:
Carrier sense multiple access with collision avoidance (CSMA/CA) is a media access control policy
that regulates how data packets are transmitted between two computer nodes. This method avoids
collision by configuring each computer terminal to make a signal before transmission. The signal is
carried out by the transmitting computer to avoid a collision.
Multiple access implies that many computers are attempting to transmit data. Collision avoidance
means that when a computer node transmitting data states its intention, the other waits at a specific
length of time before resending the data.
CSMA/CA is data traffic regulation is slow and adds cost in having each computer node signal its
intention before transmitting data. It used only on Apple networks.
Carrier sense multiple access with collision detection (CSMA/CD) is the opposite of CSMA/CA.
Instead of detecting data to transmit signal intention to prevent a collision, it observes the cable to
detect the signal before transmitting.
Collision detection means that when a collision is detected by the media access control policy,
transmitting by the network stations stops at a random length of time before transmitting starts
again.
It is faster than CSMA/CA as it functions in a network station that involves fewer data frames being
transmitted. CSMA/CD is not as efficient as CSMA/CA in preventing network collisions. This is
because it only detects huge data traffic in the network cable. Huge data traffic increases the
possibility of a collision taking place. It is used on the Ethernet network.
Demand Priority
The demand priority is an improved version of the Carrier sense multiple access with collision
detection (CSMA/CD). This data control policy uses an ‘active hub’ in regulating how a network is
accessed. Demand priority requires that the network terminals obtain authorization from the active
hub before data can be transmitted.
Another distinct feature of this MAC control policy is that data can be transmitted between the two
network terminals at the same time without collision. In the Ethernet media, demand priority directs
that data is transmitted directly to the receiving network terminal.
Token Passing
This media access control method uses free token passing to prevent a collision. Only a computer
that possesses a free token, which is a small data frame, is authorized to transmit. Transmission
occurs from a network terminal that has a higher priority than one with a low priority.
CS3591 COMPUTER NETWORKS
GNANAMANI COLLEGE OF TECHNOLOGY
DEPARTMENT OF AI&DS
Token passing flourishes in an environment where a large number of short data frames are
transmitted. This media access control policy is highly efficient in avoiding a collision. Possession
of the free token is the only key to transmitting data by a network node. Each terminal holds this
free token for a specific amount of time if the network with the high priority does not have data to
transmit, the token is passed to the adjoining station in the network.
Media access control regulates how a network is accessed by computer terminals and transmits
from one terminal to the other without collision. This is achieved through CSMA/CD, CSMA/CA,
demand priority, or Token passing.
Ethernet
Ethernet is the most popular physical layer LAN technology in use today. It defines the number of
conductors that are required for a connection, the performance thresholds that can be expected, and
provides the framework for data transmission. A standard Ethernet network can transmit data at a
rate up to 10 Megabits per second (10 Mbps). Other LAN types include Token Ring, Fast Ethernet,
Gigabit Ethernet, 10 Gigabit Ethernet, Fiber Distributed Data Interface (FDDI), Asynchronous
Transfer Mode (ATM) and LocalTalk.
Ethernet is popular because it strikes a good balance between speed, cost and ease of installation.
These benefits, combined with wide acceptance in the computer marketplace and the ability to
support virtually all popular network protocols, make Ethernet an ideal networking technology for
most computer users today.
The Institute for Electrical and Electronic Engineers developed an Ethernet standard known as
IEEE Standard 802.3. This standard defines rules for configuring an Ethernet network and also
specifies how the elements in an Ethernet network interact with one another. By adhering to the
IEEE standard, network equipment and network protocols can communicate efficiently.
What is Ethernet?
Ethernet is the traditional technology for connecting devices in a wired local area network (LAN) or
wide area network (WAN). It enables devices to communicate with each other via a protocol, which
is a set of rules or common network language.
Ethernet describes how network devices format and transmit data so other devices on the same
LAN or campus network can recognize, receive and process the information. An Ethernet cable is
the physical, encased wiring over which the data travels.
Connected devices that use cables to access a geographically localized network -- instead of a
wireless connection -- likely use Ethernet. From businesses to gamers, diverse end users rely on the
benefits of Ethernet connectivity, which include reliability and security.
Ethernet is used to connect devices in a network and is still a popular form of network connection.
For local networks used by specific organizations -- such as company offices, school campuses and
hospitals -- Ethernet is used for its high speed, security and reliability.
Ethernet initially grew popular due to its inexpensive price tag when compared to the competing
technology of the time, such as IBM's token ring. As network technology advanced, Ethernet ability
to evolve and deliver higher levels of performance, ensured its sustained popularity. Throughout its
evolution, Ethernet also maintained backward compatibility.
CS3591 COMPUTER NETWORKS
GNANAMANI COLLEGE OF TECHNOLOGY
DEPARTMENT OF AI&DS
The IEEE 802.3 working group approved the first Ethernet standard in 1983. Since then, the
technology has continued to evolve and embrace new media, higher transmission speeds and
changes in frame content.
Gigabit Ethernet boasts speeds of 1,000 Mbps -- 1 gigabit or 1 billion bits per second (bps) -- 10
GbE, up to 10 Gbps, and so on. Over time, the typical speed of each connection tends to increase.
Ethernet cables connect network devices to the appropriate routers or modems. Different cables
work with different standards and speeds. For example, Category 5 (Cat5) cables support traditional
and 100BASE-T Ethernet. Category 5e (Cat5e) cables can handle GbE, while Category 6 (Cat6)
works with 10 GbE.
Consider a scenario where there are ‘n’ stations on a link and all are waiting to transfer data through
that channel. In this case, all ‘n’ stations would want to access the link/channel to transfer their own
data. The problem arises when more than one station transmits the data at the moment. In this case,
there will be collisions in the data from different stations.
CS3591 COMPUTER NETWORKS
GNANAMANI COLLEGE OF TECHNOLOGY
DEPARTMENT OF AI&DS
CSMA/CD is one such technique where different stations that follow this protocol agree on some
terms and collision detection measures for effective transmission. This protocol decides which
station will transmit when so that data reaches the destination without corruption.
Carrier sense: Before transmitting data, a device listens to the network to check if the transmission
medium is free. If the medium is busy, the device waits until it becomes free before transmitting
data.
Multiple Access: In a CSMA/CD network, multiple devices share the same transmission medium.
Each device has equal access to the medium, and any device can transmit data when the medium is
free.
Collision detection: If two or more devices transmit data simultaneously, a collision occurs. When a
device detects a collision, it immediately stops transmitting and sends a jam signal to inform all
other devices on the network of the collision. The devices then wait for a random time before
attempting to transmit again, to reduce the chances of another collision.
Backoff algorithm: In CSMA/CD, a backoff algorithm is used to determine when a device can
retransmit data after a collision. The algorithm uses a random delay before a device retransmits
data, to reduce the likelihood of another collision occurring.
Minimum frame size: CSMA/CD requires a minimum frame size to ensure that all devices have
enough time to detect a collision before the transmission ends. If a frame is too short, a device may
not detect a collision and continue transmitting, leading to data corruption on the network.
Advantages of CSMA/CD:
Simple and widely used: CSMA/CD is a widely used protocol for Ethernet networks, and its
simplicity makes it easy to implement and use.
Fairness: In a CSMA/CD network, all devices have equal access to the transmission medium, which
CS3591 COMPUTER NETWORKS
GNANAMANI COLLEGE OF TECHNOLOGY
DEPARTMENT OF AI&DS
ensures fairness in data transmission.
Efficiency: CSMA/CD allows for efficient use of the transmission medium by preventing
unnecessary collisions and reducing network congestion.
Read through this article to find out more about LAN and VLAN and how they are different from
each other.
What is LAN?
A local area network (LAN) is a network limited to a particular geographic area. A switch, or stack
of switches, connects a group of computers and devices using the TCP/IP protocol's private
addressing mechanism.
Private addresses are distinct from those of other machines on a local network. Routers are used to
connect the LAN's edge to the wider WAN.
Data is transmitted at a high-speed rate because the number of computers linked is limited. The
connections must, by definition, be high-speed, and hardware must be reasonably inexpensive (such
as hubs, network adapters, and Ethernet cables).
LANs are privately owned and span a smaller geographical area (restricted to a few kilometers). It
can be used in various places, including offices, homes, hospitals, and schools. The setup and
management of a LAN are straightforward.
Twisted pair and coaxial cables are utilized as a LAN communication medium. Because it only
traverses a limited distance, the inaccuracy and noise are kept to a minimum.
Data speeds on early LANs ranged from 4 to 16 Mbps, however the data speeds have improved
significantly since then and now they are in the range of 100 to 1000 megabits per second.
In a LAN, the propagation delay is relatively short. Larger LANs can accommodate thousands of
computers, whereas smaller LANs may only employ two computers.
A LAN usually has wired connections; however, wireless connectivity can also be used. A LAN's
fault tolerance is higher, and the network is less congested.
CS3591 COMPUTER NETWORKS
GNANAMANI COLLEGE OF TECHNOLOGY
DEPARTMENT OF AI&DS
What is VLAN?
The data link layer of the OSI network model is used to create a Virtual Local Area Network
(VLAN). VLANs are created with isolated partitions in workstations. An individual node address
moves with the virtual division, not the physical workstation, unlike a physical local area network
or LAN. A hardware setup accommodates point-to-point identification and access through a
physical network.
VLANs can be implemented on higher-end switches. The goal of setting up a VLAN is to improve
a network's performance or to add necessary security features.
Computer networks are divided into two types: Local Area Networks (LANs) and Wide Area
Networks (WANs). LANs are devices connected in the same network at a specific location such as
switches, hubs, bridges, workstations, and servers. A local area network (LAN) is also a broadcast
domain.
A VLAN enables several networks to function as if they were all part of the same LAN. One of the
most advantageous features of a VLAN is that it reduces network latency, saving network
resources, and increasing network efficiency.
VLANs are also used to provide segmentation and help with security, network management, and
scalability. VLANs can also be used to regulate traffic flows efficiently.
The following table highlights the major differences between a LAN and a VLAN.
CS3591 COMPUTER NETWORKS
GNANAMANI COLLEGE OF TECHNOLOGY
DEPARTMENT OF AI&DS
Physical Layer: Data and Signals
One of the major role of Physical layer is to transfer the data in form of signals through a
transmission medium. It doesn’t matter what data you are sending, it can be text, audio, image,
video etc. everything is transferred in form of signals. This happens because a data cannot be send
as it is over a transmission medium, it must be converted to a form that is acceptable by the
transmission media, signals are what a transmission medium carry. In this guide, we will discuss
data and signals.
Both the data and the signal can be represented in form of analog and digital.
A simple analog signal can be represented in form of sine wave. A sine wave is shown in the above
diagram.
A simple analog signal is smooth, consistent and continuous. As you can see in the diagram above
that a arc above the time axis is followed by the similar arc below the time axis and so on.
There are three parameters that defines a sine wave – peak amplitude, frequency and phase.
Frequency and Period: Period is the amount of time a signal takes to complete one cycle, it is
denoted by T. Frequency refers to the number of cycles in 1 second, it is denoted by f. They are
inversely proportional to each other which means f = 1/T.
Phase: Phase refers to the position of sine wave relative to the time 0. For example if the sine wave
is at its highest intensity at the time zero then the phase value for this sine wave is 90 degrees.
Phase is measured in degrees or radians.
Unlike sine wave which is smooth and consistent, composite analog signals or waves are not
smooth and consistent, which means an arc above the time axis doesn’t necessarily followed by arc
below the time axis. You can imagine them as a group of sine waves with different frequency,
amplitude and period.
Bandwidth: The range of frequencies in a composite signal is called bandwidth. For example if a
composite signal contains waves with the frequencies ranging from 2000 to 4000 then you can say
that the bandwidth of this composite signal is 4000-2000 = 2000Hz. Bandwidth is measured in Hz.
2. Digital Signals
Similar to analog signals, data can be transmitted in form of digital signals. For example a data that
is converted it into a machine language (combination of 0s and 1s) such as 1001 can be represented
in form digital signals. 1 represents high voltage and 0 represents low voltage.
Bit Rate: A bit rate is measured as bits per second, it represents the number of 1s send in 1 second.
CS3591 COMPUTER NETWORKS
GNANAMANI COLLEGE OF TECHNOLOGY
DEPARTMENT OF AI&DS
Bit Length: A bit length is the distance a bit occupies on the transmission medium.
Transmission Media
What is the transmission media?
A transmission medium is a system or substance that can mediate the propagation of signals
for the purposes of telecommunication. Signals are typically imposed on a wave of some kind
suitable for the chosen medium.
High Speed
Secure
Used for comparatively shorter distances
The cable can be unidirectional or bidirectional. The WDM (Wavelength Division Multiplexer)
supports two modes, namely unidirectional and bidirectional mode.
Stripline
(v) Microstripline
In this, the conducting material is separated from the ground plane by a layer of dielectric.
2. Unguided Media:
It is also referred to as Wireless or Unbounded transmission media. No physical medium is required
for the transmission of electromagnetic signals.
Features:
(ii) Microwaves –
It is a line of sight transmission i.e. the sending and receiving antennas need to be properly aligned
with each other. The distance covered by the signal is directly proportional to the height of the
antenna. Frequency Range:1GHz – 300GHz. These are majorly used for mobile phone
communication and television distribution.
(iii) Infrared –
Infrared waves are used for very short distance communication. They cannot penetrate through
obstacles. This prevents interference between systems. Frequency Range:300GHz – 400THz. It is
used in TV remotes, wireless mouse, keyboard, printer, etc.
CS3591 COMPUTER NETWORKS
GNANAMANI COLLEGE OF TECHNOLOGY
DEPARTMENT OF AI&DS
Telephone system network is one of the example of Circuit switching. TDM (Time Division
Multiplexing) and FDM (Frequency Division Multiplexing) are two methods of multiplexing
multiple signals into a single carrier.