Download Chapter 14

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Deep packet inspection wikipedia , lookup

Piggybacking (Internet access) wikipedia , lookup

AppleTalk wikipedia , lookup

Backpressure routing wikipedia , lookup

Zero-configuration networking wikipedia , lookup

List of wireless community networks by region wikipedia , lookup

Internet protocol suite wikipedia , lookup

Wake-on-LAN wikipedia , lookup

IEEE 802.1aq wikipedia , lookup

IEEE 1355 wikipedia , lookup

Computer network wikipedia , lookup

Peering wikipedia , lookup

Cracking of wireless networks wikipedia , lookup

Airborne Networking wikipedia , lookup

Multiprotocol Label Switching wikipedia , lookup

Recursive InterNetwork Architecture (RINA) wikipedia , lookup

Routing wikipedia , lookup

Routing in delay-tolerant networking wikipedia , lookup

Transcript
Unicast Routing Protocols
There isn’t a person anywhere that isn’t
capable of doing more than he thinks he
can.
- Henry Ford
Chapter 14
1
Objectives
• List advantages and disadvantages of routing
protocols
• Describe how routing tables are dynamically built
up in a router
• Explain how routing protocols can be categorized
as interior and exterior routing protocols
• Describe how routing loops can occur and
techniques used for minimizing them
• Describe basic features of RIP, OSPF and BGP
Chapter 14
2
Advantages & Disadvantages of
Routing Protocols
• Compared to manual configuration, much easier to
maintain in large networks
• Represent a point of failure that attackers can exploit
• Can take some time for a router on one side of a large
network to learn about a topology change on the other
side of the network
• Advanced routing protocols can be very complex
• Inherent lack of control. For eg: if there are multiple paths
to a destination network, routing protocol will decide
which one to use. While metrics can be manually
tweaked to make one path preferred, one needs to
understand the consequences of the manual changes
Chapter 14
3
Routing Domains and Autonomous Systems
• A routing domain is a group of routers under the control
of a single administrative entity, running a common
interior routing protocol.
• An autonomous system consists of a collection of routers
under the control of a single administrative entity - for
example, all the routers belonging to a particular ISP,
corporation or university.
• An autonomous system can choose one or more routing
protocols to run within the autonomous system, but
typically may use only a single interior routing protocol.
Chapter 14
4
Grouping Routing Protocols
• Routed or Routable protocols (in contrast to Routing
protocols) are Layer 3 protocols used to carry application
data through an internetwork (Eg: IP). Routed protocols
use information in routing tables built up by routing
protocols for forwarding packets to their destinations
• Intra- and Inter-domain routing protocols
– Intra-domain (or, interior) routing protocols are used
inside an autonomous system. They are also called
“interior gateway protocols”. E.g: RIP, OSPF
– Inter-domain (or, exterior) routing protocols are used
between autonomous systems. They are also called
“exterior gateway protocols”. E.g: BGP (Border
Gateway Protocol)
Chapter 14
5
Figure 14.1
Chapter 14
Autonomous systems
6
Figure 14.2
Chapter 14
Grouping routing protocols
7
Distance Vector Routing Protocols
• In distance vector routing, the least cost route between
any two routers is the route with minimum distance.
Each router maintains a vector (table) of minimum
distances to other nodes.
• The minimum distance (called the “routing metric”) is a
“measure of goodness” of a path to another router.
• Each node shares its routing table with its immediate
neighbors periodically (by sending Periodic Updates)
and whenever there is a change in network topology (by
sending Triggered Updates).
Chapter 14
8
Figure 14.3
Chapter 14
Distance vector routing tables
9
How the Routing Table is built up ...
• Initially, each router knows only about its immediate
neighbors - those directly connected to it. Using the
configuration data, a router builds up the distance vector
info for each directly connected link.
• Each router periodically sends its routing table (distance
vector information) on all directly connected links.
• When a router receives a routing table from a neighbor, it
updates its own routing table based on the information in
the neighbor’s routing table.
• After some time, if there is no change in the network (such
as a link failure), all routers will have stable routing tables.
Routers are then called to be in a “converged” state.
Chapter 14
10
Instability due to Routing Loops
• An example of a routing loop: When a router X believes
the best path to a network N is via a second router Y,
and at the same time, the second router Y believes the
best path to network N is through the first router X
• X & Y will forward a packet to each other until the packet
is finally discarded due to TTL expiry
• With each routing update received from the other, X & Y
will update its distance metric until “infinity”. This is
called “Counting to Infinity” problem.
• Implementations of distance-vector routing protocols
define the “infinity” as a smaller number (E.g. 16) and
then the route is marked as “unreachable”.
Chapter 14
11
Figure 14.6
Chapter 14
Two-node instability
12
Techniques to minimize routing loops
• Split Horizon
– Essence of this technique: a router won’t advertise a
particular route to a neighbor, if that route was
originally learned from that neighbor
• Split Horizon with poisoned reverse
– Routes learned from a neighbor are marked with a
metric of “infinity” (poisoning the routes) when the
routing table is sent to the neighbor. It tells the
neighbor “I have learnt about these routes from you.
My paths to these networks are via you”.
Chapter 14
13
RIP - Routing Information Protocol
• A distance-vector intra-domain routing
protocol
• Two versions: V1 (RFC 1058); V2 (RFC
2453)
• UDP port 520 used for RIP messages
• “Distance” (or, the metric) used is “hop count”
- the number of links that have to be crossed
to reach the destination network
• “Infinity” is defined as 16.
Chapter 14
14
RIP V1
• When RIPv1 routers first come up, they send a RIP
announcement about their directly connected links
• Next, the router sends a RIP request, asking neighbors to
send their routing tables
• These two steps are used to build the routing table
Figure 14.9 RIP message format
Chapter 14
15
RIP V1
• Command (1 byte)
– RIP Request (1) or RIP Response (2)
• Version (1 byte)
– Indicates the RIP version
• Address Family Identifier (2 bytes)
– Defines the protocol family that is using RIP (2 for TCP/IP)
• Network Address (4 bytes)
– IP address of the destination network being advertised
• Distance (or, Metric) (4 bytes)
– Hop count from the advertising router to the destination
network
Chapter 14
16
RIP V2
• Enhancements in RIP V2 are: support of subnet masks,
basic authentication, and multicasting for routing
updates (instead of broadcasting)
Figure 14.13
Chapter 14
RIP version 2 format
17
RIP V2
• No new fields are added
• First entry of the message contains authentication info.
“Protocol Family” field is set to 0xFFFF to indicate that the entry
contains authentication info.
Figure 14.14
Chapter 14
Authentication
18
RIP V2
• Authentication Type (2 bytes)
– Currently defined Type value = 2
• Authentication Information (16 bytes)
– Contains a plain text password
– If the password is shorter than 16 bytes, it is left-justified and
padded with Hex.00’s on the right
• Route Tag (2 bytes)
– Indicates whether the route information that follows is an
internal route entry (received from within this routing area),
or an external routing entry (learned through another IGP or
EGP outside this routing area)
Chapter 14
19
RIPv2
• Network Address
– IP address of the destination network being advertised
• Subnet Mask
– Subnet mask associated with the destination network
address being advertised
• Next Hop
– IP address to which packets to the destination specified by
this route entry should be forwarded.
– 0.0.0.0 indicates that routing should be via the originator of
the RIP advertisement.
Chapter 14
20
Advantages and Drawbacks of RIP
• Simpler to understand and implement (compared to
OSPF, for example) and is suitable for small networks
• Not suitable for medium- to large-sized networks - can
take a long time to converge
• Use of “hop count” as metric, creates two problems:
– Limits the diameter of a RIP network to 15 router
hops
– Administrators cannot not use such factors as
bandwidth and/or delay as the routing metric
• Slow to flush unreachable destinations from the network,
going through the “counting to infinity” procedure
• Anyone can bring up a bogus RIP router, advertising
bogus routes to disrupt routing (even though there is
basic authentication in RIP v2)
Chapter 14
21
Link-State Routing Protocols
• Routers do not broadcast their entire routing tables.
• Each router “floods” its domain with Link State Packets
(LSPs) containing information about its directly
connected links:
– Periodically, with the period being much longer (in the
range of 1 - 2 hours) compared to distance-vector routing
protocols (period in the range of 30 sec.)
– When there is a change in topology of the domain
• Network convergence time is relatively shorter compared
to distance-vector routing protocols and therefore
scalable for large networks
Chapter 14
22
How flooding of LSPs work
• After a router prepares an LSP (containing info such as:
router identity, list of directly connected links, sequence
number & age of LSP), it is sent out of each interface
• When a router receives an LSP, if it is older than a copy
it already has, the newly received copy is discarded
• If the received LSP is newer:
– Discards any old copy and keeps the new one
– Sends a copy out of each interface except the one from
which the LSP was received
• After receiving LSPs from all other routers in the domain,
each router compiles the whole topology of the domain
Chapter 14
23
How the Routing Table is built
• From the topology information, using Dijkstra’s
algorithm, each router creates a shortest path tree,
with itself as the root.
• Shortest path tree of a router contains the shortest
path from itself to every other router in the routing
domain.
• Each router then constructs its routing table using the
info in shortest path tree.
Chapter 14
24
Figure 14.15
Chapter 14
Concept of link state routing
25
Figure 14.18
Chapter 14
Formation of shortest path tree by A
26
Table 14.1 Routing table for Router A
Chapter 14
27
Open Shortest Path First (OSPF)
• OSPF (Version 2, RFC 2328), is the most commonly used
intra-domain, link-state routing protocol in TCP/IP networks.
• OSPF runs directly over IP without using TCP or UDP.
• OSPF routing is based on configurable metrics based on
network bandwidth, delay or monetary cost. By default, the
metric used for route determination is based on network
bandwidth.
• OSPF routers send Hello packets on the directly connected
links to learn about their neighbors. By default, hello packets
are sent every 10 sec. This interval is configurable.
• A router learns about neighbors when it receives neighbors’
Hello packets in turn.
Chapter 14
28
Simplified version of how OSPF works
• Each router in the OSPF routing domain is responsible for
sending out Link State Advertisements (LSAs) to all other
routers using “flooding”.
• LSAs describe the sending router’s local part of the routing
domain. There are different types of LSAs. “Router-LSAs” (LS
Type = 1) includes the sending router’s set of directly
connected links, neighbors and the metrics.
• Taken together, the collection of LSAs generated by all of the
routers in a routing domain is called the “Link-State
Database”.
• Once all the routers have received other routers’ LSAs (i.e.,
when the routers are in a converged state), they all have the
same identical link-state database.
Chapter 14
29
Simplified version of how OSPF works
• Using link-state database as input, applying Dijkstra’s
algorithm, each router computes its routing table.
• When the network is in a steady state (i.e., no routers or links
are going in or out of service), the only OSPF routing traffic is
periodic Hello packets between neighboring OSPF routers and
the occasional refresh of pieces of the link-state database.
• Every 30 min, a router refloods the pieces of the link-state
database that it is responsible for, just in case those pieces
have been lost from or corrupted in one of the other routers’
databases.
• If an LSA has not been updated after an hour, the LSA is
assumed to be no longer valid and is removed from the
database.
Chapter 14
30
Areas and Area Border Routers
• OSPF divides an autonomous system (AS) into areas,
with each area given an Area ID
• An area is a collection of networks, hosts & routers
contained within an AS
• Each AS has a backbone area with an Area ID of 0 (can
be written as 0.0.0.0). Routers inside the backbone area
are called backbone routers.
• All other areas in the AS must be connected to the
backbone area and exchange routing info through Area 0.
• Ass are connected together using AS boundary routers.
Chapter 14
31
Figure 14.19
Chapter 14
Areas in an autonomous system
32
Path Vector Routing
• One (or, more) router(s) in an AS (called the speaker
node) acts on behalf of the entire AS in creating a
routing table and advertising it to speaker nodes in
the neighboring Ass.
• Similar to distance vector routing except that only
speaker nodes (i.e., routers) in each AS exchange
routing info with each other
• What is advertised is also different compared to
distance vector routing. A speaker node advertises
the path, and not the metric.
• At the beginning, each speaker node knows only the
reachability of nodes inside its AS.
Chapter 14
33
Figure 14.48
Chapter 14
Initial routing tables in path
vector routing
34
Path Vector Routing
• Similar to distance vector routing, a speaker in an AS
shares its routing table with immediate neighbors in
other ASs
• When a speaker node receives a table from a
neighbor, it updates its own table by adding the
nodes that are not in its routing table
• After a while, each speaker node knows how to reach
each node in other Ass.
Chapter 14
35
Figure 14.49
Chapter 14
Stabilized tables for four ASs
36
Border Gateway Protocol (BGP)
• BGP is an inter-domain routing protocol using path
vector routing
• Current version is BGP 4 (RFC 1771)
• BGP uses TCP as its transport protocol. A BGP
session is established between two BGP routers for
exchanging routing info.
• As a TCP connection created for BGP can last for a
long time, BGP sessions are sometimes referred to
as semi-permanent connections.
Chapter 14
37
External & Internal BGP
• BGP can have external or internal sessions
• External BGP (E-BGP) session is used to
exchange routing info between two speaker nodes
in two different ASs
• Internal BGP (I-BGP) session is used to exchange
routing info between two routers inside an AS
Chapter 14
38
Figure 14.50
Chapter 14
Internal and external BGP sessions
39
Figure 14.51
Types of BGP messages
• To create a neighborhood relationship, a BGP
router opens a TCP connection with a neighbor
and sends an Open message
Chapter 14
40
BGP Messages
• If the neighbor accepts the neighborhood
relationship, it responds with a keepalive message
• Update messages are used to announce new
routes to a destination or removing routes
• Notification messages are sent by a router when
an error condition is detected or to close a BGP
session.
Chapter 14
41