DCN UNIT - III (1)
DCN UNIT - III (1)
DCN UNIT - III (1)
Network Layer
Switching – Circuit Switched Networks - Packet Switching –
Structure of a Switch - Routing algorithms: Shortest Path events -
Distance Vector Routing - Link State Routing - Congestion control
algorithms: Traffic aware routing - Admission Control -
Internetworking: Tunneling - Internetwork Routing - Packet
Fragmentation.
Switching
Advantages
Node takes routing decisions to Node does not take any routing
forward the packets. decision.
In packet switching data is divided into There is a dedicated path for each packet in
packets, and packets is sent independently. circuit switching.
The delay between data units in packet The delay between data units in circuit
switching is not uniform. switching is uniform.
In Packet Switching there is no physical path In-Circuit Switching there is a physical path
between the source and the destination. between the source and the destination.
Call setup is not required in packet switching. Call setup is required in circuit switching.
Packet switching requires complex protocols Circuit switching requires simple protocols for
for delivery. delivery.
Littel bit more overheating in packet switching. Overheading is low in circuit switching.
Routing Algorithm
• In order to transfer the packets from source to the destination, the network
layer must determine the best route through which packets can be
transmitted.
• Whether the network layer provides datagram service or virtual circuit
service, the main job of the network layer is to provide the best route. The
routing protocol provides this job.
• The routing protocol is a routing algorithm that provides the best path
from the source to the destination.
• The best path is the path that has the "least-cost path" from source to the
destination.
• Routing is the process of forwarding the packets from source to the
destination but the best route to send the packets is determined by the
routing algorithm.
Types of Routing Algorithms
Adaptive Algorithms
• 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.
• 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.
• Information sharing at regular intervals: Within 30 seconds, the router
sends the information to the neighboring routers.
Algorithm
At each node x,
Initialization
•NET ID: The Network ID defines the final destination of the packet.
•Cost: The cost is the number of hops that packet must take to get there.
•Next hop: It is the router to which the packet must be delivered.
1.A sends its routing table to B, F &
E.
2.B sends its routing table to A & C.
Route Calculation
Each node uses Dijkstra's algorithm on the graph to calculate the optimal
routes to all nodes.
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.
The Dijkstra's algorithm is an iterative, and it has the property that after kth
iteration of the algorithm, the least cost paths are well known for k
destination nodes.
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
c( i , j): Link cost from node i to node j. If i and j nodes are not directly
linked, then c(i , j) = ∞.
D(v): It defines the cost of the path from source code to destination v
that has the least cost currently.
P(v): It defines the previous node (neighbor of v) along with current
least cost path from source to v.
N: It is the total number of nodes available in the network.
Shortest Path Algorithm in Computer Network
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
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
Example
Bellman Ford’s Algorithm
The Bell man Ford’s algorithm is a single source graph search algorithm
which help us to find the shortest path between a source vertex and any
other vertex in a give graph. We can use it in both weighted and unweighted
graphs. This algorithm is slower than Dijkstra's algorithm and it can also use
negative edge weight.
Algorithm
1: First we Initialize all vertices v in a distance array dist[] as INFINITY.
2: Then we pick a random vertex as vertex 0 and assign dist[0] =0.
3: Then iteratively update the minimum distance to each node (dist[v]) by
comparing it with the sum of the distance from the source node (dist[u]) and
the edge weight (weight) N-1 times.
4: To identify the presence of negative edge cycles, with the help of following
cases do one more round of edge relaxation.
We can say that a negative cycle exists if for any edge uv the sum of
distance from the source node (dist[u]) and the edge weight (weight) is less
than the current distance to the largest node(dist[v])
Floyd Warshall’s Algorithm
The Floyd Warshall’s Algorithm is used to find the shortest path between any two nodes in a given
graph. It keeps a matrix of distances between each pair of vertices.it will continue iterating the
matrix until it reaches at a shortest path.
Algorithm:
1: Using the data about the graph, make a matrix.
2: By taking all vertices as an intermediate vertex, we have to update the final matrix.
3: It is to be noted that it includes at a time we pick one vertex, and we update the shortest path
which includes this chosen vertex as an in-between point along the path.
4: When we select a vertex say k almost like the middle of the path, in previous calculations we
have already taken all vertices P{0,1,2..,k-1} as potential middle points.
5: We have to consider the following subpoints while dealing with the source and destination
vertices I,j respectively
If vertex k is not the part of shortest path from I to j, we don’t have to change dist[i][j] value .ie, it
will remain unchanged.
If vertex k is indeed part of shortest path from I to j, update dist[i][j] to the sum of dist[i][k] and
dist[k][j] but note that only if dist[i][j] is greater than this value we newly calculated.
What is Congestion?
Improved Network Stability: Congestion control helps keep the network stable by
preventing it from getting overloaded. It manages the flow of data so the network
doesn’t crash or fail due to too much traffic.
Reduced Latency and Packet Loss: Without congestion control, data transmission can
slow down, causing delays and data loss. Congestion control helps manage traffic
better, reducing these delays and ensuring fewer data packets are lost, making data
transfer faster and the network more responsive.
Enhanced Throughput: By avoiding congestion, the network can use its resources more
effectively. This means more data can be sent in a shorter time, which is important for
handling large amounts of data and supporting high-speed applications.
Fairness in Resource Allocation: Congestion control ensures that network resources are
shared fairly among users. No single user or application can take up all the bandwidth,
allowing everyone to have a fair share.
Mitigation of Network Congestion Collapse: Without congestion
control, a sudden spike in data traffic can overwhelm the
network, causing severe congestion and making it almost
unusable. Congestion control helps prevent this by managing
traffic efficiently and avoiding such critical breakdowns.
Better User Experience: When data flows smoothly and
quickly, users have a better experience. Websites, online
services, and applications work more reliably and without
annoying delays.
Congestion Control is a mechanism that controls the entry of
data packets into the network, enabling a better use of a
shared network infrastructure and avoiding congestive
collapse.
Congestive-avoidance algorithms (CAA) are implemented at
the TCP layer as the mechanism to avoid congestive collapse
in a network.
There are two congestion control algorithms which are as
follows:
Leaky Bucket Algorithm
Token Bucket Algorithm
Leaky Bucket Algorithm
The leaky bucket algorithm discovers its use in the context of
network traffic shaping or rate-limiting.
A leaky bucket execution and a token bucket execution are
predominantly used for traffic shaping algorithms.
This algorithm is used to control the rate at which traffic is
sent to the network and shape the burst traffic to a steady
traffic stream.
The disadvantages compared with the leaky-bucket algorithm
are the inefficient use of available network resources.
The large area of network resources such as bandwidth is not
being used effectively.
Similarly, each network interface contains a leaky bucket and the following steps
are involved in leaky bucket algorithm:
When host wants to send packet, packet is thrown into the bucket.
The bucket leaks at a constant rate, meaning the network interface transmits
packets at a constant rate.
Step 2 − Suppose most of the traffic in between East and West is using link CF,
and as a result CF link is heavily loaded with long delays. Including queueing
delay in the weight which is used for shortest path calculation will make EI
more attractive.
Step 3 − After installing the new routing tables, most of East-West traffic will
now go over the EI link. As a result in the next update CF link will appear to be
the shortest path.
Step 4 − As a result the routing tables may oscillate widely, leading to erratic
routing and many potential problems.
It is a congestion technique.
These roots can be changed in accordance with traffic patterns
because, as network users, we can sleep in various time zones
throughout the day.
As there are heavily used paths so roots can be changed to
shift traffic away.
Traffic can be split across multiple paths.
Admission Control
It is one of techniques that is widely used in virtual-circuit networks to
keep congestion at bay. The idea is do not set up a new virtual circuit
unless the network can carry the added traffic without becoming
congested.
Extranet
Intranet
Internet
Extranet
It’s a network of the internetwork that’s restricted in scope to
one organization or entity however that additionally has
restricted connections to the networks of one or a lot of
different sometimes, however not essential.
It’s the very lowest level of Internetworking, usually enforced
in an exceedingly personal area.
Associate degree extranet may additionally be classified as a
Man, WAN, or different form of network however it cannot
encompass one local area network i.e. it should have a
minimum of one reference to associate degree external
network.
Intranet
This associate degree computer network could be a set of
interconnected networks, which exploits the Internet Protocol
and uses IP-based tools akin to web browsers and FTP tools,
that are underneath the management of one body entity.
That body entity closes the computer network to the
remainder of the planet and permits solely specific users.
Most typically, this network is the internal network of a
corporation or different enterprise.
An outsized computer network can usually have its own
internet server to supply users with browsable data.
Internet
A selected Internetworking, consisting of a worldwide
interconnection of governmental, academic, public, and
personal networks based mostly upon the Advanced analysis
comes Agency Network (ARPANET) developed by ARPA of the
U.S. Department of Defense additionally home to the World
Wide Web (WWW) and cited as the ‘Internet’ to differentiate
from all different generic Internetworks.
Participants within the web, or their service suppliers, use IP
Addresses obtained from address registries that manage
assignments.
Internetwork Addressing
The internetwork addresses set up devices singly or
collectively. Depending on the protocol family and because of
the OSI layer, addressing strategies vary.
DLL, MAC addresses, and network-layer addresses are
the three types of internetwork address area units that are
typically employed.
DLL Addresses
All the physical network associations of network devices are
clearly identified by a data-link layer address.
Area units are frequently used as physical addresses or
hardware addresses in data-link addresses.
Data-link addresses can occasionally be found within a flat
address space and are pre-configured with a fixed relationship
to a particular device.
End systems typically only have one data-link address since
they only have one physical network association.
As a result of having many physical network connections,
routers and other internetworking equipment frequently have
various data-link addresses.
MAC (Media Access Control)
Addresses
Data-link layer addresses are included in MAC addresses.
MAC addresses create network entities in LANs that use the
data-link layer’s IEEE(Institute of Electrical and Electronics
Engineers) MAC addresses.
For each local area network interface, a unique MAC address
designates a particular area unit.
MAC addresses are expressed as twelve hexadecimal numbers
and are forty-eight bits long.
The Organisational Unique Identifier (OUI) is made up of the
first 12 hexadecimal digits, which are typically managed by
the IEEE and identify the maker or seller.
Network Layer Addresses
The network addresses can occasionally be seen in both
gradable address areas and the more common virtual or
logical address area units.
The relationship between the network address and the tool is
logical and flexible; it typically depends either on the
properties of the physical network or on groupings without any
physical foundation.
For each network-layer protocol that a finished system
supports, a network-layer address is required.
For each supported network-layer protocol, routers and other
internetworking devices require a single network-layer address
for every physical network association.
Challenges to Internetworking
There is no guarantee that useful internetwork will be
implemented.
There are many difficult fields, especially in the ones of
dependability, connection, adaptability, and network
management.
However, each and every one of these fields is crucial to the
creation of an efficient and cost-effective internetwork.
Fragmentation
Fragmentation is an important function of network layer.
It is technique in which gateways break up or divide larger packets
into smaller ones called fragments.
Each fragment is then sent as a separate internal packet.
Each fragment has its separate header and trailer.
We can use multiple exit gateways and can improve the network
performance.
It has a higher throughput.