Un4 cn
Un4 cn
NETWORK AS A GRAPH
The nodes of the graph, labeled A through G, may be hosts, switches, routers,
or networks.
The edges of the graph correspond to the network links.
Each edge has an associated cost.
The basic problem of routing is to find the lowest-cost path between any two
nodes, where the cost of a path equals the sum of the costs of all the edges that
make up the path.
This static approach has several problems:
For these reasons, routing is achieved by running routing protocols among the
nodes.
These protocols provide a distributed, dynamic way to solve the problem of
finding the lowest-cost path in the presence of link and node failures and
changing edge costs.
Each node knows the distance (cost) to each of its directly connected neighbors.
Initial State
Each node sends its initial table (distance vector) to neighbors and receives
their estimate.
Node A sends its table to nodes B, C, E & F and receives tables from nodes
B, C, E & F.
Each node updates its routing table by comparing with each of its neighbor's
table
For each destination, Total Cost is computed as:
Each node builds complete routing table after few exchanges amongst its
neighbors.
System stabilizes when all nodes have complete routing information, i.e.,
convergence.
Routing tables are exchanged periodically or in case of triggered update.
The final distances stored at each node is given below:
Periodic Update
Triggered Update
In this case, whenever a node notices a link failure or receives an update from
one of its neighbors that causes it to change one of the routes in its routing
table.
Whenever a node’s routing table changes, it sends an update to its neighbors,
which may lead to a change in their tables, causing them to send an update to
their neighbors.
● Routers advertise the cost of reaching networks. Cost of reaching each link is 1
hop. For example, router C advertises to A that it can reach network 2, 3 at cost
0 (directly connected), networks 5, 6 at cost 1 and network 4 at cost 2.
● Each router updates cost and next hop for each network number.
● Infinity is defined as 16, i.e., any route cannot have more than 15 hops.
Therefore RIP can be implemented on small-sized networks only.
● Advertisements are sent every 30 seconds or in case of triggered update.
⮚ Time to live
● Link-State routing protocols rely on two mechanisms:
⮚ Reliable flooding of link-state information to all other nodes
Reliable Flooding
● Each node sends its LSP out on each of its directly connected links.
● When a node receives LSP of another node, checks if it has an LSP already
for that node.
● If not, it stores and forwards the LSP on all other links except the incoming
one.
● Else if the received LSP has a bigger sequence number, then it is stored and
forwarded. Older LSP for that node is discarded.
● Otherwise discard the received LSP, since it is not latest for that node.
● Thus recent LSP of a node eventually reaches all nodes, i.e., reliable flooding.
(a) (b) (c) (d)
● Flooding of LSP in a small network is as follows:
⮚ When node X receives Y’s LSP (fig a), it floods onto its neighbors A
and C (fig b)
⮚ Nodes A and C forward it to B, but does not sends it back to X (fig c).
Route Calculation
● Each node knows the entire topology, once it has LSP from every other node.
● Forward search algorithm is used to compute routing table from the received
LSPs.
● Each node maintains two lists, namely Tentative and Confirmed with entries
of the form (Destination, Cost, NextHop).
Example :
OPEN SHORTEST PATH FIRST PROTOCOL (OSPF)
● OSPF is a non-proprietary widely used link-state routing protocol.
● OSPF Features are:
⮚ Authentication―Malicious host can collapse a network by advertising
to reach every host with cost 0. Such disasters are averted by
authenticating routing updates.
⮚ Additional hierarchy―Domain is partitioned into areas, i.e., OSPF is
more scalable.
⮚ Load balancing―Multiple routes to the same place are assigned same
cost. Thus traffic is distributed evenly.
Spanning Trees
● In path-vector routing, the path from a source to all destinations is
determined by the best spanning tree.
● The best spanning tree is not the least-cost tree.
● It is the tree determined by the source when it imposes its own policy.
● If there is more than one route to a destination, the source can choose the
route that meets its policy best.
● A source may apply several policies at the same time.
● One of the common policies uses the minimum number of nodes to be
visited. Another common policy is to avoid some nodes as the middle node in
a route.
● The spanning trees are made, gradually and asynchronously, by each node.
When a node is booted, it creates a path vector based on the information it can
obtain about its immediate neighbor.
● A node sends greeting messages to its immediate neighbors to collect these
pieces of information.
● Each node, after the creation of the initial path vector, sends it to all its
immediate neighbors.
● Each node, when it receives a path vector from a neighbor, updates its path
vector using the formula
Example:
● The Figure below shows a small internet with only five nodes.
● Each source has created its own spanning tree that meets its policy.
● The policy imposed by all sources is to use the minimum number of nodes to
reach a destination.
● The spanning tree selected by A and E is such that the communication does
not pass through D as a middle node.
● Similarly, the spanning tree selected by B is such that the communication
does not pass through C as a middle node.
Path Vectors made at booting time
● The Figure below shows all of these path vectors for the example.
● Not all of these tables are created simultaneously.
● They are created when each node is booted.
● The figure also shows how these path vectors are sent to immediate
neighbors after they have been created.
● Each AS have a border router (gateway), by which packets enter and leave
that AS. In above figure, R3 and R4 are border routers.
● One of the router in each autonomous system is designated as BGP speaker.
● BGP Speaker exchange reachability information with other BGP
speakers, known as external BGP session.
● BGP advertises complete path as enumerated list of AS (path vector) to
reach a particular network.
● Paths must be without any loop, i.e., AS list is unique.
● For example, backbone network advertises that networks 128.96 and
192.4.153 can be reached along the path <AS1, AS2, AS4>.
● If there are multiple routes to a destination, BGP speaker chooses one based
on policy.
● Speakers need not advertise any route to a destination, even if one exists.
● Advertised paths can be cancelled, if a link/node on the path goes down.
This negative advertisement is known as withdrawn route.
● Routes are not repeatedly sent. If there is no change, keep alive messages
are sent.
iBGP - interior BGP
● A Variant of BGP
● Used by routers to update routing information learnt from other speakers
to routers inside the autonomous system.
● Each router in the AS is able to determine the appropriate next hop for
all prefixes.
MULTICAST ADDRESSING
● Multicast address is associated with a group, whose members are dynamic.
● Each group has its own IP multicast address.
● IP addresses reserved for multicasting are Class D in IPv4 (Class D 224.0.0.1
to 239.255.255.255), 1111 1111 prefix in IPv6.
o
● Hosts that are members of a group receive copy of the packet sent when
destination contains group address.
Using IP multicast
● Sending host does not send multiple copies of the packet
● A host sends a single copy of the packet addressed to the group’s multicast
address
● The sending host does not need to know the individual unicast IP address of
each member
TYPES OF MULTICASTING
● Source-Specific Multicast - In source-specific multicast (one-to-many model),
receiver specifies multicast group and sender from which it is interested to
receive packets. Example: Internet radio broadcasts.
MULTICAST APPLICATIONS
● Access to Distributed Databases
● Information Dissemination
● Teleconferencing.
● Distance Learning
MULTICAST ROUTING
● To support multicast, a router must additionally have multicast forwarding
tables that indicate, based on multicast address, which links to use to
forward the multicast packet.
● Unicast forwarding tables collectively specify a set of paths.
● Multicast forwarding tables collectively specify a set of trees -Multicast
distribution trees.
● Multicast routing is the process by which multicast distribution trees are
determined.
● To support multicasting, routers additionally build multicast forwarding
tables.
● Multicast forwarding table is a tree structure, known as multicast
distribution trees.
● Internet multicast is implemented on physical networks that support
broadcasting by extending forwarding functions.
Pruning:
🞆 Sent from routers receiving multicast traffic for which they have no
active group members
🞆 “Prunes” the tree created by DVMRP
Grafting:
🞆 Used after a branch has been pruned back
🞆 Goes from router to router until a router active on the multicast group is
reached
🞆 Sent for the following cases
Shared Tree
When a router sends Join message for group G to RP, it goes through a set of
routers.
Join message is wildcarded (*), i.e., it is applicable to all senders.
Routers create an entry (*, G) in its forwarding table for the shared tree.
Interface on which the Join arrived is marked to forward packets for that
group.
Forwards Join towards rendezvous router RP.
Eventually, the message arrives at RP. Thus a shared tree with RP as root is
formed.
Example
Router R4 sends Join message for group G to rendezvous router RP.
Join message is received by router R2. It makes an entry (*, G) in its table and
forwards the message to RP.
When R5 sends Join message for group G, R2 does not forwards the Join. It
adds an outgoing interface to the forwarding table created for that group.
As routers send Join message for a group, branches are added to the tree, i.e.,
shared.
Multicast packets sent from hosts are forwarded to designated router RP.
Suppose router R1, receives a
message to group G. oR1 has
no state for group G.
o Encapsulates the multicast packet in a Register message.
o Multicast packet is tunneled along the way to RP.
RP decapsulates the packet and sends multicast packet onto the
shared tree, towards R2.
R2 forwards the multicast packet to routers R4 and R5 that have
members for group G.
Source-Specific Tree
RP can force routers to know about group G, by sending Join
message to the sending host, so that tunneling can be avoided.
Intermediary routers create sender-specific entry (S, G) in their
tables. Thus a source-specific route from R1 to RP is formed.
If there is high rate of packets sent from a sender to a group G,
then shared- tree is replaced by source-specific tree with sender
as root.
Example
Analysis of PIM
Protocol independent because, tree is based on Join messages via shortest
path.
Shared trees are more scalable than source-specific trees.
Source-specific trees enable efficient routing than shared trees.