3.3.c Compare routing protocol types

3.3.c [ii] Link state

Djikstra:

in his own words…

Construct [a] tree of minimum total length between the n nodes. (The tree is a graph with one and only one path between every two nodes.)
In the course of the construction that we present here, the branches are divided into three sets:
I. the branches definitely assigned to the tree under construction (they will be in a subtree);
II. the branches from which the next branch to be added to set I, will be selected;
III. the remaining branches (rejected or not considered).
The nodes are divided into two sets:
A. the nodes connected by the branches of set I,
B. the remaining nodes (one and only one branch of set II will lead to each of these nodes).

We start the construction by choosing an arbitrary node as the only member of set A, and by placing all branches that end in this node in set II. To start with, set I is empty. From then onwards we perform the following two steps repeatedly.
Step 1: The shortest branch of set II is removed from this set and added to set I. As a result, one node is transferred from set B to set A.
Step 2: Consider the branches leading from the node, which has just been transferred to set A, to the nodes that are still in set B. If the branch under construction is longer than the corresponding branch in set II, it is rejected; if it is shorter, it replaces the corresponding branch in set II, and the latter is rejected.
We then return to step 1 and repeat the process until sets II and B are empty. The branches in set I form the tree required.

doyle’s take on it:

1 A router initializes the Tree database by adding itself as the root. This entry shows the
router as its own neighbor, with a cost of 0.
2 All triples in the link state database describing links to the root router’s neighbors are
added to the Candidate database.
3 The cost from the root to each link in the Candidate database is calculated. The link
in the Candidate database with the lowest cost is moved to the Tree database. If two
or more links are an equally low cost from the root, choose one.
4 The Neighbor ID of the link just added to the Tree database is examined. With the
exception of any triple whose Neighbor ID is already in the Tree database, triples in the
link state database describing that router’s neighbors are added to the Candidate database.
5 If entries remain in the Candidate database, return to step 3. If the Candidate database is
empty, terminate the algorithm. At termination, a single Neighbor ID entry in the Tree
database should represent every router, and the shortest path tree is complete.