Computer Networks
Computer Networks
o The aim of the computer network is the sharing of resources among various devices.
o In the case of computer network technology, there are several types of networks that vary
from simple to complex level.
NIC is a device that helps the computer to communicate with another device. The network interface
card contains the hardware addresses, the data-link layer protocol use this address to iden fy the
system on the network so that it transfers the data to the correct des na on.
There are two types of NIC: wireless NIC and wired NIC.
o Wireless NIC: All the modern laptops use the wireless NIC. In Wireless NIC, a connec on is
made using the antenna that employs the radio wave technology.
o Wired NIC: Cables use the wired NIC to transfer the data over the medium.
Hub
Hub is a central device that splits the network connec on into mul ple devices. When computer
requests for informa on from a computer, it sends the request to the Hub. Hub distributes this
request to all the interconnected computers.
Switches
Switch is a networking device that groups all the devices over the network to transfer the data to
another device. A switch is be er than Hub as it does not broadcast the message over the network,
i.e., it sends the message to the device for which it belongs to. Therefore, we can say that switch
sends the message directly from source to the des na on.
Cable is a transmission media that transmits the communica on signals. There are three types of
cables:
o Twisted pair cable: It is a high-speed cable that transmits the data over 1Gbps or more.
o Coaxial cable: Coaxial cable resembles like a TV installa on cable. Coaxial cable is more
expensive than twisted pair cable, but it provides the high data transmission speed.
o Fibre op c cable: Fibre op c cable is a high-speed cable that transmits the data using light
beams. It provides high data transmission speed as compared to other cables. It is more
expensive as compared to other cables, so it is installed at the government level.
Router
Router is a device that connects the LAN to the internet. The router is mainly used to connect the
dis nct networks or connect the internet to mul ple computers.
Modem
Modem connects the computer to the internet over the exis ng telephone line. A modem is not
integrated with the computer motherboard. A modem is a separate part on the PC slot found on the
motherboard.
o Resource sharing: Resource sharing is the sharing of resources such as programs, printers,
and data among the users on the network without the requirement of the physical loca on
of the resource and user.
Communication
Email: Sending and receiving electronic messages across the globe.
Instant messaging: Real-time text-based communication.
Video conferencing: Holding virtual meetings with audio and video.
Social media: Connecting and sharing information with people worldwide.
Resource Sharing
File sharing: Accessing and distributing documents, images, and other files.
Printer sharing: Multiple users printing to a single network printer.
Software sharing: Running applications from a central server.
Internet sharing: Multiple devices connecting to the internet through a single
connection.
Business Applications
E-commerce: Online shopping, banking, and financial transactions.
Supply chain management: Coordinating the flow of goods and services.
Customer relationship management (CRM): Storing and managing
customer data.
Collaboration: Team members working together on projects, regardless of
location.
Education
Online learning: Accessing courses and educational materials remotely.
Research: Sharing data and collaborating with researchers worldwide.
Virtual classrooms: Interactive online learning environments.
Entertainment
Online gaming: Playing games with people around the world.
Streaming media: Watching movies and TV shows online.
Music streaming: Listening to music on demand.
Other Applications
Healthcare: Storing and accessing patient records, remote diagnosis.
Transportation: Traffic management, vehicle tracking, and navigation
systems.
Military: Secure communication and information sharing.
Scientific research: Data analysis, simulations, and collaboration.
OSI Model
o OSI stands for Open System Interconnection is a reference model
that describes how information from a software application in
one computer moves through a physical medium to the software
application in another computer.
o OSI consists of seven layers, and each layer performs a particular
network function.
o OSI model was developed by the International Organization for
Standardization (ISO) in 1984, and it is now considered as an
architectural model for the inter-computer communications.
o OSI model divides the whole task into seven smaller and manageable
tasks. Each layer is assigned a particular task.
o Each layer is self-contained, so that task assigned to each layer can be
performed independently.
1. Physical Layer
2. Data-Link Layer
3. Network Layer
4. Transport Layer
5. Session Layer
6. Presentation Layer
7. Application Layer
1) Physical layer
2) Data-Link Layer
o This layer is responsible for the error-free transfer of data frames.
o It defines the format of the data on the network.
o It provides a reliable and efficient communication between two or
more devices.
o It is mainly responsible for the unique identification of each device
that resides on a local network.
o It contains two sub-layers:
o Logical Link Control Layer
o It is responsible for transferring the packets to the
Network layer of the receiver that is receiving.
o It identifies the address of the network layer protocol from
the header.
o It also provides flow control.
o Media Access Control Layer
o A Media access control layer is a link between the Logical
Link Control layer and the network's physical layer.
o It is used for transferring the packets over the network.
3) Network Layer
o It is a layer 3 that manages device addressing, tracks the location of
devices on the network.
o It determines the best path to move data from source to the
destination based on the network conditions, the priority of service,
and other factors.
o The Data link layer is responsible for routing and forwarding the
packets.
o Routers are the layer 3 devices, they are specified in this layer and used
to provide the routing services within an internetwork.
o The protocols used to route the network traffic are known as Network
layer protocols. Examples of protocols are IP and Ipv6.
4) Transport Layer
o The Transport layer is a Layer 4 ensures that messages are
transmitted in the order in which they are sent and there is no
duplication of data.
o The main responsibility of the transport layer is to transfer the data
completely.
o It receives the data from the upper layer and converts them into
smaller units known as segments.
o This layer can be termed as an end-to-end layer as it provides a point-
to-point connection between source and destination to deliver the
data reliably.
The two protocols used in this layer are:
5) Session Layer
6) Presentation Layer
Network Protocols
Think of protocols as the "rules of the road" for network communication. They define
how data is formatted, transmitted, received, and interpreted. Without protocols,
devices wouldn't understand each other. Here are some key aspects of network
protocols:
Syntax: The format of data, including the structure and order of bits and
bytes.
Semantics: The meaning of each section of data and the control information.
Timing: The timing of data transmission, including when data should be sent
and how fast.
Types of Network Protocols
Protocols can be categorized based on their function and the layer of the OSI model
they operate at. Here are a few important categories and examples:
Web Services: Providing access to web pages and web applications using
HTTP/HTTPS.
Email Services: Sending, receiving, and storing email using SMTP, POP3,
and IMAP.
File Sharing Services: Allowing users to access and share files stored on a
server using protocols like FTP or SMB/CIFS.
DNS Services: Translating domain names to IP addresses.
DHCP (Dynamic Host Configuration Protocol): Automatically assigning IP
addresses and other network configuration information to devices.
VPN (Virtual Private Network): Creating secure connections over a public
network like the internet.
Firewall Services: Protecting networks from unauthorized access.
Relationship between Protocols and Services
Network services rely on network protocols to function. For example, web services
use HTTP/HTTPS, email services use SMTP, POP3, and IMAP, and file sharing
services use FTP or SMB/CIFS. The protocols define the rules for communication,
while the services provide specific functions to users.
In short, protocols are the rules, and services are the applications of those rules.
They work together to make network communication possible.
Unit-II: Physical Layer and Data Link Layer
Overview of the physical layer and its func ons
The individual layer of the OSI model is a package of protocols. This article will
comprehend the physical layer of the OSI model.
The physical layer is the first and lowest layer from the bottom of the 7-layered
OSI model and delivers security to hardware. This layer is in charge of data
transmission over the physical medium. It is the most complex layer in the OSI
model.
The physical layer converts the data frame received from the data link layer into
bits, i.e., in terms of ones and zeros. It maintains the data quality by
implementing the required protocols on different network modes and
maintaining the bit rate through data transfer using a wired or wireless
medium.
1. Signals: The data is first converted to a signal for efficient data transmission.
There are two kinds of signals:
Advertisement
Physical Topology:
Physical topology refers to the specification or structure of the connections of
the network between the devices where the transmission will happen. There
are four types of topologies, which are as follows:
Star Topology:
Star topology is a sort of network topology in which each node or device in the
network is individually joined to a central node, which can be a switch or a hub.
This topology looks like a star, due to which this topology is called star topology.
Hub does not provide route data, but it transmits data to other devices
connected to it. The advantage of this topology is that if one cable fails, the
device connected to that cable is affected, and not the others.
Bus Topology:
Bus topology comprises a single communication line or cable that is connected
to each node. The backbone of this network is the central cable, and each node
can communicate with other devices through the central cable.
The signal goes from the ground terminator to the other terminator of the wire.
The terminator stops the signal once it reaches the end of the wire to avoid
signal bounce. Each computer communicates independently with other
computers in what is called a peer-to-peer network. Each computer has a
unique address, so if a message is to be sent to a specific computer, the device
can communicate directly with that computer.
The advantage of bus topology is that collapse in one device will not affect other
devices. The bus topology is not expensive to build because it uses a single wire
and works well for small networks.
Ring Topology:
In a ring topology, the devices are connected in the form of a ring so that each
device has two neighbors for communication. Data moves around the ring in
one direction.
Advertisement
As you can see below, all four devices are connected to each other in the form
of a ring. Each device has two neighbors. Node 2 and Node 4 are neighbors of
Node 1; similarly, Node 1 and Node 3 are neighbors of Node 2, and so on.
The advantage of ring topology is that if you want to add another device to the
ring, you will need an additional cable to do so. Similarly, you can remove a
device and join the wires.
Mesh Topology:
In a mesh topology, each system is directly joined to every other system. The
advantage of mesh topology is that there will be no traffic issues as each device
has a dedicated communication line. If one system is not functioning, it will not
affect other devices. It provides more security or privacy.
Advertisement
The drawback of mesh topology is that it is expensive and more complex than
other topologies.
Conclusion:
o You studied the physical layer in OSI model in this article. The physical
layer provides the hardware needed to transmit and receive bits over
a network link.
o You have studied the attributes of the physical layer, such as types of
signals used for data transmission, wired and wireless media of
transmission, rate of data flow, and noise in transmission.
o You have read about the various functions and responsibilities of the
physical layer.
o You have studied physical topologies such as star topology, bus
topology, ring topology, and mesh topology.
o Finally, you have gained knowledge about the importance of the
physical layer in the OSI model.
Transmission media and their characteris cs
1. Guided Media (Wired)
Twisted-Pair Cable:
o Description: Consists of two insulated copper wires twisted together to reduce
electromagnetic interference (EMI).
o Types:
Unshielded Twisted Pair (UTP): Commonly used in Ethernet
networks.
Shielded Twisted Pair (STP): Has a metallic shield for better EMI
protection.
o Characteristics:
Bandwidth: Moderate (up to 10 Gbps in modern implementations)
Cost: Low (UTP) to moderate (STP)
Distance: Limited (typically up to 100 meters)
Susceptibility to Interference: Moderate (UTP), low (STP)
Applications: Ethernet LANs, telephone lines
Coaxial Cable:
o Description: Has a central conductor surrounded by an insulating layer, a
metallic shield, and an outer jacket.
o Characteristics:
Bandwidth: Higher than twisted-pair
Cost: Moderate
Distance: Longer than twisted-pair
Susceptibility to Interference: Low
Applications: Cable TV, older Ethernet networks
Fiber Optic Cable:
o Description: Transmits data as light pulses through thin glass or plastic
fibers.
o Types:
Single-mode fiber: Has a smaller core and allows only one light path,
enabling long-distance transmission.
Multi-mode fiber: Has a larger core and allows multiple light paths,
suitable for shorter distances.
o Characteristics:
Bandwidth: Very high (up to terabits per second)
Cost: Higher than copper cables
Distance: Very long (up to hundreds of kilometers)
Susceptibility to Interference: Immune to EMI
Applications: Long-distance telecommunications, high-speed data
networks, submarine cables
2. Unguided Media (Wireless)
These media use electromagnetic waves to transmit data without physical cables.
Radio Waves:
o Description: Electromagnetic waves used for various wireless communication
technologies.
o Characteristics:
Frequency: Different frequency bands are used for different
applications (e.g., Wi-Fi, Bluetooth, cellular networks).
Range: Varies depending on frequency and power.
Susceptibility to Interference: Can be affected by other radio waves
and physical obstacles.
Applications: Wi-Fi, Bluetooth, cellular networks, radio and television
broadcasting
Microwaves:
o Description: High-frequency radio waves used for line-of-sight
communication.
o Types:
Terrestrial microwaves: Use ground-based antennas.
Satellite microwaves: Use satellites in orbit.
o Characteristics:
Bandwidth: High
Range: Long (especially for satellite communication)
Susceptibility to Interference: Can be affected by atmospheric
conditions and obstacles.
Applications: Long-distance communication, satellite TV, wireless
internet access
Infrared:
o Description: Uses infrared light to transmit data over short distances.
o Characteristics:
Range: Short
Susceptibility to Interference: Can be blocked by obstacles.
Applications: Remote controls, short-range wireless communication
Bandwidth: The amount of data that can be transmitted per unit of time.
Cost: The cost of the cable or wireless technology and its installation.
Distance: The maximum distance over which data can be transmitted reliably.
Susceptibility to Interference: The degree to which the medium is affected by EMI
or other types of interference.
Security: The level of security provided by the medium.
Data encoding and modulation
Digital Transmission
Data can be represented either in analog or digital form. The computers used
the digital form to store the information. Therefore, the data needs to be
converted in digital form so that it can be used by a computer.
DIGITAL-TO-DIGITAL CONVERSION
Digital-to-digital encoding is the representation of digital information by a
digital signal. When binary 1s and 0s generated by the computer are translated
into a sequence of voltage pulses that can be propagated over a wire, this
process is known as digital-to-digital encoding.
o Unipolar Encoding
o Polar Encoding
o Bipolar Encoding
Unipolar
o Digital transmission system sends the voltage pulses over the
medium link such as wire or cable.
o In most types of encoding, one voltage level represents 0, and another
voltage level represents 1.
o The polarity of each pulse determines whether it is positive or
negative.
o This type of encoding is known as Unipolar encoding as it uses only
one polarity.
o In Unipolar encoding, the polarity is assigned to the 1 binary state.
o In this, 1s are represented as a positive value and 0s are represented
as a zero value.
o In Unipolar Encoding, '1' is considered as a high voltage and '0' is
considered as a zero voltage.
o Unipolar encoding is simpler and inexpensive to implement.
Unipolar encoding has two problems that make this scheme less desirable:
o DC Component
o Synchronization
Polar
o Polar encoding is an encoding scheme that uses two voltage levels:
one is positive, and another is negative.
o By using two voltage levels, an average voltage level is reduced, and
the DC component problem of unipolar encoding scheme is
alleviated.
NRZ
o NRZ stands for Non-return zero.
o In NRZ encoding, the level of the signal can be represented either
positive or negative.
The two most common methods used in NRZ are:
NRZ-L: In NRZ-L encoding, the level of the signal depends on the type of the bit
that it represents. If a bit is 0 or 1, then their voltages will be positive and
negative respectively. Therefore, we can say that the level of the signal is
dependent on the state of the bit.
NRZ-I: NRZ-I is an inversion of the voltage level that represents 1 bit. In the NRZ-
I encoding scheme, a transition occurs between the positive and negative
voltage that represents 1 bit. In this scheme, 0 bit represents no change and 1
bit represents a change in voltage level.
RZ
o RZ stands for Return to zero.
o There must be a signal change for each bit to achieve synchronization.
However, to change with every bit, we need to have three values:
positive, negative and zero.
o RZ is an encoding scheme that provides three values, positive voltage
represents 1, the negative voltage represents 0, and zero voltage
represents none.
o In the RZ scheme, halfway through each interval, the signal returns to
zero.
o In RZ scheme, 1 bit is represented by positive-to-zero and 0 bit is
represented by negative-to-zero.
Disadvantage of RZ:
It performs two signal changes to encode one bit that acquires more
bandwidth.
Biphase
o Biphase is an encoding scheme in which signal changes at the middle
of the bit interval but does not return to zero.
Biphase encoding is implemented in two different ways:
Manchester
o It changes the signal at the middle of the bit interval but does not
return to zero for synchronization.
o In Manchester encoding, a negative-to-positive transition represents
binary 1, and positive-to-negative transition represents 0.
o Manchester has the same level of synchronization as RZ scheme
except that it has two levels of amplitude.
Differential Manchester
Bipolar
o Bipolar encoding scheme represents three voltage levels: positive,
negative, and zero.
o In Bipolar encoding scheme, zero level represents binary 0, and binary
1 is represented by alternating positive and negative voltages.
o If the first 1 bit is represented by positive amplitude, then the second
1 bit is represented by negative voltage, third 1 bit is represented by
the positive amplitude and so on. This alternation can also occur even
when the 1bits are not consecutive.
Bipolar can be classified as:
AMI
o AMI stands for alternate mark inversion where mark work comes
from telegraphy which means 1. So, it can be redefined as alternate 1
inversion.
o In Bipolar AMI encoding scheme, 0 bit is represented by zero level and
1 bit is represented by alternating positive and negative voltages.
Advantage:
o DC component is zero.
o Sequence of 1s bits are synchronized.
Disadvantage:
B8ZS
o B8ZS stands for Bipolar 8-Zero Substitution.
o This technique is adopted in North America to provide
synchronization of a long sequence of 0s bits.
o In most of the cases, the functionality of B8ZS is similar to the bipolar
AMI, but the only difference is that it provides the synchronization
when a long sequence of 0s bits occur.
o B8ZS ensures synchronization of a long string of 0s by providing force
artificial signal changes called violations, within 0 string pattern.
o When eight 0 occurs, then B8ZS implements some changes in 0s
string pattern based on the polarity of the previous 1 bit.
o If the polarity of the previous 1 bit is positive, the eight 0s will be
encoded as zero, zero, zero, positive, negative, zero, negative, positive.
o If the polarity of previous 1 bit is negative, then the eight 0s will be
encoded as zero, zero, zero, negative, positive, zero, positive, negative.
HDB3
o HDB3 stands for High-Density Bipolar 3.
o HDB3 technique was first adopted in Europe and Japan.
o HDB3 technique is designed to provide the synchronization of a long
sequence of 0s bits.
o In the HDB3 technique, the pattern of violation is based on the polarity
of the previous bit.
o When four 0s occur, HDB3 looks at the number of 1s bits occurred
since the last substitution.
o If the number of 1s bits is odd, then the violation is made on the fourth
consecutive of 0. If the polarity of the previous bit is positive, then the
violation is positive. If the polarity of the previous bit is negative, then
the violation is negative.
If the number of 1s bits since the last substitution is odd.
If the number of 1s bits is even, then the violation is made on the place of the
first and fourth consecutive 0s. If the polarity of the previous bit is positive, then
violations are negative, and if the polarity of the previous bit is negative, then
violations are positive.
ANALOG-TO-DIGITAL CONVERSION
o When an analog signal is digitalized, this is called an analog-to-digital
conversion.
o Suppose human sends a voice in the form of an analog signal, we
need to digitalize the analog signal which is less prone to noise. It
requires a reduction in the number of values in an analog message so
that they can be represented in the digital stream.
o In analog-to-digital conversion, the information contained in a
continuous wave form is converted in digital pulses.
PAM
o PAM stands for pulse amplitude modulation.
o PAM is a technique used in analog-to-digital conversion.
o PAM technique takes an analog signal, samples it, and generates a
series of digital pulses based on the result of sampling where
sampling means measuring the amplitude of a signal at equal
intervals.
o PAM technique is not useful in data communication as it translates
the original wave form into pulses, but these pulses are not digital. To
make them digital, PAM technique is modified to PCM technique.
PCM
o PCM stands for Pulse Code Modulation.
o PCM technique is used to modify the pulses created by PAM to form
a digital signal. To achieve this, PCM quantizes PAM pulses.
Quantization is a process of assigning integral values in a specific
range to sampled instances.
o PCM is made of four separate processes: PAM, quantization, binary
encoding, and digital-to-digital encoding.
PCM
Next Topic
Modulation
Applications of Modulation
Error Detection
When data is transmitted from one device to another device, the system does
not guarantee whether the data received by the device is identical to the data
transmitted by another device. An Error is a situation when the message
received at the receiver end is not identical to the message transmitted.
Types Of Errors
o Single-Bit Error
o 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.
In the above figure, the message which is sent is corrupted as single-bit, i.e., 0
bit is changed to 1.
Single-Bit Error does not appear more likely in Serial Data Transmission. For
example, Sender sends the data at 10 Mbps, this means that the bit lasts only
for 1 ?s and for a single-bit error to occurred, a noise must be more than 1 ?s.
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.
The duration of noise in Burst Error is more than the duration of noise in Single-
Bit.
Advertisement
The number of affected bits depends on the duration of the noise and data rate.
Error Detecting Techniques:
The most popular Error Detecting Techniques are:
Checksum
A Checksum is an error detection technique based on the concept of
redundancy.
Checksum Generator
A Checksum is generated at the sending side. Checksum generator subdivides
the data into equal segments of n bits each, and all these segments are added
together by using one's complement arithmetic. The sum is complemented
and appended to the original data, known as checksum field. The extended
data is transmitted across the network.
Suppose L is the total sum of the data segments, then the checksum would be
?L
Checksum Checker
A Checksum is verified at the receiving side. The receiver subdivides the
incoming data into equal segments of n bits each, and all these segments are
added together, and then this sum is complemented. If the complement of the
sum is zero, then the data is accepted otherwise data is rejected.
If the resultant of this division is not zero which means that the data consists of
an error. Therefore, the data is discarded.
Let's understand this concept through an example:
Advertisement
CRC Generator
o 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.
o Now, the string becomes 11100000, and the resultant string is divided
by the divisor 1001.
o The remainder generated from the binary division is known as CRC
remainder. The generated value of the CRC remainder is 111.
o CRC remainder replaces the appended string of 0s at the end of the
data unit, and the final string would be 11100111 which is sent across
the network.
CRC Checker
o The functionality of the CRC checker is similar to the CRC generator.
o When the string 11100111 is received at the receiving end, then CRC
checker performs the modulo-2 division.
o A string is divided by the same divisor, i.e., 1001.
o In this case, CRC checker generates the remainder of zero. Therefore,
the data is accepted.
Error Correction
Error correction techniques allow the receiver to not only detect errors but also to correct
them without requiring retransmission. This is particularly useful in situations where
retransmission is not feasible or efficient, such as in wireless communication or real-time
applications. Here are some common error correction methods:
Hamming Code:
o Adds redundant bits to the data that can be used to identify the location of a
single-bit error and correct it.
o Uses the concept of Hamming distance to determine the number of bit
differences between valid code words.
Forward Error Correction (FEC):
o A general term for error correction techniques that allow the receiver to
correct errors without retransmission.
o Includes various codes like Reed-Solomon codes, Turbo codes, and Low-
Density Parity-Check (LDPC) codes.
o These codes are more complex than Hamming codes but can correct multiple
errors.
Key Considerations
The choice of error detection or correction technique depends on factors such as the
error rate of the channel, the cost of retransmission, and the acceptable level of
overhead.
Error correction techniques generally have higher overhead than error detection
techniques, as they require more redundant information to be transmitted.
In many cases, a combination of error detection and correction is used. For example,
CRC might be used for error detection, and if an error is detected, a retransmission is
requested.
o Framing & Link access: Data Link Layer protocols encapsulate each
network frame within a Link layer frame before the transmission
across the link. A frame consists of a data field in which network layer
datagram is inserted and a number of data fields. It specifies the
structure of the frame as well as a channel access protocol by which
frame is to be transmitted over the link.
o Reliable delivery: Data Link Layer provides a reliable delivery service,
i.e., transmits the network layer datagram without any error. A reliable
delivery service is accomplished with transmissions and
acknowledgements. A data link layer mainly provides the reliable
delivery service over the links as they have higher error rates and they
can be corrected locally, link at which an error occurs rather than
forcing to retransmit the data.
o Flow control: A receiving node can receive the frames at a faster rate
than it can process the frame. Without flow control, the receiver's
buffer can overflow, and frames can get lost. To overcome this
problem, the data link layer uses the flow control to prevent the
sending node on one side of the link from overwhelming the receiving
node on another side of the link.
o Error detection: Errors can be introduced by signal attenuation and
noise. Data Link Layer protocol provides a mechanism to detect one
or more errors. This is achieved by adding error detection bits in the
frame and then receiving node can perform an error check.
o Error correction: Error correction is similar to the Error detection,
except that receiving node not only detect the errors but also
determine where the errors have occurred in the frame.
o Half-Duplex & Full-Duplex: In a Full-Duplex mode, both the nodes
can transmit the data at the same time. In a Half-Duplex mode, only
one node can transmit the data at the same time.
Framing, flow control, and error control in data link layer protocols
Framing
Data-link layer takes the packets from the Network Layer and encapsulates
them into frames. If the frame size becomes too large, then the packet may
be divided into small sized frames. Smaller sized frames makes flow control
and error control more efficient.
Then, it sends each frame bit-by-bit on the hardware. At receiver's end, data
link layer picks up signals from hardware and assembles them into frames.
Parts of a Frame
A frame has the following parts −
Types of Framing
Framing can be of two types, fixed sized framing and variable sized framing.
Fixed-sized Framing
Here the size of the frame is fixed and so the frame length acts as delimiter
of the frame. Consequently, it does not require additional boundary bits to
identify the start and end of the frame.
Length Field − Here, a length field is used that determines the size of the
frame. It is used in Ethernet (IEEE 802.3).
End Delimiter − Here, a pattern is used as a delimiter to determine the
size of frame. It is used in Token Rings. If the pattern occurs in the
message, then two approaches are used to avoid the situation −
o Byte – Stuffing − A byte is stuffed in the message to differentiate
from the delimiter. This is also called character-oriented framing.
o Bit – Stuffing − A pattern of bits of arbitrary length is stuffed in the
message to differentiate from the delimiter. This is also called bit
– oriented framing.
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.
Two methods have been developed to control the flow of data:
o Stop-and-wait
o Sliding window
Stop-and-wait
Disadvantage of Stop-and-wait
Sliding Window
the next four frames. Therefore, the sender window contains six
frames (5,6,7,0,1,2).
Receiver Window
Error Control
Error Control is a technique of error detection and retransmission.
This technique works on the principle that the sender will not transmit the next
frame until it receives the acknowledgement of the last transmitted frame.
o The sending device keeps a copy of the last transmitted frame until
the acknowledgement is received. Keeping the copy allows the
sender to retransmit the data if the frame is not received correctly.
o Both the data frames and the ACK frames are numbered alternately
0 and 1 so that they can be identified individually. Suppose data 1
frame acknowledges the data 0 frame means that the data 0 frame
has been arrived correctly and expects to receive data 1 frame.
o If an error occurs in the last transmitted frame, then the receiver sends
the NAK frame which is not numbered. On receiving the NAK frame,
sender retransmits the data.
o It works with the timer. If the acknowledgement is not received within
the allotted time, then the sender assumes that the frame is lost
during the transmission, so it will retransmit the frame.
Two possibilities of the retransmission:
o In this case, the sender keeps the copies of all the transmitted frames
until they have been acknowledged. Suppose the frames from 0
through 4 have been transmitted, and the last acknowledgement
was for frame 2, the sender has to keep the copies of frames 3 and 4
until they receive correctly.
o The receiver can send either NAK or ACK depending on the
conditions. The NAK frame tells the sender that the data have been
received damaged. Since the sliding window is a continuous
transmission mechanism, both ACK and NAK must be numbered for
the identification of a frame. The ACK frame consists of a number that
represents the next frame which the receiver expects to receive. The
NAK frame consists of a number that represents the damaged frame.
o The sliding window ARQ is equipped with the timer to handle the lost
acknowledgements. Suppose then n-1 frames have been sent before
receiving any acknowledgement. The sender waits for the
acknowledgement, so it starts the timer and waits before sending any
more. If the allotted time runs out, the sender retransmits one or all
the frames depending upon the protocol used.
Two protocols used in sliding window ARQ:
o Lost Data Frame: In Sliding window protocols, data frames are sent
sequentially. If any of the frames is lost, then the next frame arrive at
the receiver is out of sequence. The receiver checks the sequence
number of each of the frame, discovers the frame that has been
skipped, and returns the NAK for the missing frame. The sending
device retransmits the frame indicated by NAK as well as the frames
transmitted after the lost frame.
o Lost Acknowledgement: The sender can send as many frames as the
windows allow before waiting for any acknowledgement. Once the
limit of the window is reached, the sender has no more frames to
send; it must wait for the acknowledgement. If the acknowledgement
is lost, then the sender could wait forever. To avoid such situation, the
sender is equipped with the timer that starts counting whenever the
window capacity is reached. If the acknowledgement has not been
received within the time limit, then the sender retransmits the frame
since the last ACK.
Selective-Reject ARQ
Network Layer
o The Network Layer is the third layer of the OSI model.
o It handles the service requests from the transport layer and further
forwards the service request to the data link layer.
o The network layer translates the logical addresses into physical
addresses
o It determines the route from the source to the destination and also
manages the traffic problems such as switching, routing and controls
the congestion of data packets.
o The main role of the network layer is to move the packets from
sending host to the receiving host.
You're diving into a core aspect of networking! Routing algorithms and protocols are
essential for directing data packets across networks, ensuring they reach their
intended destinations efficiently. Let's break down the key concepts:
Routing Algorithms
Routing algorithms are the "brains" behind the routing process. They are sets of
rules and procedures that routers use to determine the best path for data packets to
travel from source to destination. The "best" path is usually defined as the path with
the lowest cost, which can be based on factors like:
Routing protocols are the "languages" that routers use to communicate routing
information with each other. They define the format of routing messages, the rules
for exchanging these messages, and the algorithms used to make routing decisions.
Here are some key routing protocols:
What is IP?
An IP stands for internet protocol. An IP address is assigned to each device
connected to a network. Each device uses an IP address for communication. It
also behaves as an identifier as this address is used to identify the device on a
network. It defines the technical format of the packets. Mainly, both the
networks, i.e., IP and TCP, are combined together, so together, they are referred
to as a TCP/IP. It creates a virtual connection between the source and the
destination.
An IP address consists of two parts, i.e., the first one is a network address, and
the other one is a host address.
What is IPv4?
IPv4 is a version 4 of IP. It is a current version and the most commonly used IP
address. It is a 32-bit address written in four numbers separated by 'dot', i.e.,
periods. This address is unique for each device.
For example, 66.94.29.13
The above example represents the IP address in which each group of numbers
separated by periods is called an Octet. Each number in an octet is in the range
from 0-255. This address can produce 4,294,967,296 possible unique addresses.
Each bit in an octet can be either 1 or 0. If the bit the 1, then the number it
represents will count, and if the bit is 0, then the number it represents does not
count.
Now, we will see how to obtain the binary representation of the above IP
address, i.e., 66.94.29.13
To obtain 94, we put 1 under 64, 16, 8, 4, and 2 as the sum of these numbers is
equal to 94, and the remaining bits will be zero. Therefore, the binary bit version
of 94 is 01011110.
To obtain 13, we put 1 under 8, 4, and 1 as the sum of these numbers is equal to
13, and the remaining bits will be zero. Therefore, the binary bit version of 13 is
00001101.
Drawback of IPv4
Currently, the population of the world is 7.6 billion. Every user is having more
than one device connected with the internet, and private companies also rely
on the internet. As we know that IPv4 produces 4 billion addresses, which are
not enough for each device connected to the internet on a planet. Although
the various techniques were invented, such as variable- length mask, network
address translation, port address translation, classes, inter-domain translation,
to conserve the bandwidth of IP address and slow down the depletion of an IP
address. In these techniques, public IP is converted into a private IP due to
which the user having public IP can also use the internet. But still, this was not
so efficient, so it gave rise to the development of the next generation of IP
addresses, i.e., IPv6.
What is IPv6?
IPv4 produces 4 billion addresses, and the developers think that these
addresses are enough, but they were wrong. IPv6 is the next generation of IP
addresses. The main difference between IPv4 and IPv6 is the address size of IP
addresses. The IPv4 is a 32-bit address, whereas IPv6 is a 128-bit hexadecimal
address. IPv6 provides a large address space, and it contains a simple header
as compared to IPv4.
Advertisement
It provides transition strategies that convert IPv4 into IPv6, and these strategies
are as follows:
o Dual stacking: It allows us to have both the versions, i.e., IPv4 and
IPv6, on the same device.
o Tunneling: In this approach, all the users have IPv6 communicates
with an IPv4 network to reach IPv6.
o Network Address Translation: The translation allows the
communication between the hosts having a different version of IP.
This hexadecimal address contains both numbers and alphabets. Due to the
usage of both the numbers and alphabets, IPv6 is capable of producing over
340 undecillion (3.4*1038) addresses.
Address format
The address format of IPv4:
The above diagram shows the address format of IPv4 and IPv6. An IPv4 is a 32-
bit decimal address. It contains 4 octets or fields separated by 'dot', and each
field is 8-bit in size. The number that each field contains should be in the range
of 0-255. Whereas an IPv6 is a 128-bit hexadecimal address. It contains 8 fields
separated by a colon, and each field is 16-bit in size.
It generates 340
It generates 4 billion
Address space undecillion unique
unique addresses
addresses.
In IPv6, the
In IPv4, the IP address is
Address representation representation of the IP
represented in decimal.
address in hexadecimal.
Fragmentation is done by
Fragmentation is done by
Fragmentation the senders and the
the senders only.
forwarding routers.
Transport Layer
o The transport layer is a 4th layer from the top.
o The main role of the transport layer is to provide the communication
services directly to the application processes running on different
hosts.
o The transport layer provides a logical communication between
application processes running on different hosts. Although the
application processes on different hosts are not physically connected,
application processes use the logical communication provided by the
transport layer to send the messages to each other.
o The transport layer protocols are implemented in the end systems but
not in the network routers.
o A computer network provides more than one protocol to the network
applications. For example, TCP and UDP are two transport layer
protocols that provide a different set of services to the network layer.
o All transport layer protocols provide multiplexing/demultiplexing
service. It also provides other services such as reliable data transfer,
bandwidth guarantees, and delay guarantees.
o Each of the applications in the application layer has the ability to send
a message by using TCP or UDP. The application communicates by
using either of these two protocols. Both TCP and UDP will then
communicate with the internet protocol in the internet layer. The
applications can read and write to the transport layer. Therefore, we
can say that communication is a two-way process.
Services provided by the Transport Layer
The services provided by the transport layer are similar to those of the data link
layer. The data link layer provides the services within a single network while the
transport layer provides the services across an internetwork made up of many
networks. The data link layer controls the physical layer while the transport
layer controls all the lower layers.
The services provided by the transport layer protocols can be divided into
five categories:
o End-to-end delivery
o Addressing
o Reliable delivery
o Flow control
o Multiplexing
End-to-end delivery:
The transport layer transmits the entire message to the destination. Therefore,
it ensures the end-to-end delivery of an entire message from a source to the
destination.
Reliable delivery:
The transport layer provides reliability services by retransmitting the lost and
damaged packets.
o Error control
o Sequence control
o Loss control
o Duplication control
Error Control
Loss Control is a third aspect of reliability. The transport layer ensures that all
the fragments of a transmission arrive at the destination, not some of them. On
the sending end, all the fragments of transmission are given sequence
numbers by a transport layer. These sequence numbers allow the receiver?s
transport layer to identify the missing segment.
Duplication Control
Flow Control
Flow control is used to prevent the sender from overwhelming the receiver. If
the receiver is overloaded with too much data, then the receiver discards the
packets and asking for the retransmission of packets. This increases network
congestion and thus, reducing the system performance. The transport layer is
responsible for flow control. It uses the sliding window protocol that makes the
data transmission more efficient as well as it controls the flow of data so that
the receiver does not become overwhelmed. Sliding window protocol is byte
oriented rather than frame oriented.
Multiplexing
The transport layer uses the multiplexing to improve transmission efficiency.
Receiving Side: On receiving data from the channel, RDT simply accepts
data via the rdt_rcv(data) event. Then it extracts the data from the packet
(via the extract(packet, data)) and sends the data to the application layer
using the deliver_data(data) event.
RDT1.0: Receiving Side FSM
Features of TCP
The following are the features of the TCP:
o Data delivery
TCP protocol ensures that the data is received correctly, no data is
missing and in order. If TCP protocol is not used, then the incorrect
data can be received or out of order. For example, if we try to view the
web page or download a file without using TCP, then some data or
images could be missing.
o Protocol
TCP is a connection-oriented protocol. Through the
word connection-oriented, we understand that the computers first
establish a connection and then do the communication. This is done
by using a three-way handshake. In a three-way handshake, the first
sender sends the SYN message to the receiver then the receiver sends
back the SYN ACK message to confirm that the message has been
received. After receiving the SYN ACK message, the sender sends the
acknowledgment message to the receiver. In this way, the connection
is established between the computers. Once the connection is
established, the data will be delivered. This protocol guarantees the
data delivery means that if the data is not received then the TCP will
resend the data.
What is UDP?
The UDP stands for User Datagram Protocol. Its working is similar to the TCP
as it is also used for sending and receiving the message. The main difference is
that UDP is a connectionless protocol. Here, connectionless means that no
connection establishes prior to communication. It also does not guarantee the
delivery of data packets. It does not even care whether the data has been
received on the receiver's end or not, so it is also known as the "fire-and-forget"
protocol. It is also known as the "fire-and-forget" protocol as it sends the data
and does not care whether the data is received or not. UDP is faster than TCP
as it does not provide the assurance for the delivery of the packets.
TCP UDP
It is a connection- It is a connectionless
Type of connection oriented protocol, which protocol, which means
means that the that it sends the data
connection needs to be without checking
established before the whether the system is
data is transmitted over ready to receive or not.
the network.
Application Layer
The application layer in the OSI model is the closest layer to the end user which
means that the application layer and end user can interact directly with the
software application. The application layer programs are based on client and
servers.
The device which is in the network can communicate with each other. There
are two types of network types one is peer-to-peer, and another is client-server.
In a client-server network, many clients can connect to a server. The clients
need services, and the server offers needed services. However, in a peer-to-peer
network, we don't have any clients or servers. Instead, all nodes can act as
clients or servers. In other words, every node can request services and deliver
services.
In a client-server network, the client requests services from the server. The
server reacts to client requests by rendering the necessary service after
listening to their queries. A client-server network's key benefit is that it is safer
because the server constantly controls access and security. Additionally,
making backups is simpler. However, it is not very dependable because a server
failure will impair the clients' ability to work. Additionally, the setup and
maintenance costs are high.
o The client-server network offers a good user interface, and can handle
files easily.
o In a client-server network, we can share the resources easily.
o Users have the freedom to access files stored in the central storage
from any location.
o The client-server network has complete control over all network
processes and activities because it is a centralised network.
Peer-to-Peer Network
This model does not distinguish between clients and servers; each node acts as
both a client and server. Every node in a peer-to-peer network has the ability
to request and provide service. A node is also called a peer.
The local area network (LAN), which is typically preferred by small workplaces
for the purpose of resource sharing, is another frequently used example of the
peer-to-peer network.
A Client-Server network
A Peer-to-Peer is less
Expense is more expensive to
expensive to implement.
implement.
It is less
It is more
stable and scalable, if the
Stability stable and scalable than
number of peers
a peer-to-peer network.
increases in the system.
In a client-server network, In a peer-to-peer network,
Data the data is stored in a each peer has its own
centralized server. data.
A server is not
A server may get
bottlenecked since the
overloaded when many
services are dispersed
Server customers make
among numerous servers
simultaneous service
using a peer-to-peer
requests.
network.
A Client-Server network is
a secured network The network's security
because the server can deteriorates, and its
Security
verify a client's access to susceptibility grows as
any area of the network, the number of peers rises.
making it secure.
Threats
These are malicious actions that exploit vulnerabilities to cause harm to a network or
its data.
kept secret.
o Slower than symmetric encryption.
o Solves the key distribution problem.
o Examples: RSA
Transposition Ciphers:
o Rearrange the order of characters in the plaintext.
o Example: Rail Fence cipher (writes the plaintext diagonally and then
reads it row by row).
Modern Ciphers:
o Use complex mathematical operations and multiple rounds of
transformations.
o Examples:
AES (Advanced Encryption Standard): A widely used
symmetric block cipher.
RSA: A widely used asymmetric cipher.
4. Cryptographic Hash Functions
Purpose: Create a fixed-size "fingerprint" (hash value) of a message or data.
Characteristics:
o One-way function: It's computationally infeasible to reverse the hash
function to get the original data.
o Deterministic: The same input always produces the same hash value.
o Collision-resistant: It's computationally infeasible to find two different
inputs that produce the same hash value.
Examples: SHA-256, MD5
5. Digital Signatures
Purpose: Provide authentication and non-repudiation.
How it works:
o The sender uses their private key to encrypt a hash of the message,
creating a digital signature.
o The receiver uses the sender's public key to decrypt the signature and
verify the message's authenticity and integrity.
Cryptography and encryption are essential tools for protecting sensitive information
in today's digital world. They are used in various applications, including secure
communication, data storage, and authentication.