Routing Algorithms

Routing Algorithms
The purpose of a routing algorithm is simple; given a set of linked routers the algorithm finds a good path from the source to the destination. This usually means finding the cheapest route, but many networks have special rules, which makes the routing more difficult. Routing problems are usually represented as graphs, and thus graph theory is very applicable. Each edge of the graph has a value representing its cost; this cost would typically be the physical length of the link.

Classification
One classification of routing algorithms is whether they are global or decentralized'''. Global''' algorithms are based on having a total knowledge of the network, knowing all connections and all the costs of each link. When using a decentralized routing algorithm, the calculation is done iteratively with each node’s initial knowledge only being the cost of the directly attached links.

Another way of looking at it is if the algorithms are static or dynamic. Static algorithms involve slow-changing routes, usually because of human intervention. Dynamic routing algorithms however, change as traffic loads varies.

Lastly, routing algorithms can be divided into load-sensitive or load-insensitive algorithms. When an algorithm is load-sensitive, the link costs vary as a reflection of the congestion of the underlying link, whilst in load-insensitive algorithms this is not the case. Today’s Internet routing algorithms are load-insensitive.

The Link-State (LS) Routing Algorithm
Link-state algorithms are global algorithms, and thus all link costs are known at runtime. This is done by each node broadcasting link-state packages to all other nodes, with the contents of these packages being the identities and costs of its attached links. Each node uses this information to find the same set of least-cost paths.

A famous link-state routing algorithm is Dijkstra’s algorithm, which computes the least-cost path from one node to all other nodes in the network. The global routing algorithm consists of looping through the number of nodes in the network and ending up the shortest path from the source to every other node in the network. The complexity of this algorithm is $$O(n^2)$$ (complexity can be reduced by using a heap data structure).

Oscillations can occur in congestion-sensitive routing if first all source nodes find that the shortest path to the destination node is clockwise, and on the next LS run the clockwise path has no traffic, and then this would been the least-cost path, and all sources change to a counterclockwise path. This oscillates back and forth. An acceptable solution to this problem would be running the LS algorithm at different times on each source/router.

The Distance-Vector (DV) Routing Algorithm
Being a decentralized algorithm, the DV algorithm is iterative, asynchronous and distributed. It is distributed because each node receives some information directly from its attached neighbors, and distributes the results of the calculations performed back to the neighbors. I iterates until all information is exchanged. Since it does not need the nodes to operate in lockstep with each other, the algorithm is asynchronous. The DV algorithm is suitable for networks with a rapid topology changes and because of its distributed nature, has a lower complexity than the LS algorithm since it does not need to inform all nodes in the network of the changes made. The algorithm used for calculating the paths is the Bellman-Ford algorithm. It works by first waiting until a link cost change to a neighbor is changed or until it receives a distance vector from a neighbor. The distance vector is then updated for all destinations from the node to all nodes, and if the distance vector changes as a result of this update, the node sends its new distance vector to all neighbors. Updating of link costs, specifically increase in link costs, can lead to the count-to-infinity problem.

Comparison Between the LS Algorithm and the DV Algorithm
The message complexity of LS is worse than of DV, this is because LS needs to send the cost of each link to all nodes and DV only communicates with its neighbors and only if the distance vector changes. This being said, DV can converge slowly and suffer from routing loops, in addition to suffering from the count-to-infinity problem.

When it comes to robustness, the LS seem to way to go. The reason for this is that given for example a router sabotage, LS will only broadcast changes from one node, as where DV would iteratively change all the distance vectors of all the other nodes.

Hierarchical Routing (Autonomous systems)
Problems with scaling and administrative authority are solved by defining autonomous systems (ASs). Within an AS, all routers run the same intra-AS routing protocol. The problems of scale are solved because intra-AS routers only need to know about routers within the same AS. Administrative authority is solved by each organization being able to run whatever intra-AS routing protocol it chooses.