1) Link State Route selection protocol
Introduction: If you are now in the sand along the river for the first time to go to the company near the ancient swing to report, you do not know the specific way to go, then how to do?
We know you can download a navigation in the phone (router router), after entering the destination, the navigation will be in his various areas of the map table (routing table) to select the best path to plan the line. So, the navigation to achieve this goal, first it must have the next sand along the 6th Street (direct links link) information, the Xiasha road is not in the building subway, block traffic jams (link state), to the gate after the opening how to turn (directly connected to the neighbor information), After the Burgundy road is to the stadium road or the North Ring road (the next Hop link information), until the destination; This information is aggregated and stored in the map database (link state database) to be able to calculate (SPF algorithm) based on these information and select the optimal path to reach the destination as fast as possible.
Summary: If the information used by the distance vector router is likened to the information provided by the Signpost, then the link state routing protocol is like a road map. In the network of link state routing protocol, each router will have its own, direct link, direct-connected neighbor, link state information, from one router to another router, each router will make a copy of the information without changing the information content In the end, each router can compute its own optimal path independently of this information.
The link state protocol (shortest Path precedence protocol) has the following types:
- IP Open Shortest Path First (OSPF);
- CLNS or IP ISO intermediate system to intermediate system (IS-IS);
- The DNA phase of Dec 5;
- Novell's NetWare Link Service protocol;
Setup steps:
- A relationship is established between each router and its neighbors (adjacency relationship);
- Each router sends a link state advertisement (LSA: A cost measure that identifies the link, link state, routed interface to the router, and all its neighbors) to each neighbor, and each neighbor forwards (floods) these notices to its neighbor once it receives the LSA;
- Each router keeps a copy of the LSA backup it receives in the database, and works in the normal state, all the routers have the same database;
- The Complete Topology library (link state database), the SPF algorithm calculates the shortest path for each router on the network graph, and then the link state Protocol queries the link state database to find the subnets connected to each router and input the information into the routing table;
Neighbor:
In the process of establishing a link-state environment, the router establishes the adjacency relationship through the Hello Protocol (Hello Protocol) and monitors the survival of the neighbor (neighboring relationship). The typical Hello packet exchange interval is 10S, and the typical death cycle is 4 times times the packet switching interval.
Link-State flooding:
After the adjacency relationship is established, the router begins sending the LSA. The notification is sent to each neighbor, and the router saves the received LSA and forwards it to each neighbor in turn. And for the distance vector must run the algorithm and update its own route table before sending the route update, even for triggering the router, so when the topology changes, the link state routing protocol converges much faster than the distance vector protocol.
Serial number:
When all the routers in the topology receive all the LSA, the flooding must stop; To solve this problem, a serial number is generated when the router triggers the sending of an LSA, and the sequence number is not changed during flooding and is saved in the router's topology database along with the other LSA information. When the router receives an LSA that already exists in the database and the serial number is the same, the router discards the information. If the information is the same but the serial number is larger, the received information and the new serial number are saved to the database, and flooding spreads the LSA. In summary, when all routers receive the latest LSA copy, flooding will stop.
Note: For more description and calculation of the serial number space, refer to the TCP/IP Routing Technology (Volume I) "p121 content.
Aging (Aging ):
The LSA format contains a field that is used to advertise age. When the LSA is created, the router sets the field to 0, and as the packet spreads, the age segment in the advertisement is incremented for each router.
The aging process adds a layer of reliability to the flood diffusion process, which defines a maximum age gap for the network (MAXAGEDIFF). The router may receive multiple copies of an LSA, where the serial number is the same, the age is different, if the age gap is less than maxagediff, it is considered due to the network's normal delay caused by the age difference, so the database retains the original LSA, the newly received LSA is not spread If the age difference exceeds Maxagediff, then the network is considered to be abnormal, in which case the newer LSA is logged and the packet is spread out. The Maxagediff of OSPF is 15 minutes.
If the LSA resides in the database, the age of the LSA continues to increase. If the age of the link state record increases to a maximum age value (MAXAGE)----defined by a particular routing protocol----then a MaxAge-worthy LSA is flooded to all neighbors, and the neighbor deletes the related record from the database.
When the age of the LSA reaches MaxAge, the link-State refresh timer (Lsrefeshtime) periodically confirms the LSA and resets the timer before reaching the maximum age.
OSPF defines a maxage of 1 hours and a lsrefeshtime of 30 minutes.
Link State database:
All valid LSA in a router is stored in its link state database, and the correct LSA can describe the structure of an OSPF area network topology.
SPF algorithm:
E. W. Explanation of SPF Algorithm for Dijkstra originals:
Constructing a tree "a ", so that n the smallest total length between nodes ( the tree is a graph with only one path between each two nodes) .
In the tectonic process we give, the branches are divided into 3 A collection:
I . branches that are explicitly assigned to the tree in the structure (they will be in the subtree);
I i . The branch next to the branch is added to the set I;
I i i . remaining branches (discarded or not considered);
A node is divided into two sets:
be set I The points in which the branches are connected;
remaining nodes (set I i and only one of the branches will point to each of these nodes).
let's start by constructing a tree, selecting any one node as the set a and put all the branches that get this node into the set I I the. The start set I is empty. Then we repeat the next two steps.
Step 1 : Set I i The shortest branches are removed and added to the set I . As a result, a node is transferred from collection B to collection a.
Step 2 : Consider from this node (just being transferred to set a the node in the set) leads to collection B the branch of the middle node. If the branch in the build is longer than the corresponding branch of the set I I , then the branch is discarded, otherwise, it is substituted for the corresponding branch in I I , and the latter is discarded.
then we go back to the first step and repeat the process until the set I I and set B is empty. the branches in the set I form the required tree.
With the router algorithm, the above is divided into 3 sets:i, I i, I I i;
- Tree Database (collection I ) : by adding a branch to the database to add a link (branch) to the shortest path tree, when the algorithm completes, the information in this database can describe all the shortest path tree from the root neighbor router;
- candidate Object Database (collection I i ): Copy the link from the link-state database to the list as a candidate for addition to the tree database by rule;
- link State database (collection I i I ): This preserves all the unchecked links advertised by the LSA;
Router SPF the steps of the algorithm:
Step 1: The router initializes the tree database and takes itself as the root of the tree, indicating that the router as its own neighbor costs 0;
Step 2: In the link state database, all ternary groups (Router ID, neighbor ID, cost) that describe the link to the root router neighbor are added to the candidate database;
Step 3: Calculate the cost from the root to each link, the least expensive link in the candidate database is moved to the tree database, if there are multiple links from the root of the shortest cost is the same, select one of them;
Step 4: Check the neighbor ID that is added to the tree database. In addition to the ternary groups in the tree database where the neighbor ID already exists, the ternary group describing the routing neighbor in the link state database is added to the candidate database;
Step 5: If the candidate database has remaining table entries, go back to step 3rd. If the candidate database is empty, then the algorithm terminates. At the end of the algorithm, in the tree database, each single Neighbor ID table entry will represent 1 routers, and the shortest path tree is constructed.
Figure 1.4.5
Note: The link cost is calculated according to the outbound interface direction, and the cost of all interfaces within a network is not necessarily identical;
Table 1.4.6: Link state database as shown in Figure 1.4.5
Router ID |
Neighbor ID |
Price |
R1 |
R2 |
2 |
R1 |
R4 |
4 |
R1 |
R5 |
4 |
R2 |
R1 |
2 |
R2 |
R5 |
10 |
R2 |
R3 |
1 |
R3 |
R2 |
5 |
R3 |
R6 |
2 |
R4 |
R1 |
4 |
R4 |
R5 |
3 |
R4 |
R7 |
5 |
R5 |
R1 |
5 |
R5 |
R2 |
2 |
R5 |
R4 |
3 |
R5 |
R6 |
2 |
R5 |
R7 |
1 |
R5 |
R8 |
8 |
R6 |
R3 |
2 |
R6 |
R5 |
2 |
R6 |
R8 |
4 |
R7 |
R4 |
5 |
R7 |
R5 |
1 |
R8 |
R5 |
8 |
R8 |
R6 |
6 |
Table 1.4.7: SPF algorithm for the database of table 1.4.6
r1 r1 0
r1 r2 2
r2 r3 1
Candidate objects |
To the root cost |
Tree Database |
Describe |
|
|
r1,r1,0 |
Router R1 himself as the root of the tree |
R1 R2 2 R1 R4 4 R1 R5 4 |
2 4 4 |
r1,r1,0 |
Links to all R1 neighbors are added to the list of candidate objects |
R1 R4 4 R1 R5 4 R2 R5 10 R2 R3 1 |
4 4 12 3 |
R1 R1 0 R1 R2 2 |
R1 R2 2 is the least expensive link in all candidate lists added to the tree, all R2 neighbors except those already in the tree are added to the candidate list, R1 R5 4 to R5 is less expensive than R2 R5 10, so drop R2 R5 in the candidate list 10 |
| r1 r4 4 r1 R5 4 r3 r6 2 |
4 4 | TD valign= "Top" width= "94" >
r2 r3 1 is the smallest in the candidate list and is added to the tree, so R3 's neighbors will become candidates except those that are already in the tree |
| r1 r5 4 r3 r6 2 R4 r5 3 r4 r7 5 |
4 5 7 9 |
r1 r1 0 R1 r2 2 r2 r3 1 r1 r4 4 |
R1 R4 4 and R1 R5 4 the cost to R1 is 4,R3 R6 2 the cost is 5;R1 R4 4 is added to the tree, and its neighbors become candidates; from R1 in the candidate list R4 R5 3 is discarded because of higher cost |
| r3 r6 2 r4 r7 5 R5 r6 2 r5 r7 1 r5 r8 8 |
5 9 6 5 |
r1 r1 0 r1 r2 2 r2 r3 1 r1 r4 4 r1 R5 4 |
R1 R5 1 are added to tree species, and all R5 neighbors that are not in the tree are added to the candidate list. The most costly link to the R7 is discarded. |
| r5 r6 2 r5 r7 1 r5 r8 8 r6& nbsp r8 4 |
6 5 9 |
r1 r1 0 r1 r2 2 R2 r3 1 r1 r4 4 r1 r5 4 r3 r6 2 |
r3 r6 2 are added to tree species and its neighbors are added to the candidate list. Since the cost of R5 R7 1 is the same as triggering from R1 (5), use R5 R7 1 instead, to R7 the higher cost of being discarded |
| r6 r8 4 |
|
r1 r1 0 r1 r2 2 r2 r3 1 r1 r4 4 r1 r5 4 r3 r6 2 r5 r7 1 |
r5 r7 1 are added to tree species. R7 all neighbors are in the tree, so no objects are added to the candidate list |
|
|
R1 R1 0 R1 R2 2 R2 R3 1 R1 R4 4 R1 R5 4 R3 R6 2 R5 R7 1 R6 R8 4 |
R6 R8 4 is the least expensive link in the candidate list, so it is added to the tree and the candidate list no longer has candidates, so the algorithm terminates. The shortest path tree is constructed. |
Regional:
A zone is a subset of the routers that make up a network. Dividing the network into zones is a measure of the 3 consequences of the Link-State protocol:
- The necessary database requires more memory than the distance vector protocol.
- The complex algorithm requires more CPU time than the distance vector protocol.
- Link-State flood-diffusion packets have a negative impact on available bandwidth, especially in unstable networks;
When a network is divided into multiple regions, routers in one region only need to diffuse LSA in the region, so only the link state database of the region is maintained. The smaller the database, the smaller the required memory, and the smaller the CPU cycles required to run the SPF algorithm. If the topology changes frequently, the resulting diffusion will also be confined to the unstable region.
Zone Border Router: A router that connects two zones, which belongs to the two zones connected, and must maintain its own topology database for each zone.
Dynamic routing 3--link state routing protocol