Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
20 views4 pages

CN Assignment03

Computer network assignment

Uploaded by

alikhan125466ak
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views4 pages

CN Assignment03

Computer network assignment

Uploaded by

alikhan125466ak
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Assignment 03

Computer Networks

SUBMITTED BY:
Hassan Ali Khan

ROLL NO:
BSCS-RC-328

BATCH#
BSCS-36(MORNING)
NUML-F21-34404

SUBMITTED TO:
Sir Jawwad Ibrahim

Dated: 14/05/24
Assignment 03
Question:
Describe the concept of Routing in Network. Explain the working of RIP and OSPF routing
protocol with examples?

Answer:
Concept of Routing in Network:
Routing is the process of selecting paths in a network along which to send network traffic. In a
typical network, routers determine the optimal path from a source to a destination. This is crucial
for ensuring efficient and reliable data delivery across complex and interconnected networks.
Routing involves the following key aspects:
1. Path Selection: Determining the best route for data packets based on metrics such as hop count,
bandwidth, delay, and more.
2. Routing Tables: Maintaining and updating tables that store route information, which helps
routers make forwarding decisions.
3. Packet Forwarding: Moving packets from the input interface to the output interface based on
routing table entries.
4. Protocol Use: Implementing various routing protocols to discover and share information about
available routes.

RIP (Routing Information Protocol):


Overview:
RIP is one of the oldest distance-vector routing protocols used in IP networks. It uses hop count as
the metric to determine the best path to a destination. The maximum number of hops allowed in RIP
is 15, making it suitable for smaller networks.

Working:
1. Route Advertisement: Routers using RIP broadcast their routing table to neighboring routers
every 30 seconds.
2. Hop Count: Each router increments the hop count for each route entry received from its
neighbors. If the hop count exceeds 15, the route is considered unreachable.
3. Routing Table Updates: Routers update their routing tables based on the advertisements
received, preferring routes with the lowest hop count.
4. Timers:
 Update Timer: Controls the interval between routing updates (30 seconds).
 Invalid Timer: Time after which a route is declared invalid if no updates are received (180
seconds).
 Flush Timer: Time after which an invalid route is removed from the routing table (240
seconds).
Example
Consider three routers (R1, R2, R3) in a network:
 R1 advertises its routing table to R2 and R3.
 R2 receives the advertisement and updates its routing table with routes learned from R1,
incrementing the hop count by 1.
 R3 does the same and also advertises its routes back to R1 and R2.
If the network topology changes (e.g., a link goes down), RIP routers will detect the change and
update their routing tables accordingly, propagating the updates to all routers in the network.

OSPF (Open Shortest Path First):


Overview:
OSPF is a link-state routing protocol designed for larger and more complex networks. It uses the
Shortest Path First (SPF) algorithm to calculate the shortest path based on link cost, which can
represent bandwidth, delay, or other factors.

Working:
1. Link-State Advertisements (LSAs): Routers exchange information about their directly
connected links using LSAs.
2. Link-State Database (LSDB): Each router maintains an identical database describing the
network topology.
3. SPF Algorithm: OSPF uses Dijkstra's algorithm to compute the shortest path tree for each router
based on the LSDB.
4. Areas: OSPF networks can be divided into hierarchical areas to optimize routing efficiency and
reduce overhead. The backbone area (Area 0) connects all other areas.
5. Hello Protocol: Routers send Hello packets to establish and maintain neighbor relationships. If a
neighbor fails to respond within a certain time, the route is considered down.
6. Designated Router (DR) and Backup Designated Router (BDR): In multi-access networks
(like Ethernet), OSPF elects a DR and a BDR to reduce the number of adjacencies and LSAs
exchanged.
Example:
Consider a network with four routers (R1, R2, R3, R4) connected as follows:
 R1 is connected to R2 and R3.
 R2 is connected to R4.
 R3 is connected to R4.

1. LSA Exchange: Each router sends LSAs to its neighbors.
 R1 sends LSAs to R2 and R3.
 R2 sends LSAs to R1 and R4.
 R3 sends LSAs to R1 and R4.
 R4 sends LSAs to R2 and R3.
2. LSDB Update: Each router builds its LSDB with the received LSAs.
3. SPF Calculation: Each router runs the SPF algorithm to calculate the shortest path to every
destination.
 R1 calculates the shortest paths to R2, R3, and R4.
 R2 calculates the shortest paths to R1, R3, and R4, and so on.
4. Routing Table: Each router updates its routing table with the shortest paths computed by the
SPF algorithm.
If a link between R1 and R3 goes down, OSPF quickly detects the change and recomputes the
shortest paths using the remaining topology, updating all routing tables accordingly.

Comparison of RIP and OSPF

 Metric: RIP uses hop count, while OSPF uses link cost.
 Convergence: OSPF converges faster than RIP due to its link-state nature and SPF algorithm.
 Scalability: OSPF is suitable for larger and more complex networks, whereas RIP is limited to
smaller networks due to its hop count limitation.
 Network Overhead: OSPF has higher initial overhead due to the exchange of LSAs and the
maintenance of the LSDB, but it is more efficient in the long run. RIP has lower overhead
but slower convergence and scalability issues.
 Topology Changes: OSPF adapts more efficiently to network topology changes, providing
faster updates and more reliable routing.
In summary, while RIP is simpler and easier to implement, OSPF offers better performance,
scalability, and reliability, making it more suitable for larger networks.

References:
 https://www.geeksforgeeks.org/routing-information-protocol-rip/
 https://www.geeksforgeeks.org/open-shortest-path-first-ospf-set-2/
 https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/iproute_rip/configuration/15-mt/irr-15-mt-
book/irr-cfg-info-prot.html

You might also like