layer 3 routing protocols - rab nawaz jadoon · 2013-12-09 · department of computer science 3...
TRANSCRIPT
Department of Computer Science
DCS
COMSATS Institute of Information Technology
Layer 3 Routing Protocols
Rab Nawaz JadoonAssistant Professor
COMSATS IIT, Abbottabad
Pakistan
Telecom Network Design
Department of Computer Science 2
Network Layer
Department of Computer Science 3
Routing
Delivery
Delivery refers to the way a packet is handled by the underlying networks under the control of the network layer.
Forwarding
Forwarding refers to the way a packet is delivered to the next station.
Routing
Routing refers to the way routing tables are created to help in forwarding.
Department of Computer Science 4
Routing
Direct and indirect delivery
Direct Delivery Indirect and Direct Delivery
Department of Computer Science 5
Routing at Network Layer
Forwarding Forwarding requires a host or a router to have a
routing table.
When a host has a packet to send or when a router has received a packet to be forwarded, it looks at this table to find the route to the final destination.
Forwarding Techniques Several techniques can make the size of the routing
table manageable, Next-Hop Method vs Route Method
Network-Specific vs Host specific method
Department of Computer Science 6
Routing at Network Layer
Department of Computer Science 7
Routing at Network Layer
Host-specific versus network-specific method
Department of Computer Science 8
Routing at Network Layer
Default Method
Host A is connected to a network with two routers.
Router R1 routes the packets to hosts connected to network N2.
So instead of listing all networks in the entire Internet, host A can just have one entry called the default
Department of Computer Science 9
Routing at Network Layer
Routing Table
Static Routing Table
(A static routing table contains information entered manually)
Dynamic Routing Table
A dynamic routing table is updated periodically by using one of the dynamic routing protocols such as RIP, OSPF, or BGP.
Automatic updating of routing tables.
Department of Computer Science 10
Unicast routing protocols
Routing tables need to be updated when a router is down, and they need to be updated whenever a better route has been found. Routing protocols have been created in response to
the demand for dynamic routing tables.
A routing protocol is a combination of rules and procedures that lets routers in the internet inform each other of changes.
It allows routers to share whatever they know about the internet or their neighborhood.
The routing protocols also include procedures for combining information received from other routers.
Department of Computer Science 11
Routing at Network Layer
Optimization
A router is usually attached to several networks.
When it receives a packet, to which network should it pass the packet?
The decision is based on optimization: optimum route selection.
One approach is to assign a cost for passing through a network, called metric.
The metric assigned to each network depends on the type of protocol.
Department of Computer Science 12
Routing
Intra- and Interdomain Routing
Today, an internet can be so large that one routing protocol cannot handle the task of updating the routing tables of all routers.
For this reason, an internet is divided into autonomous systems (AS).
An autonomous system (AS) is a group of networks and routers under the authority of a single administration.
Department of Computer Science 13
Routing at Network Layer
Intradomain
Routing inside an autonomous system is referred to as intradomain routing.
Interdomain
Routing between autonomous systems is referred to as interdomain routing.
Department of Computer Science 14
Autonomous system
Department of Computer Science 15
Routing Protocols
Popular routing protocols
Department of Computer Science 16
Distance Vector Routing
Distance Vector Routing
In distance vector routing, the least-cost route between any two nodes is the route with minimum distance.
Each node maintains a vector (table) of minimum distances to every node.
Routing tables maintains the next hop entry to forward the packet.
Department of Computer Science 17
Distance Vector Routing
----C
---A-
-AA-A
---A-
C--C-
Department of Computer Science 18
Distance Vector Routing
In distance vector routing, each node shares its routing table with its immediate neighbors periodically and when there is a change.
Initialization
Department of Computer Science 19
Distance Vector Routing
Table Updating
Department of Computer Science 20
Distance Vector Routing
When to Share?
Periodic Update
A node sends its routing table, normally every 30 s, in a periodic update.
Triggered Update
Anytime there is a change in its routing table.
Department of Computer Science 21
Distance Vector Routing
Two-Node Loop Instability
X 6 AX-6-AX-2-
X-6-AX-ὲ-
X-10-A X-6-A
X-10-A X-14-A
X-ὲ- X-ὲ-
Department of Computer Science 22
Distance Vector Routing
Some solution
Defining infinity
Split Horizon
Split Horizon and Poison Reverse
Department of Computer Science 23
RIP
RIP (Routing Information Protocol)
An Interdomain routing protocol used inside an autonomous system.
Based on distance vector routing.
RIP implements distance vector routing directly with some consideration
In an autonomous system, we are dealing with routers and networks (links). The routers have routing tables; networks do not.
The destination in a routing table is a network, which means the first column defines a network address.
Department of Computer Science 24
RIP
The metric in RIP is called a hop count.
Infinity is defined as 16, which means that any route in an autonomous system using RIP cannot have more than 15 hops.
The next-node column defines the address of the router to which the packet is to be sent to reach its destination.
Department of Computer Science 25
RIP
Example of a domain using RIP
Department of Computer Science 26
Link State Routing
In link state routing, each node in the domain has the entire topology of the domain. The node can use Dijkstra's algorithm to build a
routing table.
Department of Computer Science 27
Link State Routing
Each node uses the same topology to create a routing table, but the routing table for each node is unique because the calculations are based on different interpretations of the topology.
This is analogous to a city map.
Each person may have the same map, each needs to take a different route to reach her specific destination.
Department of Computer Science 28
Link State Routing
If there are changes in any point in the network, The topology must be updated for each node.
Building Routing Tables In link state routing, four sets of actions are required
Routing table showing the least-cost node to every other node. Creation of the link state packet (LSP).
Flooding of LSPs
Formation of a shortest path tree for each node.
Calculation of a routing table based on the shortest path tree.
Department of Computer Science 29
Link State Routing
LSPs are generated on two occasions:
When there is a change in the topology of the domain.
On a periodic basis.
The period is much longer than Distance vector.
Flooding of LSPs
The creating node sends a copy of the LSP out of each interface.
Older LSPs are discarded, new are kept. This is done through sequence numbers included in LSP.
Flood the information out of each interface except the one from which the packet arrives.
This ensures that flooding stop somewhere in domain.
Department of Computer Science 30
Link State Routing
Formation of Shortest Path Tree: Dijkstra Algorithm
After receiving all LSPs, each node will have a copy of the whole topology.
A shortest path tree is needed.
A tree is a graph of nodes and links; one node is called the root.
A shortest path tree is a tree in which the path between the root and every other node is the shortest.
Department of Computer Science 31
Link State Routing
Department of Computer Science 32
Link State Routing
Calculation of Routing Table from Shortest Path Tree
Each node uses the shortest path tree protocol to construct its routing table.
The routing table shows the cost of reaching each node from the root.
Department of Computer Science 33
OSPF
Open shortest Path First An intradomain routing protocol based on link state
routing.
Areas An area is a collection of networks, hosts, and routers all
contained within an autonomous system.
An autonomous system can be divided into many different areas.
Routers inside an area flood the area with routing information.
At the border of an area, special routers called area border routers summarize the information about the area and send it to other areas.
Department of Computer Science 34
OSPF
Among the areas inside an autonomous system is a special area called the backbone;
All the areas inside an autonomous system must be connected to the backbone.
the backbone serves as a primary area.
The routers inside the backbone are called the backbone routers.
A backbone router can also be an area border router.
Each area has an area identification.
The area identification of the backbone is zero.
Department of Computer Science 35
OSPF
Area in Autonomous system
Department of Computer Science 36
OSPF
Metric The OSPF protocol allows the administrator to assign
a cost, called the metric, to each route.
The metric can be based on a type of service (minimum delay, maximum throughput, and so on).
Types of Links In OSPF terminology, a connection is called a link.
Four types of links, Point to point
Transient
Stub
virtual
Department of Computer Science 37
OSPF
Point to point link
4 4
Transient link
A
C
B
E D
Department of Computer Science 38
OSPF
If we want to show the neighborhood of previous figure the relationship in this situation,
A
C
B
E
D
Unrealistic representation
Department of Computer Science 39
OSPF
Realistic representation
A
C
B
E
D
Designated Router
Department of Computer Science 40
OSPF
Stub link
A stub link is a network that is connected to only one router.
The data packets enter the network through this single router and leave the network through this same router.
This is a special case of the transient network. We can show this situation using the router as a node and using the designated router for the network.
Department of Computer Science 41
OSPF
Virtual Link
When the link between two routers is broken, the administration may create a virtual link between them, using a longer path that probably goes through several routers.
Department of Computer Science
Choosing Between Distance-Vector and Link-State Protocols
According to Cisco design documents, you can use the following guidelines to help you decide which type of routing protocol to deploy?
Choose distance-vector protocols when
The network uses a simple, flat topology and does not require a hierarchical design.
The network uses a simple hub-and-spoke topology.
The administrators do not have enough knowledge to operate and troubleshoot link state protocols.
Worst-case convergence times in the network are not a concern.
42
Department of Computer Science
Cont…
Choose link-state protocols when
The network design is hierarchical, which is usually the case for large networks.
The administrators are knowledgeable about the selected link-state protocol.
Fast convergence of the network is crucial.
43
Department of Computer Science 44
Interdomain Routing
Path Vector Routing
In path vector routing, we assume that there is one node called speaker node in each autonomous system that acts on behalf of the entire autonomous system.
The speaker node in an AS creates a routing table and advertises it to speaker nodes in the neighboring ASs.
The idea is the same as for distance vector routing except that only speaker nodes in each AS can communicate with each other.
Department of Computer Science 45
Path Vector Routing
The advertisement is also different in this case,
A speaker node advertises the path, not the metric of the nodes, in its autonomous system or other autonomous systems.
Initialization
At the beginning, each speaker node can know only the reachability of nodes inside its autonomous system.
Department of Computer Science 46
Path Vector Routing
Initial routing tables in path vector routing
Speaker NodeA1 for AS1B1 for AS2C1 for AS3D1 for As4
Department of Computer Science 47
Path Vector Routing
Sharing In path vector routing, a speaker in an autonomous
system shares its table with immediate neighbors.
When a speaker node receives a two-column table from a neighbor, it updates its own table by adding the nodes that are not in its routing table and adding its own autonomous system and the autonomous system that sent the table.
According to the figure, if router A1 receives a packet for nodes A3, it knows that the path is in AS1 (the packet is at home);
But if it receives a packet for D1, it knows that the packet should go from AS 1, to AS2, and then to AS3.
Department of Computer Science 48
Path Vector Routing
Stabilized tables for three autonomous systems
Department of Computer Science 49
BGP
Border Gateway Protocol
Border Gateway Protocol (BGP) is an interdomainrouting protocol using path vector routing.
It first appeared in 1989 and has gone through four versions.
We can divide autonomous systems into three categories:
Stub
Multihomed
Transit.
Department of Computer Science 50
BGP
Stub AS A stub AS has only one connection to another AS.
Multihomed AS. A multihomed AS has more than one connection to
other Ass.
It does not allow data coming from one AS and going to another AS to pass through.
It does not allow transient traffic.
Transient AS A transit AS is a multihomed AS that also allows
transient traffic.
E.g. national and international ISPs (Internet backbones).
Department of Computer Science 51
BGP Session
External and Internal BGP
BGP can have two types of sessions:
External BGP (E-BGP)
The E-BGP session is used to exchange information between two speaker nodes belonging to two different autonomous systems.
Internal BGP (I-BGP)
It is used to exchange routing information between two routers inside an autonomous system.
A1B1AS1 AS2
--- I-BGPE-BGP
Department of Computer Science 52
Department of Computer Science
Switch
A switch refers to a device that operates at Layers 1 and 2 of the OSI reference model.
The term switch does have a more generic meaning, though.
Switching means to move something to a different position.
An internetworking device moves data that comes in one interface to a different interface.
A switch permits or interrupts the flow of data and, although it doesn’t turn a locomotive, it does turn bits, frames, and packets.
53
Department of Computer Science
Switch vs bridge
Switches take advantage of fast integrated circuits to offer low latency.
Bridges were much slower than switches and had fewer ports and a higher cost per port.
For these reasons, switches have replaced bridges these days.
Switches have the capability to do store-and-forward processing or cut-through processing.
A disadvantage with cut-through processing is that it forwards illegal frames (for example, Ethernet runts) and frames with CRC errors.
54
Department of Computer Science
Cont…
On a network that is prone to runts and errors, cut-through processing should not be used.
Some switches have the capability to automatically move from cut-through mode to store-and-forward mode when an error threshold is reached.
This feature is called adaptive cut-through switching by some vendors.
A switch also supports parallel forwarding, whereas bridges usually do not.
55
Department of Computer Science
Cont…
There is only one forwarding path in a bridge.
A switch, on the other hand, allows multiple, parallel forwarding paths, which means a switch can handle a high volume of traffic more quickly than a bridge.
56
Department of Computer Science 57