[go: up one dir, main page]

0% found this document useful (0 votes)
37 views199 pages

Basics of Computer Networking

The document provides an overview of computer networking, including definitions of key terms, types of network architectures, and protocols. It discusses network topology, the OSI model, and unique identifiers like IP and MAC addresses. Additionally, it covers network security measures and characteristics essential for efficient network operations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views199 pages

Basics of Computer Networking

The document provides an overview of computer networking, including definitions of key terms, types of network architectures, and protocols. It discusses network topology, the OSI model, and unique identifiers like IP and MAC addresses. Additionally, it covers network security measures and characteristics essential for efficient network operations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 199

Computer Networking

Prepared by P. Prasanna
1.Computer Networking basics
A computer network is a collection of interconnected devices that share
resources and information. These devices can include computers, servers,
printers, and other hardware. Networks allow for the efficient exchange of data,
enabling various applications such as email, file sharing, and internet browsing.
Basic Terminologies of Computer Networks
 Network: A group of connected computers and devices that can
communicate and share data with each other.
 Node: Any device that can send, receive, or forward data in a network.
This includes laptops, mobiles, printers, earbuds, servers, etc.
 Networking Devices: Devices that manage and support networking
functions. This includes routers, switches, hubs, and access points.
 Transmission Media: The physical or wireless medium through which
data travels between devices. Wired media: Ethernet cables, optical fiber.
Wireless media: Wi-Fi, Bluetooth, infrared
 Service Provider Networks: Networks offered by external providers that
allow users or organizations to lease network access and capabilities. This
includes internet providers, mobile carriers, etc.
We will be discussing more terms like Protocol, IP Address, DNS, etc below in
this article.
How Does a Computer Network Work?
Basics building blocks of a Computer network are Nodes and Links. A Network
Node can be illustrated as Equipment for Data Communication like a Modem,
Router, etc., or Equipment of a Data Terminal like connecting two computers or
more. Link in Computer Networks can be defined as wires or cables or free
space of wireless networks.
The working of Computer Networks can be simply defined as rules or protocols
which help in sending and receiving data via the links which allow Computer
networks to communicate. Each device has an IP Address, that helps in
identifying a device.
Types of Computer Network Architecture
Computer Network falls under these broad Categories:
 Client-Server Architecture: Client-Server Architecture is a type of
Computer Network Architecture in which Nodes can be Servers or
Clients. Here, the server node can manage the Client Node Behaviour.
 Peer-to-Peer Architecture: In P2P (Peer-to-Peer) Architecture, there is not
any concept of a Central Server. Each device is free for working as either
client or server.
Network Devices
An interconnection of multiple devices, also known as hosts, that are connected
using multiple paths for the purpose of sending/receiving data or media.
Computer networks can also include multiple devices/mediums which help in
the communication between two different devices; these are known as Network
devices and include things such as routers, switches, hubs, and bridges.

Network Devices
Network Topology
The Network Topology is the layout arrangement of the different devices in a
network. Some types of network topologies are,
 Bus Topology: In bus topology all devices are connected to a single
central cable called a bus.
 Star Topology: In star topology all devices are connected to a central
node called hub or switch.
 Ring Topology: In ring topology devices are connected in a circular loop
with each device connected to two others. Data travels in one direction
(or sometimes both) passing through each device until it reaches its
destination.
 Mesh Topology: In mesh topology every device is connected to every
other device in the network.
 Tree Topology: Tree topology is the combination of star and bus
topology. Tree topology is good for organizing large networks and allows
for easy expansion.
 Hybrid Topology: Hybrid topology is the combination of two or more
different topologies (like star and mesh).

Network Topology
OSI Model
OSI stands for Open Systems Interconnection. It is a reference model that
specifies standards for communications protocols and also the functionalities of
each layer. The OSI has been developed by the International Organization For
Standardization and it is 7 layer architecture. Each layer of OSI has different
functions and each layer has to follow different protocols. The 7 layers are as
follows:
 Physical Layer
 Data link Layer
 Network Layer
 Transport Layer
 Session Layer
 Presentation Layer
 Application Layer
Network Protocols
A protocol is a set of rules or algorithms which define the way how two entities
can communicate across the network and there exists a different protocol
defined at each layer of the OSI model. A few such protocols are TCP, IP, UDP,
ARP, DHCP, FTP, and so on.
 Transmission Control Protocol/Internet Protocol (TCP/IP): TCP/IP is the
foundational protocol suite of the internet, enabling reliable
communication. TCP Ensures data is delivered reliably and in order and
IP routes data packets to their destination based on IP addresses.
 Hypertext Transfer Protocol (HTTP) and HTTPS: HTTP
and HTTPS protocols used for transmitting web pages. In
HTTP communication is unsecured and in HTTPS secured
communication using SSL/TLS encryption.
 Simple Mail Transfer Protocol (SMTP): SMTP protocol used to send
email. SMTP protocol works with other protocols like POP3 and IMAP
for email retrieval.
 File Transfer Protocol (FTP): FTP protocol used for transferring files
between computers. Includes commands for uploading, downloading, and
managing files on a remote server.
 Dynamic Host Configuration Protocol
(DHCP): DHCP protocol automatically assigns IP addresses to devices on
a network. Reduces manual configuration and IP address conflicts.
 Domain Name System (DNS): DNS Translates human-friendly domain
names into IP addresses. Ensures seamless navigation on the internet.
Unique Identifiers of Network
Hostname: Each device in the network is associated with a unique device name
known as Hostname. Type “hostname” in the command prompt(Administrator
Mode) and press ‘Enter’, this displays the hostname of your machine.

HostName

IP Address (Internet Protocol address): Also known as the Logical Address, the
IP Address is the network address of the system across the network. To identify
each device in the world-wide-web, the Internet Assigned Numbers Authority
(IANA) assigns an IPV4 (Version 4) address as a unique identifier to each
device on the Internet. The length of an IPv4 address is 32 bits, hence, we have
232 IP addresses available. The length of an IPv6 address is 128 bits.

In Windows Type “ipconfig” in the command prompt and press ‘Enter’, this
gives us the IP address of the device. For Linux, Type “ifconfig” in the terminal
and press ‘Enter’ this gives us the IP address of the device.

MAC Address (Media Access Control address): Also known as physical


address, the MAC Address is the unique identifier of each host and is associated
with its NIC (Network Interface Card). A MAC address is assigned to the NIC
at the time of manufacturing. The length of the MAC address is: 12-nibble/ 6
bytes/ 48 bits Type “ipconfig/all” in the command prompt and press ‘Enter’, this
gives us the MAC address.

Port: A port can be referred to as a logical channel through which data can be
sent/received to an application. Any host may have multiple applications
running, and each of these applications is identified using the port number on
which they are running.
A port number is a 16-bit integer, hence, we have 216 ports available which are
categorized as shown below:
Port Types Range

Well known
0 – 1023
Ports

Registered Ports 1024 – 49151

Ephemeral Ports 49152 - 65535

Number of ports: 65,536


Range: 0 – 65535
Type “netstat -a” in the command prompt and press ‘Enter’, this lists all the
ports being used.

List of Ports
Socket: The unique combination of IP address and Port number together is
termed a Socket.
Other Related Concepts
DNS Server: DNS stands for Domain Name System. DNS is basically a server
that translates web addresses or URLs (ex: www.google.com) into their
corresponding IP addresses. We don’t have to remember all the IP addresses of
each and every website. The command ‘nslookup’ gives you the IP address of
the domain you are looking for. This also provides information on our DNS
Server. \
Domain IP Address
ARP: ARP stands for Address Resolution Protocol. It is used to convert an IP
address to its corresponding physical address(i.e., MAC Address). ARP is used
by the Data Link Layer to identify the MAC address of the Receiver’s machine.

RARP: RARP stands for Reverse Address Resolution Protocol. As the name
suggests, it provides the IP address of the device given a physical address as
input. But RARP has become obsolete since the time DHCP has come into the
picture.
The Domain Name System (DNS) is a critical component of computer
networking. It converts easily recognizable domain names, such as
www.example.com, into numerical IP addresses that computers use to identify
each other on the network.
How DNS Works?
DNS works efficiently, translating user-friendly domain names into IP
addresses, allowing seamless navigation on the internet. Below step by step
working of DNS:
 User Input: When a user enters a domain name in a browser, the system
needs to find its IP address.
 DNS Query: The user's device sends a DNS query to the DNS resolver.
 Resolver Request: The DNS resolver checks its cache for the IP address.
If not found, it forwards the request to the root DNS server.
 Root DNS Server: The root DNS server provides the address of the TLD
(Top-Level Domain) server for the specific domain extension (e.g., .com).
 TLD DNS Server: The TLD server directs the resolver to the
authoritative DNS server for the actual domain.
 Authoritative DNS Server: The authoritative DNS server knows the IP
address for the domain and provides it to the resolver.
 Response to User: The resolver stores the IP address in its cache and
sends it to the user's device.
 Access Website: With the IP address, the user's device can access the
desired website.
Please refer How DNS works for more details.
Network Security
Ensuring the security of a network is crucial to protect data and resources from
unauthorized access and attacks. Key aspects of network security include:
 Firewalls: Devices or software that monitor and control incoming and
outgoing network traffic based on security rules.
 Encryption: The process of encoding data to prevent unauthorized access.
Commonly used in VPNs, HTTPS, and secure email.
 Intrusion Detection Systems (IDS): Tools that monitor network traffic for
suspicious activity and potential threats.
 Access Control: Mechanisms that restrict access to network resources
based on user identity and role.
 Regular Updates and Patching: Keeping software and hardware up to date
to protect against vulnerabilities.
Characteristics of Computer Networks
Computer networks are systems that connect multiple devices to facilitate
communication, resource sharing, and data transfer. They possess several key
characteristics that ensure efficient and secure operations. These characteristics
include Security, Reliability, Scalability, Performance, Fault Tolerance, and
hardware and software support. Please refer Characteristics of Computer
Networks for more details.
Types of Network Topology
Network topology refers to the arrangement of different elements like nodes,
links, or devices in a computer network. Common types of network topology
include bus, star, ring, mesh, and tree topologies, each with its advantages and
disadvantages. In this article, we will discuss different types of network
topology in detail.
There are two major categories of Network Topology i.e. Physical Network
topology and Logical Network Topology. Physical Network Topology refers to
the actual structure of the physical medium for the transmission of data. Logical
network Topology refers to the transmission of data between devices present in
the network irrespective of the way devices are connected. The structure of the
network is important for the proper functioning of the network. one must choose
the most suitable topology as per their requirement.
Types of Network Topology
Below mentioned are the types of Network Topology
Point to Point Topology
Point-to-point topology is a type of topology that works on the functionality of
the sender and receiver. It is the simplest communication between two nodes, in
which one is the sender and the other one is the receiver. Point-to-Point provides
high bandwidth.

Point to
Point Topology
Mesh Topology
In a mesh topology, every device is connected to another device via a particular
channel. Every device is connected to another via dedicated channels. These
channels are known as links. In Mesh Topology, the protocols used are AHCP
(Ad Hoc Configuration Protocols), DHCP (Dynamic Host Configuration
Protocol), etc.
Mesh Topology
 Suppose, the N number of devices are connected with each other in a
mesh topology, the total number of ports that are required by each device
is N-1. In Figure , there are 6 devices connected to each other, hence the
total number of ports required by each device is 5. The total number of
ports required = N * (N-1).
 Suppose, N number of devices are connected with each other in a mesh
topology, then the total number of dedicated links required to connect
them is N C 2 i.e. N(N-1)/2. In Figure, there are 6 devices connected to
each other, hence the total number of links required is 6*5/2 = 15.
Advantages of Mesh Topology
 Communication is very fast between the nodes.
 Mesh Topology is robust.
 The fault is diagnosed easily. Data is reliable because data is transferred
among the devices through dedicated channels or links.
 Provides security and privacy.
Disadvantages of Mesh Topology
 Installation and configuration are difficult.
 The cost of cables is high as bulk wiring is required, hence suitable for
less number of devices.
 The cost of maintenance is high.
A common example of mesh topology is the internet backbone, where various
internet service providers are connected to each other via dedicated channels.
This topology is also used in military communication systems and aircraft
navigation systems.
Star Topology
In Star Topology, all the devices are connected to a single hub through a cable.
This hub is the central node and all other nodes are connected to the central
node. The hub can be passive in nature i.e., not an intelligent hub such as
broadcasting devices, at the same time the hub can be intelligent known as an
active hub. Active hubs have repeaters in them. Coaxial cables or RJ-45 cables
are used to connect the computers. In Star Topology, many
popular Ethernet LAN protocols are used as CD(Collision
Detection), CSMA (Carrier Sense Multiple Access), etc.

Star Topology

Advantages of Star Topology


 If N devices are connected to each other in a star topology, then the
number of cables required to connect them is N. So, it is easy to set up.
 Each device requires only 1 port i.e. to connect to the hub, therefore the
total number of ports required is N.
 It is Robust. If one link fails only that link will affect and not other than
that.
 Easy to fault identification and fault isolation.
 Star topology is cost-effective as it uses inexpensive coaxial cable.
Disadvantages of Star Topology
 If the concentrator (hub) on which the whole topology relies fails, the
whole system will crash down.
 The cost of installation is high.
 Performance is based on the single concentrator i.e. hub.
A common example of star topology is a local area network (LAN) in an office
where all computers are connected to a central hub. This topology is also used
in wireless networks where all devices are connected to a wireless access point.
Bus Topology
Bus Topology is a network type in which every computer and network device is
connected to a single cable. It is bi-directional. It is a multi-point connection
and a non-robust topology because if the backbone fails the topology crashes. In
Bus Topology, various MAC (Media Access Control) protocols are followed by
LAN ethernet connections like TDMA, Pure Aloha, CDMA, Slotted Aloha, etc.

Bus
Topology
Advantages of Bus Topology
 If N devices are connected to each other in a bus topology, then the
number of cables required to connect them is 1, known as backbone
cable, and N drop lines are required.
 Coaxial or twisted pair cables are mainly used in bus-based networks that
support up to 10 Mbps.
 The cost of the cable is less compared to other topologies, but it is used to
build small networks.
 Bus topology is familiar technology as installation and troubleshooting
techniques are well known.
 CSMA is the most common method for this type of topology.
Disadvantages of Bus Topology
 A bus topology is quite simpler, but still, it requires a lot of cabling.
 If the common cable fails, then the whole system will crash down.
 If the network traffic is heavy, it increases collisions in the network. To
avoid this, various protocols are used in the MAC layer known as Pure
Aloha, Slotted Aloha, CSMA/CD, etc.
 Adding new devices to the network would slow down networks.
 Security is very low.
A common example of bus topology is the Ethernet LAN, where all devices are
connected to a single coaxial cable or twisted pair cable. This topology is also
used in cable television networks.
Ring Topology
In a Ring Topology, it forms a ring connecting devices with exactly two
neighboring devices. A number of repeaters are used for Ring topology with a
large number of nodes, because if someone wants to send some data to the last
node in the ring topology with 100 nodes, then the data will have to pass
through 99 nodes to reach the 100th node. Hence to prevent data loss repeaters
are used in the network.
The data flows in one direction, i.e. it is unidirectional, but it can be made
bidirectional by having 2 connections between each Network Node, it is
called Dual Ring Topology. In-Ring Topology, the Token Ring Passing protocol
is used by the workstations to transmit the data.

Ring Topology
The most common access method of ring topology is token passing.
 Token passing: It is a network access method in which a token is passed
from one node to another node.
 Token: It is a frame that circulates around the network.
Operations of Ring Topology
 One station is known as a monitor station which takes all the
responsibility for performing the operations.
 To transmit the data, the station has to hold the token. After the
transmission is done, the token is to be released for other stations to use.
 When no station is transmitting the data, then the token will circulate in
the ring.
 There are two types of token release techniques: Early token
release releases the token just after transmitting the data and Delayed
token release releases the token after the acknowledgment is received
from the receiver.
Advantages of Ring Topology
 The data transmission is high-speed.
 The possibility of collision is minimum in this type of topology.
 Cheap to install and expand.
 It is less costly than a star topology.
Disadvantages of Ring Topology
 The failure of a single node in the network can cause the entire network
to fail.
 Troubleshooting is difficult in this topology.
 The addition of stations in between or the removal of stations can disturb
the whole topology.
 Less secure.
Tree Topology
Tree topology is the variation of the Star topology. This topology has a
hierarchical flow of data. In Tree Topology, protocols like DHCP and SAC
(Standard Automatic Configuration) are used.
Tree Topology
In tree topology, the various secondary hubs are connected to the central hub
which contains the repeater. This data flow from top to bottom i.e. from the
central hub to the secondary and then to the devices or from bottom to top i.e.
devices to the secondary hub and then to the central hub. It is a multi-point
connection and a non-robust topology because if the backbone fails the
topology crashes.
Advantages of Tree Topology
 It allows more devices to be attached to a single central hub thus it
decreases the distance that is traveled by the signal to come to the
devices.
 It allows the network to get isolated and also prioritize from different
computers.
 We can add new devices to the existing network.
 Error detection and error correction are very easy in a tree topology.
Disadvantages of Tree Topology
 If the central hub gets fails the entire system
fails.
 The cost is high because of the cabling.
 If new devices are added, it becomes difficult
to reconfigure.
A common example of a tree topology is the hierarchy in a large organization.
At the top of the tree is the CEO, who is connected to the different departments
or divisions (child nodes) of the company. Each department has its own
hierarchy, with managers overseeing different teams (grandchild nodes). The
team members (leaf nodes) are at the bottom of the hierarchy, connected to their
respective managers and departments.
Hybrid Topology
Hybrid Topology is the combination of all the various types of topologies we
have studied above. Hybrid Topology is used when the nodes are free to take
any form. It means these can be individuals such as Ring or Star topology or can
be a combination of various types of topologies seen above. Each individual
topology uses the protocol that has been discussed earlier.

Hybrid Topology
The above figure shows the structure of the Hybrid topology. As seen it contains
a combination of all different types of networks.
Advantages of Hybrid Topology
 This topology is very flexible .
 The size of the network can be easily expanded by adding new devices.
Disadvantages of Hybrid Topology
 It is challenging to design the architecture of the Hybrid Network.
 Hubs used in this topology are very expensive.
 The infrastructure cost is very high as a hybrid network requires a lot of
cabling and network devices .
A common example of a hybrid topology is a university campus network. The
network may have a backbone of a star topology, with each building connected
to the backbone through a switch or router. Within each building, there may be a
bus or ring topology connecting the different rooms and offices. The wireless
access points also create a mesh topology for wireless devices. This hybrid
topology allows for efficient communication between different buildings while
providing flexibility and redundancy within each building.
Why is Network Topology Important?
Network Topology is important because it defines how devices are connected
and how they communicate in the network. Here are some points that defines
why network topology is important.
 Network Performance: Upon choosing the appropriate topology as per
requirement, it helps in running the network easily and hence increases
network performance.
 Network Reliability: Some topologies like Star, Mesh are reliable as if
one connection fails, they provide an alternative for that connection,
hence it works as a backup.
 Network Expansion : Chosing correct topology helps in easier expansion
of Network as it helps in adding more devices to the network without
disrupting the actual network.
 Network Security: Network Topology helps in understanding how
devices are connected and hence provides a better security to the network.
Network Devices (Hub, Repeater, Bridge, Switch, Router, Gateways and
Brouter):-
Network devices are physical devices that allow hardware on a computer
network to communicate and interact with each other. Network devices like
hubs, repeaters, bridges, switches, routers, gateways, and brouter help manage
and direct data flow in a network. They ensure efficient communication between
connected devices by controlling data transfer, boosting signals, and linking
different networks. Each device serves a specific role, from simple data
forwarding to complex routing between networks. In this article, we are going
to discuss different types of network devices in detail.
Types of Network
Devices
Functions of Network Devices
 Network devices help to send and receive data between different devices.
 Network devices allow devices to connect to the network efficiently and
securely.
 Network devices improves network speed and manage data flow better.
 It protects the network by controlling access and preventing threats.
 Expand the network range and solve signal problems.
Common Types of Networking Devices and Their Uses
Network devices work as a mediator between two devices for transmission of
data, and thus play a very important role in the functioning of a computer
network. Below are some common network devices used in modern networks:
 Access Point
 Modems
 Firewalls
 Repeater
 Hub
 Bridge
 Switch
 Routers
 Gateway
 Brouter
 NIC
Access Point
An access point in networking is a device that allows wireless devices, like
smartphones and laptops, to connect to a wired network. It creates a Wi-Fi
network that lets wireless devices communicate with the internet or other
devices on the network. Access points are used to extend the range of a network
or provide Wi-Fi in areas that do not have it. They are commonly found in
homes, offices, and public places to provide wireless internet access.
Modems
Modem is also known as modulator/demodulator is a network device that is
used to convert digital signal into analog signals of different frequencies and
transmits these signals to a modem at the receiving location. These converted
signals can be transmitted over the cable systems, telephone lines, and other
communication mediums. A modem is also used to convert an analog signal
back into digital signal. Modems are generally used to access the internet by
customers of an Internet Service Provider (ISP).
Types of Modems
There are four main types of modems:
 DSL Modem: Uses regular phone lines to connect to the internet but it is
slower compared to other types.
 Cable Modem: Sends data through TV cables, providing faster internet
than DSL.
 Wireless Modem: Connects devices to the internet using Wi-Fi relying on
nearby Wi-Fi signals.
 Cellular Modem: Connects to the internet using mobile data from a
cellular network not Wi-Fi or fixed cables.
Firewalls
A firewall is a network security device that monitors and controls the flow of
data between your computer or network and the internet. It acts as a barrier,
blocking unauthorized access while allowing trusted data to pass through.
Firewalls help protect your network from hackers, viruses, and other
online threats by filtering traffic based on security rules. Firewalls can be
physical devices (hardware), programs (software), or even cloud-based services,
which can be offered as SaaS, through public clouds, or private virtual clouds.
Repeater
A repeater operates at the physical layer. Its main function is to amplify (i.e.,
regenerate) the signal over the same network before the signal becomes too
weak or corrupted to extend the length to which the signal can be transmitted
over the same network. When the signal becomes weak, they copy it bit by bit
and regenerate it at its star topology connectors connecting following the
original strength. It is a 2-port device.
Hub
A hub is a multiport repeater. A hub connects multiple wires coming from
different branches, for example, the connector in star topology which connects
different stations. Hubs cannot filter data, so data packets are sent to all
connected devices. In other words, the collision domain of all hosts connected
through Hub remains one. Also, they do not have the intelligence to find out the
best path for data packets which leads to inefficiencies and wastage.
Types of Hub
 Active Hub: These are the hubs that have their power supply and can
clean, boost, and relay the signal along with the network. It serves both as
a repeater as well as a wiring center. These are used to extend the
maximum distance between nodes.
 Passive Hub: These are the hubs that collect wiring from nodes and
power supply from the active hub. These hubs relay signals onto the
network without cleaning and boosting them and can't be used to extend
the distance between nodes.
 Intelligent Hub: It works like an active hub and includes remote
management capabilities. They also provide flexible data rates to network
devices. It also enables an administrator to monitor the traffic passing
through the hub and to configure each port in the hub.
Bridge
A bridge operates at the data link layer. A bridge is a repeater, with add on the
functionality of filtering content by reading the MAC addresses of the source
and destination. It is also used for interconnecting two LANs working on the
same protocol. It typically connects multiple network segments and each port is
connected to different segment. A bridge is not strictly limited to two ports, it
can have multiple ports to connect and manage multiple network segments.
Modern multi-port bridges are often called Layer 2 switches because they
perform similar functions.
Types of Bridges
 Transparent Bridges: These are the bridge in which the stations are
completely unaware of the bridge's existence i.e. whether or not a bridge
is added or deleted from the network, reconfiguration of the stations is
unnecessary. These bridges make use of two processes i.e. bridge
forwarding and bridge learning.
 Source Routing Bridges: In these bridges, routing operations is performed
by the source station and the frame specifies which route to follow. The
host can discover the frame by sending a special frame called the
discovery frame, which spreads through the entire network using all
possible paths to the destination.
Switch
A switch is a multiport bridge with a buffer designed that can boost its
efficiency(a large number of ports imply less traffic) and performance. A switch
is a data link layer device. The switch can perform error checking before
forwarding data, which makes it very efficient as it does not forward packets
that have errors and forward good packets selectively to the correct port only.
In other words, the switch divides the collision domain of hosts, but
the broadcast domain remains the same.
Types of Switch
 Unmanaged Switches: These switches have a simple plug-and-play
design and do not offer advanced configuration options. They are suitable
for small networks or for use as an expansion to a larger network.
 Managed Switches: These switches offer advanced configuration options
such as VLANs, QoS, and link aggregation. They are suitable for larger,
more complex networks and allow for centralized management.
 Smart Switches: These switches have features similar to managed
switches but are typically easier to set up and manage. They are suitable
for small- to medium-sized networks.
 Layer 2 Switches: These switches operate at the Data Link layer of
the OSI model and are responsible for forwarding data between devices
on the same network segment.
 Layer 3 switches: These switches operate at the Network layer of the OSI
model and can route data between different network segments. They are
more advanced than Layer 2 switches and are often used in larger, more
complex networks.
 PoE Switches: These switches have Power over Ethernet capabilities,
which allows them to supply power to network devices over the same
cable that carries data.
 Gigabit switches: These switches support Gigabit Ethernet speeds, which
are faster than traditional Ethernet speeds.
 Rack-Mounted Switches: These switches are designed to be mounted in a
server rack and are suitable for use in data centers or other large
networks.
 Desktop Switches: These switches are designed for use on a desktop or in
a small office environment and are typically smaller in size than rack-
mounted switches.
 Modular Switches: These switches have modular design that allows for
easy expansion or customization. They are suitable for large networks and
data centers.
Router
A router is a device like a switch that routes data packets based on their IP
addresses. The router is mainly a Network Layer device. Routers normally
connect LANs and WANs and have a dynamically updating routing table based
on which they make decisions on routing the data packets. The router divides
the broadcast domains of hosts connected through it.
Gateway
A gateway, as the name suggests, is a passage to connect two networks that may
work upon different networking models. They work as messenger agents that
take data from one system, interpret it, and transfer it to another system.
Gateways are also called protocol converters and can operate at any network
layer. Gateways are generally more complex than switches or routers.
Brouter
It is also known as the bridging router is a device that combines features of both
bridge and router. It can work either at the data link layer or a network layer.
Working as a router, it is capable of routing packets across networks and
working as a bridge, it is capable of filtering local area network traffic.
NIC
NIC or network interface card is a network adapter that is used to connect the
computer to the network. It is installed in the computer to establish a LAN. It
has a unique ID that is written on the chip, and it has a connector to connect the
cable to it. The cable acts as an interface between the computer and the router or
modem. NIC is a layer 2 device which means that it works on both the physical
and data link layers of the network model.
What is OSI Model? - Layers of OSI Model
The OSI (Open Systems Interconnection) Model is a set of rules that explains
how different computer systems communicate over a network. OSI Model was
developed by the International Organization for Standardization (ISO). The OSI
Model consists of 7 layers and each layer has specific functions and
responsibilities. This layered approach makes it easier for different devices and
technologies to work together. OSI Model provides a clear structure for data
transmission and managing network issues. The OSI Model is widely used as a
reference to understand how network systems function.
There are 7 layers in the OSI Model and each layer has its specific role in
handling data. All the layers are mentioned below:
 Physical Layer
 Data Link Layer
 Network Layer
 Transport Layer
 Session Layer
 Presentation Layer
 Application Layer
Layer 1: Physical Layer
The lowest layer of the OSI reference model is the Physical Layer. It is
responsible for the actual physical connection between the devices. The physical
layer contains information in the form of bits. Physical Layer is responsible for
transmitting individual bits from one node to the next. When receiving data, this
layer will get the signal received and convert it into 0s and 1s and send them to
the Data Link layer, which will put the frame back together. Common physical
layer devices are Hub, Repeater, Modem, and Cables.
Physical Layer
Functions of the Physical Layer
 Bit Synchronization: The physical layer provides the synchronization of
the bits by providing a clock. This clock controls both sender and receiver
thus providing synchronization at the bit level.
 Bit Rate Control: The Physical layer also defines the transmission rate i.e.
the number of bits sent per second.
 Physical Topologies: Physical layer specifies how the different,
devices/nodes are arranged in a network i.e. bus topology, star topology,
or mesh topology.
 Transmission Mode: Physical layer also defines how the data flows
between the two connected devices. The various transmission modes
possible are Simplex, half-duplex and full duplex.
Layer 2: Data Link Layer (DLL)
The data link layer is responsible for the node-to-node delivery of the message.
The main function of this layer is to make sure data transfer is error-free from
one node to another, over the physical layer. When a packet arrives in a
network, it is the responsibility of the DLL to transmit it to the Host using
its MAC address. Packet in the Data Link layer is referred to as
Frame. Switches and Bridges are common Data Link Layer devices.
The Data Link Layer is divided into two sublayers:
 Logical Link Control (LLC)
 Media Access Control (MAC)
The packet received from the Network layer is further divided into frames
depending on the frame size of the NIC (Network Interface Card). DLL also
encapsulates Sender and Receiver’s MAC address in the header.
The Receiver’s MAC address is obtained by placing an ARP (Address
Resolution Protocol) request onto the wire asking, "Who has that IP address?"
and the destination host will reply with its MAC address.
Functions of the Data Link Layer
 Framing: Framing is a function of the data link layer. It provides a way
for a sender to transmit a set of bits that are meaningful to the receiver.
This can be accomplished by attaching special bit patterns to the
beginning and end of the frame.
 Physical Addressing: After creating frames, the Data link layer adds
physical addresses (MAC addresses) of the sender and/or receiver in the
header of each frame.
 Error Control: The data link layer provides the mechanism of error
control in which it detects and retransmits damaged or lost frames.
 Flow Control: The data rate must be constant on both sides else the data
may get corrupted thus, flow control coordinates the amount of data that
can be sent before receiving an acknowledgment.
 Access Control: When a single communication channel is shared by
multiple devices, the MAC sub-layer of the data link layer helps to
determine which device has control over the channel at a given time.
Layer 3: Network Layer
The network layer works for the transmission of data from one host to the other
located in different networks. It also takes care of packet routing i.e. selection of
the shortest path to transmit the packet, from the number of routes available.
The sender and receiver's IP address are placed in the header by the network
layer. Segment in the Network layer is referred to as Packet. Network layer is
implemented by networking devices such as routers and switches.
Functions of the Network Layer
 Routing: The network layer protocols determine which route is suitable
from source to destination. This function of the network layer is known as
routing.
 Logical Addressing: To identify each device inter-network uniquely, the
network layer defines an addressing scheme. The sender and receiver’s IP
addresses are placed in the header by the network layer. Such an address
distinguishes each device uniquely and universally.
Layer 4: Transport Layer
The transport layer provides services to the application layer and takes services
from the network layer. The data in the transport layer is referred to
as Segments. It is responsible for the end-to-end delivery of the complete
message. The transport layer also provides the acknowledgment of the
successful data transmission and re-transmits the data if an error is found.
Protocols used in Transport Layer are TCP, UDP NetBIOS, PPTP.
At the sender's side, the transport layer receives the formatted data from the
upper layers, performs Segmentation, and also implements Flow and error
control to ensure proper data transmission. It also adds Source and
Destination port number in its header and forwards the segmented data to the
Network Layer.
 Generally, this destination port number is configured, either by default or
manually. For example, when a web application requests a web server, it
typically uses port number 80, because this is the default port assigned to
web applications. Many applications have default ports assigned.
At the Receiver’s side, Transport Layer reads the port number from its header
and forwards the Data which it has received to the respective application. It also
performs sequencing and reassembling of the segmented data.
Functions of the Transport Layer
 Segmentation and Reassembly: This layer accepts the message from the
(session) layer and breaks the message into smaller units. Each of the
segments produced has a header associated with it. The transport layer at
the destination station reassembles the message.
 Service Point Addressing: To deliver the message to the correct process,
the transport layer header includes a type of address called service point
address or port address. Thus, by specifying this address, the transport
layer makes sure that the message is delivered to the correct process.
Services Provided by Transport Layer
 Connection-Oriented Service
 Connectionless Service
Layer 5: Session Layer
Session Layer in the OSI Model is responsible for the establishment of
connections, management of connections, terminations of sessions between two
devices. It also provides authentication and security. Protocols used in the
Session Layer are NetBIOS, PPTP.
Functions of the Session Layer
 Session Establishment, Maintenance, and Termination: The layer allows
the two processes to establish, use, and terminate a connection.
 Synchronization: This layer allows a process to add checkpoints that are
considered synchronization points in the data. These synchronization
points help to identify the error so that the data is re-synchronized
properly, and ends of the messages are not cut prematurely, and data loss
is avoided.
 Dialog Controller: The session layer allows two systems to start
communication with each other in half-duplex or full duplex.
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.

Communication in Session Layer


Layer 6: Presentation Layer
The presentation layer is also called the Translation layer. The data from the
application layer is extracted here and manipulated as per the required format to
transmit over the network. Protocols used in the Presentation Layer
are TLS/SSL (Transport Layer Security / Secure Sockets Layer).JPEG, MPEG,
GIF, are standards or formats used for encoding data, which is part of the
presentation layer’s role.
Functions of the Presentation Layer
 Translation: For example, ASCII to EBCDIC.
 Encryption/ Decryption: Data encryption translates the data into another
form or code. The encrypted data is known as the ciphertext, and the
decrypted data is known as plain text. A key value is used for encrypting
as well as decrypting data.
 Compression: Reduces the number of bits that need to be transmitted on
the network.
Layer 7: Application Layer
At the very top of the OSI Reference Model stack of layers, we find the
Application layer which is implemented by the network applications. These
applications produce the data to be transferred over the network. This layer also
serves as a window for the application services to access the network and for
displaying the received information to the user. Protocols used in the
Application layer are SMTP, FTP, DNS, etc.

Application Layer
Functions of the Application Layer
The main functions of the application layer are given below.
 Network Virtual Terminal (NVT): It allows a user to log on to a remote
host.
 File Transfer Access and Management (FTAM): This application allows a
user to access files in a remote host, retrieve files in a remote host, and
manage or control files from a remote computer.
 Mail Services: Provide email service.
 Directory Services: This application provides distributed database sources
and access for global information about various objects and services.
How Data Flows in the OSI Model?
When we transfer information from one device to another, it travels through 7
layers of OSI model. First data travels down through 7 layers from the sender's
end and then climbs back 7 layers on the receiver's end.
Data flows through the OSI model in a step-by-step process:
 Application Layer: Applications create the data.
 Presentation Layer: Data is formatted and encrypted.
 Session Layer: Connections are established and managed.
 Transport Layer: Data is broken into segments for reliable delivery.
 Network Layer: Segments are packaged into packets and routed.
 Data Link Layer: Packets are framed and sent to the next device.
 Physical Layer: Frames are converted into bits and transmitted physically.
Each layer adds specific information to ensure the data reaches its destination
correctly, and these steps are reversed upon arrival.
We can understand how data flows through OSI Model with the help of an
example mentioned below.
Let us suppose, Person A sends an e-mail to his friend Person B.
Step 1: Person A interacts with e-mail application like Gmail, outlook, etc.
Writes his email to send. (This happens at Application Layer).
Step 2: At Presentation Layer, Mail application prepares for data transmission
like encrypting data and formatting it for transmission.
Step 3: At Session Layer, there is a connection established between the sender
and receiver on the internet.
Step 4: At Transport Layer, Email data is broken into smaller segments. It adds
sequence number and error-checking information to maintain the reliability of
the information.
Step 5: At Network Layer, addressing of packets is done in order to find the best
route for transfer.
Step 6: At Data Link Layer, data packets are encapsulated into frames, then
MAC address is added for local devices and then it checks for error using error
detection.
Step 7: At Physical Layer, Frames are transmitted in the form of electrical/
optical signals over a physical network medium like ethernet cable or WiFi.
After the email reaches the receiver i.e. Person B, the process will reverse and
decrypt the e-mail content. At last, the email will be shown on Person B email
client.
Protocols Used in the OSI Layers

Protocol
Layer Working Data Unit Protocols

Establishing
1: Physical Physical
Bits USB, SONET/SDH, etc.
Layer Connections
between Devices.

Node to Node
2: Data Link
Delivery of Frames Ethernet, PPP, etc.
Layer
Message.

Transmission of
data from one host
3: Network IP, ICMP, IGMP, OSPF,
to another, located Packets
Layer etc.
in different
networks.

Take Service from Segments


Network Layer (for TCP)
4: Transport
and provide it to or TCP, UDP, SCTP, etc.
Layer
the Application Datagrams
Layer. (for UDP)

Establishes
Connection,
Maintenance,
5: Session NetBIOS, RPC, PPTP,
Ensures Data
Layer etc.
Authentication
and Ensures
security.
Protocol
Layer Working Data Unit Protocols

Data from the


application layer
6:
is extracted and
Presentation Data TLS/SSL, MIME, etc.
manipulated in the
Layer
required format
for transmission.

Helps in
7: identifying the
FTP, SMTP, DNS, DHC
Application client and Data
P, etc.
Layer synchronizing
communication.

Why Does the OSI Model Matter


The OSI Model matters because it provides the user a clear structure of "how
the data moves in the network?". As the OSI Model consists of 7 layers, each
layer has its specific role, and due to which it helps in understanding,
identifying and solving the complex network problems easily by focusing on
one of the layers not the entire network.
As the modern Internet does not prefer the OSI Model, but still, the OSI Model
is still very helpful for solving network problems. It helps people understanding
network concepts very easily.
Difference Between OSI and TCP/IP Model

OSI Model TCP/IP Model

OSI stands for Open Systems TCP/IP stands for Transmission


Interconnection. Control Protocol/Internet Protocol.

OSI model has 7 layers. TCP/IP model consists of 4 layers.


OSI Model TCP/IP Model

Package delivery is guaranteed in Package delivery is not guaranteed in


OSI Model. the TCP/IP Model.

In the OSI model, only layers 1,2


All layers of the TCP/IP model are
and 3 are necessary for data
needed for data transmission.
transmission.

Layers are integrated; some layers are


Protocols at each layer is
required by other layers of TCP/IP
independent of the other layer.
model.

OSI Model is a conceptual


Widely used in actual networks like
framework, less used in practical
Internet and Communication Systems.
applications.

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
 The OSI Model has seven layers, which can be complicated and hard to
understand for beginners.
 In real-life networking, most systems use a simpler model called the
Internet protocol suite (TCP/IP), so the OSI Model is not always directly
applicable.
 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.
 The OSI Model is more of a theoretical framework, meaning it's great for
understanding concepts but not always practical for implementation.
TCP/IP Model
The TCP/IP model is a framework that is used to model the
communication in a network. It is mainly a collection of network
protocols and organization of these protocols in different layers for
modeling the network.
 It has four layers, Application, Transport, Network/Internet and Network
Access.
 While the OSI model has seven layers, the 4 layer TCP/IP model is
simpler and commonly used in today’s Internet and networking systems.
Role of TCP/IP
One of its main goals is to make sure that the data sent by the sender
arrives safely and correctly at the receiver’s end. To do this, the data is
broken down into smaller parts called packets before being sent. These
packets travel separately and are reassembled in the correct order when
they reach the destination. This helps prevent errors and makes sure the
message is complete and accurate.
Layers of TCP/IP Model
1. Application Layer
The Application Layer is the top layer of the TCP/IP model and the
one closest to the user. This is where all the apps you use like web
browsers, email clients, or file sharing tools connect to the network. It
acts like a bridge between your software (like Chrome, Gmail, or
WhatsApp) and the lower layers of the network that actually send and
receive data.
It supports different protocols like HTTP (for websites), FTP (for file
transfers), SMTP (for emails), and DNS (for finding website addresses).
It also manages things like data formatting, so both sender and receiver
understand the data, encryption to keep data safe, and session
management to keep track of ongoing connections.
2. Transport Layer
The Transport Layer is responsible for making sure that data is
sent reliably and in the correct order between devices. It checks that the
data you send like a message, file, or video arrives safely and completely.
This layer uses two main protocols: TCP and UDP, depending on whether
the communication needs to be reliable or faster.
TCP is used when data must be correct and complete, like when loading a
web page or downloading a file. It checks for errors, resends missing
pieces, and keeps everything in order. On the other hand, UDP (User
Datagram Protocol) is faster but doesn’t guarantee delivery useful for
things like live video or online games where speed matters more than
perfect accuracy.
3. Internet Layer
The Internet Layer is used for finding the best path for data to travel
across different networks so it can reach the right destination. It works
like a traffic controller, helping data packets move from one network to
another until they reach the correct device. This layer uses the Internet
Protocol (IP) to give every device a unique IP address, which helps
identify where data should go.
The main job of this layer is routing deciding the best way for data to
travel. It also takes care of packet forwarding (moving data from one
point to another), fragmentation (breaking large data into smaller parts),
and addressing.
4. Network Access Layer
The Network Access Layer is the bottom layer of the TCP/IP model. It
deals with the actual physical connection between devices on the same
local network like computers connected by cables or communicating
through Wi-Fi. This layer makes sure that data can travel over the
hardware, such as wires, switches, or wireless signals.
It also handles important tasks like using MAC addresses to identify
devices, creating frames (the format used to send data over the physical
link), and checking for basic errors during transmission.
Working of TCP/IP Model
The working of TCP/IP can be explained with the help of the diagram
given below and explained :
TCP/IP WORKING MODEL
When Sending Data (From Sender to Receiver)
 Application Layer: Prepares user data using protocols like HTTP, FTP, or
SMTP.
 Transport Layer (TCP/UDP): Breaks data into segments and ensures
reliable (TCP) or fast (UDP) delivery.
 Internet Layer (IP): Adds IP addresses and decides the best route for each
packet.
 Link Layer (Network Access Layer): Converts packets into frames and
sends them over the physical network.
When Receiving Data (At the Destination)
 Link Layer: Receives bits from the network and rebuilds frames to pass to
the next layer.
 Internet Layer: Checks the IP address, removes the IP header, and
forwards data to the Transport Layer.
 Transport Layer: Reassembles segments, checks for errors, and ensures
data is complete.
 Application Layer: Delivers the final data to the correct application (e.g.,
displays a web page in the browser).
Why TCP/IP is Used Over the OSI Model
TCP/IP is used over the OSI model because it is simpler, practical, and
widely adopted for real-world networking and the internet. The diagram
below shows the comparison of OSI layer with the TCP :
Reason Explanation

TCP/IP has only 4 layers, compared to 7 in


OSI, making it easier to implement and
Simpler Structure understand in real systems.

TCP/IP was designed based on working


Protocol-Driven protocols, while the OSI model is more of a
Design theoretical framework.

TCP/IP adapts well to different hardware and


Flexibility and networks and includes error handling,
Robustness routing, and congestion control.

TCP/IP is open, free to use, and not


controlled by any single organization, helping
Open Standard it gain universal acceptance.

Actual Use vs The OSI model is great for education and


Conceptual design principles, but TCP/IP is the one
Model actually used in real-world networking.

Advantages of TCP/IP Model


 Interoperability : The TCP/IP model allows different types of computers
and networks to communicate with each other, promoting compatibility
and cooperation among diverse systems.
 Scalability : TCP/IP is highly scalable, making it suitable for both small
and large networks, from local area networks (LANs) to wide area
networks (WANs) like the internet.
 Standardization : It is based on open standards and protocols, ensuring
that different devices and software can work together without
compatibility issues.
 Flexibility : The model supports various routing protocols, data types, and
communication methods, making it adaptable to different networking
needs.
 Reliability : TCP/IP includes error-checking and retransmission features
that ensure reliable data transfer, even over long distances and through
various network conditions.
Disadvantages of TCP/IP Model
 Security Concerns : TCP/IP was not originally designed with security in
mind. While there are now many security protocols available (such as
SSL/TLS), they have been added on top of the basic TCP/IP model,
which can lead to vulnerabilities.
 Inefficiency for Small Networks : For very small networks, the overhead
and complexity of the TCP/IP model may be unnecessary and inefficient
compared to simpler networking protocols.
 Limited by Address Space : Although IPv6 addresses this issue, the older
IPv4 system has a limited address space, which can lead to issues with
address exhaustion in larger networks.
 Data Overhead : TCP the transport protocol, includes a significant
amount of overhead to ensure reliable transmission.

2. Physical Layer :-
Physical Layer in OSI Model
The physical Layer is the bottom-most layer in the Open System
Interconnection (OSI) Model which is a physical and electrical
representation of the system. It consists of various network components
such as power plugs, connectors, receivers, cable types, etc. The physical
layer sends data bits from one device(s) (like a computer) to another
device(s).
The physical Layer defines the types of encoding (that is how the 0's and
1's are encoded in a signal). It is responsible for the communication of the
unstructured raw data streams over a physical medium.
Functions Performed by Physical Layer
The Physical Layer is responsible for sending raw data as bits over a
physical medium. It converts data into signals that can travel through
wires, fiber optics, or wireless channels (encoding) and turns these
signals back into data at the receiver (decoding). It ensures signals are
transmitted correctly and uses techniques like modulation to prepare the
data for transmission and demodulation to retrieve it at the other end.
This layer also decides how data flows (one-way, two-way alternately, or
simultaneously) through transmission modes and controls the speed and
timing of data transmission to keep everything running smoothly.
To read in detail about services offered by this layer, refer to Physical
Layer Services.
Physical Topologies
Physical topologies describe the physical arrangement of devices and
cables in a network. Let's take a look into different types of physical

topologies :
Line Configuration
 Point-to-Point configuration: In Point-to-Point configuration, there is a
line (link) that is fully dedicated to carrying the data between two
devices.
 Multi-Point configuration: In a Multi-Point configuration, there is a line
(link) through which multiple devices are connected.
Modes of Transmission Medium
 Simplex mode: In this mode, out of two devices, only one device can
transmit the data, and the other device can only receive the data.
o Example- Input from keyboards, monitors, TV broadcasting, Radio
broadcasting, etc.

 Half Duplex mode: In this mode, out of two devices, both devices can
send and receive the data but only one at a time not simultaneously.
o Examples- Walkie-Talkie, Railway Track, etc.
 Full-Duplex mode: In this mode, both devices can send and receive the
data simultaneously.
o Examples- Telephone Systems, Chatting applications, etc.

Protocols in Physical Layer


Typically, a combination of hardware and software programming makes
up the physical layer. It consists of several protocols that control data
transmissions on a network. The following are some examples of Layer 1
protocols:
 Ethernet (IEEE 802.3) – Widely used for wired networks.
 Wi-Fi (IEEE 802.11) – For wireless communication.
 Bluetooth (IEEE 802.15.1) – Short-range wireless communication.
 USB (Universal Serial Bus) – For connecting devices over short
distances.
Advantages of the Physical Layer
 It ensures devices can transmit and receive raw data over physical
mediums.
 It provides universal standards for cables, connectors, and signaling,
ensuring compatibility.
 Support for Various Media: Works with wired (e.g., Ethernet) and
wireless (e.g., Wi-Fi) technologies.
Limitations of the Physical Layer
 No Error Handling: Cannot detect or correct errors in data transmission.
 Susceptible to Physical Damage: Cables, connectors, and hardware
failures can disrupt communication.
 No Data Interpretation: It only transmits bits and doesn't understand or
process the actual data.
Transmission Modes in Computer Networks (Simplex, Half-Duplex
and Full-Duplex)
Transmission modes also known as communication modes, are methods of transferring data
between devices on buses and networks designed to facilitate communication. They are
classified into three types: Simplex Mode, Half-Duplex Mode, and Full-Duplex Mode. In this
article, we will discuss Transmission Modes.
What is Transmission Modes?

Transmission mode means transferring data between two devices. It is also


known as a communication mode. Buses and networks are designed to allow
communication to occur between individual devices that are
interconnected. There are three types of transmission modes:

Simplex Mode
In Simplex mode, the communication is unidirectional, as on a one-way street.
Only one of the two devices on a link can transmit, the other can only receive.
The simplex mode can use the entire capacity of the channel to send data in one
direction.
Example: Keyboard and traditional monitors. The keyboard can only introduce
input, the monitor can only give the output.
Advantages of Simplex Mode
 Simplex mode is the easiest and most reliable mode of communication.
 It is the most cost-effective mode, as it only requires one communication
channel.
 There is no need for coordination between the transmitting and receiving
devices, which simplifies the communication process.
 Simplex mode is particularly useful in situations where feedback or
response is not required, such as broadcasting or surveillance.
Disadvantages of Simplex Mode
 Only one-way communication is possible.
 There is no way to verify if the transmitted data has been received
correctly.
 Simplex mode is not suitable for applications that require bidirectional
communication.
Half-Duplex Mode
In half-duplex mode, each station can both transmit and receive, but not at the
same time. When one device is sending, the other can only receive, and vice
versa. The half-duplex mode is used in cases where there is no need for
communication in both directions at the same time. The entire capacity of the
channel can be utilized for each direction.
Example: Walkie-talkie in which message is sent one at a time and messages are
sent in both directions.
Channel capacity=Bandwidth * Propagation Delay
Advantages of Half Duplex Mode
 Half-duplex mode allows for bidirectional communication, which is
useful in situations where devices need to send and receive data.
 It is a more efficient mode of communication than simplex mode, as the
channel can be used for both transmission and reception.
 Half-duplex mode is less expensive than full-duplex mode, as it only
requires one communication channel.
Disadvantages of Half Duplex Mode
 Half-duplex mode is less reliable than Full-Duplex mode, as both devices
cannot transmit at the same time.
 There is a delay between transmission and reception, which can cause
problems in some applications.
 There is a need for coordination between the transmitting and receiving
devices, which can complicate the communication process.
Full-Duplex Mode
In full-duplex mode, both stations can transmit and receive simultaneously. In
full_duplex mode, signals going in one direction share the capacity of the link
with signals going in another direction, this sharing can occur in two ways:
 Either the link must contain two physically separate transmission paths,
one for sending and the other for receiving.
 Or the capacity is divided between signals traveling in both directions.
Full-duplex mode is used when communication in both directions is required all
the time. The capacity of the channel, however, must be divided between the
two directions.
Example: Telephone Network in which there is communication between two
persons by a telephone line, through which both can talk and listen at the same
time.
Channel Capacity=2* Bandwidth*propagation Delay

Advantages of Full-Duplex Mode


 Full-duplex mode allows for simultaneous bidirectional communication,
which is ideal for real-time applications such as video conferencing or
online gaming.
 It is the most efficient mode of communication, as both devices can
transmit and receive data simultaneously.
 Full-duplex mode provides a high level of reliability and accuracy, as
there is no need for error correction mechanisms.
Disadvantages of Full-Duplex Mode
 Full-duplex mode is the most expensive mode, as it requires two
communication channels.
 It is more complex than simplex and half-duplex modes, as it requires
two physically separate transmission paths or a division of channel
capacity.
 Full-duplex mode may not be suitable for all applications, as it requires a
high level of bandwidth and may not be necessary for some types of
communication.
Difference Between Simplex, Half duplex, and Full Duplex Transmission Modes

Parameters Simplex Half Duplex Full Duplex

The direction of Simplex mode is a Half Duplex mode is Full Duplex mode is
Parameters Simplex Half Duplex Full Duplex

a two-way a two-way
uni-directional directional directional
communication
communication. communication but communication
one at a time. simultaneously.

In Half Duplex
In simplex mode, In Full Duplex mode,
mode, Sender can
Sender can send the Sender can send the
Sender and send the data and
data but that sender data and also can
Receiver also can receive the
can’t receive the receive the data
data but one at a
data. simultaneously.
time.

Usage of one Usage of one Usage of two


Channel usage channel for the channel for the channels for the
transmission of data. transmission of data. transmission of data.

The simplex mode


The Half Duplex Full Duplex provides
provides less
mode provides less better performance
Performance performance than
performance than than simplex and half
half duplex and full
full duplex. duplex mode.
duplex.

The Half-Duplex The Full-Duplex


Simplex utilizes the involves lesser doubles the
Bandwidth
maximum of a utilization of single utilization of
Utilization
single bandwidth. bandwidth at the transmission
time of transmission. bandwidth.

It is suitable for It is suitable for those


It is suitable for
those transmissions transmissions when
those transmissions
when there is there is requirement
when there is
Suitable for requirement of of sending and
requirement of full
sending data in both receiving data
bandwidth for
directions, but not at simultaneously in
delivering data.
the same time. both directions.

Examples Example of simplex Example of half Example of full


Parameters Simplex Half Duplex Full Duplex

mode are: Keyboard duplex mode is: duplex mode is:


and monitor. Walkie-Talkies. Telephone.

Types of Transmission Media


Transmission media is the physical medium through which data is transmitted
from one device to another within a network. These media can
be wired or wireless. The choice of medium depends on factors like distance,
speed, and interference. In this article, we will discuss the transmission media.
In this article we will see types of transmission media in detail.
What is Transmission Media in Computer Networks?
A transmission media is a physical path between the transmitter and the receiver
i.e. it is the path along which data is sent from one device to another.
Transmission Media is broadly classified into the following types:

Types of Transmission
Media
1. Guided Media
Guided Media is also referred to as Wired or Bounded transmission media.
Signals being transmitted are directed and confined in a narrow pathway by
using physical links.
Features:
 High Speed
 Secure
 Used for comparatively shorter distances
There are 3 major types of Guided Media:
Twisted Pair Cable
It consists of 2 separately insulated conductor wires twisted about each other.
Generally, several such pairs are bundled together in a protective sheath. They
are the most widely used Transmission Media. Twisted Pair is of two types:
 Unshielded Twisted Pair (UTP):UTP consists of two insulated copper
wires twisted around one another. This type of cable has the ability to
block interference and does not depend on a physical shield for this
purpose. It is used for telephonic applications.

Unshielded Twisted Pair


Advantages of Unshielded Twisted Pair
 Least expensive
 Easy to install
 High-speed capacity
Disadvantages of Unshielded Twisted Pair
 Lower capacity and performance in comparison to STP
 Short distance transmission due to attenuation

Shielded Twisted Pair


Shielded Twisted Pair (STP): Shielded Twisted Pair (STP) cable consists of a
special jacket (a copper braid covering or a foil shield) to block external
interference. It is used in fast data rate Ethernet and in voice and data channels
of telephone lines.
Advantages of Shielded Twisted Pair
 Better performance at a higher data rate in comparison to UTP
 Eliminates crosstalk
 Comparatively faster
Disadvantages of Shielded Twisted Pair
 Comparatively difficult to install and manufacture
 More expensive
 Bulky
Coaxial Cable
Coaxial cable has an outer plastic covering containing an insulation layer made
of PVC or Teflon and 2 parallel conductors each having a separate insulated
protection cover. The coaxial cable transmits information in two modes:
Baseband mode(dedicated cable bandwidth) and Broadband mode(cable
bandwidth is split into separate ranges). Cable TVs and analog television
networks widely use Coaxial cables.

Advantages of Coaxial Cable


 Coaxial cables has high bandwidth .
 It is easy to install.
 Coaxial cables are more reliable and durable.
 Less affected by noise or cross-talk or electromagnetic inference.
 Coaxial cables support multiple channels
Disadvantages of Coaxial Cable
 Coaxial cables are expensive.
 The coaxial cable must be grounded in order to prevent any crosstalk.
 As a Coaxial cable has multiple layers it is very bulky.
 There is a chance of breaking the coaxial cable and attaching a “t-joint”
by hackers, this compromises the security of the data.
Optical Fiber Cable
Optical Fibre Cable uses the concept of total internal reflection of light through
a core made up of glass. The core is surrounded by a less dense glass or plastic
covering called the coating. It is used for the transmission of large volumes of
data. The cable can be unidirectional or bidirectional. The WDM (Wavelength
Division Multiplexer) supports two modes, namely unidirectional and
bidirectional mode.

Advantages of Optical Fibre Cable


 Increased capacity and bandwidth
 Lightweight
 Less signal attenuation
 Immunity to electromagnetic interference
 Resistance to corrosive materials
Disadvantages of Optical Fibre Cable
 Difficult to install and maintain
 High cost
Applications of Optical Fibre Cable
 Medical Purpose: Used in several types of medical instruments.
 Defence Purpose: Used in transmission of data in aerospace.
 For Communication: This is largely used in formation of internet cables.
 Industrial Purpose: Used for lighting purposes and safety measures in
designing the interior and exterior of automobiles.
Stripline
Stripline is a transverse electromagnetic (TEM) transmission line medium
invented by Robert M. Barrett of the Air Force Cambridge Research Centre in
the 1950s. Stripline is the earliest form of the planar transmission line. It uses a
conducting material to transmit high-frequency waves it is also called a
waveguide. This conducting material is sandwiched between two layers of the
ground plane which are usually shorted to provide EMI immunity.
Microstripline
A microstripline is a type of transmission media used to carry high-frequency
signals, commonly found in microwave and radio frequency circuits. It consists
of a flat, narrow conducting strip (usually made of metal) placed on top of a
dielectric material (an insulating layer), with a metal ground plane on the other
side.
2. Unguided Media
It is also referred to as Wireless or Unbounded transmission media . No physical
medium is required for the transmission of electromagnetic signals.
Features of Unguided Media
 The signal is broadcasted through air
 Less Secure
 Used for larger distances
There are 3 types of Signals transmitted through unguided media:
Radio Waves
Radio waves are easy to generate and can penetrate through buildings. The
sending and receiving antennas need not be aligned. Frequency Range:3KHz -
1GHz. AM and FM radios and cordless phones use Radio waves for
transmission.
Types of Radio Waves:
 Short Wave: AM Radio
 VHF (Very High Frequency): FM Radio/TV
 UHF (Ultra High Frequency): TV
Radio Wave Components:
 Transmitter: Responsible for encoding the signal.
 Receiver: Responsible for decoding the signal.

Radiowave
Microwaves
It is a line of sight transmission i.e. the sending and receiving antennas need to
be properly aligned with each other. The distance covered by the signal is
directly proportional to the height of the antenna. Frequency Range:1GHz -
300GHz. Micro waves are majorly used for mobile phone communication and
television distribution.
Advantages:
 Cheaper than using cables
 Freedom from land acquisition
 Ease of communication in difficult terrains
 Communication over oceans
Disadvantages:
 Insecure communication.
 Out of phase signal.
 Susceptible to weather conditions.
 Bandwidth is limited.
 High cost of design, implementation, and maintenance.

Infrared
Infrared waves are used for very short distance communication. They cannot
penetrate through obstacles. This prevents interference between systems.
Frequency Range:300GHz - 400THz. It is used in TV remotes, wireless mouse,
keyboard, printer, etc.

Difference Between Radio Waves, Micro Waves, and Infrared Waves

Basis Radiowave Microwave Infrared wave

Direction These are omni- These are These are


directional in unidirectional in unidirectional in
Basis Radiowave Microwave Infrared wave

nature. nature. nature.

At low frequency,
At low frequency,
they can penetrate
they can penetrate They cannot
through solid
through solid penetrate
objects and walls
objects and walls. through any
but high
at high frequency, solid object and
frequency they
they cannot walls.
bounce off the
penetrate.
Penetration obstacle.

Frequency range: Frequency


Frequency range:
Frequency 1 GHz to 300 range: 300 GHz
3 KHz to 1GHz.
range GHz. to 400 GHz.

These offers poor These offers These offers


Security security. medium security. high security.

Attenuation is Attenuation is Attenuation is


Attenuation high. variable. low.

Some frequencies Some frequencies


in the radio-waves in the microwaves There is no need
require require of government
government government license to use
Government license to use license to use these waves.
License these. these.

Setup and usage Setup and usage Usage Cost is


Usage Cost Cost is moderate. Cost is high. very less.

Communication These are used in These are used in These are not
Basis Radiowave Microwave Infrared wave

used in long
long distance long distance
distance
communication. communication.
communication.

Causes of Transmission Impairment


Transmission impairment refers to the loss or distortion of signals during data
transmission, leading to errors or reduced quality in communication. Common
causes include signal distortion, attenuation, and noise all of which can affect
the clarity and reliability of transmitted data.

Transmission
Impairment
 Attenuation: It means loss of energy. The strength of signal decreases
with increasing distance which causes loss of energy in overcoming
resistance of medium. This is also known as attenuated
signal. Amplifiers are used to amplify the attenuated signal which gives
the original signal back and compensate for this loss.
 Distortion: It means changes in the form or shape of the signal. This is
generally seen in composite signals made up with different frequencies.
Each frequency component has its own propagation speed travelling
through a medium. And thats why it delay in arriving at the final
destination Every component arrive at different time which leads to
distortion. Therefore, they have different phases at receiver end from
what they had at senders end.
 Noise: The random or unwanted signal that mixes up with the original
signal is called noise. There are several types of noise such as induced
noise, crosstalk noise, thermal noise and impulse noise which may
corrupt the signal.
Factors Considered for Designing the Transmission Media
 Bandwidth: Assuming all other conditions remain constant, the greater a
medium's bandwidth, the faster a signal's data transmission rate.
 Transmission Impairment : Transmission Impairment occurs when the
received signal differs from the transmitted signal. Signal quality will be
impacted as a result of transmission impairment.
 Interference: Interference is defined as the process of disturbing a signal
as it travels over a communication media with the addition of an
undesired signal.
Applications of Transmission Media in Computer Networks
Transmission media in computer networks are used to connect devices and
transfer data. Here are some common applications:

Transmission Media Application

Unshielded Twisted Pair


Local Area Networks (LAN), telephones
(UTP)

Industrial networks, environments with high


Shielded Twisted Pair (STP)
interference

Optical Fiber Cable Long-distance communication, internet backbones

Coaxial Cable Cable TV, broadband internet, CCTV

Stripline Printed Circuit Boards (PCBs), microwave circuits

Microstripline Antennas, satellite communication, RF circuits

Wireless communication, AM/FM radio, mobile


Radio
phones

Infrared Remote controls, short-range communication


Transmission Media Application

Microwave Satellite communication, radar, long-distance links

3.DATA LINK LAYER:-


Data Link Layer in OSI Model:-
The data link layer is the second layer from the bottom in the OSI (Open
System Interconnection) network architecture model.
 Responsible for the node-to-node delivery of data within the same local
network.
 Major role is to ensure error-free transmission of information.
 Also responsible for encoding, decoding, and organizing the outgoing and
incoming data.
 Considered as the most complex layer of the OSI model as it hides all the
underlying complexities of the hardware from the other above layers.
Data Link Layer in OSI Model
Sub-Layers of The Data Link Layer
The data link layer is further divided into two sub-layers, which are as follows:
Logical Link Control (LLC)
This sublayer of the data link layer deals with multiplexing, the flow of data
among applications and other services, and LLC is responsible for providing
error messages and acknowledgments as well.
Media Access Control (MAC)
MAC sublayer manages the device's interaction, responsible for addressing
frames, and also controls physical media access. The data link layer receives the
information in the form of packets from the Network layer, it divides packets
into frames and sends those frames bit-by-bit to the underlying physical layer.
Functions of The Data-link Layer
There are various benefits of data link layers s let's look into it.

Protocols in Data link layer


There are various protocols in the data link layer, which are as follows:
 Synchronous Data Link Protocol (SDLC)
 High-Level Data Link Protocol (HDLC)
 Serial Line Interface Protocol (SLIP)
 Point to Point Protocol (PPP)
 Link Access Procedure (LAP)
 Link Control Protocol (LCP)
 Network Control Protocol (NCP)
Devices Operating at the Data Link Layer
1.Switch
 A switch is a key device in the Data Link Layer.
 It uses MAC addresses to forward data frames to the correct device
within a network.
 Works in local area networks (LANs) to connect multiple devices.
2. Bridge
 A bridge connects two or more LANs, creating a single, unified network.
 Operates at the Data Link Layer by forwarding frames based on MAC
addresses.
 Used to reduce network traffic and segment a network.
3. Network Interface Card (NIC)
 A NIC is a hardware component in devices like computers and printers.
 Responsible for adding the MAC address to frames and ensuring proper
communication with the network.
 Operates at the Data Link Layer by preparing and sending frames over
the physical medium.
4. Wireless Access Point (WAP)
 A WAP allows wireless devices to connect to a wired network.
 Operates at the Data Link Layer by managing wireless MAC addresses.
 Uses protocols like Wi-Fi (IEEE 802.11) to communicate with devices.
5. Layer 2 Switches
 These are specialized switches that only operate at Layer 2, unlike multi-
layer switches.
 Responsible for frame forwarding using MAC address tables.
Limitations of Data Link Layer
 Limited Scope: It operates only within a local network and cannot handle
end-to-end communication across different networks.
 Increased Overhead: Adding headers, trailers, and redundant data (for
error correction) increases the size of transmitted data.
 Error Handling Dependency: While it can detect and correct some
errors, it relies on upper layers for handling more complex issues.
 No Routing Capability: The Data Link Layer cannot make routing
decisions. It only ensures delivery within the same network segment.
 Resource Usage: Flow control and error correction mechanisms may
consume extra processing power and memory
Applications of Data Link Layer
 Local Area Networks (LANs): Enables reliable communication between
devices within a local network using protocols like Ethernet (IEEE
802.3).
 Wireless Networks (Wi-Fi): Manages communication between devices
in wireless networks via protocols like IEEE 802.11 hence, handling
media access and error control.
 Switches and MAC Addressing: Facilitates the operation of switches by
using MAC addresses to forward data frames to the correct device within
the network.
 Point-to-Point Connections: Used in protocols like PPP (Point-to-Point
Protocol) to establish and manage direct communication between two
nodes.
What is Switching?:-
Switching is the process of transferring data packets from one device to another
in a network, or from one network to another, using specific devices
called switches. A computer user experiences switching all the time for
example, accessing the Internet from your computer device, whenever a user
requests a webpage to open, the request is processed through switching of data
packets only.
Switching takes place at the Data Link layer of the OSI Model. This means that
after the generation of data packets in the Physical Layer, switching is the
immediate next process in data communication.
Introduction to Switch
 A switch is a hardware device in a network that connects and helps
multiple devices share a network without their data interfering with each
other.
 A switch works like a traffic cop at a busy intersection. When a data
packet arrives, the switch decides where it needs to go and sends it
through the right port.
 Some data packets come from devices directly connected to the switch,
like computers or VoIP phones. Other packets come from devices
connected through hubs or routers.
 The switch knows which devices are connected to it and can send data
directly between them. If the data needs to go to another network, the
switch sends it to a router, which forwards it to the correct destination.
What is Network Switching?
A switch is a dedicated piece of computer hardware that facilitates the process
of switching i.e., incoming data packets and transferring them to their
destination. A switch works at the Data Link layer of the OSI Model. A switch
primarily handles the incoming data packets from a source computer or network
and decides the appropriate port through which the data packets will reach their
target computer or network.
A switch decides the port through which a data packet shall pass with the help
of its destination MAC(Media Access Control) Address. A switch does this
effectively by maintaining a switching table, (also known as forwarding table).
A network switch is more efficient than a network Hub or repeater because it
maintains a switching table, which simplifies its task and reduces congestion on
a network, which effectively improves the performance of the network.
The switching process involves the following steps:
 Frame Reception: The switch receives a data frame or packet from a
computer connected to its ports.
 MAC Address Extraction: The switch reads the header of the data
frame and collects the destination MAC Address from it.
 MAC Address Table Lookup: Once the switch has retrieved the MAC
Address, it performs a lookup in its Switching table to find a port that
leads to the MAC Address of the data frame.
 Forwarding Decision and Switching Table Update: If the switch
matches the destination MAC Address of the frame to the MAC address
in its switching table, it forwards the data frame to the respective port.
However, if the destination MAC Address does not exist in its forwarding
table, it follows the flooding process, in which it sends the data frame to
all its ports except the one it came from and records all the MAC
Addresses to which the frame was delivered. This way, the switch finds
the new MAC Address and updates its forwarding table.
 Frame Transition: Once the destination port is found, the switch sends
the data frame to that port and forwards it to its target computer/network.
Types of Switching
There are three types of switching methods:
 Message Switching
 Circuit Switching
 Packet Switching
o Datagram Packet Switching
o Virtual Circuit Packet Switching
Let us now discuss them individually:
Message Switching: This is an older switching technique that has become
obsolete. In message switching technique, the entire data block/message is
forwarded across the entire network thus, making it highly inefficient.
Message Switching
Circuit Switching: In this type of switching, a connection is established
between the source and destination beforehand. This connection receives the
complete bandwidth of the network until the data is transferred completely.
This approach is better than message switching as it does not involve sending
data to the entire network, instead of its destination only.
Circuit Switching
Packet Switching: This technique requires the data to be broken down into
smaller components, data frames, or packets. These data frames are then
transferred to their destinations according to the available resources in the
network at a particular time.
This switching type is used in modern computers and even the Internet. Here,
each data frame contains additional information about the destination and other
information required for proper transfer through network components.
Packet Switching
Datagram Packet Switching: In Datagram Packet switching, each data frame
is taken as an individual entity and thus, they are processed separately. Here, no
connection is established before data transmission occurs. Although this
approach provides flexibility in data transfer, it may cause a loss of data frames
or late delivery of the data frames.
Virtual-Circuit Packet Switching: In Virtual-Circuit Packet switching, a
logical connection between the source and destination is made before
transmitting any data. These logical connections are called virtual circuits. Each
data frame follows these logical paths and provides a reliable way of
transmitting data with less chance of data loss.
Virtual LAN (VLAN):-
Virtual LAN (VLAN) is a concept in which we can divide the devices logically
on layer 2 (data link layer). Generally, layer 3 devices divide the broadcast
domain but the broadcast domain can be divided by switches using the concept
of VLAN.

A broadcast domain is a network segment in which if a device broadcast a


packet then all the devices in the same broadcast domain will receive it. The
devices in the same broadcast domain will receive all the broadcast packets but
it is limited to switches only as routers don't forward out the broadcast packet.
To forward out the packets to different VLAN (from one VLAN to another) or
broadcast domains, inter Vlan routing is needed. Through VLAN, different
small-size sub-networks are created which are comparatively easy to handle.
VLAN ranges:
 VLAN 0, 4095: These are reserved VLAN which cannot be seen or used.
 VLAN 1: It is the default VLAN of switches. By default, all switch ports
are in VLAN. This VLAN can't be deleted or edit but can be used.
 VLAN 2-1001: This is a normal VLAN range. We can create, edit and
delete these VLAN.
 VLAN 1002-1005: These are CISCO defaults for fddi and token rings.
These VLAN can't be deleted.
 Vlan 1006-4094: This is the extended range of Vlan.
Configuration -
We can simply create VLANs by simply assigning the vlan-id and Vlan name.
#switch1(config)#vlan 2
#switch1(config-vlan)#vlan accounts
Here, 2 is the Vlan I'd and accounts is the Vlan name. Now, we assign Vlan to
the switch ports.e.g-
Switch(config)#int fa0/0
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access Vlan 2
Also, switchport range can be assigned to required vlans.
Switch(config)#int range fa0/0-2
Switch(config-if)#switchport mode access
Switch(config-if) #switchport access Vlan 2
By this, switchport fa0/0, fa0/1, fa0-2 will be assigned Vlan 2.
Example -

Assigning IP address 192.168.1.1/24, 192.168.1.2/24 and 192.168.2.1/24 to the


PC's. Now, we will create Vlan 2 and 3 on switch.
Switch(config)#vlan 2
Switch(config)#vlan 3
We have made VLANs but the most important part is to assign switch ports to
the VLANs.
Switch(config)#int fa0/0
Switch(config-if)#switchport mode access
Switch(config-if) #switchport access Vlan 2

Switch(config)#int fa0/1
Switch(config-if)#switchport mode access
Switch(config-if) #switchport access Vlan 3

Switch(config)#int fa0/2
Switch(config-if)#switchport mode access
Switch(config-if) #switchport access Vlan 2
As seen, we have assigned Vlan 2 to fa0/0, fa0/2, and Vlan 3 to fa0/1.
VLANs offer several features and benefits, including:
 Improved network security: VLANs can be used to separate network
traffic and limit access to specific network resources. This improves
security by preventing unauthorized access to sensitive data and network
resources.
 Better network performance: By segregating network traffic into
smaller logical networks, VLANs can reduce the amount of broadcast
traffic and improve network performance.
 Simplified network management: VLANs allow network administrators
to group devices together logically, rather than physically, which can
simplify network management tasks such as configuration,
troubleshooting, and maintenance.
 Flexibility: VLANs can be configured dynamically, allowing network
administrators to quickly and easily adjust network configurations as
needed.
 Cost savings: VLANs can help reduce hardware costs by allowing
multiple virtual networks to share a single physical network
infrastructure.
 Scalability: VLANs can be used to segment a network into smaller, more
manageable groups as the network grows in size and complexity.
Some of the key features of VLANs include:
 VLAN tagging: VLAN tagging is a way to identify and distinguish
VLAN traffic from other network traffic. This is typically done by adding
a VLAN tag to the Ethernet frame header.
 VLAN membership: VLAN membership determines which devices are
assigned to which VLANs. Devices can be assigned to VLANs based on
port, MAC address, or other criteria.
 VLAN trunking: VLAN trunking allows multiple VLANs to be carried
over a single physical link. This is typically done using a protocol such as
IEEE 802.1Q.
 VLAN management: VLAN management involves configuring and
managing VLANs, including assigning devices to VLANs, configuring
VLAN tags, and configuring VLAN trunking.
Types of connections in VLAN -
There are three ways to connect devices on a VLAN, the type of connections are
based on the connected devices i.e. whether they are VLAN-aware(A device
that understands VLAN formats and VLAN membership) or VLAN-unaware(A
device that doesn't understand VLAN format and VLAN membership).
1. Trunk Link -
All connected devices to a trunk link must be VLAN-aware. All frames
on this should have a special header attached to it called tagged frames.
2. Access link -
It connects VLAN-unaware devices to a VLAN-aware bridge. All frames
on the access link must be untagged.
3. Hybrid link -
It is a combination of the Trunk link and Access link. Here both VLAN-
unaware and VLAN-aware devices are attached and it can have both
tagged and untagged frames.
Advantages -
 Performance -
The network traffic is full of broadcast and multicast. VLAN reduces the
need to send such traffic to unnecessary destinations. e.g.-If the traffic is
intended for 2 users but as 10 devices are present in the same broadcast
domain, therefore, all will receive the traffic i.e. wastage of bandwidth
but if we make VLANs, then the broadcast or multicast packet will go to
the intended users only.
 Formation of virtual groups -
As there are different departments in every organization namely sales,
finance etc., VLANs can be very useful in order to group the devices
logically according to their departments.
 Security -
In the same network, sensitive data can be broadcast which can be
accessed by the outsider but by creating VLAN, we can control broadcast
domains, set up firewalls, restrict access. Also, VLANs can be used to
inform the network manager of an intrusion. Hence, VLANs greatly
enhance network security.
 Flexibility -
VLAN provide flexibility to add, remove the number of host we want.
 Cost reduction -
VLANs can be used to create broadcast domains which eliminate the
need for expensive routers.
By using Vlan, the number of small size broadcast domain can be
increased which are easy to handle as compared to a bigger broadcast
domain.
Disadvantages of VLAN
1. Complexity: VLANs can be complex to configure and manage,
particularly in large or dynamic cloud computing environments.
2. Limited scalability: VLANs are limited by the number of available
VLAN IDs, which can be a constraint in larger cloud computing
environments.
3. Limited security: VLANs do not provide complete security and can be
compromised by malicious actors who are able to gain access to the
network.
4. Limited interoperability: VLANs may not be fully compatible with all
types of network devices and protocols, which can limit their usefulness
in cloud computing environments.
5. Limited mobility: VLANs may not support the movement of devices or
users between different network segments, which can limit their
usefulness in mobile or remote cloud computing environments.
6. Cost: Implementing and maintaining VLANs can be costly, especially if
specialized hardware or software is required.
7. Limited visibility: VLANs can make it more difficult to monitor and
troubleshoot network issues, as traffic is isolated in different segments.
Real-Time Applications of VLAN
Virtual LANs (VLANs) are widely used in cloud computing environments to
improve network performance and security. Here are a few examples of real-
time applications of VLANs:
1. Voice over IP (VoIP) : VLANs can be used to isolate voice traffic from
data traffic, which improves the quality of VoIP calls and reduces the risk
of network congestion.
2. Video Conferencing : VLANs can be used to prioritize video traffic and
ensure that it receives the bandwidth and resources it needs for high-
quality video conferencing.
3. Remote Access : VLANs can be used to provide secure remote access to
cloud-based applications and resources, by isolating remote users from
the rest of the network.
4. Cloud Backup and Recovery : VLANs can be used to isolate backup
and recovery traffic, which reduces the risk of network congestion and
improves the performance of backup and recovery operations.
5. Gaming : VLANs can be used to prioritize gaming traffic, which ensures
that gamers receive the bandwidth and resources they need for a smooth
gaming experience.
6. IoT : VLANs can be used to isolate Internet of Things (IoT) devices from
the rest of the network, which improves security and reduces the risk of
network congestion.
Framing in Data Link Layer:-
Frames are the units of digital transmission, particularly in computer networks
and telecommunications. Frames are comparable to the packets of energy called
photons in the case of light energy. Frame is continuously used in Time Division
Multiplexing process.
Framing is a point-to-point connection between two computers or devices
consisting of a wire in which data is transmitted as a stream of bits. However,
these bits must be framed into discernible blocks of information. Framing is a
function of the data link layer. It provides a way for a sender to transmit a set of
bits that are meaningful to the receiver. Ethernet, token ring, frame relay, and
other data link layer technologies have their own frame structures. Frames have
headers that contain information such as error-checking codes.

At the data link layer, it extracts the message from the sender and provides it to
the receiver by providing the sender's and receiver's addresses. The advantage of
using frames is that data is broken up into recoverable chunks that can easily be
checked for corruption.
The process of dividing the data into frames and reassembling it is transparent
to the user and is handled by the data link layer.
Framing is an important aspect of data link layer protocol design because it
allows the transmission of data to be organized and controlled, ensuring that the
data is delivered accurately and efficiently.

Problems in Framing
 Detecting start of the frame: When a frame is transmitted, every station
must be able to detect it. Station detects frames by looking out for a
special sequence of bits that marks the beginning of the frame i.e. SFD
(Starting Frame Delimiter).
 How does the station detect a frame: Every station listens to link for
SFD pattern through a sequential circuit. If SFD is detected, sequential
circuit alerts station. Station checks destination address to accept or reject
frame.
 Detecting end of frame: When to stop reading the frame.
 Handling errors: Framing errors may occur due to noise or other
transmission errors, which can cause a station to misinterpret the frame.
Therefore, error detection and correction mechanisms, such as cyclic
redundancy check (CRC), are used to ensure the integrity of the frame.
 Framing overhead: Every frame has a header and a trailer that contains
control information such as source and destination address, error
detection code, and other protocol-related information. This overhead
reduces the available bandwidth for data transmission, especially for
small-sized frames.
 Framing incompatibility: Different networking devices and protocols
may use different framing methods, which can lead to framing
incompatibility issues. For example, if a device using one framing
method sends data to a device using a different framing method, the
receiving device may not be able to correctly interpret the frame.
 Framing synchronization: Stations must be synchronized with each
other to avoid collisions and ensure reliable communication.
Synchronization requires that all stations agree on the frame boundaries
and timing, which can be challenging in complex networks with many
devices and varying traffic loads.
 Framing efficiency: Framing should be designed to minimize the
amount of data overhead while maximizing the available bandwidth for
data transmission. Inefficient framing methods can lead to lower network
performance and higher latency.
Types of framing
There are two types of framing:

1. Fixed-size: The frame is of fixed size and there is no need to provide


boundaries to the frame, the length of the frame itself acts as a delimiter.
 Drawback: It suffers from internal fragmentation if the data size is less
than the frame size
 Solution: Padding
2. Variable size: In this, there is a need to define the end of the frame as well as
the beginning of the next frame to distinguish. This can be done in two ways:
1. Length field - We can introduce a length field in the frame to indicate the
length of the frame. Used in Ethernet(802.3). The problem with this is
that sometimes the length field might get corrupted.
2. End Delimiter (ED) - We can introduce an ED(pattern) to indicate the
end of the frame. Used in Token Ring. The problem with this is that ED
can occur in the data. This can be solved by:

1. Character/Byte Stuffing: Used when frames consist of characters. If


data contains ED then, a byte is stuffed into data to differentiate it from
ED.

Let ED = "$" --> if data contains '$' anywhere, it can be escaped using '\
O' character.
--> if data contains '\O$' then, use '\O\O\O$'($ is escaped using \O and \O
is escaped using \O).

Disadvantage - It is very costly and obsolete method.


2. Bit Stuffing: Let ED = 01111 and if data = 01111
--> Sender stuffs a bit to break the pattern i.e. here appends a 0 in data =
011101.
--> Receiver receives the frame.
--> If data contains 011101, receiver removes the 0 and reads the data.
Examples:
 If Data --> 011100011110 and ED --> 0111 then, find data after bit
stuffing.
--> 011010001101100
 If Data --> 110001001 and ED --> 1000 then, find data after bit stuffing?
--> 11001010011
framing in the Data Link Layer also presents some challenges, which
include:
Variable frame length: The length of frames can vary depending on the data
being transmitted, which can lead to inefficiencies in transmission. To address
this issue, protocols such as HDLC and PPP use a flag sequence to mark the
start and end of each frame.
Bit stuffing: Bit stuffing is a technique used to prevent data from being
interpreted as control characters by inserting extra bits into the data stream.
However, bit stuffing can lead to issues with synchronization and increase the
overhead of the transmission.
Synchronization: Synchronization is critical for ensuring that data frames are
transmitted and received correctly. However, synchronization can be
challenging, particularly in high-speed networks where frames are transmitted
rapidly.
Error detection: Data Link Layer protocols use various techniques to detect
errors in the transmitted data, such as checksums and CRCs. However, these
techniques are not foolproof and can miss some types of errors.
Efficiency: Efficient use of available bandwidth is critical for ensuring that data
is transmitted quickly and reliably. However, the overhead associated with
framing and error detection can reduce the overall efficiency of the
transmission.
Error Control in Data Link Layer:-
Data-link layer uses the techniques of error control simply to ensure and
confirm that all the data frames or packets, i.e. bit streams of data, are
transmitted or transferred from sender to receiver with certain accuracy. Using
or providing error control at this data link layer is an optimization, it was never
a requirement. Error control is basically process in data link layer of detecting
or identifying and re-transmitting data frames that might be lost or corrupted
during transmission. In both of these cases, receiver or destination does not
receive correct data frame and sender or source does not even know anything
about any such loss regarding data frames. Therefore, in such type of cases,
both sender and receiver are provided with some essential protocols that are
required to detect or identify such types of errors as loss of data frames. The
Data-link layer follows a technique known as re-transmission of frames to
detect or identify transit errors and also to take necessary actions that are
required to reduce or remove such errors. Each and every time an error is
detected during transmission, particular data frames are retransmitted and this
process is known as ARQ (Automatic Repeat Request).
Ways of doing Error Control : There are basically two ways of doing Error
control as given below :

Ways of Error Control


1. Error Detection : Error detection, as the name suggests, simply means
detection or identification of errors. These errors may occur due to noise
or any other impairments during transmission from transmitter to the
receiver, in communication system. It is a class of techniques for
detecting garbled i.e. unclear and distorted data or messages.
2. Error Correction : Error correction, as the name suggests, simply means
correction or solving or fixing of errors. It simply means reconstruction
and rehabilitation of original data that is error-free. But error correction
method is very costly and very hard.
Various Techniques for Error Control : There are various techniques of error
control as given below :
1. Stop-and-Wait ARQ : Stop-and-Wait ARQ is also known as alternating bit
protocol. It is one of the simplest flow and error control techniques or
mechanisms. This mechanism is generally required in telecommunications to
transmit data or information between two connected devices. Receiver simply
indicates its readiness to receive data for each frame. In these, sender sends
information or data packets to receiver. Sender then stops and waits for ACK
(Acknowledgment) from receiver. Further, if ACK does not arrive within given
time period i.e., time-out, sender then again resends frame and waits for ACK.
But, if sender receives ACK, then it will transmit the next data packet to
receiver and then again wait for ACK from receiver. This process to stop and
wait continues until sender has no data frame or packet to send.
2. Sliding Window ARQ : This technique is generally used for continuous
transmission error control. It is further categorized into two categories as given
below :
 Go-Back-N ARQ : Go-Back-N ARQ is form of ARQ protocol in which
transmission process continues to send or transmit total number of frames
that are specified by window size even without receiving an ACK
(Acknowledgement) packet from the receiver. It uses sliding window
flow control protocol. If no errors occur, then operation is identical to
sliding window.
 Selective Repeat ARQ : Selective Repeat ARQ is also form of ARQ
protocol in which only suspected or damaged or lost data frames are only
retransmitted. This technique is similar to Go-Back-N ARQ though much
more efficient than the Go-Back-N ARQ technique due to reason that it
reduces number of retransmission. In this, the sender only retransmits
frames for which NAK is received. But this technique is used less
because of more complexity between sender and receiver and each frame
must be needed to be acknowledged individually.
Flow Control in Data Link Layer:-
Flow control is design issue at Data Link Layer. It is a technique that
generally observes the proper flow of data from sender to receiver. It is very
essential because it is possible for sender to transmit data or information at
very fast rate and hence receiver can receive this information and process it.
This can happen only if receiver has very high load of traffic as compared to
sender, or if receiver has power of processing less as compared to sender.
Flow control is basically a technique that gives permission to two of stations
that are working and processing at different speeds to just communicate with
one another. Flow control in Data Link Layer simply restricts and
coordinates number of frames or amount of data sender can send just before
it waits for an acknowledgement from receiver. Flow control is actually set
of procedures that explains sender about how much data or frames it can
transfer or transmit before data overwhelms receiver. The receiving device
also contains only limited amount of speed and memory to store data. This is
why receiving device should be able to tell or inform the sender about
stopping the transmission or transferring of data on temporary basis before it
reaches limit. It also needs buffer, large block of memory for just storing data
or frames until they are processed.
flow control can also be understand as a speed matching mechanism for two
stations.

Approaches to Flow Control : Flow Control is classified into two


categories:
 Feedback - based Flow Control : In this control technique, sender
simply transmits data or information or frame to receiver, then receiver
transmits data back to sender and also allows sender to transmit more
amount of data or tell sender about how receiver is processing or doing.
This simply means that sender transmits data or frames after it has
received acknowledgements from user.
 Rate – based Flow Control : In this control technique, usually when
sender sends or transfer data at faster speed to receiver and receiver is not
being able to receive data at the speed, then mechanism known as built-in
mechanism in protocol will just limit or restricts overall rate at which data
or information is being transferred or transmitted by sender without any
feedback or acknowledgement from receiver.

Techniques of Flow Control in Data Link Layer : There are basically two
types of techniques being developed to control the flow of data

1. Stop-and-Wait Flow Control : This method is the easiest and simplest


form of flow control. In this method, basically message or data is broken
down into various multiple frames, and then receiver indicates its readiness
to receive frame of data. When acknowledgement is received, then only
sender will send or transfer the next frame. This process is continued until
sender transmits EOT (End of Transmission) frame. In this method, only one
of frames can be in transmission at a time. It leads to inefficiency i.e. less
productivity if propagation delay is very much longer than the transmission
delay and Ultimately In this method sender sent single frame and receiver
take one frame at a time and sent acknowledgement(which is next frame
number only) for new frame.
Advantages -
 This method is very easiest and simple and each of the frames is checked
and acknowledged well.
 This method is also very accurate.
Disadvantages -
 This method is fairly slow.
 In this, only one packet or frame can be sent at a time.
 It is very inefficient and makes the transmission process very slow.
2. Sliding Window Flow Control : This method is required where reliable
in-order delivery of packets or frames is very much needed like in data link
layer. It is point to point protocol that assumes that none of the other entity
tries to communicate until current data or frame transfer gets completed. In
this method, sender transmits or sends various frames or packets before
receiving any acknowledgement. In this method, both the sender and
receiver agree upon total number of data frames after which
acknowledgement is needed to be transmitted. Data Link Layer requires and
uses this method that simply allows sender to have more than one
unacknowledged packet “in-flight” at a time. This increases and improves
network throughput. and Ultimately In this method sender sent multiple
frame but receiver take one by one and after completing one frame
acknowledge(which is next frame number only) for new frame.
Advantages -
 It performs much better than stop-and-wait flow control.
 This method increases efficiency.
 Multiples frames can be sent one after another.
Disadvantages -
 The main issue is complexity at the sender and receiver due to the
transferring of multiple frames.
 The receiver might receive data frames or packets out the sequence.
Access Control in Computer Network:-
Access control is a security strategy that controls who or what can view or
utilize resources in a computer system. It is a fundamental security concept that
reduces risk to the company or organization. In this article, we are going to
discuss every point about access control. In this article, we will learn about
Access control and its authentication factors, components of access control,
types of access control, and the Difference between Authentication and
Authorization.
What is Access Control?
Access Control is a method of limiting access to a system or resources. Access
control refers to the process of determining who has access to what resources
within a network and under what conditions. It is a fundamental concept in
security that reduces risk to the business or organization. Access control systems
perform identification, authentication, and authorization of users and entities by
evaluating required login credentials that may include passwords, pins, bio-
metric scans, or other authentication factors. Multi-factor
authentication requires two or more authentication factors, which is often an
important part of the layered defense to protect access control systems.
Authentication Factors
 Password or PIN
 Bio-metric measurement (fingerprint & retina scan)
 Card or Key
For computer security, access control includes the authorization, authentication,
and audit of the entity trying to gain access. Access control models have a
subject and an object.
Components of Access Control
 Authentication: Authentication is the process of verifying the identity of
a user. User authentication is the process of verifying the identity of a
user when that user logs in to a computer system.
 Authorization: Authorization determines the extent of access to the
network and what type of services and resources are accessible by the
authenticated user. Authorization is the method of enforcing policies.
 Access: After the successful authentication and authorization, their
identity becomes verified, This allows them to access the resource to
which they are attempting to log in.
 Manage: Organizations can manage their access control system by
adding and removing authentication and authorization for users and
systems. Managing these systems can be difficult in modern IT setups
that combine cloud services and physical systems.
 Audit: The access control audit method enables organizations to follow
the principle. This allows them to collect data about user activities and
analyze it to identify possible access violations.
How Access Control Works?
Access control involves determining a user based on their credentials and then
providing the appropriate level of access once confirmed. Credentials are used
to identify and authenticate a user include passwords, pins, security tokens, and
even biometric scans. Multifactor authentication (MFA) increases security by
requiring users to be validated using more than one method. Once a user's
identity has been verified, access control policies grant specified permissions,
allowing the user to proceed further. Organizations utilize several access control
methods depending on their needs.
Types of Access Control
 Attribute-based Access Control (ABAC): In this model, access is
granted or declined by evaluating a set of rules, policies, and relationships
using the attributes of users, systems and environmental conditions.
 Discretionary Access Control (DAC): In DAC, the owner of data
determines who can access specific resources.
 History-Based Access Control (HBAC): Access is granted or declined
by evaluating the history of activities of the inquiring party that includes
behavior, the time between requests and content of requests.
 Identity-Based Access Control (IBAC): By using this model network
administrators can more effectively manage activity and access based on
individual requirements.
 Mandatory Access Control (MAC): A control model in which access
rights are regulated by a central authority based on multiple levels of
security. Security Enhanced Linux is implemented using MAC on
the Linux operating system.
 Organization-Based Access control (OrBAC): This model allows the
policy designer to define a security policy independently of the
implementation.
 Role-Based Access Control (RBAC): RBAC allows access based on the
job title. RBAC eliminates discretion on a large scale when providing
access to objects. For example, there should not be permissions for
human resources specialist to create network accounts.
 Rule-Based Access Control (RAC): RAC method is largely context
based. Example of this would be only allowing students to use the labs
during a certain time of day.
Different access control models are used depending on the compliance
requirements and the security levels of information technology that is to be
protected. Basically access control is of 2 types:
 Physical Access Control: Physical access control restricts entry to
campuses, buildings, rooms and physical IT assets.
 Logical Access Control: Logical access control limits connections to
computer networks, system files and data.
Challenges of Access Control
 Distributed IT Systems: Current IT systems frequently combine internet
and on-premise networks. These systems may be distributed
geographically and comprise various devices, assets, and virtual
machines. Access is allowed to all of these devices, and keeping track of
them can be challenging.
 Policy Management: Policy makers within the organization create
policies, and the IT department converts the planned policies into code
for implementation. Coordination between these two groups is essential
for keeping the access control system up to date and functioning properly.
 Monitoring and Reporting: Organizations must constantly check access
control systems to guarantee compliance with corporate policies and
regulatory laws. Any violations or changes must be recognized and
reported immediately.
 Access Control Models: Access control mechanisms provide varying
levels of precision. Choosing the right access control strategy for your
organization allows you to balance acceptable security with employee
efficiency.
Types of Authentication Mechanism
 Two-factor authentication
 Multi-factor authentication
 one-time password
 Three-factor authentication
 Biometrics
 Hard Tokens
 Soft Tokens
 Contextual Authentication
 Device identification
What Are Some Methods for Implementing Access Control?
Virtual Private Networks are one of the most commonly used techniques to
implement access controls. This allows users to safely access resources
remotely, which is critical when working away from the actual workplace.
VPNs can be used by businesses to offer safe access to their networks when
workers are spread out across the globe. While this is great for security reasons,
it may cause performance concerns, such as latency. Other techniques of access
control include identity repositories, monitoring and reporting apps, password
management tools, provisioning tools, and security policy enforcement services.
Difference between Authentication and Authorization

Authentication Authorization

Authorization determines the extent of


Authentication is the process
access to the network and what type of
of verifying the identity of a
services and resources are accessible by the
user.
authenticated user.

It is done before the While this process is done after the


authorization process. authentication process.

It needs usually the user’s While it needs the user’s privilege or


login details. security levels.

The authorization permissions cannot be


The authentication credentials
changed by user as these are granted by the
can be changed in part as and
owner of the system and only he/she has
when required by the user.
the access to change it.

Authentication determines
While it determines What permission does
whether the person is user or
the user have?
not.

The user authentication is The user authorization is not visible at the


Authentication Authorization

visible at user end. user end.

The user authentication is


The user authorization is carried out
identified with username,
through the access rights to resources by
password, face recognition,
using roles that have been pre-defined.
retina scan, fingerprints, etc.

Data Link Layer Protocols:-


Data Link Layer protocols are generally responsible for ensuring and
confirming that the bits and bytes received are identical to the bits and bytes
being transferred. It is a set of specifications that are used for the
implementation of the data link layer just above the physical layer of the Open
System Interconnections (OSI) Model.
Various data link protocols are required for Wide Area Network (WAN) and
modem connections. Logical Link Control (LLC) is a Local Area Network
(LAN) data link protocol. Some of the data link protocols are given below :

1. Synchronous Data Link Control (SDLC) - SDLC is basically a


communication protocol of computer. It usually supports multipoint links even
error recovery or error correction also. It is usually used to carry SNA (Systems
Network Architecture) traffic and is present precursor to HDLC. It is also
designed and developed by IBM in 1975. It is also used to connect all of the
remote devices to mainframe computers at central locations may be in point-to-
point (one-to-one) or point-to-multipoint (one-to-many) connections. It is also
used to make sure that the data units should arrive correctly and with right flow
from one network point to next network point.
2. High-Level Data Link Protocol (HDLC) - HDLC is basically a protocol
that is now assumed to be an umbrella under which many Wide Area protocols
sit. It is also adopted as a part of X.25 network. It was originally created and
developed by ISO in 1979. This protocol is generally based on SDLC. It also
provides best-effort unreliable service and also reliable service. HDLC is a bit-
oriented protocol that is applicable for point-to-point and multipoint
communications both.
3. Serial Line Interface Protocol (SLIP) - SLIP is generally an older protocol
that is just used to add a framing byte at end of IP packet. It is basically a data
link control facility that is required for transferring IP packets usually among
Internet Service Providers (ISP) and a home user over a dial-up link. It is an
encapsulation of the TCP/IP especially designed to work with over serial ports
and several router connections simply for communication. It is some limitations
like it does not provide mechanisms such as error correction or error detection.
4. Point to Point Protocol (PPP) - PPP is a protocol that is basically used to
provide same functionality as SLIP. It is most robust protocol that is used to
transport other types of packets also along with IP Packets. It can also be
required for dial-up and leased router-router lines. It basically provides framing
method to describe frames. It is a character-oriented protocol that is also used
for error detection. It is also used to provides two protocols i.e. NCP and LCP.
LCP is used for bringing lines up, negotiation of options, bringing them down
whereas NCP is used for negotiating network-layer protocols. It is required for
same serial interfaces like that of HDLC.
5. Link Control Protocol (LCP) - It was originally developed and created by
IEEE 802.2. It is also used to provide HDLC style services on LAN (Local Area
Network). LCP is basically a PPP protocol that is used for establishing,
configuring, testing, maintenance, and ending or terminating links for
transmission of data frames.
6. Link Access Procedure (LAP) - LAP protocols are basically a data link
layer protocols that are required for framing and transferring data across point-
to-point links. It also includes some reliability service features. There are
basically three types of LAP i.e. LAPB (Link Access Procedure Balanced),
LAPD (Link Access Procedure D-Channel), and LAPF (Link Access Procedure
Frame-Mode Bearer Services). It is actually originated from IBM SDLC, which
is being submitted by IBM to the ISP simply for standardization.
7. Network Control Protocol (NCP) - NCP was also an older protocol that was
implemented by ARPANET. It basically allows users to have access to use
computers and some of the devices at remote locations and also to transfer files
among two or more computers. It is generally a set of protocols that is forming a
part of PPP. NCP is always available for each and every higher-layer protocol
that is supported by PPP. NCP was replaced by TCP/IP in the 1980s.
4.NETWORK LAYER:-
Network Layer in OSI Model
The Network Layer is the 5th Layer from the top and the 3rd layer from the
Bottom of the OSI Model. It is one of the most important layers which plays a
key role in data transmission. The main job of this layer is to maintain the
quality of the data and pass and transmit it from its source to its destination. It
also handles routing, which means that it chooses the best path to transmit the
data from the source to its destination, not just transmitting the packet. There are
several important protocols that work in this layer.
Network Layer in OSI Model
Data is transmitted in the form of packets via various logical network pathways
between various devices. It offers routes for data packet transfers across the
network. The network layer is also responsible for organizing and controlling
the available paths for data transfer.
Functions of Network Layer
Some of the most important functions of the network layer are given below :
1. Assigning Logical Address: It provides unique IP addresses to devices
for identification and communication across networks.
2. Packetizing: It encapsulates data into packets for efficient transmission.
3. Host-to-Host Delivery: It ensures data is delivered from the sender to the
intended receiver across networks.
4. Forwarding: It is the process of moving packets from the input to the
appropriate output interface in a router, based on the destination address
5. Fragmentation and Reassembly: It splits large packets into smaller
fragments for transmission and reassembles them at the destination.
6. Logical Subnetting: It divides larger networks into smaller subnetworks
for better management and routing efficiency.
7. Network Address Translation (NAT): Maps private IP addresses to a
public IP for internet access, conserving IPs and adding security.
8. Routing: It determines the best path for packets to travel to their
destination across multiple networks.

Read more about Functions of Network Layer.


How Does the Network Layer Work?
 Every device gets a unique address (IP address) to identify it on the
network.
 Data is packaged into small packets, with labels showing where it’s
coming from and where it’s going.
 Routers figure out the best path to send the packets to their destination.
 Packets travel step by step through different routers until they reach the
right device.
 If a packet is too big, it gets broken into smaller pieces to fit through the
network.
 At the destination, the pieces are put back together into the original data.
 If something goes wrong, like the destination can’t be reached, an error
message is sent back.
Protocols Used at Network Layer
The protocols used at the Network Layer are:
1. IP (Internet Protocol)
2. ICMP (Internet Control Message Protocol)
3. ARP (Address Resolution Protocol)
4. RARP (Reverse Address Resolution Protocol)
5. NAT (Network Address Translation)
6. Routing Protocols:
 RIP (Routing Information Protocol)
 OSPF (Open Shortest Path First)
 BGP (Border Gateway Protocol)
7. IPSec (Internet Protocol Security)
8. MPLS (Multiprotocol Label Switching)
Advantages of Network Layer
 Using the network layer in the OSI paradigm offers a multitude of
advantages. Let's delve into some of these benefits:
 The network layer takes the data and breaks it down into packets, which
makes transmitting the data over the network easier. This process also
eliminates any weak points in the transmission, ensuring that the packet
successfully reaches its intended destination.
 Router is the important component of the network layer . Its role is to
reduce network congestion by facilitating collisions and broadcasting the
domains within the network layer.
 Used to send data packets across the network nodes, the forwarding
method is various.
Limitations of Network Layer
 There is no flow control mechanism provided by the network layer
design.
 There may be times when there are too many datagrams in transit over
the network, causing congestion. This could put further strain on the
network routers. In some circumstances, the router may lose some data
packets if there are too many datagrams. Important data may be lost in the
process of transmission as a result of this.
 Indirect control cannot be implemented at the network layer since the
data packets are broken up before being sent. Additionally, this layer
lacks effective error control systems.
Difference Between Routing and Flooding
Routing Flooding

A routing table is required. No Routing table is required

May give the shortest path. Always gives the shortest path.

Routing is less reliable Flooding is more reliable

Traffic is less in Routing Traffic is more in Flooding

Duplicate packets are not present Duplicate packet are present

Introduction of Classful IP Addressing:-


An IP address is an address that has information about how to reach a specific
host, especially outside the LAN. An IP address is a 32-bit unique address
having an address space of 232.
Classful IP addressing is a way of organizing and managing IP addresses,
which are used to identify devices on a network. Think of IP addresses like
street addresses for houses; each device on a network needs its unique address
to communicate with other devices. In this article, we will discuss Classful IP
addresses, and their types in detail.
Classful IP Addressing
Classful IP addressing is an obsolete method for allocating IP addresses and
dividing the available IP address space across networks. It was used from 1981
to 1993 until the introduction of CIDR (Based on Prefixes rather than classes).
Classful method categorizes IP addresses into five classes (A, B, C, D, and E),
each defined by the first few bits of the address and serving specific ranges of
purposes. The functionality of classful networking also extended to ease of
configuration. Network administrators could set up networks with default
subnet masks without the need for detailed subnetting strategies, which was
particularly beneficial in less complex networking environments.
IPV4 Address
An IPv4 address is a unique number assigned to every device that connects to
the internet or a computer network. It's like a home address for your computer,
smartphone, or any other device, allowing it to communicate with other devices.
 Format: An IPv4 address is written as four numbers separated by
periods, like this: 192.168.1.1. Each number can range from 0 to 255.
 The IPv4 address is divided into two parts: NID (Network ID) = 8bit,
and HID (Host ID) = 24bit. So there are 28 which is 256 total networks
created and 224 which is 16M Host per network.
 Purpose: The main purpose of an IPv4 address is to identify devices on a
network and ensure that data sent from one device reaches the correct
destination.
 Example: When you type a website address into your browser, your
device uses the IPv4 address to find and connect to the server where the
website is hosted.
There are two notations in which the IP address is written, dotted decimal
and hexadecimal notation.
Dotted Decimal Notation
Some points to be noted about dotted decimal notation:
 The value of any segment (byte) is between 0 and 255 (both included).
 No zeroes preceding the value in any segment (054 is wrong, 54 is
correct).

Dotted Decimal Notation


Hexadecimal Notation
Need For Classful Addressing
 Classful addressing provided a straightforward method to allocate and
manage IP addresses based on fixed classes, simplifying the
administrative burden associated with IP address distribution.
 Network equipment of the time, such as routers, could be more easily
programmed to handle a limited number of fixed classes, speeding up the
routing process because the class of an address could be quickly
identified from its first few bits.
 While it did have limitations, classful addressing allowed for scaling of
networks within the bounds of each class size. Larger networks could use
a Class A or B address, and smaller networks could operate efficiently
within a Class C subnet.
 By standardizing address ranges, classful addressing facilitated the
implementation of uniform network protocols, which was important for
the interoperability of network devices across different networks and
platforms.
 Classful addressing was a cost-effective solution that supported the early
expansion of the Internet by avoiding the need for complex subnetting
schemes that require additional computing resources and more
sophisticated network management tools.
Classes of IP Addressing
The 32-bit IP address is divided into five sub-classes. These are given below:
 Class A
 Class B
 Class C
 Class D
 Class E
Each of these classes has a valid range of IP addresses. Classes D and E are
reserved for multicast and experimental purposes respectively. The order of bits
in the first octet determines the classes of the IP address.
The class of IP address is used to determine the bits used for network ID and
host ID and the number of total networks and hosts possible in that particular
class. Each ISP or network administrator assigns an IP address to each device
that is connected to its network.

Classful Addressing
Note:
 IP addresses are globally managed by Internet Assigned Numbers
Authority (IANA) and Regional Internet Registries (RIR).
 While finding the total number of host IP addresses, 2 IP addresses are
not counted and are therefore, decreased from the total count because the
first IP address of any network is the network number and whereas the
last IP address is reserved for broadcast IP.

Occupation of The Address Space


In Classful Addressing
Class A
IP addresses belonging to class A are assigned to the networks that contain a
large number of hosts.
 The network ID is 8 bits long.
 The host ID is 24 bits long.
The higher-order bit of the first octet in class A is always set to 0. The remaining
7 bits in the first octet are used to determine network ID. The 24 bits of host ID
are used to determine the host in any network. The default subnet mask for
Class A is 255.x.x.x. Therefore, class A has a total of:
 224 - 2 = 16,777,214 host ID
IP addresses belonging to class A ranges from 0.0.0.0 - 127.255.255.255.

Class A
Class B
IP address belonging to class B is assigned to networks that range from
medium-sized to large-sized networks.
 The network ID is 16 bits long.
 The host ID is 16 bits long.
The higher-order bits of the first octet of IP addresses of class B are always set
to 10. The remaining 14 bits are used to determine the network ID. The 16 bits
of host ID are used to determine the host in any network. The default subnet
mask for class B is 255.255.x.x. Class B has a total of:
 214 = 16384 network address
 216 - 2 = 65534 host address
IP addresses belonging to class B ranges from 128.0.0.0 – 191.255.255.255.

Class B
Class C
IP addresses belonging to class C are assigned to small-sized networks.
 The network ID is 24 bits long.
 The host ID is 8 bits long.
The higher-order bits of the first octet of IP addresses of class C is always set to
110. The remaining 21 bits are used to determine the network ID. The 8 bits of
host ID are used to determine the host in any network. The default subnet
mask for class C is 255.255.255.x. Class C has a total of:
 221 = 2097152 network address
 28 – 2 = 254 host address
IP addresses belonging to class C range from 192.0.0.0 – 223.255.255.255.

Class C
Class D
IP address belonging to class D is reserved for multi-casting. The higher-order
bits of the first octet of IP addresses belonging to class D is always set to 1110.
The remaining bits are for the address that interested hosts recognize.
Class D does not possess any subnet mask. IP addresses belonging to class D
range from 224.0.0.0 – 239.255.255.255.

Class D
Class E
IP addresses belonging to class E are reserved for experimental and research
purposes. IP addresses of class E range from 240.0.0.0 – 255.255.255.255. This
class doesn’t have any subnet mask. The higher-order bits of the first octet of
class E are always set to 1111.
Class E
Range of Special IP Addresses
169.254.0.0 – 169.254.0.16 : Link-local addresses
127.0.0.0 – 127.255.255.255 : Loop-back addresses
0.0.0.0 – 0.0.0.8: used to communicate within the current network.
Rules for Assigning Host ID
Host IDs are used to identify a host within a network. The host ID is assigned
based on the following rules:
 Within any network, the host ID must be unique to that network.
 A host ID in which all bits are set to 0 cannot be assigned because this
host ID is used to represent the network ID of the IP address.
 Host ID in which all bits are set to 1 cannot be assigned because this host
ID is reserved as a broadcast address to send packets to all the hosts
present on that particular network.
Rules for Assigning Network ID
Hosts that are located on the same physical network are identified by the
network ID, as all host on the same physical network is assigned the same
network ID. The network ID is assigned based on the following rules:
 The network ID cannot start with 127 because 127 belongs to the class A
address and is reserved for internal loopback functions.
 All bits of network ID set to 1 are reserved for use as an IP broadcast
address and therefore, cannot be used.
 All bits of network ID set to 0 are used to denote a specific host on the
local network and are not routed and therefore, aren’t used.
Structure of Classful Addressing
In the above table No. of networks for class A should be 127. (Network ID with
all 0 s is not considered)
Problems With Classful Addressing
The problem with this classful addressing method is that millions of class A
addresses are wasted, many of the class B addresses are wasted, whereas, the
number of addresses available in class C is so small that it cannot cater to the
needs of organizations. Class D addresses are used for multicast routing and are
therefore available as a single block only. Class E addresses are reserved.
Since there are these problems, Classful networking was replaced by Classless
Inter-Domain Routing (CIDR) in 1993. We will be discussing Classless
addressing in the next post.
 The network ID is 24 bits long.
 The host ID is 8 bits long.
 221 = 2097152 network address
 28 - 2 = 254 host address
 Within any network, the host ID must be unique to that network.
 Host ID in which all bits are set to 0 cannot be assigned because this host
ID is used to represent the network ID of the IP address.
 Host ID in which all bits are set to 1 cannot be assigned because this host
ID is reserved as a broadcast address to send packets to all the hosts
present on that particular network.
 The network ID cannot start with 127 because 127 belongs to the class A
address and is reserved for internal loopback functions.
 All bits of network ID set to 1 are reserved for use as an IP broadcast
address and therefore, cannot be used.
 All bits of network ID set to 0 are used to denote a specific host on the
local network and are not routed and therefore, aren't used.
Classful and Classless Addressing
Here is the main difference between Classful and Classless Addressing:

Parameter Classful Addressing Classless Addressing

Classless addressing
In Classful addressing IP came to replace the
addresses are allocated classful addressing and
Basics
according to the classes- A to to handle the issue of
E. rapid exhaustion of IP
addresses.

Practical It is less practical. It is more practical.

The changes in the Network There is no such


Network ID and
ID and Host ID depend on restriction of class in
Host ID
the class. classless addressing.

It does not support the It supports the Variable


VLSM Variable Length Subnet Length Subnet Mask
Mask (VLSM). (VLSM).

Classful addressing requires It requires less


more bandwidth. As a result, bandwidth. Thus, fast
Bandwidth it becomes slower and more and less expensive as
expensive as compared to compared to classful
classless addressing. addressing.

CIDR It does not support Classless It supports Classless


Inter-Domain Routing Inter-Domain Routing
Parameter Classful Addressing Classless Addressing

(CIDR). (CIDR).

Updates Regular or periodic updates Triggered Updates

Troubleshooting and
problem detection are easy
Troubleshooting It is not as easy
than classless addressing
and Problem compared to classful
because of the division of
detection addressing.
network, host and subnet
parts in the address.

 Network
Division of  Host
 Host
Address  Subnet
 Subnet

Classless Addressing in IP Addressing:-


The Network address identifies a network on the internet. Using this, we can
find a range of addresses in the network and total possible number of hosts in
the network.
Mask is a 32-bit binary number that gives the network address in the address
block when AND operation is bitwise applied on the mask and any IP address of
the block.
The default masks in different classes are :
 Class A - 255.0.0.0
 Class B - 255.255.0.0
 Class C - 255.255.255.0
Question: Given IP address 132.6.17.85 and default class B mask, find the
beginning address (network address).
Solution: The default mask is 255.255.0.0, which means that only the first 2
bytes are preserved and the other 2 bytes are set to 0. Therefore, the network
address is 132.6.0.0.
Subnetting
Dividing a large block of addresses into several contiguous sub-blocks and
assigning these sub-blocks to different smaller networks is called subnetting. It
is a practice that is widely used when classless addressing is done.
A subnet or subnetwork is a network inside a network. Subnets make networks
more efficient. Through subnetting, network traffic can travel a shorter distance
without passing through unnecessary routers to reach its destination.
Classless Addressing
To reduce the wastage of IP addresses in a block, we use sub-netting. What we
do is that we use host id bits as net id bits of a classful IP address. We give the
IP address and define the number of bits for mask along with it (usually
followed by a '/' symbol), like, 192.168.1.1/28. Here, subnet mask is found by
putting the given number of bits out of 32 as 1, like, in the given address, we
need to put 28 out of 32 bits as 1 and the rest as 0, and so, the subnet mask
would be 255.255.255.240. A classless addressing system or classless
interdomain routing (CIDR or supernetting) is the way to combine two or more
class C networks to create a/23 or a /22 supernet. A classless addressing system
or classless interdomain routing (CIDR) is an improved IP addressing system.
In a classless addressing system the block of IP address is assigned dynamically
based on specific rules.
Some Values Calculated in Subnetting:
1. Number of subnets : 2(Given bits for mask - No. of bits in default mask)
2. Subnet address : AND result of subnet mask and the given IP address
3. Broadcast address : By putting the host bits as 1 and retaining the network
bits as in the IP address
4. Number of hosts per subnet : 2(32 - Given bits for mask) - 2
5. First Host ID : Subnet address + 1 (adding one to the binary representation of
the subnet address)
6. Last Host ID : Subnet address + Number of Hosts.
What is an IP Address?:-
Imagine every device on the internet as a house. For you to send a letter to a
friend living in one of these houses, you need their home address. In the digital
world, this home address is what we call an IP (Internet Protocol) Address. It's
a unique string of numbers separated by periods (IPv4) or colons (IPv6) that
identifies each device connected to the internet or a local network.
Here's the definition:
What is an IP Address?
An IP address, or Internet Protocol address, is a unique string of numbers
assigned to each device connected to a computer network that uses the Internet
Protocol for communication. It serves as an identifier that allows devices to
send and receive data over the network, ensuring that this data reaches the
correct destination.
Types of IP Address
IP addresses can be classified in several ways based on their structure, purpose,
and the type of network they are used in. Here's a breakdown of the different
classifications of IP addresses:
1. Based on Addressing Scheme (IPv4 vs. IPv6)
IPv4:
This is the most common form of IP Address. It consists of four sets of numbers
separated by dots. For example, 192.158.1.38. Each set of numbers can range
from 0 to 255. This format can support over 4 billion unique addresses. Here's
how the structure is broken down:
 Four Octets: Each octet represents eight bits, or a byte, and can take a
value from 0 to 255. This range is derived from the possible combinations
of eight bits (2^8 = 256 combinations).
 Example of IPv4 Address: 192.168.1.1
o 192 is the first octet
o 168 is the second octet
o 1 is the third octet
o 1 is the fourth octet
Each part of the IP address can indicate various aspects of the network
configuration, from the network itself to the specific device within that network.
In most cases, the network part of the address is represented by the first one to
three octets, while the remaining section identifies the host (device).
IPv4 Address Format
IPv6:
IPv6 addresses were created to deal with the shortage of IPv4 addresses. They
use 128 bits instead of 32, offering a vastly greater number of possible
addresses. These addresses are expressed as eight groups of four hexadecimal
digits, each group representing 16 bits. The groups are separated by colons.
 Example of IPv6 Address: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
o Each group (like 2001, 0db8, 85a3, etc.) represents a 16-bit block
of the address.
For detailed information, refer to this article - IPv4 vs. IPv6
2. Based on Usage (Public vs. Private)
Public IP Addresses
A Public IP address is assigned to every device that directly accesses the
internet. This address is unique across the entire internet. Here are the key
characteristics and uses of public IP addresses:
 Uniqueness: Each public IP address is globally unique. No two devices
on the internet can have the same public IP address at the same time.
 Accessibility: Devices with a public IP address can be accessed directly
from anywhere on the internet, assuming no firewall or security settings
block the access.
 Assigned by ISPs: Public IP addresses are assigned by Internet Service
Providers (ISPs). When you connect to the internet through an ISP, your
device or router receives a public IP address.
 Types: Public IP addresses can be static (permanently assigned to a
device) or dynamic (temporarily assigned and can change over time).
Example Use: Public IP addresses are typically used for servers hosting
websites, email servers, or any device that needs to be accessible from the
internet. For instance, if you host a website on your own server at home, your
ISP must assign a public IP address to your server so users around the world
can access your site.
Private IP Addresses
Private IP addresses are used within private networks (such as home networks,
office networks, etc.) and are not routable on the internet. This means that
devices with private IP addresses cannot directly communicate with devices on
the internet without a translating mechanism like a router performing Network
Address Translation (NAT). Key features include:
 Not globally unique: Private IP addresses are only required to be unique
within their own network. Different private networks can use the same
range of IP addresses without conflict.
 Local communication: These addresses are used for communication
between devices within the same network. They cannot be used to
communicate directly with devices on the internet.
 Defined ranges: The Internet Assigned Numbers Authority (IANA) has
reserved specific IP address ranges for private use:
o IPv4: 10.0.0.0 to 10.255.255.255, 172.16.0.0 to 172.31.255.255,
192.168.0.0 to 192.168.255.255
o IPv6: Addresses starting with FD or FC
Example Use: In a typical home network, the router assigns private IP
addresses to each device (like smartphones, laptops, smart TVs) from the
reserved ranges. These devices use their private IPs to communicate with each
other and with the router. The router uses NAT to allow these devices to access
the internet using its public IP address.

3. Based on Assignment Method (Static vs. Dynamic)


Static IP Addresses:
 These are permanently assigned to a device, typically important for
servers or devices that need a constant address.
 Reliable for network services that require regular access such as websites,
remote management.
Dynamic IP Addresses:
 Temporarily assigned from a pool of available addresses by the Dynamic
Host Configuration Protocol (DHCP).
 Cost-effective and efficient for providers, perfect for consumer devices
that do not require permanent addresses.
For detailed information, refer to this article - Static vs. Dynamic IP Address
How Do IP Addresses Work?
Here's how IP addresses work:
1. Unique Identification
Every device connected to a network, such as computers, smartphones, and
servers, is assigned an IP address. This address is used to identify the device on
the network, similar to how a home address identifies a specific location.
2. Communication Protocol
The Internet Protocol (IP), part of the broader suite of internet protocols, uses
these addresses to facilitate the routing of data packets between devices. Each
piece of data sent over a network is broken into smaller units called packets.
Each packet includes both the sender's and the recipient's IP addresses.
3. Data Routing
When a device sends information to another device over the internet:
 The data is divided into packets.
 Each packet contains the IP address of the device it is destined for.
 Routers within the network read the destination IP address on each packet
and determine the best path for the packet to travel. Routers communicate
with each other to update and maintain records of the fastest, most
efficient routes for data.
4. Local Area Networks (LAN) and Wide Area Networks (WAN)
 LAN: On local networks, IP addresses can be assigned manually by an
administrator (static IP) or automatically by a DHCP server. Devices
within the same network communicate directly using their local IP
addresses.
 WAN: For devices on different networks, the data must travel through
multiple routers across the internet. Each router makes independent
decisions about the best route for the packets based on the destination IP
address.
5. Network Address Translation (NAT)
Most devices on a home or small business network share a single public IP
address when accessing the internet, even though each device has its own
private IP address within the local network. NAT is a process where multiple
local IP addresses are mapped to a single public IP address. This conserves IP
addresses and adds a layer of security by hiding internal IP addresses from the
external network.
Real World Scenario: Sending an Email from New York to Tokyo
Let's explore how IP addresses work through a real-world example that involves
sending an email from one person to another across the globe:
Step 1: Assigning IP Addresses
 Alice in New York wants to send an email to Bob in Tokyo.
 Alice’s laptop has a private IP address (e.g., 192.168.1.5) assigned by her
router at home.
 Bob's computer in Tokyo has a private IP address (e.g., 192.168.2.4)
assigned by his router at his office.
Step 2: Connection to the Internet
 Both Alice and Bob’s routers have public IP addresses assigned by their
Internet Service Providers (ISPs). These public IP addresses are what the
devices use to send and receive data over the internet.
Step 3: Sending the Email
 Alice writes her email and hits send.
 Her email service (e.g., Gmail) packages the message and its attachments
into data packets. Each packet includes the source IP (Alice’s router's
public IP) and the destination IP (Bob’s email server's public IP).
Step 4: Routing the Packets
 The data packets leave Alice’s laptop and travel to her home router. The
router notes that the destination IP is outside the local network.
 The router sends the packets to Alice's ISP. The ISP uses routers that
examine the destination IP address of the packets and determine the best
route to send them toward their destination.
 The packets may pass through several routers around the world — in data
centers in countries like Canada, Germany, and finally Japan. Each router
along the way reads the destination IP and forwards the packets
accordingly.
Step 5: Reaching Bob
 The packets arrive at Bob's email server's ISP in Tokyo and are then
forwarded to the server.
 Bob's email server reassembles the packets into the original email
message.
Step 6: Bob Accesses the Email
 Bob’s computer requests the email from his server using his local
network IP.
 The server sends the email to Bob's computer, allowing him to read the
message Alice sent.
Additional Details
 NAT (Network Address Translation): Both Alice and Bob's routers
perform NAT, translating the private IP addresses to and from the public
IP addresses when interfacing with the internet. This process is crucial for
keeping the number of public IPs needed lower and adds a layer of
security by masking internal network structures.
 Dynamic IP Addressing: If either Alice or Bob’s public IP is dynamic, it
might change if they restart their routers. This doesn’t affect their ongoing
activities much because the DNS (Domain Name System) helps update
the mapping of domain names (like gmail.com) to the current IP
addresses.
This example illustrates the fundamental role of IP addresses and the complex
network of routers involved in even the simplest internet activities like sending
an email. Each part of the process depends on the IP address to ensure that data
finds its way correctly from sender to receiver, no matter where they are in the
world.
---> Other Important Things to Know About IP Address
Classes of IPv4 Address
There are around 4.3 billion IPv4 addresses and managing all those addresses
without any classification is next to impossible.
Let’s understand it with a simple example. If you have to find a word from a
language dictionary, how long will it take just think about it. Usually you will
take less than 5 minutes to find that word. You are able to do this because words
in the dictionary are organized in alphabetical order. If you have to find out the
same word from a dictionary that doesn’t use any sequence or order to organize
the words, it will take an eternity to find the word. If a dictionary with one
billion words without order can be so disastrous, then you can imagine the pain
behind finding an address from 4.3 billion addresses.
For easier management and assignment IP addresses are organized in numeric
order and divided into the following 5 classes:
IP addresses are also classified into different classes based on their range
and intended use:
 Class A (1.0.0.0 to 127.255.255.255):
o Used for very large networks (like multinational companies).
o Supports up to 16 million hosts per network.
o Example: 10.0.0.1 (Private IP in this class).
 Class B (128.0.0.0 to 191.255.255.255):
o Used for medium-sized networks, such as large organizations.
o Supports up to 65,000 hosts per network.
o Example: 172.16.0.1 (Private IP in this class).
 Class C (192.0.0.0 to 223.255.255.255):
o Used for smaller networks, like small businesses or home
networks.
o Supports up to 254 hosts per network.
o Example: 192.168.1.1 (Private IP in this class).
 Class D (224.0.0.0 to 239.255.255.255):
o Reserved for multicast groups (used to send data to multiple
devices at once).
o Not used for traditional devices or networks.
 Class E (240.0.0.0 to 255.255.255.255):
o Reserved for experimental purposes and future use.
IP Class Address Range Maximum number of networks

Class A 1-126 126 (27-2)

Class B 128-191 16384

Class C 192-223 2097152

Class
224-239 Reserve for multitasking
D

Class E 240-254 Reserved for Research and development

Special IP Addresses
There are also some special-purpose IP addresses that don't follow the usual
structure:
 Loopback Address:
o The loopback address 127.0.0.1 is used to test network
connectivity within the same device (i.e., sending data to yourself).
o Often called "localhost."
 Broadcast Address:
o The broadcast address allows data to be sent to all devices in a
network. For a typical network with the IP range 192.168.1.0/24,
the broadcast address would be 192.168.1.255.
 Multicast Address:
o Used to send data to a group of devices (multicast). For
example, 233.0.0.1 is a multicast address.
How to Look Up IP Addresses?
In Windows
1. Open the Command Prompt.
2. Type ipconfig and press Enter.
3. Look for your IP under your network connection.
On Mac
1. Open System Preferences > Network.
2. Select your active connection.
3. You’ll see your IP address in the connection details.
On iPhone
1. Go to Settings > Wi-Fi.
2. Tap the (i) icon next to your network.
3. Find your IP under "IP Address."
IP Address Security Threats
IP addresses are essential for connecting devices on the internet, but they also
come with various security risks. Understanding these threats can help you
protect your network and personal information more effectively. Here are some
common IP address security threats:
 IP Spoofing: Hackers use this technique to bypass security measures,
launch attacks, or gain unauthorized access to systems. By pretending to
be a trusted IP address, attackers can trick networks into granting them
access or allowing malicious activities.
 Distributed Denial of Service (DDoS) Attacks: This happens by
overloading a website or service with too much traffic. Many hacked
devices send lots of requests to a target all at once, making the website or
service crash. This means real users can’t access it which can cause
crashing of site, businesses to lose money and many more.
 Man-in-the-Middle (MitM) Attacks: Eavesdropping or altering
messages between two people without letting them know is MitM attack.
Attackers intercept the communication between two parties and can steal
sensitive information like passwords or credit card details by targeting the
IP addresses involved.
 Port Scanning: It is a technique used to identify open ports and services
running on a device's IP address. Hackers use port scanners to find
vulnerabilities in network services, which they can then exploit to gain
unauthorized access or deploy malware. Regularly monitoring and
securing open ports is essential to prevent such attacks.
How to Protect and Hide Your IP Address?
 VPN (Virtual Private Network): A VPN hides your IP by masking it
with the VPN server’s IP, giving you privacy. Your internet traffic passes
through the VPN server, masking your real IP address with the server’s
IP. This makes it difficult for others to track your online activities or
identify your location.
 Proxy Server: Routes your data through a different server, hiding your
real IP. When you use a proxy, your requests go through the proxy server,
which hides your real IP address by replacing it with its own.
 Tor Browser: Encrypts and bounces your data around multiple servers
for anonymity. This multi-layered routing makes it extremely difficult to
trace your IP address or monitor your online activities.
 Enable Your Firewall: A firewall is a security system that monitors and
controls incoming and outgoing network traffic. It can block unauthorized
access to your device, making it harder for attackers to target your IP
address.
IPv4 Datagram Header:-
IP stands for Internet Protocol and v4 stands for Version Four (IPv4). IPv4
was the primary version brought into action for production within the
ARPANET in 1983. IP version four addresses are 32-bit integers which will
be expressed in decimal notation. In this article, we will discuss about IPv4
datagram header.
IPv4 is a connectionless protocol used for packet-switched
networks. Internet Protocol Version 4 (IPv4) is the fourth revision of the
Internet Protocol and a widely used protocol in data communication over
different kinds of networks. IPv4 is a connectionless protocol used in packet-
switched layer networks, such as Ethernet. It provides a logical connection
between network devices by providing identification for each device. There
are many ways to configure IPv4 with all kinds of devices – including
manual and automatic configurations – depending on the network type. IPv4
uses 32-bit addresses for Ethernet communication in five classes: A, B, C, D
and E. Classes A, B, and C have a different bit length for addressing the
network host. Class D addresses are reserved for multicasting, while class E
addresses are reserved for military purposes. IPv4 uses 32-bit (4-byte)
addressing, which gives 232 addresses. IPv4 addresses are written in the dot-
decimal notation, which comprises four octets of the address expressed
individually in decimal and separated by periods, for instance, 192.168.1.5.
Characteristics of IPv4
 IPv4 could be a 32-Bit IP Address.
 IPv4 could be a numeric address, and its bits are separated by a dot.
 The number of header fields is twelve and the length of the header field is
twenty.
 It has Unicast, broadcast, and multicast style of addresses.
 IPv4 supports VLSM (Virtual Length Subnet Mask).
 IPv4 uses the Post Address Resolution Protocol to map to the MAC
address.
 RIP may be a routing protocol supported by the routed daemon.
 Networks ought to be designed either manually or with DHCP.
 Packet fragmentation permits from routers and causing host.
IPv4 Datagram Header
 VERSION: Version of the IP protocol (4 bits), which is 4 for IPv4
 HLEN: IP header length (4 bits), which is the number of 32 bit words in
the header. The minimum value for this field is 5 and the maximum is
15.
 Type of service: Low Delay, High Throughput, Reliability (8 bits)
 Total Length: Length of header + Data (16 bits), which has a minimum
value 20 bytes and the maximum is 65,535 bytes.
 Identification: Unique Packet Id for identifying the group of fragments
of a single IP datagram (16 bits)
 Flags: 3 flags of 1 bit each : reserved bit (must be zero), do not fragment
flag, more fragments flag (same order)
 Fragment Offset: Represents the number of Data Bytes ahead of the
particular fragment in the particular Datagram. Specified in terms of
number of 8 bytes, which has the maximum value of 65,528 bytes.
 Time to live: Datagram’s lifetime (8 bits), It prevents the datagram to
loop through the network by restricting the number of Hops taken by a
Packet before delivering to the Destination.
 Protocol: Name of the protocol to which the data is to be passed (8 bits)
 Header Checksum: 16 bits header checksum for checking errors in the
datagram header
 Source IP address: 32 bits IP address of the sender
 Destination IP address: 32 bits IP address of the receiver
 Option: Optional information such as source route, record route. Used by
the Network administrator to check whether a path is working or not.

IPv4 Datagram Header


Due to the presence of options, the size of the datagram header can be of
variable length (20 bytes to 60 bytes).
Difference Between IPv4 and IPv6:-
IPv4 and IPv6 are two versions of the system that gives devices a unique
address on the internet, known as the Internet Protocol (IP). IP is like a set of
rules that helps devices send and receive data online. Since the internet is
made up of billions of connected devices, each one needs its own special
number an IP address to be found.
IPv4 is the older version and uses a 32-bit address, which allows for about 4
billion unique addresses. It was used to be enough, but with the growth of
the internet and smart devices (IoT), we’re running out of IPv4 addresses
that’s why IPv6 was created. It uses a 128-bit address, which means it can
provide trillions upon trillions of unique addresses, solving the shortage
problem and preparing the internet for the future.
What is IPv4?
IPv4, or Internet Protocol version 4, is the original addressing system of the
Internet, introduced in 1983. It uses a 32-bit address scheme, which
theoretically allows for over 4 billion unique addresses (232). IPv4 addresses
are typically displayed in decimal format, divided into four octets separated
by dots. For example, 192.168.1.1 is a common IPv4 address you might find
in a home network.
IPv4 Address Format is a 32-bit Address that comprises binary digits
separated by a dot (.).
Characteristics of IPv4
 32-bit address length: Allows for approximately 4.3 billion unique
addresses.
 Dot-decimal notation: IP addresses are written in a format of four
decimal numbers separated by dots, such as 192.168.1.1.
 Packet structure: Includes a header and payload; the header contains
information essential for routing and delivery.
 Checksum fields: Uses checksums in the header for error-checking the
header integrity.
 Fragmentation: Allows packets to be fragmented at routers along the
route if the packet size exceeds the maximum transmission unit (MTU).
 Address Resolution Protocol (ARP): Used for mapping IP network
addresses to the hardware addresses used by a data link protocol.
 Manual and DHCP configuration: Supports both manual configuration
of IP addresses and dynamic configuration through DHCP (Dynamic
Host Configuration Protocol).
 Limited address space: The main limitation which has led to the
development of IPv6 to cater to more devices.
 Network Address Translation (NAT): Used to allow multiple devices
on a private network to share a single public IP address.
 Security: Lacks inherent security features, requiring additional protocols
such as IPSec for secure communications.
Drawbacks of IPv4
 Limited Address Space : IPv4 has a limited number of addresses, which
is not enough for the growing number of devices connecting to the
internet.
 Complex Configuration : IPv4 often requires manual configuration or
DHCP to assign addresses, which can be time-consuming and prone to
errors.
 Less Efficient Routing : The IPv4 header is more complex, which can
slow down data processing and routing.
 Security Issues : IPv4 does not have built-in security features, making it
more vulnerable to attacks unless extra security measures are added.
 Limited Support for Quality of Service (QoS) : IPv4 has limited
capabilities for prioritizing certain types of data, which can affect the
performance of real-time applications like video streaming and VoIP.
 Fragmentation : IPv4 allows routers to fragment packets, which can lead
to inefficiencies and increased chances of data being lost or corrupted.
 Broadcasting Overhead : IPv4 uses broadcasting to communicate with
multiple devices on a network, which can create unnecessary network
traffic and reduce performance.
What is IPv6?
It is a widely used version of the Internet Protocol today is IPv6. It is
becoming more common, especially in areas like mobile networks, where the
demand for IP addresses keeps growing. IPv6 was developed by the Internet
Engineering Task Force (IETF) in December 1998 to replace IPv4, which
couldn’t handle the rapidly increasing number of internet users and
connected devices.
IPv6 stands for Internet Protocol version 6. It’s the newer and more
advanced version of IP, offering improvements in address space, efficiency,
and security. IPv6 addresses are written in eight groups of hexadecimal
numbers, separated by colons.
IPv6 Address Format
IPv6 Address Format is a 128-bit IP Address, which is written in a group of 8
hexadecimal numbers separated by colon (:).
IPV6 Address Format
Characteristics of IPv6
 128-bit Addressing: Uses a 128-bit address format, allowing for an
almost unlimited number of unique IP addresses.
 Hexadecimal Notation: IP addresses are written in eight groups of four
hexadecimal digits, separated by colons (e.g.,
2001:0db8:85a3::8a2e:0370:7334).
 Connectionless and Connection-Oriented Support: Supports both
connectionless (like UDP) and connection-oriented (like TCP)
communications.
 No Broadcast: Does not use broadcasting; instead, uses multicast and
anycast for efficient data delivery.
 Simplified Header Format: Has a simpler and more efficient packet
header compared to IPv4, improving processing speed.
 Integrated Security (IPSec): Includes built-in support for IPSec to
provide confidentiality, authentication, and data integrity.
 Auto-Configuration: Supports stateless and stateful address
configuration, including automatic address assignment.
 No Need for NAT: Eliminates the need for Network Address Translation
due to its vast address space.
 Improved Routing Efficiency: Reduces routing table size and simplifies
network structure for faster data delivery.
 Support for New Services: Designed to work better with modern
internet services like mobile IP, VoIP, and IoT devices.
Benefits of IPv6 over IPv4
The recent Version of IP IPv6 has a greater advantage over IPv4. Here are
some of the mentioned benefits:
 Larger Address Space: IPv6 has a greater address space than IPv4,
which is required for expanding the IP Connected Devices. IPv6 has 128
bit IP Address rather and IPv4 has a 32-bit Address.
 Improved Security: IPv6 has some improved security which is built in
with it. IPv6 offers security like Data Authentication, Data Encryption,
etc. Here, an Internet Connection is more Secure.
 Simplified Header Format: As compared to IPv4, IPv6 has a simpler
and more effective header Structure, which is more cost-effective and
also increases the speed of Internet Connection.
 Prioritize: IPv6 contains stronger and more reliable support for QoS
features, which helps in increasing traffic over websites and increases
audio and video quality on pages.
 Improved Support for Mobile Devices: IPv6 has increased and better
support for Mobile Devices. It helps in making quick connections over
other Mobile Devices and in a safer way than IPv4.
Switching From IPV4 to IPV6 : To switch from IPv4 to IPv6, there are
several strategies:
 Dual Stacking : Devices can use both IPv4 and IPv6 at the same time.
This way, they can talk to networks and devices using either version.
 Tunneling : This method allows IPv6 users to send data through an IPv4
network to reach other IPv6 users. Think of it as creating a "tunnel" for
IPv6 traffic through the older IPv4 system.
 Network Address Translation (NAT) : NAT helps devices using
different versions of IP addresses (IPv4 and IPv6) to communicate with
each other by translating the addresses so they understand each other
Difference Between IPv4 and IPv6
The below table shows the difference between the IPV4 and IPV6
addressing :

Feature IPv4 IPv6

Address
32-bit address 128-bit address
Length

Decimal format
Address (e.g., Hexadecimal format (e.g., 2001:0db8::1)
Format 192.168.0.1)

Manual and
DHCP Auto-configuration and renumbering supported
Configuration configuration
Feature IPv4 IPv6

End-to-end
Connection integrity is End-to-end integrity is achievable
Integrity unachievable

No built-in
security;
IPSec is built-in for encryption and
external tools
authentication
like IPSec
Security needed

Performed by
sender and Performed only by the sender
Fragmentation routers

Flow Uses Flow Label field in header for packet flow


Not available
Identification identification

Checksum
Present Not present
Field

Transmission Supports
Uses multicast and anycast; no broadcast
Scheme broadcast

Variable: 20–60
Fixed: 40 bytes
Header Size bytes

Can be
converted to Not all IPv6 addresses can be converted to IPv4
Conversion IPv6

4 fields
separated by 8 fields separated by colons (:)
Field Structure dots (.)

Address Has address No concept of address classes


Classes classes (A, B, C,
Feature IPv4 IPv6

D, E)

Supports
Variable Length
Does not support VLSM
Subnet Mask
VLSM Support (VLSM)

Example 66.94.29.13 2001:0000:3238:DFE1:0063:0000:0000:FEFB

Difference between Private and Public IP addresses:-


IP Address or Internet Protocol Address is a type of address that is required to
communicate one computer with another computer for exchanging information,
file, webpage, etc. Public and Private IP address are two important parts of
device identity. In this article, we will see the differences between Public and
Private IP Addresses. Before proceeding with that, let's see what is an IP
Address with an example.
If someone wants to send a particular file or a mail to you from his/her
computer, then an address is required to communicate with you without the
confusion of delivering that information to any other computer, that's why an
address is required and that address is called an IP Address. IP Address is
unique for each computer.
What is a Private IP Address
The Private IP Address of a system is the IP address that is used to communicate
within the same network. Using private IP data or information can be sent or
received within the same network. The router basically assigns these types of
addresses to the device. Unique private IP Addresses are provided to each and
every device that is present on the network. These things make Private IP
Addresses more secure than Public IP Addresses.
Can we trace Private IP Address
Yes, we can trace Private IP Addresses, but this happens only by using other
devices on the local network. Devices that are connected to the local network
has private IP Address and this can only be visible to the devices that are
connected within that network. But it can't be seen online as it happens in public
IP Addresses.
Advantages of Private IP Addresses
 Security: As Private IP addresses are directly not accessible from the
internet, thus reducing the risk of unauthorized access and cyber attacks
and makes system more secure.
 Scalability: Private IP address provide addressing space for small to large
networks, providing the growth of devices and services within an
organization.
 Cost-Effectiveness: By using private IP addresses internally,
organizations can avoid the need to obtain and manage large blocks of
public IP addresses, reducing costs associated with internet connectivity.
Disadvantages of Private IP Addresses
 Limited Accessibility: Private IP addresses are not directly available
from general public internet, resulting in hiding internet community
sources.
 Interoperability Issues: While integrating with external services Private
IP addresses may come across interoperability issues.
 Network Address Translation (NAT) Overhead: Network Address
Translation (NAT) introduces overhead in terms of processing energy,
latency, and complexity, in particular in big-scale deployments.
What is a Public IP Address
The Public IP Address of a system is the IP address that is used to communicate
outside the network. A public IP address is basically assigned by the ISP
(Internet Service Provider).
Public IP Address is basically of two types:
 Dynamic IP Address: Dynamic IP Address are addresses that change
over time. After establishing a connection of a smartphone or computer
with the Internet, ISP provides an IP Address to the device, these random
addresses are called Dynamic IP Address.
 Static IP Address: Static IP Address are those addresses that do not
change with time. These are stated as permanent internet addresses.
Mostly these are used by the DNS (Domain Name System) Servers.
Can we trace Public IP Address
Yes, Public IP Addresses can be traced back to the Internet Service Provider that
can easily trace the geographical location. This might reveal the location very
easily to advertisers, hackers, etc. For using the Internet anonymously, you can
easily hide your IP Address by using different ways like VPN, Tor Browser, etc.
But among different ways, VPN is the fastest and most secure way of using the
Internet.
Advantages of Public IP Address
 Direct Access: A public IP allows users to access your device directly.
 Hosting: its ideal for hosting websites, game servers, or services without
additional network configurations.
 Direct Communication: Device with public IPs can communicate
directly to each other over the internet without any extra setups.
Disadvantages of Public IP Address
 Higher Costs: Public IP addresses usually takes extra cost from internet
service providers or cloud services.
 Limited Availability: With the continuous decrease of IPv4, public IPs
are becoming harder to obtain.
 Privacy Concerns: Devices with public IPs are easier to trace, thus
reducing user privacy.
Introduction To Subnetting:-
Subnetting is the process of dividing a large network into smaller
networks called "subnets." Subnets provide each group of devices with
their own space to communicate, which ultimately helps the network to
work easily. This also boosts security and makes it easier to manage the
network, as each subnet can be monitored and controlled separately. In
this article, we will discuss Subnetting in detail.
Introduction to Subnet
A subnet is like a smaller group within a large network. It is a way to split
a large network into smaller networks so that devices present in one
network can transmit data more easily. For example, in a company,
different departments can each have their own subnet, keeping their data
traffic separate from others. Subnet makes the network faster and easier
to manage and also improves the security of the network.
Why Subnetting is Important?
Let's consider a company that follows classful addressing, it has a Class
C network (192.168.1.0/24) with 256 IP addresses. It has three
departments:
 Sales: 20 devices
 HR: 10 devices
 IT: 50 devices
Without subnetting, all departments share the same network, and all 256
IP addresses are available to everyone, which leads to:
 IP Waste: Only 80 devices are needed (20 + 10 + 50), but all 256
addresses are allocated, wasting 176 addresses.
 Performance Issues: Since all departments are on the same network, any
data sent between devices floods the entire network, slowing
communication for everyone. For example, heavy data transfer in IT can
impact Sales and HR.
 Security Risks: Without subnets, anyone in Sales can access HR or IT
devices, exposing sensitive data like payroll systems.
With Subnetting, we split the network into three subnets, allocating just
enough IP addresses for each department:
 Sales: 192.168.1.0/27 → 32 IPs (for 20 devices, 12 spare)
 HR: 192.168.1.32/28 → 16 IPs (for 10 devices, 6 spare)
 IT: 192.168.1.48/26 → 64 IPs (for 50 devices, 14 spare)
By subnetting, we:
 Save IP addresses (Efficiency): Only 112 addresses are used (80 + some
spare), leaving 144 unused for future growth.
 Keep networks faster (Better Performance): Data within each
department stays in its subnet. For example, HR traffic stays in HR,
reducing network congestion for Sales and IT.
 Protect sensitive data (Improved Security): Each department is
isolated. If someone in Sales tries to access HR systems, subnet
restrictions block them.
Key Concepts in Subnetting
IP Addressing
An IP address is made up of different parts, each serving a specific
purpose in identifying a device on a network. An IPv4 address consists of
four parts called "octets," separated by dots (e.g., 192.168.1.1). It has two
main sections:
 Network Portion: Identifies the network the device belongs to.
 Host Portion: Uniquely identifies a device within the network.
IPv4 addresses are divided into classes based on the length of the network
and host portions:
 Class A: 8-bit network ID, 24-bit host ID.
 Class B: 16-bit network ID, 16-bit host ID.
 Class C: 24-bit network ID, 8-bit host ID.
What is a Subnet Mask?
A subnet mask is a 32-bit number used in IP addressing to separate the
network portion of an IP address from the host portion. It helps computers
and devices determine which part of an IP address refers to the network
they are present, and which part refers to their specific location or address
within that network.
CIDR Notation: A Simplified Approach to Subnetting
Instead of using a long subnet mask (e.g., 255.255.255.0), CIDR uses a
simple format like /24. The number after the slash (/n) represents the
number of bits used for the network portion of the IP address.
How Subnetting Works?
The working of subnets starts in such a way that firstly it divides the
subnets into smaller subnets. For communicating between subnets,
routers are used. Each subnet allows its linked devices to communicate
with each other. Subnetting for a network should be done in such a way
that it does not affect the network bits.
In class C the first 3 octets are network bits so it remains as it is.
 For Subnet-1: The first bit which is chosen from the host id part is zero
and the range will be from (193.1.2.00000000 till you get all 1's in the
host ID part i.e, 193.1.2.01111111) except for the first bit which is chosen
zero for subnet id part.
Thus, the range of subnet 1 is: 193.1.2.0 to 193.1.2.127
Subnet id of Subnet-1 is : 193.1.2.0
The direct Broadcast id of Subnet-1 is: 193.1.2.127
The total number of hosts possible is: 126 (Out of 128, 2 id's are used for
Subnet id & Direct Broadcast id)
The subnet mask of Subnet- 1 is: 255.255.255.128
 For Subnet-2: The first bit chosen from the host id part is one and the
range will be from (193.1.2.100000000 till you get all 1's in the host ID
part i.e, 193.1.2.11111111).
Thus, the range of subnet-2 is: 193.1.2.128 to 193.1.2.255
Subnet id of Subnet-2 is : 193.1.2.128
The direct Broadcast id of Subnet-2 is: 193.1.2.255
The total number of hosts possible is: 126 (Out of 128, 2 id's are used for
Subnet id & Direct Broadcast id)
The subnet mask of Subnet- 2 is: 255.255.255.128
The best way to find out the subnet mask of a subnet is to set the fixed bit
of host-id to 1 and the rest to 0.
Finally, after using the subnetting the total number of usable hosts is
reduced from 254 to 252.
Note:
1. To divide a network into four (2 2 ) parts you need to choose two bits
from the host id part for each subnet i.e, (00, 01, 10, 11).
2. To divide a network into eight (2 3 ) parts you need to choose three bits
from the host id part for each subnet i.e, (000, 001, 010, 011, 100, 101,
110, 111) and so on.
3. We can say that if the total number of subnets in a network increases the
total number of usable hosts decreases.
The network can be divided into two parts: To divide a network into
two parts, you need to choose one bit for each Subnet from the host ID
part.
In the above diagram, there are two Subnets.
Note: It is a class C IP so, there are 24 bits in the network id part and 8
bits in the host id part.
Example 1: An organization is assigned a class C network address of
201.35.2.0. It uses a netmask of 255.255.255.192 to divide this into
sub-networks. Which of the following is/are valid host IP addresses?
1. 201.35.2.129
2. 201.35.2.191
3. 201.35.2.255
4. Both (A) and (C)
Solution:
Converting the last octet of the netmask into the binary form:
255.255.255.11000000
Converting the last octet of option 1 into the binary form:
201.35.2.10000001
Converting the last octet of option 2 into the binary form:
201.35.2.10111111
Converting the last octet of option 3 into the binary form:
201.35.2.11111111
From the above, we see that Options 2 and 3 are not valid host IP
addresses (as they are broadcast addresses of a subnetwork),
and OPTION 1 is not a broadcast address and it can be assigned to a host
IP.
Example 2: An organization has a class C network address of
201.32.64.0. It uses a subnet mask of 255.255.255.248. Which of the
following is NOT a valid broadcast address for any subnetworks?
1. 201.32.64.135
2. 201.32.64.240
3. 201.32.64.207
4. 201.32.64.231
Solution:
Converting the last octet of the netmask into the binary form:
255.255.255.11111000
Converting the last octet of option 1 into the binary form:
201.32.64.10000111
Converting the last octet of option 2 into the binary form:
201.32.64.11110000
Converting the last octet of option 3 into the binary form:
201.32.64.11001111
Converting the last octet of option 4 into the binary form:
201.32.64.11100111
From the above, we can see that in OPTION 1, 3, and 4, all the host bits
are 1 and give the valid broadcast address of subnetworks.
and OPTION 2, the last three bits of the Host address are not 1 therefore
it's not a valid broadcast address.
Advantages of Subnetting
 It provides security to one network from another network. For example:
In an Organization, the code of the Developer department must not be
accessed by another department.
 It may be possible that a particular subnet might need higher network
priority than others. For example, a Sales department needs to host
webcasts or video conferences.
 In the case of Small networks, maintenance is easy.
Disadvantages of Subnetting
 In the case of a single network, only three steps are required to reach a
Process i.e Source Host to Destination Network, Destination Network to
Destination Host, and then Destination Host to Process.
 In the case of a Single Network only two IP addresses are wasted to
represent Network Id and Broadcast address but in the case of Subnetting
two IP addresses are wasted for each Subnet.
 The cost of the overall Network also increases. Subnetting requires
internal routers, Switches, Hubs, Bridges, etc. which are very costly.

Difference Between
Private and Public IP Addresses
Difference Between Private and Public IP Addresses

Private IP Address Public IP Address

The scope of Private IP is local. The scope of Public IP is global.

It is used to communicate within the It is used to communicate outside


network. the network.

Private IP addresses of the systems Public IP may differ in a uniform


Private IP Address Public IP Address

connected in a network differ in a


or non-uniform manner.
uniform manner.

It works only on LAN. It is used to get internet service.

It is used to load the network operating


It is controlled by ISP.
system.

It is available free of cost. It is not free of cost.

Public IP can be known by


Private IP can be known by entering
searching “what is my ip” on
“ipconfig” on the command prompt.
Google.

Range:
10.0.0.0 – 10.255.255.255, Range: Besides private IP
172.16.0.0 – 172.31.255.255, addresses, the rest are public.

192.168.0.0 – 192.168.255.255

Example: 192.168.1.10 Example: 17.5.7.8

Public IP uses a numeric code that


Private IP uses numeric code that is not
is unique and cannot be used by
unique and can be used again
other

The public IP address has no


Private IP addresses are secure
security and is subjected to attack

Private IP addresses require NAT to Public IP does not require a


Private IP Address Public IP Address

communicate with devices network translation

What is Routing?:-
The process of choosing a path across one or more networks is known as
Network Routing. Nowadays, individuals are more connected on the internet
and hence, the need to use Routing Communication is essential.
Routing chooses the routes along which Internet Protocol (IP) packets get from
their source to their destination in packet-switching networks. This article will
discuss the details of the Routing Process along with its different types and
working principles.
What is a Router?
Routers are specialized pieces of network hardware that make these judgments
about Internet routing. It is a networking device that forwards data packets
between computer networks. Also, it helps to direct traffic based on the
destination IP address. It ensures that data reaches its intended destination.
As the router connects different networks, it manages data traffic between them.
The Router operates at Layer 3 (the network layer) of the OSI Model. It is also
responsible for determining the best path for data to travel from one network to
another.
What is Routing?
Routing refers to the process of directing a data packet from one node to
another. It is an autonomous process handled by the network devices to direct a
data packet to its intended destination. Note that, the node here refers to
a network device called - 'Router'.
Routing is a crucial mechanism that transmits data from one location to another
across a network (Network type could be any like LAN, WAN, or MAN). The
process of routing involves making various routing decisions to ensure reliable
& efficient delivery of the data packet by finding the shortest path using various
routing metrics which we will be discussing in this article.
Routing of a data packet is done by analyzing the destination IP Address of the
packet. Look at the below image:
Routing of packets
 The Source Node (Sender) sends the data packet on the network,
embedding the IP in the header of the data packet.
 The nearest router receives the data packet, and based on some metrics,
further routes the data packet to other routers.
 Step 2 occurs recursively till the data packet reaches its intended
destination.
Note: There are limits to how many hop counts a packet can do if it is
exceeded, the packet is considered to be lost.
What are Different Types of Routing?
Routing is typically of 3 types, each serving its purpose and offering different
functionalities.

Types of Routing
1. Static Routing
Static routing is also called as "non-adaptive routing". In this, routing
configuration is done manually by the network administrator. Let's say for
example, we have 5 different routes to transmit data from one node to another,
so the network administrator will have to manually enter the routing
information by assessing all the routes.
 A network administrator has full control over the network, routing the
data packets to their concerned destinations
 Routers will route packets to the destination configured manually by the
network administrator.
 Although this type of routing gives fine-grained control over the routes, it
may not be suitable for large-scale enterprise networks.
2. Dynamic Routing
Dynamic Routing is another type of routing in which routing is an autonomous
procedure without any human intervention. Packets are transmitted over a
network using various shortest-path algorithms and pre-determined metrics.
This type of routing is majorly preferred in modern networks as it offers more
flexibility and versatile functionality.
 It is also known as adaptive routing.
 In this, the router adds new routes to the routing table based on any
changes made in the topology of the network.
 The autonomous procedure of routing helps in automating every routing
operation from adding to removing a route upon updates or any changes
made to the network.
3. Default Routing
Default Routing is a routing technique in which a router is configured to
transmit packets to a default route that is, a gateway or next-hop device if no
specific path is defined or found. It is commonly used when the network has a
single exit point. The IP Router has the following address as the default route:
0.0.0.0/0.
What is the Working Principle of Routing?
Routing works by finding the shortest path from the source node to the
destination node across a network. Here's the step-by-step working of routing:
Step 1: Communication initiation
The first step that typically happens is, one node (client or server) initiates a
communication across a network using HTTP protocols.
Step 2: Data Packets
The source device now breaks a big chunk of information into small data
packets for reliable and efficient transmission. This process is called de-
assembling and encapsulating the data payload. Then each data packet is labeled
with the destination node's IP address.
Step 3: Routing Table
The Routing table is a logical data structure used to store the IP addresses and
relevant information regarding the nearest routers. The source node then looks
up the IP addresses of all the nodes that can transmit the packet to its destination
selects the shortest path using the shortest path algorithm and then routes
accordingly.
The Routing Table is stored in a router, a network device that determines the
shortest path and routes the data packet.
Step 4: Hopping procedure
In the procedure or routing, the data packet will undergo many hops across
various nodes in a network till it reaches its final destination node. Hop count is
defined as the number of nodes required to traverse through to finally reach the
intended destination node.
This hopping procedure has certain criteria defined for every data packet, there's
a limited number of hops a packet can take if the packet exceeds that, then it's
considered to be lost and is retransmitted.
Step 5: Reaching the destination node
Once all the data packets reach their intended destination node, they re-
assemble and transform into complete information that was sent by the sender
(source node). The receiver will perform various error-checking mechanisms to
verify the authenticity of the data packets.
Overall, the data packet will be transmitted over the least hop-count path as well
as the path on which there is less traffic to prevent packet loss.

Working of Routing
In the above image, we have 3 major components
 Sender
 Receiver
 Routers
The shortest path is highlighted in red, the path with the least hop count. As we
can see, there are multiple paths from source to node but if all the appropriate
metrics are satisfied, the data packets will be transmitted through the shortest
path (highlighted in red).
What are the Main Routing Protocols?
 RIP (Routing Information Protocol): It is a distance-vector protocol
that uses hop count as a metric.
 OSPF (Open Shortest Path First): OSPF is a link-state protocol that
finds the shortest path using the Dijkstra algorithm.
 EIGRP (Enhanced Interior Gateway Routing Protocol): It is a hybrid
protocol that combines features of distance-vector and link-state.
 BGP (Border Gateway Protocol): It is a path-vector protocol that is
used for routing between different autonomous systems on the internet.
 IS-IS (Intermediate System to Intermediate System): It is a link-state
protocol that is primarily used in large networks like ISPs.
What are Different Routing Metrics?
The purpose of routing protocols is to learn about all the available paths to route
data packets, build routing tables, and make routing decisions based on
specified metrics. There are two primary types of routing protocols rest of them
ideate from these two only.
1. Distance Vector Routing
In this type of routing protocol, all the nodes that are a part of the network
advertise their routing table to their adjacent nodes (nodes that are directly
connected) at regular intervals. With each router getting updated at regular
intervals, it may take time for all the nodes to have the same accurate network
view.
 Uses fixed length sub-net, not suitable for scaling.
 Algorithm used: Bellman Ford Algorithm to find the shortest path.
2. Link State Routing
Link State Routing is another type of dynamic routing protocol in which routes
advertise their updated routing tables only when some new updates are added.
This results in the effective use of bandwidth. All the routers keep exchanging
information dynamically regarding different links such as cost and hop count to
find the best possible path.
 Uses a variable length subnet mask, which is scalable and uses addressing
more effectively.
 The algorithm used: Dijkstra's Algorithm to find the shortest path.
Let's look at the metrics used to measure the cost of travel from one node to
another:-
1. Hop Count: Hop count refers to the number of nodes a data packet has to
traverse to reach its intended destination. Transmitting from one node to
another node counts as 1 - hop count. The goal is to minimize the hop
count and find the shortest path.
2. Bandwidth Consumption: Bandwidth is the ability of a network to
transmit data typically measured in Kbps (Kilobits per second), Mbps
(Megabits per second), or Gbps (Gigabits per second). The bandwidth
depends on several factors such as - the volume of data, traffic on a
network, network speed, etc. Routing decision is made in a way to ensure
efficient bandwidth consumption.
3. Delay: Delay is the time it takes for a data packet to travel from the
source node to its destination node. There are different types of delay
such as - propagation delay, transmission delay, and queuing delay.
4. Load: Load refers to the network traffic on a certain path in the context
of routing. A data packet will be routed to the path with a lesser load so
that it reaches its destination in the specified time.
5. Reliability: Reliability refers to the assured delivery of the data packet to
its intended destination although there are certain other factors, the data
packet is routed in such a way that it reaches its destination. The stability
and availability of the link in the network are looked over before routing
the data packet from a specific path.
What are the Advantages of Routing?
 Overall routing can be done in various ways its important to know the
requirements and use the one that fits right for our specific needs, hence
automated routing is typically preferred as the routing of packets is done
by the algorithms defined and the manually configurable routing can give
us a fine-grained control over the network.
 Routing is a highly scalable operation for transmitting data that is, in a
large-scale enterprise network it becomes crucial to manage information
related to all the nodes that may be sharing sensitive and confidential
information regarding the organization.
 Load Balancing is also one of the crucial aspects taken care of by routing
data packets off the routes that are generally busy as sending data through
those routes will only put our data at risk of getting lost.
What are the Disadvantages of Routing?
Every type of routing comes with some pros and cons here are some of the
disadvantages for specific types of routing :
 Static Routing: This type of routing is appropriate only for smaller
networks where the network administrator has an accurate view of the
network & good knowledge of topology else it might raise some security
concerns and complex configuration issues.
 Dynamic Routing: Everything is done automatically by the algorithms,
providing less control over the network that may not be suitable for every
kind of network. It is also computationally expensive and consumes more
bandwidth.
 Default Routing: The path on which the packets are to be transmitted by
default is configurable but can be a complex procedure if not defined
clearly.
Network Layer Protocols:-
Network Layer is responsible for the transmission of data or communication
from one host to another host connected in a network. Rather than describing
how data is transferred, it implements the technique for efficient transmission.
In order to provide efficient communication protocols are used at the network
layer. The data is being grouped into packets or in the case of extremely large
data it is divided into smaller sub packets. Each protocol used has specific
features and advantages. The below article covers in detail the protocols used at
the network layer.
Functions of Network Layer
The network layer is responsible for providing the below-given tasks:
 Logical Addressing: Each device on the network needs to be identified
uniquely. Therefore network layer provides an addressing scheme to
identify the device. It places the IP address of every sender and the
receiver in the header. This header consists of the network ID and host ID
of the network.
 Host-to-host Delivery of Data: The network layer ensures that the
packet is being delivered successfully from the sender to the receiver.
This layer makes sure that the packet reaches the intended recipient only.
 Fragmentation: In order to transmit the larger data from sender to
receiver, the network layer fragments it into smaller packets.
Fragmentation is required because every node has its own fixed capacity
for receiving data.
 Congestion Control: Congestion is defined as a situation where the
router is not able to route the packets property which results in
aggregation of packets in the network. Congestion occurs when a large
amount of packets are flooded in the network. Therefore network layer
controls the congestion of data packets in the network.
 Routing and Forwarding: Routing is the process that decides the route
for transmission of packets from sender to receiver. It mostly chooses the
shortest path between the sender and the receiver. Routing protocols that
are mostly used are path vector, distance vector routing, link state routing,
etc.
Network Layer Protocols
There are various protocols used in the network layer. Each protocol is used for
a different task. Below are the protocols used in the network layer:

Protocols at
each Layer
1. IP (Internet Protocol)
IP stands for Internet Protocol. Internet Protocol helps to uniquely identify each
device on the network. Internet protocol is responsible for transferring the data
from one node to another node in the network. Internet protocol is a
connectionless protocol therefore it does not guarantee the delivery of data. For
the successful delivery higher level protocols such as TCP are used to guarantee
the data transmission. The Internet Protocol is divided in two types. They are:
 IPv4: IPv4 provides with the 32 bit address scheme. IPv4 addressing has
four numeric fields and are separated by dot. IPv4 can be configured
either using DHCP or manually. IPv4 does not provide with more security
features as it does not support authentication or encryption techniques.
IPv4 is further divided into five classes as Class A, Class B, Class C,
Class D and Class E.
 IPv6: IPv6 is the most recent version of IP. If provided with a 128 bit
addressing scheme. IP address has eight fields that are separated by colon,
and these fields are alphanumeric. The IPv6 address is represented in
hexadecimal. IPv6 provides with more security features such as
authentication and encryption. IPv6 supports end-to-end connection
integrity. IPv6 provides with more range of IP address as compared to
IPv4.

2. ARP (Address Resolution Protocol)


ARP stands for Address Resolution Protocol. ARP is used to convert the logical
address ie. IP address into physical address ie. MAC address. While
communicating with other nodes, it is necessary to know the MAC address or
physical address of the destination node. If any of the node in a network wants
to know the physical address of another node in the same network, the host then
sends an ARP query packet. This ARP query packet consists of IP address and
MAC address of source host and only the IP address of destination host. This
ARP packet is then received to every node present in the network. The node
with its own IP address recognises it and sends it MAC address to the
requesting node. But sending and receiving such packets to know the MAC
address of destination node it increases the traffic load. Therefore in order to
reduce this traffic and improve the performance, the systems that makes use of
ARP maintain a cache of recently acquired IP into MAC address bindings.
How Does ARP Work?
 The host broadcasts an ARP inquiry packet containing the IP address over
the network in order to find out the physical address of another computer
on its network.
 The ARP packet is received and processed by all hosts on the network;
however, only the intended recipient can identify the IP address and reply
with the physical address.
 After adding the physical address to the datagram header and cache
memory, the host storing the datagram transmits it back to the sender.

ARP

Types of ARP Entries


 Static Entry: This type of entry is created when a user uses the ARP
command utility to manually enter the IP to MAC address association.
 Dynamic Entry: A dynamic entry is one that is automatically formed
when a sender broadcasts their message to the whole network. Dynamic
entries are periodically removed and are not permanent.
3. RARP
RARP stands for Reverse Address Resolution Protocol. RARP works opposite
of ARP. Reverse Address Resolution Protocol is used to convert MAC address
ie. physical address into IP address ie. logical address. RARP provides with a
feature for the systems and applications to get their own IP address from a DNS(
Domain Name System) or router. This type of resolution is required for various
tasks such as executing reverse DNS lookup. As Reverse Address Resolution
Protocol works at low level it requires direct network addresses. The reply from
the server mostly carries a small information but the 32 bit internet address is
used and it does not exploit the full potential of a network such as ethernet.
How Does RARP Work?
 Data is sent between two places in a network using the RARP, which is
on the Network Access Layer.
 Every user on the network has two distinct addresses: their MAC
(physical) address and their IP (logical) address.
 Software assigns the IP address, and the hardware then builds the MAC
address into the device.
 Any regular computer connected to the network can function as the
RARP server, answering to RARP queries. It must, however, store all of
the MAC addresses' associated IP addresses. Only these RARP servers
are able to respond to RARP requests that are received by the network.
The information package must be transmitted over the network's lowest
tiers.
 Using both its physical address and Ethernet broadcast address, the client
transmits a RARP request. In response, the server gives the client its IP
address.

RARP
4. ICMP
ICMP stands for Internet Control Message Protocol. ICMP is a part of IP
protocol suite. ICMP is an error reporting and network diagnostic protocol.
Feedback in the network is reported to the designated host. Meanwhile, if any
kind of error occur it is then reported to ICMP. ICMP protocol consists of many
error reporting and diagnostic messages. ICMP protocol handles various kinds
of errors such as time exceeded, redirection, source quench, destination
unreachable, parameter problems etc. The messages in ICMP are divided into
two types. They are given below:
 Error Message: Error message states about the issues or problems that are
faced by the host or routers during processing of IP packet.
 Query Message: Query messages are used by the host in order to get
information from a router or another host.
How Does ICMP Work?
 The main and most significant protocol in the IP suite is called ICMP.
However, unlike TCP and UDP, ICMP is a connectionless protocol,
meaning it doesn't require a connection to be established with the target
device in order to transmit a message.
 TCP and ICMP operate differently from one another; TCP is a
connection-oriented protocol, while ICMP operates without a connection.
Every time a connection is made prior to a message being sent, a TCP
Handshake is required of both devices.
 Datagrams including an IP header containing ICMP data are used to
transmit ICMP packets. An independent data item like a packet is
comparable to an ICMP datagram.

ICMP
5. IGMP
IGMP stands for Internet Group Message Protocol. IGMP is a multicasting
communication protocol. It utilizes the resources efficiently while broadcasting
the messages and data packets. IGMP is also a protocol used by TCP/IP. Other
hosts connected in the network and routers makes use of IGMP for multicasting
communication that have IP networks. In many networks multicast routers are
used in order to transmit the messages to all the nodes. Multicast routers
therefore receives large number of packets that needs to be sent. But to
broadcast this packets is difficult as it would increase the overall network load.
Therefore IGMP helps the multicast routers by addressing them while
broadcasting. As multicast communication consists of more than one senders
and receivers the Internet Group Message Protocol is majorly used in various
applications such as streaming media, web conference tools, games, etc.
How Does IGMP Work?
 Devices that can support dynamic multicasting and multicast groups can
use IGMP.
 The host has the ability to join or exit the multicast group using these
devices. It is also possible to add and remove customers from the group
using these devices.
 The host and local multicast router use this communication protocol.
Upon creation of a multicast group, the packet's destination IP address is
changed to the multicast group address, which falls inside the class D IP
address range.

6. Transport Layer:-
Transport Layer in OSI Model
The transport layer, or layer 4 of the OSI model, controls network traffic
between hosts and end systems to guarantee full data flows.
It is positioned between the network and session layers in the OSI paradigm.
The data packets must be taken and sent to the appropriate machine by the
network layer. After that, the transport layer receives the packets, sorts them,
and looks for faults. Subsequently, it directs them to the session layer of the
appropriate computer program. Now, the properly structured packets are
used by the session layer to hold the data for the application.
Functions of Transport Layer
The Transport Layer is responsible for end-to-end communication of data
packets. It provides a number of important functions that are responsible for
reliable, efficient, and organized data transfer between host systems in a
networked environment.
The primary functions of the Transport Layer are:
Working of Transport Layer
Communication between end systems is dependable and effective thanks to
the Transport Layer. Apart from regulating flow and accommodating
numerous applications concurrently, it guarantees data delivery in a manner
that guarantees accuracy and minimises mistakes. It accomplishes this by
utilising a collection of methods and protocols that provide data transport.

 The primary function of the transport layer is to give application


processes operating on several hosts direct access to communication
services.
 Logical communication between application processes operating on
separate hosts is facilitated by the transport layer. Application processes
use the logical communication offered by the transport layer to deliver
messages to one other even when they are running on different hosts and
are not physically connected.
 The network routers do not implement the transport layer protocols; only
the end systems do.
 For instance, the network layer receives services from TCP and UDP, two
transport layer protocols, which offer distinct functionalities.
 Protocols at the transport layer offer multiplexing and demultiplexing
capabilities. In addition, it offers other services including bandwidth
assurances, latency guarantees, and dependable data transport.
 Every application at the application layer is capable of sending a message
via either TCP or UDP. Either of these two protocols can be used by the
application to interact. The internet protocol on the internet layer will
then be communicated with by both TCP and UDP. The transport layer is
readable and writeable by the applications.
Transport Layer Protocols
Transport Layer Protocol uses different protocol for the better
communication between two ends uses of protocol may differ from
specifications. Below mention are some protocols used in Transport Layer
1. Transmission Control Protocol(TCP)
 TCP is connection-oriented Protocol.
 TCP is reliable protocol.
 As TCP is connection-oriented protocol, so first the connection is
established between two ends and then data is transferred and then the
connection is terminated after all data being sent.
2. User Datagram Protocol (UDP)
 UDP is not reliable protocol
 The protocol UDP is connectionless.
 When speed and size are more important than security and dependability,
this kind of protocol is employed.
 The data from the higher layer is supplemented with transport-level
addresses, checksum error control, and length information by UDP, an
end-to-end transport level protocol.
 A user datagram is the packet that the UDP protocol generates.
3. Stream Control Transmission Protocol (SCTP)
 Many Internet applications use SCTP to perform transport layer duties,
similar to User Datagram Protocol (UDP) and Transmission Control
Protocol (TCP).
 On top of a connectionless packet network like IP, SCTP is a dependable
transport protocol that facilitates data transfer over the network in
scenarios involving one or more IP addresses.
Difference Between TCP and UDP at Transport Layer

TCP UDP

TCP is a connection-oriented UDP is the connection-less


protocol protocol
TCP UDP

TCP is reliable. UDP is not reliable.

UDP has only the basic error-


TCP supports error-checking
checking mechanism using
mechanisms.
checksums.

An acknowledgment segment is
No acknowledgment segment.
present.

UDP is faster, simpler, and more


TCP is slower than UDP
efficient than TCP.

There is no retransmission of lost


Retransmission of lost packets is
packets in the User Datagram
possible in TCP, but not in UDP.
Protocol (UDP)

TCP has a (20-60) bytes variable The header length is fixed of 8


length header. bytes.

Transport Layer Protocols:-


The transport layer is the fourth layer in the OSI model and the second layer in
the TCP/IP model. The transport layer provides with end to end connection
between the source and the destination and reliable delivery of the services.
Therefore transport layer is known as the end-to-end layer. The transport layer
takes the services from its upward layer which is the application layer and
provides it to the network layer. Segment is the unit of data encapsulation at the
transport layer.
In this article, we are going to discuss all the important aspects of Transport
Layer Protocol which include: Functions of Transport Layer protocol,
characteristics of TLP, UDP & UDP Segemnts and their Advantages and
Disadvantages, TCP & TCP Segemnts and their Advantages and Disadvantages,
SCTP and its Advantages & Disadvantages.
Functions of
Transport Layer
 The process to process delivery
 End-to-end connection between devices
 Multiplexing and Demultiplexing
 Data integrity and error Correction
 Congestion Control
 Flow Control
Characteristics of Transport Layer Protocol
 The two protocols that make up the transport layer are TCP and UDP.
 A datagram is sent by the IP protocol at the network layer from a source
host to a destination host.
 These days, an operating system can support environments with multiple
users and processes; a programme under execution is referred to as a
process.
 A source process is transmitting a process to a destination process when a
host sends a message to another host. Certain connections to certain ports,
referred to as protocol ports, are defined by the transport layer protocols.
 A positive integer address, consisting of 16 bits, defines each port.
Transport Layer Protocols
The transport layer is represented majorly by TCP and UDP protocols. Today
almost all operating systems support multiprocessing multi-user environments.
This transport layer protocol provides connections to the individual ports. These
ports are known as protocol ports. Transport layer protocols work above the IP
protocols and deliver the data packets from IP serves to destination port and
from the originating port to destination IP services. Below are the protocols
used at the transport layer.
1. UDP
UDP stands for User Datagram Protocol. User Datagram Protocol provides a
nonsequential transmission of data. It is a connectionless transport protocol.
UDP protocol is used in applications where the speed and size of data
transmitted is considered as more important than the security and reliability.
User Datagram is defined as a packet produced by User Datagram Protocol.
UDP protocol adds checksum error control, transport level addresses, and
information of length to the data received from the layer above it. Services
provided by User Datagram Protocol(UDP) are connectionless service, faster
delivery of messages, checksum, and process-to-process communication.

UDP Segment
While the TCP header can range from 20 to 60 bytes, the UDP header is a fixed,
basic 8 bytes. All required header information is contained in the first 8 bytes,
with data making up the remaining portion. Because UDP port number fields
are 16 bits long, the range of possible port numbers is defined as 0 to 65535,
with port 0 being reserved.
UDP
 Source Port: Source Port is a 2 Byte long field used to identify the port
number of the source.
 Destination Port: This 2-byte element is used to specify the packet's
destination port.
 Length: The whole length of a UDP packet, including the data and
header. The field has sixteen bits.
 Cheksum: The checksum field is two bytes long. The data is padded with
zero octets at the end (if needed) to create a multiple of two octets. It is
the 16-bit one's complement of the one's complement sum of the UDP
header, the pseudo-header containing information from the IP header, and
the data.
Advantages of UDP
 UDP also provides multicast and broadcast transmission of data.
 UDP protocol is preferred more for small transactions such as DNS
lookup.
 It is a connectionless protocol, therefore there is no compulsion to have a
connection-oriented network.
 UDP provides fast delivery of messages.
Disadvantages of UDP
 In UDP protocol there is no guarantee that the packet is delivered.
 UDP protocol suffers from worse packet loss.
 UDP protocol has no congestion control mechanism.
 UDP protocol does not provide the sequential transmission of data.
2. TCP
TCP stands for Transmission Control Protocol. TCP protocol provides transport
layer services to applications. TCP protocol is a connection-oriented protocol. A
secured connection is being established between the sender and the receiver. For
a generation of a secured connection, a virtual circuit is generated between the
sender and the receiver. The data transmitted by TCP protocol is in the form of
continuous byte streams. A unique sequence number is assigned to each byte.
With the help of this unique number, a positive acknowledgment is received
from receipt. If the acknowledgment is not received within a specific period the
data is retransmitted to the specified destination.

TCP Segment
A TCP segment's header may have 20–60 bytes. The options take about 40
bytes. A header consists of 20 bytes by default, although it can contain up to 60
bytes.
 Source Port Address: The port address of the programme sending the
data segment is stored in the 16-bit field known as the source port
address.
 Destination Port Address: The port address of the application running
on the host receiving the data segment is stored in the destination port
address, a 16-bit field.
 Sequence Number: The sequence number, or the byte number of the first
byte sent in that specific segment, is stored in a 32-bit field. At the
receiving end, it is used to put the message back together once it has been
received out of sequence.
 Acknowledgement Number : The acknowledgement number, or the byte
number that the recipient anticipates receiving next, is stored in a 32-bit
field called the acknowledgement number. It serves as a confirmation that
the earlier bytes were successfully received.
 Header Length (HLEN): This 4-bit field stores the number of 4-byte
words in the TCP header, indicating how long the header is. For example,
if the header is 20 bytes (the minimum length of the TCP header), this
field will store 5 because 5 x 4 = 20, and if the header is 60 bytes (the
maximum length), it will store 15 because 15 x 4 = 60. As a result, this
field's value is always between 5 and 15.
 Control flags: These are six 1-bit control bits that regulate flow control,
method of transfer, connection abortion, termination, and establishment.
They serve the following purposes:
o Urgent: This pointer is legitimate
o ACK: The acknowledgement number (used in cumulative
acknowledgement cases) is valid.
o PSH: Push request
o RST: Restart the link.
o SYN: Sequence number synchronisation
o FIN: Cut off the communication
o Window size: This parameter provides the sender TCP's window
size in bytes.
 Checksum: The checksum for error control is stored in this field. Unlike
UDP, it is required for TCP.
 Urgent pointer: This field is used to point to data that must urgently
reach the receiving process as soon as possible. It is only valid if the
URG control flag is set. To obtain the byte number of the final urgent
byte, the value of this field is appended to the sequence number.
Advantages of TCP
 TCP supports multiple routing protocols.
 TCP protocol operates independently of that of the operating system.
 TCP protocol provides the features of error control and flow control.
 TCP provides a connection-oriented protocol and provides the delivery of
data.
Disadvantages of TCP
 TCP protocol cannot be used for broadcast or multicast transmission.
 TCP protocol has no block boundaries.
 No clear separation is being offered by TCP protocol between its
interface, services, and protocols.
 In TCP/IP replacement of protocol is difficult.
3. SCTP
SCTP stands for Stream Control Transmission Protocol. SCTP is a connection-
oriented protocol. Stream Control Transmission Protocol transmits the data from
sender to receiver in full duplex mode. SCTP is a unicast protocol that provides
with point to point-to-point connection and uses different hosts for reaching the
destination. SCTP protocol provides a simpler way to build a connection over a
wireless network. SCTP protocol provides a reliable transmission of data. SCTP
provides a reliable and easier telephone conversation over the internet. SCTP
protocol supports the feature of multihoming ie. it can establish more than one
connection path between the two points of communication and does not depend
on the IP layer. SCTP protocol also ensures security by not allowing the half-
open connections.

Advantages of SCTP
 SCTP provides a full duplex connection. It can send and receive the data
simultaneously.
 SCTP protocol possesses the properties of both TCP and UDP protocol.
 SCTP protocol does not depend on the IP layer.
 SCTP is a secure protocol.
Disadvantages of SCTP
 To handle multiple streams simultaneously the applications need to be
modified accordingly.
 The transport stack on the node needs to be changed for the SCTP
protocol.
 Modification is required in applications if SCTP is used instead of TCP or
UDP protocol.
What is TCP (Transmission Control Protocol)?:-
Transmission Control Protocol (TCP) is a connection-oriented
protocol for communications that helps in the exchange of messages
between different devices over a network. It is one of the main protocols
of the TCP/IP suite. In OSI model, it operates at the transport layer(Layer
4). It lies between the Application and Network Layers which are used in
providing reliable delivery services. The Internet Protocol (IP), which
establishes the technique for sending data packets between computers,
works with TCP.
 TCP establishes a reliable connection between sender and receiver using
the three-way handshake (SYN, SYN-ACK, ACK) and it uses a four-
step handshake (FIN, ACK, FIN, ACK) to close connections properly.
 It ensures error-free, in-order delivery of data packets.
 It uses acknowledgments (ACKs) to confirm receipt.
 It prevents data overflow by adjusting the data transmission rate
according to the receiver’s buffer size.
 It prevents network congestion using algorithms like Slow Start,
Congestion Avoidance, Fast Retransmit, and Fast Recovery.
 TCP header uses checksum to detect corrupted data and requests
retransmission if needed.
 It is used in applications requiring reliable and ordered data transfer,
such as web browsing, email, and remote login.
Internet Protocol (IP)
Internet Protocol (IP) is a method that is useful for sending data from one
device to another from all over the internet. It is a set of rules governing
how data is sent and received over the internet. It is responsible for
addressing and routing packets of data so they can travel from the sender
to the correct destination across multiple networks. Every device contains
a unique IP Address that helps it communicate and exchange data across
other devices present on the internet.
Working of Transmission Control Protocol (TCP)
Transmission Control Protocol (TCP) model breaks down the data into
small bundles and afterward reassembles the bundles into the original
message on the opposite end to make sure that each message reaches its
target location intact. Sending the information in little bundles of
information makes it simpler to maintain efficiency as opposed to sending
everything in one go.
After a particular message is broken down into bundles, these bundles
may travel along multiple routes if one route is jammed but the
destination remains the same.
TCP
For Example: When a user requests a web page on the internet,
somewhere in the world, the server processes that request and sends back
an HTML Page to that user. The server makes use of a protocol called the
HTTP Protocol. The HTTP then requests the TCP layer to set the required
connection and send the HTML file.
Now, the TCP breaks the data into small packets and forwards it toward
the Internet Protocol (IP) layer. The packets are then sent to the
destination through different routes.
The TCP layer in the user's system waits for the transmission to get
finished and acknowledges once all packets have been received.
Features of TCP
Some of the most prominent features of Transmission control protocol are
mentioned below.
 Segment Numbering System: TCP keeps track of the segments being
transmitted or received by assigning numbers to each and every single
one of them. A specific Byte Number is assigned to data bytes that are to
be transferred while segments are assigned sequence numbers.
Acknowledgment Numbers are assigned to received segments.
 Connection Oriented: It means sender and receiver are connected to
each other till the completion of the process. The order of the data is
maintained i.e. order remains same before and after transmission.
 Full Duplex: In TCP data can be transmitted from receiver to the sender
or vice - versa at the same time. It increases efficiency of data flow
between sender and receiver.
 Flow Control: Flow control limits the rate at which a sender transfers
data. This is done to ensure reliable delivery. The receiver continually
hints to the sender on how much data can be received (using a sliding
window).
 Error Control: TCP implements an error control mechanism for reliable
data transfer. Error control is byte-oriented. Segments are checked for
error detection. Error Control includes - Corrupted Segment & Lost
Segment Management, Out-of-order segments, Duplicate segments, etc.
 Congestion Control: TCP takes into account the level of congestion in
the network. Congestion level is determined by the amount of data sent
by a sender.
Advantages of TCP
 It is a reliable protocol.
 It provides an error-checking mechanism as well as one for recovery.
 It gives flow control.
 It makes sure that the data reaches the proper destination in the exact
order that it was sent.
 It is a well-documented and widely implemented protocol, maintained by
standards organizations like the IETF (Internet Engineering Task Force).
 It works in conjunction with IP (Internet Protocol) to establish
connections between devices on a network.
Disadvantages of TCP
 TCP is made for Wide Area Networks, thus its size can become an issue
for small networks with low resources.
 TCP runs several layers so it can slow down the speed of the network.
 It is not generic in nature. It cannot represent any protocol stack other
than the TCP/IP suite. E.g., it cannot work with a Bluetooth connection.
 No modifications since their development around 30 years ago.
User Datagram Protocol (UDP):-
User Datagram Protocol (UDP) is a Transport Layer protocol. UDP is a part of
the Internet Protocol suite, referred to as UDP/IP suite. Unlike TCP, it is
an unreliable and connectionless protocol. So, there is no need to establish a
connection before data transfer. The UDP helps to establish low-latency and
loss-tolerating connections over the network. The UDP enables process-to-
process communication.
What is User Datagram Protocol?
User Datagram Protocol (UDP) is one of the core protocols of the Internet
Protocol (IP) suite. It is a communication protocol used across the internet for
time-sensitive transmissions such as video playback or DNS lookups . Unlike
Transmission Control Protocol (TCP), UDP is connectionless and does not
guarantee delivery, order, or error checking, making it a lightweight and
efficient option for certain types of data transmission.
UDP Header
UDP header is an 8-byte fixed and simple header, while for TCP it may vary
from 20 bytes to 60 bytes. The first 8 Bytes contain all necessary header
information and the remaining part consists of data. UDP port number fields are
each 16 bits long, therefore the range for port numbers is defined from 0 to
65535; port number 0 is reserved. Port numbers help to distinguish different
user requests or processes.

UDP Header

 Source Port: Source Port is a 2 Byte long field used to identify the port
number of the source.
 Destination Port: It is a 2 Byte long field, used to identify the port of the
destined packet.
 Length: Length is the length of UDP including the header and the data. It
is a 16-bits field.
 Checksum: Checksum is 2 Bytes long field. It is the 16-bit one's
complement of the one's complement sum of the UDP header, the pseudo-
header of information from the IP header, and the data, padded with zero
octets at the end (if necessary) to make a multiple of two octets.
Notes - Unlike TCP, the Checksum calculation is not mandatory in UDP. No
Error control or flow control is provided by UDP. Hence UDP depends on IP
and ICMP for error reporting. Also UDP provides port numbers so that is can
differentiate between users requests.
Applications of UDP
 Used for simple request-response communication when the size of data is
less and hence there is lesser concern about flow and error control.
 It is a suitable protocol for multicasting as UDP supports packet
switching.
 UDP is used for some routing update protocols like RIP(Routing
Information Protocol).
 Normally used for real-time applications which can not tolerate uneven
delays between sections of a received message.
 VoIP (Voice over Internet Protocol) services, such as Skype and
WhatsApp, use UDP for real-time voice communication. The delay in
voice communication can be noticeable if packets are delayed due to
congestion control, so UDP is used to ensure fast and efficient data
transmission.
 DNS (Domain Name System) also uses UDP for its query/response
messages. DNS queries are typically small and require a quick response
time, making UDP a suitable protocol for this application.
 DHCP (Dynamic Host Configuration Protocol) uses UDP to dynamically
assign IP addresses to devices on a network. DHCP messages are
typically small, and the delay caused by packet loss or retransmission is
generally not critical for this application.
 Following implementations uses UDP as a transport layer protocol:

o NTP (Network Time Protocol)


o DNS (Domain Name Service)
o BOOTP, DHCP.
o NNP (Network News Protocol)
o Quote of the day protocol
o TFTP, RTSP, RIP.
 The application layer can do some of the tasks through UDP-

o Trace Route
o Record Route
o Timestamp
 UDP takes a datagram from Network Layer , attaches its header, and
sends it to the user. So, it works fast.
TCP vs UDP

Transmission Control Protocol User Datagram


Basis (TCP) Protocol (UDP)

UDP is the
Datagram-oriented
protocol. This is
because there is no
TCP is a connection-oriented overhead for opening
protocol. Connection orientation a connection,
means that the communicating maintaining a
devices should establish a connection, or
connection before transmitting data terminating a
and should close the connection connection. UDP is
after transmitting the data. efficient for
broadcast and
multicast types of
network
Type of Service transmission.

The delivery of data


TCP is reliable as it guarantees the
to the destination
delivery of data to the destination
cannot be guaranteed
router.
Reliability in UDP.

Error checking TCP provides extensive error- UDP has only the
mechanism checking mechanisms. It is because basic error-checking
Transmission Control Protocol User Datagram
Basis (TCP) Protocol (UDP)

it provides flow control and mechanism using


acknowledgment of data. checksums.

Acknowledgme An acknowledgment segment is No acknowledgment


nt present. segment.

There is no
Sequencing of data is a feature of sequencing of data in
Transmission Control Protocol UDP. If the order is
(TCP). this means that packets required, it has to be
arrive in order at the receiver. managed by the
Sequence application layer.

UDP is faster,
TCP is comparatively slower than
simpler, and more
UDP.
Speed efficient than TCP.

There is no
retransmission of lost
Retransmission of lost packets is
packets in the User
possible in TCP, but not in UDP.
Datagram Protocol
Retransmission (UDP).

TCP has a (20-60) bytes variable UDP has an 8 bytes


Header Length length header. fixed-length header.

Weight TCP is heavy-weight. UDP is lightweight.

Handshaking Uses handshakes such as SYN, It’s a connectionless


Techniques ACK, SYN-ACK protocol i.e. No
Transmission Control Protocol User Datagram
Basis (TCP) Protocol (UDP)

handshake

UDP supports
TCP doesn’t support Broadcasting.
Broadcasting Broadcasting.

UDP is used
TCP is used by HTTP, by DNS, DHCP,
HTTPs , FTP , SMTP and Telnet . TFTP, SNMP , RIP,
Protocols and VoIP.

The TCP connection is a byte UDP connection is a


Stream Type stream. message stream.

Overhead Low but higher than UDP. Very low.

This protocol is used


in situations where
This protocol is primarily utilized quick
in situations when a safe and communication is
trustworthy communication necessary but where
procedure is necessary, such as in dependability is not a
email, on the web surfing, and concern, such as
in military services. VoIP, game
streaming, video, and
Applications music streaming, etc.

Advantages of UDP
 Speed: UDP is faster than TCP because it does not have the overhead of
establishing a connection and ensuring reliable data delivery.
 Lower latency: Since there is no connection establishment, there is lower
latency and faster response time.
 Simplicity: UDP has a simpler protocol design than TCP, making it
easier to implement and manage.
 Broadcast support: UDP supports broadcasting to multiple recipients,
making it useful for applications such as video streaming and online
gaming.
 Smaller packet size: UDP uses smaller packet sizes than TCP, which can
reduce network congestion and improve overall network performance.
 User Datagram Protocol (UDP) is more efficient in terms of both latency
and bandwidth.
Disadvantages of UDP
 No reliability: UDP does not guarantee delivery of packets or order of
delivery, which can lead to missing or duplicate data.
 No congestion control: UDP does not have congestion control, which
means that it can send packets at a rate that can cause network
congestion.
 Vulnerable to attacks: UDP is vulnerable to denial-of-service attacks ,
where an attacker can flood a network with UDP packets, overwhelming
the network and causing it to crash.
 Limited use cases: UDP is not suitable for applications that require
reliable data delivery, such as email or file transfers, and is better suited
for applications that can tolerate some data loss, such as video streaming
or online gaming.
How is UDP used in DDoS attacks?
A UDP flood attack is a type of Distributed Denial of Service (DDoS) attack
where an attacker sends a large number of User Datagram Protocol
(UDP) packets to a target port.
 UDP Protocol : Unlike TCP, UDP is connectionless and doesn’t require a
handshake before data transfer. When a UDP packet arrives at a server, it
checks the specified port for listening applications. If no app is found, the
server sends an ICMP “destination unreachable” packet to the
supposed sender (usually a random bystander due to spoofed IP
addresses).
 Attack Process :
o The attacker sends UDP packets with spoofed IP sender addresses
to random ports on the target system.
o The server checks each incoming packet’s port for a listening
application (usually not found due to random port selection).
o The server sends ICMP “destination unreachable” packets to the
spoofed sender (random bystanders).
o The attacker floods the victim with UDP data packets,
overwhelming its resources.
 Mitigation : To protect against UDP flood attacks, monitoring network
traffic for sudden spikes and implementing security measures are crucial.
Organizations often use specialized tools and services to detect and
mitigate such attacks effectively.
UDP Pseudo Header
 The purpose of using a pseudo-header is to verify that the UDP packet
has reached its correct destination
 The correct destination consist of a specific machine and a specific
protocol port number within that machine

UDP pseudo header


UDP Pseudo Header Details
 The UDP header itself specify only protocol port number.thus , to verify
the destination UDP on the sending machine computes a checksum that
covers the destination IP address as well as the UDP packet.
 At the ultimate destination, UDP software verifies the checksum using the
destination IP address obtained from the header of the IP packet that
carried the UDP message.
 If the checksum agrees, then it must be true that the packet has reached
the intended destination host as well as the correct protocol port within
that host.
User Interface
A user interface should allow the creation of new receive ports, receive
operations on the receive ports that returns the data octets and an indication of
source port and source address, and an operation that allows a datagram to be
sent, specifying the data, source and destination ports and address to be sent.
IP Interface
 The UDP module must be able to determine the source and destination
internet address and the protocol field from internet header
 One possible UDP/IP interface would return the whole internet datagram
including the entire internet header in response to a receive operation
 Such an interface would also allow the UDP to pass a full internet
datagram complete with header to the IP to send. the IP would verify
certain fields for consistency and compute the internet header checksum.
 The IP interface allows the UDP module to interact with the network
layer of the protocol stack, which is responsible for routing and delivering
data across the network.
 The IP interface provides a mechanism for the UDP module to
communicate with other hosts on the network by providing access to the
underlying IP protocol.
 The IP interface can be used by the UDP module to send and receive data
packets over the network, with the help of IP routing and addressing
mechanisms.

6.Session Layer and PRESENTATION


LAYER:
Session Layer in OSI model:-
The Session Layer is the 5th layer in the Open System Interconnection (OSI)
model which plays an important role in controlling the dialogues (connections)
between computers. This layer is responsible for setting up, coordinating, and
terminating conversations, exchanges, and dialogues between the applications
at each end. It establishes, manages, and terminates the connections between
the local and remote applications.
 The Session Layer is responsible for establishing active communication
sessions between two devices.
 In the OSI model, the transport layer is not responsible for releasing a
connection. Instead, the session layer is responsible for that. However, in
modern TCP/IP networks, TCP already provides orderly closing of
connections at the transport layer.
 Dialogue Control is also implemented in the Session Layer of the OSI
model but in TCP/IP the dialogue control is implemented in the
Application Layer.
 Session-layer services are commonly used in application environments
that use remote procedure calls (RPCs).
 Zone Information Protocol in AppleTalk is an example of Session Layer
Implementation.
 Session Layer has synchronization and resynchronization techniques that
ensure reliable and orderly communication over networks, which is
particularly important in applications requiring high levels of data
integrity and continuity.
 Synchronization points are markers or tokens inserted into the data
stream that allow communication sessions to have checkpoints and on
the other hand Resynchronization involves restoring a session to a
known state after a disruption, such as a network failure or session
timeout.
Session Layer in OSI Model
In Session Layer, data streams are received and further marked, which is then
resynchronized properly, so that the ends of the messages are not cut initially
and further data loss is avoided. This layer establishes a connection between
the session entities. This layer handles and manipulates data that it receives
from the Session Layer as well as from the Presentation Layer.
Functions of Session Layear
The session layer performs several different as well as important functions that
are needed for establishing as well as maintaining a safe and secure
connection:
1. Session Establishment : It establishes and manages sessions between
communicating parties that cab be connection-oriented or
connectionless. It also maps sessions to transport connections.
2. Communication Synchronization : It ensures reliable connectivity and
recovery by using synchronization bits and checkpoints in data stream.
3. Activity Management : It allow the user to divide data into logical units
called activities. An activity can be processed on its own and each
activity is independent of activities that come before and after it.
4. Dialog Management : It refers to deciding whose turn it is to talk. Some
applications uses a token mechanism for half-duplex mode, where only
one party holds the token to transmit data while other supports full-
duplex mode for simultaneous data transmission.
5. Data Transfer : It manages data exchange between systems.
6. Resynchronization : In this, all the tokens are restored to the positions
that were set during synchronization. The various options for
resynchronization includes set, abandon and restart.
Working of Session Layer
 The Session Layer manages communication sessions between
applications over a network.
 It establishes connections, negotiating session parameters like
authentication and communication direction (full-duplex or half-duplex).
 It oversees data exchange by using tokens to manage transmission rights
and prevent collisions.
 Synchronization techniques are implemented, inserting checkpoints for
recovery in case of disruptions.
 It ensures orderly communication, reducing message loss, duplication, or
errors caused by overlapping communication.
 The Session Layer gracefully terminates the session, ensuring all data is
exchanged and both sides agree to close
Session Layer Protocols
Session Layer uses some protocols which are required for safe, secure and
accurate communication which exists between two-ender user applications.
Following are some of the protocols provided or used by the Session Layer:
 AppleTalk Data Stream Protocol (ADSP): ADSP is that type of protocol
which was developed by Apple Inc. and it includes a number of features
that allow local area networks to be connected with no prior setup. This
protocol was released in 1985. This protocol rigorously followed the OSI
model of protocol layering. ADSP itself has two protocols named:
AppleTalk Address Resolution Protocol (AARP) and Name Binding
Protocol (NBP), both aimed at making system self-configuring.
 Real-time Transport Control Protocol (RTCP): RTCP is a protocol which
provides out-of-band statistics and control information for an RTP (Real-
time Transport Protocol) session. RTCP's primary function is to provide
feedback on the quality of service (QoS) in media distribution by
periodically sending statistical information such as transmitted octet and
packet counts or packet loss to the participants in the streaming
multimedia session.
 Point-to-Point Tunneling Protocol (PPTP): PPTP is a protocol which
provides a method for implementing virtual private networks. PPTP uses
a TCP control channel and a Generic Routing Encapsulation tunnel to
encapsulate PPP (Point-to-Point Protocol) packets This protocol provides
security levels and remote access levels comparable with typical VPN
(Virtual Private Network) products.
 Password Authentication Protocol (PAP): It is a password-based
authentication protocol used by Point to Point Protocol (PPP) to validate
users. Almost all network operating systems, remote servers support
PAP. PAP authentication is done at the time of the initial link
establishment and verifies the identity of the client using a two-way
handshake (Client-sends data and server in return sends Authentication-
ACK (Acknowledgement) after the data sent by client is verified
completely).
 Remote Procedure Call Protocol (RPCP): It is a protocol that is used
when a computer program causes a procedure (or a sub-routine) to
execute in a different address space without the programmer explicitly
coding the details for the remote interaction. This is basically the form of
client-server interaction, typically implemented via a request-response
message-passing system.
 Sockets Direct Protocol (SDP): It is a protocol that supports streams of
sockets over Remote Direct Memory Access (RDMA) network fabrics. The
purpose of SDP is to provide an RDMA-accelerated alternative to the TCP
protocol. The primary goal is to perform one particular thing in such a
manner which is transparent to the application.
What devices are in the session layer?
Devices associated with the Session Layer include:
 Firewalls: Manage session control by monitoring and filtering network
connections.
 Proxy Servers: Establish and manage sessions between clients and
servers.
 Session Border Controllers (SBCs): Used in VoIP to manage and secure
communication sessions.
 Application Servers: Handle session creation and management for
applications.
*How does the Session Layer differ from the Transport Layer?
The Session Layer manages sessions (logical connections), while the Transport
Layer ensures reliable data delivery.
*How does the Session Layer handle synchronization?
It uses checkpoints to allow data recovery in case of communication failure

Presentation Layer in OSI model:-


Presentation Layer is the 6th layer in the Open System Interconnection (OSI)
model. This layer is also known as Translation layer, as this layer serves as a
data translator for the network. The data which this layer receives from the
Application Layer is extracted and manipulated here as per the required format
to transmit over the network. The main responsibility of this layer is to provide
or define the data format and encryption. The presentation layer is also called
as Syntax layer since it is responsible for maintaining the proper syntax of the
data which it either receives or transmits to other layer(s)
Functions of Presentation Layer
The presentation layer performs several types of functions such as data
translation, compression, encryption/decryption etc.
Services Provided by Presentation Layer
Presentation layer plays an important role while communication is taking place
between two devices in a network.
List of services which are provided by the presentation layer are:
 Presentation layer could apply certain sophisticated compression
techniques, so fewer bytes of data are required to represent the
information when it is sent over the network.
 If two or more devices are communicating over an encrypted
connection, then this presentation layer is responsible for adding
encryption on the sender's end as well as the decoding the encryption
on the receiver's end so that it can represent the application layer with
unencrypted, readable data.
 This layer formats and encrypts data to be sent over a network,
providing freedom from compatibility problems.
 This presentation layer is also responsible for compressing data it
receives from the application layer before delivering it to the session
layer (which is the 5th layer in the OSI model) and thus improves the
speed as well as the efficiency of communication by minimizing the
amount of the data to be transferred.
 This presentation layer also negotiates the Transfer Syntax.
Working of Presentation Layer
Here's how presentation layer works:
 Data Translation: Converts data into a standardized format (e.g., EBCDIC
to ASCII).
 Data Compression: Reduces data size to optimize bandwidth and speed.
 Data Encryption/Decryption: Secures data during transmission (e.g.,
SSL/TLS).
 Syntax and Semantics: Ensures data is interpreted correctly across
systems.
 Interoperability: Bridges differences in data formats between devices.
Presentation Layer Protocols
Presentation Layer, for performing translations or other specified functions,
needs to use certain protocols which are defined below -
 Apple Filing Protocol (AFP): Apple Filing Protocol is the proprietary
network protocol (communications protocol) that offers services to
macOS or the classic macOS. This is basically the network file control
protocol specifically designed for Mac-based platforms.
 Lightweight Presentation Protocol (LPP): Lightweight Presentation
Protocol is that protocol which is used to provide ISO presentation
services on the top of TCP/IP based protocol stacks.
 NetWare Core Protocol (NCP): NetWare Core Protocol is the network
protocol which is used to access file, print, directory, clock
synchronization, messaging, remote command execution and other
network service functions.
 Network Data Representation (NDR): Network Data Representation is
basically the implementation of the presentation layer in the OSI model,
which provides or defines various primitive data types, constructed data
types and also several types of data representations.
 External Data Representation (XDR): External Data Representation (XDR)
is the standard for the description and encoding of data. It is useful for
transferring data between computer architectures and has been used to
communicate data between very diverse machines. Converting from
local representation to XDR is called encoding, whereas converting XDR
into local representation is called decoding.
 Secure Socket Layer (SSL): The Secure Socket Layer protocol provides
security to the data that is being transferred between the web browser
and the server. SSL encrypts the link between a web server and a
browser, which ensures that all data passed between them remains
private and free from attacks.
What are the presentation layer attacks?
Presentation layer attacks exploit the vulnerabilities in how data is formatted,
encrypted, compressed, or transmitted between systems. Common attacks
include:
 Man-in-the-Middle (MITM) Attacks: Interception of data during
transmission to steal sensitive information like login credentials or
financial details.
 SSL/TLS Downgrade Attacks: Forcing a connection to use weaker
encryption protocols, making it easier to decrypt the data.
 Certificate Spoofing: Using fake or compromised security certificates to
impersonate a trusted entity and gain access to sensitive data.
 Code Injection: Exploiting vulnerabilities in data parsing or translation
*What is TLS in presentation layer?
TLS (Transport Layer Security) is a cryptographic protocol that operates at the
Presentation Layer. It ensures secure communication between devices by
encrypting data, maintaining its integrity, and providing authentication.
*What is SSL vs TLS?
SSL (Secure Sockets Layer) and TLS (Transport Layer Security) are protocols for
securing communication. TLS is the modern, more secure successor to SSL.
While SSL (now outdated) had vulnerabilities, TLS improves encryption,
authentication, and overall security. TLS is widely used for secure web
browsing, replacing SSL.

Secure Socket Layer (SSL):-


SSL or Secure Sockets Layer, is an Internet security protocol that encrypts data
to keep it safe. It was created by Netscape in 1995 to ensure privacy,
authentication, and data integrity in online communications. SSL is the older
version of what we now call TLS (Transport Layer Security).
Websites using SSL/TLS have "HTTPS" in their URL instead of "HTTP."
Working of SSL
 Encryption: SSL encrypts data transmitted over the web, ensuring
privacy. If someone intercepts the data, they will see only a jumble of
characters that is nearly impossible to decode.
 Authentication: SSL starts an authentication process called a handshake
between two devices to confirm their identities, making sure both
parties are who they claim to be.
 Data Integrity: SSL digitally signs data to ensure it hasn't been tampered
with, verifying that the data received is exactly what was sent by the
sender.
Importance of SSL
Originally, data on the web was transmitted in plaintext, making it easy for
anyone who intercepted the message to read it. For example, if someone
logged into their email account, their username and password would travel
across the Internet unprotected.
SSL was created to solve this problem and protect user privacy. By encrypting
data between a user and a web server, SSL ensures that anyone who intercepts
the data sees only a scrambled mess of characters. This keeps the user's login
credentials safe, visible only to the email service.
Additionally, SSL helps prevent cyber attacks by:
 Authenticating Web Servers: Ensuring that users are connecting to the
legitimate website, not a fake one set up by attackers.
 Preventing Data Tampering: Acting like a tamper-proof seal, SSL ensures
that the data sent and received hasn't been altered during transit.
Secure Socket Layer Protocols
1. SSL Record Protocol
2. Handshake Protocol
3. Change-Cipher Spec Protocol
4. Alert Protocol
SSL Record Protocol
SSL Record provides two services to SSL connection.
 Confidentiality
 Message Integrity
In the SSL Record Protocol application data is divided into fragments. The
fragment is compressed and then encrypted MAC (Message Authentication
Code) generated by algorithms like SHA (Secure Hash Protocol) and MD5
(Message Digest) is appended. After that encryption of the data is done and in
last SSL header is appended to the data.

Handshake Protocol
Handshake Protocol is used to establish sessions. This protocol allows the client
and server to authenticate each other by sending a series of messages to each
other. Handshake protocol uses four phases to complete its cycle.
 Phase-1: In Phase-1 both Client and Server send hello-packets to each
other. In this IP session, cipher suite and protocol version are exchanged
for security purposes.
 Phase-2: Server sends it certificate and Server-key-exchange. The server
end phase-2 by sending the Server-hello-end packet.
 Phase-3: In this phase, Client replies to the server by sending it
certificate and Client-exchange-key.
 Phase-4: In Phase-4 Change Cipher Spec occurs and after this the
Handshake Protocol ends.

SSL Handshake Protocol Phases


diagrammatic representation
Change-Cipher Protocol
This protocol uses the SSL record protocol. Unless Handshake Protocol is
completed, the SSL record Output will be in a pending state. After the
handshake protocol, the Pending state is converted into the current state.
Change-cipher protocol consists of a single message which is 1 byte in length
and can have only one value. This protocol's purpose is to cause the pending
state to be copied into the current state.

Alert Protocol
This protocol is used to convey SSL-related alerts to the peer entity. Each
message in this protocol contains 2 bytes.

The level is further classified into two parts:


Warning (level = 1)
This Alert has no impact on the connection between sender and receiver. Some
of them are:
 Bad Certificate: When the received certificate is corrupt.
 No Certificate: When an appropriate certificate is not available.
 Certificate Expired: When a certificate has expired.
 Certificate Unknown: When some other unspecified issue arose in
processing the certificate, rendering it unacceptable.
 Close Notify: It notifies that the sender will no longer send any messages
in the connection.
 Unsupported Certificate: The type of certificate received is not
supported.
 Certificate Revoked: The certificate received is in revocation list.
Fatal Error (level = 2):
This Alert breaks the connection between sender and receiver. The connection
will be stopped, cannot be resumed but can be restarted. Some of them are :
 Handshake Failure: When the sender is unable to negotiate an
acceptable set of security parameters given the options available.
 Decompression Failure: When the decompression function receives
improper input.
 Illegal Parameters: When a field is out of range or inconsistent with
other fields.
 Bad Record MAC: When an incorrect MAC was received.
 Unexpected Message: When an inappropriate message is received.
The second byte in the Alert protocol describes the error.
Salient Features of Secure Socket Layer
 The advantage of this approach is that the service can be tailored to the
specific needs of the given application.
 Secure Socket Layer was originated by Netscape.
 SSL is designed to make use of TCP to provide reliable end-to-end secure
service.
 This is a two-layered protocol.
Versions of SSL
SSL 1 - Never released due to high insecurity
SSL 2 - Released in 1995
SSL 3 - Released in 1996
TLS 1.0 - Released in 1999
TLS 1.1 - Released in 2006
TLS 1.2 - Released in 2008
TLS 1.3 - Released in 2018
SSL Certificate
SSL (Secure Sockets Layer) certificate is a digital certificate used to secure and
verify the identity of a website or an online service. The certificate is issued by
a trusted third-party called a Certificate Authority (CA), who verifies the
identity of the website or service before issuing the certificate.
The SSL certificate has several important characteristics that make it a reliable
solution for securing online transactions :
 Encryption: The SSL certificate uses encryption algorithms to secure the
communication between the website or service and its users. This
ensures that the sensitive information, such as login credentials and
credit card information, is protected from being intercepted and read by
unauthorized parties.
 Authentication: The SSL certificate verifies the identity of the website or
service, ensuring that users are communicating with the intended party
and not with an impostor. This provides assurance to users that their
information is being transmitted to a trusted entity.
 Integrity: The SSL certificate uses message authentication codes (MACs)
to detect any tampering with the data during transmission. This ensures
that the data being transmitted is not modified in any way, preserving its
integrity.
 Non-repudiation: SSL certificates provide non-repudiation of data,
meaning that the recipient of the data cannot deny having received it.
This is important in situations where the authenticity of the information
needs to be established, such as in e-commerce transactions.
 Public-key cryptography: SSL certificates use public-key cryptography for
secure key exchange between the client and server. This allows the client
and server to securely exchange encryption keys, ensuring that the
encrypted information can only be decrypted by the intended recipient.
 Session management: SSL certificates allow for the management of
secure sessions, allowing for the resumption of secure sessions after
interruption. This helps to reduce the overhead of establishing a new
secure connection each time a user accesses a website or service.
 Certificates issued by trusted CAs: SSL certificates are issued by trusted
CAs, who are responsible for verifying the identity of the website or
service before issuing the certificate. This provides a high level of trust
and assurance to users that the website or service they are
communicating with is authentic and trustworthy.
In addition to these key characteristics, SSL certificates also come in
various levels of validation, including Domain Validation (DV), Organization
Validation (OV), and Extended Validation (EV). The level of validation
determines the amount of information that is verified by the CA before issuing
the certificate, with EV certificates providing the highest level of assurance and
trust to users. For more information about SSL certificates for each Validation
level type, please refer to Namecheap.
Overall, the SSL certificate is an important component of online security,
providing encryption, authentication, integrity, non-repudiation, and other key
features that ensure the secure and reliable transmission of sensitive
information over the internet.
Types of SSL Certificates
There are different types of SSL certificates, each suited for different needs:
 Single-Domain SSL Certificate: This type covers only one specific domain.
A domain is the name of a website, like www.geeksforgeeks.org. For
instance, if you have a single-domain SSL certificate for
www.geeksforgeeks.org, it won't cover any other domains or
subdomains.
 Wildcard SSL Certificate: Similar to a single-domain certificate, but it also
covers all subdomains of a single domain. For example, if you have a
wildcard certificate for *.geeksforgeeks.org, it would cover
www.geeksforgeeks.org, blog.www.geeksforgeeks.org, and any other
subdomain under example.com.
 Multi-Domain SSL Certificate: This type can secure multiple unrelated
domains within a single certificate.
These certificates vary in scope and flexibility, allowing website owners to
choose the appropriate level of security coverage based on their needs.
SSL certificates have different validation levels, which determine how
thoroughly a business or organization is vetted:
 Domain Validation (DV): This is the simplest and least expensive level. To
get a DV certificate, a business just needs to prove it owns the domain
(like www.geeksforgeeks.org).
 Organization Validation (OV): This involves a more hands-on verification
process. The Certificate Authority (CA) directly contacts the organization
to confirm its identity before issuing the certificate. OV certificates
provide more assurance to users about the legitimacy of the
organization.
 Extended Validation (EV): This is the most rigorous level of validation. It
requires a comprehensive background check of the organization to
ensure it's legitimate and trustworthy. EV certificates are recognized by
the green address bar in web browsers, indicating the highest level of
security and trustworthiness.
These validation levels help users understand the level of security and trust
they can expect when visiting websites secured with SSL certificates.
Are SSL and TLS the Same thing?
SSL is the direct predecessor of TLS (Transport Layer Security). In 1999,
the Internet Engineering Task Force (IETF) proposed an update to SSL. Since this
update was developed by the IETF without Netscape's involvement, the name
was changed to TLS. The changes between the last version of SSL (3.0) and the
first version of TLS were not significant; the name change mainly signified new
ownership.
Because SSL and TLS are so similar, people often use the terms interchangeably.
Some still call it SSL, while others use "SSL/TLS encryption" since SSL is still
widely recognized.
Check SSL Version
SSL (Secure Sockets Layer) hasn't been updated since SSL 3.0 back in 1996 and
is now considered outdated. It has known vulnerabilities, so security experts
advise against using it. Most modern web browsers no longer support SSL.
TLS (Transport Layer Security) is the current encryption protocol used online.
Despite this, many still refer to it as "SSL encryption," causing confusion when
people look for security solutions. Nowadays, any vendor offering "SSL" is likely
providing TLS protection, which has been the standard for over 20 years. The
term "SSL protection" is still used widely on product pages because many users
still search for it.

PPTP Full Form - Point-to-Point Tunneling Protocol:-


PPTP Stands for Point-to-Point Tunneling Protocol is a widely used networking
protocol designed to create a secure private connection over a public network
like the internet. It is Developed by Microsoft and other tech companies in the
1990s It is one of the first protocols used for Virtual Private Networks VPNs. A
PPTP works by establishing a tunnel between two points allowing users to
securely connect to private networks from remote locations.
This protocol essentially creates a direct and private pathway for data
transmission making it appear as if the remote user is directly connected to a
private network even when accessing it from anywhere in the world through
the internet.
What is PPTP?
The PPTP means a Point-to-Point Tunneling Protocol. The PPTP is a networking
standard for connecting to a virtual private network VPN. These are secure
networks that can be accessed over the Internet allowing the users to access
the network from a remote location. This is useful for a people who need to
connect to an other network from one location to another location.
the "point-to-point" term refers to the connection generated by PPTP. It allows
one point to access another determined point over the Internet. The
"tunneling" term refers to the way one protocol/Algorithm is encapsulated
within another respective one. In PPTP, the point-to-point protocol is wrapped
inside the TCP/IP protocol, which provides the Internet connection. Therefore,
even though the connection is created over the Internet, the PPTP connection
makes a direct link between the two clients/locations, giving a secure
connection. PPTP is fast due to its low level of encryption and it is capable of
offering fast connectivity.
How does PPTP work?
PPTP is an improved version of PPP, on the basis of its authentication and
encryption framework. Like all the tunneling technologies PPTP is used to
encapsulate data creating a route for data to flow across the IP network. This
PPTP uses a client-server design that operates at Layer 2 of an OSI model. Once
a VPN tunnel is established, PPTP supports two types of information flow, one
is the Control messages for managing and eventually tearing down the VPN
connection.
Control messages pass directly between VPN client and server. The other one
being Data packets that pass through the tunnel, i.e. to or from the VPN client.
PPTP uses General Routing Encapsulation, TCP port 1723, and IP port 47. PPTP
supports encryption keys up to 128-bits, and it uses Microsoft Point-to-Point
Encryption.
The most secured versions of PPTP is to exclusively use:
 MPPE-128 encryption which uses RC4 encryption with a 128bit key.
 MS-CHAPv2 authentication which uses SHA-1.
 Strong Passwords.
Types of Tunneling
1.Voluntary Tunneling
In this client-initiated approach, the user's device creates and manages the VPN
connection directly. It offers greater control to the end-user but requires
manual configuration, making it popular for personal VPN use and remote work
scenarios.
2.Compulsory Tunneling
This server-initiated method automatically establishes the VPN connection as
soon as the user connects to the internet. It provides centralized control for
organizations, ensuring all traffic passes through the VPN, but requires network
infrastructure support and may impact connection flexibility.
Advantages of PPTP
 PPTP is a very fast VPN protocol.
 PPTP is really easy to set up and configure on most operating systems
and devices.
 Due to the protocol’s high rate of cross-platform compatibility, a PPTP
connection can be established on tons of platforms.
 Lower Transmission Costs: No additional service used, other than the
Internet.
 Reduces hardware costs: Allows ISDN cards and modems to be
separated from other servers, which results in fewer devices to purchase
and manage.
 Low Administrative Overhead: Administrators only manage the remote
access server (RAS) and user accounts, rather than managing different
hardware configurations.
 Enhanced Security: PPTP connection is encrypted and secured over the
Internet and works with other networking protocols, like IP, Internetwork
Packet Exchange and NetBIOS Extended User Interface (NetBEUI).
Disadvantages of PPTP
 PPTP encryption is sub-par and not suitable for securing online data and
traffic. The NSA has actually cracked PPTP traffic.
 A PPTP connection can be exploited by cybercriminals with malicious
attacks.
 A router with PPTP Passthrough is usually required since PPTP doesn’t
natively work with NAT.
 A PPTP connection can be blocked quite easily by firewalls.

Multipurpose Internet Mail Extension (MIME) Protocol:-


MIME (Multipurpose Internet Mail Extensions) is a standard used to extend
the format of email messages, allowing them to include more than just text.
It enables the transmission of multimedia content such as images, audio,
video, and attachments, within email messages, as well as other types of
content types.
Multipurpose Internet Mail Extension (MIME) Protocol
It was designed to make email messages more versatile and allow a wider
variety of content to be sent over email systems that traditionally only
supported plain ASCII text. MIME works by encoding the message content in
a way that ensures it can be transmitted over email protocols like SMTP
(Simple Mail Transfer Protocol) without loss of data or corruption. It breaks
down the data into a format that's safe for email transmission and provides
metadata that helps identify the type of content.
Characteristics of MIME
 Text Encoding: It allows email messages to contain characters from
character sets beyond ASCII (such as UTF-8).
 Attachments: It enables emails to include multimedia content such as
images, video, and audio files as attachments.
 Multipart Messages: It allows the message to be divided into multiple
parts, such as plain text and HTML content, or different types of media
files.
 Header Fields: It introduces special header fields that define how the
content should be interpreted (e.g., Content-Type, Content-Disposition).
MIME Structure
A typical MIME email consists of several parts:
 MIME-Version: Specifies the version of MIME being used.
 Content-Type: Describes the type of the content (e.g., text, image,
audio).
 Content-Transfer-Encoding: Specifies how the content is encoded for
transmission (e.g., base64, quoted-printable).
 Content-Disposition: Defines whether the content is inline or as an
attachment.
Working of MIME
Suppose a user wants to send an email through a user agent and it is in a
non-ASCII format so there is a MIME protocol that converts it into 7-bit
NVT ASCII format.
The message is transferred through the e-mail system to the other side in
the 7-bit format now MIME protocol again converts it back into non-ASCII
code and now the user agent of the receiver side reads it and then
information is finally read by the receiver. MIME header is basically inserted
at the beginning of any e-mail transfer.
The below diagram shows the working of the MIME protocol:

MIME working
 Content-Type Header: MIME introduces the Content-Type header, which
tells the receiving email client what kind of data is being sent (e.g., text,
image, audio).
 Encoding: Non-textual data (e.g., images or files) is encoded into ASCII
text format using base64 or other encoding schemes. This ensures that
binary data can be sent over a text-based protocol.
 Multipart Messages: If the message contains more than one part (such
as a mix of text and attachments), MIME can structure the email as
multipart with a boundary separator to distinguish between different
parts.
MIME Header Key Fields and Their Functions
 MIME-Version: Defines the version of the MIME protocol. Must be 1.0,
indicating the message uses MIME formatting.
 Content-Type: Specifies the type of data in the message body, such
as text/plain, text/html, image/jpeg, or audio/mpeg.
 Content-Transfer-Encoding: Indicates the encoding method used to
transmit the message safely such as 7bit, 8bit, base64, or quoted-
printable.
 Content-ID: Provides a unique identifier for each MIME part, useful for
referencing embedded objects like inline images.
 Content-Description: Describes the nature of the content (e.g., “Image
file”, “Video clip”, or “PDF Document”) to understand what’s included.
Advantages of MIME
 Supports Multiple Data Types : MIME enables the transfer of diverse
data formats such as text, audio, video, images, and application files in
email messages.
 Multilingual Compatibility : Emails can be composed and read in various
languages including Hindi, French, Japanese, Chinese, and more.
 Rich Formatting with HTML/CSS : Allows users to attach HTML and CSS,
making it possible to customize and stylize emails with enhanced
formatting.
 Handles Long Messages : Capable of delivering large or lengthy email
content without loss of data or formatting.
 Unique Identification : Assigns a unique Content-ID to each message or
attachment, helpful in managing embedded media.
Disadvantages of MIME
 Inconsistent Interpretation : The receiver’s system may not interpret
MIME types correctly, potentially affecting content display or behavior.
 Increased Overhead : MIME adds extra headers and encoding,
increasing the size of the email and possibly slowing down transmission.
 Complexity for Users : Most users are unfamiliar with MIME types, and
multiple media types can make the message harder to understand.
 Compatibility Issues : Some older or limited systems may not support
MIME, leading to errors or loss of content during transmission.

7. Application Layer:-
Application Layer in OSI Model:-
The Application Layer of OSI (Open System Interconnection) model, is the
top layer in this model and takes care of network communication. The
application layer provides the functionality to send and receive data from
users. It acts as the interface between the user and the application. The
application provides services like file transmission, mail service, and many
more.
Functions of Application Layer
The Application Layer, being topmost layer in OSI model, performs functions
required in any kind of application or communication process. Let's have a
look into the functions:

Working of Application Layer


 At first, client sends a command to server and when server receives that
command, it allocates port number to client.
 Thereafter, the client sends an initiation connection request to server
and when server receives request, it gives acknowledgement (ACK) to
client through client has successfully established a connection with the
server.
 Therefore, now client has access to server through which it may either
ask server to send any types of files or other documents or it may upload
some files or documents on server itself.
Services Provided by Application Layer Protocols
The following are some of the services which are provided by Application
layer protocols-
 The Application Layer protocol defines process for both parties which are
involved in communication.
 These protocols define the type of message being sent or received from
any side (either source host or destination host).
 These protocols also define basic syntax of the message being forwarded
or retrieved.
 These protocols define the way to send a message and the expected
response.
 These protocols also define interaction with the next level.
Read in detail about Services Provided by Application Layer.
Protocols of the Application Layer
The application layer provides several protocols which allow any software to
easily send and receive information and present meaningful data to its
users. The following are some of the application layer protocols.
 HTTP: HTTP stands for Hyper Text Transfer Protocol. It is the foundation
of the World Wide Web (WWW). HTTP works on the client server model.
This protocol is used for transmitting hypermedia documents like HTML.
This protocol was designed particularly for the communications between
the web browsers and web servers, but this protocol can also be used for
several other purposes. HTTP is a stateless protocol (network protocol in
which a client sends requests to server and server responses back as per
the given state), which means the server is not responsible for
maintaining the previous client's requests. HTTP uses port number 80.
 DNS: DNS stands for Domain Name System. The DNS service translates
the domain name (selected by user) into the corresponding IP address.
For example- If you choose the domain name as www.abcd.com, then
DNS must translate it as 192.36.20.8 (random IP address written just for
understanding purposes). DNS protocol uses the port number 53.
 TELNET: Telnet stands for Telecommunications Network. This protocol is
used for managing files over the Internet. It allows the Telnet clients to
access the resources of Telnet server. Telnet uses port number 23.
 DHCP: DHCP stands for Dynamic Host Configuration Protocol. It provides
IP addresses to hosts. Whenever a host tries to register for an IP address
with the DHCP server, DHCP server provides lots of information to the
corresponding host. DHCP uses port numbers 67 and 68.
 FTP: FTP stands for File Transfer Protocol. This protocol helps to transfer
different files from one device to another. FTP promotes sharing of files
via remote computer devices with reliable, efficient data transfer. FTP
uses port number 20 for data access and port number 21 for data
control.
 SMTP: SMTP stands for Simple Mail Transfer Protocol. It is used to
transfer electronic mail from one user to another user. SMTP is used by
end users to send emails with ease. SMTP uses port numbers 25 and
587. .
 NFS: NFS stands for Network File System. This protocol allows remote
hosts to mount files over a network and interact with those file systems
as though they are mounted locally. NFS uses the port number 2049.
 SNMP: SNMP stands for Simple Network Management Protocol. This
protocol gathers data by polling the devices from the network to the
management station at fixed or random intervals, requiring them to
disclose certain information. SNMP uses port numbers 161 (TCP) and 162
(UDP).

Client-Server Model:-
The Client-Server Model is a distributed application architecture that
divides tasks or workloads between servers (providers of resources or
services) and clients (requesters of those services). In this model,
a client sends a request to a server for data, which is typically processed on
the server side. The server then returns the requested data to the client.
Clients generally do not share resources with each other, but instead rely on
the server to provide the resources or services requested. Common
examples of the client-server model include email systems and the World
Wide Web (WWW), where email clients interact with mail servers, and web
browsers request resources from web servers.
How Does the Client-Server Model Work?
In this article, we are going to take a dive into the Client-Server model and
have a look at how the Internet works via, web browsers. This article will
help us have a solid WEB foundation and help us easily work with WEB
technologies.
Client
When we talk about a "Client," it refers to a device (usually a computer,
smartphone, or application) that requests and receives services from a
server. The client is the entity that initiates communication, asking for data
or resources from the server. For instance, web browsers like Google
Chrome, Mozilla Firefox, or Safari are common client applications that
request data from a server to render web pages.
Server
A Server, on the other hand, is a remote computer or system that provides
data, resources, or services to clients. It listens to incoming client requests,
processes them, and sends the required information back. A server can
handle multiple client requests simultaneously.
For example, Web servers host websites, and database servers store and
serve databases for applications. In simple terms, the client sends a request
to the server, and the server serves the request as long as the data or
service is available in its system.
Client Server Model
How the Browser Interacts With the Servers?
The process of interacting with servers through a browser involves several
steps. Here's a breakdown of the steps taken when you enter a URL in a
browser and receive the website data:
1. User Enters the URL (Uniform Resource Locator): The user types a
website address (e.g., www.example.com) into the browser's address bar.
2. DNS (Domain Name System) Lookup: The browser sends a request to
the DNS server to resolve the human-readable URL into an IP address (since
computers use IP addresses to identify and connect to each other).
3. DNS Server Resolves the Address: The DNS server looks up the domain
name and returns the IP address of the web server hosting the requested
website.
4. Browser Sends HTTP/HTTPS Request: The browser sends an HTTP/HTTPS
request to the IP address of the web server to fetch the website’s data.
HTTP (HyperText Transfer Protocol) or HTTPS (the secure version) is the
protocol used for communication between the browser (client) and the web
server (server).
5. Server Sends Website Files: The server processes the request and sends
the necessary website files (HTML, CSS, JavaScript, images, etc.) back to the
browser.
6. Rendering the Website: The browser renders the files and displays the
website to the user. This rendering process involves several
components:Together, these components, known as Just-In-Time (JIT)
Compilers, allow the browser to convert raw data into a visual webpage.
 DOM (Document Object Model) Interpreter: Processes the HTML
structure.
 CSS Interpreter: Applies styles to the HTML elements.
 JS Engine: Executes JavaScript code for interactivity.
Together, these components, known as Just-In-Time (JIT) Compilers, allow
the browser to convert raw data into a visual webpage.

Client Server Request


and Response
Advantages of the Client-Server Model
The Client-Server model offers several advantages that make it popular in
networked and distributed systems:
 Centralized Data Management: All data is stored in a centralized server,
which makes it easier to manage, update, and back up.
 Cost Efficiency: Since the server handles most of the processing, clients
require fewer resources and can be simpler devices, reducing costs.
 Scalability: Both clients and servers can be scaled separately. Servers can
be upgraded to handle more clients, and new clients can be added
without significant changes to the server infrastructure.
 Data Recovery: Centralized data storage on the server allows for
better data recovery and easier backup strategies.
 Security: Security measures such as firewalls, encryption, and
authentication can be centralized on the server, ensuring that sensitive
data is protected.
Disadvantages of Client-Server Model
 Clients Are Vulnerable: Clients are prone to viruses, Trojans, and worms
if present in the Server or uploaded into the Server.
 Servers Are Targets: Servers are prone to Denial of Service (DOS) attacks,
where the server is overwhelmed with traffic and made unavailable to
legitimate clients.
 Data Spoofing and Modification: Data packets may be spoofed or
modified during transmission if the proper security measures (e.g.,
encryption) are not implemented.
 Man-in-the-Middle (MITM) Attacks: Phishing or capturing login
credentials or other useful information of the user are common
and MITM(Man in the Middle) attacks are common.
Real-World Examples of the Client-Server Model
1. Email Systems
 Client: The user’s email client (e.g., Microsoft Outlook, Gmail App).
 Server: The email server (e.g., Gmail Server, Yahoo Mail Server).
 How It Works: The email client requests emails from the server, and the
server delivers them. Similarly, when the user sends an email, the client
communicates with the server to send the message.
2. The World Wide Web
 Client: A web browser (e.g., Google Chrome, Mozilla Firefox).
 Server: A web server (e.g., Apache Server, Nginx Server).
 How It Works: The browser requests the web pages from the server, and
the server sends the HTML files back to the client, which are then
rendered and displayed.
3. Cloud Storage Services
 Client: The user’s device (e.g., smartphone, PC).
 Server: A cloud server (e.g., Google Drive, Dropbox).
 How It Works: The client uploads files to the server and can download
them when needed. The server stores all the user’s files centrally,
ensuring remote access to data.

World Wide Web (WWW):-


The World Wide Web (WWW), often called the Web, is a system of
interconnected webpages and information that you can access using the
Internet. It was created to help people share and find information easily, using
links that connect different pages together. The Web allows us to browse
websites, watch videos, shop online, and connect with others around the world
through our computers and phones.
All public websites or web pages that people may access on their local
computers and other devices through the internet are collectively known as
the World Wide Web or W3. Users can get further information by navigating to
links interconnecting these pages and documents. This data may be presented
in text, picture, audio, or video formats on the internet.
Fact: Today, it connects over 63% of the world’s population, making it one of
the most powerful tools for communication and information sharing.
Key Parts of the Web
The Web has three main building blocks that make it work:
 URL (Uniform Resource Locator): This is the address of a webpage, like
https://www.example.com./ It tells your browser exactly where to find
the page.
 HTTP (Hypertext Transfer Protocol): This is the set of rules that lets your
browser and the server talk to each other to send and receive webpages.
 HTML (Hypertext Markup Language): This is the code that tells browsers
how to display a webpage, including where to put text, pictures, and
links.
Working of World Wide Web(WWW)
A Web browser is used to access web pages. Web browsers can be defined as
programs which display text, data, pictures, animation and video on the
Internet. Hyperlinked resources on the World Wide Web can be accessed using
software interfaces provided by Web browsers. Initially, Web browsers were
used only for surfing the Web but now they have become more universal.
The below diagram indicates how the Web operates just like client-server
architecture of the internet. When users request web pages or other
information, then the web browser of your system request to the server for the
information and then the web server provide requested services to web
browser back and finally the requested service is utilized by the user who made
the request.

World Wide Web


Web browsers can be used for several tasks, including conducting searches,
mailing, transferring files, and much more. Some of the commonly used
browsers are Internet Explorer, Opera Mini, and Google Chrome.
World Wide Web (WWW) Vs Internet
It’s easy to mix up the Web and the Internet, but they’re different:

Aspect World Wide Web Internet

What It Is A collection of webpages and A global network


websites you access with a connecting computers.
Aspect World Wide Web Internet

browser.

1989 by Tim Berners-Lee at


1960s as ARPANET.
Started CERN.

To share and explore information To connect devices and


Purpose like text, images, and videos. share data.

How You Through browsers like Chrome or Through any connected


Use It Firefox. device for email, apps, etc.

Sending an email or
Visiting a website like Wikipedia.
Example streaming a video.

Note: In short, the Web is just one part of the Internet, like a library is one part
of a city.
Challenges of the Web
The Web is amazing, but it has some problems that you should know about:
 Privacy: Some websites collect information about you, like what you
search for, and might share it without asking.
 Safety: Hackers can try to steal your information or send viruses through
fake links or ads.
 False Information: Not everything on the Web is true, so you need to
check if a website is trustworthy.
 Bullying: Some people use the Web to be mean or bully others, which
can hurt feelings.
 Too Much Screen Time: Spending too much time online can make it hard
to focus on school or sleep well.
 Access Issues: Not everyone has fast Internet, especially in some
countries, which makes it harder to use the Web.
History of the WWW
It is a project created, by Tim Berner Lee in 1989, for researchers to work
together effectively at CERN. It is an organization, named the World Wide Web
Consortium (W3C), which was developed for further development of the web.
This organization is directed by Tim Berner's Lee, aka the father of the web.
CERN, where Tim Berners worked, is a community of more than 1700
researchers from more than 100 countries. These researchers spend a little
time on CERN and the rest of the time they work at their colleges and national
research facilities in their home country, so there was a requirement for solid
communication so that they can exchange data.
How Web Evolves?

Web Evolution
World Wide Web(WWW) Evolved so much from web 1.0 to web 4.0 (Future of
WWW) as follows:
 Web 1.0 (1990–2000) Introduced static websites,
 while Web 2.0 (2000–2010) brought interactive and social platforms.
 Web 3.0 (2010–2020) focused on the semantic web, enabling machines
to understand data and offer personalized experiences.
 Looking ahead, Web 4.0 (2020–2030) is expected to be a fully intelligent
web ecosystem powered by AI and integrated web operating systems.
Some Facts About the Web
 The first website ever is still online! You can visit it at
"http://info.cern.ch/"
 There are over 1.5 billion websites in the world, and that number grows
every day.
 Google Chrome is used by more than 60% of people browsing the Web.
 The Web is available in over 150 languages, so you can explore in your
language or learn a new one!

Introduction to Electronic Mail:-


Introduction:
Electronic mail, commonly known as email, is a method of exchanging
messages over the internet. Here are the basics of email:
1. An email address: This is a unique identifier for each user, typically in the
format of name@domain.com.
2. An email client: This is a software program used to send, receive and
manage emails, such as Gmail, Outlook, or Apple Mail.
3. An email server: This is a computer system responsible for storing and
forwarding emails to their intended recipients.

To send an email:
1. Compose a new message in your email client.
2. Enter the recipient's email address in the "To" field.
3. Add a subject line to summarize the content of the message.
4. Write the body of the message.
5. Attach any relevant files if needed.
6. Click "Send" to deliver the message to the recipient's email server.
7. Emails can also include features such as cc (carbon copy) and bcc (blind
carbon copy) to send copies of the message to multiple recipients, and
reply, reply all, and forward options to manage the conversation.
Electronic Mail (e-mail) is one of most widely used services of Internet. This
service allows an Internet user to send a message in formatted manner
(mail) to the other Internet user in any part of world. Message in mail not only
contain text, but it also contains images, audio and videos data. The person
who is sending mail is called sender and person who receives mail is
called recipient. It is just like postal mail service. Components of E-Mail System
: The basic components of an email system are : User Agent (UA), Message
Transfer Agent (MTA), Mail Box, and Spool file. These are explained as following
below.
1. User Agent (UA) : The UA is normally a program which is used to send
and receive mail. Sometimes, it is called as mail reader. It accepts variety
of commands for composing, receiving and replying to messages as well
as for manipulation of the mailboxes.
2. Message Transfer Agent (MTA) : MTA is actually responsible for transfer
of mail from one system to another. To send a mail, a system must have
client MTA and system MTA. It transfer mail to mailboxes of recipients if
they are connected in the same machine. It delivers mail to peer MTA if
destination mailbox is in another machine. The delivery from one MTA to
another MTA is done by Simple Mail Transfer Protocol.

3. Mailbox : It is a file on local hard drive to collect mails. Delivered mails


are present in this file. The user can read it delete it according to his/her
requirement. To use e-mail system each user must have a mailbox .
Access to mailbox is only to owner of mailbox.
4. Spool file : This file contains mails that are to be sent. User agent
appends outgoing mails in this file using SMTP. MTA extracts pending
mail from spool file for their delivery. E-mail allows one name, an alias,
to represent several different e-mail addresses. It is known as mailing
list, Whenever user have to sent a message, system checks recipient's
name against alias database. If mailing list is present for defined alias,
separate messages, one for each entry in the list, must be prepared and
handed to MTA. If for defined alias, there is no such mailing list is
present, name itself becomes naming address and a single message is
delivered to mail transfer entity.
Services provided by E-mail system :
 Composition - The composition refer to process that creates messages
and answers. For composition any kind of text editor can be used.
 Transfer - Transfer means sending procedure of mail i.e. from the sender
to recipient.
 Reporting - Reporting refers to confirmation for delivery of mail. It help
user to check whether their mail is delivered, lost or rejected.
 Displaying - It refers to present mail in form that is understand by the
user.
 Disposition - This step concern with recipient that what will recipient do
after receiving mail i.e save mail, delete before reading or delete after
reading.
Advantages Or Disadvantages:
Advantages of email:
1. Convenient and fast communication with individuals or groups globally.
2. Easy to store and search for past messages.
3. Ability to send and receive attachments such as documents, images, and
videos.
4. Cost-effective compared to traditional mail and fax.
5. Available 24/7.

Disadvantages of email:
1. Risk of spam and phishing attacks.
2. Overwhelming amount of emails can lead to information overload.
3. Can lead to decreased face-to-face communication and loss of personal
touch.
4. Potential for miscommunication due to lack of tone and body language
in written messages.
5. Technical issues, such as server outages, can disrupt email service.
6. It is important to use email responsibly and effectively, for example, by
keeping the subject line clear and concise, using proper etiquette, and
protecting against security threats.

What is a Content Distribution Network and how does it work?


Over the last few years, there has been a huge increase in the number of
Internet users. YouTube alone has 2 Billion users worldwide, while Netflix has
over 160 million users. Streaming content to such a wide demographic of users
is no easy task. One can think that a straightforward approach to this can be
building a large data center, storing all the content in the servers, and providing
it to users worldwide. But there are issues that arise when this approach is
followed-
1. Firstly if the data center is in the USA and the user is in India there will be
slower delivery of content.
2. Secondly, a single data center represents a single point of failure.
3. Thirdly, if some content is being accessed frequently from a remote area
then it is likely to follow the same links, and this, in turn, results in
wastage of bandwidth.
CDN - Content Distribution Network or Content Delivery Network is a solution
that provides faster delivery of content to the users distributed
worldwide. What is a CDN? A CDN is essentially a group of servers that are
strategically placed across the globe with the purpose of accelerating the
delivery of web content. A CDN-
1. Manages servers that are geographically distributed over different
locations.
2. Stores the web content in its servers.
3. Attempts to direct each user to a server that is part of the CDN so as to
deliver content quickly.
How does CDN work? To minimize the distance between the visitors and your
website’s server, a CDN stores a cached version of original content in multiple
geographical locations (a.k.a., points of presence/ PoPs). Each PoP contains a
number of caching servers known as edge servers that are responsible for
content delivery to visitors within its proximity. CDN caches content in many
places at once, ensuring quick delivery of content. Let’s consider an
example: Suppose you are hosting a website, wherein your origin server(server
containing the primary source of your website’s data, where website files are
hosted) is located in Australia and a company XYZ provides you the CDN
service. When a user in India clicks on a video on your website, the request
goes to the user's local DNS server(DNS), which relays the request to the
authoritative DNS server of your website. The authoritative DNS server then
identifies that the user is situated far away and therefore relays the request to
its XYZ’s DNS server. Now the DNS query enters XYZ’s network which provides
the address of the edge server that is closest to the user to the Local DNS
server. The video is delivered by this edge server. From this point onwards the
local DNS server knows the address of the edge server. So whenever users
within its network send a request for content from your website, the local DNS
server shall relay the request to the edge server. CDN thus minimizes the
number of hops required to deliver the data to a user’s browser due to the
POPs that are located near the user. Following image depicts the same:

Following Image
depicts the difference between how a request is handled with and without a
CDN respectively: WITH CDN(2 SECONDS)
WITHOUT CDN(5 SECONDS)

Benefits of CDN
 Security improvement- The DDOS mitigation improves the security as it
contains some security certificates and optimizations.
 Increase in content availability and redundancy- Hardware failures and
more traffic can lead to the website’s dysfunction. CDN can handle traffic
and can withstand hardware disfunction better than many servers.
 Better load times- The visitor has a fast page loading because a nearby
CDN server is used whenever a client search for a webpage. CDN also
reduces the slow loading times by reducing the bounce rates and
increasing the amount of time people spend on site.
 Low bandwidth cost- The direct cost for hosting a website is bandwidth
consumption cost. With the help of caching and other optimizations, it
minimizes the amount of data an origin server must provide, thus
reducing the hosting costs.
Protocols in Application Layer:-
The Application Layer is the topmost layer in the Open System Interconnection
(OSI) model. This layer provides several ways for manipulating the data which
enables any type of user to access the network with ease. The Application
Layer interface directly interacts with the application and provides common
web application services. The application layer performs several kinds of
functions that are required in any kind of application or communication
process. In this article, we will discuss various application layer protocols.
What are Application Layer Protocols?
Application layer protocols are those protocols utilized at the application layer
of the OSI (Open Systems Interconnection) and TCP/IP models. They facilitate
communication and data sharing between software applications on various
network devices. These protocols define the rules and standards that allow
applications to interact and communicate quickly and effectively over a
network.
Application Layer Protocol in Computer Network
1. TELNET
Telnet stands for the TELetype NETwork. It helps in terminal emulation. It
allows Telnet clients to access the resources of the Telnet server. It is used for
managing files on the Internet. It is used for the initial setup of devices like
switches. The telnet command is a command that uses the Telnet protocol to
communicate with a remote device or system. The port number of the telnet is
23.
Command
telnet [\\RemoteServer]
\\RemoteServer
: Specifies the name of the server
to which you want to connect
2. FTP
FTP stands for File Transfer Protocol. It is the protocol that actually lets us
transfer files. It can facilitate this between any two machines using it. But FTP is
not just a protocol but it is also a program.FTP promotes sharing of files via
remote computers with reliable and efficient data transfer. The Port number for
FTP is 20 for data and 21 for control.
Command
ftp machinename
3. TFTP
The Trivial File Transfer Protocol (TFTP) is the stripped-down, stock version of
FTP, but it’s the protocol of choice if you know exactly what you want and
where to find it. It's a technology for transferring files between network
devices and is a simplified version of FTP. The Port number for TFTP is 69.
Command
tftp [ options... ] [host [port]] [-c command]
4. NFS
It stands for a Network File System. It allows remote hosts to mount file
systems over a network and interact with those file systems as though they are
mounted locally. This enables system administrators to consolidate resources
onto centralized servers on the network. The Port number for NFS is 2049.
Command
service nfs start
5. SMTP
It stands for Simple Mail Transfer Protocol. It is a part of the TCP/IP protocol.
Using a process called "store and forward," SMTP moves your email on and
across networks. It works closely with something called the Mail Transfer Agent
(MTA) to send your communication to the right computer and email inbox. The
Port number for SMTP is 25.
Command
MAIL FROM:<mail@abc.com?
6. LPD
It stands for Line Printer Daemon. It is designed for printer sharing. It is the part
that receives and processes the request. A "daemon" is a server or agent. The
Port number for LPD is 515.
Command
lpd [ -d ] [ -l ] [ -D DebugOutputFile]
7. X window
It defines a protocol for the writing of graphical user interface–based
client/server applications. The idea is to allow a program, called a client, to run
on one computer. It is primarily used in networks of interconnected
mainframes. Port number for X window starts from 6000 and increases by 1 for
each server.
Command
Run xdm in runlevel 5
8. SNMP
It stands for Simple Network Management Protocol. It gathers data by polling
the devices on the network from a management station at fixed or random
intervals, requiring them to disclose certain information. It is a way that servers
can share information about their current state, and also a channel through
which an administrate can modify pre-defined values. The Port number of
SNMP is 161(TCP) and 162(UDP).
Command
snmpget -mALL -v1 -cpublic snmp_agent_Ip_address sysName.0
9. DNS
It stands for Domain Name System. Every time you use a domain name,
therefore, a DNS service must translate the name into the corresponding IP
address. For example, the domain name www.abc.com might translate to
198.105.232.4.
The Port number for DNS is 53.
Command
ipconfig /flushdns
10. DHCP
It stands for Dynamic Host Configuration Protocol (DHCP). It gives IP addresses
to hosts. There is a lot of information a DHCP server can provide to a host when
the host is registering for an IP address with the DHCP server. Port number for
DHCP is 67, 68.
Command
clear ip dhcp binding {address | * }
11. HTTP/HTTPS
HTTP stands for Hypertext Transfer Protocol and HTTPS is the more secured
version of HTTP, that's why HTTPS stands for Hypertext Transfer Protocol
Secure. This protocol is used to access data from the World Wide Web. The
Hypertext is the well-organized documentation system that is used to link
pages in the text document.
 HTTP is based on the client-server model.
 It uses TCP for establishing connections.
 HTTP is a stateless protocol, which means the server doesn't maintain
any information about the previous request from the client.
 HTTP uses port number 80 for establishing the connection.
12. POP
POP stands for Post Office Protocol and the latest version is known as POP3
(Post Office Protocol version 3). This is a simple protocol used by User agents
for message retrieval from mail servers.
 POP protocol work with Port number 110.
 It uses TCP for establishing connections.
POP works in dual mode- Delete mode, Keep Mode.
In Delete mode, it deletes the message from the mail server once they are
downloaded to the local system.
In Keep mode, it doesn't delete the message from the mail server and also
facilitates the users to access the mails later from the mail server.
13. IRC
IRC stands for Internet Relay Chat. It is a text-based instant messaging/chatting
system. IRC is used for group or one-to-one communication. It also supports
file, media, data sharing within the chat. It works upon the client-server model.
Where users connect to IRC server or IRC network via some web/ standalone
application program.
 It uses TCP or TLS for connection establishment.
 It makes use of port number 6667.
14. MIME
MIME stands for Multipurpose Internet Mail Extension. This protocol is
designed to extend the capabilities of the existing Internet email protocol like
SMTP. MIME allows non-ASCII data to be sent via SMTP. It allows users to
send/receive various kinds of files over the Internet like audio, video, programs,
etc. MIME is not a standalone protocol it works in collaboration with other
protocols to extend their capabilities.

You might also like