Unicast Routing Protocols Summar
Unicast Routing Protocols Summar
UNICAST ROUTING PROTOCOLS Routing protocols used in the Internet are based on unicast
routing algorithms, but protocols involve more than just algorithms. They also define the domain of
operation, the messages exchanged, communication between routers, and interaction with
protocols across different domains. The three main Internet routing protocols discussed are
Routing Information Protocol (RIP), based on the distance-vector algorithm; Open Shortest Path
First (OSPF), based on the link-state algorithm; and Border Gateway Protocol (BGP), based on the
path-vector algorithm. These protocols handle different aspects of routing within and between
networks. Dr. Rajesh L, Associate Professor, ISE, DSATM Page 39 Computer Networks (BCS502)
Internet Structure The Internet has changed from a tree-like structure, with a single backbone, to a
multi-backbone structure run by different private corporations today. Although it is difficult to give
a general view of the Internet today, we can say that the Internet has a structure similar to what is
shown in Figure. There are several backbones run by private communication companies that
provide global connectivity. These backbones are connected by some peering points that allow
connectivity between backbones. At a lower level, there are some provider networks that use the
backbones for global connectivity but provide services to Internet customers. Finally, there are
some customer networks that use the services provided by the provider networks. Any of these
three entities (backbone, provider network, or customer network) can be called an Internet Service
Provider or ISP. They provide services, but at different levels. Hierarchical Routing The
Internet is vast, and routing cannot rely on a single protocol due to scalability and administrative
challenges: o Scalability problem: Large forwarding tables make searching slow and traffic updates
overwhelming. o Administrative issue: Each ISP is managed independently and may have unique
needs like using specific routing algorithms or hardware. Hierarchical routing divides the Internet
into Autonomous Systems (AS), where each ISP operates as an AS with control over its routing
protocol (intra-AS routing). Intra-AS Routing Protocols (Interior Gateway Protocols or IGPs):
Examples include RIP and OSPF, used within an AS. Dr. Rajesh L, Associate Professor, ISE, DSATM
Page 40 Computer Networks (BCS502) Inter-AS Routing Protocol (Exterior Gateway Protocol or
EGP): BGP is currently the only inter-AS routing protocol, connecting multiple ASs globally. Types of
Autonomous Systems: 1. Stub AS: o Connected to only one other AS. Traffic can originate or
terminate here, but it does not pass through. o Example: A customer network. 2. Multihomed AS:
o Connected to more than one AS but doesn’t allow traffic to pass through. o Example: A customer
AS using services from multiple providers but blocking transit traffic. 3. Transient AS: o Connected
to multiple ASs and allows traffic to pass through. o Example: Backbone or provider networks. Each
AS is assigned a unique Autonomous System Number (ASN) to identify it in the Internet structure.
Routing Information Protocol (RIP) The Routing Information Protocol (RIP) is one of the most widely
used intradomain routing protocols based on the distance-vector routing algorithm we described
earlier. RIP was started as part of the Xerox Network System (XNS), but it was the Berkeley
Software Distribution (BSD) version of UNIX that helped make the use of RIP widespread. RIP
Messages Two RIP processes, a client and a server, like any other processes, need to exchange
messages. RIP defines the format of the message. Part of the message, which we call entry, can be
repeated as needed in a message. Each entry carries the information related to one line in the
forwarding table of the router that sends the message. RIP has two types of messages: request
and response. A request message is sent by a router that has just come up or by a router that has
some time-out entries. A request message can ask about specific Dr. Rajesh L, Associate Professor,
ISE, DSATM Page 41 Computer Networks (BCS502) entries or all entries. A response (or update)
Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 1/7
message can be either solicited or unsolicited. A solicited response message is sent only in answer
to a request message. It contains information about the destination specified in the corresponding
request message. An unsolicited response message, on the other hand, is sent periodically, every
30 seconds or when there is a change in the forwarding table. RIP Algorithm RIP is a distance-
vector protocol. Figure illustrates an AS with six leaf subnets. The table in the figure indicates the
number of hops from the source A to each of the leaf subnets. In RIP, routing updates are
exchanged between neighbours approximately every 30 seconds using a RIP response message.
Response messages are also known as RIP advertisements. Consider the portion of an AS shown in
Figure. Figure shows the routing table for router D. suppose that 30 seconds later, router D
receives from router A the advertisement shown in next Figure. Dr. Rajesh L, Associate Professor,
ISE, DSATM Page 42 Computer Networks (BCS502) Subnet z is only four hops away from router
A. Router D, upon receiving the advertisement, merges the advertisement with the old routing
table. Router D learns that there is a path through router A to subnet z that is shorter than the
path through router B. Thus, router D updates its routing table to account for the shorter
shortest path, as shown in Figure. Figure below shows how RIP is implemented in a UNIX system,
for example, a UNIX workstation serving as a router. Dr. Rajesh L, Associate Professor, ISE, DSATM
Page 43 Computer Networks (BCS502) A process called routed executes RIP, that is, maintains
routing information and exchanges messages with routed processes running in neighbouring
routers. Because RIP is implemented as an application-layer process, it can send and receive
messages over a standard socket and use a standard transport protocol. As shown, RIP is
implemented as an application-layer protocol running over UDP. Open Shortest Path First (OSPF)
Open Shortest Path First (OSPF) is an intradomain routing protocol like RIP but is based on the link
state routing protocol. It is an open protocol, meaning the specification is publicly available. Unlike
RIP, OSPF allows each link to be assigned a weight based on factors such as throughput, round-trip
time, or reliability, though administrators can use hop count as a cost. Different Types of Service
(TOS) can have different weights for cost calculation. Metric: OSPF calculates the cost of reaching a
destination from a source by considering link weights, which can vary based on the type of service.
This is shown in Figure below, where the total cost to the destination is calculated by summing the
costs of individual links. Forwarding Tables: OSPF routers use Dijkstra’s algorithm to create
forwarding tables by building the shortest-path tree to destinations. The difference between OSPF
and RIP forwarding tables is mainly in the cost values. If OSPF uses hop count as its metric, its
forwarding tables would be identical to those of RIP. Both protocols determine the best route using
shortest-path trees. Dr. Rajesh L, Associate Professor, ISE, DSATM Page 44 Computer Networks
(BCS502) Areas: OSPF is designed for both small and large autonomous systems (AS). In large ASs,
flooding link-state packets (LSPs) across the entire network can cause congestion, so OSPF
introduces areas to localize LSP flooding. The AS is divided into smaller sections called areas, with
one backbone area (Area 0) responsible for inter-area communication. Link-State Advertisement
(LSA): OSPF routers advertise their link states to neighbors for forming a global link-state database
(LSDB). Unlike the simple graph model, OSPF distinguishes between different types of nodes and
links, requiring various types of advertisements: Router Link: Announces router existence and its
connection to other entities. Network Link: Advertises the existence of a network, but with no
associated cost. Summary Link to Network: Advertised by area border routers to summarize links
between areas. Summary Link to AS: Announced by AS boundary routers to inform other areas of
external AS links. External Link: Advertises external network routes to the AS. Dr. Rajesh L,
Associate Professor, ISE, DSATM Page 45 Computer Networks (BCS502) OSPF Implementation:
OSPF operates at the network layer and uses IP for message propagation. OSPF messages are
encapsulated in IP datagrams with a protocol field value of 89. OSPF has two versions, with version
2 being the most widely implemented. OSPF Messages: OSPF uses five message types, each with a
distinct format : Dr. Rajesh L, Associate Professor, ISE, DSATM Page 46 Computer Networks
(BCS502) Hello Message (Type 1): Used by routers to introduce themselves and announce their
known neighbors. Database Description Message (Type 2): Sent in response to Hello messages,
Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 2/7
allowing routers to acquire the full LSDB. Link-State Request (Type 3): Sent when a router requires
specific LS information. Link-State Update (Type 4): The primary message used to build the LSDB,
with versions for each type of link. Link-State Acknowledgment (Type 5): Provides reliability by
confirming receipt of link-state updates. Authentication: OSPF supports message authentication to
prevent unauthorized routers from joining the routing system. This is critical for network security
and preventing malicious interference. OSPF Algorithm: OSPF uses a modified link-state routing
algorithm. After routers form their shortest-path trees, they create corresponding routing tables.
The algorithm also handles OSPF message exchange. Performance: Update Messages: OSPF’s LSPs
are complex and can create heavy traffic in large areas, using considerable bandwidth.
Convergence of Forwarding Tables: OSPF converges relatively quickly once flooding is complete,
although Dijkstra's algorithm can take time to run. Robustness: OSPF is more robust than RIP since
routers operate independently after constructing their LSDBs. A failure in one router has less
impact on the overall network. Dr. Rajesh L, Associate Professor, ISE, DSATM Page 47 Computer
Networks (BCS502) Border Gateway Protocol Version 4 (BGP4) BGP4 is the predominant
interdomain routing protocol used across the internet. It is a path- vector protocol, which means it
provides the entire path to the destination instead of just the next hop. This path information is
useful for avoiding routing loops and ensuring stable paths between autonomous systems (AS).
Figure illustrates a network with four ASs: AS1 is a transient AS, and AS2, AS3, and AS4 are stub ASs.
Data exchanges between the stub ASs occur through AS1. External BGP (eBGP) Operation BGP
operates over Transmission Control Protocol (TCP) connections, ensuring reliable communication
between routers. The protocol defines two types of operations: external (eBGP) and internal (iBGP).
eBGP sessions are established between routers belonging to different ASs, as seen in Figure. In
these sessions, routers share routing information to other ASs by exchanging reachability
information about network prefixes. However, this only provides visibility between the border
routers, so internal routers need iBGP for full route dissemination. Dr. Rajesh L, Associate
Professor, ISE, DSATM Page 48 Computer Networks (BCS502) Internal BGP (iBGP) Operation
Within the same AS, routers establish iBGP sessions to disseminate the routes learned from eBGP
sessions. A fully connected mesh of iBGP sessions is required to prevent routing loops. Each iBGP
router must have a direct session with every other iBGP router, as depicted in Figure. Dr. Rajesh L,
Associate Professor, ISE, DSATM Page 49 Computer Networks (BCS502) This ensures that all
routers inside an AS have complete knowledge of external networks. After iBGP sessions converge,
all routers will have consistent routing information about the external networks, allowing them to
build accurate path tables, as demonstrated in Figure. Injection into Intradomain Routing BGP
injects routes learned from external sources into the intradomain routing protocol (such as RIP or
OSPF). In a stub AS like AS2, the border router typically injects a default route into the internal
network, pointing to external destinations. In contrast, in a transient AS such as AS1, more detailed
route information is injected into the intradomain routing protocol. This ensures that all routers
within the AS have the necessary information to forward packets outside their local AS. Figure
shows an example of how the forwarding tables are updated with routes from external ASs. Dr.
Rajesh L, Associate Professor, ISE, DSATM Page 50 Computer Networks (BCS502) Address
Aggregation BGP employs techniques such as address aggregation to reduce the size of routing
tables by summarizing multiple IP prefixes into a single route advertisement. This approach
minimizes the number of entries in the forwarding table, optimizing router performance. Path
Attributes Additionally, BGP uses several path attributes to influence route selection and ensure
routing stability. Important attributes include the AS-PATH, which lists all ASs a route has traversed,
and the ORIGIN, which indicates how the route was learned. These attributes help routers make
intelligent decisions about which paths to choose and avoid loops, as illustrated in Figure.
ORIGIN (type 1): A well-known mandatory attribute defining the source of routing
information. Value 1 indicates an intradomain protocol (RIP or OSPF), Value 2 indicates BGP, and
Value 3 indicates an unknown source. AS-PATH (type 2): A well-known mandatory attribute listing
the autonomous systems through which the destination can be reached. It helps prevent loops and
Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 3/7
assists in route selection. NEXT-HOP (type 3): A well-known mandatory attribute defining the next
router to forward the data packet. It injects path information into intradomain protocols such as
RIP or OSPF. MULT-EXIT-DISC (type 4): An optional intransitive attribute, used to select among
multiple exit paths to a destination. Its value is a 4-byte unsigned integer, typically defined by the
metric in intradomain protocols. The path with the lowest value is selected. LOCAL-PREF (type 5): A
well-known discretionary attribute used by administrators to prioritize routes. Routes with higher
preference values are chosen based on organizational policy. ATOMIC-AGGREGATE (type 6): A well-
known discretionary attribute with no value field, indicating that the destination prefix is not
aggregated. AGGREGATOR (type 7): An optional transitive attribute, indicating that the destination
prefix is an aggregate. The value specifies the AS number and IP address of the last router that Dr.
Rajesh L, Associate Professor, ISE, DSATM Page 51 Computer Networks (BCS502) performed the
aggregation. Route Selection in BGP BGP route selection is complex compared to intradomain
routing protocols, as it relies on attributes such as LOCAL-PREF and others. The process begins by
extracting routes that meet specific criteria in each step. If one route remains, it is selected;
otherwise, the next criteria are applied until one route is chosen. BGP Messages Dr. Rajesh L,
Associate Professor, ISE, DSATM Page 52 Computer Networks (BCS502) Open Message:
Establishes a neighborhood relationship by initiating a TCP connection. Update Message:
Announces new routes or withdraws previously advertised routes. Keepalive Message: Regularly
exchanged between BGP peers to confirm they are still active. Notification: Sent when an error is
detected or when a router wants to close the session. Format of Path Attribute Flags: o O:
Optional bit (set if the attribute is optional) o P: Partial bit (set if an optional attribute is lost in
transit) o T: Transitive bit (set if the attribute is transitive) o E: Extended bit (set if the attribute
length is two bytes) Fields: o Attribute type o Attribute value length o Attribute value (variable)
Multicast Link State (MOSPF) Path First (OSPF) protocol, which is used in unicast routing. It also uses
the source-based tree approach to multicasting. If the internet is running a unicast link-state
routing algorithm, the idea can be extended to provide a multicast link-state routing algorithm. To
extend unicasting to multicasting, each router needs to have another database, as with the case of
unicast distance-vector routing, to show which interface has an active member in a particular group.
Now a router goes through the following steps to forward a multicast packet received from source S
and to be sent to destination G (a group of recipients): 1. The router uses the Dijkstra algorithm to
create a shortest-path tree with S as the root and all destinations in the internet as the leaves. Note
that this shortest-path tree is different from the one the router normally uses for unicast
forwarding, in which the root of the tree is the router itself. In this case, the root of the tree is the
source of the packet defined in the source address of the packet. The Dr. Rajesh L, Associate
Professor, ISE, DSATM Page 53 Computer Networks (BCS502) router is capable of creating this tree
because it has the LSDB, the whole topology of the internet; the Dijkstra algorithm can be used to
create a tree with any root, no matter which router is using it. The point we need to remember is
that the shortest-path tree created this way depends on the specific source. For each source we
need to create a different tree. 2. The router finds itself in the shortest-path tree created in the first
step. In other words, the router creates a shortest-path subtree with itself as the root of the
subtree. 3. The shortest-path subtree is actually a broadcast subtree with the router as the root and
all networks as the leaves. The router now uses a strategy similar to the one we describe in the case
of DVMRP to prune the broadcast tree and to change it to a multicast tree. The IGMP protocol is
used to find the information at the leaf level. MOSPF has added a new type of link state update
packet that floods the membership to all routers. The router can use the information it receives in
this way and prune the broadcast tree to make the multicast tree. 4. The router can now forward
the received packet out of only those interfaces that correspond to the branches of the multicast
tree. We need to make certain that a copy of the multicast packet reaches all networks that have
active members of the group and that it does not reach those networks that do not. Figure shows
an example of using the steps to change a graph to a multicast tree. For simplicity, we have not
shown the network, but we added the groups to each router. The figure shows how a source based
Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 4/7
tree is made with the source as the root and changed to a multicast subtree with the root at the
current router. Dr. Rajesh L, Associate Professor, ISE, DSATM Page 54 Computer Networks (BCS502)
NOTE: Simpler Version of BGP(Not in Prescribed text book) The Border Gateway Protocol version 4
is the standard inter-AS routing protocol in today’s Internet. It is commonly referred to as BGP4 or
as BGP. It provides each AS a means to 1. Obtain subnet reachability information from neighboring
ASs. 2. Propagate the reachability information to all routers internal to the AS. 3. Determine “good”
routes to subnets based on the reachability information and on AS policy. In BGP, pairs of routers
exchange routing information over semi-permanent TCP connections. In Figure 31, there is a TCP
connection between gateway routers 3a and 1c and another TCP connection between gateway
routers 1b and 2a. There are also semi-permanent BGP TCP connections between routers within
an AS. For each TCP connection, the two routers at the end of the connection are called BGP
peers, and the TCP connection along with all the BGP messages sent over the connection is called a
BGP session. A BGP session that spans two Ass is called an external BGP (eBGP) session, and a
BGP session between routers in the same AS is called an internal BGP (iBGP) session. Suppose
there are four subnets attached to AS2: 138.16.64/24, 138.16.65/24, 138.16.66/24, and 138.16.67/24.
Then AS2 could aggregate the prefixes for these four subnets and use BGP to advertise the single
prefix to 138.16.64/22 to AS1. Path Attributes and BGP Routes When a router advertises a prefix
across a BGP session, it includes with the prefix a number of BGP attributes. A prefix along with its
attributes is called a route. Two important attributes are AS-PATH and NEXT-HOP: 1. AS-PATH. This
attribute contains the ASs through which the advertisement for the prefix has passed. When a
prefix is passed into an AS, the AS adds its ASN to the ASPATH attribute. For example in Figure 31,
suppose the prefix 138.16.64/24 is first advertised from AS2 to AS1and then to AS3, AS-PATH would
be AS2 AS1. Routers use the AS-PATH attribute to detect and prevent looping advertisements. Dr.
Rajesh L, Associate Professor, ISE, DSATM Page 55 Computer Networks (BCS502) 2. Providing the
critical link between inter-AS and intra-AS routing protocols. The NEXT-HOP is the router interface
that begins the AS-PATH. In Figure 31, suppose the gateway router 3a in AS3 advertises a route to
gateway router 1c in AS1 using eBGP. The route includes the advertised prefix, say x, and an AS-
PATH to the prefix. This advertisement also includes the NEXT-HOP, which is the IP address of the
router 3a interface that leads to 1c. BGP Route Selection If there are two or more routes to the
same prefix, then BGP invokes the following elimination rules until one route remains: Routes are
assigned a local preference value as one of their attributes. The policy decision is left to the AS’s
network administrator. The routes with the highest local preference values are selected. From the
remaining routes, the route with the shortest AS-PATH is selected. If this is the only rule for route
selection, then BGP would use a DV algorithm for path determination, where the distance metric
uses the number of AS hops. From the remaining routes, the route with the closest NEXT-HOP
router is selected. It determined by the intra-AS algorithm by hot potato routing process. If more
than one route still remains, the router uses BGP identifiers to select the route. Routing Policy
Figure shows six interconnected autonomous systems: A, B, C, W, X, and Y. Assume that
autonomous systems W, X, and Yare stub networks and that A, B, and C are backbone provider
networks. Also assume that A, B, and C, all peer with each other, and provide full BGP information
to their customer networks. All traffic entering a stub network must be destined for that network,
and all traffic leaving a stub network must have originated in that network. W and Y are clearly stub
networks. X is a multi-homed stub network, since it is connected to the rest of the network via two
different providers. X is prevented from forwarding traffic between B and C by controlling the
manner in which BGP routes are advertised. That is, even though X may know of a path, say XCY,
that reaches network Y, it will not advertise this path to B. Since B is unaware that X has a path to
Y, B would never forward traffic destined to Y (or C) via X. o This simple example shows how a
selective route advertisement policy can be used to implement customer/provider routing
relationships. explain all in simple words with example
Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 5/7
The text provided elaborates on unicast routing protocols with a focus on Routing Information
Protocol (RIP), Open Shortest Path First (OSPF), and Border Gateway Protocol (BGP). Here's a
concise summary:
Unicast routing protocols are integral to internet routing, covering algorithm implementation, domain
operations, and inter-router communication. Major protocols include:
Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 6/7
1. Stub AS:
Connected to one AS; no transit traffic.
Example: Small customer networks.
2. Multihomed AS:
Connected to multiple ASes; blocks transit traffic.
Example: Customers with multiple providers for redundancy.
3. Transient AS:
Connected to multiple ASes; allows transit traffic.
Example: Backbone or major ISPs.
Key Comparisons
This summary integrates the critical details of the original text and can serve as a foundational reference
for further study or analysis of these protocols. Let me know if you'd like further details or elaboration
on specific sections!
Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 7/7