0% found this document useful (0 votes)
36 views177 pages

CNND Module 2 Notes

Uploaded by

Ankur Patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views177 pages

CNND Module 2 Notes

Uploaded by

Ankur Patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 177

Module 2

Physical Layer and Data Link Layer

Physical Layer
Syllabus
Syllabus
Transmission Media
• In data communication terminology, a transmission medium is a
physical path between the transmitter and the receiver i.e.
• it is the channel through which data is sent from one place to another.
Guided Media
• It is defined as the physical medium through which the signals are
transmitted.
• also referred to as Wired or Bounded transmission media.
• Signals being transmitted are directed and confined in a narrow pathway by
using physical links. 
Features:  
• High Speed
• Secure
• Used for comparatively shorter distances
• Types:
• Twisted pair:

• Coaxial Cable
Guided Media
• Types:
• Twisted pair:
• Coaxial Cable
• Fibre Optic
Types of Guided Media: Twisted Pair
• Twisted pair is a physical media made up of a pair of cables
twisted with each other.
• A twisted pair cable is cheap as compared to other
transmission media.
• Installation of the twisted pair cable is easy, and it is a
lightweight cable.
• The frequency range for twisted pair cable is from 0 to
3.5KHz.
• A twisted pair consists of two insulated copper wires
arranged in a regular spiral pattern.
Types of Guided Media: Twisted Pair
Types of Guided Media: Twisted
Pair
• Unshielded Twisted Pair:
• UTP consists of two insulated copper wires twisted around one
another.
• This type of cable has the ability to block interference and does not
depend on a physical shield for this purpose.
• It is used for telephonic applications.
Types of Guided Media: Twisted
Pair
• Unshielded Twisted Pair:
- Following are the categories of the unshielded twisted pair cable:
• Category 1: Category 1 is used for telephone lines that have low-
speed data.
• Category 2: It can support upto 4Mbps.
• Category 3: It can support upto 16Mbps.
• Category 4: It can support upto 20Mbps. Therefore, it can be used
for long-distance communication.
• Category 5: It can support upto 200Mbps.
Types of Guided Media: Twisted
Pair
• Unshielded Twisted Pair:
• Advantages :
• It is cheap.
• Installation of the unshielded twisted pair is easy.
• It can be used for high-speed LAN.
• Disadvantage:
• This cable can only be used for shorter distances because of attenuation.
•  Susceptible to external interference
• Lower capacity and performance in comparison to STP
• Applications:
• Used in telephone connections and LAN networks
Types of Guided Media: Twisted
Pair
• Shielded Twisted Pair:
• 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.
Types of Guided Media: Twisted
Pair
• Shielded Twisted Pair:
- Characteristics Of Shielded Twisted Pair:
• The cost of the shielded twisted pair cable is not very high and not very low.
• An installation of STP is easy.
• It has higher capacity as compared to unshielded twisted pair cable.

• It has a higher attenuation (Attenuation is the loss of signal strength in

networking cables or connections.).

• It is shielded that provides the higher data transmission rate.


Types of Guided Media: Twisted
Pair
• Shielded Twisted Pair:
- Advantages: 
• ⇢ Better performance at a higher data rate in comparison to UTP
• ⇢ Eliminates crosstalk
• ⇢ Comparatively faster
- Disadvantages:
• ⇢ Comparatively difficult to install and manufacture
• ⇢ More expensive
• ⇢ Bulky
- Applications:
• The shielded twisted pair type of cable is most frequently used in extremely
cold climates, where the additional layer of outer covering makes it perfect
for withstanding such temperatures or for shielding the interior components.
Types of Guided Media: Coaxial Cable

• It has an outer plastic covering containing an insulation layer made of PVC


or Teflon and 2 parallel conductors each having a separate insulated
protection cover.
Types of Guided Media: Coaxial Cable
• The inner conductor of the coaxial cable is made up of copper, and the outer
conductor is made up of copper mesh.
• The middle core is made up of non-conductive cover that separates the inner
conductor from the outer conductor.
• The middle core is responsible for the data transferring whereas the copper
mesh prevents from the EMI(Electromagnetic interference).
Types of Guided Media: Coaxial Cable
• Coaxial cable is of two types:
1. Baseband transmission: 
• (dedicated cable bandwidth)
• It is defined as the process of transmitting a single signal at high speed.
2. Broadband transmission: 
• (cable bandwidth is split into separate ranges)
• It is defined as the process of transmitting multiple signals
simultaneously.
• Cable TVs and analog television networks widely use Coaxial cables. 
Types of Guided Media: Coaxial Cable
- Advantages Of Coaxial cable:
• The data can be transmitted at high speed.
• It has better shielding as compared to twisted pair cable.
• It provides higher bandwidth.
- Disadvantages Of Coaxial cable:
• It is more expensive as compared to twisted pair cable.
• If any fault occurs in the cable causes the failure in the entire network.
- Applications:
• Radio frequency signals are sent over coaxial wire.
• It can be used for cable television signal distribution, digital audio (S/PDIF),
computer network connections (like Ethernet), and feedlines that connect radio
transmitters and receivers to their antennas.
Types of Guided Media: Fibre Optic
• Fibre optic cable is a cable that uses electrical signals for communication.
• Fibre optic is a cable that holds the optical fibres coated in plastic that are
used to send the data by pulses of light.
• It 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.
Types of Guided Media: Fibre Optic
• The plastic coating protects the optical fibres from heat, cold,
electromagnetic interference from other types of wiring.
• Fibre optics provide faster data transmission than copper wires.
• It is used for the transmission of large volumes of data. 
• The cable can be unidirectional or bidirectional. The WDM (Wavelength
Division Multiplexer) supports two modes, namely unidirectional and
bidirectional mode.
Types of Guided Media: Fibre Optic
• Basic elements of Fibre optic cable:
- Core: The optical fibre consists of a narrow strand of glass or plastic known
as a core.
- A core is a light transmission area of the fibre.
- The more the area of the core, the more light will be transmitted into the fibre.
- Cladding: The concentric layer of glass is known as cladding.
- The main functionality of the cladding is to provide the lower refractive index
at the core interface as to cause the reflection within the core so that the light
waves are transmitted through the fibre.
- Jacket: The protective coating consisting of plastic is known as a jacket.
- The main purpose of a jacket is to preserve the fibre strength, absorb shock
and extra fibre protection.
Types of Guided Media: Fibre Optic
- Advantages of fibre optic cable over copper:
• Greater Bandwidth: The fibre optic cable provides more
bandwidth as compared copper. Therefore, the fibre optic
carries more data as compared to copper cable.
• Faster speed: Fibre optic cable carries the data in the form
of light. This allows the fibre optic cable to carry the signals
at a higher speed.
• Longer distances: The fibre optic cable carries the data at
a longer distance as compared to copper cable.
• Better reliability: The fibre optic cable is more reliable
than the copper cable as it is immune to any temperature
changes while it can cause obstruct in the connectivity of
copper cable.
Types of Guided Media: Fibre Optic
- Advantages of fibre optic cable over copper:
• Thinner and Sturdier: Fibre optic cable is thinner and
lighter in weight so it can withstand more pull pressure than
copper cable.
- Disadvantages:  
• Difficult to install and maintain
• High cost
• Fragile
THANK YOU!!!
Module 2
Physical Layer and Data Link Layer

Physical Layer
Syllabus
Syllabus
Unguided Media
• also referred to as Wireless or Unbounded transmission media.
• No physical medium is required for the transmission of
electromagnetic signals. 
• Features:  
• The signal is broadcasted through air
• Less Secure
• Used for larger distances
• There are 3 types of Signals transmitted through unguided
media: 
(i) Radio waves
(ii) Microwaves
(iii) Infrared 
Radio Waves
•  the electromagnetic waves that are transmitted in all the directions
of free space.
• omnidirectional, i.e., the signals are propagated in all the
directions.
• The range in frequencies of radio waves is from 3Khz to 1 khz.
Radio Waves
• In the case of radio waves, the sending and receiving antenna are not
aligned, i.e., the wave sent by the sending antenna can be received by any
receiving antenna.
• An example of the radio wave is FM radio.
• Further Categorized as (i) Terrestrial and (ii) Satellite. 
• Applications Of Radio waves:
• useful for multicasting when there is one sender and many receivers.
• An FM radio, television, cordless phones are examples of a radio wave.
• Advantages Of Radio transmission:
• Radio transmission is mainly used for wide area networks and mobile cellular
phones.
• Radio waves cover a large area, and they can penetrate the walls.
• Radio transmission provides a higher transmission rate.
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. 
Microwaves
• Characteristics of Microwave:
• Frequency range: The frequency range of terrestrial microwave is from
4-6 GHz to 21-23 GHz.
• Bandwidth: It supports the bandwidth from 1 to 10 Mbps.
• Short distance: It is inexpensive for short distance.
• Long distance: It is expensive as it requires a higher tower for a longer
distance.
• Attenuation: Attenuation means loss of signal. It is affected by
environmental conditions and antenna size.
Microwaves
• Advantages Of Microwave:
• Microwave transmission is cheaper than using cables.
• It is free from land acquisition as it does not require any land for the
installation of cables.
• Microwave transmission provides an easy communication in terrains as
the installation of cable in terrain is quite a difficult task.
• Communication over oceans can be achieved by using microwave
transmission.
Microwaves
• Disadvantages of Microwave transmission:
• Eavesdropping: An eavesdropping creates insecure
communication. Any malicious user can catch the signal in the air
by using its own antenna.
• Out of phase signal: A signal can be moved out of phase by using
microwave transmission.
• Susceptible to weather condition: A microwave transmission is
susceptible to weather condition. This means that any
environmental change such as rain, wind can distort the signal.
• Bandwidth limited: Allocation of bandwidth is limited in the case
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.
Infrared
• Characteristics Of Infrared:
• It supports high bandwidth, and hence the data rate will be very high.
• Infrared waves cannot penetrate the walls.
• Therefore, the infrared communication in one room cannot be interrupted by the
nearby rooms.
• An infrared communication provides better security with minimum
interference.
• Infrared communication is unreliable outside the building because the
sun rays will interfere with the infrared waves.
THANK YOU!!!
Wireless Transmission:
Electromagnetic Spectrum
Electromagnetic Spectrum

• The sun is our planet’s principal source of


energy, and its energy travels in the form of
electromagnetic radiation.
• Electromagnetic energy moves across empty
space at the speed of light in the form of waves
of electric and magnetic fields with a range of
frequencies or wavelengths.
Electromagnetic Waves

• Waves created by the interaction of vibrating


electric and magnetic fields are known as
electromagnetic waves.
• An oscillating electric and magnetic field
makes up EM waves.
Electromagnetic Waves
• A charged particle, in general, produces an electric field.
• This electric field exerts a push on other charged particles.
• Positive charges accelerate in the field’s direction, whereas
negative charges accelerate in the opposite direction of the
field.
• A travelling charged particle creates the magnetic field. This
magnetic field exerts a push on other moving particles.
• Because the force acting on these charges is always
perpendicular to their movement, it only affects the direction
of the velocity, not the speed.
• As a result, a speeding charged particle generates the
electromagnetic field. Electromagnetic waves are nothing more
than electric and magnetic fields travelling at the speed of light
c through open space.
Electromagnetic Waves
• When a charged particle oscillates about an equilibrium
location, it is said to be accelerating.
• If the charged particle’s oscillation frequency is f, it creates
an electromagnetic wave of frequency f.
• The wavelength of this wave may be calculated using the
formula:  

λ = c/f
• Electromagnetic waves are a type of energy transfer that
occurs in space.
Representation of Electromagnetic Waves
Electromagnetic Spectrum
• The electromagnetic spectrum is a
– collection of frequencies, wavelengths, and photon
energies of electromagnetic waves
– spanning from 1Hz to 1025Hz,
– equivalent to wavelengths ranging from a few hundred
kilometres to a size smaller than the size of an atomic
nucleus. 
• In a vacuum, all electromagnetic waves travel at
the same speed as light.
• For different forms of electromagnetic waves,
however, the wavelengths, frequencies, and photon
energy will vary.
Electromagnetic Spectrum
Electromagnetic Spectrum
Electromagnetic Waves in Electromagnetic
Spectrum
• Visible Rays
– Visible rays are electromagnetic waves that can be seen
with the naked eye. They are the most common type of
electromagnetic waves.
– These can be found in the frequency range of 4×1014Hz–
7×1014Hz or the wavelength range of 400nm–700nm.
– The visible light rays reflected or released from the
objects around us assist us in seeing the world, and the
range of visible radiation is different for different
creatures.
– Devices that emit light in the visible area of the
electromagnetic spectrum include bulbs, lamps, candles,
LEDs, tube lights, and so on.
Electromagnetic Waves in Electromagnetic
Spectrum
• Ultraviolet Rays
– Although the sun is the primary source of ultraviolet radiation on
Earth, the ozone layer absorbs the majority of UV energy before it
reaches the atmosphere.
– UV radiation has a wavelength of 400nm–1nm.
– These radiations are emitted by special lamps and extremely hot
bodies, and in big numbers, they can cause significant injury to
humans. It tans the skin and creates burns.
– Because these radiations may be focused on tiny beams, they are used
in high precision applications such as LASIK or laser-based eye
surgery.
– UV lamps are used in water purifiers to eliminate microorganisms
that may be present in the water.
– When working with UV welding arcs, welders use special goggles to
protect their eyes.
Electromagnetic Waves in Electromagnetic
Spectrum
• X-Rays
– This electromagnetic radiation is found outside of the ultraviolet
(UV) region of the electromagnetic spectrum and is extremely
valuable in the medical field.
– The wavelength range of X-ray radiation is 1nm–10–3nm.
– By blasting a metal target with high-energy electrons, X-rays can
be produced.
– X-rays are a diagnostic technique in medicine that can be quite
helpful in the treatment of some types of cancer. To find the source
of the problem, a doctor utilises an x-ray scanner to scan our bones
or teeth. Overexposure to x-rays can cause harm or death to the
organism’s healthy tissues. As a result, extreme caution must be
exercised when dealing with x-rays.
– At the airport checkpoint, security agents utilise it to search
through passengers’ luggage. X-rays are also emitted by the
universe’s heated gases.
Electromagnetic Waves in
Electromagnetic Spectrum
• Gamma-Rays
– The universe is the largest gamma-ray generator.
– These rays are in the electromagnetic spectrum’s higher
frequency region.
– Gamma rays have wavelengths ranging from 10–12m to
10–14m.
– Radioactive nuclei release high-frequency radiations,
which are also created during nuclear processes.
– Gamma rays have a wide range of medical applications,
including the destruction of cancerous cells. Gamma-ray
imaging is a technique used by doctors to examine the
insides of patients’ bodies.
Types of Radiation Frequency range (Hz) Wavelength Range

Gamma-rays 1020-1024 <10-12 m

X-rays 1017-1020 1 nm – 1 pm

Ultraviolet rays  1015-1017 400 nm – 1 nm

Visible rays 4 x 1014 – 7.5 x 1014 750 nm – 400 nm

Near-infrared  1 x 1014 – 4 x 1014 2.5 μm – 750 nm 

Infrared rays 1013 – 1014 25 μm – 2.5 μm

Microwaves 3 x 1011 – 1013 11 mm – 25 μm

Radio waves < 3x 1011 >1 mm


• Radio: A radio basically captures radio waves that
are transmitted by radio stations.
– Radio waves can also be emitted by gases and stars in
space.
– Radio waves are mainly used for TV/mobile
communication.
• Microwave: This type of radiation is found in
microwaves and helps in cooking at home/office.
– It is also used by astronomers to determine and
understand the structure of nearby galaxies and stars.
• Infrared: It is used widely in night vision goggles.
– These devices can read and capture the infrared light
emitted by our skin and objects with heat.
– In space, infrared light helps to map the interstellar dust.
• X-ray: X-rays can be used in many instances.
– For example, a doctor can use an x-ray machine to take an
image of our bone or teeth.
– Airport security personnel use it to see through and check
bags. X-rays are also given out by hot gases in the universe.
• Gamma-ray: It has a wide application in the medical field.
– Gamma-ray imaging is used to see inside our bodies.
Interestingly, the universe is the biggest gamma-ray
generator of all.
• Ultraviolet: Sun is the main source of ultraviolet radiation.
– It causes skin tanning and burns.
– Hot materials that are in space also emit UV radiations.
• Visible: Visible light can be detected by our eyes. Light
bulbs, stars, etc. emit visible light.
Switching Techniques
• In large networks, there can be multiple paths
from sender to receiver.
• The switching technique will decide the best
route for data transmission.
• Types:
1. Circuit Switched Network
2. Packet Switched Network
Circuit Switching
• establishes a dedicated path
between sender and receiver.
• once the connection is established
then the dedicated path will remain
to exist until the connection is
terminated.
• Circuit switching in a network
operates in a similar way as the
telephone works.
• A complete end-to-end path must
exist before the communication takes
Circuit Switching
• Communication through circuit
switching has 3 phases:
• Circuit establishment
• Data transfer
• Circuit Disconnect
Circuit Switching
• Advantages 
1. In the case of Circuit Switching technique, the
communication channel is dedicated.
2. It has fixed bandwidth.
• Disadvantages 
1.It takes a long time to establish a connection.
2.More bandwidth is required in setting up dedicated
channels.
3.It cannot be used to transmit any other data even if
the channel is free as the connection is dedicated to
circuit switching.
Packet Switching
• the major problem with circuit
switching is that it needs a dedicated
line for transmission.
• In packet switching, data is broken
down into small packets with each
packet having source and destination
addresses, travelling from one router
to the next router.
• the message is sent in one go, but it
is divided into smaller pieces, and
they are sent individually.
Packet Switching
• The message splits into smaller pieces known as
packets and packets are given a unique number to
identify their order at the receiving end.
• Every packet contains some information in its
headers such as source address, destination
address and sequence number.
• Packets will travel across the network, taking the
shortest path as possible.
• All the packets are reassembled at the receiving
end in correct order.
• If any packet is missing or corrupted, then the
message will be sent to resend the message.
• If the correct order of the packets is reached, then
the acknowledgment message will be sent.
Packet Switching
• Packet Switching uses Store and
Forward technique while switching the
packets; while forwarding the packet each hop
first stores that packet then forward.
• This technique is very beneficial because
packets may get discarded at any hop due to
some reason.
• More than one path is possible between a pair
of sources and destinations.
Packet Switching
• More than one path is possible between a pair of sources and
destinations.
• If there is congestion at some path, packets are allowed to
choose different paths possible over an existing network. 
• Advantages:
1. More efficient in terms of bandwidth, since the concept
of reserving circuit is not there.
2. Minimal transmission latency.
3. More reliable as a destination can detect the missing
packet.
4. More fault tolerant because packets may follow a
different path in case any link is down, Unlike Circuit
Switching.
5. Cost-effective and comparatively cheaper to
implement.
Packet Switching
• The disadvantage of Packet Switching over Circuit
Switching : 
• Packet Switching doesn’t give packets in order, whereas
Circuit Switching provides ordered delivery of packets
because all the packets follow the same path.
• Since the packets are unordered, we need to provide
sequence numbers for each packet.
• Complexity is more at each node because of the facility to
follow multiple paths.
• Transmission delay is more because of rerouting.
• Packet Switching is beneficial only for small messages,
but for bursty data (large messages) Circuit Switching is
better.
Circuit Switching Vs Packet Switching
Circuit Switching Packet Switching

In-circuit switching has there are


3 phases: 
In Packet switching directly data
i) Connection Establishment. 
transfer takes place.
ii) Data Transfer. 
iii) Connection Released.

In-circuit switching, each data In Packet switching, each data


unit knows the entire path unit just knows the final
address which is provided by the destination address intermediate
source. path is decided by the routers.

In Packet switching, data is


In-Circuit switching, data is
processed at the source system processed at all intermediate
only nodes including the source
system.
Circuit Switching Vs Packet Switching
Circuit Switching Packet Switching

The delay between data The delay between data


units in circuit switching is units in packet switching is
uniform. not uniform.

Resource reservation is the There is no resource


feature of circuit switching reservation because
because the path is fixed bandwidth is shared among
for data transmission. users.
Circuit switching is more Packet switching is less
reliable. reliable.
Circuit Switching Vs Packet Switching
Circuit Switching Packet Switching

It is not a store and forward It is a store and forward


technique. technique.

Transmission of the data is done


Transmission of the data is done not only by the source but also
by the source.
by the intermediate routers.

Congestion can occur during the


connection establishment phase Congestion can occur during the
because there might be a case data transfer phase, a large
where a request is being made number of packets comes in no
for a channel but the channel is time. 
already occupied.
Circuit Switching Vs Packet Switching
Circuit Switching Packet Switching
n-Circuit Switching there is a In Packet Switching there is no
physical path between the physical path between the
source and the destination source and the destination
Circuit Switching does not
support store and forward Packet Switching supports store
and forward transmission
transmission
Call setup is required in circuit No call setup is required in
switching. packet switching.

In-circuit switching each packet In packet switching packets can


follows the same route. follow any route.
Circuit Switching Vs Packet Switching

Circuit Switching Packet Switching

The circuit switching Packet switching is


implemented at the
network is implemented datalink layer and network
at the physical layer. layer

Circuit switching requires Packet switching requires


simple protocols for complex protocols for
delivery. delivery.
Module 2
Physical Layer and Data Link Layer

Data Link Layer


Syllabus
Syllabus
Data Link Layer
• Data-link layer is the second layer after the physical
layer. The data link layer is responsible for maintaining
the data link between two hosts or nodes. 
• The data link layer is divided into two sub-layers : 
1. Logical Link Control Sub-layer (LLC) – 
• Provides the logic for the data link,
• Thus it controls the synchronization, flow control, and
error checking functions of the data link layer.
Functions are – 
(i) Error Recovery. 
(ii) It performs the flow control operations. 
(iii) User addressing. 
 
Data Link Layer
2. Media Access Control Sub-layer (MAC) – 
• It is the second sub-layer of data-link layer.
• It controls the flow and multiplexing for transmission
medium.
• Transmission of data packets is controlled by this layer.
• This layer is responsible for sending the data over the
network interface card. 
Functions are – 
(i) To perform the control of access to media. 
(ii) It performs the unique addressing to stations directly connected
to LAN. 
(iii) Detection of errors. 
Data Link Layer Design Issues
Services provided to the network layer – 
• The data link layer act as a service interface to the 
network layer.
• The principle service is transferring data from network
layer on sending machine to the network layer on
destination machine.
• This transfer also takes place via DLL (Data link-layer). 
Data Link Layer Design Issues
Frame synchronization – 
• The source machine sends data in the form of blocks called frames to the
destination machine.
• The starting and ending of each frame should be identified so that the
frame can be recognized by the destination machine.  
• The data link layer encapsulates each data packet from the network layer
into frames that are then transmitted.
• A frame has three parts, namely −
• Frame Header
• Payload field that contains the data packet from network layer
• Trailer
Data Link Layer Design Issues
Frame synchronization – 
Data Link Layer Design Issues
Flow control – 
• Flow control is done to prevent the flow of data frame at the receiver end.
• The source machine must not send data frames at a rate faster than the capacity of
destination machine to accept them. 
• The data link layer regulates flow control so that a fast sender does not
drown a slow receiver.
• When the sender sends frames at very high speeds, a slow receiver may not be able
to handle it.
• There will be frame losses even if the transmission is error-free.
• The two common approaches for flow control are −
• Feedback based flow control
• Rate based flow control
Data Link Layer Design Issues
Error control – 
• Error control is done to prevent duplication of frames.
• The errors introduced during transmission from source to destination
machines must be detected and corrected at the destination machine. 
• The data link layer ensures error free link for data transmission. The issues
it caters to with respect to error control are −
• Dealing with transmission errors
• Sending acknowledgement frames in reliable connections
• Retransmitting lost frames
• Identifying duplicate frames and deleting them
• Controlling access to shared channels in case of broadcasting
Error Detection
• An Error is a situation when the message received at the
receiver end is not identical to the message transmitted.
• Types Of Errors
• Errors can be classified into two categories:
• Single-Bit Error
• Burst Error

• Single-Bit Error:
• The only one bit of a given data unit is changed from 1 to 0 or
from 0 to 1.
Error Detection
• Types Of Errors
• Errors can be classified into two categories:
• Single-Bit Error
• Burst Error
• Burst Error:
• The two or more bits are changed from 0 to 1 or from 1 to 0 is
known as Burst Error.
• The Burst Error is determined from the first corrupted bit to the
last corrupted bit.
Error Detecting Techniques

• The most popular Error Detecting Techniques are:


• Single parity check
• Two-dimensional parity check
• Checksum
• Cyclic redundancy check
Error Detecting Techniques

• Checksum
- In checksum error detection scheme, the data is divided
into k segments each of m bits.
- In the sender’s end the segments are added using 1’s
complement arithmetic to get the sum. The sum is
complemented to get the checksum.
- The checksum segment is sent along with the data
segments.
- At the receiver’s end, all received segments are added
using 1’s complement arithmetic to get the sum. The sum is
complemented.
Error Detecting Techniques

• Checksum
Error Detecting Techniques
• Cyclic Redundancy Check (CRC)
- CRC is a redundancy error technique used to determine the error.
• Following are the steps used in CRC for error detection:
- In CRC technique, a string of n 0s is appended to the data unit, and this n
number is less than the number of bits in a predetermined number, known as
division which is n+1 bits.
- Secondly, the newly extended data is divided by a divisor using a process
is known as binary division.
- The remainder generated from this division is known as CRC remainder.
- Thirdly, the CRC remainder replaces the appended 0s at the end of the
original data. This newly generated unit is sent to the receiver.
Error Detecting Techniques
• Cyclic Redundancy Check (CRC)
- The receiver receives the data followed by the CRC remainder.
- The receiver will treat this whole unit as a single unit, and it is divided by the same
divisor that was used to find the CRC remainder.
• If the resultant of this division is zero which means that it has no error, and
the data is accepted.
• If the resultant of this division is not zero which means that the data
consists of an error. Therefore, the data is discarded.
Error Detecting Techniques
• Cyclic Redundancy Check (CRC)
Error Detecting Techniques
• Cyclic Redundancy Check (CRC)
• Eg. Suppose the original data is 11100 and divisor is
1001.
• CRC Generator
- A CRC generator uses a modulo-2 division.
• Firstly, three zeroes are appended at the end of the data as
the length of the divisor is 4 and we know that the length of
the string 0s to be appended is always one less than the
length of the divisor.
- Now, the string becomes 11100000, and the resultant string is
divided by the divisor 1001.
- The remainder generated from the binary division is known as
CRC remainder. The generated value of the CRC remainder is
111.
Error Detecting Techniques
• Cyclic Redundancy Check (CRC)
• Eg. Suppose the original data is 11100 and divisor is
1001.
• CRC Generator
Error Detecting Techniques
• Cyclic Redundancy Check (CRC)
• Eg. Suppose the original data is 11100 and divisor is
1001.
• CRC Checker
- The functionality of the CRC checker is similar to the CRC
generator.
- When the string 11100111 is received at the receiving end,
then CRC checker performs the modulo-2 division.
- A string is divided by the same divisor, i.e., 1001.
- In this case, CRC checker generates the remainder of zero.
Therefore, the data is accepted.
Error Detecting Techniques
• Cyclic Redundancy Check (CRC)
• Eg. Suppose the original data is 11100 and divisor is
1001.
• CRC Checker
Error Detecting Techniques
• Cyclic Redundancy Check (CRC)
• Eg.
THANK YOU!!!
Module 2
Physical Layer and Data Link Layer

Data Link Layer


Syllabus
Syllabus
Error Correction
• codes are used to detect and correct the errors when data is
transmitted from the sender to the receiver.

• Error Correction can be handled in two ways:


 Backward error correction: Once the error is discovered, the receiver
requests the sender to retransmit the entire data unit.
 Forward error correction: In this case, the receiver uses the error-
correcting code which automatically corrects the errors.

• For correcting the errors, one has to know the exact position of the
error. 

• To achieve this, we have to add some additional redundant bits.


Error Correction: Hamming Code
• Suppose
• r is the number of redundant bits and

• d is the total number of the data bits.

• The number of redundant bits r can be calculated by using the


formula:
2r>=d+r+1

• To determine the position of the bit which is in error, a technique


developed by R.W Hamming is Hamming code which can be applied
to any length of the data unit and uses the relationship between data
units and redundant units.
Error Correction : Hamming Code
• Parity bits: The bit which is appended to the original data of
binary bits so that the total number of 1s is even or odd.

• Even parity: To check for even parity,


• if the total number of 1s is even, then the value of the parity bit is 0.
• If the total number of 1s occurrences is odd, then the value of the
parity bit is 1.

• Odd Parity: To check for odd parity,


• if the total number of 1s is even, then the value of parity bit is 1.
• If the total number of 1s is odd, then the value of parity bit is 0.
Error Correction : Hamming Code

• Algorithm of Hamming code:


• An information of 'd' bits are added to the redundant bits 'r'
to form d+r.
• The location of each of the (d+r) digits is assigned a decimal
value.
• The 'r' bits are placed in the positions 1,2,.....2k-1.
• At the receiving end, the parity bits are recalculated. The
decimal value of the parity bits determines the position of an
error.
Error Correction : Hamming Code

• Example : Suppose the original data is 1010 which


isTotal
to benumber
sent. of data bits 'd' = 4
Number of redundant bits r : 2r >= d+r+1 2r>
= 4+r+1
Therefore, the value of r is 3 that satisfies the above
relation.
Total number of bits = d+r = 4+3 = 7;
Error Correction : Hamming Code
• Determining the position of the redundant bits
• The number of redundant bits is 3.
• The three bits are represented by r1, r2, r4.
• The position of the redundant bits is calculated with corresponds to the
raised power of 2.
• Therefore, their corresponding positions are 1, 21, 22.
1.The position of r1 = 1  
2.The position of r2 = 2  
3.The position of r4 = 4  

• Representation of Data on the addition of parity bits:


Error Correction : Hamming Code
• Determining the Parity bits
1. Determining the r1 bit
• The r1 bit is calculated by performing a parity check on
the bit positions whose binary representation includes 1 in
the first position.
• We observe the bit positions that includes 1 in the first
position are 1, 3, 5, 7.
• Now, we perform the even-parity check at these bit
positions. The total number of 1 at these bit positions
corresponding to r1 is even, therefore, the value of the
r1 bit is 0.

• r1=0
Error Correction : Hamming Code
• Determining the Parity bits
2. Determining the r2 bit
• The r1 bit is calculated by performing a parity check on
the bit positions whose binary representation includes 1 in
the second position.
• We observe the bit positions that includes 1 in the second
position are 2, 3, 6, 7.
• Now, we perform the even-parity check at these bit
positions. The total number of 1 at these bit positions
corresponding to r2 is odd, therefore, the value of the
r2 bit is 1.

• r2=1
Error Correction : Hamming Code
• Determining the Parity bits
2. Determining the r4 bit
• The r1 bit is calculated by performing a parity check on
the bit positions whose binary representation includes 1 in
the third position.
• We observe the bit positions that includes 1 in the third
position are 4, 5, 6, 7.
• Now, we perform the even-parity check at these bit
positions. The total number of 1 at these bit positions
corresponding to r4 is even, therefore, the value of the
r4 bit is 0.

• r4=0
Error Correction : Hamming Code
• Determining the Parity bits
• Data transferred is given below:

• Suppose the 4th bit is changed from 0 to 1 at the


receiving end, then parity bits are recalculated.
Error Correction : Hamming Code
• R1 bit
• The bit positions of the r1 bit are 1,3,5,7
• We observe from the figure that the binary
representation of r1 is 1100.
• Now, we perform the even-parity check, the total
number of 1s appearing in the r1 bit is an even number.
• Therefore, the value of r1 is 0.
Error Correction : Hamming Code
• R2 bit
• The bit positions of the r2 bit are 2,3,6,7.
• We observe from the figure that the binary
representation of r2 is 1001.
• Now, we perform the even-parity check, the total
number of 1s appearing in the r2 bit is an even number.
• Therefore, the value of r2 is 0.
Error Correction : Hamming Code
• R4 bit
• The bit positions of the r4 bit are 4,5,6,7.
• We observe from the figure that the binary
representation of r4 is 1011.
• Now, we perform the even-parity check, the total
number of 1s appearing in the r4 bit is an odd number.
• Therefore, the value of r4 is 1.
Error Correction : Hamming Code
• The binary representation of redundant bits, i.e.,
• r4r2r1 is 100, and
• its corresponding decimal value is 4.
• Therefore, the error occurs in a 4th bit position.
• The bit value must be changed from 1 to 0 to
correct the error.

• Original data

• Received Data
Error Correction : Hamming Code
• Example : Sender original data : 1011

• Original data 7 6 5 4 3 2 1
1 0 1 r4=0 1 r2=0 r1=1

r1 = 1,3,5,7 r2 = 2,3,6,7 r4 = 4,5,6,7


Even – Parity : 1’s even= parity bit set to 0
1’s odd = parity bit set to 1
• r1 =(111) 1 r2 =(1,0,1) 0 r4 =(101) 0
• Received Data 7 6 5 4 3 2 1
1 1 1 r4=0 1 r2=0 r1=1
Error Correction : Hamming Code
• Example : Sender original data : 1011

• Received data 7 6 5 4 3 2 1
1 1 to 0 1 r4=0 1 r2=0 r1=1

r1 = 1,3,5,7 r2 = 2,3,6,7 r4 = 4,5,6,7


Even – Parity : 1’s even= parity bit set to 0
1’s odd = parity bit set to 1
• r1 = (1,1,1,1) 0 r2 = (0,1,1,1) 1 r4 =
(0,1,1,1) 1
r4r2r1 = 110 = (6)
THANK YOU!!!
Module 2
Physical Layer and Data Link Layer

Data Link Layer


Syllabus
Syllabus
Elementary Data Link Protocols
• responsible to simply ensure and confirm that the bits and
bytes that are received are identical to the bits and bytes
being transferred. 

• Protocols:

1. Stop and Wait

2. Sliding Window
1. Go Back N
2. Selective Repeat
Elementary Data Link Protocols
• The error control mechanism is divided into two categories,
i.e.,
• Stop and Wait ARQ and
• sliding window.

• The sliding window is further divided into two categories,


i.e.,
• Go Back N, and
• Selective Repeat.
Stop and Wait Protocol
• In stop and wait protocol,
• Sender sends one data packet and
then waits for its acknowledgement.
• Sender sends the next packet only
after it receives the
acknowledgement for the previous
packet.
Stop and Wait Protocol
• Primitives of Stop and Wait Protocol
• The primitives of stop and wait protocol
are:
• Sender side
• Rule 1: Sender sends one data packet at a
time.
• Rule 2: Sender sends the next packet only
when it receives the acknowledgment of the
previous packet.
• Receiver side
• Rule 1: Receive and then consume the data
packet.
• Rule 2: When the data packet is consumed,
receiver sends the acknowledgment to the
sender.
Stop and Wait Protocol
• Disadvantages of Stop and Wait protocol
1. Problems occur due to lost data
• In this case, two problems occur:
Sender waits for an infinite amount of time for an
acknowledgment.
Receiver waits for an infinite amount of time for a data.
Stop and Wait Protocol
• Disadvantages of Stop and Wait protocol
2. Problems occur due to lost acknowledgment
• In this case, one problem occurs:
Sender waits for an infinite amount of time for an
acknowledgment.
Stop and Wait Protocol
• Disadvantages of Stop and Wait protocol
3. Problem due to the delayed data or
acknowledgment
Stop and Wait ARQ Protocol
• is an improved and modified version of Stop and Wait protocol.
• Stop and Wait ARQ assumes-
The communication channel is noisy.
Errors may get introduced in the data during the transmission.
• Working-
Stop and wait ARQ works similar to stop and wait protocol.
It provides a solution to all the limitations of stop and wait
protocol.
Stop and wait ARQ includes the following three extra elements.
Stop and Wait ARQ Protocol
Thus, we can say-
 
Stop and Wait ARQ
= Stop and Wait Protocol + Time Out Timer + Sequence
Numbers for Data Packets and Acknowledgements

Number of Sequence
Numbers Required- NOTE
For any sliding window protocol to work without any problem,
the following condition must be satisfied-
Available Sequence Numbers >= Sender Window Size + Receiver
Stop and Wait ARQ Protocol
• Stop and wait ARQ is a one bit sliding window protocol where-
Sender window size = 1
Receiver window size = 1
• Thus, in stop and wait ARQ,
• Minimum number of sequence numbers required
= Sender Window Size + Receiver Window Size
=1+1
=2
• Thus,
Minimum number of sequence numbers required in Stop and
Wait ARQ = 2.
The two sequence numbers used are 0 and 1.
How Stop and Wait ARQ Solves All Problems?

1. Problem of Lost Data Packet-


• Time out timer helps to solve the problem of lost data packet.
• After sending a data packet to the receiver, sender starts the time
out timer.
• If the data packet gets acknowledged before the timer expires,
sender stops the time out timer.
• If the timer goes off before receiving the acknowledgement,
sender retransmits the same data packet.
• After retransmission, sender resets the timer.
• This prevents the occurrence of deadlock.
How Stop and Wait ARQ Solves All Problems?

1. Problem of Lost Data Packet-


How Stop and Wait ARQ Solves All Problems?

2. Problem of Lost Acknowledgement-


• Sequence number on data packets help to solve the problem of
delayed acknowledgement.
• Consider the acknowledgement sent by the receiver gets lost.
• Then, sender retransmits the same data packet after its timer
goes off.
• This prevents the occurrence of deadlock.
• The sequence number on the data packet helps the receiver to
identify the duplicate data packet.
• Receiver discards the duplicate packet and re-sends the same
acknowledgement.
How Stop and Wait ARQ Solves All Problems?

2. Problem of Lost Acknowledgement-


How Stop and Wait ARQ Solves All Problems?

2. Problem of Lost Acknowledgement-


• Role of Sequence Number on Data Packets
• Consider the above example-
• Step-01:
• Sender sends a data packet with sequence number-0 to the receiver.
• Step-02:
• Receiver receives the data packet correctly.
• Receiver now expects data packet with sequence number-1.
• Receiver sends the acknowledgement ACK-1.
• Step-03:
• Acknowledgement ACK-1 sent by the receiver gets lost on the way.
How Stop and Wait ARQ Solves All Problems?

2. Problem of Lost Acknowledgement-


• Role of Sequence Number on Data Packets
• Consider the above example- 
• Step-04:
• Sender receives no acknowledgement and time out occurs.
• Sender retransmits the same data packet with sequence number-0.
• This will be a duplicate packet for the receiver.
• Step-05:
• Receiver receives the data packet and discovers it is the duplicate packet.
• It expects the data packet with sequence number-1 but receiving the data
packet with sequence number-0.
• It discards the duplicate data packet and re-sends acknowledgement ACK-1.
• ACK-1 requests the sender to send a data packet with sequence number-1.
• This avoids the inconsistency of data.
How Stop and Wait ARQ Solves All Problems?

2. Problem of Lost Acknowledgement-


• Role of Sequence Number on Data Packets

• Conclusion-
• Had the sequence numbers not been allotted to the data packets,
receiver would have accepted the duplicate data packet thinking of it as
the new data packet.
• This is how sequence numbers allotted to the data packets prove to be
useful for identifying the duplicate data packets and discarding them.
How Stop and Wait ARQ Solves All Problems?

• 3. Problem of Delayed
Acknowledgement-

• Sequence number on
acknowledgements help to solve the
problem of delayed
acknowledgement.
How Stop and Wait ARQ Solves All Problems?

• 3. Problem of Delayed Acknowledgement-


• Role of Sequence Number on Acknowledgements
• Consider the above example-
• Step-01:
• Sender sends a data packet with sequence number-0 to the receiver.

• Step-02:
• Receiver receives the data packet correctly.
• Receiver now expects data packet with sequence number-1.
• Receiver sends the acknowledgement ACK-1.
• Step-03:
• Acknowledgement ACK-1 sent by the receiver gets delayed in reaching
the sender.
How Stop and Wait ARQ Solves All Problems?

• 3. Problem of Delayed Acknowledgement-


• Role of Sequence Number on Acknowledgements
• Consider the above example-
• Step-04:
• Sender receives no acknowledgement and time out occurs.
• Sender retransmits the same data packet with sequence number-0.
• This will be a duplicate packet for the receiver.

• Step-05:
• Receiver receives the data packet and discovers it is the duplicate packet.
• It expects the data packet with sequence number-1 but receiving the data
packet with sequence number-0.
• It discards the duplicate data packet and re-sends acknowledgement ACK-1.
• ACK-1 requests the sender to send a data packet with sequence number-1.
How Stop and Wait ARQ Solves All Problems?

• 3. Problem of Delayed Acknowledgement-


• Role of Sequence Number on Acknowledgements
• Consider the above example-
• Step-06:
• Two acknowledgements ACK1 reaches the sender.
• When first acknowledgement ACK1 reaches the sender, sender sends
the next data packet with sequence number 1.
• When second acknowledgement ACK1 reaches the sender, sender
rejects the duplicate acknowledgement.
• This is because it has already sent the data packet with sequence
number-1 and now sender expects the acknowledgement with
sequence number 0 from the receiver.
How Stop and Wait ARQ Solves All Problems?

4. Problem of Damaged
Packet-
• If receiver receives a corrupted data
packet from the sender, it sends a
negative acknowledgement (NAK) to
the sender.
• NAK requests the sender to send the
data packet again.
How Stop and Wait ARQ Solves All Problems?
The major limitation of Stop and Wait ARQ is its very less efficiency.

Limitation of Stop and Wait ARQ-


 
 
To increase the efficiency, protocols like Go back N and Selective Repeat are
used.
Sliding Window Protocols
• for reliable and sequential delivery of data frames.

• also used in Transmission Control Protocol.

• In this protocol, multiple frames can be sent by a sender at a time before


receiving an acknowledgment from the receiver.

• The term sliding window refers to the imaginary boxes to hold frames. 

• is a technique for sending multiple frames at a time.

• It controls the data packets between the two devices where reliable and
gradual delivery of data frames is needed.
Sliding Window Protocols
• Working Principle
In these protocols, the sender has a buffer called the sending window and
the receiver has buffer called the receiving window.
 The size of the sending window determines the sequence number of the outbound
frames. If the sequence number of the frames is an n-bit field, then the range of
sequence numbers that can be assigned is 0 to 2𝑛−1.
 The sequence numbers are numbered as modulo-n.
 For example, if the sending window size is 4, then the sequence numbers will be
0, 1, 2, 3, 0, 1, 2, 3, 0, 1, and so on. The number of bits in the sequence number is
2 to generate the binary sequence 00, 01, 10, 11.
The size of the receiving window is the maximum number of frames that
the receiver can accept at a time.
It determines the maximum number of frames that the sender can send
before receiving acknowledgment.
Sliding Window Protocols
• Example
• Suppose that we have sender
window and receiver window
each of size 4.
• So the sequence numbering of
both the windows will be
0,1,2,3,0,1,2 and so on.
• The following diagram shows the
positions of the windows after
sending the frames and
receiving acknowledgments.
Sliding Window Protocols
• Types of Sliding Window Protocols
The Sliding Window ARQ (Automatic Repeat reQuest)
protocols are of two categories −
Go-Back-N Automatic Repeat Request
• In Go-Back-N ARQ, the frames are numbered sequentially as Go-
Back-N ARQ sends the multiple frames at a time
• that requires the numbering approach to distinguish the frame from
another frame, and
• these numbers are known as the sequential numbers.

• The number of frames that can be sent at a time totally depends


on the size of the sender's window. 

• If the acknowledgment of a frame is not received within an


agreed-upon time period, then all the frames available in the
current window will be retransmitted.
Go-Back-N Automatic Repeat Request
• Working of Go-Back-N ARQ
• Suppose there are a sender
and a receiver, and
• let's assume that there are 11
frames to be sent.
• These frames are represented
as 0,1,2,3,4,5,6,7,8,9,10, and
these are the sequence
numbers of the frames.
• Step 1: 
• Firstly, the sender will send
the first four frames to the
receiver, i.e., 0,1,2,3, and now
the sender is expected to
receive the acknowledgment
of the 0th frame.
Go-Back-N Automatic Repeat Request
• Working of Go-Back-N ARQ
• Let's assume that the receiver has sent the acknowledgment for the
0 frame, and the receiver has successfully received it.
Go-Back-N Automatic Repeat Request
• Working of Go-Back-N ARQ
• The sender will then send the next frame, i.e., 4, and the
window slides containing four frames (1,2,3,4).
Go-Back-N Automatic Repeat Request
• Working of Go-Back-N ARQ
• The receiver will then send the acknowledgment for the
frame no 1. After receiving the acknowledgment, the
sender will send the next frame, i.e., frame no 5, and the
window will slide having four frames (2,3,4,5).
Go-Back-N Automatic Repeat Request
• Working of Go-Back-N ARQ
• Now, let's assume that the receiver is not acknowledging the frame
no 2, either the frame is lost, or the acknowledgment is lost.
• Instead of sending the frame no 6, the sender Go-Back to 2, which is
the first frame of the current window, retransmits all the frames in
the current window, i.e., 2,3,4,5.
Go-Back-N Automatic Repeat Request
• Working of Go-Back-N ARQ
• Now, let's assume that the receiver is not acknowledging the frame
no 2, either the frame is lost, or the acknowledgment is lost.
• Instead of sending the frame no 6, the sender Go-Back to 2, which is
the first frame of the current window, retransmits all the frames in
the current window, i.e., 2,3,4,5.
Go-Back-N Automatic Repeat Request
• Important points related to Go-Back-N ARQ:
• In Go-Back-N, N determines the sender's window size, and
the size of the receiver's window is always 1.
• It does not consider the corrupted frames and simply
discards them.
• It does not accept the frames which are out of order and
discards them.
• If the sender does not receive the acknowledgment, it leads
to the retransmission of all the current window frames.
Selective Repeat ARQ
• The Go-back-N ARQ protocol works well if it has fewer errors.
• But if there is a lot of error in the frame, lots of bandwidth
loss in sending the frames again. So, we use the Selective
Repeat ARQ protocol.
• In this protocol, the size of the sender window is always equal
to the size of the receiver window.
• The size of the sliding window is always greater than 1.
• If the receiver receives a corrupt frame, it does not directly
discard it.
• It sends a negative acknowledgment to the sender.
• The sender sends that frame again as soon as on the
receiving negative acknowledgment.
Selective Repeat ARQ
• Working of Selective Repeat Protocol
• The steps of data transmission can be:
1.The sender sends frames 0 and 1.
2.The receiver receives the frames and sends back ACK 0 and ACK 1.
3.Again the sender sends the frames 2 and 3.
4.The receiver only receives the frame 3. So it sends back NACK 2 which
means that the 2nd frame is lost and needs to be re-transmitted.
5.So, the sender sends back the frame 2 and this process is continued till all
the frames have been received by the receiver.
Selective Repeat ARQ
• Working of Selective Repeat Protocol
Selective Repeat ARQ
• Important Points:
• Point 1:
• In SR protocol, sender window size is always same as receiver window size.
• Point 2:
• SR protocol uses independent acknowledgements only.
• In SR protocol,
• Receiver acknowledges each frame independently.
• As receiver receives a new frame from the sender, it sends its
acknowledgement.

• Point-03: https://www.gatevidyalay.com/selective-
repeat-sliding-window-protocol/
THANK YOU!!!
Module 2
Physical Layer and Data Link Layer

Data Link Layer


Syllabus
Syllabus
Piggybacking
• In reliable full - duplex data transmission, the technique of
hooking up acknowledgments onto outgoing data frames is
called piggybacking.

• in which the outgoing acknowledgement is delayed


temporarily is called piggybacking.
Why Piggybacking?
• Communications are mostly full – duplex in nature, i.e. data
transmission occurs in both directions.
• to achieve full – duplex communication is to consider both
the communication as a pair of simplex communication.
• Each link comprises a forward channel for sending data
and a reverse channel for sending acknowledgments.
• However, in the above arrangement, traffic load doubles
for each data unit that is transmitted.
• Half of all data transmission comprise of transmission of
acknowledgments.
Why Piggybacking?
• Solution:
• that provides better utilization of bandwidth is piggybacking.
• Here, sending of acknowledgment is delayed until the next data
frame is available for transmission.
• The acknowledgment is then hooked onto the outgoing data frame.
• The data frame consists of an ack field.
• The size of the ack field is only a few bits, while an acknowledgment
frame comprises of several bytes.
• Thus, a substantial gain is obtained in reducing bandwidth
requirement.
Why Piggybacking?
• Working Principle
• Suppose that there are two communication stations X and
Y.
• The data frames transmitted have an acknowledgment
field, 
- ack field that is of a few bits length.
• Additionally, there are frames for sending
acknowledgments, ACK frames.
• The purpose is to minimize the ACK frames.
Why Piggybacking?
• Working Principle :
• The three principles governing piggybacking when the station X
wants to communicate with station Y are −
• If station X has both data and acknowledgment to send,
it sends a data frame with the ack field containing the sequence
number of the frame to be acknowledged.
• If station X has only an acknowledgment to send,
it waits for a finite period of time to see whether a data frame is
available to be sent.
If a data frame becomes available, then it piggybacks the
acknowledgment with it.
Otherwise, it sends an ACK frame.
Why Piggybacking?
• Working Principle
• The three principles governing piggybacking when the
station X wants to communicate with station Y are −

- If station X has only a data frame to send,


- it adds the last acknowledgment with it.
- The station Y discards all duplicate acknowledgments.
- Alternatively, station X may send the data frame with
the ack field containing a bit combination denoting no
acknowledgment.
Why Piggybacking?
• Example
• The diagram
illustrates the three
scenario −
HDLC - High-level Data Link Control
• High-level Data Link Control (HDLC) is a group of communication protocols
of the data link layer for transmitting data between network points or nodes.

• created by the International Organization for Standardization (ISO).

• Since it is a data link protocol, data is organized into frames.

• A frame is transmitted via the network to the destination that verifies its
successful arrival.

• It is a bit - oriented protocol that is applicable for both point - to - point and
multipoint communications.
HDLC - Transfer Modes
• HDLC supports two types of transfer modes, normal
response mode and asynchronous balanced mode.
1. Normal Response Mode (NRM) 
2. Asynchronous Balanced Mode (ABM) 

1. Normal Response Mode (NRM) −


• Here, two types of stations are there, a primary station that send
commands and secondary station that can respond to received
commands.
• It is used for both point - to - point and multipoint communications.
HDLC - Transfer Modes
1. Normal Response Mode (NRM) 
HDLC - Transfer Modes
2. Asynchronous Balanced Mode (ABM) −
• Here, the configuration is balanced, i.e. each station can both
send commands and respond to commands.
• It is used for only point - to - point communications.
HDLC - Frame
• HDLC is a bit - oriented protocol where each frame contains
up to six fields.
• The structure varies according to the type of frame.
• The fields of a HDLC frame are −
Flag − It is an 8-bit sequence that marks the beginning and the
end of the frame.
• The bit pattern of the flag is 01111110.
Address − It contains the address of the receiver.
If the frame is sent by the primary station, it contains the
address(es) of the secondary station(s).
If it is sent by the secondary station, it contains the address of the
primary station.
The address field may be from 1 byte to several bytes.
HDLC - Frame
• The fields of a HDLC frame are −
Control − It is 1 or 2 bytes containing flow and error
control information.
Payload − This carries the data from the network layer. Its
length may vary from one network to another.
FCS − It is a 2 byte or 4 bytes frame check sequence for
error detection. The standard code used is CRC (cyclic
redundancy code)
HDLC – Types of Frame
• There are three types of HDLC frames.
• The type of frame is determined by the control field of the
frame −
1. I-frame
2. S-frame
3. U-frame
• I-frame −
• I-frames or Information frames carry user data from the
network layer.
• They also include flow and error control information that is
piggybacked on user data.
• The first bit of control field of I-frame is 0.
HDLC – Types of Frame
• The type of frame is determined by the control field of the
frame −
• S-frame −
S-frames or Supervisory frames do not contain information field.
They are used for flow and error control when piggybacking is
not required.
The first two bits of control field of S-frame is 10.
• U-frame −
U-frames or Un-numbered frames are used for myriad
miscellaneous functions, like link management.
It may contain an information field, if required.
The first two bits of control field of U-frame is 11.
HDLC – Types of Frame
THANK YOU!!!

You might also like