CN110752991A - Method for selecting shortest path of dynamic route - Google Patents
Method for selecting shortest path of dynamic route Download PDFInfo
- Publication number
- CN110752991A CN110752991A CN201911021848.1A CN201911021848A CN110752991A CN 110752991 A CN110752991 A CN 110752991A CN 201911021848 A CN201911021848 A CN 201911021848A CN 110752991 A CN110752991 A CN 110752991A
- Authority
- CN
- China
- Prior art keywords
- router
- information
- route
- shortest path
- packet
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/02—Topology update or discovery
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/12—Shortest path evaluation
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides a method for selecting the shortest path of a dynamic route, which updates the route information in real time through the dynamic update of the route, and then calculates the shortest path from pc to each router by executing Dijkstra algorithm; the steps of the dynamic update of the route are realized as follows: discovering neighbors, setting link cost, constructing a link state packet, distributing the link state packet, and calculating a new routing relation. The invention is used for solving the problems of dynamic networking and data interaction between a master control computer and a terminal (router).
Description
Technical Field
The invention relates to the field of dynamic routing path calculation, in particular to a method for selecting a shortest path of a dynamic route.
Background
Disclosure of Invention
The invention aims to overcome the defects of the traditional technology, provides a method for selecting the shortest path of a dynamic route, and solves the problems of dynamic networking and data interaction between a master control computer and a terminal (router).
The aim of the invention is achieved by the following technical measures:
a method for selecting the shortest path of dynamic route, through route dynamic update in order to upgrade the routing information in real time, then calculate pc to the shortest path of each router through carrying out Dijkstra algorithm; the steps of the dynamic update of the route are realized as follows: discovering neighbors, setting link cost, constructing a link state packet, distributing the link state packet, and calculating a new routing relation.
Further, the router discovers the neighbor by utilizing interaction of a self-checking message and HELLO and helloback messages, a special HELLO data packet is sent on each point-to-point line, then another router of the line replies a helloback, so that the router can confirm all neighbor information of the router after collecting all helloback messages of the router, after the pc receives the HELLO messages of the adjacent router, the helloback message sent by the pc end is returned, meanwhile, a router node is constructed, the router information is added into a router data table, and in the process, the pc is also used as a router.
Further, the information included in the link state packet includes port numbers of the router and the adjacent router, the serial number of the adjacent router, and the port numbers of the adjacent router and the router.
Further, the router will record, if it is a new data packet, it will be forwarded, if it is a duplicate data packet, it will be discarded, after pc receives the link message from a certain router, it will add the information of the router into the router data table, if the same router information already exists in the current router data table, it will delete the original router information and update it to the latest router information.
Further, the specific steps of finding out the shortest path from pc to each router by executing Dijkstra algorithm are as follows: each router in the router data table is re-labeled, the label pc is 0, the labels of the rest routers are natural numbers numbered from 1, after the router nodes are labeled, neighbor information is extracted from the router link information, edges are added, the connection relation between the routers is established, and therefore a path address list between the pc and a certain router is selected.
Due to the adoption of the technical scheme, compared with the prior art, the invention has the advantages that:
the master control computer can automatically identify the current networking state in real time and dynamically generate a network routing table;
the problems of dynamic networking and data interaction between a master control computer and a terminal (router) are solved.
The invention is further described with reference to the following figures and detailed description.
Drawings
Fig. 1 is a schematic diagram of a connection relationship between routers.
Detailed Description
Example (b):
the method of the invention is carried out according to the following steps:
1. and (3) discovering the neighbor:
when a router starts up, the router finds out which routers are its neighbors, discovers the neighbors by using self-check messages and the interaction of HELLO and helloback messages, and sends a special HELLO packet on each point-to-point line. Then another router of the line makes a helloback reply, so that after the router collects all helloback messages of the router, all neighbor information of the router can be confirmed.
After receiving the hello message of the adjacent router, the pc returns the helloback message sent by the pc end, simultaneously constructs a router node 0, adds the router 0 information into a router data table,
when executing the link state routing algorithm, the pc is also treated as a router
2. Setting the link cost:
because only the optimal route with the minimum number of cross-domain routers is searched, the link distance between the routers is 1 by default
3. Constructing a link state packet:
the router organizes the link message, which contains the following information
Port number of router connected to adjacent router 1, adjacent router 1 sequence number, port number of adjacent router 1 connected to router
Port number of router connected to adjacent router 2, serial number of adjacent router 2, port number of adjacent router 2 connected to router
。。。。。。。。。
。。。。。。。。。
4. Distributing the link state packet:
the router records and forwards it if it is a new packet and discards it if it is a duplicate packet. After a pc receives a link message from a certain router, the information of the router is added into a router data table, if the same router information already exists in the current router data table, the original router information is deleted and updated to the latest router information, and because the neighbor list information in the router information may change at any time, the router information in the router data table needs to be updated and replaced at any time.
After this step, we will continuously update and maintain our routing table according to the link message on the network, when a router is added in the routing network, the routing table will be updated and added in time, when a certain router is removed from the routing network, we will perform link breaking confirmation, if the link information of the router cannot be received in a certain time (for example, 5 seconds), we think that the router is really lost, delete the router information from the routing table and update.
5. Calculating a new routing relation:
after 1-4 steps, the routing table is continuously updated, in the step, the existing routing table is utilized, a thread is newly built, and the shortest path from pc to each router is found by executing Dijkstra algorithm.
The specific process is as follows
The routers in the routing table are first re-numbered, pc being 0 and the remaining routers being 1,2,3 … … …
After the router nodes are labeled, neighbor information is extracted from the router link information, edges are added, and the connection relationship between the routers is established, as shown in fig. 1.
6. The shortest path between pc and each label router is calculated by using Dijkstra algorithm, which is similar to the calculation of the shortest path between pc and each label router
0—>1
0—>1—>2
0—>1—>3
0—>1—>2—>4
0—>1—>3—>4
The router label is restored to the serial number of the router.
And configuring the router according to the shortest path.
According to the calculated shortest path and by combining the neighbor list in the router link information, we can calculate the path address list between pc and a certain router, and then pc configures the logical address of each effective port of the router through the path address.
Claims (5)
1. A method for selecting the shortest path of dynamic route is characterized in that the route information is updated in real time through the dynamic update of the route, and then the shortest path from pc to each router is calculated through executing Dijkstra algorithm; the steps of the dynamic update of the route are realized as follows: discovering neighbors, setting link cost, constructing a link state packet, distributing the link state packet, and calculating a new routing relation.
2. The method as claimed in claim 1, wherein the router discovers the neighbor by using self-checking packets and interaction of HELLO and helloback packets, sends a special HELLO packet on each peer-to-peer line, and then another router of the line replies with a helloback, so that after the router collects all helloback packets of the router, all neighbor information of the router can be confirmed, and after the pc receives HELLO packets of the neighboring router, the pc returns the helloback packet sent by the pc, constructs router nodes at the same time, and adds the router information to the router data table, in this process, the pc is also used as a router.
3. The method as claimed in claim 1, wherein the information included in the link state packet includes port numbers of the router and the neighboring router, the serial numbers of the neighboring routers, and the port numbers of the neighboring routers and the router.
4. The method as claimed in claim 2, wherein the router records, forwards it if it is a new packet, discards it if it is a duplicate packet, adds the information of a router to the router data table after pc receives a link message from the router, and deletes the original router information and updates it to the latest router information if the same router information already exists in the current router data table.
5. The method as claimed in claim 4, wherein the specific steps of finding the shortest path from pc to each router by executing Dijkstra algorithm are as follows: each router in the router data table is re-labeled, the label pc is 0, the labels of the rest routers are natural numbers numbered from 1, after the router nodes are labeled, neighbor information is extracted from the router link information, edges are added, the connection relation between the routers is established, and therefore a path address list between the pc and a certain router is selected.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911021848.1A CN110752991A (en) | 2019-10-25 | 2019-10-25 | Method for selecting shortest path of dynamic route |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911021848.1A CN110752991A (en) | 2019-10-25 | 2019-10-25 | Method for selecting shortest path of dynamic route |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110752991A true CN110752991A (en) | 2020-02-04 |
Family
ID=69279923
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911021848.1A Pending CN110752991A (en) | 2019-10-25 | 2019-10-25 | Method for selecting shortest path of dynamic route |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110752991A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112671654A (en) * | 2020-12-28 | 2021-04-16 | 北京东土军悦科技有限公司 | Routing information updating method, device, equipment, medium and OSPF network |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102118299A (en) * | 2009-12-31 | 2011-07-06 | 中国电子科技集团公司第五十研究所 | Adaptive dynamic routing method |
CN104883695A (en) * | 2015-04-24 | 2015-09-02 | 南京航空航天大学 | Multi-hop cognitive radio network architecture and deployment method |
CN104967563A (en) * | 2015-07-24 | 2015-10-07 | 国家电网公司 | Active routing method and device |
-
2019
- 2019-10-25 CN CN201911021848.1A patent/CN110752991A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102118299A (en) * | 2009-12-31 | 2011-07-06 | 中国电子科技集团公司第五十研究所 | Adaptive dynamic routing method |
CN104883695A (en) * | 2015-04-24 | 2015-09-02 | 南京航空航天大学 | Multi-hop cognitive radio network architecture and deployment method |
CN104967563A (en) * | 2015-07-24 | 2015-10-07 | 国家电网公司 | Active routing method and device |
Non-Patent Citations (2)
Title |
---|
LUCIOZHANG: ""《计算机网络》第5章 网络层"", 《CSDN,HTTPS://BLOG.CSDN.NET/QQ_18738333/ARTICLE/DETAILS/66205394》 * |
NINETEEN: ""网络层—链路状态路由算法"", 《CSDN,HTTPS://BLOG.CSDN.NET/NINETEEN_/ARTICLE/DETAILS/50347549》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112671654A (en) * | 2020-12-28 | 2021-04-16 | 北京东土军悦科技有限公司 | Routing information updating method, device, equipment, medium and OSPF network |
CN112671654B (en) * | 2020-12-28 | 2022-09-27 | 北京东土军悦科技有限公司 | Routing information updating method, device, equipment and medium and OSPF network |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10432427B2 (en) | Border gateway protocol for communication among software defined network controllers | |
US8817798B2 (en) | Constraining topology size and recursively calculating routes in large networks | |
US10218600B2 (en) | Path computation element hierarchical software defined network control | |
EP2254284B1 (en) | Method and device for route installation and distribution | |
US20160050138A1 (en) | Method and apparatus for advertising border connection information of autonomous system | |
US20090180489A1 (en) | Node, routing control method, and routing control program | |
CN109417508B (en) | Method and device for constructing hierarchical Path Computation Element (PCE) network topology | |
KR101457317B1 (en) | Prioritization of routing information updates | |
US9143431B2 (en) | Hiding a service node in a network from a network routing topology | |
CN107707474B (en) | Route distribution method and system | |
CN104168154A (en) | Network-situation-awareness-oriented multi-level network system and building method thereof | |
CN102025552A (en) | Backup method and backup device of link-state advertisement | |
CN113285876A (en) | Routing method, routing device and computer readable storage medium | |
US20100027555A1 (en) | Method for processing link state advertisement and routing device | |
EP3188408B1 (en) | Method and apparatus for determining network topology, and centralized network state information storage device | |
WO2021254173A1 (en) | Routing processing method and related device | |
CN111464440A (en) | Communication method and device | |
CN110752991A (en) | Method for selecting shortest path of dynamic route | |
CN111464441A (en) | Communication method and device | |
CN104065578B (en) | IP router processing method and device based on ASON optical network | |
CN114727354A (en) | Clustering optimal link state routing method based on virtual backbone network | |
CN106470159B (en) | Tunnel convergence method and device | |
CN114157724B (en) | Identity/position identification hybrid forwarding method based on source route | |
CN105591940B (en) | TRILL network distribution tree selection method and TRILL network node | |
CN114268583B (en) | SDN-based dual-stack backbone management method and device and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200204 |
|
RJ01 | Rejection of invention patent application after publication |