Physical and Data Link Layer Overview
Physical and Data Link Layer Overview
Transmission Media?
A transmission medium is a physical path between the transmitter and the receiver
i.e. it is the
Guided Media
Signals being transmitted are directed and confined in a narrow pathway by using
physical links.
Features:
High Speed
Secure
Least expensive
Easy to install
High-speed capacity
Shielded Twisted Pair (STP): This type of cable consists of a special jacket (a
copper braid covering or a foil shield) to block external interference. It is used in
fast-data-rate Ethernet and in voice and data channels of telephone lines.
Eliminates crosstalk
Comparatively faster
More expensive
Bulky
Coaxial Cable
Coaxial cables have better cut-through resistance so they are more reliable
and durable.
Optical Fibre Cable uses the concept of refraction of light through a core made up
of glass or plastic. The core is surrounded by a less dense glass or plastic covering
called the cladding. It is used for the transmission of large volumes of data. The
cable can be unidirectional or bidirectional. The WDM (Wavelength
DivisionMultiplexer) supports two modes, namely unidirectional and bidirectional
mode.
Lightweight
High cost
Fragile
Stripline
Microstripline
In this, the conducting material is separated from the ground plane by a layer of
dielectric.
2 Unguided Media
.
Unguided Media
Unguided media is a type of Transmission Media. A transmission medium is a
physical path between the transmitter and the receiver. Unguided media
transport electromagnetic waves without using a physical conductor. It is also
known as unbounded or wireless media, and does not rely on physical pathways to
transmit signals. Instead, they use wireless communication methods to propagate
signals through the air or free space.
Types of Unguided Media
Wireless transmission
1. Radio Waves
Radio waves are electromagnetic signals used for various wireless
communication technologies, such as Wi-Fi, Bluetooth and radio broadcasting.
Electromagnetic waves ranging in frequencies between 3 kHz and 1 GHz are
normally called radio waves.
2. Microwaves
Electromagnetic waves having frequencies between 1 and 300 GHz are called
microwaves. Microwaves are unidirectional. The sending and receiving antennas
need to be aligned. The unidirectional property has an obvious advantage. A pair of
antennas can be aligned without interfering with another pair of aligned antennas.
Let’s talk about the Unidirectional Antenna now.
Unidirectional Antenna
Microwaves need unidirectional antennas that send out signals in one direction.
Types of Microwaves
There are two types of microwaves:
1. Terrestrial Microwave
Terrestrial Microwave are microwaves that transmits the beam of a radio signal
from one ground based antenna to another ground based antenna.
Wide Coverage
Long Distance Communication
Reliable
Broadcast Capabilities.
Flexibility.
High Cost.
Signal Delay
Weather Sensitivity
3. Infrared
Infrared waves, with frequencies from 300 GHz to 400 THz (wavelengths from 1
mm to 770 nm), can be used for short-range communication. Infrared waves,
having high frequencies, cannot penetrate walls. This advantageous characteristic
prevents interference between one system and another; a short range
communication system in one room cannot be affected by another system in the
next room. When we use our infrared remote control, we do not interfere with the
use of the remote by our neighbours. It is used in TV remotes, wireless mouse,
keyboard, printer, etc.
At low frequency,
At low frequency,
they can penetrate They cannot
they can penetrate
through solid objects penetrate
through solid objects
Penetration and walls but high through any
and walls. at high
frequency they solid object and
frequency, they
bounce off the walls.
cannot penetrate.
obstacle.
Frequency
Frequency Frequency range: 3 Frequency range: 1
range: 300 GHz
range KHz to 1GHz. GHz to 300 GHz.
to 400 GHz.
Attenuation is Attenuation is
Attenuation Attenuation is high.
variable. low.
Usage Cost Setup and usage Cost Setup and usage Cost Usage Cost is
Basis Radio wave Microwave Infrared wave
Module 2.2
OSI model
The application layer is used by end-user applications such as web browsers and
email clients. It provides protocols that allow applications to send and receive
information and present meaningful data to users. A few examples of application
layer protocols are the Hypertext Transfer Protocol (HTTP), File Transfer Protocol
(FTP), Post Office Protocol (POP), Simple Mail Transfer Protocol (SMTP), and
Domain Name System (DNS).
6. Presentation layer
It receives data from the application layer in the form of character and number
Translation : It translate the data into machine readable format to transmit over the
network.
Encryption/ Decryption: Data encryption translates the data into another form or
code. The encrypted data is known as the cipher text and the decrypted data is
known as plain text. A key value is used for encrypting as well as decrypting data.
5. Session layer
The session layer permits two parties to hold ongoing communications called a
session across a network. The applications on either end of the session can
exchange data or send packets to another for as long as the session lasts. The
session layer handles session setup, data or message exchanges, and terminates
session. It also monitors session identification so only permitted user/device can
participate and security services to control access to session information. A session
can be used to allow a user to log into a remote time-sharing system or transfer a
file between two machines.
Another session layer service is synchronization. Consider the problems that occur
when transferring a file between two machines and the system crashed and not
being able to complete the transfer.
[Link] layer
The transport layer receives data from the session layer and breaks it into smaller
unit called “segments” and pass it to the network layer. It is responsible for
reassembling the segments on the receiving end, turning it back into data that can
be used by the session layer. The transport layer carries out flow control, sending
data at a rate that matches the connection speed of the receiving device, and error
control, checking if data was received incorrectly and if not, requesting it again.
In order to deliver the message to correct process, transport layer header includes a
type of address called service point address or port address. Thus by specifying this
address, transport layer makes sure that the message is delivered to the correct
process.
Connection less service: In this type of transmission, the receiver does not
acknowledge receipt of a packet. This approach allows for much faster
communication between devices. Connection-oriented service is more reliable than
connectionless Service. UDP is connection less service.
3. Network layer
Network layer transmits data in from one device/host to another device/host which
located at different network. Data unit in this layer is called packet.
Determine best path for data transmission from source to destination, and transmits
the data through the path known as routing.
In this layer data is transmitted node to node (usually in directed connected device
such as switch to pc or pc to pc which is connected through physically). Packets are
divided in this layer known as frame.
DLL has two layers . Logical Link Control(LLC) and Media Access
Control(MAC) also known as physical address of device. MAC is globally unique.
MAC is 48 bits (6 bytes) , first half of the address uniquely identifies the vendor
known as OUI(Organization Unique Identifier), last half identifies for the device id.
Functions of Data Link Layer :
Framing : It provides a way for a sender to transmit a set of bits that are
meaningful to the receiver.
Flow Control : Data must be constant in both side otherwise it may be get
corrupted. flow control coordinates the amount of data that can be sent before
receiving acknowledgement
Access Control : determine which device has control over the channel at a given
time, when a single communication channel is shared by multiple devices.
1. Physical Layer
Physical layer is the bottom layer of the OSI model. This layer is concerned with
transmitting raw data bits across the network. For transmitting data it converts the
digital bits into electrical, radio or optical signal. It can include specifications such
as voltages, pin layout, cabling, and radio frequencies
TCP/IP Model
Working
Whenever we want to send something over the internet using the TCP/IP Model,
the TCP/IP Model divides the data into packets at the sender’s end and the same
packets have to be recombined at the receiver’s end to form the same data, and this
thing happens to maintain the accuracy of the data. TCP/IP model divides the data
into a 4-layer procedure, where the data first go into this layer in one order and
again in reverse order to get organised in the same way at the receiver’s end.
The packet’s network protocol type, in this case, TCP/IP, is identified by network
access layer. Error prevention and “framing” are also provided by this layer.
Internet Layer
This layer parallels the functions of OSI’s Network layer. It defines the protocols
which are responsible for the logical transmission of data over the entire network.
The main protocols residing at this layer are as follows:
IP: IP stands for Internet Protocol and it is responsible for delivering packets
from the source host to the destination host by looking at the IP addresses
in the packet headers. IP has 2 versions: IPv4 and IPv6. IPv4 is the one
that most websites are using currently. But IPv6 is growing as the number
of IPv4 addresses is limited in number when compared to the number of
users.
Transport Layer
The TCP/IP transport layer protocols exchange data receipt acknowledgments and
retransmit missing packets to ensure that packets arrive in order and without error.
End-to-end communication is referred to as such. Transmission Control Protocol
(TCP) and User Datagram Protocol are transport layer protocols at this level
(UDP).
Scalability: TCP/IP is highly scalable, making it suitable for both small and
large networks, from local area networks (LANs) to wide area networks
(WANs) like the internet.
Flexibility: The model supports various routing protocols, data types, and
communication methods, making it adaptable to different networking
needs.
Inefficiency for Small Networks: For very small networks, the overhead
and complexity of the TCP/IP model may be unnecessary and inefficient
compared to simpler networking protocols.
Limited by Address Space: Although IPv6 addresses this issue, the older
IPv4 system has a limited address space, which can lead to issues with
address exhaustion in larger networks.
4. Application Layer
This layer is analogous to the transport layer of the OSI model. It is responsible for
end-to-end communication and error-free delivery of data. It shields the upper-
layer applications from the complexities of data. The three main protocols present
in this layer are:
HTTP and HTTPS: HTTP stands for Hypertext transfer protocol. It is used
by the World Wide Web to manage communications between web
browsers and server
Difference Between OSI Model and TCP/IP Model
These models work as frameworks for organising and understanding how data
moves from one device to another across networks. While both models aim to
achieve similar goals, they differ in their approach, layer organisation, and
practical application within computer networking. We will discuss these two
models in this article and also see the differences between these two articles.
OSI Model stands for Open Systems Interconnection. It has 7 layer and Each layer
performs its task independently. It was developed in 1984 by the International
Organisation for Standardisation (ISO).
The data flow in the OSI (Open Systems Interconnection) model describes how
data is transmitted from one device to another through the seven layers of the OSI
model. This process involves encapsulation and decapsulation at each layer to
ensure proper data transmission and reception.
The data flow in the OSI model involves encapsulating data at each layer on the
sender side, transmitting it over the network, and decapsulating it at each layer on
the receiver side to ensure the data reaches its intended destination correctly and
reliably.
OSI Model
Advantages
It is quite flexible.
Disadvantages
Setting up a model is a challenging task.
TCP/IP Model
It is lightweight.
Disadvantages
Another similarity between the two models is that they both use the concept of , in
which data is packaged into a series of headers and trailers that contain information
about the data being transmitted and how it should be handled by the network.
The OSI (Open Systems Interconnection) Model and the TCP/IP (Transmission
Control Protocol/Internet Protocol) Model are two frameworks used to understand
how data moves through networks. While they both help in organising network
communication, they have distinct structures and purposes. Understanding these
differences is essential for anyone learning about or working with computer
networks.
OSI vs TCP/IP
It is horizontally
Approach It is vertically approached
approached
Error Built into Data Link and Transport Built into protocols like
Handling layers TCP
Data Link Control is the service provided by the Data Link Layer to provide
reliable data transfer over the physical medium. For example, In the half-duplex
transmission mode, one device can only transmit the data at a time. If both the
devices at the end of the links transmit the data simultaneously, they will collide
and leads to the loss of the information. The Data link layer provides the
coordination among the devices so that no collision occurs.
o Line discipline
o Flow Control
o Error Control
Line Discipline
o Line Discipline is a functionality of the Data link layer that provides the
coordination among the link systems. It determines which device can send,
and when it can send the data.
o ENQ/ACK
o Poll/select
o END/ACK stands for Enquiry/Acknowledgement is used when there is no
wrong receiver available on the link and having a dedicated path between
the two devices so that the device capable of receiving the transmission is
the intended one.
o END/ACK coordinates which device will start the transmission and whether
the recipient is ready or not.
o Working of END/ACK
o The transmitter transmits the frame called an Enquiry (ENQ) asking whether
the receiver is available to receive the data or not.
o The receiver responses either with the positive acknowledgement(ACK) or
with the negative acknowledgement(NACK) where positive
acknowledgement means that the receiver is ready to receive the
transmission and negative acknowledgement means that the receiver is
unable to accept the transmission.
o Following are the responses of the receiver:
o If the response to the ENQ is positive, the sender will transmit its data, and
once all of its data has been transmitted, the device finishes its transmission
with an EOT (END-of-Transmission) frame.
o If the response to the ENQ is negative, then the sender disconnects and
restarts the transmission at another time.
o If the response is neither negative nor positive, the sender assumes that the
ENQ frame was lost during the transmission and makes three attempts to
establish a link before giving up.
Poll/Select
The Poll/Select method of line discipline works with those topologies where one
device is designated as a primary station, and other devices are secondary stations.
Working of Poll/Select
o In this, the primary device and multiple secondary devices consist of a single
transmission line, and all the exchanges are made through the primary
device even though the destination is a secondary device.
o The primary device has control over the communication link, and the
secondary device follows the instructions of the primary device.
o The primary device determines which device is allowed to use the
communication channel. Therefore, we can say that it is an initiator of the
session.
o If the primary device wants to receive the data from the secondary device, it
asks the secondary device that they anything to send, this process is known
as polling.
o If the primary device wants to send some data to the secondary device, then
it tells the target secondary to get ready to receive the data, this process is
known as selecting.
Select
o The select mode is used when the primary device has something to send.
o When the primary device wants to send some data, then it alerts the
secondary device for the upcoming transmission by transmitting a Select
(SEL) frame, one field of the frame includes the address of the intended
secondary device.
o When the secondary device receives the SEL frame, it sends an
acknowledgement that indicates the secondary ready status.
o If the secondary device is ready to accept the data, then the primary device
sends two or more data frames to the intended secondary device. Once the
data has been transmitted, the secondary sends an acknowledgement
specifies that the data has been received.
Poll
o The Poll mode is used when the primary device wants to receive some data
from the secondary device.
o When a primary device wants to receive the data, then it asks each device
whether it has anything to send.
o Firstly, the primary asks (poll) the first secondary device, if it responds with
the NACK (Negative Acknowledgement) means that it has nothing to send.
Now, it approaches the second secondary device, it responds with the ACK
means that it has the data to send. The secondary device can send more than
one frame one after another or sometimes it may be required to send ACK
before sending each one, depending on the type of the protocol being used.
Flow Control
o It is a set of procedures that tells the sender how much data it can transmit
before the data overwhelms the receiver.
o The receiving device has limited speed and limited memory to store the data.
Therefore, the receiving device must be able to inform the sending device to
stop the transmission temporarily before the limits are reached.
o It requires a buffer, a block of memory for storing the information until they
are processed.
o Stop-and-wait
o Sliding window
Stop-and-wait
Advantage of Stop-and-wait
Disadvantage of Stop-and-wait
Stop-and-wait technique is inefficient to use as each frame must travel across all
the way to the receiver, and an acknowledgement travels all the way before the
next frame is sent. Each frame sent and received uses the entire time needed to
traverse the link.
Sliding Window
Sender Window
Error Control
2. Lost Acknowledgement
Assume the sender sends the data,.The receiver sends an acknowledgment after
receiving the packet. In this situation, the acknowledgment is lost in the network.
next packet cannot be transmitted until the preceding packet’s acknowledgment
is received.
3. Delayed Acknowledgement/Data
Assume the sender sends the data The receiver then transmits the
acknowledgment, which is received after the sender’s timeout period.
Stop and Wait for ARQ (Automatic Repeat Request)
The above 3 problems are resolved by Stop and Wait for ARQ (Automatic
Repeat Request) that does both error control and flow control.
1. Time Out
Timeout refers to the duration for which the sender waits for an acknowledgment
(ACK)
2. Sequence Number (Data)
In Stop-and-Wait ARQ, the sender assigns sequence numbers to each data frame
it sends. ensuring reliable delivery of data packets..
3. Sequence Number(Acknowledgement)
Similarly, sequence numbers are also used in acknowledgments (ACKs) sent by
the receiver to acknowledge received data frames. When the receiver
successfully receives a data frame, it sends an ACK back to the sender,
indicating the sequence number of the next expected frame.
Working of Stop and Wait for ARQ
Sender A sends a data frame or packet with sequence number 0.
Receiver B, after receiving the data frame, sends an acknowledgement
with sequence number 1 (the sequence number of the next expected data
frame or packet)
There is only a one-bit sequence number that implies that both sender and
receiver have a buffer for one frame or packet only.
Framing is a function of the data link layer. It provides a way for a sender
to transmit a set of bits that are meaningful to the receiver.
Problems in Framing
Detecting start of the frame: When a frame is transmitted, every station
must be able to detect itby using a special sequence of bits that marks the
beginning of the frame i.e. SFD
How does the station detect a frame: Every station listens to link for SFD
pattern through a sequential circuit. Station checks destination address to
accept or reject frame.
Detecting end of frame: When to stop reading the frame.
Handling errors: In this error detection and correction mechanisms, such
as cyclic redundancy check (CRC), are used to ensure the transmission of the
frame.
Framing overhead: Every frame has a header and a trailer that contains
control information such as source and destination address, error detection
code, and other protocol-related information. This overhead reduces the
available bandwidth for data transmission, especially for small-sized frames.
Framing incompatibility: Different networking devices and protocols may
use different framing methods,
Framing synchronization: Stations must be synchronized with each other
to avoid collisions and ensure reliable communication.
Framing efficiency: Framing should be designed to minimize the amount
of data overhead while maximizing the available bandwidth for data
transmission
Types of framing
There are two types of framing:
Error is a condition when the receiver’s information does not match the sender’s.
Types of Errors
Single-Bit Error
A single-bit error refers to a type of data transmission error that occurs when one
bit (i.e., a single binary digit) of a transmitted data unit is altered during
transmission, resulting in an incorrect or corrupted data unit.
Single-Bit Error
Multiple-Bit Error
A multiple-bit error is an error type that arises when more than one bit in a data
transmission is affected. Although multiple-bit errors are relatively rare when
compared to single-bit errors
Multiple-Bit Error
Burst Error
When several consecutive bits are flipped mistakenly in digital transmission, it
creates a burst error. This error causes a sequence of consecutive incorrect
values.
Burst Error
Error Detection Methods
To detect errors, a common technique is to introduce redundancy bits that
provide additional information. Various techniques for error detection include:
Simple Parity Check
Two-Dimensional Parity Check
Checksum
Cyclic Redundancy Check (CRC)
Simple Parity Check
Simple-bit parity is a simple error detection method that involves adding an extra
bit to a data transmission. It works as:
1 is added to the block if it contains an odd number of 1’s, and
0 is added if it contains an even number of 1’s
This scheme makes the total number of 1’s even, that is why it is called even
parity checking.
Two-dimensional Parity check bits are calculated for each row, which is
equivalent to a simple parity check bit. Parity check bits are also calculated for
all columns, then both are sent along with the data. At the receiving end, these
are compared with the parity bits calculated on the received data.
Advantages of Two-Dimensional Parity Check
Two-Dimensional Parity Check can detect and correct all single bit error.
Two-Dimensional Parity Check can detect two or three bit error that
occurs anywhere in the matrix.
.
Checksum
CRC Working
We have given dataword of length n and divisor of length k.
Step 1: Append (k-1) zero’s to the original message
Step 2: Perform modulo 2 division
Step 3: Remainder of division = CRC
Step 4: Code word = Data with append k-1 zero’s + CRC
Note:
CRC must be k-1 bits
Example: Let’s data to be send is 1010000 and divisor in the form of polynomial
is x3+1. CRC method discussed below.
Length of Code word = n+k-1 bits
The medium access control (MAC) is a sublayer of the data link layer of the open
system interconnections (OSI) reference model for data transmission.
• It provides an abstraction of the physical layer to the LLC and upper layers
of the OSI network.
• It performs multiple access resolutions when more than one data frame is to
be transmitted. It determines the channel access methods for transmission.
MAC Addresses
MAC address or media access control address is a unique identifier allotted to a
network interface controller (NIC) of a device. It is used as a network address for
data transmission within a network segment like Ethernet, Wi-Fi, and Bluetooth.
Logical Link Control (LLC) provides conventional data link protocol functions,
such as error control and flow control
LLC provides the following three services for a local network application:
ALOHA
• When two or more systems seek to transmit on the same channel at the same
time, a shared communication system such as ALOHA needs a way to
handle collisions.
• ALOHA is basically a multiple access protocol which describes how all the
terminals can access a medium without interfering at all with one another or
even colliding.
• The Slotted ALOHA protocol divides the time interval into discrete slots,
each of which is equal to one frame’s worth of time.
Versions of ALOHA
Pure ALOHA
Slotted ALOHA increases the capacity of pure ALOHA while reducing collisions.
Slots are discrete time periods that are used to divide up the shared channel. Only
at the start of each time slot is the station able to transmit data. If multiple stations
attempt to transmit at the start of the same time slot, there may still be collisions
• There is no time restriction for sending the data (you can talk to your friend
without a time restriction).
ALOHA
CSMA
CSMA/CD
CSMA/CA
The ALOHA protocol or also known as the ALOHA method is a random access
protocol in which every transmitting station or source in a network will send the
data whenever a frame is available for transmission. If we succeed and the frame
reaches its destination, the next frame is lined-up for transmission. But remember,
if the data frame is not received by the receiver (maybe due to collision) then the
frame is sent again until it successfully reaches the receiver's end.
1-persistent mode: In this, first the node checks the channel, if the channel is idle
then the node or station transmits data, otherwise it keeps on waiting and whenever
the channel is idle, the stations transmit the data frame.
Non-persistent mode: In this, the station checks the channel similarly as the 1-
persistent mode, but the only difference is that when the channel is busy it checks
it again after a random amount of time, unlike the 1-persistent where the stations
keep on checking continuously.
P-persistent mode: In this, the station checks the channel and if found idle then it
transmits the data frame with the probability of P and if the data is not transmitted
(1-P) then the station waits for a random amount of time and again transmits the
data with the probability P and this cycle goes on continuously until the data-frame
is successfully sent.
It is comparatively much greater than the throughput of pure and slotted ALOHA.
Here, for the 1-persistent mode, the throughput is 50% when G=1; for the Non-
persistent mode, the throughput can reach 90%.
In this, whenever the station transmits data-frame it then monitors the channel or
the medium to acknowledge the state of the transmission i.e. successfully
transmitted or failed. If the transmission succeeds, then it prepares for the next
frame otherwise it resends the previously failed data frame. The point to remember
here is, that the frame transmission time should be at least twice the maximum
propagation time, which can be deduced when the distance between the two
stations involved in a collision is maximum.
To detect the possible collisions, the sender receives the acknowledgment and if
there is only one acknowledgment present (its own) then this means that the data
frame has been sent successfully. But, if there are 2 or more acknowledgment
signals then this indicates that the collision has occurred.
Interframe space: in this case, assume that your station waits for the channel to
become idle and found that the channel is idle, then it will not send the data frame
immediately (in order to avoid collision due to propagation delay) it rather waits
for some time called interframe space or IFS, and after this time the station again
checks the medium for being idle. But it should be kept in mind that the IFS
duration depends on the priority of the station.
Contention Window: here, the time is divided into slots. Say, if the sender is ready
for transmission of the data, it then chooses a random number of slots as waiting
time which doubles every time whenever the channel is busy. But, if the channel is
not idle at that moment, then it does not restart the entire process but restarts the
timer when the channel is found idle again.
The Carrier Sense Multiple Access/ Collision Detection protocol is used to detect a
collision in the media access control (MAC) layer. Once the collision was detected,
the CSMA CD immediately stopped the transmission by sending the signal so that
the sender does not waste all the time to send the data packet. Suppose a collision
is detected from each station while broadcasting the packets. In that case, the
CSMA CD immediately sends a jam signal to stop transmission and waits for a
random time context before transmitting another data packet. If the channel is
found free, it immediately sends the data and returns it.
1. It is used for collision detection on a shared channel within a very short time.
2. CSMA CD is better than CSMA for collision detection.
3. CSMA CD is used to avoid any form of waste transmission.
4. When necessary, it is used to use or share the same amount of bandwidth at
each station.
5. It has lower CSMA CD overhead as compared to the CSMA CA.
Disadvantage of CSMA/CD
CSMA stands for Carrier Sense Multiple Access with Collision Avoidance.
It means that it is a network protocol that uses to avoid a collision rather than
allowing it to occur, and it does not deal with the recovery of packets after a
collision. It is similar to the CSMA CD protocol that operates in the media
access control layer. In CSMA CA, whenever a station sends a data frame to
a channel, it checks whether it is in use. If the shared channel is busy, the
station waits until the channel enters idle mode. Hence, we can say that it
reduces the chances of collisions and makes better use of the medium to
send data packets more efficiently.
1. When the size of data packets is large, the chances of collision in CSMA CA
is less.
2. It controls the data packets and sends the data when the receiver wants to
send them.
3. It is used to prevent collision rather than collision detection on the shared
channel.
4. CSMA CA avoids wasted transmission of data over the channel.
5. .It is best suited for wireless transmission protocol
6. It avoids unnecessary data traffic on the network with the help of the RTS/
CTS extension.
S. CSMA CD CSMA CA
NO