0% found this document useful (0 votes)
3 views

Unit 5 Physical and Data Link Layer 16052023

Uploaded by

subashri8711
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Unit 5 Physical and Data Link Layer 16052023

Uploaded by

subashri8711
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 86

Unit 5

Physical and Data Link Layer


Physical Layer
• The physical layer is the lowest layer of the OSI (Open
Systems Interconnection) model and the TCP/IP
(Transmission Control Protocol/Internet Protocol) model.

• It is responsible for transmitting raw data bits over a


physical medium such as copper wire, fiber optic cable, or
wireless channels.

• The physical layer deals with the physical characteristics of


the communication medium, such as voltage levels, signal
timing, and physical connectors.
Physical Layer
• The physical layer defines the physical
characteristics of the transmission medium,
including the type of cable or wireless technology
used, the maximum data rate, the maximum
transmission distance, and the signaling method
used to transmit bits over the medium.

• The physical layer also defines how the bits are


transmitted, such as in serial or parallel form.
Physical Layer
• The physical layer provides several services to the higher layers of the
OSI model,

– Including bit synchronization, error detection, and media access control.

• Bit synchronization ensures that the receiving device can correctly


identify the beginning and end of each bit in the transmitted signal.

• Error detection allows the receiving device to detect errors in the


transmitted signal and request retransmission if necessary.

• Media access control provides a mechanism for sharing the physical


communication medium among multiple devices.
Data and Signals in physical layer
• In the physical layer, data refers to the raw,
unstructured stream of bits that need to be
transmitted over a communication medium.

• These bits could represent anything from a text


message to a video file.

• The physical layer takes these raw bits and encodes


them in a way that can be transmitted over the
chosen communication medium.
Physical Layer
• A signal, on the other hand, is a specific pattern
of electrical or electromagnetic energy that
represents the encoded data being transmitted
over the communication medium.

• The physical layer takes the raw data and


converts it into a signal that can be transmitted
over the medium, which can be in the form of
electrical, optical or electromagnetic waves.
Analog and Digital Data
in physical layer
• Analog and digital data are both
types of data that can be
transmitted over the physical layer.

• Analog data is a continuous


representation of information that
varies over time.

• Examples of analog data include


audio signals, such as music or
voice, and video signals.

• Analog data can be represented by


an analog signal that varies
continuously in amplitude,
frequency, or phase.
Analog and Digital Data
in physical layer

• Digital data, on the other hand, is a discrete representation of information


that is represented as a sequence of 0s and 1s.

• Examples of digital data include text, images, and computer programs.

• Digital data can be represented by a digital signal that consists of a series


of pulses or transitions between two states, representing the 0s and 1s.
• In order to transmit analog or digital data over a
communication medium, it needs to be converted into a
signal that can be transmitted.

• Analog data can be converted into an analog signal using


techniques such as modulation, which involves varying the
amplitude, frequency, or phase of a carrier signal to represent
the analog data.

• Digital data can be converted into a digital signal using


techniques such as pulse-code modulation (PCM), which
involves sampling the digital data at regular intervals and
quantizing each sample into a discrete value.
• The choice between transmitting analog or digital
data depends on the nature of the data being
transmitted and the characteristics of the
communication medium.

• Analog data is well-suited for continuous data such as


audio and video, while digital data is more suited for
discrete data such as text and computer programs.

• In general, digital data is preferred over analog data


for transmission over long distances and in noisy
environments, as it is more robust and can be
corrected and regenerated more easily.
• Both Analog and Digital signal can take one of two
forms.

– A periodic signal in the physical layer is a signal that


repeats itself after a fixed period of time. This means
that the waveform of the signal is identical over each
cycle of the repetition.

– A non-periodic signal in the physical layer, on the other


hand, is a signal that does not repeat itself over time or
has an irregular pattern.
• Sine waves are one of the most common examples
of periodic analog signals.

• A sine wave is a smooth, continuous waveform that


oscillates between a positive maximum value and a
negative maximum value over time.

• The period of a sine wave is the time it takes for one


complete cycle of the waveform to occur, and it is
measured in seconds.
• Peak amplitude refers to the maximum value
of the amplitude of a waveform or signal.
• Frequency refers to the number of cycles or
oscillations that occur per unit of time.
• Phase is a parameter of a signal or waveform
that describes the relationship between two
or more waves with the same frequency.
• Wavelength is a physical characteristic of a periodic wave, and it
represents the distance between two adjacent.

• In other words, it is the distance that a wave travels in one complete


cycle.

• The symbol used to represent wavelength is the Greek letter lambda


(λ).

• The relationship between wavelength, frequency, and wave velocity is


given by the following formula:

• wavelength (λ) = wave velocity (v) / frequency (f)


• Composite signal – A single frequency sine wave is
not useful in data communication, we need to
send a composite signal.Composite signal is made
of many simple sine waves.

• Bandwidth – The bandwidth is nomally a


difference between two frequencies in composite
– If CS contains frequencies between 1000 and 5000,
then its bandwidth is 5000-1000 = 4000.
Non Periodic Digital Signal
• Most Digital Signals are Non-Periodic
• Positive Voltage represented by 1 and Negative voltage
represented by 0 as shown in previous figure.
• Bit Rate - Refers to the rate at which digital data is
transmitted over a communication channel.
– It is a measure of the amount of information that can be
transmitted per unit of time and is typically expressed in bits
per second (bps).
• Bit length refers to the number of bits used to represent
a single symbol or unit of information in a digital signal.
• Transmission impairment
– Transmission impairment refers to any type of
distortion or degradation that occurs during the
transmission of a signal over a communication
channel.
– These impairments can result in errors in the
received signal, which can affect the accuracy and
reliability of the transmitted data.
• Some common types of transmission impairments include:

– Attenuation: Attenuation refers to the loss of signal strength that occurs as a


signal travels over a distance. This can result in a weaker and noisier signal at
the receiver, which can make it more difficult to accurately decode the
transmitted data.

– Noise: Noise refers to any unwanted signals or interference that is introduced


into the communication channel, which can distort or interfere with the
transmitted signal. Sources of noise can include electromagnetic interference,
thermal noise, and crosstalk.

– Distortion: Distortion can occur when the shape or timing of the transmitted
signal is altered during transmission. This can result in errors in the received
data, as the receiver may not be able to accurately interpret the distorted
signal.

– Delay: Delay can occur when the signal takes longer than expected to reach
the receiver, resulting in a delay between the transmitted and received data.
This can be especially problematic in real-time applications, such as voice or
video communication, where delays can lead to a loss of synchronization or
degraded quality.
Performance
• Bandwidth ( Throughput )
• Latency ( Delay )
Abstract Details
• Bandwidth: Bandwidth refers to the maximum
data transfer rate of a network connection.
– Higher bandwidth allows for faster data
transmission and better network performance.
• Latency: Latency is the time it takes for a data
packet to travel from its source to its
destination.
– Lower latency results in quicker response times
and better network performance,
• Bandwidth : No of bits transmitted in a certain period of time

– A link may have a bandwidth of “B” bps, but we can send only “T” bps ; T
< B always;

Problem :
A network with bandwidth of 10 mbps can pass only an average of 12000
frames per minute and each frame carrying an average of 10000 bits, what
is the throughput of this network ?

Throughput = 12000 * 10000 / 60 = 2 MBPS

Bandwidth = Data transferred / Transfer time


• Latency
– How long it takes a message to travel from one
end of a network to the other.

– Latency = Propagation time + Transmission time


• Propagation time = Distance / Speed of Light
• Transmit = Size / bandwidth
• The distance between two devices is 500 kilometers (km), and the signal
propagation speed is 200,000 kilometers per second (km/s). Calculate the
propagation time for the network connection.

• Solution:
To calculate the propagation time, we need to determine the time it takes for a
signal to travel from one device to another.

• Step 1: Divide the distance by the signal propagation speed.

Propagation time = Distance / Propagation speed

500 km / 200,000 km/s = 0.0025 seconds

• Step 2: The result obtained above represents the propagation time. However, it's
often more convenient to express it in milliseconds (ms).

Propagation time = 0.0025 seconds * 1000 ms/second = 2.5 milliseconds (ms)


Example 1:

• You are playing an online game, and you measure the round-trip
time (RTT) between your computer and the game server.

• The RTT is measured as 50 milliseconds (ms). Calculate the


latency of the network connection.

• Solution: Since the RTT measures the time it takes for a round
trip, the latency can be calculated by dividing the RTT by 2.

– Latency = RTT / 2 = 50 ms / 2 = 25 ms
Transmission Media
• Transmission media, also known as
communication channels, are the physical
paths or mediums used to transmit data and
information from one point to another in a
communication system.
Twisted Pair cable
• Twisted pair cable is a type of transmission
medium commonly used in computer
networks and telephone systems.

• It consists of two insulated copper wires


twisted together in a specific pattern.
RJ 45 Connector
Coaxial cable
• Coaxial cable is a type of transmission medium
that consists of a central conductor, an insulating
layer, a metallic shield, and an outer cover.
• It is widely used for transmitting high-frequency
signals and is commonly found in cable television
(CATV), broadband internet connections, and
other applications that require high bandwidth.
• Here are some key features and uses of coaxial
cable:
BNC Connector
Fiber Optic Cable
Fiber optic cables are a type of
high-speed data transmission
medium that uses thin strands of
glass or plastic to transmit digital
information in the form of light
signals.

These cables are designed to carry


large amounts of data over long
distances with minimal loss or
degradation of the signal.
Unguided Media
• Radio Wave
– Radio waves are a type of electromagnetic radiation with
wavelengths ranging from about one millimeter to over
100 kilometers.
• Microwaves
– are a type of electromagnetic radiation with wavelengths
ranging from about one meter to one millimeter.
• Infrared (IR) radiation
– is a form of electromagnetic radiation with wavelengths
longer than those of visible light but shorter than those of
microwaves.
Switching
• Forwarding data packets between different
network devices
• Receive packet on one of its link and to
transmit on some other link.
Circuit Switching
Circuit Switching
• Circuit switching is a communication method
used in telecommunications networks to
establish a dedicated communication path
between two devices for the duration of a
connection.

• It is a traditional method of communication


that has been largely replaced by packet
switching in modern digital networks.
• In a circuit-switched network, when a call or
connection is initiated between two devices
(such as telephones),

– a dedicated physical path is established and reserved


for the duration of the call.

– This path remains exclusive to the connected devices


until the call is terminated.

– During the connection, the network resources, such


as transmission lines and switches, are dedicated to
maintaining the connection.
Phases of Circuit Switching
• Call Setup:

– When a user initiates a call, the network sets up a dedicated circuit between the calling and receiving
devices.
– This involves reserving the necessary resources along the entire path, including transmission lines
and switching equipment.

• Call Data Transfer:

– Once the circuit is established, data (such as voice or video) is transmitted directly over the dedicated
path without any intermediate processing.
– The devices communicate in real-time, and the dedicated resources ensure a consistent quality of
service throughout the call.

• Call Termination:

– When the call is ended by either party, the dedicated circuit is released, and the resources are freed
up for other connections.
– The circuit is no longer available for use by any other communication until it is set up again for a new
call.
• Circuit switching has several advantages,
– guaranteed bandwidth and low latency,
– which are particularly beneficial for real-time
applications like voice and video calls.
– It also provides a predictable quality of service since
the dedicated resources ensure consistent
performance throughout the connection.
• Circuit switching has limitations.
– It requires the reservation of resources even during
periods of silence or inactivity, resulting in inefficient
use of network capacity.
– Additionally, establishing and tearing down circuits can
take some time, which can lead to delays in call setup.
Data Link Layer
• Two main functions of the data link layer

– data link control and media access control.

• Data link control, deals with the design and procedures for
communication between two adjacent nodes:

– node-to-node communication.

• Data link control functions include framing, flow and error control, and

• Software implemented protocols that provide smooth and reliable


transmission of frames between nodes
FRAMING
• Data transmission in the physical layer means
moving bits in the form of a signal from the
source to the destination.

• The data link layer, on the other hand, needs


to pack bits into frames, so that each frame is
distinguishable from another.
Framing
• Framing in the data link layer separates a message
by adding a sender address and a destination
address.

• The destination address defines where the packet is


to go; the sender address helps the recipient
acknowledge the receipt.

• When a message is divided into smaller frames, a


single-bit error affects only that small frame
• Fixed-Size Framing
• Variable-Size Framing
– a character-oriented approach and
– a bit-oriented approach.

• In a character-oriented protocol,
– data to be carried are 8-bit characters from a coding system such as
ASCII.

– The header, which normally carries the source and destination addresses
and other control information,

– and the trailer, which carries error detection or error correction


redundant bits, are also multiples of 8 bits.

– To separate one frame from the next, an 8-bit (I-byte) flag is added at
the beginning and the end of a frame.
Bit-Oriented Protocols
• the data section of a frame is a sequence of bits to be
interpreted by the upper layer as text, graphic, audio, video,
and so on.

• However, in addition to headers (and possible trailers), we


still need a delimiter to separate one frame from the other.

• Most protocols use a special 8-bit pattern flag 01111110 as


the delimiter to define the beginning and the end of the
frame, as shown in Figure 11.3
FLOW AND ERROR CONTROL
• Data communication requires at least two devices
working together, one to send and the other to receive.

• coordination for an intelligible exchange

• most important responsibilities of the data link layer are


flow control and error control.

• Collectively, these functions are known as data link


control.
• Flow Control
– Flow control refers to a set of procedures used to restrict the amount of
data that the sender can send before waiting for acknowledgment.

• Error Control
– Error control is both error detection and error correction.

– It allows the receiver to inform the sender of any frames lost or


damaged in transmission and coordinates the retransmission of those
frames by the sender.

– Error control in the data link layer is based on automatic repeat request,
which is the retransmission of data.

data link layer can combine framing, flow control,


and error control to achieve the delivery of data
from one node to another
NOISELESS CHANNELS
• Simplest Protocol Our first protocol,

– is one that has no flow or error control.

– it is a unidirectional protocol in which data frames are traveling in only one


direction-from the sender to receiver.

– receiver can immediately handle any frame it receives

– receiver immediately removes the header from the frame and hands the data
packet to its network layer,

– which can also accept the packet immediately.

– In other words, the receiver can never be overwhelmed with incoming frames
Stop-and-Wait Protocol
NOISY CHANNELS

Stop-and-Wait Automatic Repeat Request

Error correction in Stop-and-Wait ARQ is done


by keeping a copy of the sent frame and
retransmitting of the frame when the timer
expires

In Stop-and-Wait ARQ~ we use sequence


numbers to number the frames. The sequence
numbers are based on modul0-2 arithmetic.

In Stop-and-WaitARQ ~ the acknowledgment


number always announces in modul0-2
arithmetic the sequence number of the next
frame expected
Go-Back-N Automatic Repeat Request
• we can send several frames before receiving
acknowledgments; we keep a copy of these
frames until the acknowledgment

For example, if m is 4, the only sequence numbers are 0 through 15 inclusive.

However, we can repeat the sequence. So the sequence numbers are

0, 1,2,3,4,5,6, 7,8,9, 10, 11, 12, 13, 14, 15,0, 1,2,3,4,5,6,7,8,9,10, 11, .....
• Sliding Window
– The send window is an imaginary box covering the
sequence numbers of the data frames which can be
in transit.
m
– The maximum size of the window is 2 – 1
– The window at any time divides the possible
sequence numbers into four regions.
– The first region, from the far left to the left wall of
the window, defines the sequence numbers
belonging to frames that are already acknowledged
The sender does
not worry about
these frames and
keeps no copies of
them.

The second region,


defines the range of
The third range,
sequence numbers
defines the range of Finally, the
belonging to the
sequence numbers for fourth region
frames that are sent
frames that can be defines
and have an
sent; however, the sequence
unknown status.
corresponding data numbers that
The sender needs to wait to find packets have not yet cannot be used
out if these frames have been been received from until the window
received or were lost. We call the network layer. slides
these outstanding frames.
Figure 11.12b shows how a send window can slide one or more slots to the right when an
acknowledgment arrives from the other end.

In Figure 11.12b, frames 0, I, and 2 are acknowledged, so the window has slid to the right
three slots.

Note that the value of Sf is 3 because frame 3 is now the first outstanding frame.
HDLC
• High-level Data Link Control (HDLC) is a bit-oriented protocol for communication
over point-to-point and multipoint links.

• It implements the ARQ mechanisms

• Configurations and Transfer Modes HDLC provides two common transfer modes
that can be used in different configurations:
– normal response mode (NRM) and asynchronous balanced mode (ABM).

• In normal response mode (NRM), the station configuration is unbalanced. We


have one primary station and multiple secondary stations.

• A primary station can send commands; a secondary station can only respond.
The NRM is used for both point-to-point and multiple-point links, as shown in
Figure 11.25
• Asynchronous Balanced Mode In
asynchronous balanced mode (ABM), the
configuration is balanced.
• The link is point-to-point, and each station can
function as a primary and a secondary (acting
as peers), as shown in Figure 11.26. This is the
common mode today.
POINT-TO-POINT PROTOCOL (PPP)
• Although HDLC is a general protocol that can be used for both point-to-point and
multipoint configurations,

• one of the most common protocols for point-to-point access is the Point-to-Point
Protocol (PPP).

• Today, millions of Internet users who need to connect their home computers to
the server of an Internet service provider use PPP.

• The majority of these users have a traditional modem; they are connected to the
Internet through a telephone line, which provides the services of the physical
layer.

• But to control and manage the transfer of data, there is a need for a point-to-
point protocol at the data link layer.
• PPP provides several services:

1. PPP defines the format of the frame to be exchanged between devices.

2. PPP defines how two devices can negotiate the establishment of the link and the
exchange of data.

3. PPP defines how network layer data are encapsulated in the data link frame.

4. PPP defines how two devices can authenticate each other.

5. PPP provides multiple network layer services supporting a variety of network


layer protocols.

6. PPP provides connections over multiple links.

7. PPP provides network address configuration. This is particularly useful when a


home user needs a temporary network address to connect to the Internet
• On the other hand, to keep PPP simple, several services are missing:

1. PPP does not provide flow control. A sender can send several frames
one after another with no concern about overwhelming the receiver.

2. PPP has a very simple mechanism for error control.


– A CRC field is used to detect errors. If the frame is corrupted, it is silently
discarded;
– the upper-layer protocol needs to take care of the problem.
– Lack of error control and sequence numbering may cause a packet to be
received out of order.

3. PPP does not provide a sophisticated addressing mechanism to handle


frames in a multipoint configuration
MAC
• The primary function of the MAC sublayer is to provide a unique
identifier for each device on a network.

• This identifier is known as the MAC address or hardware address.

• MAC addresses are assigned to network interface cards (NICs)


and are typically stored in read-only memory (ROM) on the card.

• They are assigned by the manufacturer and are globally unique,


ensuring that no two devices have the same MAC address.
The MAC sublayer performs several
important tasks:
• Addressing
• Medium Access Control
• Frame Delimiting
• Error Detection
Error Detection and Correction in computer
network
• Error detection and correction are crucial processes in
computer networks to ensure reliable data transmission.

• They help identify and fix errors that may occur during
the transmission of data across the network.

• There are various techniques and protocols employed


for error detection and correction.

• Let's explore some of the commonly used methods:


• Parity Check:
– Parity check is a simple error detection method.
– In this technique, an additional bit, known as a parity bit, is added to the data
being transmitted.
– The parity bit is set to 1 or 0 to ensure that the total number of 1s in the data,
including the parity bit, is either even (even parity) or odd (odd parity).
– The receiver checks the parity of the received data and detects if an error has
occurred.

• Checksum:
– Checksum is another widely used error detection technique.
– It involves adding a checksum value to the data being transmitted.
– The checksum is calculated by summing up all the data words and then taking
the complement of the result.
– The receiver recalculates the checksum using the received data and compares
it with the received checksum.
– If they don't match, an error is detected.
• Cyclic Redundancy Check (CRC):
– CRC is a more sophisticated error detection technique.
– It uses polynomial division to generate a checksum, which is appended to the
data.
– At the receiver's end, the received data and checksum are divided by the same
polynomial.
– If the remainder is zero, no error is detected; otherwise, an error has occurred.

• Forward Error Correction (FEC):


– Unlike error detection techniques that require retransmission of data,
– FEC is an error correction technique that can correct errors directly.
– In FEC, additional redundant bits are added to the data, allowing the receiver
to reconstruct the original data even if errors are present.
– Reed-Solomon codes are commonly used for FEC in network communications.
• Automatic Repeat Request (ARQ):
– ARQ is an error control protocol that involves
retransmitting data when errors are detected.

– It relies on acknowledgments (ACK) and negative


acknowledgments (NAK) from the receiver to confirm
successful transmission or request retransmission.

– Examples of ARQ protocols include Stop-and-Wait


ARQ, Go-Back-N ARQ, and Selective Repeat ARQ.
Key Functions of the Data Link Layer:
• Framing:
– The Data Link Layer encapsulates network layer packets into frames by adding header
and trailer information.
– Frames include control information, such as synchronization bits, frame delimiters, and
error detection codes.

• Physical Addressing:
– The Data Link Layer uses physical addressing, such as MAC (Media Access Control)
addresses, to identify the source and destination nodes on the same network segment.
– MAC addresses are typically assigned to network interface cards (NICs) and are globally
unique.

• Media Access Control:


– The Data Link Layer implements access control mechanisms to regulate the access to the
shared communication medium when multiple devices are connected.
– Popular access control methods include Carrier Sense Multiple Access with Collision
Detection (CSMA/CD) for Ethernet and Carrier Sense Multiple Access with Collision
Avoidance (CSMA/CA) for Wi-Fi.
• Error Detection and Correction:

– The Data Link Layer employs various error detection and correction techniques, such as
checksums and cyclic redundancy checks (CRC), to ensure data integrity during
transmission.
– These techniques help detect and, in some cases, correct errors that occur due to noise
or other impairments on the physical medium.

• Flow Control:

– Flow control mechanisms in the Data Link Layer ensure that the sender does not
overwhelm the receiver with data.
– It manages the rate of data transmission by implementing techniques like sliding
window protocols, which allow a sender to transmit a certain number of frames before
receiving acknowledgments from the receiver.

• Error Handling:
– The Data Link Layer handles error conditions, such as frame loss or corruption, by
requesting retransmissions using protocols like Automatic Repeat Request (ARQ).
– It also handles frame sequencing and reassembly at the receiver's end.
Common protocols and standards associated with the Data Link Layer include Ethernet (IEEE
802.3), Wi-Fi (IEEE 802.11), Point-to-Point Protocol (PPP), High-Level Data Link Control
(HDLC), and Asynchronous Transfer Mode (ATM).

You might also like