CN notes
CN notes
OSI stands for Open Systems Interconnection, where open stands to say non-
proprietary. It is a 7-layer architecture with each layer having specific functionality to
perform. All these 7 layers work collaboratively to transmit the data from one person to
another across the globe. The OSI reference model was developed by ISO –
‘International Organization for Standardization‘, in the year 1984.
The OSI model provides a theoretical foundation for understanding network
communication. However, it is usually not directly implemented in its entirety in real-
world networking hardware or software. Instead, specific
protocols and technologies are often designed based on the principles outlined in
the OSI model to facilitate efficient data transmission and networking operations
Note:
Packet in the Data Link layer is referred to as Frame.
Data Link layer is handled by the NIC (Network Interface Card) and device drivers
of host machines.
Switch & Bridge are Data Link Layer devices.
Example
Let us consider a scenario where a user wants to send a message through some
Messenger application running in their browser. The “Messenger” here acts as the
application layer which provides the user with an interface to create the data. This
message or so-called Data is compressed, optionally encrypted (if the data is sensitive),
and converted into bits (0’s and 1’s) so that it can be transmitted.
Helps in
identifying the
Application
client and Message SMTP
Layer
synchronizing
7 communication.
Information
Layer Layer Form (Data
No Name Responsibility Unit) Device or Protocol
Establishes
Connection,
Message
Maintenance,
Session (or
Ensures Gateway
Layer encrypted
Authentication
message)
and Ensures
5 security.
Take Service
from Network
Transport Layer and
Segment Firewall
Layer provide it to the
Application
4 Layer.
Transmission
of data from
one host to
Network
another, Packet Router
Layer
located in
different
3 networks.
Node to Node
Data Link
Delivery of Frame Switch, Bridge
Layer
2 Message.
Information
Layer Layer Form (Data
No Name Responsibility Unit) Device or Protocol
Establishing
Physical
Physical Hub, Repeater, Modem,
Connections Bits
Layer Cables
between
1 Devices.
OSI vs TCP/IP
Advantages of OSI Model
The OSI Model defines the communication of a computing system into 7 different layers.
Its advantages include:
It divides network communication into 7 layers which makes it easier to understand
and troubleshoot.
It standardizes network communications, as each layer has fixed functions and
protocols.
Diagnosing network problems is easier with the OSI model.
It is easier to improve with advancements as each layer can get updates
separately.
Disadvantages of OSI Model
Complexity: The OSI Model has seven layers, which can be complicated and hard
to understand for beginners.
Not Practical: In real-life networking, most systems use a simpler model called the
Internet protocol suite (TCP/IP), so the OSI Model isn’t always directly applicable.
Slow Adoption: When it was introduced, the OSI Model was not quickly adopted
by the industry, which preferred the simpler and already-established TCP/IP model.
Overhead: Each layer in the OSI Model adds its own set of rules and operations,
which can make the process more time-consuming and less efficient.
Theoretical: The OSI Model is more of a theoretical framework, meaning it’s great
for understanding concepts but not always practical for implementation.
2. TCP and UDP
TCP UDP
Full form It stands It stands for User
for Transmission Control Datagram Protocol.
Protocol.
Type of connection It is a connection- It is a connectionless
oriented protocol, which protocol, which means
means that the that it sends the data
connection needs to be without checking whether
established before the the system is ready to
data is transmitted over receive or not.
the network.
Reliable TCP is a reliable protocol UDP is an unreliable
as it provides assurance protocol as it does not
for the delivery of data take the guarantee for the
packets. delivery of packets.
Speed TCP is slower than UDP as UDP is faster than TCP as
it performs error it does not guarantee the
checking, flow control, delivery of data packets.
and provides assurance
for the delivery of data
packets
Header size The size of TCP is 20 The size of the UDP is 8
bytes. bytes.
Acknowledgment TCP uses the three-way- UDP does not wait for any
handshake concept. In acknowledgment; it just
this concept, if the sender sends the data.
receives the ACK, then the
sender will send the data.
TCP also has the ability to
resend the lost data.
Flow control mechanism It follows the flow control This protocol follows no
mechanism in which too such mechanism.
many packets cannot be
sent to the receiver at the
same time.
Error checking TCP performs error It does not perform any
checking by using a error checking, and also
checksum. When the data does not resend the lost
is corrected, then the data data packets.
is retransmitted to the
receiver.
Applications This protocol is mainly This protocol is used
used where a secure and where fast
reliable communication communication is
process is required, like required and does not
military services, web care about the reliability
browsing, and e-mail. like VoIP, game
streaming, video and
music streaming, etc.
NETWORK PROTOCOLS
A network protocol is a set of rules that govern data communication between different
devices in the network. It determines what is being communicated, how it is being
communicated, and when it is being communicated. It permits connected devices to
communicate with each other, irrespective of internal and structural differences.
It is essential to understand how devices communicate over a network by recognizing
network protocols. The Open Systems Interconnection (OSI), the most widely used
model, illustrates how computer systems interact with one another over a network. The
communication mechanism between two network devices is shown by seven different
layers in the OSI model. Every layer in the OSI model works based on different network
protocols. At every layer, one or more protocols are there for network communication.
To enable network-to-network connections, the Internet Protocol (IP), for instance,
routes data by controlling information like the source and destination addresses of data
packets. It is known as a network layer protocol.
Types of Network Protocols
In most cases, communication across a network like the Internet uses the OSI model.
The OSI model has a total of seven layers. Secured connections, network management,
and network communication are the three main tasks that the network
protocol performs. The purpose of protocols is to link different devices.
The protocols can be broadly classified into three major categories:
Network Communication
Network Management
Network Security
1. Network Communication
Communication protocols are really important for the functioning of a network. They are
so crucial that it is not possible to have computer networks without them. These
protocols formally set out the rules and formats through which data is transferred. These
protocols handle syntax, semantics, error detection, synchronization, and
authentication. Below mentioned are some network communication protocol:
Hypertext Transfer Protocol(HTTP)
It is a layer 7 protocol that is designed for transferring a hypertext between two or more
systems. HTTP works on a client-server model, most of the data sharing over the web
is done through using HTTP.
Transmission Control Protocol(TCP)
TCP layouts a reliable stream delivery by using sequenced acknowledgment. It is
a connection-oriented protocol i.e., it establishes a connection between applications
before sending any data. It is used for communicating over a network. It has many
applications such as emails, FTP, streaming media, etc.
User Datagram Protocol(UDP)
It is a connectionless protocol that lay-out a basic but unreliable message service. It
adds no flow control, reliability, or error-recovery functions. UPD is functional in cases
where reliability is not required. It is used when we want faster transmission,
for multicasting and broadcasting connections, etc.
Border Gateway Protocol(BGP)
BGP is a routing protocol that controls how packets pass through the router in an
independent system one or more networks run by a single organization and connect to
different networks. It connects the endpoints of a LAN with other LANs and it also
connects endpoints in different LANs to one another.
Address Resolution Protocol(ARP)
ARP is a protocol that helps in mapping logical addresses to the physical addresses
acknowledged in a local network. For mapping and maintaining a correlation between
these logical and physical addresses a table known as ARP cache is used.
Internet Protocol(IP)
It is a protocol through which data is sent from one host to another over the internet. It
is used for addressing and routing data packets so that they can reach their destination.
Dynamic Host Configuration Protocol(DHCP)
it’s a protocol for network management and it’s used for the method of automating the
process of configuring devices on IP networks. A DHCP server automatically assigns
an IP address and various other configurational changes to devices on a network so
they can communicate with other IP networks. it also allows devices to use various
services such as NTP, DNS, or any other protocol based on TCP or UDP.
2. Network Management
These protocols assist in describing the procedures and policies that are used in
monitoring, maintaining, and managing the computer network. These protocols also
help in communicating these requirements across the network to ensure stable
communication. Network management protocols can also be used
for troubleshooting connections between a host and a client.
Internet Control Message Protocol(ICMP)
It is a layer 3 protocol that is used by network devices to forward operational information
and error messages. ICMP is used for reporting congestions, network errors, diagnostic
purposes, and timeouts.
Simple Network Management Protocol(SNMP)
It is a layer 7 protocol that is used for managing nodes on an IP network. There are
three main components in the SNMP protocol i.e., SNMP agent, SNMP manager, and
managed device. SNMP agent has the local knowledge of management details, it
translates those details into a form that is compatible with the SNMP manager. The
manager presents data acquired from SNMP agents, thus helping in monitoring network
glitches, and network performance, and troubleshooting them.
Gopher
It is a type of file retrieval protocol that provides downloadable files with some
description for easy management, retrieving, and searching of files. All the files are
arranged on a remote computer in a stratified manner. Gopher is an old protocol and it
is not much used nowadays.
File Transfer Protocol(FTP)
FTP is a Client/server protocol that is used for moving files to or from a host computer,
it allows users to download files, programs, web pages, and other things that are
available on other services.
Post Office Protocol(POP3)
It is a protocol that a local mail client uses to get email messages from a remote email
server over a TCP/IP connection. Email servers hosted by ISPs also use
the POP3 protocol to hold and receive emails intended for their users. Eventually, these
users will use email client software to look at their mailbox on the remote server and to
download their emails. After the email client downloads the emails, they are generally
deleted from the servers.
Telnet
It is a protocol that allows the user to connect to a remote computer program and to use
it i.e., it is designed for remote connectivity. Telnet creates a connection between a host
machine and a remote endpoint to enable a remote session.
3. Network Security
These protocols secure the data in passage over a network. These protocols also
determine how the network secures data from any unauthorized attempts to extract or
review data. These protocols make sure that no unauthorized devices, users, or
services can access the network data. Primarily, these protocols depend on encryption
to secure data.
Secure Socket Layer(SSL)
It is a network security protocol mainly used for protecting sensitive data and securing
internet connections. SSL allows both server-to-server and client-to-server
communication. All the data transferred through SSL is encrypted thus stopping any
unauthorized person from accessing it.
Hypertext Transfer Protocol(HTTPS)
It is the secured version of HTTP. this protocol ensures secure communication between
two computers where one sends the request through the browser and the other fetches
the data from the web server.
Transport Layer Security(TLS)
It is a security protocol designed for data security and privacy over the internet, its
functionality is encryption, checking the integrity of data i.e., whether it has been
tampered with or not, and authentication. It is generally used for encrypted
communication between servers and web apps, like a web browser loading a website,
it can also be used for encryption of messages, emails, and VoIP.
Some Other Protocols
Internet Message Access Protocol (IMAP)
ICMP protocol is used to retrieve message from the mail server. By using ICMP
mail user can view and manage mails on his system.
Session Initiation Protocol (SIP)
SIP is used in video, voice, and messaging application. This protocol is used to
initiating, Managing, Terminating the session between two users while they are
communicating.
Real-Time Transport Protocol (RTP)
This protocol is used to forward audio, video over IP network. This protocol is used
with SIP protocol to send audio, video at real-time.
Rout Access Protocol (RAP)
RAP is used in network management. It helps to user for accessing the nearest
router for communication. RAP is less efficient as compared to SNMP.
Point To Point Tunnelling Protocol (PPTP)
It is used to implement VPN ( Virtual Private Network ). PPTP protocol append
PPP frame in IP datagram for transmission through IP based network.
Trivial File Transfer Protocol (TFTP)
TFTP is the simplified version of FTP. TFTP is also used to transfer file over
internet
Resource Location Protocol (RLP)
RLP is used to assign the resource such as server, printer, or other devices over
the internet to the user. It is used to locate the resource to the client for broadcast
query.
IP Security
IPSec refers to a collection of communication rules or protocols used to establish
secure network connections. Internet Protocol (IP) is the common standard that
controls how data is transmitted across the internet. IPSec enhances the protocol’s
security by introducing encryption and authentication. For example, it encrypts data at
the source and then decrypts it at the destination. It also verifies the source of the
data.
Uses of IP Security
IPsec can be used to do the following things:
To encrypt application layer data.
To provide security for routers sending routing data across the public internet.
To provide authentication without encryption, like to authenticate that the data
originates from a known sender.
To protect network data by setting up circuits using IPsec tunneling in which all
data being sent between the two endpoints is encrypted, as with a Virtual Private
Network(VPN) connection.
What is IPSec Encyrption?
IPSec encryption is a software function that encrypts data to protect it from unauthorized
access. An encryption key encrypts data, which must be decrypted. IPSec supports a
variety of encryption algorithms, including AES, Blowfish, Triple DES, ChaCha, and
DES-CBC. IPSec combines asymmetric and symmetric encryption to provide both
speed and security during data transmission. In asymmetric encryption, the encryption
key is made public, while the decryption key remains private. Symmetric encryption
employs the same public key to encrypt and decrypts data. IPSec builds a secure
connection using asymmetric encryption and then switches to symmetric encryption to
speed up data transmission.
Components of IP Security
It has the following components:
Encapsulating Security Payload (ESP)
Authentication Header (AH)
Internet Key Exchange (IKE)
1. Encapsulating Security Payload (ESP): It provides data integrity, encryption,
authentication, and anti-replay. It also provides authentication for payload.
2. Authentication Header (AH): It also provides data integrity, authentication, and anti-
replay and it does not provide encryption. The anti-replay protection protects against
the unauthorized transmission of packets. It does not protect data confidentiality.
IP Header
IP Security Architecture
IPSec (IP Security) architecture uses two protocols to secure the traffic or data flow.
These protocols are ESP (Encapsulation Security Payload) and AH (Authentication
Header). IPSec Architecture includes protocols, algorithms, DOI, and Key Management.
All these components are very important in order to provide the three main services:
Confidentiality
Authenticity
Integrity
IP Security Architecture
Working on IP Security
The host checks if the packet should be transmitted using IPsec or not. This packet
traffic triggers the security policy for itself. This is done when the system sending
the packet applies appropriate encryption. The incoming packets are also checked
by the host that they are encrypted properly or not.
Then IKE Phase 1 starts in which the 2 hosts( using IPsec ) authenticate
themselves to each other to start a secure channel. It has 2 modes. The Main
mode provides greater security and the Aggressive mode which enables the host
to establish an IPsec circuit more quickly.
The channel created in the last step is then used to securely negotiate the way the
IP circuit will encrypt data across the IP circuit.
Now, the IKE Phase 2 is conducted over the secure channel in which the two hosts
negotiate the type of cryptographic algorithms to use on the session and agree on
secret keying material to be used with those algorithms.
Then the data is exchanged across the newly created IPsec encrypted tunnel.
These packets are encrypted and decrypted by the hosts using IPsec SAs.
When the communication between the hosts is completed or the session times out
then the IPsec tunnel is terminated by discarding the keys by both hosts.
What are IPSec modes?
Tunnel: The IPSec tunnel mode is appropriate for sending data over public
networks because it improves data security against unauthorised parties. The
computer encrypts all data, including the payload and header, and adds a new
header to it.
Transport: IPSec transport mode encrypts only the data packet’s payload while
leaving the IP header unchanged. The unencrypted packet header
enables routers to determine the destination address of each data packet. As a
result, IPSec transport is utilized in a closed and trusted network, such as to
secure a direct link between two computers.
Features of IPSec
Authentication: IPSec provides authentication of IP packets using digital
signatures or shared secrets. This helps ensure that the packets are not tampered
with or forged.
Confidentiality: IPSec provides confidentiality by encrypting IP packets,
preventing eavesdropping on the network traffic.
Integrity: IPSec provides integrity by ensuring that IP packets have not been
modified or corrupted during transmission.
Key management: IPSec provides key management services, including key
exchange and key revocation, to ensure that cryptographic keys are securely
managed.
Tunneling: IPSec supports tunneling, allowing IP packets to be encapsulated
within another protocol, such as GRE (Generic Routing Encapsulation) or L2TP
(Layer 2 Tunneling Protocol).
Flexibility: IPSec can be configured to provide security for a wide range of
network topologies, including point-to-point, site-to-site, and remote access
connections.
Interoperability: IPSec is an open standard protocol, which means that it is
supported by a wide range of vendors and can be used in heterogeneous
environments.
What is IPSec VPN?
VPN, or virtual private network, is a networking software that enables users to browse
the internet anonymously and securely. An IPSec VPN is a type of VPN software that
uses the IPSec protocol to establish encrypted tunnels over the internet. It offers end-
to-end encryption, which means that data is broken down at the computer and then
collected at the receiving server.
Advantages of IPSec
Strong security: IPSec provides strong cryptographic security services that help
protect sensitive data and ensure network privacy and integrity.
Wide compatibility: IPSec is an open standard protocol that is widely supported
by vendors and can be used in heterogeneous environments.
Flexibility: IPSec can be configured to provide security for a wide range of
network topologies, including point-to-point, site-to-site, and remote access
connections.
Scalability: IPSec can be used to secure large-scale networks and can be scaled
up or down as needed.
Improved network performance: IPSec can help improve network performance
by reducing network congestion and improving network efficiency.
Disadvantages of IPSec
Configuration complexity: IPSec can be complex to configure and requires
specialized knowledge and skills.
Compatibility issues: IPSec can have compatibility issues with some network
devices and applications, which can lead to interoperability problems.
Performance impact: IPSec can impact network performance due to the overhead
of encryption and decryption of IP packets.
Key management: IPSec requires effective key management to ensure the
security of the cryptographic keys used for encryption and authentication.
Limited protection: IPSec only provides protection for IP traffic, and other
protocols such as ICMP, DNS, and routing protocols may still be vulnerable to
attacks.
Digital Signature
A Digital Signature is a verification method made by the recipient to ensure the message
was sent from the authenticated identity. When a customer signs a cheque, the bank
must verify that he issued that specific cheque. In this case, a signature on a document
acts as a sign of authentication and verifies that the document is authentic.
Suppose we have:
Alice is the entity that sends a message or initiates communication.
Bob represents the recipient or receiver of the message.
Eve represents an eavesdropper or adversary who may attempt to intercept or
tamper with the communication.
In Public Key cryptography (also known as Asymmetric cryptography), the
communication process is as follows:
Alice encrypts the message using Bob’s public key.
The encrypted message reaches Bob.
Bob decrypts the message sent by Alice using his private key.
Now, suppose when Alice sends a message to Bob, then Bob will check if the sender is
authentic; to ensure that it was Alice who sent the message, not Eve. For this, Bob can
ask Alice to sign the message electronically. So we can say that an electronic signature
can prove that Alice is authentic and is the one sending the message. We called this
type of signature a digital signature.
Digital Signature is a verification method. Digital signatures do not provide confidential
communication. If you want to achieve confidentiality, both the message and the
signature must be encrypted using either a secret key or a public key cryptosystem.
This additional layer of security can be incorporated into a basic digital signature
scheme.
RSA approach
Primary Termologies
User’s Private Key (PR): This key is publicly known and can be shared with
anyone. It’s used to verify digital signatures created with a corresponding private
key.
User’s Public Key (PU): A top-secret cryptographic key only possessed by the
user is used in DSA algorithm’s digital signature generation. As it is, the private key
must be kept secret and secure because it proves that a given user is genuine.
Signing (Sig): Signing involves creating a digital signature with the help of a user’s
private key. In case of DSA, this process requires mathematical operations to be
performed on the message that should be signed using a given private key in order
to generate a unique signature for that message.
Verifying (Ver): Verifying is the process of verifying whether or not a digital
signature has been forged using its corresponding public key. In DSA, this involves
comparing the messages hash against the verification value through mathematical
operations between two binary strings – one representing an encrypted data and
another one representing plain-text original message.
Steps to Perform DSA
The Digital Signature Algorithm (DSA) is a public-key technique (i.e., assymetric
cryptography) and it is used to provide only the digital signature function, and it cannot
be used for encryption or key exchange.
The Steps to perform the Digital Signature Algorithm can be broadly divided into:
Global Public-Key Components
User’s Private Key
User’s Public Key
Signing
Verifying
1. Global Public-Key Components
There are three parameters that are public and can be shared to a set of users.
A prime number p is chosen with a length between 512 and 1024 bits such that q
divides (p – 1). So, p is prime number where 2L-1 < p <2L for 512<= L<=1024 and
L is a multiple of 64; i.e., bit length of between 512 and 1024 bits in increments of
64 bits.
Next, an N-bit prime number q is selected. So, q is prime divisor of (p – 1), where
2N-1 < q < 2N i.e., bit length of N bits.
Finally, g is selected to be of the form h(p-1)/q mod p, where h is an integer
between 1 and (p – 1) with the limitation that g must be greater than 1. So, g is =
h(p – 1)/q mod p, where h is any integer with 1 < h < (p – 1) such that h(p-1)/q mod
p > 1.
If a user has these numbers, then it can selects a private key and generates a public
key.
2. User’s Private Key
The private key x should be chosen randomly or pseudorandomly and it must be a
number from 1 to (q – 1), so x is random or pseudorandom integer with 0 < x < q.
3. User’s Public Key
The public key is computed from the private key as y = gx mod p. The computation of
y given x is simple. But, given the public key y, it is believed to be computationally
infeasible to choose x, which is the discrete logarithm of y to the base g, mod p.
4. Signing
If a user want to develop a signature, a user needs to calculates two quantities, r and
s, that are functions of the public key components (p, q, g), the hash code of the
message H(M, the user’s private key (x), and an integer k that must be generated
randomly or pseudorandomly and be unique for each signing. k is generated randomly
or pseudorandomly integer such that 0<k < q.
Signing
5. Verification
Let M, r′, and s′ be the received versions of M, r, and s, respectively.
Verification is performed using the formulas shown in below:
w = (s′)-1 mod q
u1 = [H(M′)w] mod q
u2 = (r′)w mod q
v = [(gu1 yu2) mod p] mod q
The receiver needs to generate a quantity v that is a function of the public key
components, the sender’s public key, and the hash code of the message. If this value
matches the r value of the signature, then the signature is considered as valid.
TEST: v = r′
Verification
Now, at the end it will test on the value r, and it does not depend on the message or
plaintext as, r is the function of k and the three global public-key components as
mentioned above. The multiplicative inverse of k (mod q) when passed to the function
that also has as inputs the message hash code and the user’s private key. The
structure of this function is such that the receiver can recover r using the incoming
message and signature, the public key of the user, and the global public key.
It is given that there is difficulty in taking discrete logarithms, it is not feasible for an
attacker to recover k from r or to recover x from s. The only computationally
demanding task in signature generation is the exponential calculation gk mod p.
Because this value does not depend on the message to be signed, it can be computed
ahead of time. Indeed, a user could precalculate a number of values of r to be used to
sign documents as needed. The only other somewhat demanding task is the
determination of a multiplicative inverse, k-1 .
Services
Message Authentication: A secure digital signature scheme, like a secure
conventional signature (one that cannot be easily copied) can provide message
authentication (also referred to as data-origin authentication). Bob can easily
confirm that the plaintext/message is sent by Alice as Alice’s public key is used for
verification and the Alice’s public key woult not verify the signature signed by Eve’s
private key. Hence, A digital signature provides message authentication.
Message Integrity: When we sign a whole message, its integrity remains intact
because if the message changes, we won’t get the same signature. Nowadays,
digital signature methods use a special function called a hash function in both
signing and verifying to ensure the message’s integrity.
Nonrepudiation: If Alice signs a message and later claims she didn’t, can Bob
provide evidence that she did? For example, if Alice instructs a bank (Bob) to
transfer $10,000 to Ted’s account and then denies sending the message, Bob
needs to keep the signed message and use Alice’s public key to recreate it.
However, this approach may not work if Alice changes her keys or disputes the
authenticity of the file. A solution is involving a trusted third party. This trusted party
can authenticate messages and prevent Alice from denying them. In this setup,
Alice sends her message along with her identity, Bob’s identity, and her signature
to the trusted center. The center verifies the message’s authenticity and
timestamps it before creating its own signature. This process ensures that if Alice
denies sending the message later, the center can provide evidence to settle the
dispute. Encryption can also be added for confidentiality. Thus, nonrepudiation is
achievable through a trusted party.
Advantages of DSA
Authentication: At some point, digital signatures ensure strong identity authentication
for the sender. The recipient can be sure that the message or document was signed by
the purported signatory.
Integrity: Digital signatures ensure the integrity of the content. If something is
altered in the content after the signature is made, then it becomes invalid with
respect to verifying the content.
Non-Repudiation: A digital signature gives non-repudiation, meaning the sender
cannot disclaim his creation of that document post factum. Most relevant in legal
and contractual issues.
Efficiency: Digital signatures make the process of signing electronic and automate
it, giving way to fast online transactions free from the need of manual verification,
paperwork, and a physical signature.
Security: As long as the whole digital signing process is well organized, digital
signatures may prove to be secure. Cryptographic public key cryptography and
hashing algorithms prevent unauthorized parties from forging digital signatures.
World Acceptance: Such a mechanism (digital signatures) to represent the
conclusion of the related transaction in case of legal or contractual terms is known
and widely accepted all over the world.
Timestamping: Timestamping would also make another secure layer against
replay attacks and against the freshness of the signature.
Cost Savings: The digital signing process discontinues the need for transporting
documents, thereby saving on costs to be done with printing, courier services, and
manual handling.
Disadvantages of DSA
Key Management Complexity: Cryptographic keys that are used for signing
documents must be properly managed. Generating, storing, and distributing keys
in a secure manner are all complicated procedures that need to be attended to,
and revocation has to be handled carefully.
Infrastructure Dependence: Digital signatures are built on a secure and reliable
infrastructure of Public Key Infrastructure (PKI) and Certificate Authorities. If the
infrastructure is compromised or becomes unavailable, it may compromise trust in
digital signatures.
Legal and Regulatory Challenges: Although many people are increasingly using
digital signatures, there might still be legal and regulatory challenges in some
places. It will be very important to observe local laws and standards.
Initial Setup Costs: A proper setup of an extensive digital signature system may
include the cost of obtaining certificates for digital certificates, putting in place
safety measures, and training of the users.
Offline Usability: In the event of not having access to the signer’s private key,
digital signatures are found to be challenged. Solutions of hardware tokens and
secure elements add to the complexity.
User Education: Education of the proper application and value of digital
signatures is necessary in order that the users should be educated in use. The
correct measures to be taken against vulnerability, as well as being aware of any
possible threat, are important in successful implementation.
Vulnerability to Key Compromise: Private keys need to be safeguarded from
unauthorized access since one compromised private key can initiate fraudulent
signatures.
FIREWALL
A firewall can be defined as a special type of network security device or a software
program that monitors and filters incoming and outgoing network traffic based on a
defined set of security rules. It acts as a barrier between internal private networks
and external sources (such as the public Internet).
The primary purpose of a firewall is to allow non-threatening traffic and prevent malicious
or unwanted data traffic for protecting the computer from viruses and attacks. A firewall
is a cybersecurity tool that filters network traffic and helps users block malicious software
from accessing the Internet in infected computers.
Network Firewalls
Network Firewalls are the devices that are used to prevent private networks from
unauthorized access. A Firewall is a security solution for the computers or devices that
are connected to a network, they can be either in the form of hardware as well as in
form of software. It monitors and controls the incoming and outgoing traffic (the amount
of data moving across a computer network at any given time ).
The major purpose of the network firewall is to protect an inner network by separating it
from the outer network. An inner Network can be simply called a network created inside
an organization and a network that is not in the range of an inner network can be
considered an Outer Network.
A firewall is a network security device, either hardware or software-based, which
monitors all incoming and outgoing traffic and based on a defined set of security rules
accepts, rejects, or drops that specific traffic.
Accept: allow the traffic
Reject: block the traffic but reply with an “unreachable error”
Drop: block the traffic with no reply
A firewall is a type of network security device that filters incoming and outgoing network
traffic with security policies that have previously been set up inside an organization. A
firewall is essentially the wall that separates a private internal network from the open
Internet at its very basic level.
Next-generation Firewalls
These firewalls are called intelligent firewalls. These firewalls can perform all the tasks
that are performed by the other types of firewalls that we learned previously but on top
of that, it includes additional features like application awareness and control, integrated
intrusion prevention, and cloud-delivered threat intelligence.
Circuit-level Gateways
A circuit-level gateway is a firewall that provides User Datagram Protocol (UDP)
and Transmission Control Protocol (TCP) connection security and works between an
Open Systems Interconnection (OSI) network model’s transport and application layers
such as the session layer.
Software Firewall
The software firewall is a type of computer software that runs on our computers. It
protects our system from any external attacks such as unauthorized access, malicious
attacks, etc. by notifying us about the danger that can occur if we open a particular mail
or if we try to open a website that is not secure.
Hardware Firewall
A hardware firewall is a physical appliance that is deployed to enforce a network
boundary. All network links crossing this boundary pass-through this firewall, which
enables it to perform an inspection of both inbound and outbound network traffic and
enforce access controls and other security policies.
Cloud Firewall
These are software-based, cloud-deployed network devices. This cloud-based firewall
protects a private network from any unwanted access. Unlike traditional firewalls, a
cloud firewall filters data at the cloud level.
Hardware Firewall vs Software Firewall
A hardware firewall is a separate physical device placed between a network and its
connected devices. It monitors and controls incoming and outgoing network traffic
based on set security rules. Setting up a hardware firewall requires skilled personnel for
proper installation and ongoing management.
In contrast, a software firewall runs on a server or virtual machine. It operates on a
security-focused operating system, typically using standard hardware resources.
Software firewalls can often be quickly implemented using cloud automation tools.
Both hardware and software firewalls are crucial for network security. The choice
between them depends on specific needs and deployment contexts.
Working of Firewalls
Firewalls can control and monitor the amount of incoming or outgoing traffic of our
network. The data that comes to our network is in the forms of packets(a small unit of
data), it is tough to identify whether the packet is safe for our network or not, this gives
a great chance to the hackers and intruders to bombard our networks with various
viruses, malware, spam, etc.
There is no as such best firewall architecture. The choice of firewall architecture for any
network depends upon its use cases, requirements, budgets etc. In our network if we
are having threat at Application layer then Application layer firewall can be best. If we
are having threat at session layer then circuit level gateways can be best.
Advantages
Monitors Network Traffic : A network firewall monitors and analyzes traffic by
inspecting whether the traffic or packets passing through our network is safe for
our network or not. By doing so, it keeps our network away from any malicious
content that can harm our network.
Halt Hacking: In a society where everyone is connected to technology, it becomes
more important to keep firewalls in our network and use the internet safely.
Stops Viruses : Viruses can come from anywhere, such as from an insecure
website, from a spam message, or any threat, so it becomes more important to
have a strong defense system (i.e. firewall in this case), a virus attack can easily
shut off a whole network. In such a situation, a firewall plays a vital role.
Better Security: If it is about monitoring and analyzing the network from time to
time and establishing a malware-free, virus-free, spam-free environment so
network firewall will provide better security to our network.
Increase Privacy: By protecting the network and providing better security, we get
a network that can be trusted.
Disadvantages
Cost: Depending on the type of firewall, it can be costly, usually, the hardware
firewalls are more costly than the software ones.
Restricts User: Restricting users can be a disadvantage for large organizations,
because of its tough security mechanism. A firewall can restrict the employees to
do a certain operation even though it’s a necessary operation.
Issues With The Speed of The Network: Since the firewalls have to monitor
every packet passing through the network, this can slow down operations needed
to be performed, or it can simply lead to slowing down the network.
Maintenance: Firewalls require continuous updates and maintenance with every
change in the networking technology. As the development of new viruses is
increasing continuously that can damage your system.
Checksum
Checksum is the error detection method used by upper layer protocols and is
considered to be more reliable than LRC, VRC and CRC. This method makes
the use of Checksum Generator on Sender side and Checksum Checker on
Receiver side.
At the Sender side, the data is divided into equal subunits of n bit length by the
checksum generator. This bit is generally of 16-bit length. These subunits are
then added together using one’s complement method. This sum is of n bits. The
resultant bit is then complemented. This complemented sum which is called
checksum is appended to the end of original data unit and is then transmitted to
Receiver.
The Receiver after receiving data + checksum passes it to checksum checker.
Checksum checker divides this data unit into various subunits of equal length
and adds all these subunits. These subunits also contain checksum as one of
the subunits. The resultant bit is then complemented. If the complemented
result is zero, it means the data is error-free. If the result is non-zero it means
the data contains an error and Receiver rejects it.
Example –
If the data unit to be transmitted is 10101001 00111001, the following
procedure is used at Sender site and Receiver site.
Sender Site :
10101001 subunit 1
00111001 subunit 2
11100010 sum (using 1s complement)
00011101 checksum (complement of sum)
Data transmitted to Receiver is –
Receiver Site :
10101001 subunit 1
00111001 subunit 2
00011101 checksum
11111111 sum
00000000 sum's complement
Flow Control
o It is a set of procedures that tells the sender how much data it can transmit before
the data overwhelms the receiver.
o The receiving device has limited speed and limited memory to store the data.
Therefore, the receiving device must be able to inform the sending device to stop
the transmission temporarily before the limits are reached.
o It requires a buffer, a block of memory for storing the information until they are
processed.
o Stop-and-wait
o Sliding window
Stop-and-wait
2. Lost Acknowledgement
Assume the sender sends the data, which is also received by the receiver. The receiver
sends an acknowledgment after receiving the packet. In this situation, the
acknowledgment is lost in the network. The sender does not send the next data packet
because it does not receive acknowledgement, under the stop and wait protocol, the
next packet cannot be transmitted until the preceding packet’s acknowledgment is
received.
3. Delayed Acknowledgement/Data
Assume the sender sends the data, which is also received by the receiver. The receiver
then transmits the acknowledgment, which is received after the sender’s timeout period.
After a timeout on the sender side, a long-delayed acknowledgement might be wrongly
considered as acknowledgement of some other recent packet.
1. Time Out
Timeout refers to the duration for which the sender waits for an acknowledgment (ACK)
from the receiver after transmitting a data packet. If the sender does not receive an ACK
within this timeout period, it assumes that the frame was lost or corrupted and
retransmits the frame.
2. Sequence Number (Data)
In Stop-and-Wait ARQ, the sender assigns sequence numbers to each data frame it
sends. This allows the receiver to identify and acknowledge each frame individually,
ensuring reliable delivery of data packets. After sending a frame, the sender waits for
an acknowledgment before sending the next frame.
3. Sequence Number(Acknowledgement)
Similarly, sequence numbers are also used in acknowledgments (ACKs) sent by the
receiver to acknowledge received data frames. When the receiver successfully receives
a data frame, it sends an ACK back to the sender, indicating the sequence number of
the next expected frame. The sender uses this ACK to determine whether the
transmission was successful and whether it can proceed to send the next frame.
Working of Stop and Wait for ARQ
Sender A sends a data frame or packet with sequence number 0.
Receiver B, after receiving the data frame, sends an acknowledgement with
sequence number 1 (the sequence number of the next expected data frame or
packet)
There is only a one-bit sequence number that implies that both sender and receiver
have a buffer for one frame or packet only.
In the Stop-and-wait method, the sender waits for an acknowledgement after every frame
it sends.
o When acknowledgement is received, then only next frame is sent. The process of
alternately sending and waiting of a frame continues until the sender transmits the
EOT (End of transmission) frame.
Sliding Window
Sliding window protocols are data link layer protocols for reliable and
sequential delivery of data frames. The sliding window is also used
in Transmission Control Protocol.
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.
Consequently, the size of the sending window is 2 𝑛−1. Thus in order to
accommodate a sending window size of 2 𝑛−1, a n-bit sequence number is
chosen.
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.
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.
o The Sliding Window is a method of flow control in which a sender can transmit the
several frames before getting an acknowledgement.
o In Sliding Window Control, multiple frames can be sent one after the another due
to which capacity of the communication channel can be utilized efficiently.
o A single ACK acknowledge multiple frames.
o Sliding Window refers to imaginary boxes at both the sender and receiver end.
o The window can hold the frames at either end, and it provides the upper limit on
the number of frames that can be transmitted before the acknowledgement.
o Frames can be acknowledged even when the window is not completely filled.
o The window has a specific size in which they are numbered as modulo-n means
that they are numbered from 0 to n-1. For example, if n = 8, the frames are
numbered from 0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1........
o The size of the window is represented as n-1. Therefore, maximum n-1 frames can
be sent before acknowledgement.
o When the receiver sends the ACK, it includes the number of the next frame that it
wants to receive. For example, to acknowledge the string of frames ending with
frame number 4, the receiver will send the ACK containing the number 5. When
the sender sees the ACK with the number 5, it got to know that the frames from 0
through 4 have been received.
Sender Window
o At the beginning of a transmission, the sender window contains n-1 frames, and
when they are sent out, the left boundary moves inward shrinking the size of the
window. For example, if the size of the window is w if three frames are sent out,
then the number of frames left out in the sender window is w-3.
o Once the ACK has arrived, then the sender window expands to the number which
will be equal to the number of frames acknowledged by ACK.
o For example, the size of the window is 7, and if frames 0 through 4 have been sent
out and no acknowledgement has arrived, then the sender window contains only
two frames, i.e., 5 and 6. Now, if ACK has arrived with a number 4 which means that
0 through 3 frames have arrived undamaged and the sender window is expanded
to include the next four frames. Therefore, the sender window contains six frames
(5,6,7,0,1,2).
Receiver Window
o At the beginning of transmission, the receiver window does not contain n frames,
but it contains n-1 spaces for frames.
o When the new frame arrives, the size of the window shrinks.
o The receiver window does not represent the number of frames received, but it
represents the number of frames that can be received before an ACK is sent. For
example, the size of the window is w, if three frames are received then the number
of spaces available in the window is (w-3).
o Once the acknowledgement is sent, the receiver window expands by the number
equal to the number of frames acknowledged.
o Suppose the size of the window is 7 means that the receiver window contains seven
spaces for seven frames. If the one frame is received, then the receiver window
shrinks and moving the boundary from 0 to 1. In this way, window shrinks one by
one, so window now contains the six spaces. If frames from 0 through 4 have sent,
then the window contains two spaces before an acknowledgement is sent.
Stop-and-wait ARQ
Stop-and-wait ARQ is a technique used to retransmit the data in case of damaged or lost
frames.
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.
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 Damaged Frame: When the frame is damaged, then the receiver sends a NAK
frame.
In the above figure, three frames have been transmitted before an error discovered in the
third frame. In this case, ACK 2 has been returned telling that the frames 0,1 have been
received successfully without any error. The receiver discovers the error in data 2 frame,
so it returns the NAK 2 frame. The frame 3 is also discarded as it is transmitted after the
damaged frame. Therefore, the sender retransmits the frames 2,3.
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
CSMA CD
The Carrier Sense Multiple Access/ Collision Detection protocol is used to detect a
collision in the media access control (MAC) layer. Once the collision was detected, the
CSMA CD immediately stopped the transmission by sending the signal so that the sender
does not waste all the time to send the data packet. Suppose a collision is detected from
each station while broadcasting the packets. In that case, the CSMA CD immediately sends
a jam signal to stop transmission and waits for a random time context before transmitting
another data packet. If the channel is found free, it immediately sends the data and returns
it.
1. It is used for collision detection on a shared channel within a very short time.
2. CSMA CD is better than CSMA for collision detection.
3. CSMA CD is used to avoid any form of waste transmission.
4. When necessary, it is used to use or share the same amount of bandwidth at each
station.
5. It has lower CSMA CD overhead as compared to the CSMA CA.
Disadvantage of CSMA CD
CSMA/CA
CSMA stands for Carrier Sense Multiple Access with Collision Avoidance. It means that
it is a network protocol that uses to avoid a collision rather than allowing it to occur, and
it does not deal with the recovery of packets after a collision. It is similar to the CSMA CD
protocol that operates in the media access control layer. In CSMA CA, whenever a station
sends a data frame to a channel, it checks whether it is in use. If the shared channel is
busy, the station waits until the channel enters idle mode. Hence, we can say that it
reduces the chances of collisions and makes better use of the medium to send data
packets more efficiently.
1. When the size of data packets is large, the chances of collision in CSMA CA is less.
2. It controls the data packets and sends the data when the receiver wants to send
them.
3. It is used to prevent collision rather than collision detection on the shared channel.
4. CSMA CA avoids wasted transmission of data over the channel.
5. It is best suited for wireless transmission in a network.
6. It avoids unnecessary data traffic on the network with the help of the RTS/ CTS
extension.
1. Sometime CSMA/CA takes much waiting time as usual to transmit the data packet.
2. It consumes more bandwidth by each station.
3. Its efficiency is less than a CSMA CD.