Unit III
Unit III
Routing – Network as Graph - Distance Vector – Link State – Global Internet –Subnetting -
Classless Routing (CIDR) - BGP- IPv6 – Multicast routing - DVMRP- PIM.
ROUTING:
In a network there are multiple routes available between a source and a destination
The process of finding the shortest route from the source to a destination is
defined as routing.
The routing table in a router is the table which contains the shortest route to reach
a destination.
It is built up by the routing algorithms. It generally contains mappings from
network numbers to next hops.
Forwarding:
Used to o select an output port based on destination address and routing
table
Routing:
Process by which routing table is built
Forwarding table
Used when a packet is being forwarded and so must contain enough
information to accomplish the forwarding function
A row in the forwarding table contains the mapping from a network
number to an outgoing interface and some MAC information, such as
Ethernet Address of the next hop. (Shown in fig. b)
Routing table
Built by the routing algorithm
Generally, contains mapping from network numbers to next hops.(shown in
fig. a)
Network as a Graph
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
For a simple network, we can calculate all shortest paths and load them into some
nonvolatile storage on each node.
Such a static approach has several shortcomings
It does not deal with node or link failures
It does not consider the addition of new nodes or links
It implies that edge costs cannot change
Hence we need a solution in the form of dynamic protocols (implemented with routing
algorithms) to find shortest route between nodes.
Before starting with it, we need to know that Internet is a Collection of Millions of Networks and
we can’t represent the entire Internet as a single entity (single network/graph) to find the shortest
routes between nodes. The Internet is divided into blocks termed as Autonomous Systems.
An autonomous system (AS) is a network or a collection of networks that are all managed and
supervised by a single entity or organization.It is a group of networks and routers under authority
of a single administrator. An AS is a heterogeneous network typically governed by a large
enterprise.
The number of unique autonomous networks in the routing system of the Internet exceeded
5,000 in 1999, 30,000 in late 2008, 35,000 in mid-2010, 42,000 in late 2012, 54,000 in mid-2016
and 60,000 in early 2018.
Since the Internet is divided into Autonomous Systems(AS), it is necessary to perform the
routing process within an AS and between ASs.
Intra-Domain Routing Protocols (Interior Gateway Protocols):
Used to construct routing table within an Autonomous System.
RIP (Routing Information Protocol) is based on Distance Vector Routing
OSPF (Open Shortest Path First Protocol is based on Link State Routing
Inter-Domain Routing Protocols (Exterior Gateway Protocols):
Used to construct routing table between Autonomous Systems
BGP(Border Gateway Protocol) is based on Path Vector Routing.
DISTANCE VECTOR ROUTING
Working Principle: Each node(router) shares the entire routing information (entire AS) to
its neighbors periodically.
That is, each node constructs a one dimensional array (a vector) containing the
“distances” (costs) to all other nodes and distributes that vector to its immediate
neighbors
Starting assumption is that each node knows the cost of the link to each of its directly
connected neighbors.
Consider the below example,
The below table shows the global view of all vectors at each node, first row is the initial vector at router A
and so on for each router.
The Router updates its own table according to the following three rules:
After a few exchanges of information between neighbors, all nodes have consistent
routing table with correct distance information. The process of getting consistent
routing information to all the nodes is calledconvergence.
The following figure shows the final distances stored at each node.
There are two different conditions under which a node decides to send a routing table to
neighbors
1. Periodic update
Each node automatically sends an update message every seconds
orminutes even though there is no change
2. Triggered update
whenever a node’s routing table changes, it sends its updated distance
information to its neighbors.
Triggered updates are sent generally, whenever a link fails and causes
changes in the routing table.
Link Failure example
Command - request or
response
version -2
must be zero - unused
Address - IP address
Family - network address
designed to carry
information to
different Protocols
Distance - metric value that
determines how many
hops to reach its
destination
(1 to 15 are valid routes, 16 is
unreachable)
mask - subnet masking
next hop - indicates the IP
address of the next hop
Reliable flooding is the process of making sure that all the nodesparticipating in the
routing protocol get a copy of the link-state information from all the other nodes.
o As the term ―flooding suggests, the basic idea is for a node to send its
link-state information out on all of its directly connected links, with each
node that receives this information forwarding it out on all of its links.
Initially each node knows only the state of the link to each of its neighbor.
The information of each node is put into update packet called as Link State
Packet (LSP) and its flooded to all other packets. Ie This process continues until
the information has reached all the nodes in the network.
Flooding of link-state
packets.
(a) LSP arrives at
node X;
(b) X floods LSP to A
and C;
(c) A and C flood
LSP to B (but not
X);
(d) flooding is
complete
Each node becomes shaded as it stores the new LSP. In Figure (a) the LSP
arrives at node X, which sends it to neighbors A and in Figure (b) A and C
do not send it back to X, but send it on to B. Since B receives two identical
copies of the LSP, it will accept whichever arrived first and ignore the
second as a duplicate. It then passes the LSP on to D, who has no
neighbors to flood it to, and the process is complete.
In practice, each router computes its routing table directly from the
LSPs it has collected.
Once a node has a copy of LSP from every other node, it can compute
a complete map of network topology and finds the shortest route (routing
table) using Dijkstra’s algorithm called the forward search algorithm.
The algorithm
1. Initialize the Confirmed list with an entry for myself; this entry has
a cost of 0
2. For the node just added to the Confirmed list in the previous step,
call it node Next, select its LSP
3. For each neighbor (Neighbor) of Next, calculate the cost (Cost) to
reach this Neighbor as the sum of the cost from myself to Next and
from Next to Neighbor
a) If Neighbor is currently on neither the Confirmed nor the Tentative
list, then add (Neighbor, Cost, Nexthop) to the Tentative list, where
Nexthop is the direction I go to reach Next.
b) If Neighbor is currently on the Tentative list, and the Cost is less
than the currently listed cost for the Neighbor, then replace the
current entry with (Neighbor, Cost, Nexthop) where Nexthop is
the direction I go to reach Next.
4. If the Tentative list is empty, stop. Otherwise, pick the entry from
the Tentative list with the lowest cost, move it to the Confirmed
list, and return to Step 2.
Consider an example network for link-state routing
The following table list the steps for building routing table for node D.
Additional hierarchy
Introduces additional hierarchy by allowing arouting domain to be
portioned into areas.
Reduces the amount of information that must be transmitted to and
stored in each node.
Router doesn’t need to know how to reach each network in its domain;
it may know how to get to right area.
Load balancing
OSPF allows distributing traffic among multiple routes of same cost.
Version - set to 2
Type – may take the values 1 through 5
SourceAddr - identifies the sender of the message
Authentication type
- 0 if authentication is used
- 1 if password is used
- 2 if cryptographic authentication checksum is used
Area id – 32 bit identifier of the area in which node is located
Authentication - password or cryptographic checksum Checksum - the
entire packet, except the authentication data, is protected by a 16-bit
checksum using the same algorithm as the IP header.
Type - OSPF Message Types
Type 1 -> “hello” msg (notficationmsg to nofity that it is alive)
Type 2 -> request
Type 3 -> response
Type 4 –> send
Type 5 -> acknowledge the receipt of link state msg
The basic building blocks of link state messages is known as link state
advertisement (LSA). One message may contain one or many LSAs.
The packet format for type1 link-state advertisement is as follows:-
GLOBAL INTERNET
Internetworking is a heterogeneous of networks with tens of
thousands of networks connected to it.
The Global Internet
ROUTING AREAS:
How does a router in one area determine the right next hop for a
packet destined to a network in another area?
To make this work, the area border routers summarize routing information
that they have learned from one area and make it available in their
advertisements to other areas.
For example, R1 receives link-state advertisements from all the
routers in area 1 and can thus determine the cost of reaching any network
in area 1.
When R1 sends link-state advertisements into area 0, it advertises
the costs of reaching the networks in area 1 much as if all those networks
were directly connected to R1.
This enables all the area 0 routers to learn the cost to reach all
networks in area 1. The area border routers (ABR) then summarize this
information and advertise it into the non-backbone areas. Thus, all routers
learn how to reach all networks in the domain.
In the case of area 2, there are two ABRs and that routers in
area 2 will thus have to make a choice as to which one they use to
reach the backbone.
The use of areas forces all packets traveling from one area to another
to go via the back- bone area, even if a shorter path might have been
available.
For example, even if R4 and R5 were directly connected, packets
would not flow between them because they are in different non-backbone
areas.
It turns out that the need for scalability is often more important than
the need to use the absolute shortest path.
Finally, we note that there is a trick by which network administrators
can more flexibly decide which routers go in area
0. This trick uses the idea of a virtual link between routers.Such a virtual
link is obtained by configuring a router that is not directly connected to area
0 to exchange backbone routing information with a router that is.
INTER-DOMAIN ROUTING
Exterior Gateway Protocol (EGP)
Forced a tree-like topology onto the Internet
Did not allow for the topology to become general
Tree like structure: there is a single backbone and
autonomous systems are connected only as parents
and children and not as peers
Border Gateway Protocol (BGP)
BGP version 4 is often regarded as one of the more complex
parts of the internet.
BGP makes virtually no assumptions about how
autonomous systems are interconnected—they form
an arbitrary graph.
BORDER
GATEWAY PROTOCOL:
BGP is used for routing interconnected set of Autonomous Systems(ASs)
It Assumes that the Internet is an arbitrarily interconnected set of ASs.
1) local traffic
- as traffic that originates at or terminates on nodes within an AS
2) transit traffic
- as traffic that passes through an AS.
Basics of BGP
1. Each AS has one or more border routers through which packets enter
and leave the AS.
2. A Border Router is simple an IP router that is charged with the task of
forwarding packet between autonomous systems.
Each AS has
One BGP speaker that advertises:
local networks
other reachable networks (transit AS only)
gives path information
In addition to the BGP speakers, the AS has one or more border
“gateways” which need not be the same as the speakers
The border gateways are the routers through which packets enter and
leave the AS
BGP does not belong to either of the two main classes of routing
protocols (distance vectors and link-state protocols).
BGP advertises complete paths as an enumerated lists of ASs to reach
a particular network. It is sometimes called a path-vector protocol for
this reason.
consider the very simple example network in Figure. Assume
that the providers are transit networks, while the customer
networks are stubs.
A BGP speaker for the AS of provider A (AS 2) advertises
reachability to P and Q
Network 128.96, 192.4.153, 192.4.32, and 192.4.3, can be
reached directly from AS 2.
Speaker for backbone network then advertises
Networks 128.96, 192.4.153, 192.4.32, and 192.4.3 can be
reached along the path <AS 1, AS 2>.
Speaker can also cancel previously advertised paths
An important job of BGP is to prevent the establishment of looping
paths.
In figure only in the addition of an extra link between AS 2 and AS 3,
but the effect now is that the graph of autonomous systems has a loop in it.
2. Customer-Provider
Advertise my own prefixes and routes learned from my provider to my
customers to my provider, advertises routes learned from my providers to
my customers , but don’t advertise routes learned from one provider to
another provider.
3. Peer
Third option is a symmetrical peering between autonomous systems.
policy here is to advertise routes learned from my customers to my peer,
advertise routes learned from my peer to my customers, but don’t advertise
routes from my peer to any provider or vice versa.
Integrating Inter-domain and Intra-domain Routing
Consider, for example, the border router of a provider AS that
connects to a customer AS. That router could learn that the network prefix
192.4.54/24 is located inside the customer AS, either through BGP or
because the information is con- figured into the border router. It could inject
a route to that prefix into the routing protocol running inside the provider
AS. This would be an advertisement of the sort, “I have a link to 192.4.54/24
of cost X.”
This would cause other routers in the provider AS to learn that this
border router is the place to send packets destined for that prefix.
iBGP enables any router in the AS to learn the best border router to
use when sending a packet to any address. At the same time, each router in
the AS keeps track of how to get to each border router using a conventional
intradomain protocol with no injected information. By combining these two
sets of information, each router in the AS is able to determine the
appropriate next hop for all prefixes.
BGP routing table, IGP routing table, and combined table at router B is,
FIGURE 4.10 BGP routing table, IGP routing table, and combined table at
router B.
IPV6
The motivation for new version of IP is
- To deal with scaling problem
- To achieve 100 % address utilization efficiency
Historical perspective
In addition to deal with scalable routing and addressing, IPv6 should also
IPv6 also follows CIDR like IPv4, so IPv6 addresses are classless
The address prefix assignments for IPv6 is as follows,
- One type, the IPv4-compatible IPv6 address, is used for devices that
are compatible with both IPv4 and IPv6;
- Begins with 96 bits zeros then followed by 32 bits IPv4 address
47CD:1234:4422:ACO2:0022:1234:A456:0124
Example1
47CD:0000:0000:0000:0000:0000:A456:0124
could be written as 47CD::A456:0124
Example 2
3FFE:085B:1F1F:0000:0000:0000:00A9:1234
could be written as 3FFE:85B:1F1F::A9:1234
The two types of IPv6 addresses that contain an embedded IPv4 address
have their own special notation that makes extraction of the IPv4 address
easier.
For example, the IPv4 -mapped IPv6 address of a host whose IPv4 address
was 128.96.33.81 could be written as:: FFFF:128.96.33.81
That is, the last 32 bits are written in IPv4 notation, rather than as a pair
of hexadecimal numbers separated by a colon.Note that the double colon
at the front indicates the leading 0s.
Assuming it is the only extension header present, then the NextHeader field of the
IPv6 header would contain the value 44, which is the value assigned to indicate the
fragmentation header
The NextHeader field of the fragmentation header itself contains a
value describing the header that follows it. Again, assuming no other
extension headers are present, then the next header might be the TCP
header, which results in NextHeader containingthe value 6, just as
the Protocol field would in IPv4.
If the fragmentation header were followed by, say, an authentication
header, then the fragmentation header’s NextHeaderfield would
contain the value 51.
MULTICASTING
One-to-many
Radio station broadcast
Transmitting news, stock-price
Software updates to multiple hosts
Many-to-many
Multimedia teleconferencing
Online multi-player games
Distributed simulations
Multicast address
224.0.0.1 The All Hosts multicast group addresses all hosts on the same
network segment.
224.0.0.2 The All Routers multicast group addresses all routers on the same
network segment.
224.0.0.4 This address is used in the Distance Vector Multicast
RoutingProtocol (DVMRP) to address multicast routers.
224.0.0. The Open Shortest Path First (OSPF) All OSPF Routers address
is used to send Hello packets to all OSPF routers on a network segment.
Multicasting with IPv6
Address Description
MULTICAST ROUTING
GROUP SHARED TREE APPROACH:
Each router already knows that shortest path to source S goes through router
N.
When receive multicast packet from S, forward on all outgoing links (except
the one on which the packet arrived), if packet arrived from N. flood to all
links except to the link connected to S.
Two shortcomings
Two shortcomings
Solution to shortcoming2
PIM – DM
PIM – Dense mode uses flood and prune algorithm (used in
DVMRP).
Suffers from scaling issues
PIM - SM
Routers explicitly join and leave the group
• Uses “Join” and “Leave” messages.
PIM assigns a representative node called the
“RendezvousPoint” (or RP)to each multicast group.
RP’s IP address is known to all the routers in a domain.
PIM-SM defines a set of procedures by which all routers in a domain
can agree to use RP for a given group.
Multicast forwarding tree is built as a result of routers sending join
messages to RP.
PIM-SM use join message to build two kinds of trees
1. Shared Tree: Used by all senders
2. Source-Specific Tree: Used by only a specific sending host.
PIM-SM first creates shared tree first followed by one or more source
specific trees.
Traditional multicast
– A group address is a single IP address taken from a
reserved range (224.0.0.0/4 for IPv4, FF00::/8 for IPv6)