Unit-3 Routing, Ipv6
Unit-3 Routing, Ipv6
Concept of Routing
in Network Layer,
IPV6 Addressing
1
Network Layer II (routing)
Routing Styles:
Static vs. Dynamic Routing
Routing Protocols/Algorithms
Routing Table
Routing Information Protocol (RIP) & Distance Vector Routing
(DVR)
Open Shortest Path First (OSPF) & Link State Routing (LSR)
Dijkstra’s “Shortest Path” Algorithm
Border Gateway Protocol (BGP) and Path Vector Routing (PVR)
2
3
Routing Protocol & Routing Algorithm
A Routing Protocol is a combination of rules and
procedures that lets routers in an internet inform
each other of changes. It allows routers to share
whatever they know about the internet or their
neighbourhood.
The destination host address Instead of having an entry for every host
is given in the routing table; connected to the same network, only one entry
to have greater control over is needed to defined the address of the network
routing. itself. All host connected to the same network
as one single entity. 10
11
12
Default routing
16
Make a routing table for router R1, using the
Example 7a configuration in Figure below
m3
The table is sorted from the longest mask to the shortest mask. 17
Example 7b Show the forwarding process if a packet arrives at
R1 with the destination address 180.70.65.140.
Solution
The router performs the following steps:
1. The first mask (/26) is applied to the destination address.
The result is 180.70.65.128, which does not match the
corresponding network address.
2. The second mask (/25) is applied to the destination
address. The result is 180.70.65.128, which matches the
corresponding network address. The next-hop address
and the interface number m0 are passed on for
further processing. 18
Show the forwarding process if a packet arrives at
Example 7c R1 with the destination address 201.4.22.35.
Solution
25
Static versus Dynamic Routing
28
29
30
31
32
33
34
35
36
37
38
39
40
Routing Information Protocol (RIP)
a) RIP is based on distance vector routing, which uses the Bellman-
Ford algorithm for calculating the routing table.
b) RIP treats all network equals; the cost of passing thru a network
is the same: one hop count per network.
c) Each router/node maintains a vector (table) of minimum
distances to every node. (the least-cost route btw any nodes is the
route with the minimum number of hop-count).
d) The hop-count is the number of networks that a packet
encounters to reach its destination. Path costs are based on
number of hops.
e) In distance vector routing, each router periodically shares its
knowledge about the entire internet with its neighbour.
f) Each router keeps a routing table that has one entry for each
destination network of which the router is aware.
g) The entry consists of Destination Network Address/id, Hop- 41
Count and Next-Router.
42
43
44
Distance Vector Routing (DVR)
a) 3 keys to understand how this algorithm works:
• Sharing knowledge about the entire AS. Each router
shares its knowledge about the entire AS with
neighbours. It sends whatever it has.
• Sharing only with immediate neighbours. Each
router sends whatever knowledge it has thru all its
interface.
• Sharing at regular intervals. sends at fixed intervals,
e.g. every 30 sec.
46
Updating in distance vector routing example: C to A
From C From A
47
Final Distance vector routing tables
48
Example of Initial routing tables (RIP)
in a small autonomous system
49
Example of Final routing tables
50
Example of a domain using RIP
51
Link State Routing (LSR)
a) Like RIP, in link state routing, each router also shares its knowledge
about its neighbourhood with every routers in the area.
b) However, in LSR, the link-state packet (LSP) defines the best known
network topology (of an area) is sent to every routers (of other area)
after it is constructed locally. Whereas RIP slowly converge to final
routing list based information received from immediate neighbours.
c) 3 keys to understand how this algorithm works:
• Sharing knowledge about the neighbourhood. Each router sends the state of
its neighbourhood to every other router in the area.
• Sharing with every other routers. Thru process of flooding. each router sends
the state of its neighbourhood thr all its output ports and each neighbour sends
to every other neighbours and so on until all routers received same full
information eventually.
• Sharing when there is a change. Each router share its state of its neighbour
only when there is a change; contrasting DVR results in lower traffic.
d) From the received LSPs and knowledge of entire topology, a router
can then calculate the shortest path between itself and each network.52
53
54
55
56
57
58
59
60
61
62
63
64
Open Shortest Path First (OSPF)
a) OSPF uses link state routing to update the routing table in an area;
OSPF divides an AS into different areas (depending on their
type).
b) Unlike RIP, OSPF treats the entire network within differently with
different philosophy; depending on the types, cost (metric) and
condition of each link: to define the ‘state’ of a link.
c) OSPF allows the administrator to (only) assign a cost for passing
through a network based on the type of service required. e.g.
minimum delay, maximum throughput. (but not stating exact path)
d) Each router should have the exact topology of the AS network(a
picture of entire AS network) at every moment. The topology is a
graph consisting of nodes and edges.
e) Each router needs to advertise to the neighbourhood of every
other routers involved in an Area. (flood)
65
Link State Advertisement (LSA)
To share information about the neighbourhood, each entity
distribute link state advertisements (LSAs).
5 Types of LSAs
Backbone network
Router and network link advertisements flood each area with info about the router
links and network links within/inside an area. But a router must also know about the
networks outside its area, and the area border routers can provide this information.
An area border router is active in more than one area. It receives router link and
network link advertisements and creates a routing table for each area.
69
Summary link to AS boundary router
The previous advertisement lets every router know the cost to reach all networks
within/inside an AS. But what about the network outside the AS? If a router inside an
area wants to send a packet outside the autonomous system, it should first know the
route to an AS boundary router; the summary link to AS boundary router provides
this information. The border routers can then flood their areas with this information.
70
External link
Although the previous advertisement lets each router know the route to different AS
boundary router, this information is not enough. A router inside an AS also wants to
know which networks are available outside the AS; i.e. the external internet.
The external link advertisement provide this information. The AS boundary router
floods the AS with cost of each network outside the AS, using a routing table created
by an exterior routing table protocol. Each advertisement announces one single 71
network. If there is more than one network. Separate announcements are made.
Example In the figure below, which router(s) sends out
router link LSAs? and which router(s) sends out
network link LSAs?
Solution
73
In OSPF, all routers have
the same Link State database.
• Every router in an area receives the router link and network link
LSAs and form a link state database.
• Every router in the same area has the same link state database.
• A link state database is a tabular representation of the topology of
the internet inside an area. It shows the relationship between each
router and its neighbors including the metrics used.
• To calculate its next-route in the routing table, each router applies
the Dijkstra algorithm to its state database, to find the shortest path
between 2 points on a network, using a graph (nodes and edges).
• The algorithm divides the nodes into two sets: tentative and
permanent. It chooses nodes, makes them tentative, examines them,
74
and if they pass the criteria, makes permanent.
Shortest Path Search
Dijkstra’s Algorithm
1. Start with the local node (router): the root of the tree.
2. Assign a cost of 0 to this node and make it the first permanent node.
3. Examine each neighbour node of the node that was the last
permanent node.
4. Assign a cumulative cost to each node and make it tentative.
5. Among the list of tentative nodes
a. Find the node with the smallest cumulative cost and make it permanent.
b. If a node can be reached from more than one direction
i. Select the direction with the shortest cumulative cost.
6. Repeat steps 3 to 5 until every node becomes permanent.
75
Dijkstra algorithm
76
Example of formation of shortest path tree
77
Link State Routing (LSR)
Idea Behind LSR: Each router must do the following:
1. Discover its neighbors, learn their network address. ( Send HELLO
packet)
2. Measure the delay or cost to each of its neighbors. (Send ECHO packet)
3. Building Link State packet telling all it has just learned. (ACK flag)
4. Distribute/Send this packet to all other routers (Flooding – SEND flag).
5. Compute the shortest path to every other router. (Dijkstra’s algorithm)
In effect the complete topology and all the delays are experimentally
measured and distributed to every router, then Dijkstra’s algorithm can
be run to find the shortest path to every other router.
78
OSPF Packets
79
Exterior Routing Protocol:
Border Gateway Protocol
(BGP)
80
BGP & Path Vector Routing (PVR)
a) Border Gateway Protocol (BGP) is an inter-domain or inter-
autonomous system routing protocol: routing between different ASs.
b) BGP uses path vector routing to update the routing table in an area.
c) DVR and LSR are not suitable candidates for inter-AS routing :
• DVR: there are occasions in which the route with the smallest hop count is not
the preferred route; non-secure path although the shortest route taken.
• LSR: internet is too big for this routing method to require each router to have a
huge link state database. Taking very long time to calculate the routing table.
d) PVR defines the exact paths as an ordered list of ASs that a packet
should travel thru to reach the destination (besides having the
destination network and next router info.) in its routing table.
e) Security and Political issues involved: more desired to avoid
‘unsaved’ paths/routes/ASs than to take a shorter route.
f) The AS boundary router that participate in PVR advertise the routes
of the networks in their own AS to neighbour AS boundary routers.
g) Solve the count-to-infinity problem 81
Path vector packets
• Each AS has its ‘speaker’ router/node that acts on behalves of the AS. Only
speaker router can communicate with other speaker routers.
• R1 send a path vector message advertising its reachability of N1. R2
receives the message, updates its routing table and after adding its AS to the
path and inserting itself as next router, send message to R3. R3 receives the
message, updates its routing table, make changes and sends the message to
82
R4.
Path Vector Routing Policy
a) Policy routing can be easily implemented through path vector routing.
b) When a router receives a message from its neighbour, the speaker
node or AS boundary router can check the path with its approved list
of ASs.
c) If one of the ASs listed in the path is against its policy, the router can
ignore that path entirely and that destination.
d) For any unapproved paths, the router does not update its routing table
with this path, and it does not send the PV message to its neighbours.
e) This means that the routing table in path vector routing are not based
on the smallest hop count (as in distance vector routing) or the
minimum delay metric (as in open shortest path first routing); they are
based on the policy imposed on the router by the administrator.
f) The path was presented as a list of ASs, but is in fact, a list of
attributes. Each attributes gives some information about the path. The
list of attributes helps the receiving router make a better decision
when applying its policy. (Well-known & Optional) 83
Types of BGP messages
85
19-2 IPv6 ADDRESSES
Despite all short-term solutions, address depletion is
still a long-term problem for the Internet. This and
other problems in the IP protocol itself have been the
motivation for IPv6.
19.86
Note
19.87
Figure 19.14 IPv6 address in binary and hexadecimal colon notation
19.88
Figure 19.15 Abbreviated IPv6 addresses
19.89
Example 19.11
Expand the address 0:15::1:12:1213 to its original.
Solution
We first need to align the left side of the double colon to
the left of the original pattern and the right side of the
double colon to the right of the original pattern to find
how many 0s we need to replace the double colon.
19.90
IPv4 Addressing Concepts and
Their IPv6 Equivalents
IPv4 Address IPv6 Address
Address Length – 32 bits 128 bits
1. Version (4 bits)
• 4 bits are used to indicate the version of IP and is set to 6