Routing: Unicast and Multicast Routing
Routing: Unicast and Multicast Routing
Routing: Unicast and Multicast Routing
Routing
Kithsiri M. Liyanage
Dept. of Electrical and Electronic Engineering
University of Peradeniya
Unicast
Multicast
Metric
A metric is a cost assigned for passing through a network.
the total metric of a particular route is equal to the sum of the metrics of
networks that comprise the route.
the router chooses the route with the shortest (smallest) metric
Therefore an internet is divided into autonomous systems.
RIP (Routing Information Protocol): treating each network equals.
The cost of passing through each network is the same.
so if a packet passes through 10 networks to reach the destination, the
total cost is hop counts.
OSPF (Open Shortest Path First)
Allowing the administrator to assign a cost for passing through a
network based on the type of service required.
A route through a chosen. network can have different costs (metrics)
7/29/2014
Autonomous Systems
Intra and Inter Domain Routing
In distance vector routing, the least cost route between any two nodes is the
route with minimum distance. In this protocol each node maintains a vector
(table) of minimum distances to every node
7/29/2014
Split Horizons
7/29/2014
Three-Node Instability
RIP sends out the full routing table every periodic update
RIP uses a form of distance as its metric (in this case, hopcount)
RIP uses the Bellman-Ford Distance Vector algorithm to determine the
best path to a particular destination
7/29/2014
RIP Version 2
Distance : defining the hop count from the advertising router to the
destination network
In case that shares a network backbone by two ASes, the message can
define the router to which the packet should go next
7/29/2014
RIP Messages . . .
Requests and Response
Request messages :
sent by a router that has just come up or by a router that has
some time-out entries.
RIP Messages . . .
Response
solicited response is
sent only in answer to a request
containing information about the destination specified in the
corresponding request
unsolicited response is
sent periodically, every 30 seconds
containing information covering the whole routing table
7/29/2014
RIP Timers
Indicates how often the router will send out a routing table update.
Update Timer
Invalid Timer
Hold-down Timer
Indicates how long a route will remain in a routing table before being marked
as invalid, if no new updates are heard about this route.
Flush Timer
The invalid timer will be reset if an update is received for that particular route
before the timer expires.
A route marked as invalid is not immediately removed from the routing table.
Instead, the route is marked (and advertised) with a metric of 16, indicating it is
unreachable, and placed in a hold-down state.
7/29/2014
RIP Authnetication
Example
A routing table has 20 entries. It does not receive
information about five routes for 200 seconds. How many
timers are running at this time?
The timers are listed below:
Update timer: 1
Invalid timer: 20 - 5 = 15
Hold down timer: 5
Flush timer: 20
7/29/2014
3.
4.
Creation of LSP
On a periodic basis
Dijkstra Algorithm
60 minutes or 2 hours
7/29/2014
OSPF (contd)
OSPF (Open Shortest Path First)
Areas
Is a collection of networks, hosts, and routers in AS
AS can be divided into many different areas.
All networks inside an area must be connected.
Routers inside an area flood the area with routing information.
Area Border Router
Summarizes the information about the area and sends it to other
areas
Backbone
All of the areas inside an AS must be connected to the backbone
Serving as a primary area
Consisting of backbone routers
Back bone routers can be an area border router
10
7/29/2014
OSPF (contd)
OSPF (contd)
Areas in an AS
Metric
OSPF protocol allows the administrator to assign a cost, called the
metric, to each route
Based on a type of service (minimum delay, maximum throughput,
and so on)
A router can have multiple routing tables, each based on a different
type of service.
OSPF (contd)
1. Sharing knowledge about the neighborhood
2. Sharing with every other router by flooding
OSPF (contd)
Types of Links
In OSPF terminology, a connection is called a link.
So, every router can calculate the shortest path between itself and
each network
11
7/29/2014
OSPF (contd)
Point-to-point Link
OSPF (contd)
Transient Link
Each router has only one neighbor at the other side of the link.
(network)
OSPF (contd)
OSPF (contd)
Stub Link
is a network that is connected to only one router
is a special case of transient network
The link is only one-directional, from the router to the network.
Virtual Link
When the link between two routers is broken, the administration
may create a virtual link between them using a longer path
Graphical Representation
An internet with 5 networks and 6 routers
12
7/29/2014
OSPF Packets
OSPF (contd)
or 64 bits
13
7/29/2014
LS age: The time in seconds since the link state advertisement was originated.
E flag : 1 means that the area is a stub area
T flag : 1 means that the router can handle multiple types of service
Link state type : 1) router link, 2) network link, 3) summary link to network, 4) summary link
to AS boundary router 5) AS external link
Link State ID: This field identifies the portion of the internet environment that is being
described by the advertisement. The contents of this field depend on the advertisement's LS
type.
LS Type
Link State ID
.
1
The originating router's Router ID.
2
The IP interface address of the network's Designated Router.
3
The destination network's IP address.
4
The Router ID of the described AS boundary router.
5
The destination network's IP address.
Advertising Router: The Router ID of the router that originated the link state advertisement.
For example, in network links advertisements this field is set to the Router ID of the network's
Designated Router.
LSA
Router Link
defining the links of a true router
A true router uses the advertisement to announce information about
all of its links and what is at the other side of the link (neighbors)
14
7/29/2014
Example
Example : Solution
Give the router link LSA sent by router 10.24.7.9 in the following Figure
15
7/29/2014
Network Link
Example
Example : Solution
16
7/29/2014
Example
Example: Solution
Example: Solution
All three network must advertise network links:
a. Advertisement for N1 is done by R1 because it is the only attached
router and therefore the designated router.
b. Advertisement for N2 can be done by either R1, R2, or R3,
depending on which one is chosen as the designated router.
c. Advertisement for N3 is done by R3 because it is the only
attached router and therefore the designated router.
17
7/29/2014
External Link
18
7/29/2014
Other Packets
Hello message
uses to create neighborhood relationships and to test the reachability of neighbors
is the first step in link state routing
Backup Designated Router: The identity of the Backup Designated Router for this
network, in the view of the advertising router. The Backup Designated Router is identified
here by its IP interface address on the network. Set to 0.0.0.0 if there is no Backup
Designated Router.
Neighbor: The Router IDs of each router from whom valid Hello packets have been seen
recently on the network. Recently means in the last RouterDeadInterval seconds.
Then, the router sends one or more link state request packets to get full
information about that particular link
19
7/29/2014
Interconnected ASes
Encapsulation
OSPF packets are encapsulated in IP datagram
3c
These packets contain the acknowledgment mechanism for flow
and error control
3b
3a
AS3
1a
2a
1c
AS2
1b
1d
2c
AS1
Intra-AS
Routing
algorithm
Inter-AS
Routing
algorithm
forwarding table
configured by both
intra- and inter-AS
routing algorithm
Forwarding
table
Inter-AS tasks
3c
3b
2b
3a
AS3
1a
2a
1c
1d
1b
2c
AS2
AS1
2b
3b
3a
AS3
1a
2a
1c
1d
1b AS1
2c
2b
AS2
20
7/29/2014
3c
3b
3a
AS3
1a
2a
1c
1d
1b
2c
AS2
2b
AS1
Policy:
Inter-AS: admin wants control over how its traffic routed,
who routes through its net.
Intra-AS: single admin, so no policy decisions needed
Scale:
hierarchical routing saves table size, reduced update
traffic
Performance:
Intra-AS: can focus on performance
Inter-AS: policy may dominate over performance
Determine from
forwarding table the
interface I that leads
to least-cost gateway.
Enter (x,I) in
forwarding table
21
7/29/2014
Initialization
Sharing
Updating
22
7/29/2014
Loop Prevention
Aggregation
Policy Routing
For example, consider this IPv4 routing table (CIDR
notation is used):
192.168.20.16/28
192.168.0.0/16
When the address 192.168.20.19 needs to be looked up,
both entries in the routing table "match". That is, both
entries contain the looked up address. In this case, the
longest prefix of the candidate routes is 192.168.20.16/28,
since its subnet mask (/28) is higher than the other entry's
mask (/16), making the route more specific.
23
7/29/2014
Optimum Path
BGP Sessions
24
7/29/2014
BGP can have 2 types of session: external BGP (EBGP) and internal BGP (I-BGP) sessions
The E-BGP session is used to exchange information
between 2 speaker nodes belonging to 2 different Ass
The I-BGP session is used to exchange routing
information between 2 routers inside an AS
Note:
BGP uses the services of TCP
on port 179.
Path Attributes
3c
3b
3a
AS3
1a
AS1
iBGP session
2a
1c
1d
1b
2c
AS2
2b
25
7/29/2014
26
7/29/2014
B
W
provider
network
customer
network:
provider
network
customer
network:
legend:
A advertises path AW to B
B advertises path BAW to X
Should B advertise path BAW to C?
No way! B gets no revenue for routing CBAW since
neither W nor C are Bs customers
B wants to force C to route to w via A
B wants to route only to/from its customers!
Types of Packets
Packet Format
27
7/29/2014
Open Message
Update Message
28
7/29/2014
Keepalive Message
Notification Message
29
7/29/2014
Initialization
Each speaker node can know only the reach-ability of nodes inside
its AS
30
7/29/2014
14.7 BGP
link state routing : requiring each router to have a huge link state database
Each entry in the routing table contains the destination network, the next router, and
the path to reach the destination
The path is usually defined as an ordered list of autonomous systems that a packet
should travel through to reach the destination
BGP (contd)
BGP (contd)
Stub AS
Multihomed AS
has more than one connection to other AS
Path attributes
Well-known attributes
well-known mandatory : ORIGIN (RIP, OSPF, and so on), AS-PATH,
NEXT_HOP
well-known discretionary
Transit AS
is a multihomed AS that also allows transient traffic.
ex) national and international ISPs
Optional attributes
Optional transitive : must be passed to the next router by the router has
not implemented this attribute
Optional nontransitive : must be discarded if the receiving router has
not implemented this attribute
31
7/29/2014
BGP (contd)
BGP (contd)
BGP Session
Types of Packets
Total message
including the header
BGP (contd)
BGP (contd)
Open message
To create a neighborhood relationship, a router running BGP
opens a TCP connection with a neighbor and sends an open
message
Encapsulation
BGP messages are encapsulated in TCP segments using the wellknown port 179
Update message
used by a router to withdraw destinations that have been
advertised previously, announce a route to a new destination,
or both
Keepalive message
exchange keepalive messages regularly (before their hold time
expires) to tell each other that routers are alive
Notification message
sent by a router whenever an error condition is detected or a
router wants to close the connection
32