Overview of Routing Protocols in Networks
Overview of Routing Protocols in Networks
Routing Protocols
Routing protocols are the set of rules and algorithms that routers use to communicate with each
other to find the most efficient path to transmit data packets from a sender to a receiver. There
are many routing protocols in computer networks, which we are going to discuss in this article,
but to understand routing protocols properly, let us first understand routing.
The term "routing" comes from the word "route", which means the path used to transport data
packets in computer networks. Routing is a procedure of moving data packets from one network
to another by discovering the finest path from the source to the destination. The device that helps
in finding the best path to forward data packets from the source of one network to the destination
of another network is called a router.
There are three kinds of routing protocols in computer networks, which are given as:
It can also be called non-adaptive routing. It is a manual configuration technique in which the
network administrator selects the best path to transfer the data packet from source to destination.
When a network administrator configures each router in the routing table by hand, it is called
static routing. After that, the router forwards the data packets to the destination along the path
defined by the network administrator.
It provides security because only the administrator has control over routing. It is ideal for small
organizations as it requires less bandwidth; hence, the cost is low.
The default routing protocol can also be called the default route. When a router faces a situation
where it does not know the destination network of a data packet, then it uses a method
called "default routing". It is an approach in which the router transfers all data packets to the
single-hop device, regardless of the network.
The default route is the predetermined path the router uses to send all data packets when
encountering such a situation. When the destination network is unknown to the router, then the
router uses the default route and sends all data packets to that route.
It can also be called adaptive routing. It is an approach in which a router automatically finds the
best path to transmit data packets from the sender to the receiver and puts the selected path
information into the routing table of each router.
The router selects the path based on situations of the communication circuit or the network
topology. If there is any loss of connection between the nodes or there is a problem with the
route decided, the packed data is automatically adjusted on the new route to be forwarded
towards the destination. It is ideal for larger organizations where many routers are used.
The routing protocols that are used within the same network or autonomous system
(AS) facilitate the swapping of routing details between routers. The main function of IGP is to
search for the best route for forwarding data packets from sender to receiver within an
autonomous system.
The routing protocols are used in various autonomous systems that facilitate the swapping of
routing details between routers. The main function of EGP is to search for the best route for
forwarding data packets from sender to receiver between various autonomous systems.
They are further categorized into link-state routing protocols, distance-vector routing
protocols, and hybrid routing protocols.
Link-state routing protocols are a type of interior gateway protocol which are used in computer
networks to decide the most suitable path to send data packets from one point to another over the
network. These protocols have a very good knowledge of the network topology to forward the
data packets to their destination efficiently. These protocols track the status and connection type
of each link; based on these factors, they produce calculated metrics with the help of which
routing is done.
There are several link-state routing protocols, which are discussed below:
It uses Internet Protocol (IP) type 89 for communication. It supports Classless Inter-Domain
Routing (CIDR) and Variable Length Subnet Mask (VLSM). It is developed to work with
both IPv4 and IPv6 networks. It can divide a larger internetwork into smaller internetwork called
areas.
The OSPF router keeps the information of network topology, such as routers, links, and
networks within the same autonomous system. This information is stored in the form of Link-
State Advertisements (LSAs) in a database called the Link-State Database (LSDB). Each
router has a distinctive Router ID (RID) identifying an individual router. Each router contains
information about every other router connected to the network, due to which the size of the link
state database increases.
In OSPF, a large autonomous system is divided into OSPF areas, which reduces the size of the
LSDB.
Each area has its network, hosts, routers, and other devices. Each area is assigned an
identification number called area identification. Each area only stores information about the
devices within its area and doesn't need detailed knowledge about the network topology.
The OSPF network must have a backbone area, also referred to as Area 0, to which all other
areas are connected. This connection allows routers in different areas to communicate indirectly.
In OSPF, there are Area Border Routers (ABRs) that connect OSPF areas within an
autonomous system and Autonomous System Border Routers (ASBRs) that connect OSPF
domains to external networks. The Open Shortest Path First uses cost metrics to determine the
most cost-effective route to get to the destination
It uses a two-level hierarchy: Level 1 routing and Level 2 routing. In Level 1 routing, routers
exchange routing information within the same area. In Level 2 routing, a router provides
connectivity between different areas. The routers that only directly communicate with the routers
of the same area are called Level 1 routers. The routers which are communicating with routers in
another area are called Level 2 routers. L2 routers are also responsible for routing traffic between
different autonomous systems. IS-IS can be used to route any network layer protocol. This
flexibility makes it suitable for diverse networks.
2. Distance-vector routing protocols
Distance-vector routing protocols are interior gateway protocols that are used in computer
networks to choose the most profitable path to transmit data packets from one point to another
within autonomous systems (ASes).
In distance-vector routing protocols, distance is the measurement of the path between the two
networks, and vector is the direction in which the data packets should be forwarded so that they
reach the destination by covering the distance. In routers, the vector indicates the interfaces.
Distance-vector routing protocols calculate paths using distance and vectors to reach the data
packets to the destination network. This protocol periodically sends information about routers to
their neighbors whenever there is a change in the network topology.
There are several distance-vector routing protocols, which are discussed below:
This protocol routinely sends information about routers to their neighbors whenever there is a
modification in the network topology. It is a unicast routing protocol that is used to establish
one-to-one communication in which there will be one sender and one receiver. It supports
classful routing.
The metric used by RIP is hop count. From one router to another, one hop is counted. RIP
calculates the distance by counting the number of hops between the sender and receiver. The
distance with the minimum number of hop counts is considered the best route for forwarding
data packets. If all routes between the source and destination have the same hop count, then RIP
will send messages on all routes to balance the load on the network. It is important to know that
the maximum number of hop counts allowed in RIP is 15 hops, which is why the maximum
number of routers in the network can be 16 routers. The distance greater than 15 hops is
considered unreachable.
To update the routers with the information about the routes present in the network, RIP sends
messages. There are two types of RIP messages: request message (it is sent by new routers
entering the network to obtain information about their neighboring routers) and response
message, which are classified into two types: solicited message (it is sent in response to request
message) and unsolicited message (it is sent at regular interval of 30 seconds to update
neighboring routers regarding the routes and the networks).
There are 2 versions of the routing information protocol: RIP Version 1 (RIPv1) and RIP
Version 2 (RIPv2).
RIPv1 is the oldest version of RIP, which is a classful protocol, so it does not support VLSM. It
uses the hop count metric to find the finest path between source and destination. It provides
routing updates periodically to neighboring routers.
RIPv2 is a modern version of RIP, which is a classless routing protocol and supports VLSM. It
uses the hop count metric, but it can hold more information in routing updates. It enhances
security by supporting authentication.
The maximum limit of hop count in IGRP is 100, and it sends updates to the router periodically,
every 90 seconds. It provides more security to data packets traveling from sender to receiver.
It is a Cisco proprietary protocol that is an improved version of the Interior Gateway Routing
Protocol. It is the successor to IGRP developed by Cisco to overcome the shortcomings of IGRP.
It is also known as a hybrid routing protocol as it has features of both link-state routing protocols
and distance-vector routing protocols.
The metrics it uses are bandwidth, load, delay, and reliability. It uses a Diffusing Update
Algorithm (DUAL) algorithm to ensure loop-free routing. It supports both Classless Inter-
Domain Routing (CIDR) and Variable Length Subnet Mask (VLSM). It is used for efficient use
of bandwidth and fast convergence.
The most widely used EGP is the Border Gateway Protocol (BGP).
Border Gateway Protocol (BGP):
It is a dynamic routing protocol that is used to figure out the best path to transfer data packets
from one network to another. It is an exterior gateway protocol that allows routers to exchange
information between different autonomous systems. It uses a path-vector routing
protocol, which maintains route details that get updated dynamically.
BGP enables efficient routing to determine the best route to the destination network that
provides the most reliable and faster communication. It is highly scalable as it can seamlessly
manage the growing number of interconnected devices and networks. It supports multi-home
connectivity, which means the organization can connect to multiple internet service providers
simultaneously and automatically select the best path.
BGP provides organizations with control over Internet traffic, which helps avoid congested
routes. BGP enhances internet resilience by quickly adapting to network changes. If routes
become congested with traffic, BGP can redirect the traffic to an alternate path that ensures
uninterrupted communication. It provides global connectivity, which means that BGP allows
networks from different locations to interconnect and exchange routing information, which
facilitates seamless data transfer across borders.
Flooding
What is Flooding?
flooding is a communication method where data packets are sent to all connected devices, even
if they are not the intended recipients of the data. Although this approach is frequently used in
specific network protocols and circumstances, it can be extremely inefficient and is rarely
employed in contemporary computer networks for routine data transmission.
o Sending Data: When a network device wants to send data to another device but is unsure
of the recipient's precise location or address, it creates a data packet containing the
desired information.
o Broadcasting: The sending device sends the data packet to every device on the network
rather than attempting to pinpoint its precise destination. The way to do this is to give the
packet's destination address a special value that denotes "broadcast" or "all devices."
o Data Reception: The broadcasted data packet is received by all devices connected to the
network, including the one that sent it in the first place.
o Packet inspection: To ascertain whether it is the intended recipient of the data, each
device looks at the header of the packet. It verifies the packet's header's destination
address.
o Filtering: A device will accept a packet and process its contents if the destination address
in the packet matches the address of that device. The device throws away the packet if the
addresses do not match.
o Data packet propagation: After repeating steps 3, 4, and 5, the data packet keeps
travelling through the network until it eventually connects to the device with the correct
destination address.
o Loop Prevention: Flooding frequently uses mechanisms like Time To Live (TTL)
counters to prevent packets from circling endlessly in the network. The TTL value in the
packet's header is decreased each time a device forwards the packet. The packet is no
longer forwarded and is discarded when the TTL reaches zero. This aids in preventing
network infinite loops.
In computer networks, flooding is a very simple and occasionally ineffective method of
communication because it can create a lot of extra network traffic. In some routing protocols,
like Link-State Routing, or when broadcasting messages to every device on a local network
segment, like ARP requests in Ethernet networks to translate IP addresses to MAC addresses, it
is used, but only in certain circumstances.
Modern computer networks typically prefer more effective communication techniques like
unicast (sending to a single recipient), multicast (sending to multiple specified recipients), or
broadcast (sending to all devices on a subnet).
In computer networks, flooding is used in specific circumstances where its characteristics are
advantageous. Here are some reasons why we use flooding in computer networks:
1. Address Resolution
Devices frequently use Address Resolution Protocol (ARP) in local area networks (LANs) to
translate IP addresses to actual MAC addresses. A device uses ARP to send a broadcast message,
which is a type of flooding when it needs to find the MAC address connected to a specific IP
address on the same subnet. Devices can now dynamically update their ARP caches, thanks to
this.
2. Routing Protocols
Link-state routing (such as OSPF), one of the routing protocols, uses flooding as part of its
operation. In Link-State Routing, routers communicate about the topology of the network by
saturating it with Link-State Advertisement (LSA) packets. This aids in the router's development
of a consistent topology view of the network.
3. Announcement and Network Discovery
Flooding can be used for network announcement and discovery. For instance, broadcasting is
used by the Dynamic Host Configuration Protocol (DHCP) to find DHCP servers in the network.
For similar services like printer discovery, network devices may broadcast announcements.
To create a multicast distribution tree, some multicast routing algorithms flood the network with
the initial multicast group membership information. Multicast traffic can be effectively
forwarded to group members once the tree has been established.
5. Emergency Broadcasts
Flooding can be used to make sure that important messages reach all networked devices,
regardless of their location or address, in emergencies like disaster recovery scenarios or network
alarms.
Flooding is useful in these particular situations, but it should be noted that in present-day
computer networks, it is not typically the preferred method for routine data communication.
This is due to the possibility of security risks, increased network congestion, and inefficient use
of network resources caused by flooding. In order to maximize network performance and cut
down on pointless data transmission, unicast, multicast, and broadcast are preferred for regular
network traffic in practice.
A communication method known as flooding in computer networks has the following essential
characteristics:
o Network Congestion: Because flooding sends data packets to every device connected to
the network, it creates a large amount of network traffic. All devices may experience
increased latency, network congestion, and poor network performance as a result.
o Bandwidth Wastage: Flooding uses up network bandwidth because it sends data packets
to every device, especially when there are lots of devices present. Costly in terms of
bandwidth usage and energy use, this inefficiency can be both.
o Security Risks: Flooding can reveal private information to recipients who weren't
intended. Unauthorized devices have the potential to intercept and possibly abuse data
packets that weren't meant for them.
o Resource Consumption: Even if they are not the intended recipients, devices connected
to the network must process incoming data packets. This use of processing and memory
resources may impact these devices' overall performance.
o Lack of Scalability: As a network's size increases, flooding becomes more and more
impractical. Larger networks may have an unmanageable number of devices that each
flooded packet is received by, which exacerbates resource usage and network congestion.
o Inefficient for Unicast: Flooding wastefully sends data to every device on the network,
even when only one device is the intended recipient, making it inefficient for unicast
communication (sending data to a single recipient).
o Limited Control: Data transmission can be only partially controlled by flooding. There
is no way to ensure the level of service, give particular types of traffic higher priority, or
manage the route that data takes through the network.
o Broadcast Storms: In some situations, like Ethernet networks, excessive broadcasting
can result in broadcast storms, in which the network is overloaded with broadcast traffic
and becomes unstable or fails altogether.
o No Guarantee of Delivery: Flooding makes an effort to reach all devices, but it cannot
guarantee that the data will be successfully delivered to all of them. For a variety of
reasons, devices might be off, disconnected, or unreachable.
o Complexity in Large Networks: Managing the effects of flooding, such as handling
loops, can be difficult in large and complex networks and may require additional network
protocols.
Shortest Path Algorithm
In between sending and receiving data packets from the sender to the receiver, it will go through
many routers and subnets. So as a part of increasing the efficiency in routing the data packets and
decreasing the traffic, we must find the shortest path. In this article, we are discussing the
shortest path algorithms.
What is Shortest Path Routing?
It refers to the algorithms that help to find the shortest path between a sender and receiver for
routing the data packets through the network in terms of shortest distance, minimum cost, and
minimum time.
It is mainly for building a graph or subnet containing routers as nodes and edges as
communication lines connecting the nodes.
Hop count is one of the parameters that is used to measure the distance.
Hop count: It is the number that indicates how many routers are covered. If the hop count is
6, there are 6 routers/nodes and the edges connecting them.
Another metric is a geographic distance like kilometers.
We can find the label on the arc as the function of bandwidth, average traffic, distance,
communication cost, measured delay, mean queue length, etc.
Common Shortest Path Algorithms
Dijkstra’s Algorithm
Bellman Ford’s Algorithm
Floyd Warshall’s Algorithm
Dijkstra’s Algorithm
The Dijkstra’s Algorithm is a greedy algorithm that is used to find the minimum distance
between a node and all other nodes in a given graph. Here we can consider node as a router and
graph as a network. It uses weight of edge .ie, distance between the nodes to find a minimum
distance route.
Algorithm:
1: Mark the source node current distance as 0 and all others as infinity.
2: Set the node with the smallest current distance among the non-visited nodes as the current
node.
3: For each neighbor, N, of the current node:
Calculate the potential new distance by adding the current distance of the current node with
the weight of the edge connecting the current node to N.
If the potential new distance is smaller than the current distance of node N, update N's
current distance with the new distance.
4: Make the current node as visited node.
5: If we find any unvisited node, go to step 2 to find the next node which has the smallest current
distance and continue this process.
Example:
Consider the graph G:
Grap
hG
Now,we will start normalising graph one by one starting from node 0.
step 1
step 3
Similarly we will normalize other node considering it should not form a cycle and will keep track
in visited nodes.
step 5
Step 1:
Step 2:
Step 3:
Step 4:
Step 5:
Outcome: The graph contains a negative cycle in the path from node D to node F and then to
node E.
Gra
ph G
Step 1:
Step 2:
Step 3:
Step 4:
Step 5:
Step 6:
Step 7:
Distance Vector Routing Algorithm
o Knowledge about the whole network: Each router shares its knowledge through the
entire network. The Router sends its collected knowledge about the network to its
neighbors.
o Routing only to neighbors: The router sends its knowledge about the network to only
those routers which have direct links. The router sends whatever it has about the network
through the ports. The information is received by the router and uses the information to
update its own routing table.
o Information sharing at regular intervals: Within 30 seconds, the router sends the
information to the neighboring routers.
Let dx(y) be the cost of the least-cost path from node x to node y. The least costs are related by
Bellman-Ford equation,
Where the minv is the equation taken for all x neighbors. After traveling from x to v, if we
consider the least-cost path from v to y, the path cost will be c(x,v)+d v(y). The least cost from x
to y is the minimum of c(x,v)+dv(y) taken over all neighbors.
With the Distance Vector Routing algorithm, the node x contains the following routing
information:
o For each neighbor v, the cost c(x,v) is the path cost from x to directly attached neighbor,
v.
o The distance vector x, i.e., Dx = [ Dx(y) : y in N ], containing its cost to all destinations, y,
in N.
o The distance vector of each of its neighbors, i.e., D v = [ Dv(y) : y in N ] for each neighbor
v of x.
Distance vector routing is an asynchronous algorithm in which node x sends the copy of its
distance vector to all its neighbors. When node x receives the new distance vector from one of its
neighboring vector, v, it saves the distance vector of v and uses the Bellman-Ford equation to
update its own distance vector. The equation is given below:
The node x has updated its own distance vector table by using the above equation and sends its
updated table to all its neighbors so that they can update their own distance vectors.
Algorithm
At each node x,
Initialization
Note: In Distance vector algorithm, node x update its table when it either see any cost change in
one directly linked nodes or receives any vector update from some neighbor.
Let's understand through an example:
Sharing Information
o In the above figure, each cloud represents the network, and the number inside the cloud
represents the network ID.
o All the LANs are connected by routers, and they are represented in boxes labeled as A, B,
C, D, E, F.
o Distance vector routing algorithm simplifies the routing process by assuming the cost of
every link is one unit. Therefore, the efficiency of transmission can be measured by the
number of links to reach the destination.
o In Distance vector routing, the cost is based on hop count.
In the above figure, we observe that the router sends the knowledge to the immediate neighbors.
The neighbors add this knowledge to their own knowledge and sends the updated table to their
own neighbors. In this way, routers get its own information plus the new information about the
neighbors.
Routing Table
Initially, the routing table is created for each router that contains atleast three types of
information such as Network ID, the cost and the next hop.
o NET ID: The Network ID defines the final destination of the packet.
o Cost: The cost is the number of hops that packet must take to get there.
o Next hop: It is the router to which the packet must be delivered.
o In the above figure, the original routing tables are shown of all the routers. In a routing
table, the first column represents the network ID, the second column represents the cost
of the link, and the third column is empty.
o These routing tables are sent to all the neighbors.
For Example:
o When A receives a routing table from B, then it uses its information to update the table.
o The routing table of B shows how the packets can move to the networks 1 and 4.
o The B is a neighbor to the A router, the packets from A to B can reach in one hop. So, 1
is added to all the costs given in the B's table and the sum will be the cost to reach a
particular network.
o After adjustment, A then combines this table with its own table to create a combined
table.
o The combined table may contain some duplicate data. In the above figure, the combined
table of router A contains the duplicate data, so it keeps only those data which has the
lowest cost. For example, A can send the data to network 1 in two ways. The first, which
uses no next router, so it costs one hop. The second requires two hops (A to B, then B to
Network 1). The first option has the lowest cost, therefore it is kept and the second one is
dropped.
o The process of creating the routing table continues for all routers. Every router receives
the information from the neighbors, and update the routing table.
Final routing tables of all the routers are given below:
Link State Routing
Link state routing is a technique in which each router shares the knowledge of its neighborhood
with every other router in the internetwork.
o Knowledge about the neighborhood: Instead of sending its routing table, a router sends
the information about its neighborhood only. A router broadcast its identities and cost of
the directly attached links to other routers.
o Flooding: Each router sends the information to every other router on the internetwork
except its neighbors. This process is known as Flooding. Every router that receives the
packet sends the copies to all its neighbors. Finally, each and every router receives a copy
of the same information.
o Information sharing: A router sends the information to every other router only when the
change occurs in the information.
Link State Routing has two phases:
Reliable Flooding
Route Calculation
Each node uses Dijkstra's algorithm on the graph to calculate the optimal routes to all nodes.
o The Link state routing algorithm is also known as Dijkstra's algorithm which is used to
find the shortest path from one node to every other node in the network.
o The Dijkstra's algorithm is an iterative, and it has the property that after k th iteration of the
algorithm, the least cost paths are well known for k destination nodes.
o c( i , j): Link cost from node i to node j. If i and j nodes are not directly linked, then c(i ,
j) = ∞.
o D(v): It defines the cost of the path from source code to destination v that has the least
cost currently.
o P(v): It defines the previous node (neighbor of v) along with current least cost path from
source to v.
o N: It is the total number of nodes available in the network.
Algorithm
Initialization
N = {A} // A is a root node.
for all nodes v
if v adjacent to A
then D(v) = c(A,v)
else D(v) = infinity
loop
find w not in N such that D(w) is a minimum.
Add w to N
Update D(v) for all v adjacent to w and not in N:
D(v) = min(D(v) , D(w) + c(w,v))
Until all nodes in N
In the above algorithm, an initialization step is followed by the loop. The number of times the
loop is executed is equal to the total number of nodes available in the network.
Let's understand through an example:
Step 1:
The first step is an initialization step. The currently known least cost path from A to its directly
attached neighbors, B, C, D are 2,5,1 respectively. The cost from A to B is set to 2, from A to D
is set to 1 and from A to C is set to 5. The cost from A to E and F are set to infinity as they are
not directly linked to A.
In the above table, we observe that vertex D contains the least cost path in step 1. Therefore, it is
added in N. Now, we need to determine a least-cost path through D vertex.
1. v = B, w = D
2. D(B) = min( D(B) , D(D) + c(D,B) )
3. = min( 2, 1+2)>
4. = min( 2, 3)
5. The minimum value is 2. Therefore, the currently shortest path from A to B is 2.
b) Calculating shortest path from A to C
1. v = C, w = D
2. D(B) = min( D(C) , D(D) + c(D,C) )
3. = min( 5, 1+3)
4. = min( 5, 4)
5. The minimum value is 4. Therefore, the currently shortest path from A to C is 4.</p>
c) Calculating shortest path from A to E
1. v = E, w = D
2. D(B) = min( D(E) , D(D) + c(D,E) )
3. = min( ∞, 1+1)
4. = min(∞, 2)
5. The minimum value is 2. Therefore, the currently shortest path from A to E is 2.
Note: The vertex D has no direct link to vertex E. Therefore, the value of D(F) is infinity.
Step 3:
In the above table, we observe that both E and B have the least cost path in step 2. Let's consider
the E vertex. Now, we determine the least cost path of remaining vertices through E.
1. v = B, w = E
2. D(B) = min( D(B) , D(E) + c(E,B) )
3. = min( 2 , 2+ ∞ )
4. = min( 2, ∞)
5. The minimum value is 2. Therefore, the currently shortest path from A to B is 2.
b) Calculating the shortest path from A to C.
1. v = C, w = E
2. D(B) = min( D(C) , D(E) + c(E,C) )
3. = min( 4 , 2+1 )
4. = min( 4,3)
5. The minimum value is 3. Therefore, the currently shortest path from A to C is 3.
c) Calculating the shortest path from A to F.
1. v = F, w = E
2. D(B) = min( D(F) , D(E) + c(E,F) )
3. = min( ∞ , 2+2 )
4. = min(∞ ,4)
5. The minimum value is 4. Therefore, the currently shortest path from A to F is 4.
Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F)
Step 4:
In the above table, we observe that B vertex has the least cost path in step 3. Therefore, it is
added in N. Now, we determine the least cost path of remaining vertices through B.
1. v = C, w = B
2. D(B) = min( D(C) , D(B) + c(B,C) )
3. = min( 3 , 2+3 )
4. = min( 3,5)
5. The minimum value is 3. Therefore, the currently shortest path from A to C is 3.
b) Calculating the shortest path from A to F.
1. v = F, w = B
2. D(B) = min( D(F) , D(B) + c(B,F) )
3. = min( 4, ∞)
4. = min(4, ∞)
5. The minimum value is 4. Therefore, the currently shortest path from A to F is 4.
Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F)
Step 5:
In the above table, we observe that C vertex has the least cost path in step 4. Therefore, it is
added in N. Now, we determine the least cost path of remaining vertices through C.
1. v = F, w = C
2. D(B) = min( D(F) , D(C) + c(C,F) )
3. = min( 4, 3+5)
4. = min(4,8)
5. The minimum value is 4. Therefore, the currently shortest path from A to F is 4.
Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F)
5 ADEBC 4,E
5 ADEBC 4,E
6 ADEBCF
Final table:
Disadvantage:
Heavy traffic is created in Line state routing due to Flooding. Flooding can cause an infinite
looping, this problem can be solved by using Time-to-leave field
What is Flooding?
In a computer network, flooding is a communication method where data packets are sent to all connected devices,
even if they are not the intended recipients of the data. Although this approach is frequently used in specific
network protocols and circumstances, it can be extremely inefficient and is rarely employed in contemporary
computer networks for routine data transmission.
A straightforward and easy-to-use network communication method called flooding involves broadcasting data
packets to every device connected to the network. Let's see how it works:
o Sending Data: When a network device wants to send data to another device but is unsure of the recipient's
precise location or address, it creates a data packet containing the desired information.
o Broadcasting: The sending device sends the data packet to every device on the network rather than
attempting to pinpoint its precise destination. The way to do this is to give the packet's destination address a
special value that denotes "broadcast" or "all devices."
o Data Reception: The broadcasted data packet is received by all devices connected to the network,
including the one that sent it in the first place.
o Packet inspection: To ascertain whether it is the intended recipient of the data, each device looks at the
header of the packet. It verifies the packet's header's destination address.
o Filtering: A device will accept a packet and process its contents if the destination address in the packet
matches the address of that device. The device throws away the packet if the addresses do not match.
o Data packet propagation: After repeating steps 3, 4, and 5, the data packet keeps travelling through the
network until it eventually connects to the device with the correct destination address.
o Loop Prevention: Flooding frequently uses mechanisms like Time To Live (TTL) counters to prevent
packets from circling endlessly in the network. The TTL value in the packet's header is decreased each time
a device forwards the packet. The packet is no longer forwarded and is discarded when the TTL reaches
zero. This aids in preventing network infinite loops.
In computer networks, flooding is a very simple and occasionally ineffective method of communication because it
can create a lot of extra network traffic. In some routing protocols, like Link-State Routing, or when broadcasting
messages to every device on a local network segment, like ARP requests in Ethernet networks to translate IP
addresses to MAC addresses, it is used, but only in certain circumstances.
Modern computer networks typically prefer more effective communication techniques like unicast (sending to a
single recipient), multicast (sending to multiple specified recipients), or broadcast (sending to all devices on a
subnet).
In computer networks, flooding is used in specific circumstances where its characteristics are advantageous. Here
are some reasons why we use flooding in computer networks:
1. Address Resolution
Devices frequently use Address Resolution Protocol (ARP) in local area networks (LANs) to translate IP addresses
to actual MAC addresses. A device uses ARP to send a broadcast message, which is a type of flooding when it
needs to find the MAC address connected to a specific IP address on the same subnet. Devices can now
dynamically update their ARP caches, thanks to this.
2. Routing Protocols
Link-state routing (such as OSPF), one of the routing protocols, uses flooding as part of its operation. In Link-State
Routing, routers communicate about the topology of the network by saturating it with Link-State Advertisement
(LSA) packets. This aids in the router's development of a consistent topology view of the network.
Advertisement
Flooding can be used for network announcement and discovery. For instance, broadcasting is used by the Dynamic
Host Configuration Protocol (DHCP) to find DHCP servers in the network. For similar services like printer
discovery, network devices may broadcast announcements.
To create a multicast distribution tree, some multicast routing algorithms flood the network with the initial
multicast group membership information. Multicast traffic can be effectively forwarded to group members once
the tree has been established.
5. Emergency Broadcasts
Flooding can be used to make sure that important messages reach all networked devices, regardless of their
location or address, in emergencies like disaster recovery scenarios or network alarms.
Flooding is useful in these particular situations, but it should be noted that in present-day computer networks, it is
not typically the preferred method for routine data communication.
This is due to the possibility of security risks, increased network congestion, and inefficient use of network
resources caused by flooding. In order to maximize network performance and cut down on pointless data
transmission, unicast, multicast, and broadcast are preferred for regular network traffic in practice.
A communication method known as flooding in computer networks has the following essential characteristics:
o Broadcasting: Flooding involves broadcasting data packets to every device connected to the network as
opposed to sending them to predetermined, known destinations. This makes sure that the data gets to all of
the network's devices.
o No Prior Knowledge: Prior knowledge of the network topology or the precise addresses of devices is
optional for flooding. When the sender is unaware of the recipient's location, they use this method.
o Simple and Robust: Flooding is a straightforward and reliable method for network communication. It is
simple to implement because it doesn't rely on intricate routing algorithms or network configuration.
o Unicast vs. Broadcast: In computer networks, flooding is a type of communication that can be used in
unicast situations (sending data to a single person). It is now possible because we need to know the
destination.
o Potential for Inefficiency: Flooding has a number of negative aspects, one of which is the potential for
inefficiency. It can generate a lot of unnecessary network traffic because it sends data to all devices, which
causes network congestion and increases resource usage.
o Loop Prevention: Flooding frequently uses mechanisms like Time To Live (TTL) counters to stop data
packets from recirculating indefinitely within the network. As packets are forwarded, the TTL is reduced,
and when it reaches zero, the packet is discarded.
o Used in Specific Situations: Flooding is mostly employed in specific circumstances, such as ARP requests
for address resolution in Ethernet networks, Link-State Routing operations, and network discovery or
announcement protocols.
o Security considerations: Flooding exposes private information to recipients who weren't intended. In
order to prevent unauthorized access to data, flooding is restricted and controlled in secure network
environments.
o Utilization of Resources: Networked devices are required to process and possibly discard flooding packets
that are not intended for them. On devices, this might use up memory and processing resources.
o Network Congestion: Because flooding sends data packets to every device connected to the network, it
creates a large amount of network traffic. All devices may experience increased latency, network
congestion, and poor network performance as a result.
o Bandwidth Wastage: Flooding uses up network bandwidth because it sends data packets to every device,
especially when there are lots of devices present. Costly in terms of bandwidth usage and energy use, this
inefficiency can be both.
o Security Risks: Flooding can reveal private information to recipients who weren't intended. Unauthorized
devices have the potential to intercept and possibly abuse data packets that weren't meant for them.
o Resource Consumption: Even if they are not the intended recipients, devices connected to the network
must process incoming data packets. This use of processing and memory resources may impact these
devices' overall performance.
o Lack of Scalability: As a network's size increases, flooding becomes more and more impractical. Larger
networks may have an unmanageable number of devices that each flooded packet is received by, which
exacerbates resource usage and network congestion.
o Inefficient for Unicast: Flooding wastefully sends data to every device on the network, even when only
one device is the intended recipient, making it inefficient for unicast communication (sending data to a
single recipient).
o Limited Control: Data transmission can be only partially controlled by flooding. There is no way to ensure
the level of service, give particular types of traffic higher priority, or manage the route that data takes
through the network.
o Broadcast Storms: In some situations, like Ethernet networks, excessive broadcasting can result in
broadcast storms, in which the network is overloaded with broadcast traffic and becomes unstable or fails
altogether.
o No Guarantee of Delivery: Flooding makes an effort to reach all devices, but it cannot guarantee that the
data will be successfully delivered to all of them. For a variety of reasons, devices might be off,
disconnected, or unreachable.
o Complexity in Large Networks: Managing the effects of flooding, such as handling loops, can be difficult
in large and complex networks and may require additional network protocols.
Due to these drawbacks, flooding is typically only employed in specific circumstances where it is impractical to
use another form of communication or in routing protocols intended for network discovery and maintenance.
Hierarchical Routing
Hierarchical routing protocols consist of a hierarchical topology to organize the network and
routing information. Multiple layers and levels are introduced in a network. Each layer may be
assigned a different responsibility like forwarding packets, maintaining routing tables, etc. HRPs
are valuable for large networks, as they provide the capability of organizing network information
and reducing the amount of routing information that should be exchanged between nodes. Hence,
HRPs demonstrate significant scalability and fault tolerance. This is attributed to their
hierarchical structure, which provides redundancy and facilitates the efficient distribution of
routing data throughout the network.
Differences Between Hierarchical and Flat Routing Protocol
Hierarchical Routing
Basis Protocol Flat Routing Protocol
If one has to choose between the two, the choice might depend on the nature of the network that
requires routing and its needs and characteristics. For further information, visit this article.
Advantages of HRP
Scalability: Hierarchical routing protocols exhibit excellent scalability by partitioning the
network into smaller segments or areas. This division reduces the demand for routing tables
and updates on each router, enhancing network efficiency and decreasing overall network
traffic.
Better Traffic Control: Hierarchical routing protocols demonstrate superior traffic
management compared to flat routing protocols. The hierarchical framework enables more
efficient traffic control, mitigating the need for unnecessary routing updates and preventing
loops in the network.
Easy to Manage: The organisational framework in these protocols facilitates simplified
management and maintenance. Segmentation of the network into manageable sections
enhances the ease of troubleshooting and diagnosing issues.
Disadvantages of HRP
Complexity: Hierarchical routing protocols tend to be more intricate compared to flat routing
protocols. The presence of additional layers and segments necessitates more extensive
configuration, posing potential challenges in implementation.
Latency: Latency may be introduced into the network due to the presence of additional
layers and segments. Such delays in data transmission can pose challenges, particularly for
real-time applications.
Protocols of Hierarchical Routing
There are two well known hierarchical routing protocols:
Hierarchical State Routing Protocol
Fisheye State Routing Protocol
Hierarchical State Routing Protocol
The hierarchical state routing protocol (HSR) is a multi-level and distributed routing protocol. It
makes use of clustering, present on different levels. Each level of cluster has the potential to
manage its members efficiently. This improves resource allocation and management. Leaders are
elected in each cluster, which form the members of the immediate higher level.
Various clustering algorithms are employed for electing leaders in each level. There can be two
types of clustering: physical and logical. One level of physical clustering is done among nodes
that are available in a single wireless hop. The other level is made among nodes that act as
cluster heads of each of the first-level clusters. Logical clustering scheme of HSR is based on
relationships among nodes rather than their geographical locations.
Nodes have complete details about how to route packets to destinations within its own cluster.
But it does not have any information on the internal structure of other regions.
At the lowest level, there are three clusters. Nodes 1, 3 and 6 are classified as cluster leaders, or
gateway nodes. A cluster leader is entrusted with responsibilities such as slot/frequency/code
allocation, call admission control, scheduling of packet transmissions, exchange of routing
information, and handling route breaks. The higher level nodes are further organized into
clusters.
Working of HSRP
Each node maintains information about its neighboring node and their link status
The information regarding the cluster is broadcast in the network at regular intervals.
The job of the cluster leader is to exchange topology and link state routing information
among other cluster leaders of neighborhood clusters.
The exchange of link state information is carried out over multiple hops that consist of
gateway nodes and cluster-heads.
The path between two cluster-heads which is formed by multiple wireless links is called
virtual link.
The link status for the virtual link(otherwise called tunnel) is obtained from the link status
parameters of the wireless links that constitute the virtual link.
After obtaining information from its peers, the cluster head floods the information to the
lower levels.
Hierarchical addressing in HSR reduces routing information compared to link-state routing.
HSR’s HID and node ID structure simplifies addressing and topology management.
HSR tables update with received routing packets, maintaining accurate hierarchy
information.
Kinds of Nodes in a Cluster
Cluster Head – This node acts as a local coordinator of transmissions within the cluster.
Cluster head performs the function of allocating slot or frequency or code, call admission
control, and most importantly scheduling packet transmission.
Gateway Node – These nodes are associated with more than two clusters.
Internal Node – These are the members of the clusters at the most root level
Virtual Link – Information is exchanged between the gateway nodes and leader nodes through
this path.
Advantages
Reduction in Table Size: HSR protocol reduces the routing table size by making use of
hierarchy information. The storage space required is of O(N x M) whereas in flat topology
the space required is O(NM). Here, N is the average number of nodes in a cluster and m is
the number of levels.
Disadvantages
Overhead Involved: The overhead for exchanging packets containing information about
multiple levels of hierarchy and cluster head appointment process makes the protocol
expensive from the ad hoc wireless network point of view.
Scalability: The number of nodes involved in an ad hoc network does not grow to the
dimensions of the number of nodes in the Internet which is more suited for hierarchical
routing.
Time Consuming: Sharing information across all levels of the hierarchy and conducting
leader elections within each cluster is a time-consuming process.
Regular Hello Messages: To preserve the network’s topology, nodes must regularly send
hello messages to their neighboring nodes, which contributes to overhead.
Power Supply: The concentration of routes through cluster leaders imposes additional strain
on the power supply of these leaders.
Fisheye State Routing Protocol
Fisheye State Routing (FSR) is an implicit hierarchical routing protocol most meant for mobile
ad hoc networks. This protocol makes use of the fisheye technique to reduce information
required to represent graphical data, in order to reduce routing overhead. It is based on the
property of a fish’s eye that can capture pixel information with greater accuracy near its eye’s
focal point. As the distance from the centre of the focal point decreases, accuracy decreases.
Similarly, in FSR, accurate information about nodes in its local topology is maintained, and not-
so-accurate information about far-away nodes is recorded. Hence, we can say accuracy of
network information decreases with increasing distance.
Topology of the network is maintained at every node, but this information is not flooded in the
entire network, which is mostly what happens in link state routing protocols. Instead, a node
shares topology information only with its neighbours.
Working of FSRP
A sequence number is used to identify recent topology changes.
A hybrid approach consisting of a combination of link-level information exchange of
distance vector protocols and the complete topology information exchange of link state
protocols is used.
Using the complete topology information stored at each node, the desired shortest paths are
computed as required.
The topology information exchange takes place periodically rather than when an event
occurs, as instability of wireless links may cause excessive control overhead when event-
driven updates are used.
Routing Scope – The set of nodes that are reachable in a specific number of hops. The scope of
node at two hops is the set of nodes that can be reached in two hops. Link state information for
nodes belonging to the smallest scope is exchanged at the highest frequency. This frequency
decreases with an increase in scope.
This keeps the immediate neighbourhood topology information maintained at a node more
precise compared to the information about nodes farther away from it. Thus the message size for
a typical topology information update packet is significantly reduced due to the removal of
topology information regarding the far-away nodes.
This ensures that a node maintains more accurate topology information about its immediate
neighbourhood than the information pertaining to nodes situated at a greater distance.
Consequently, the message size for a standard topology information update packet experiences a
notable reduction due to the exclusion of information regarding distant nodes. This way Fisheye
exhibits a trade-off between the accuracy of the routing function and the overhead due to the
generation of control messages by routing protocols.
Advantages
Bandwidth Optimization: The notion of multi-level scopes employed by FSR significantly
reduces the bandwidth consumed by link state update packets. This makes FRS suitable for
large and mobile wireless networks.
Reduced Overhead: The routing overhead is significantly reduced by adopting different
frequencies of updates for nodes belonging to different scopes.
Scalability: FSR scales well because of the reduction in routing overhead, where varying
frequencies of updates are used.
Disadvantages
Number of Hops: The performance of the protocol at various mobility levels is notably
impacted by the selection of the number of hops assigned to each scope level. Therefore, this
parameter must be chosen with careful consideration.
Loop Creations: The occurrence of temporary loops is possible when nodes or links fail,
particularly when Hello messages are transmitted more frequently. In the event of a node
failure, its neighboring nodes detect the broken link well in advance of other nodes.
Subsequently, they recalculate their routing tables, a process that may clash with the routing
tables of other nodes and result in the creation of loops.
Transport Layer
The services provided by the transport layer are similar to those of the data link layer. The data
link layer provides the services within a single network while the transport layer provides the
services across an internetwork made up of many networks. The data link layer controls the
physical layer while the transport layer controls all the lower layers.
The services provided by the transport layer protocols can be divided into five categories:
o End-to-end delivery
o Addressing
o Reliable delivery
o Flow control
o Multiplexing
End-to-end delivery:
The transport layer transmits the entire message to the destination. Therefore, it ensures the end-
to-end delivery of an entire message from a source to the destination.
Reliable delivery:
The transport layer provides reliability services by retransmitting the lost and damaged packets.
o Error control
o Sequence control
o Loss control
o Duplication control
Error Control
o The primary role of reliability is Error Control. In reality, no transmission will be 100
percent error-free delivery. Therefore, transport layer protocols are designed to provide
error-free transmission.
o The data link layer also provides the error handling mechanism, but it ensures only node-
to-node error-free delivery. However, node-to-node reliability does not ensure the end-to-
end reliability.
o The data link layer checks for the error between each network. If an error is introduced
inside one of the routers, then this error will not be caught by the data link layer. It only
detects those errors that have been introduced between the beginning and end of the link.
Therefore, the transport layer performs the checking for the errors end-to-end to ensure
that the packet has arrived correctly.
Sequence Control
o The second aspect of the reliability is sequence control which is implemented at the
transport layer.
o On the sending end, the transport layer is responsible for ensuring that the packets
received from the upper layers can be used by the lower layers. On the receiving end, it
ensures that the various segments of a transmission can be correctly reassembled.
Loss Control
Loss Control is a third aspect of reliability. The transport layer ensures that all the fragments of a
transmission arrive at the destination, not some of them. On the sending end, all the fragments of
transmission are given sequence numbers by a transport layer. These sequence numbers allow
the receiver?s transport layer to identify the missing segment.
Duplication Control
Duplication Control is the fourth aspect of reliability. The transport layer guarantees that no
duplicate data arrive at the destination. Sequence numbers are used to identify the lost packets;
similarly, it allows the receiver to identify and discard duplicate segments.
Flow Control
Flow control is used to prevent the sender from overwhelming the receiver. If the receiver is
overloaded with too much data, then the receiver discards the packets and asking for the
retransmission of packets. This increases network congestion and thus, reducing the system
performance. The transport layer is responsible for flow control. It uses the sliding window
protocol that makes the data transmission more efficient as well as it controls the flow of data so
that the receiver does not become overwhelmed. Sliding window protocol is byte oriented rather
than frame oriented.
Multiplexing
Addressing
o According to the layered model, the transport layer interacts with the functions of the
session layer. Many protocols combine session, presentation, and application layer
protocols into a single layer known as the application layer. In these cases, delivery to the
session layer means the delivery to the application layer. Data generated by an
application on one machine must be transmitted to the correct application on another
machine. In this case, addressing is provided by the transport layer.
o The transport layer provides the user address which is specified as a station or port. The
port variable represents a particular TS user of a specified station known as a Transport
Service access point (TSAP). Each station has only one transport entity.
o The transport layer protocols need to know which upper-layer protocols are
communicating.
Where,
o Source port address: It defines the address of the application process that has delivered
a message. The source port address is of 16 bits address.
o Destination port address: It defines the address of the application process that will
receive the message. The destination port address is of a 16-bit address.
o Total length: It defines the total length of the user datagram in bytes. It is a 16-bit field.
o Checksum: The checksum is a 16-bit field which is used in error detection.
o UDP provides basic functions needed for the end-to-end delivery of a transmission.
o It does not provide any sequencing or reordering functions and does not specify the
damaged packet when reporting an error.
o UDP can discover that an error has occurred, but it does not specify which packet has
been lost as it does not contain an ID or sequencing number of a particular data segment.
TCP
o Stream data transfer: TCP protocol transfers the data in the form of contiguous stream
of bytes. TCP group the bytes in the form of TCP segments and then passed it to the IP
layer for transmission to the destination. TCP itself segments the data and forward to the
IP.
o Reliability: TCP assigns a sequence number to each byte transmitted and expects a
positive acknowledgement from the receiving TCP. If ACK is not received within a
timeout interval, then the data is retransmitted to the destination.
The receiving TCP uses the sequence number to reassemble the segments if they arrive
out of order or to eliminate the duplicate segments.
o Flow Control: When receiving TCP sends an acknowledgement back to the sender
indicating the number the bytes it can receive without overflowing its internal buffer. The
number of bytes is sent in ACK in the form of the highest sequence number that it can
receive without any problem. This mechanism is also referred to as a window
mechanism.
o Multiplexing: Multiplexing is a process of accepting the data from different applications
and forwarding to the different applications on different computers. At the receiving end,
the data is forwarded to the correct application. This process is known as demultiplexing.
TCP transmits the packet to the correct application by using the logical channels known
as ports.
o Logical Connections: The combination of sockets, sequence numbers, and window
sizes, is called a logical connection. Each connection is identified by the pair of sockets
used by sending and receiving processes.
o Full Duplex: TCP provides Full Duplex service, i.e., the data flow in both the directions
at the same time. To achieve Full Duplex service, each TCP should have sending and
receiving buffers so that the segments can flow in both the directions. TCP is a
connection-oriented protocol. Suppose the process A wants to send and receive the data
from process B. The following steps occur:
o Establish a connection between two TCPs.
o Data is exchanged in both the directions.
o The Connection is terminated.
Where,
o Source port address: It is used to define the address of the application program in a
source computer. It is a 16-bit field.
o Destination port address: It is used to define the address of the application program in a
destination computer. It is a 16-bit field.
o Sequence number: A stream of data is divided into two or more TCP segments. The 32-
bit sequence number field represents the position of the data in an original data stream.
o Acknowledgement number: A 32-field acknowledgement number acknowledge the data
from other communicating devices. If ACK field is set to 1, then it specifies the sequence
number that the receiver is expecting to receive.
o Header Length (HLEN): It specifies the size of the TCP header in 32-bit words. The
minimum size of the header is 5 words, and the maximum size of the header is 15 words.
Therefore, the maximum size of the TCP header is 60 bytes, and the minimum size of the
TCP header is 20 bytes.
o Reserved: It is a six-bit field which is reserved for future use.
o Control bits: Each bit of a control field functions individually and independently. A
control bit defines the use of a segment or serves as a validity check for other fields.
o URG: The URG field indicates that the data in a segment is urgent.
o ACK: When ACK field is set, then it validates the acknowledgement number.
o PSH: The PSH field is used to inform the sender that higher throughput is needed so if
possible, data must be pushed with higher throughput.
o RST: The reset bit is used to reset the TCP connection when there is any confusion
occurs in the sequence numbers.
o SYN: The SYN field is used to synchronize the sequence numbers in three types of
segments: connection request, connection confirmation ( with the ACK bit set ), and
confirmation acknowledgement.
o FIN: The FIN field is used to inform the receiving TCP module that the sender has
finished sending data. It is used in connection termination in three types of segments:
termination request, termination confirmation, and acknowledgement of termination
confirmation.
o Window Size: The window is a 16-bit field that defines the size of the window.
o Checksum: The checksum is a 16-bit field used in error detection.
o Urgent pointer: If URG flag is set to 1, then this 16-bit field is an offset from the
sequence number indicating that it is a last urgent data byte.
o Options and padding: It defines the optional fields that convey the additional
information to the receiver.
Differences b/w TCP & UDP
It is a Connection-Oriented
Connection Type It is a Connectionless protocol
protocol
The application layer in the OSI model is the closest layer to the end user which means that the
application layer and end user can interact directly with the software application. The application
layer programs are based on client and servers.
o Network Virtual terminal: An application layer allows a user to log on to a remote host.
To do so, the application creates a software emulation of a terminal at the remote host.
The user's computer talks to the software terminal, which in turn, talks to the host. The
remote host thinks that it is communicating with one of its own terminals, so it allows the
user to log on.
o File Transfer, Access, and Management (FTAM): An application allows a user to
access files in a remote computer, to retrieve files from a computer and to manage files in
a remote computer. FTAM defines a hierarchical virtual file in terms of file structure, file
attributes and the kind of operations performed on the files and their attributes.
o Addressing: To obtain communication between client and server, there is a need for
addressing. When a client made a request to the server, the request contains the server
address and its own address. The server response to the client request, the request
contains the destination address, i.e., client address. To achieve this kind of addressing,
DNS is used.
o Mail Services: An application layer provides Email forwarding and storage.
o Directory Services: An application contains a distributed database that provides access
for global information about various objects and services.
Authentication: It authenticates the sender or receiver's message or both.
Application architecture is different from the network architecture. The network architecture is
fixed and provides a set of services to applications. The application architecture, on the other
hand, is designed by the application developer and defines how the application should be
structured over the various end systems.
Application architecture is of two types:
o In Client-server architecture, clients do not directly communicate with each other. For
example, in a web application, two browsers do not directly communicate with each
other.
o A server is fixed, well-known address known as IP address because the server is always
on while the client can always contact the server by sending a packet to the sender's IP
address.
Disadvantage Of Client-server architecture:
It is a single-server based architecture which is incapable of holding all the requests from the
clients. For example, a social networking site can become overwhelmed when there is only one
server exists.
o P2P (peer-to-peer) architecture: It has no dedicated server in a data center. The peers
are the computers which are not owned by the service provider. Most of the peers reside
in the homes, offices, schools, and universities. The peers communicate with each other
without passing the information through a dedicated server, this architecture is known as
peer-to-peer architecture. The applications based on P2P architecture includes file sharing
and internet telephony.
o Self scalability: In a file sharing system, although each peer generates a workload by
requesting the files, each peer also adds a service capacity by distributing the files to the
peer.
o Cost-effective: It is cost-effective as it does not require significant server infrastructure
and server bandwidth.
o A network application consists of a pair of processes that send the messages to each other
over a network.
o In P2P file-sharing system, a file is transferred from a process in one peer to a process in
another peer. We label one of the two processes as the client and another process as the
server.
o With P2P file sharing, the peer which is downloading the file is known as a client, and
the peer which is uploading the file is known as a server. However, we have observed in
some applications such as P2P file sharing; a process can be both as a client and server.
Therefore, we can say that a process can both download and upload the files.
DNS
An application layer protocol defines how the application processes running on different
systems, pass the messages to each other.
Label Description
FTP
Objectives of FTP
Why FTP?
Although transferring files from one system to another is very simple and straightforward, but
sometimes it can cause problems. For example, two systems may have different file conventions.
Two systems may have different ways to represent text and data. Two systems may have
different directory structures. FTP protocol overcomes these problems by establishing two
connections between hosts. One connection is used for data transfer, and another connection is
used for the control connection.
Mechanism of FTP
The above figure shows the basic model of the FTP. The FTP client has three components: the
user interface, control process, and data transfer process. The server has two components: the
server control process and the server data transfer process.
o Control Connection: The control connection uses very simple rules for communication.
Through control connection, we can transfer a line of command or line of response at a
time. The control connection is made between the control processes. The control
connection remains connected during the entire interactive FTP session.
o Data Connection: The Data Connection uses very complex rules as data types may vary.
The data connection is made between data transfer processes. The data connection opens
when a command comes for transferring the files and closes when the file is transferred.
FTP Clients
o FTP client is a program that implements a file transfer protocol which allows you to
transfer files between two hosts on the internet.
o It allows a user to connect to a remote host and upload or download the files.
o It has a set of commands that we can use to connect to a host, transfer the files between
you and your host and close the connection.
o The FTP program is also available as a built-in component in a Web browser. This GUI
based FTP client makes the file transfer very easy and also does not require to remember
the FTP commands.
Advantages of FTP:
o Speed: One of the biggest advantages of FTP is speed. The FTP is one of the fastest way
to transfer the files from one computer to another computer.
o Efficient: It is more efficient as we do not need to complete all the operations to get the
entire file.
o Security: To access the FTP server, we need to login with the username and password.
Therefore, we can say that FTP is more secure.
o Back & forth movement: FTP allows us to transfer the files back and forth. Suppose
you are a manager of the company, you send some information to all the employees, and
they all send information back on the same server.
Disadvantages of FTP:
o The standard requirement of the industry is that all the FTP transmissions should be
encrypted. However, not all the FTP providers are equal and not all the providers offer
encryption. So, we will have to look out for the FTP providers that provides encryption.
o FTP serves two operations, i.e., to send and receive large files on a network. However,
the size limit of the file is 2GB that can be sent. It also doesn't allow you to run
simultaneous transfers to multiple receivers.
o Passwords and file contents are sent in clear text that allows unwanted eavesdropping.
So, it is quite possible that attackers can carry out the brute force attack by trying to guess
the FTP password.
o It is not compatible with every system.
Country Domain
The format of country domain is same as a generic domain, but it uses two-character country
abbreviations (e.g., us for the United States) in place of three character organizational
abbreviations.
Inverse Domain
The inverse domain is used for mapping an address to a name. When the server has received a
request from the client, and the server contains the files of only authorized clients. To determine
whether the client is on the authorized list or not, it sends a query to the DNS server and ask for
mapping an address to the name.
Working of DNS
SNMP
SNMP Concept
o A manager is a host that runs the SNMP client program while the agent is a router that
runs the SNMP server program.
o Management of the internet is achieved through simple interaction between a manager
and agent.
o The agent is used to keep the information in a database while the manager is used to
access the values in the database. For example, a router can store the appropriate
variables such as a number of packets received and forwarded while the manager can
compare these variables to determine whether the router is congested or not.
o Agents can also contribute to the management process. A server program on the agent
checks the environment, if something goes wrong, the agent sends a warning message to
the manager.
o A manager checks the agent by requesting the information that reflects the behavior of
the agent.
o A manager also forces the agent to perform a certain function by resetting values in the
agent database.
o An agent also contributes to the management process by warning the manager regarding
an unusual condition.
Management Components
o Management is not achieved only through the SNMP protocol but also the use of other
protocols that can cooperate with the SNMP protocol. Management is achieved through
the use of the other two protocols: SMI (Structure of management information) and
MIB(management information base).
o Management is a combination of SMI, MIB, and SNMP. All these three protocols such as
abstract syntax notation 1 (ASN.1) and basic encoding rules (BER).
SMI
MIB
o The MIB (Management information base) is a second component for the network
management.
o Each agent has its own MIB, which is a collection of all the objects that the manager can
manage. MIB is categorized into eight groups: system, interface, address translation, ip,
icmp, tcp, udp, and egp. These groups are under the mib object.
SNMP
GetNextRequest: The GetNextRequest message is sent from the manager to agent to retrieve
the value of a variable. This type of message is used to retrieve the values of the entries in a
table. If the manager does not know the indexes of the entries, then it will not be able to retrieve
the values. In such situations, GetNextRequest message is used to define an object.
GetResponse: The GetResponse message is sent from an agent to the manager in response to the
GetRequest and GetNextRequest message. This message contains the value of a variable
requested by the manager.
SetRequest: The SetRequest message is sent from a manager to the agent to set a value in a
variable.
Trap: The Trap message is sent from an agent to the manager to report an event. For example, if
the agent is rebooted, then it informs the manager as well as sends the time of rebooting.
What is HTTP ?
HTTP (Hypertext Transfer Protocol) is a fundamental protocol of the Internet, enabling the
transfer of data between a client and a server. It is the foundation of data communication for the
World Wide Web.
HTTP provides a standard between a web browser and a web server to establish communication.
It is a set of rules for transferring data from one computer to another. Data such as text, images,
and other multimedia files are shared on the World Wide Web. Whenever a web user opens their
web browser, the user indirectly uses HTTP. It is an application protocol that is used for
distributed, collaborative, hypermedia information systems.
History of HTTP
Tim Berners-Lee and his team at CERN are indeed credited with inventing the original
HTTP protocol.
HTTP version 0.9 was the initial version introduced in 1991.
HTTP version 1.0 followed in 1996 with the introduction of RFC 1945.
HTTP version 1.1 was introduced in January 1997 with RFC 2068, later refined in RFC 2616
in June 1999.
HTTP version 2.0 was specified in RFC 7540 and published on May 14, 2015.
HTTP version 3.0, also known as HTTP/3, is based on the QUIC protocol and is designed to
improve web performance. It was renamed as Hyper-Text Transfer Protocol QUIC (HTTP/3)
and developed by Google.
Methods of HTTP
GET: Used to retrieve data from a specified resource. It should have no side effects and is
commonly used for fetching web pages, images, etc.
POST: Used to submit data to be processed by a specified resource. It is suitable for form
submissions, file uploads, and creating new resources.
PUT: Used to update or create a resource on the server. It replaces the entire resource with
the data provided in the request body.
PATCH: Similar to PUT but used for partial modifications to a resource. It updates specific
fields of a resource rather than replacing the entire resource.
DELETE: Used to remove a specified resource from the server.
HEAD: Similar to GET but retrieves only the response headers, useful for checking resource
properties without transferring the full content.
OPTIONS: Used to retrieve the communication options available for a resource, including
supported methods and headers.
TRACE: Used for debugging purposes to echo the received request back to the client,
though it's rarely used due to security concerns.
CONNECT: Used to establish a tunnel to the server through an HTTP proxy, commonly
used for SSL/TLS connections.
HTTP Request/Response:
HTTP is a request-response protocol, which means that for every request sent by a client
(typically a web browser), the server responds with a corresponding response. The basic flow of
an HTTP request-response cycle is as follows:
Client sends an HTTP request: The client (usually a web browser) initiates the process by
sending an HTTP request to the server. This request includes a request method (GET, POST,
PUT, DELETE, etc.), the target URI (Uniform Resource Identifier, e.g., a URL), headers,
and an optional request body.
Server processes the request: The server receives the request and processes it based on the
requested method and resource. This may involve retrieving data from a database, executing
server-side scripts, or performing other operations.
Server sends an HTTP response: After processing the request, the server sends an HTTP
response back to the client. The response includes a status code (e.g., 200 OK, 404 Not
Found), response headers, and an optional response body containing the requested data or
content.
Client processes the response: The client receives the server's response and processes it
accordingly. For example, if the response contains an HTML page, the browser will render
and display it. If it's an image or other media file, the browser will display or handle it
appropriately.
HTTP Request Text information in key-value pairs sent with every HTTP request, conveying
Headers details such as client's browser, requested data, and more.
Concept Description
HTTP Request Contains data being submitted to the web server, such as form inputs,
Body authentication details, or other payload data.
HTTP
Provide important information like data format, language, and content type in
Response
the response, helping clients interpret the data correctly.
Headers
HTTP
Contains the requested information sent by the server, such as HTML content
Response
for webpages, JSON data, or other data based on the client's request.
Body
Features
Stateless: Each request is independent, and the server doesn't retain previous interactions'
information.
Text-Based: Messages are in plain text, making them readable and debuggable.
Client-Server Model: Follows a client-server architecture for requesting and serving
resources.
Request-Response: Operates on a request-response cycle between clients and servers.
Request Methods: Supports various methods like GET, POST, PUT, DELETE for different
actions on resources.
Advantages
Platform independence: Works on any operating system
Compatibility: Compatible with various protocols and technologies
Efficiency: Optimized for performance
Security: Supports encryption for secure data transfer
Disadvantages
Lack of security: Vulnerable to attacks like man in the middle
Performance issues: Can be slow for large data transfers
Statelessness: Requires additional mechanisms for maintaining state
What is an Email?
Email stands for Electronic Mail. It is a method to send messages from one computer to another
computer through the Internet. It is mostly used in business, education, technical communication,
and document interactions. It allows communicating with people all over the world without
bothering them. In 1971, a test email was sent Ray Tomlinson to himself containing text.
It is the information sent electronically between two or more people over a network. It involves a
sender and receiver/s.
Why use E-Mail?
An email is a communication that happens in real time and can get important data across to
people in various geographies. An email is a record of the communications that have happened
and is stored on the server of the organization. One has to be very cautious while typing out a
mail.
History of Email
The age of email services is older than ARPANET and the Internet. The early emails were only
sent to the same computer. Email services were started in 1971 by Ray Tomlinson. He first
developed a system to send mail between users on different hosts across the ARPANET, using
@ sign with the destination server, and was recognized as email.
Difference between Email and Webmail
To differentiate between email and webmail, we need to know that it’s a working platform.
Those types of mail that are sent through the browser are called webmail and those mail that are
sent through the specific application and browser are also called email. Gmail is a browser-based
email whereas Outlook for Office 365 is a non-browser email service. To send browser-based
mail, we just use the internet whereas sending non-browser emails, we need a specific
application, and non-browser-based email offered some security-related advantages.
Uses of Email
Email services are used in various sectors, and organizations, either personally, or among a large
group of people. It provides an easy way to communicate with individuals or groups by sending
and receiving documents, images, links, and other files. It also provides the flexibility of
communicating with others on their own schedule.
Large or small companies can use email services to many employees, and customers. A company
can send emails to many employees at a time. It becomes a professional way to communicate. A
newsletters service is also used to send company advertisements, promotions, and other
subscribed content to use advertisements, promotions.
Types of Email
Newsletters
It is a type of email sent by an individual or company to the subscriber. It contains an
advertisement, product promotion, updates regarding the organization, and marketing content. It
might be upcoming events, seminars, or webinars from the organization.
Onboarding emails
It is an email a user receives right after the subscription. These emails are sent to buyers to
familiarize and tell them about using a product. It also contains details about the journey in the
new organization.
Transactional
These types of emails might contain invoices for recent transactions and details about
transactions. If transactions failed then details about when the amount will be reverted. We can
say that transaction emails are confirmation of purchase.
Plain-Text Emails
These types of emails contain just simple text similar to other text message services. It does not
include images, videos, documents, graphics, or any attachments. Plain-text emails are also used
to send casual chatting like other text message services.
Working of Email
The email refers to the electronic means of communication of sending and receiving messages
over the Internet. Email is the most common form of communication nowadays. An email has
significantly evolved over the past couple of years. There are now stronger sync and messaging
features along with stronger security and spam-related features.
Components of an Email:
1. Sender: The sender creates an email in which he records the information that needs to be
transferred to the receiver.
2. Receiver: The receiver gets the information sent by the sender via email.
3. Email address: An email address is just like a house address where the communication
arrives for the sender and receiver and they communicate with each other.
4. Mailer: The mailer program contains allows the ability to read, write, manage and delete
the emails like Gmail, Outlook, etc.
5. Mail Server: The mail server is responsible for sending, receiving, managing, and
recording all the data proceeded by their respective mail programs and then processing
them to their respective users.
6. SMTP: SMTP stands for Simple mail transfer protocol . SMTP basically uses the internet
network connection to send and receive email messages over the Internet.
Protocols of Email:
Emails basically use two types of standard protocols for communication over the Internet.
They are:-
1. POP: POP stands for post office protocol for email. Similar to a post office, our approach
is just to drop the email over the service mail provider and then leave it for services to
handle the transfer of messages. We can be even disconnected from the Internet after
sending the email via POP. Also, there is no requirement of leaving a copy of the email
over the web server as it uses very little memory. POP allows using concentrate all the
emails from different email addresses to accumulate on a single mail program. Although,
there are some disadvantages of POP protocol like the communication medium is
unidirectional, i.e it will transfer information from sender to receiver but not vice versa.
2. IMAP: IMAP stands for Internet message access protocol . IMAP has some special
advantages over POP like it supports bidirectional communication over email and there is
no need to store conversations on servers as they are already well-maintained in a database.
It has some advanced features like it tells the sender that the receiver has read the email
sent by him.
Working of Email:
1. When the sender sends the email using the mail program, then it gets redirected to the
simple mail transfer protocol which checks whether the receiver’s email address is of
another domain name or it belongs to the same domain name as that of the sender (Gmail,
Outlook, etc.). Then the email gets stored on the server for later purposes transfer using
POP or IMAP protocols.
2. If the receiver has another domain name address then, the SMTP protocol communicates
with the DNS (domain name server) of the other address that the receiver uses. Then the
SMTP of the sender communicates with the SMTP of the receiver which then carries out
the communication and the email gets delivered in this way to the SMTP of the receiver.
3. If due to certain network traffic issues, both the SMTP of the sender and the receiver are
not able to communicate with each other, the email to be transferred is put in a queue of the
SMTP of the receiver and then it finally gets receiver after the issue resolves. And if due to
very bad circumstances, the message remains in a queue for a long time, then the message
is returned back to the sender as undelivered.
From Sender to Receiver:
The sender first needs the email address of the receiver to send the information to be
communicated via email. When the sender writes all the information in the email along with
the email address of the receiver and clicks on the send button, the mail program transfers the
message to the MTA (Mail Transfer Agent) which is transferred from the local computer of the
sender to the mail server via the SMTP protocol.
Then the webmail server looks out for the similar mail transfer agent of the receiver and
locates it whether it is using the same DNS (domain name server) or a different service. The
DNS looks for the mail exchanger service of the receiver. Now, the SMTP protocol transfers
the message between both mail servers through their mailing agents. Then the receiver’s MTA
finally transfers this message to the receiver’s local computer.
In case, the receiver uses POP protocol then when he receives the email, then the copy of the
email at the webserver will get deleted. And if he uses IMAP then the copy of the email gets
stored on the webserver and it can be changed at any time by the user.