UNIT-IV CN
UNIT-IV CN
UNIT-IV ROUTING
Routing and protocols:
Unicast routing
Distance Vector Routing - RIP –
Link State Routing – OSPF –
Path-vector routing - BGP –
Multicast Routing: DVMRP – PIM.
3.7 UNICAST ROUTING
Routing is the process of selecting best paths in a network. In unicast routing, a packet is routed,
hop by hop, from its source to its destination by the help of forwarding tables. Routing a packet
from its source to its destination means routing the packet from a source router (the default router
of the source host) to a destination router (the router connected to the destination network).
The source host needs no forwarding table because it delivers its packet to the default router in its
local network. The destination host needs no forwarding table either because it receives the packet
from its default router in its local network. Only the intermediate routers in the networks need
forwarding tables.
NETWORK AS A GRAPH
1
CS3591- Computer Networks
Prepared By:J.MANIVANNAN, Department of CSE
M.A.M. COLLEGE OF ENGINEERING AND
TECHNOLOGY
Siruganur, Tiruchirappalli – 621105.
The initial table for all the nodes are given below
Table 3.3 Initial distance of each node
2
CS3591- Computer Networks
Prepared By:J.MANIVANNAN, Department of CSE
M.A.M. COLLEGE OF ENGINEERING AND
TECHNOLOGY
Siruganur, Tiruchirappalli – 621105.
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:
▪ Total Cost = Cost (Node to Neighbor) + Cost (Neighbor to Destination)
If Total Cost < Cost then
▪ Cost = Total Cost and NextHop = Neighbor
Node A learns from C's table to reach node D and from F's table to reach node G.
Total Cost to reach node D via C = Cost (A to C) + Cost(C to D)
Cost = 1 + 1 = 2.
Since 2 < , entry for destination D in A's table is changed to (D, 2, C)
Total Cost to reach node G via F = Cost(A to F) + Cost(F to G) = 1 + 1 = 2
Since 2 < , entry for destination G in A's table is changed to (G, 2, F)
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:
Table 3.5 Final distance of each node
3
CS3591- Computer Networks
Prepared By:J.MANIVANNAN, Department of CSE
M.A.M. COLLEGE OF ENGINEERING AND
TECHNOLOGY
Siruganur, Tiruchirappalli – 621105.
Periodic Update
● In this case, each node automatically sends an update message every so often, even if nothing
has changed.
● The frequency of these periodic updates varies from protocol to protocol, but it is typically on
the order of several seconds to several minutes.
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.
4
CS3591- Computer Networks
Prepared By:J.MANIVANNAN, Department of CSE
M.A.M. COLLEGE OF ENGINEERING AND
TECHNOLOGY
Siruganur, Tiruchirappalli – 621105.
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.
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.
6
CS3591- Computer Networks
Prepared By:J.MANIVANNAN, Department of CSE
M.A.M. COLLEGE OF ENGINEERING AND
TECHNOLOGY
Siruganur, Tiruchirappalli – 621105.
If Tentative list is empty then Stop, otherwise move least cost entry from Tentative list to
Confirmed list. Go to Step 2.
Example :
Table 3.5 Confirmed and tentative table
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
Path(x,y) = best { path (x,y), [ (x+ path(v,y)]} for all v’s internet
The policy is defined by selecting the best of multiple paths.
● Path-vector routing also imposes one more condition on this equation.
● If Path (v, y) includes x, that path is discarded to avoid a loop in the path.
● In other words, x does not want to visit itself when it selects a path to y.
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.
8
CS3591- Computer Networks
Prepared By:J.MANIVANNAN, Department of CSE
M.A.M. COLLEGE OF ENGINEERING AND
TECHNOLOGY
Siruganur, Tiruchirappalli – 621105.
created.
Fig 3.40 Path vectors
Updating Path Vectors
The Figure below shows the path vector of node C after two events.
In the first event, node C receives a copy of B’s vector, which improves its vector: now it knows
how to reach node A. In the second event, node C receives a copy of D’s vector, which does not
change its vector. The vector for node C after the first event is stabilized and serves as its
forwarding table.
The Border Gateway Protocol version (BGP) is the only interdomain routing protocol used in the
Internet today. BGP4 is based on the path-vector algorithm. It provides information about the
reachability of networks in the Internet. BGP views internet as a set of autonomous systems
interconnected arbitrarily.
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.
11
CS3591- Computer Networks
Prepared By:J.MANIVANNAN, Department of CSE
M.A.M. COLLEGE OF ENGINEERING AND
TECHNOLOGY
Siruganur, Tiruchirappalli – 621105.
Link-state advertisement is exchanged amongst routers in a non-backbone area. They do not see
LSAs of other areas. For example, area 1 routers are not aware of area 3 routers. ABR advertises
routing information in their area to other ABRs.
For example,R2 advertises area 2 routing information to R1 and R3, which in turn pass onto their
areas. All routers learn how to reach all networks in the domain. When a packet is to be sent to a
network in another area, it goes through backbone area via ABR and reaches the destination area.
Routing Areas improve scalability but packets may not travel on the shortest path.
The basic idea behind autonomous systems is to provide an additional way to hierarchically
aggregate routing information in a large internet, thus improving scalability. Internet has backbone
networks and sites. Providers connect at a peering point.
12
CS3591- Computer Networks
Prepared By:J.MANIVANNAN, Department of CSE
M.A.M. COLLEGE OF ENGINEERING AND
TECHNOLOGY
Siruganur, Tiruchirappalli – 621105.
13
CS3591- Computer Networks
Prepared By:J.MANIVANNAN, Department of CSE
M.A.M. COLLEGE OF ENGINEERING AND
TECHNOLOGY
Siruganur, Tiruchirappalli – 621105.
3.8 MULTICASTING-BASICS
In multicasting, there is one source and a group of destinations. Multicast supports efficient delivery
to multiple destinations. The relationship is one to many or many-to-many.
● One-to-Many (Source Specific Multicast)
●Radio station broadcast
●Transmitting news, stock-price
●Software updates to multiple hosts
● Many-to-Many (Any Source Multicast)
●Multimedia teleconferencing
●Online multi-player games
●Distributed simulations
In this type of communication, the source address is a unicast address, but the destination address is
a group address. The group address defines the members of the group.
14
CS3591- Computer Networks
Prepared By:J.MANIVANNAN, Department of CSE
M.A.M. COLLEGE OF ENGINEERING AND
TECHNOLOGY
Siruganur, Tiruchirappalli – 621105.
In multicasting, a multicast router may have to send out copies of the same datagram through more
than one interface. Hosts that are members of a group receive copies of any packets sent to that
group’s multicast address
● A host can be in multiple groups
● A host can join and leave groups
● A host signals its desire to join or leave a multicast group by communicating with its local
router using a special protocol.
● In IPv4, the protocol is Internet Group Management Protocol (IGMP)
● In IPv6, the protocol is Multicast Listener Discovery (MLD)
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. 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.
● Any Source Multicast - Supplements any source multicast (many-to-many model).
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.
16
CS3591- Computer Networks
Prepared By:J.MANIVANNAN, Department of CSE
M.A.M. COLLEGE OF ENGINEERING AND
TECHNOLOGY
Siruganur, Tiruchirappalli – 621105.
Based Tree: (DVMRP). For each combination of (source , group), there is a shortest path spanning
tree.
▪ Flood and prune
• Send multicast traffic everywhere
• Prune edges that are not actively subscribed to group
▪ Link-state
• Routers flood groups they would like to receive
• Compute shortest-path trees on demand
Shared Tree (PIM)
▪ Single distributed tree shared among all sources
▪ Does not include its own topology discovery mechanism, but instead uses routing information
supplied by other routing protocols
▪ Specify rendezvous point (RP) for group
▪ Senders send packets to RP, receivers join at RP
▪ RP multicasts to receivers; Fix-up tree for optimization
▪ Rendezvous-Point Tree: one router is the center of the group and therefore the root of the tree.
17
CS3591- Computer Networks
Prepared By:J.MANIVANNAN, Department of CSE
M.A.M. COLLEGE OF ENGINEERING AND
TECHNOLOGY
Siruganur, Tiruchirappalli – 621105.
18
CS3591- Computer Networks
Prepared By:J.MANIVANNAN, Department of CSE
M.A.M. COLLEGE OF ENGINEERING AND
TECHNOLOGY
Siruganur, Tiruchirappalli – 621105.
Pruning:
Sent from routers receiving multicast traffic for which they have no active group members
● “Prunes” the tree created by DVMRP
● Stops needless data from being sent
19
CS3591- Computer Networks
Prepared By:J.MANIVANNAN, Department of CSE
M.A.M. COLLEGE OF ENGINEERING AND
TECHNOLOGY
Siruganur, Tiruchirappalli – 621105.
is designated as rendezvous point (RP) for each group in a domain to receive PIM messages.
Multicast forwarding tree is built as a result of routers sending Join messages to RP.
Two types of trees to be constructed:
▪ Shared tree - used by all senders
▪ Source-specific tree - used only by a specific sending host
The normal mode of operation creates the shared tree first, followed by one or more source-specific
trees
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.
Source-Specific Tree
Example
RP can force routers to know about group G, by sending Join message to the sending host, so that
tunneling can be avoided.
20
CS3591- Computer Networks
Prepared By:J.MANIVANNAN, Department of CSE
M.A.M. COLLEGE OF ENGINEERING AND
TECHNOLOGY
Siruganur, Tiruchirappalli – 621105.
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.
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.
21
CS3591- Computer Networks
Prepared By:J.MANIVANNAN, Department of CSE