Week 3 - Intradomain routing

Important Readings

Experience in Black-box OSPF Measurements
http://conferences.sigcomm.org/imc/2001/imw2001-papers/82.pdfLinks to an external site.

Book References

If you have access to the Kurose-Ross book and the Peterson book, you can find the list of chapters discussed in this lecture. As mentioned in the course schedule, purchasing the books is not required.

  • Kurose-Ross (6e)

    • 4.5.1:The Link-State (LS) Routing Algorithm
    • 4.5.2: The Distance- Vector (DV) Routing Algorithm
    • 4.6.1: Intra-AS Routing in the Internet: RIP
    • 4.6.2: Intra-AS Routing in the Internet: OSPF
  • Kurose-Ross (7e)

    • 5.2.1The Link-State (LS) Routing Algorithm
    • 5.2.2: The Distance- Vector (DV) Routing Algorithm
    • 5.3: Intra-AS Routing in the Internet: OSPF
  • Kurose-Ross (8e)

    • 5.2.1: The Link-State (LS) Routing Algorithm
    • 5.2.2: The Distance- Vector (DV) Routing Algorithm
    • 5.3: Intra-AS Routing in the Internet: OSPF

Optional Readings

Hot Potatoes Heat Up BGP Routing
https://www.cs.princeton.edu/~jrex/papers/hotpotato.pdfLinks to an external site.

Traffic Engineering With Traditional IP Routing Protocols
https://www.cs.princeton.edu/~jrex/teaching/spring2005/reading/fortz02.pdfLinks to an external site.

Dynamics of Hot-Potato Routing in IP Networks
https://www.cs.princeton.edu/~jrex/papers/sigmetrics04.pdfLinks to an external site.

OSPF Monitoring: Architecture, Design and Deployment Experience
https://www.cs.princeton.edu/~jrex/teaching/spring2005/reading/shaikh04.pdfLinks to an external site.

Routing

Routing

Routing

The process of routing is getting a packet the network associated to its IP address. To do this all routers store a routing table which maps the tuple of an IP address and a network mask to either a interface or a IP address.

There are two types of routing Intradomain routing, how routers exchange information within the same Autonomous system (AS), and interdomain routing how routes get shared between Autonomous system (AS).

There are 3 ways a router can populate its routing table

  1. Directly connected: This is for networks directly connected to the router. It adds an entry for that networks and the interface of the router it is connected to.
  2. Static route: This is a route that has been manually configured on a router. Instead of an interface it will have an IP address to forward that packet on to.
  3. Dynamic routing: This is the same in structure to the static rout but instead of being manually added this gets populated by routers sharing known addresses with one another.

This table might grow very large but routers use route summarization to keep the tables shorter.

Once a router has been configured when it receives a packet it looks at its layer 3 header containing the destination IP address. It compares that again the known address, using the network mask and finds the most precise match (matching on the longest network mask) then forwards it to that interface or IP address.

Link to original

Intradomain routing

Intradomain routing

Intradomain routing is the process of routers within an AS discovering their router table. The main class of protocols used here are Interior gateway protocol (IGP).

Link to original

Interdomain routing

Interdomain routing

This is the process of routing between Autonomous system (AS). Here there is a lot of commercial pressure on the decision of which routes to offer. The protocols that are used for this are called Boarder gateway protocol (BGP).

Link to original

Intradomain routing

Here are two main algorithms, these use two different approaches to how route packets.

Link-state routing algorithms

Link-state routing algorithms

Link-state algorithms are used for intradomain routing. These use knowledge of the whole network - including topology and weights - to perform Dijkstra’s algorithm on the network to find the shortest path to every node. This gives us where to route packets to. The computational complexity of this is where is the size of the network.

Link to original

Distance vector routing algorithms

Distance vector routing algorithms

Distance vector routing is a distributed routing algorithm. It uses the Bellman-Ford algorithm but in a distributed manner.

For this was assume all routers know the routers they are directly connected to - within a network they have an interface to. They also know the network cost of communicating with their neighbours.

Each router maintains a table with all routers within their AS to each they associate, that routers best guess at the distance to the router, and which neighbour router they need to send any packets to to achieve that best guess.

Then all the routers broadcast this information to its neighbours and use their neighbours broadcasts to update their own tables. They update their tables using the Bellman-Ford equation.

This has a Count to infinity problem where if the distance of a connection is increased dramatically or it is removed then two neighbours might keep thinking the fastest rout is via one another as there distances and dependent on that edge not being changed. This causes a very slow convergence to the real path. We can improve the algorithm to account for this however this algorithm will still be vulnerable to this with large graphs.

This has the pseudocode as below.

Pseudocode

Let us have an AS which is represented by an undirected graph where each of are routers and an edge indicates they have a common network that belongs to their interfaces. Suppose this has a distance metric associated to it . Then we describe an algorithm for a particular vertex who has neighbours . This will build two maps - current best guess of the shortest distance and

 
-- Initalisation
Set map D(v) = inf, S(y) = - for all v in V.
Set D(x) = 0
Set D(n) = d(x,n), S(n) = n for n in N_x
Send D to all members of N_x.
 
-- Recieve a message
Suppose we get D' from y in N_x
For every v in V where S(v) = y:
	# Can not use min here incase the distance has increased due 
	# to network changes
	Set D(v) = d(x,y) + D'(v)
For every v in V where S(v) /= y:
	Set D(v) = min(D(v), d(x,y) + D'(v))
	Update S(v) = y if D(v) decreased
 
If any value of D changes:
	# Handle to count to infinity problem
	For each n in N_x:
		Let D' be a copy of D
		For each v in V where S(v) = n:
			Set D'(v) = inf
		Send D' to n
Link to original

Count to infinity problem

Count to infinity problem

This is a problem within the Distance vector routing algorithms caused by a change in the underlying graph or its distances. This causes very slow convergence to the correct intradomain distances as nodes all believe sending messages to one another using the old distances is the shortest path.

Example

Suppose we have an AS with 3 routers which are all connected to one another with initial distances and then we have the following shortest path tables.

D(r,c)xyz
x011
y102
z120

The suppose the edge breaks. If the Distance vector routing algorithms don’t take this problem into account then we get a slow escalation of distance.

Router requests its neighbour distances it updates and broadcasts this. Then updates its distances and broadcasts this. Then the problem goes on.

Avoidance

To get around this we track who we are planning on sending the update two to achieve the current minimum distance. If that is the same as the person we broadcast to then we set that distance to infinity. This method is called Poison reverse.

Whilst this solves the simple cases like above - it is easy to imagine chains for routers having this exact problem without being able to realise it.

Link to original

Routing Information Protocol (RIP)

Routing Information Protocol (RIP)

This is one of the first protocols that implemented Distance vector routing algorithms. For the distance metric it just used the number of different routers it would have to go through. The messages each router sends are the routing table with each subnet, the next router it would go through and the distance to that network in terms of “hops”. This table is refereed to as the RIP table. Later iterations of RIP use address aggregation. To maintain connection with their neighbours they use a UDP message on port 520 if they don’t hear from neighbours every 180 seconds they will assume they are no longer available and change the RIP table then broadcast it to its neighbours. This algorithms has challenges with updating routes and the time that takes to converge due to the count to infinity problem.

Link to original

Open Shortest Path First (OSPF)

Open Shortest Path First (OSPF)

The OSPF protocol is a intradomain routing algorithm suggested as an improvement on RIP for ISP. This is a link-state algorithm that uses hierarchy to do route summarization. It operates over one autonomous system.

In OSPF a single router is selected as the backbone router this is where all AS externally facing routers connect to.

Routers withing the AS broadcast Link state advertisements (LSA) which include that routers neighbours. This is circulated to the whole network and is repeated at a set interval (normally 30 minutes). Then every router using itself as the root uses Dijkstra’s algorithm to find the shortest path between itself and every other subnet.

Link to original

When using OSPF the computation is handled by the router processor as apposed to the switching fabric which handles message forwarding.

The process the router goes through is:

  1. Collect LSA’s from other routers.
  2. Use Dijkstra’s algorithm to calculate new shortest paths and update Forwarding information base (FIB)
  3. Forward messages using the switching fabric

This can be summarised by the following flow chart.

Hot potato routing

Hot Potato Routing

This is the term used when deciding between two external egress routes to the Autonomous system (AS). Routes use he external egress that has the shortest intradomain routing distance.

Link to original

Traffic Engineering

The process of deciding the weights between routers can be complicated as small changes in weights can have a large impact to the traffic flow. There is a framework for this.

Traffic Engineering Framework

Traffic Engineering Framework

This framework can help network operators decide distances between routers within an autonomous system for intradomain routing. This uses the following steps

  1. Measure: Observe how the network flow is happening at the moment. This involves looking at the current set of shortest paths and the capacity of each of the links.
  2. Model: Predict how a change in weights would effect the these paths and capacities on the wires.
  3. Control: Update the weights of the routers and go back to the first step to check your model was correct.
Link to original