CN Unit3
CN Unit3
Ans)
• Definition: Packets are received, stored, and verified by routers before being forwarded
to the next hop.
• Advantages: Allows error checking and packet buffering; useful for congestion handling.
• Disadvantages: Introduces delays (latency) and may cause queuing in case of congestion.
• Packet Routing: Network layer decides the path for data to travel.
• Addressing: Provides logical addresses (e.g., IP addresses) for devices.
• Error Handling: Detects basic errors (e.g., unreachable host).
• Congestion Control: Assists in managing traffic to avoid overload.
• Fragmentation: Breaks large packets into smaller ones for efficient transmission.
Ans)
• Dijkstra’s Shortest Path Algorithm which was developed by Dutch computer scientist Edsger W.
Dijkstra in 1956.
• Dijkstra’s algorithm is a popular algorithms for solving many single-source shortest path
problems having non-negative edge weight in the graphs i.e., it is to find the shortest distance
between two vertices on a graph.
• Finds shortest paths from given source nodes to all other nodes.
• The aim is to find the optimal paths between the network nodes so that routing cost is
minimized.
Example:
mathematica
Copy code
A --5--> B
| |
1 2
| |
v v
C --1--> D --4--> E
Source node: A
Edges:
A → B = 5, A → C = 1
B → C = 2, B → D = 3
C→D=1
D→E=4
• Initialization:
➢ Set distances: A = 0, B = ∞, C = ∞, D = ∞, E = ∞
➢ Unvisited nodes: A, B, C, D, E
• Visit A (nearest unvisited node with distance 0):
➢ Update distances:
➢ A→B=0+5=5→B=5
➢ A→C=0+1=1→C=1
➢ Distances: A = 0, B = 5, C = 1, D = ∞, E = ∞
➢ Mark A as visited.
• Visit C (nearest unvisited node with distance 1):
➢ Update distances:
➢ C → B = 1 + 2 = 3 → B = 3 (updated from 5)
➢ C→D=1+1=2→D=2
➢ Distances: A = 0, B = 3, C = 1, D = 2, E = ∞
➢ Mark C as visited.
• Visit D (nearest unvisited node with distance 2):
➢ Update distances:
➢ D→E=2+4=6→E=6
➢ Distances: A = 0, B = 3, C = 1, D = 2, E = 6
➢ Mark D as visited.
• Visit B (nearest unvisited node with distance 3):
➢ No updates needed since the current distances to neighbors (C, D) are already
minimal.
➢ Distances: A = 0, B = 3, C = 1, D = 2, E = 6
➢ Mark B as visited.
• Visit E (nearest unvisited node with distance 6):
➢ No updates needed, as there are no neighbors left to explore.
➢ Distances: A = 0, B = 3, C = 1, D = 2, E = 6
➢ Mark E as visited.
A → A: 0
A → B: 3
A → C: 1
A → D: 2
A → E: 6
Ans)
• The "count to infinity" problem in Distance Vector routing occurs when routers incrementally
increase the distance to a destination after a link failure, slowly propagating this change across
the network. This leads to routers endlessly updating their routing tables, creating delays in
network convergence.
• How Exchanging Complete Path Information Solves the Problem:
• Path Information Instead of Distance: Instead of just sending the distance to a destination,
routers send the next hop or full path to reach a destination. This helps routers know the exact
route to take.
• Faster Loop Detection: When routers share the full path, they can detect routing loops early. If a
loop is detected (e.g., a router sees itself in the path), it can immediately adjust its routing table,
avoiding endless distance increments.
• No Incremental Counting: Exchanging full path information allows routers to quickly adapt to
changes, bypassing the slow "counting to infinity" process, speeding up convergence.
Key Benefits:
Ans)
• Network provisioning
o Sometimes resources can be added dynamically when there is serious congestion.
o More often, links and routers that are regularly heavily utilized are upgraded at the
earliest opportunity happens on a time scale of months, driven by long-term traffic
trends.
• Traffic-aware routing
o To make the most of the existing network capacity, routes can be tailored to traffic
patterns that change during the day as network users wake and sleep in different time
zones.
o Splitting traffic across multiple paths is also helpful
• Admission control
o Sometimes it is not possible to increase capacity.
o New connections can be refused if they would cause the network to become congested.
• Traffic throttling
o Routers can monitor the average load, queueing delay, or packet loss. In all cases, rising
numbers indicate growing congestion.
• Load shedding
o When all else fails, the network is forced to discard packets that it cannot deliver.
o A good policy for choosing which packets to discard can help to prevent congestion
collapse
Ans)
Congestion Control in TCP is a mechanism to manage the amount of data sent into the network,
preventing congestion and packet loss. It dynamically adjusts the sender's transmission rate based on
network conditions. The key components are:
1. Slow Start:
The congestion window starts small (1 or 2 MSS) and grows exponentially with each acknowledgment
received, doubling the window size each round-trip time (RTT).
This continues until the congestion window reaches a threshold called ssthresh.
2. Congestion Avoidance:
After reaching ssthresh, TCP switches to Congestion Avoidance, where the window grows linearly (by 1
MSS per RTT) to avoid overwhelming the network.
3. Fast Retransmit:
If packet loss is detected (usually via 3 duplicate ACKs), TCP retransmits the lost packet immediately
without waiting for a timeout.
4. Fast Recovery:
After retransmitting, TCP reduces the congestion window by half and enters Fast Recovery, continuing
transmission with a reduced window, avoiding a full restart.
5. Timeout Recovery:
If a timeout occurs (e.g., no ACK received), TCP reduces the congestion window drastically (to 1 MSS) and
re-enters Slow Start.
• Additive Increase: In Congestion Avoidance, the congestion window increases slowly (additively)
to probe available bandwidth.
• Multiplicative Decrease: On detecting congestion (via packet loss or timeouts), the congestion
window is halved, reducing the transmission rate to alleviate congestion.
• This dynamic adjustment of the congestion window allows TCP to prevent network overload and
ensure fair and efficient use of the network.
Ans)
IPv4 Header: Short Explanation
The IPv4 header carries essential information for routing and delivering packets across the internet.
Here's a brief overview of its key fields:
Each field helps routers and hosts handle packet delivery, fragmentation, and integrity across the
network.
4d)packet fragmentation
Ans)
➢ Every packet based network has an MTU (Maximum Transmission Unit) size. The MTU is the size
of the largest packet that network can transmit.
• Fragmentation: when the size of datagram is greater than maximum size of data that can
be held in a frame i.e., its Maximum Transmission Unit. The network layer divides the
datagram received from the transport layer into fragments so that data flow is not
disrupted.
• Packets larger than the allowable MTU must be divided into smaller packets or
fragments to enable them to traverse the network.
➢ These limits have various causes, among them :
1. .Hardware (e.g., the size of an Ethernet frame).
2. .Operating system (e.g., all buffers are 512 bytes).
3. .Protocols (e.g., the number of bits in the packet length field).
4. .Compliance with some (inter)national standard.
5. .Desire to reduce error-induced retransmissions to some level.
6. .Desire to prevent one packet from occupying the channel too long.
➢ IP fragmentation is an Internet Protocol (IP) process that breaks packets into smaller pieces
(fragments), so that the resulting pieces can pass through a link with a smaller maximum
transmission unit (MTU) than the original packet size. The fragments are reassembled by the
receiving host.
5c)Define Routing. Explain Distance Vector Routing Algorithm with an example.
Ans)
➢ 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.
➢ The routing algorithm is that part of the network layer software responsible for deciding which
output line an incoming packet should be transmitted on.
➢ A distance-vector protocol calculates the distance and direction of the vector of the next hop
from the information obtained by the neighboring router.
➢ Distance vector routing protocol also called as Bellman-Ford algorithm or Ford Fulkerson
algorithm used to calculate a path.
➢ Historically known as the old ARPANET routing algorithm {or known as Bellman Ford (BF)
algorithm}.
➢ Key points of distance vector routing protocol:
• Network Information: Every node in the network have information about its
neighboring node. Each node in the network is designed to share information
with all the nodes in the network.
• Routing Pattern: In DVR the data shared by the nodes are transmitted only to
that node that is linked directly to one or more nodes in the network.
• Data sharing: The nodes share the information with the neighboring node from
time to time as there is a change in network topology.
➢ Consider the following simple network:
Copy code
A --1--> B
| |
3 2
| |
v v
C --1--> D
Step 1: Initialization
A updates its table for C: [A=0, B=1, C=3, D=∞] (no change).
B updates its table for C: [A=1, B=0, C=3, D=2] (via D).
C updates its table for A: [A=4, B=∞, C=0, D=1] (via B).
Step 4: Repeat
The routers continue exchanging and updating their tables until all distances converge to the shortest
paths.
Ans)
➢ Quality of service (QoS) is the use of mechanisms or technologies that work on a network to
control traffic and ensure the performance of critical applications with limited network capacity.
➢ It enables organizations to adjust their overall network traffic by prioritizing specific high
performance applications.
➢ Quality of service (QoS) is a set of technologies that work on a network to guarantee its ability to
dependably run high-priority applications and traffic under limited network capacity. QoS
technologies accomplish this by providing differentiated handling and capacity allocation to
specific flows in network traffic. This enables the network administrator to assign the order in
which packets are handled and the amount of bandwidth afforded to that application or traffic
flow.
➢ A stream of packets from a source to a destination is called a flow.
• A flow might be all the packets of a connection in a connection-oriented
network, or all
• the packets sent from one process to another process in a connectionless
network.
• The needs of each flow can be characterized by four primary parameters:
• Reliability, delay, jitter and Bandwidth.
• Together, these determine the QoS (Quality of Service) the flow requires.
➢ Flow Characteristics
•Jitter: Jitter is the variation in delay for packets belonging to the same flow.
➢ Quality of Service (QoS) is an internetworking issue that has been discussed more
than defined.