Nothing Special   »   [go: up one dir, main page]

CN108848033B - Method, device and storage medium for avoiding route conflict - Google Patents

Method, device and storage medium for avoiding route conflict Download PDF

Info

Publication number
CN108848033B
CN108848033B CN201810666931.3A CN201810666931A CN108848033B CN 108848033 B CN108848033 B CN 108848033B CN 201810666931 A CN201810666931 A CN 201810666931A CN 108848033 B CN108848033 B CN 108848033B
Authority
CN
China
Prior art keywords
route
router
conflict
added
routes
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.)
Active
Application number
CN201810666931.3A
Other languages
Chinese (zh)
Other versions
CN108848033A (en
Inventor
陈杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Skyworth Digital Technology Co Ltd
Original Assignee
Shenzhen Skyworth Digital Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Skyworth Digital Technology Co Ltd filed Critical Shenzhen Skyworth Digital Technology Co Ltd
Priority to CN201810666931.3A priority Critical patent/CN108848033B/en
Publication of CN108848033A publication Critical patent/CN108848033A/en
Application granted granted Critical
Publication of CN108848033B publication Critical patent/CN108848033B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5046Resolving address allocation conflicts; Testing of addresses

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention discloses a method, a device and a storage medium for avoiding route conflict, wherein the method comprises the following steps: acquiring conflict judgment information of the added router of the router; judging the conflict judgment information based on a preset rule to determine whether a conflict route exists in the routes added by the router; and if the conflict route exists, deleting the conflict route so that the conflict route does not exist in the routes added by the router. By adopting the technical scheme, the purposes of avoiding route conflicts and ensuring normal service of the network terminal are achieved.

Description

Method, device and storage medium for avoiding route conflict
Technical Field
The embodiment of the invention relates to the technical field of internet, in particular to a method, a device and a storage medium for avoiding route conflict.
Background
A router is a computer network device that can route data packets in a network to a destination through individual networks, a process known as routing. The router performs routing of packets through individual IP (Internet Protocol) addresses. However, with the rapid development of the Internet, IPv4(Internet Protocol version 4) addresses are in short supply, and for this problem, IPv6(Internet Protocol version 6) with an address length of 128 bits well solves the problem of address shortage and has a larger address space. And the IPv6 represents a route in the routing table by a record, which can reduce the length of the routing table and improve the forwarding speed of the data packet, and the IPv6 supports the automatic address configuration, so that the management of the network, especially the local area network, is more convenient, and the IPv6 is safer, the service types are more diversified, the expandability is stronger, and the like, so that network operators and government departments at home and abroad can actively promote the evolution process from IPv4 to IPv 6.
Generally, a WAN interface of a router is connected to a higher level IPv6 device, the router is connected to a wide area network through the higher level IPv6 device, and a LAN interface of the router is connected to a network terminal in a local area network, for example, a network terminal such as a mobile phone; in this way, the network equipment can communicate with the wide area network through the router, but the IPv6 service of the network terminal of the LAN interface can be ensured to be normal only when no conflict route exists between the WAN interface route and the LAN interface route of the router.
Therefore, a method is needed to avoid IPv6 routing conflict and ensure that the IPv6 traffic of the network terminal is normal.
Disclosure of Invention
The embodiment of the invention provides a method, a device and a storage medium for avoiding route conflicts, which can avoid the route conflicts and ensure the normal service of a network terminal.
In order to achieve the above purpose, the embodiment of the invention adopts the following technical scheme:
in a first aspect, an embodiment of the present invention provides a method for avoiding a route conflict, where the method includes:
acquiring conflict judgment information of the added router of the router;
judging the conflict judgment information based on a preset rule to determine whether a conflict route exists in the routes added by the router;
and if the conflict route exists, deleting the conflict route so that the conflict route does not exist in the routes added by the router.
Further, the obtaining of the collision judgment information of the route that the router has added includes:
acquiring address information corresponding to each added route from a routing table corresponding to the router;
and determining the address information corresponding to each route as the conflict judgment information of the route added by the router.
Further, the determining, based on a preset rule, the collision determination information to determine whether there is a collision route in the routes that have been added by the router includes:
judging whether the address information corresponding to each route is the same, if so, determining the route with the same address information as a conflict route;
correspondingly, the deleting the conflicting route so that no conflicting route exists in the routes that have been added by the router includes:
deleting a set number of conflicting routes to preserve one of the conflicting routes.
Further, the obtaining of the collision judgment information of the route that the router has added includes:
acquiring an IPv6 address prefix of a WAN interface of the router through an ICMPv6 message sent to the router by a superior IPv6 device connected with the router;
acquiring a subnet prefix of the router LAN interface through a DHCPv6 reply message sent to the router by the superior IPv6 device;
determining the IPv6 address prefix and the subnet prefix as conflict judgment information of the route added by the router; or,
acquiring an IPv6 address of the WAN interface of the router and a subnet prefix of the LAN interface of the router by using a DHCPv6 reply message sent to the router by the superior IPv6 device;
and determining the IPv6 address and the subnet prefix as the conflict judgment information of the route added by the router.
Further, the determining, based on a preset rule, the collision determination information to determine whether there is a collision route in the routes that have been added by the router includes:
if the IPv6 address prefix is the same as the subnet prefix, determining that a conflict route exists in the routes added by the router; or,
if the IPv6 address and the subnet prefix are in the same network segment, determining that a conflict route exists in the added routes of the router;
correspondingly, if there is a conflicting route, deleting the conflicting route so that there is no conflicting route in the routes already added by the router, including:
finding out routes with the same address information from a routing table corresponding to the router, and determining the routes with the same address information as conflict routes;
deleting the conflicting route for the router WAN interface.
Further, the method further comprises:
and if the conflict route exists, setting a conflict flag bit and recording the conflict route.
Further, the method further comprises:
when a router WAN interface receives a new route adding request, whether a conflict flag bit is set is detected, and if yes, route conflict judgment information corresponding to the new route is obtained;
comparing the route conflict judgment information corresponding to the new route with the conflict judgment information corresponding to the recorded conflict route to determine whether the new route is the same as the recorded conflict route;
and if the new route is the same as the recorded conflict route, rejecting the new route adding request.
In a second aspect, an embodiment of the present invention provides an apparatus for avoiding a route conflict, where the apparatus includes:
the acquisition module is used for acquiring the conflict judgment information of the added router of the router;
a determining module, configured to determine the collision determination information based on a preset rule, so as to determine whether a collision route exists in routes that have been added by the router;
and the deleting module is used for deleting the conflict route if the conflict route exists so that the conflict route does not exist in the added routes of the router.
In a third aspect, an embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement a method for avoiding a route conflict as described in the first aspect.
In a fourth aspect, embodiments of the present invention provide a storage medium containing computer-executable instructions, which when executed by a computer processor, implement a method of avoiding routing conflicts as described in the first aspect above.
The method for avoiding the route conflict provided by the embodiment of the invention determines whether the route added by the router has a conflict route or not by acquiring the conflict judgment information of the route added by the router and judging the conflict judgment information based on the preset rule, and if the conflict route exists, the conflict route is deleted, so that the technical means that the conflict route does not exist in the route added by the router is realized, the route conflict is avoided, and the purpose of ensuring the normal service of a network terminal is realized.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the contents of the embodiments of the present invention and the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for avoiding a route conflict according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a connection structure between a router and a higher-level IPv6 device and a terminal according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a method for avoiding a route conflict according to a second embodiment of the present invention;
fig. 4 is a flowchart illustrating another method for avoiding a route conflict according to a second embodiment of the present invention;
fig. 5 is a schematic structural diagram of a device for avoiding a route conflict according to a third embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
In order to make the technical problems solved, technical solutions adopted and technical effects achieved by the present invention clearer, the technical solutions of the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example one
Fig. 1 is a flowchart illustrating a method for avoiding a route conflict according to an embodiment of the present invention. The method for avoiding the route conflict provided by the embodiment can be executed by a device for avoiding the route conflict. The method can be implemented by software and/or hardware, can be integrated in a household router in general, and can be integrated in an application layer of the household router in particular to detect whether conflicting routes exist between a WAN interface route and a LAN interface route of the router. Referring specifically to fig. 1, the method comprises the steps of:
110. and acquiring the conflict judgment information of the routes which are added by the router.
The router may specifically be a home router, or other routers for a local area network; specifically, referring to the schematic diagram of the connection structure between the router and the upper IPv6 device and the terminal shown in fig. 2, a WAN interface of the router is connected to the upper IPv6 device and is used for communicating with a wide area network, a LAN interface of the router is connected to a network terminal in a local area network, so that the network terminal can communicate with an external wide area network through the router, and the network terminal specifically includes: an electronic network terminal such as a mobile phone or a computer. Every time when the router is powered on, started and operated, restarted by a network, redialed by a WAN interface or updated by the WAN interface, the router performs ICMPv6 and DHCPv6 protocol interaction with a superior IPv6 device, waits for the superior IPv6 device to allocate a WAN interface address (or a WAN interface address prefix) and a LAN subnet prefix to the router, adds a WAN interface route according to the allocated WAN interface address (or the WAN interface address prefix) and the LAN subnet prefix, and starts the method for avoiding the route conflict provided by the embodiment when the WAN interface route addition is completed so as to detect whether the conflict exists between the routes which are already added by the router.
Further, before obtaining the collision judgment information of the route that has been added by the router, the method for avoiding the route collision further includes:
receiving a WAN interface address (or a WAN interface address prefix) and a LAN subnet prefix which are distributed to a router by a superior IPv6 device;
and adding WAN interface routing according to the WAN interface address (or the WAN interface address prefix) and the LAN subnet prefix.
The collision judgment information may specifically refer to address information corresponding to each route added by the router, or refer to an IPv6 address prefix of a WAN interface, an IPv6 address of a WAN interface, or a subnet prefix of a LAN interface, which is allocated by the upper IPv6 device to the router. In a normal communication process, the IPv6 address prefix of a WAN interface distributed by a superior IPv6 device for a router is different from the subnet prefix distributed for a subnet, or the IPv6 address of the WAN interface distributed by the superior IPv6 device for the router and the subnet prefix distributed for the subnet are not in the same network segment, so that a network terminal of a LAN interface of the router can enjoy normal IPv6 service, and the IPv6 service or the IPv6 service refers to network communication through an IPv6 protocol. However, in some cases, the upper IPv6 device does not execute according to the protocol, the IPv6 address prefix of the WAN interface allocated to the router is the same as the subnet prefix allocated to the subnet, or the IPv6 address of the WAN interface allocated to the router is in the same segment as the subnet prefix allocated to the subnet, and once this occurs, the network terminal of the LAN interface of the router cannot normally surf the internet, and the IPv6 service is abnormal. Therefore, whether a conflicting route exists in routes that the router has added can be determined by judging the IPv6 address prefix of the WAN interface, the IPv6 address of the WAN interface, or the subnet prefix of the LAN interface that the upper IPv6 device allocates to the router.
Illustratively, the obtaining the collision judgment information of the routes that the router has added includes:
acquiring address information corresponding to each added route from a routing table corresponding to the router;
and determining the address information corresponding to each route as the conflict judgment information of the route added by the router.
The address information can exclude destination network address information beginning with fe80, ff00, ff02 and 0000. Generally fe80, the destination network address of the beginning represents the local link route; ff00, the destination network address of the beginning represents the multicast route; ff02, the destination network address of the beginning is used for indicating the multicast range; 0000 the destination network address of the beginning is the default route. Each of the above-mentioned routes is validated according to the corresponding rule, and collision detection is not required, and even if there is a collision between partial address information in the routing table corresponding to the router and destination network address information at the beginning of fe80:, ff00:, ff02 and 0000, the IPv6 service of the network-using terminal is not affected.
120. And judging the conflict judgment information based on a preset rule to determine whether a conflict route exists in the routes added by the router.
For example, the determining the collision judgment information based on a preset rule to determine whether there is a collision route in the routes that the router has added includes:
judging whether the address information corresponding to each route is the same, if so, determining the route with the same address information as a conflict route;
correspondingly, the deleting the conflicting route so that no conflicting route exists in the routes that have been added by the router includes:
deleting a set number of conflicting routes to preserve one of the conflicting routes.
130. And if the conflict route exists, deleting the conflict route so that the conflict route does not exist in the routes added by the router.
Specifically, if the conflicting route is present between the WAN interface route and the LAN interface route of the router, that is, if the address information corresponding to the WAN interface route is the same as the address information corresponding to a certain route of the LAN interface, one of the conflicting routes is deleted.
The method for avoiding route collision provided by this embodiment determines whether a conflicting route exists in a route already added by a router by acquiring collision determination information of the route already added by the router and determining the collision determination information based on a preset rule, and if a conflicting route exists, deletes the conflicting route so that a technical means that no conflicting route exists in the route already added by the router is provided, thereby achieving the purposes of avoiding route collision and ensuring normal service of a network terminal.
Example two
Fig. 3 is a flowchart illustrating a method for avoiding a route conflict according to a second embodiment of the present invention. On the basis of the embodiment, the embodiment is further optimized, and the advantage of optimization is that the routing conflict can be accurately avoided. Referring specifically to fig. 3, the method specifically includes the following steps:
310. and acquiring the conflict judgment information of the routes which are added by the router.
Specifically, the acquiring collision judgment information of the route that has been added by the router includes:
acquiring an IPv6 address prefix of a WAN interface of the router through an ICMPv6 message sent to the router by a superior IPv6 device connected with the router;
acquiring a subnet prefix of the router LAN interface through a DHCPv6 reply message sent to the router by the superior IPv6 device;
determining the IPv6 address prefix and the subnet prefix as conflict judgment information of the route added by the router; or,
acquiring an IPv6 address of the WAN interface of the router and a subnet prefix of the LAN interface of the router by using a DHCPv6 reply message sent to the router by the superior IPv6 device;
and determining the IPv6 address and the subnet prefix as the conflict judgment information of the route added by the router.
According to the protocol specification of IPv6, when the upper-level IPv6 equipment performs stateless address allocation, the router acquires IPv6 address Prefix of WAN interface through Prefix information operation (3) of ICMPv6 message, the router generates IPv6 address of WAN interface by using Prefix + WAN interface ID, and acquires subnet Prefix through IA-PD operation (26) in DHCPv6 reply message from the upper-level IPv6 equipment. If the superior IPv6 equipment carries out stateful address allocation, the router acquires the IPv6 address of the WAN interface through the IA-NAOption (5) of the DHCPv6 reply message, and acquires the subnet prefix through the IA-PDOption (26) of the DHCPv6 reply message.
320. If the IPv6 address prefix is the same as the subnet prefix, determining that a conflict route exists in the routes added by the router; or,
and if the IPv6 address and the subnet prefix are in the same network segment, determining that a conflict route exists in the routes added by the router.
330. And finding out the route with the same address information from the routing table corresponding to the router, and determining the route with the same address information as a conflict route.
340. Deleting the conflicting route for the router WAN interface.
On the basis of the above embodiment, the method for avoiding route collision provided by this embodiment determines whether there is a collision route in routes to which routes have been added according to the IPv6 address prefix of the WAN interface (or the IPv6 address of the WAN interface) and the subnet prefix of the LAN interface allocated by the upper IPv6 device to the router, thereby achieving accurate avoidance of route collision.
Further, on the basis of the above technical solution, the method further includes:
if the conflict route exists, setting a conflict flag bit and recording the conflict route;
when a router WAN interface receives a new route adding request, whether a conflict flag bit is set is detected, and if yes, route conflict judgment information corresponding to the new route is obtained;
comparing the route conflict judgment information corresponding to the new route with the conflict judgment information corresponding to the recorded conflict route to determine whether the new route is the same as the recorded conflict route;
and if the new route is the same as the recorded conflict route, rejecting the new route adding request.
Specifically, the conflict flag bit may be set in a/proc/directory of the router, and the/proc/directory may be generally used as a means for information interaction between a core of the router and an application layer thereof, and the core of the router may read the conflict flag bit from the/proc/directory and perform control according to the conflict flag bit, so as to effectively prevent a new conflict route from being added to the router.
The new route adding request can be a request sent by a user to configure and add a new route, or a request for automatically adding a new route, which is carried in an ICMPv6RA message from a WAN interface.
Specifically, referring to another schematic flow chart of a method for avoiding a route conflict shown in fig. 4, the method includes:
410. the WAN interface of the household router is cascaded with the upper-level IPv6 equipment, and the LAN interface is accessed to network terminals such as computers and mobile phones.
420. Router startup or network restart or WAN interface reacquires the address.
430. Waiting for a detection period.
In the detection period, the superior IPv6 device performs protocol interaction with the router, allocates IPv6 address prefix (or IPv6 address of WAN interface) of WAN interface and subnet prefix of LAN interface for the router, and the router adds WAN interface route and LAN interface route according to the IPv6 address prefix (or IPv6 address of WAN interface) and subnet prefix of LAN interface. The detection period may be set to 20 s.
440. And detecting whether the WAN interface route and the LAN interface route are completely added or not, if so, executing a step 450, and otherwise, continuously waiting.
450. Route conflict detection is initiated.
460. And detecting whether the WAN interface route and the LAN interface route in the routing table conflict, if so, executing a step 470, and otherwise, ending the flow.
470. And deleting the conflicting WAN interface route.
480. And setting a conflict flag bit and recording a conflict route.
490. And preventing the addition of a new conflict route according to the conflict flag bit and the recorded conflict route.
By setting the conflict flag bit and recording the conflict route, the addition of a new conflict route is avoided.
EXAMPLE III
Fig. 5 is a schematic structural diagram of a device for avoiding a route conflict according to a third embodiment of the present invention, and as shown in fig. 5, the device includes: an acquisition module 510, a determination module 520, and a deletion module 530;
the obtaining module 510 is configured to obtain collision judgment information of a route that has been added by a router;
a determining module 520, configured to determine the collision determination information based on a preset rule, so as to determine whether there is a collision route in the routes that have been added by the router;
a deleting module 530, configured to delete a conflicting route if the conflicting route exists, so that the conflicting route does not exist in routes that have been added by the router.
Further, the apparatus further comprises:
and the setting module is used for setting the conflict flag bit and recording the conflict route if the conflict route exists.
Further, the apparatus further comprises:
the adding refusing module is used for detecting whether a conflict flag bit is set or not when the WAN interface of the router receives a new route adding request, and acquiring route conflict judgment information corresponding to a new route if the conflict flag bit is set; comparing the route conflict judgment information corresponding to the new route with the conflict judgment information corresponding to the recorded conflict route to determine whether the new route is the same as the recorded conflict route; and if the new route is the same as the recorded conflict route, rejecting the new route adding request.
Generally, the obtaining module, the determining module, the deleting module and the setting module are integrated in an application layer of a router, and the application layer routing conflict detecting module shown in fig. 2 includes the obtaining module, the determining module, the deleting module and the setting module;
the adding rejection module may be integrated in the kernel of the router, and the kernel routing conflict detection module shown in fig. 2 includes the adding rejection module.
The device for avoiding route collision provided by this embodiment determines whether a conflicting route exists in a route already added by a router by acquiring collision determination information of the route already added by the router and determining the collision determination information based on a preset rule, and if a conflicting route exists, deletes the conflicting route so that no conflicting route exists in the route already added by the router, thereby achieving the purpose of avoiding route collision and ensuring normal service of a network terminal.
Example four
Fig. 6 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. As shown in fig. 6, the electronic apparatus includes: a processor 670, memory 671, and computer programs stored on memory 671 and operable on processor 670; the number of the processors 670 may be one or more, and fig. 6 illustrates one processor 670 as an example; processor 670, when executing said computer program, implements a method of avoiding routing conflicts as described in the previous embodiments. As shown in fig. 6, the electronic device may further include an input device 672 and an output device 673. The processor 670, memory 671, input device 672 and output device 673 may be connected by a bus or other means, such as by a bus connection in fig. 6.
The memory 671 is used as a computer-readable storage medium for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to a method for avoiding a routing conflict according to an embodiment of the present invention (for example, the obtaining module 510, the determining module 520, or the deleting module 530 in the apparatus for avoiding a routing conflict). The processor 670 executes software programs, instructions and modules stored in the memory 671 to perform various functional applications and data processing of the electronic device, so as to implement the above-mentioned method for avoiding routing conflicts.
The memory 671 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, and an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. In addition, the memory 671 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 671 may further include memory located remotely from the processor 670, which may be connected to electronic devices/storage media through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 672 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function controls of the electronic apparatus. The output device 673 may include a display device such as a display screen.
EXAMPLE five
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, perform a method of avoiding routing conflicts, the method including:
acquiring conflict judgment information of the added router of the router;
judging the conflict judgment information based on a preset rule to determine whether a conflict route exists in the routes added by the router;
and if the conflict route exists, deleting the conflict route so that the conflict route does not exist in the routes added by the router.
Of course, the storage medium containing the computer-executable instructions provided by the embodiments of the present invention is not limited to the method operations described above, and may also perform related operations in a method for avoiding a route conflict provided by any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a storage medium, or a network device) to execute the methods according to the embodiments of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (6)

1. A method for avoiding routing conflicts, the method comprising:
acquiring conflict judgment information of the added router of the router;
the acquiring the collision judgment information of the route added by the router includes:
when upper-level IPv6 equipment performs stateless address allocation, acquiring an IPv6 address prefix of a WAN interface of the router through an ICMPv6 message sent to the router by the upper-level IPv6 equipment connected with the router;
acquiring a subnet prefix of the router LAN interface through a DHCPv6 reply message sent to the router by the superior IPv6 device;
determining the IPv6 address prefix and the subnet prefix as conflict judgment information of the route added by the router; or,
when the upper-level IPv6 equipment carries out stateful address allocation, the DHCPv6 reply message sent to the router by the upper-level IPv6 equipment acquires the IPv6 address of the WAN interface of the router and the subnet prefix of the LAN interface of the router;
determining the IPv6 address and the subnet prefix as conflict judgment information of the route added by the router;
judging the conflict judgment information based on a preset rule to determine whether a conflict route exists in the routes added by the router;
the determining, based on a preset rule, the collision determination information to determine whether there is a collision route in routes already added by the router includes:
if the IPv6 address prefix is the same as the subnet prefix, determining that a conflict route exists in the routes added by the router; or,
if the IPv6 address and the subnet prefix are in the same network segment, determining that a conflict route exists in the added routes of the router;
if the conflict route exists, deleting the conflict route so that the conflict route does not exist in the routes added by the router;
if the conflict route exists, deleting the conflict route so that the conflict route does not exist in the routes added by the router, wherein the process comprises the following steps:
finding out routes with the same address information from a routing table corresponding to the router, and determining the routes with the same address information as conflict routes;
deleting the conflicting route of a router WAN interface;
the method for avoiding the route conflict further comprises the following steps:
if the conflict route exists, setting a conflict flag bit and recording the conflict route;
when a router WAN interface receives a new route adding request, whether a conflict flag bit is set is detected, and if yes, route conflict judgment information corresponding to the new route is obtained;
comparing the route conflict judgment information corresponding to the new route with the conflict judgment information corresponding to the recorded conflict route to determine whether the new route is the same as the recorded conflict route;
and if the new route is the same as the recorded conflict route, rejecting the new route adding request.
2. The method of claim 1, wherein the obtaining the collision judgment information of the route that the router has added comprises:
acquiring address information corresponding to each added route from a routing table corresponding to the router;
and determining the address information corresponding to each route as the conflict judgment information of the route added by the router.
3. The method according to claim 2, wherein said determining the collision determination information based on a preset rule to determine whether there is a collision route in the routes that the router has added includes:
judging whether the address information corresponding to each route is the same, if so, determining the route with the same address information as a conflict route;
correspondingly, the deleting the conflicting route so that no conflicting route exists in the routes that have been added by the router includes:
deleting a set number of conflicting routes to preserve one of the conflicting routes.
4. An apparatus for avoiding routing conflicts, the apparatus comprising:
the acquisition module is used for acquiring the conflict judgment information of the added router of the router;
the acquiring the collision judgment information of the route added by the router includes:
when upper-level IPv6 equipment performs stateless address allocation, acquiring an IPv6 address prefix of a WAN interface of the router through an ICMPv6 message sent to the router by the upper-level IPv6 equipment connected with the router;
acquiring a subnet prefix of the router LAN interface through a DHCPv6 reply message sent to the router by the superior IPv6 device;
determining the IPv6 address prefix and the subnet prefix as conflict judgment information of the route added by the router; or,
when the upper-level IPv6 equipment carries out stateful address allocation, the DHCPv6 reply message sent to the router by the upper-level IPv6 equipment acquires the IPv6 address of the WAN interface of the router and the subnet prefix of the LAN interface of the router;
determining the IPv6 address and the subnet prefix as conflict judgment information of the route added by the router;
a determining module, configured to determine the collision determination information based on a preset rule, so as to determine whether a collision route exists in routes that have been added by the router;
the determining, based on a preset rule, the collision determination information to determine whether there is a collision route in routes already added by the router includes:
if the IPv6 address prefix is the same as the subnet prefix, determining that a conflict route exists in the routes added by the router; or,
if the IPv6 address and the subnet prefix are in the same network segment, determining that a conflict route exists in the added routes of the router;
a deleting module, configured to delete a conflicting route if the conflicting route exists, so that the conflicting route does not exist in routes that have been added by the router;
if the conflict route exists, deleting the conflict route so that the conflict route does not exist in the routes added by the router, wherein the process comprises the following steps:
finding out routes with the same address information from a routing table corresponding to the router, and determining the routes with the same address information as conflict routes;
deleting the conflicting route of a router WAN interface;
the device for avoiding the route conflict further comprises:
the setting module is used for setting a conflict flag bit if the conflict route exists and recording the conflict route;
the adding refusing module is used for detecting whether a conflict flag bit is set or not when the WAN interface of the router receives a new route adding request, and acquiring route conflict judgment information corresponding to a new route if the conflict flag bit is set; comparing the route conflict judgment information corresponding to the new route with the conflict judgment information corresponding to the recorded conflict route to determine whether the new route is the same as the recorded conflict route; and if the new route is the same as the recorded conflict route, rejecting the new route adding request.
5. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements a method of avoiding a routing conflict as recited in any one of claims 1-3 when executing the computer program.
6. A storage medium containing computer executable instructions which, when executed by a computer processor, implement a method of avoiding routing conflicts as recited in any of claims 1-3.
CN201810666931.3A 2018-06-26 2018-06-26 Method, device and storage medium for avoiding route conflict Active CN108848033B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810666931.3A CN108848033B (en) 2018-06-26 2018-06-26 Method, device and storage medium for avoiding route conflict

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810666931.3A CN108848033B (en) 2018-06-26 2018-06-26 Method, device and storage medium for avoiding route conflict

Publications (2)

Publication Number Publication Date
CN108848033A CN108848033A (en) 2018-11-20
CN108848033B true CN108848033B (en) 2021-11-09

Family

ID=64202304

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810666931.3A Active CN108848033B (en) 2018-06-26 2018-06-26 Method, device and storage medium for avoiding route conflict

Country Status (1)

Country Link
CN (1) CN108848033B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113347095B (en) * 2021-08-02 2021-11-05 中国人民解放军国防科技大学 Evasion routing path selection method and device based on segmented routing technology
CN116032832B (en) * 2022-12-15 2024-09-24 北京网太科技发展有限公司 Route conflict processing system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101159606A (en) * 2007-11-09 2008-04-09 华为技术有限公司 Method and network appliance of settling address conflict
CN101304388A (en) * 2008-06-20 2008-11-12 华为技术有限公司 Method, apparatus and system for settling IP address conflict
CN102340452A (en) * 2011-10-14 2012-02-01 中兴通讯股份有限公司 Single-Internet protocol version 6 (IPv6)-address-prefix-based routing transmission method and wireless equipment
CN105357330A (en) * 2015-10-22 2016-02-24 上海斐讯数据通信技术有限公司 Method and system for preventing IP address conflict of network devices

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9008096B2 (en) * 2012-11-13 2015-04-14 Microsoft Technology Licensing, Llc Data packet routing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101159606A (en) * 2007-11-09 2008-04-09 华为技术有限公司 Method and network appliance of settling address conflict
CN101304388A (en) * 2008-06-20 2008-11-12 华为技术有限公司 Method, apparatus and system for settling IP address conflict
CN102340452A (en) * 2011-10-14 2012-02-01 中兴通讯股份有限公司 Single-Internet protocol version 6 (IPv6)-address-prefix-based routing transmission method and wireless equipment
CN105357330A (en) * 2015-10-22 2016-02-24 上海斐讯数据通信技术有限公司 Method and system for preventing IP address conflict of network devices

Also Published As

Publication number Publication date
CN108848033A (en) 2018-11-20

Similar Documents

Publication Publication Date Title
CN106412142B (en) Resource equipment address obtaining method and device
EP3451592B1 (en) Packet transmission between vxlan domains
CN109314723B (en) Method, device and terminal for realizing data service
CN108429680B (en) Route configuration method, system, medium and equipment based on virtual private cloud
CN106982163B (en) Method and gateway for acquiring route on demand
CN107809386B (en) IP address translation method, routing device and communication system
US8887237B2 (en) Multimode authentication
CN108848033B (en) Method, device and storage medium for avoiding route conflict
US11805049B2 (en) Communication method and communications device
CN112272244B (en) Router WAN end IPv6 internet mode configuration method and device
CN106878052B (en) User migration method and device
CN107360095B (en) Method for realizing port forwarding in router based on client host name
CN110278558B (en) Message interaction method and WLAN system
CN105635138B (en) A kind of method and apparatus for preventing ARP from attacking
JP6592584B2 (en) IP address management method and apparatus, IP address anchor, and mobile node
CN108989173B (en) Message transmission method and device
CN111988446B (en) Message processing method and device, electronic equipment and storage medium
CN115277410A (en) Gateway adjusting method, device, electronic equipment and storage medium
CN106789757B (en) Access control method and device
CN104283982B (en) A kind of method that DMZ host automatically points to, system and gateway
EP3200433A1 (en) Ipv6 address management method, device and terminal
CN108712522B (en) IP address allocation method and device
CN112291212A (en) Static rule management method and device, electronic equipment and storage medium
JP6256471B2 (en) COMMUNICATION DEVICE, COMMUNICATION METHOD, AND PROGRAM
US20220247713A1 (en) Method for determining whether an ip address is attributed to a terminal in a communication network

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
GR01 Patent grant
GR01 Patent grant