CN113794644A - Method and device for deleting routing table items - Google Patents

Method and device for deleting routing table items Download PDF

Info

Publication number
CN113794644A
CN113794644A CN202111189302.4A CN202111189302A CN113794644A CN 113794644 A CN113794644 A CN 113794644A CN 202111189302 A CN202111189302 A CN 202111189302A CN 113794644 A CN113794644 A CN 113794644A
Authority
CN
China
Prior art keywords
routing table
table entry
server
acquisition mode
network device
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.)
Granted
Application number
CN202111189302.4A
Other languages
Chinese (zh)
Other versions
CN113794644B (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.)
New H3C Security Technologies Co Ltd
Original Assignee
New H3C Security Technologies 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 New H3C Security Technologies Co Ltd filed Critical New H3C Security Technologies Co Ltd
Priority to CN202111189302.4A priority Critical patent/CN113794644B/en
Publication of CN113794644A publication Critical patent/CN113794644A/en
Application granted granted Critical
Publication of CN113794644B publication Critical patent/CN113794644B/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • H04L45/021Ensuring consistency of routing table updates, e.g. by using epoch numbers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/54Organization of routing tables

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 provides a method and a device for deleting a routing table item, which relate to the technical field of networks and are applied to network equipment, wherein the network equipment is connected with a server, and the method comprises the following steps: acquiring a routing table item from the RIB, and sending the acquired routing table item and an identification of an acquisition mode adopted when the routing table item is acquired to the server, so that the server stores the routing table item and the identification of the acquisition mode; when the acquisition mode for acquiring the routing table entry changes, a PD message carrying the identifier of the original acquisition mode is sent to the server based on the BMP aiming at each original acquisition mode before the change, so that the server deletes the routing table entry corresponding to the original acquisition mode stored by the server. The embodiment of the invention can delete the routing table items stored in the server and reported by the network equipment before the acquisition mode of the routing table items is changed.

Description

Method and device for deleting routing table items
Technical Field
The present invention relates to the field of network technologies, and in particular, to a method and an apparatus for deleting a routing table entry.
Background
Network devices in the network may exchange routing table entries recorded by the network devices and various types of information related to transmission messages with each other based on a Border Gateway Protocol (BGP), so as to forward the messages based on the information exchanged with each other, and the network devices that exchange information with each other may be called BGP neighbors of each other. The server connected to any network device in the BGP neighbor may obtain the routing entry of the BGP neighbor of the network device based on a BMP (BGP Monitoring Protocol), so that the obtained routing entry may be further processed.
In the prior art, a network device may obtain a routing table entry of its own BGP neighbor, and may report the routing table entry to a connected server after obtaining the routing table entry. However, the obtaining mode of the network device obtaining the routing table entry may change, and after the obtaining mode changes, the server may delete the routing table entry received before the obtaining mode changes. In order to delete the above routing table entry, a method for deleting the routing table entry needs to be provided.
Disclosure of Invention
An object of the embodiments of the present invention is to provide a method and an apparatus for deleting a routing table entry, where the routing table entry is stored in a server and reported by a network device before an acquisition mode for acquiring a routing table entry changes.
The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for deleting a routing table entry, where the method is applied to a network device, and the network device is connected to a server, and the method includes:
acquiring a routing table entry from a RIB, and sending the acquired routing table entry and an identification of an acquisition mode adopted when the routing table entry is acquired to the server, so that the server stores the routing table entry and the identification of the acquisition mode;
when the acquisition mode for acquiring the routing table entry changes, sending a PD message carrying the identifier of the original acquisition mode to the server based on the BMP aiming at each original acquisition mode before the change, so that the server deletes the routing table entry corresponding to the original acquisition mode stored by the server.
In an embodiment of the present invention, after the obtaining a routing table entry from a RIB, and sending the obtained routing table entry and an identifier of an obtaining mode used when obtaining the routing table entry to the server, so that the server stores the routing table entry and the identifier of the obtaining mode, the method further includes:
determining whether the server supports deletion of a routing table entry stored by the server based on the identification of the acquisition mode;
if so, when the acquisition mode for acquiring the routing table entry changes, sending a PD message carrying the identifier of the original acquisition mode to the server based on the BMP aiming at each original acquisition mode before the change.
In an embodiment of the present invention, the determining whether the server supports deleting the routing table entry stored in the server based on the identification of the acquisition mode includes:
sending a first Initiation message to the server based on the BMP, wherein the first Initiation message carries first capability information, and the first capability information indicates that: the network equipment supports deletion of routing table items based on the identification of the acquisition mode;
if a second Initiation message sent by the server and used for responding to the first Initiation message is received, determining that the server supports deletion of a routing table entry stored by the server based on an identification of an acquisition mode, wherein the second Initiation message carries second capability information, and the second capability information indicates that: the server supports deleting the routing table entry stored by the server based on the identification of the acquisition mode.
In an embodiment of the present invention, in the first Initiation packet, the first capability information is stored in a value field in a first type length value TLV, and a value of a type field in the first TLV is 0.
In an embodiment of the present invention, if it is determined that the server does not support deletion of the routing table entry stored in the server based on the identification of the acquisition mode, after acquiring the routing table entry from the RIB, the method further includes:
recording the obtained routing table entry;
when the obtaining mode of obtaining the routing table entry changes, the method further comprises the following steps:
sending a PD message carrying a routing table item identifier to the server based on the BMP, so that the server deletes a routing table item corresponding to the routing table item identifier stored by the server, wherein the routing table item identifier is as follows: and the identifier of each routing table entry corresponding to the original acquisition mode, which is recorded by the network equipment.
In a second aspect, an embodiment of the present invention provides a method for deleting a routing table entry, where the method is applied to a server, and the server is connected to a network device, and the method includes:
receiving and storing a routing table entry sent by the network device and an identification of an acquisition mode adopted when the network device acquires the routing table entry, wherein the routing table entry is: the network equipment acquires a routing table entry from the RIB;
receiving a PD packet carrying an identifier of an original acquisition mode sent by the network device, where the PD packet is: the network device sends the changed acquisition mode of the routing table entry, and the original acquisition mode is as follows: before changing, the network equipment acquires the acquisition mode of the routing table item;
and deleting the routing table entry corresponding to the original acquisition mode stored by the router based on the identification.
In one embodiment of the invention, the method further comprises:
receiving a first Initiation message sent by the network device based on the BMP, wherein the first Initiation message carries first capability information, and the first capability information indicates that: the network equipment supports deletion of routing table items based on the identification of the acquisition mode;
if the server supports deletion of the routing table entry stored by the server based on the identifier of the acquisition mode, sending a second Initiation message to the network device to inform the network device that the server supports deletion of the routing table entry stored by the server based on the identifier of the acquisition mode, wherein the second Initiation message carries second capability information, and the second capability information indicates that: the server supports deleting the routing table entry stored by the server based on the identification of the acquisition mode.
In one embodiment of the invention, the method further comprises:
receiving a PD packet which is sent by the network device and carries a routing table entry identifier, where the routing table entry identifier is: the identifier of each routing table entry corresponding to the original acquisition mode, which is recorded by the network equipment;
and deleting the routing table entry corresponding to the routing table entry identifier stored in the routing table entry.
In a third aspect, an embodiment of the present invention provides a routing table entry deleting device, which is applied to a network device, where the network device is connected to a server, and the device includes:
the table entry acquisition module is used for acquiring a routing table entry from an RIB (routing information base), and sending the acquired routing table entry and an acquisition mode identifier adopted when the routing table entry is acquired to the server, so that the server stores the routing table entry and the acquisition mode identifier;
the first message sending module is configured to send, to the server, a PD message carrying an identifier of an original acquisition mode based on a BMP in response to each original acquisition mode before change when an acquisition mode for acquiring a routing table entry changes, so that the server deletes a routing table entry corresponding to the original acquisition mode stored in the server.
In one embodiment of the present invention, the apparatus further comprises:
and the capability determining module is used for determining whether the server supports deletion of a routing table entry stored by the server based on the identification of the acquisition mode, and if so, triggering execution of the first message sending module.
In an embodiment of the present invention, the capability determining module is specifically configured to:
sending a first Initiation message to the server based on the BMP, wherein the first Initiation message carries first capability information, and the first capability information indicates that: the network equipment supports deletion of routing table items based on the identification of the acquisition mode;
if a second Initiation message sent by the server and used for responding to the first Initiation message is received, determining that the server supports deletion of a routing table entry stored by the server based on an identification of an acquisition mode, wherein the second Initiation message carries second capability information, and the second capability information indicates that: the server supports deleting the routing table entry stored by the server based on the identification of the acquisition mode.
In an embodiment of the present invention, in the first Initiation packet, the first capability information is stored in a value field in a first TLV, and a value of a type field in the first TLV is 0.
In an embodiment of the present invention, if it is determined that the server does not support deletion of the routing table entry stored in the server based on the identifier of the acquisition mode, the apparatus further includes:
the table entry recording module is used for recording the acquired routing table entries;
a second message sending module, configured to send, based on a BMP, a PD message carrying a routing table entry identifier to the server when an acquisition mode for acquiring a routing table entry changes, so that the server deletes a routing table entry corresponding to the routing table entry identifier stored in the server, where the routing table entry identifier is: and the identifier of each routing table entry corresponding to the original acquisition mode, which is recorded by the network equipment.
In a fourth aspect, an embodiment of the present invention provides a device for deleting a routing table entry, where the device is applied to a server, and the server is connected to a network device, and the device includes:
a table entry receiving module, configured to receive and store a routing table entry sent by the network device and an identifier of an acquisition mode adopted when the network device acquires the routing table entry, where the routing table entry is: the network equipment acquires a routing table entry from the RIB;
a first message receiving module, configured to receive a PD message that carries an identifier of an original acquisition mode and is sent by the network device, where the PD message is: the network device sends the changed acquisition mode of the routing table entry, and the original acquisition mode is as follows: before changing, the network equipment acquires the acquisition mode of the routing table item;
and the first table item deleting module is used for deleting the routing table item which is stored by the first table item deleting module and corresponds to the original acquisition mode based on the identification.
In one embodiment of the present invention, the apparatus further comprises:
a second packet receiving module, configured to receive a first Initiation packet sent by the network device based on a BMP, where the first Initiation packet carries first capability information, and the first capability information indicates: the network equipment supports deletion of routing table items based on the identification of the acquisition mode;
a third packet sending module, configured to send a second Initiation packet to the network device if the server supports deletion of the routing table entry stored in the server based on the identifier of the acquisition mode, so as to notify that the network device supports deletion of the routing table entry stored in the server based on the identifier of the acquisition mode, where the second Initiation packet carries second capability information, and the second capability information indicates: the server supports deleting the routing table entry stored by the server based on the identification of the acquisition mode.
In one embodiment of the present invention, the apparatus further comprises:
a third message receiving module, configured to receive a PD message that is sent by the network device and carries a routing table entry identifier, where the routing table entry identifier is: the identifier of each routing table entry corresponding to the original acquisition mode, which is recorded by the network equipment;
and the second table item deleting module is used for deleting the routing table item corresponding to the routing table item identifier stored in the second table item deleting module.
In a fifth aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface complete communication between the memory and the processor through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of the first or second aspects when executing a program stored in the memory.
In a sixth aspect, the present invention provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the method steps of any one of the first aspect or the second aspect.
In a seventh aspect, an embodiment of the present invention further provides a computer program product including instructions, which, when executed on a computer, cause the computer to perform the method steps of any one of the first aspect or the second aspect.
The embodiment of the invention has the following beneficial effects:
the embodiment of the invention provides a method for deleting a routing table item applied to network equipment, wherein the network equipment is connected with a server, and acquires the routing table item from a RIB (network information base), and sends the acquired routing table item and an acquisition mode identifier adopted when the routing table item is acquired to the server, so that the server end stores the routing table item and the acquisition mode identifier. When the acquisition mode for acquiring the routing table entry changes, a PD message carrying the identifier of the original acquisition mode before the change is sent to the server based on the BMP, so that the server deletes the routing table entry corresponding to the original acquisition mode stored in the server.
As can be seen from the above, after the obtaining mode of the network device for obtaining the routing table entry changes, for each original obtaining mode before the change, the network device may send the PD packet identified by the original obtaining mode to the server, so that the server can delete the routing table entry corresponding to the original obtaining mode stored in the server. And the network device only needs to send the identifier of the original acquisition mode to the server, so that the server can delete each routing table entry corresponding to the original acquisition mode stored in the server, and the network device does not need to respectively inform the server to delete each routing table entry corresponding to the original acquisition mode.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art according to the drawings.
Fig. 1 is a schematic flowchart of a first method for deleting a routing table entry according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a second method for deleting a routing table entry according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a third method for deleting a routing table entry according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating a fourth method for deleting a routing table entry according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of a fifth method for deleting a routing table entry according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a first routing table entry deleting device according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a second routing table entry deleting device according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of another electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived from the embodiments given herein by one of ordinary skill in the art, are within the scope of the invention.
In order to delete a routing table entry stored in a server, embodiments of the present invention provide a method and an apparatus for deleting a routing table entry.
The embodiment of the invention provides a method for deleting a routing table item, which is applied to network equipment, wherein the network equipment is connected with a server, and the method comprises the following steps:
acquiring a routing table entry from an RIB, and sending the acquired routing table entry and an identification of an acquisition mode adopted when the routing table entry is acquired to the server, so that the server stores the routing table entry and the identification of the acquisition mode;
when the acquisition mode for acquiring the routing table entry changes, a PD message carrying the identifier of the original acquisition mode is sent to the server based on the BMP aiming at each original acquisition mode before the change, so that the server deletes the routing table entry corresponding to the original acquisition mode stored by the server.
As can be seen from the above, after the obtaining mode of the network device for obtaining the routing table entry changes, for each original obtaining mode before the change, the network device may send the PD packet identified by the original obtaining mode to the server, so that the server can delete the routing table entry corresponding to the original obtaining mode stored in the server. And the network device only needs to send the identifier of the original acquisition mode to the server, so that the server can delete each routing table entry corresponding to the original acquisition mode stored in the server, and the network device does not need to respectively inform the server to delete each routing table entry corresponding to the original acquisition mode.
Referring to fig. 1, a schematic flowchart of a first method for deleting a routing table entry according to an embodiment of the present invention is applied to a network device, where the network device is connected to a server. The above method includes the following steps S101-S102.
Specifically, the server may monitor the routing table entry obtained by the network device based on the BMP.
The network device may be a switch, a router, or the like. The server may be referred to as a monitoring end or a server end as a monitoring device, and the network device may be referred to as a monitored end or a client end as a monitored device. The same server may monitor multiple network devices, or the same network device may be monitored by multiple servers. The server may monitor the network device based on the monitoring software ODL BMP.
S101: and acquiring a routing table entry from the RIB, and sending the acquired routing table entry and an identification of an acquisition mode adopted when the routing table entry is acquired to the server, so that the server stores the routing table entry and the identification of the acquisition mode.
Specifically, the routing table entry obtained by the network device may be a routing table entry obtained by the network device based on BGP and sent by its own BGP neighbor, and the obtained routing table entry is a routing table entry contained In Adj-RIB-In reported by the BGP neighbor based on RFC 7854. The Adj-RIB-In is contained In a Routing Information Base (RIB).
In addition, the above-mentioned network device from the RIB routing table entry may also be a routing table entry that the above-mentioned network device sends to the BGP neighbor based on BGP, and the obtained routing table entry is a routing table entry that the network device sends to the BGP neighbor based on RFC8671 and is included in Adj-RIB-Out. The Adj-RIB-Out mentioned above is contained in the RIB.
Furthermore, the network device may obtain the routing table entry as a routing table entry included In Adj-RIB-In and Adj-RIB-Out.
In an embodiment of the present invention, an address of a connected server and a port number of the server for monitoring a client may be configured in a network device, so as to establish a TCP (Transmission Control Protocol) connection between the network device and the server. The network device may send routing table entries to the server based on TCP.
The network device may encapsulate a BMP message header before the routing table entry, encapsulate BGP UPDATE (Border Gateway Protocol UPDATE) information after the routing table entry, generate a BGP message, and after receiving the BGP message, the server may analyze the BGP message based on BGP and BMP to obtain the routing table entry included therein. The way in which the network device generates the BGP message by encapsulation and the server parses the BGP message is similar to that in the prior art, and is not described here again.
In addition, the routing table entry sent by the network device to the server carries an identifier of an acquisition mode adopted by the network device when acquiring the routing table entry, and the network device may acquire the routing table entry based on one or more different acquisition modes.
Specifically, the mode of the network device obtaining the routing table entry may be: a pre-policy RM pattern and/or a post-policy RM pattern.
The user can control the network device to obtain the mode of the routing table item based on the application scene, the network device can obtain the original routing table item before the strategy processing based on the pre-policy RM mode, and the network device can obtain the routing table item after the strategy processing based on the post-policy RM mode. The network device may select the obtained routing table entry based on the set policy, or may adjust attribute information included in the obtained routing table entry based on the policy, or the like.
S102: when the acquisition mode for acquiring the routing table entry changes, a PD message carrying the identifier of the original acquisition mode is sent to the server based on the BMP aiming at each original acquisition mode before the change, so that the server deletes the routing table entry corresponding to the original acquisition mode stored by the server.
Specifically, if the network device obtains the routing table entry based on multiple different obtaining modes, where multiple different obtaining modes that change may exist, for each original obtaining mode before the change, the network device may send a PD (Peer Down) packet carrying an identifier of the original obtaining mode to the server, so that the server deletes the routing table entry corresponding to the original obtaining mode stored in the server after receiving the PD packet.
In an embodiment of the present invention, a PD packet generated based on a BMP is used to instruct a server to delete a routing table entry stored in the server, and after the server receives the PD packet, an identifier of an original acquisition mode carried in the PD packet may be determined, and a routing table entry corresponding to the original acquisition mode may be determined to be deleted. Because the routing table entry stored by the server contains the identifier of the acquisition mode adopted when the network device acquires the routing table entry, the routing table entry containing the identifier of the original acquisition mode can be searched from the stored routing table entries to serve as the routing table entry corresponding to the original acquisition mode, and then the searched routing table entry is deleted.
As can be seen from the above, after the obtaining mode of the network device for obtaining the routing table entry changes, for each original obtaining mode before the change, the network device may send the PD packet identified by the original obtaining mode to the server, so that the server can delete the routing table entry corresponding to the original obtaining mode stored in the server. And the network device only needs to send the identifier of the original acquisition mode to the server, so that the server can delete each routing table entry corresponding to the original acquisition mode stored in the server, and the network device does not need to respectively inform the server to delete each routing table entry corresponding to the original acquisition mode.
In addition, since the network device only needs to send the identifier of the original acquisition mode to the server, the server can delete the routing table entry corresponding to the original acquisition mode stored in the server based on the identifier of the original acquisition mode, and therefore after the acquired routing table entry is sent to the server, the network device does not need to record the routing table entry corresponding to the original acquisition mode acquired by the network device, and does not influence a subsequent server to delete the routing table entry, so that the storage space of the network device can be saved.
Referring to fig. 2, a flowchart of a second method for deleting a routing table entry according to an embodiment of the present invention is shown, and compared with the embodiment shown in fig. 1, after the step S101, the method further includes the following step S103.
S103: and determining whether the server supports deleting the routing table entry stored by the server based on the identification of the acquisition mode.
Specifically, the network device may record a server identifier of a server that supports deletion of a routing table entry stored in the server based on the identifier of the acquisition mode, and if the network device records the server identifier of the server, the network device may determine that the server supports deletion of the routing table entry stored in the server based on the identifier of the acquisition mode.
The server identifier recorded in the network device may be written by a user.
In another embodiment of the present invention, the above step S103 may also be implemented based on the following steps a-B.
Step A: and sending a first Initiation message to the server based on the BMP.
Wherein, the first Initiation packet carries first capability information, and the first capability information indicates: the network device supports deletion of routing table entries based on the identification of the acquisition mode.
Specifically, according to the specification of the BMP, after the TCP connection is established between the network device and the server, the network device may send an Initiation message to the server to send the information related to the network device to the server.
The first capability information may be identified in the form of characters, character strings, numbers, and the like. For example, the network device may be represented by a number "1" to support deletion of routing table entries based on the identification of the acquisition mode.
The embodiment of the invention can add the first capability information in the Initiation message to generate the first Initiation message, and send the first Initiation message to the server to inform the server that the network equipment supports the identifier based on the acquisition mode to delete the routing table item.
And B: and if a second Initiation message which is sent by the server and used for responding to the first Initiation message is received, determining that the server supports deleting the routing table entry stored by the server based on the identification of the acquisition mode.
Wherein, the second Initiation message carries second capability information, and the second capability information indicates: the server supports deleting the routing table entry stored by the server based on the identification of the acquisition mode.
Specifically, if the server receives the first Initiation message and determines that the server supports deletion of the routing table entry stored in the server based on the identifier of the acquisition mode, the server may feed back a second Initiation message carrying second capability information to the server to notify the network device that the server also supports deletion of the routing table entry stored in the server based on the identifier of the acquisition mode, and the further network device may execute step S103, and send a PD message carrying the identifier of the original acquisition mode to the server to delete the routing table entry corresponding to the original acquisition mode in the server.
If the server does not support the identifier based on the acquisition mode to delete the routing table entry stored by the server, the server may not reply any message to the network device, or reply a third Initiation message carrying third capability information indicating that the server does not support the identifier based on the acquisition mode to delete the routing table entry stored by the server. That is, if the network device does not receive the second Initiation packet, it may be determined that the server does not support the identifier-based route deletion table entry based on the acquisition mode.
In addition, the information in the first Initiation packet may be stored in a TLV (Type Length value) format, the first capability information may be stored in a value field in the first TLV, a value of a Type field in the first TLV is 0, and the information stored in the value field in the first TLV is represented in a form of a character string.
In an embodiment of the present invention, if the server supports deleting the routing table entry stored in the server based on the identifier of the obtaining mode, after the obtaining mode of obtaining the routing table entry is changed, step S102 may be executed. Otherwise, the network device may be controlled to delete the routing table entry corresponding to the original acquisition mode stored in the network device based on other manners, for example, a routing table entry deleting method in the prior art.
As can be seen from the above, before sending the PD packet carrying the identifier of the original acquisition mode to the server to control the server to delete the routing table entry corresponding to the original acquisition mode stored in the server, the embodiment of the present invention may further determine in advance whether the server supports deletion of the routing table entry stored in the server based on the identifier of the acquisition mode, and if the server has the above capability, send the PD packet carrying the identifier of the original acquisition mode to the server. After the PD message carrying the identifier of the original acquisition mode is sent to the server, the server can complete the deletion of the routing table item based on the identifier of the original acquisition mode.
Referring to fig. 3, a flowchart of a third method for deleting a routing table entry according to an embodiment of the present invention is shown, where, compared with the foregoing embodiment shown in fig. 2, if it is determined that the server does not support deletion of a routing table entry stored in the server based on the identifier of the acquisition mode in step S102, the method further includes the following steps S104 to S105.
S104: and recording the acquired routing table entry.
S105: when the obtaining mode of obtaining the routing table entry changes, sending a PD message carrying a routing table entry identifier to the server based on the BMP, so that the server deletes the routing table entry corresponding to the routing table entry identifier stored by the server.
Wherein, the routing table entry identifier is: and the identifier of each routing table entry corresponding to the original acquisition mode, which is recorded by the network equipment.
Specifically, the routing table entry identifier may be a number of the routing table entry, a source address and a destination address included in the routing table entry, and the like. After the server receives the PD packet carrying the routing table identifier, the server may search for a routing table entry corresponding to the routing table entry identifier based on the routing table entry identifier in the PD packet, and delete the searched routing table entry.
The network device records the acquired routing table entry so as to notify the server to delete the routing table entry after the acquisition mode is changed, so that the network device can delete the recorded routing table entry corresponding to the original acquisition mode after sending the PD message carrying the routing table entry identifier to the server.
As can be seen from the above, if the server does not support the identifier based on the acquisition mode to delete the routing table entry stored in the server, even if the network device sends the PD packet carrying the identifier of the original acquisition mode to the server, the server cannot delete the routing table entry corresponding to the original acquisition mode. Therefore, the network device can respectively send the routing table item identifier of each routing table item acquired based on the original acquisition mode to the server through the PD message, so that the server can respectively delete the routing table item corresponding to each routing table item identifier based on each routing table item identifier.
Corresponding to the foregoing method for deleting a routing table entry applied to a network device, an embodiment of the present invention further provides a method for deleting a routing table entry applied to a server.
Referring to fig. 4, a flowchart of a fourth method for deleting a routing table entry according to an embodiment of the present invention is applied to a network device, where the server is connected to the network device, and the method includes the following steps S401 to S403.
S401: and receiving and storing the routing table item sent by the network equipment and the identification of the acquisition mode adopted by the network equipment when acquiring the routing table item.
Wherein, the routing table entry is: and the network equipment acquires the routing table entry from the RIB.
Specifically, the network device may send the routing table entry to the server based on TCP. The routing table entry includes an identifier of an acquisition mode based on which the network device acquires the routing table entry.
S402: and receiving the PD message which is sent by the network equipment and carries the identifier of the original acquisition mode.
Wherein, the PD message is: the network device sends the changed acquisition mode of the routing table entry, where the original acquisition mode is: before the change, the network device obtains the obtaining mode of the routing table entry.
Specifically, after the obtaining mode of the network device for obtaining the routing table entry changes, the network device sends a PD message to the server to instruct the server to delete the routing table entry.
S403: and based on the identification, deleting the routing table entry which is stored by the routing table entry and corresponds to the original acquisition mode.
Specifically, the server may search for a routing table entry corresponding to the original acquisition mode stored in the server based on the identifier of the original acquisition mode, and delete the searched routing table entry.
As can be seen from the above, after the acquisition mode of the network device for acquiring the routing table entry changes, the network device may send the PD packet carrying the identifier of the original acquisition mode to the server, and the server may delete the routing table entry corresponding to the original acquisition mode stored in the server after receiving the PD packet. Moreover, the network device only needs to send the identifier of the original acquisition mode to the server, the server can delete each routing table entry corresponding to the original acquisition mode stored in the server, and the server does not need to receive messages sent by the network device and informing the server to delete the routing table entry corresponding to the original acquisition mode, and then deletes each routing table entry corresponding to the original acquisition mode. The method for deleting the routing table entry by applying the scheme provided by the embodiment of the invention is simpler and has higher efficiency.
Referring to fig. 5, a flowchart of a fifth method for deleting a routing table entry according to an embodiment of the present invention is shown, where, compared with the foregoing embodiment shown in fig. 4, after step S401, the method further includes the following steps S404 to S405.
S404: and receiving a first Initiation message sent by the network equipment based on the BMP.
Wherein, the first Initiation packet carries first capability information, and the first capability information indicates: the network device supports deletion of routing table entries based on the identification of the acquisition mode.
S405: if the server supports the identifier based on the acquisition mode to delete the routing table entry stored by the server, a second Initiation message is sent to the network equipment to inform the network equipment that the identifier based on the acquisition mode supports the identifier based on the acquisition mode to delete the routing table entry stored by the network equipment.
Wherein, the second Initiation message carries second capability information, and the second capability information indicates: the server supports deleting the routing table entry stored by the server based on the identification of the acquisition mode.
Specifically, after the server sends the second Initiation packet to the network device, the network device may determine that the server may support deletion of the routing table entry stored in the server based on the identifier of the acquisition mode. The network device may send the PD packet carrying the identifier of the original acquisition mode to the network device to delete the routing table entry corresponding to the original acquisition mode stored in the server, and the server may delete the routing table entry through step S403 after receiving the PD packet.
In addition, if the server does not support the identifier based on the acquisition mode to delete the routing table entry, no message may be sent to the network device, or a third Initiation message carrying third capability information is sent to the network device, where the third capability information indicates that the server does not support the identifier based on the acquisition mode to delete the routing table entry, and the network device may determine that the server does not support the identifier based on the acquisition mode to delete the routing table entry, and may delete the routing table entry in the server in other manners.
As can be seen from the above, before the network device sends the PD packet to the server, the network device may first notify the server through the first Initiation packet that the network device supports deletion of the routing table entry recorded in the network device based on the identifier of the acquisition mode, and if the server also supports deletion of the routing table entry recorded in the network device based on the identifier of the acquisition mode, the network device may send the second Initiation packet to the network device, so that the network device determines that the server also supports deletion of the routing table entry based on the identifier of the acquisition mode, and thus on this basis, the network device further sends the PD packet carrying the identifier of the original acquisition mode to the server, and can ensure that the routing table entry corresponding to the original acquisition mode recorded in the server can be deleted.
In another embodiment of the present invention, if the server does not support the deletion of the routing table entry based on the identifier of the acquisition mode, the server may delete the routing table entry stored in the server through the following steps C to D.
And C: and receiving the PD message which is sent by the network equipment and carries the routing table item identifier.
Wherein, the routing table entry identifier is: and the identifier of each routing table entry corresponding to the original acquisition mode, which is recorded by the network equipment.
Step D: and deleting the routing table entry corresponding to the routing table entry identifier stored in the routing table entry.
Specifically, the routing table entry corresponding to each routing table entry identifier may be searched in the stored routing table entries, and the searched routing table entry may be deleted.
As can be seen from the above, if the server does not support the identifier based on the acquisition mode to delete the routing table entry stored in the server, even if the network device sends the PD packet carrying the identifier of the original acquisition mode to the server, the server cannot delete the routing table entry corresponding to the original acquisition mode. Therefore, the network device can respectively send the routing table item identifier of each routing table item acquired based on the original acquisition mode to the server through the PD message, and after receiving the PD message, the server can respectively delete the routing table item corresponding to each routing table item identifier based on each routing table item identifier.
Referring to fig. 6, a schematic structural diagram of a first routing table entry deleting device provided in an embodiment of the present invention is applied to a network device, where the network device is connected to a server, and the device includes:
a table entry obtaining module 601, configured to obtain a routing table entry from an RIB, and send the obtained routing table entry and an identifier of an obtaining mode used when obtaining the routing table entry to the server, so that the server stores the routing table entry and the identifier of the obtaining mode;
a first message sending module 602, configured to send, when an obtaining mode for obtaining a routing table entry changes, a PD message carrying an identifier of an original obtaining mode to the server based on a BMP according to each original obtaining mode before the change, so that the server deletes a routing table entry corresponding to the original obtaining mode stored in the server.
As can be seen from the above, after the obtaining mode of the network device for obtaining the routing table entry changes, for each original obtaining mode before the change, the network device may send the PD packet identified by the original obtaining mode to the server, so that the server can delete the routing table entry corresponding to the original obtaining mode stored in the server. And the network device only needs to send the identifier of the original acquisition mode to the server, so that the server can delete each routing table entry corresponding to the original acquisition mode stored in the server, and the network device does not need to respectively inform the server to delete each routing table entry corresponding to the original acquisition mode.
In addition, since the network device only needs to send the identifier of the original acquisition mode to the server, the server can delete the routing table entry corresponding to the original acquisition mode stored in the server based on the identifier of the original acquisition mode, and therefore after the acquired routing table entry is sent to the server, the network device does not need to record the routing table entry corresponding to the original acquisition mode acquired by the network device, and does not influence a subsequent server to delete the routing table entry, so that the storage space of the network device can be saved.
In one embodiment of the present invention, the apparatus further comprises:
a capability determining module, configured to determine whether the server supports deleting a routing table entry stored in the server based on the identifier of the acquisition mode, and if so, trigger execution of the first packet sending module 602.
As can be seen from the above, before sending the PD packet carrying the identifier of the original acquisition mode to the server to control the server to delete the routing table entry corresponding to the original acquisition mode stored in the server, the embodiment of the present invention may further determine in advance whether the server supports deletion of the routing table entry stored in the server based on the identifier of the acquisition mode, and if the server has the above capability, send the PD packet carrying the identifier of the original acquisition mode to the server. After the PD message carrying the identifier of the original acquisition mode is sent to the server, the server can complete the deletion of the routing table item based on the identifier of the original acquisition mode.
In an embodiment of the present invention, the capability determining module is specifically configured to:
sending a first Initiation message to the server based on the BMP, wherein the first Initiation message carries first capability information, and the first capability information indicates that: the network equipment supports deletion of routing table items based on the identification of the acquisition mode;
if a second Initiation message sent by the server and used for responding to the first Initiation message is received, determining that the server supports deletion of a routing table entry stored by the server based on an identification of an acquisition mode, wherein the second Initiation message carries second capability information, and the second capability information indicates that: the server supports deleting the routing table entry stored by the server based on the identification of the acquisition mode.
In an embodiment of the present invention, in the first Initiation packet, the first capability information is stored in a value field in a first TLV, and a value of a type field in the first TLV is 0.
In an embodiment of the present invention, if it is determined that the server does not support deletion of the routing table entry stored in the server based on the identifier of the acquisition mode, the apparatus further includes:
the table entry recording module is used for recording the acquired routing table entries;
a second message sending module, configured to send, based on a BMP, a PD message carrying a routing table entry identifier to the server when an acquisition mode for acquiring a routing table entry changes, so that the server deletes a routing table entry corresponding to the routing table entry identifier stored in the server, where the routing table entry identifier is: and the identifier of each routing table entry corresponding to the original acquisition mode, which is recorded by the network equipment.
As can be seen from the above, if the server does not support the identifier based on the acquisition mode to delete the routing table entry stored in the server, even if the network device sends the PD packet carrying the identifier of the original acquisition mode to the server, the server cannot delete the routing table corresponding to the original acquisition mode. Therefore, the network device can respectively send the routing table item identifier of each routing table item acquired based on the original acquisition mode to the server through the PD message, so that the server can respectively delete the routing table item corresponding to each routing table item identifier based on each routing table item identifier.
Referring to fig. 7, a schematic structural diagram of a second routing table entry deleting device according to an embodiment of the present invention is applied to a server, where the server is connected to a network device, and the device includes:
a table entry receiving module 701, configured to receive and store a routing table entry sent by the network device and an identifier of an acquisition mode adopted when the network device acquires the routing table entry, where the routing table entry is: the network equipment acquires a routing table entry from the RIB;
a first packet receiving module 702, configured to receive a PD packet that carries an identifier of an original acquisition mode and is sent by the network device, where the PD packet is: the network device sends the changed acquisition mode of the routing table entry, and the original acquisition mode is as follows: before changing, the network equipment acquires the acquisition mode of the routing table item;
a first table deletion module 703 is configured to delete, based on the identifier, a routing table stored in the first table deletion module and corresponding to the original acquisition mode.
As can be seen from the above, after the acquisition mode of the network device for acquiring the routing table entry changes, the network device may send the PD packet carrying the identifier of the original acquisition mode to the server, and the server may delete the routing table entry corresponding to the original acquisition mode stored in the server after receiving the PD packet. Moreover, the network device only needs to send the identifier of the original acquisition mode to the server, the server can delete each routing table entry corresponding to the original acquisition mode stored in the server, and the server does not need to receive messages sent by the network device and informing the server to delete the routing table entry corresponding to the original acquisition mode, and then deletes each routing table entry corresponding to the original acquisition mode. The method for deleting the routing table entry by applying the scheme provided by the embodiment of the invention is simpler and has higher efficiency.
In an embodiment of the present invention, the apparatus further includes:
a second packet receiving module, configured to receive a first Initiation packet sent by the network device based on a BMP, where the first Initiation packet carries first capability information, and the first capability information indicates: the network equipment supports deletion of routing table items based on the identification of the acquisition mode;
a third packet sending module, configured to send a second Initiation packet to the network device if the server supports deletion of the routing table entry stored in the server based on the identifier of the acquisition mode, so as to notify that the network device supports deletion of the routing table entry stored in the server based on the identifier of the acquisition mode, where the second Initiation packet carries second capability information, and the second capability information indicates: the server supports deleting the routing table entry stored by the server based on the identification of the acquisition mode.
As can be seen from the above, before the network device sends the PD packet to the server, the network device may first notify the server through the first Initiation packet that the network device supports deletion of the routing table entry recorded in the network device based on the identifier of the acquisition mode, and if the server also supports deletion of the routing table entry recorded in the network device based on the identifier of the acquisition mode, the network device may send the second Initiation packet to the network device, so that the network device determines that the server also supports deletion of the routing table entry based on the identifier of the acquisition mode, and thus on this basis, the network device further sends the PD packet carrying the identifier of the original acquisition mode to the server, and can ensure that the routing table entry corresponding to the original acquisition mode recorded in the server can be deleted.
In an embodiment of the present invention, the apparatus further includes:
a third message receiving module, configured to receive a PD message that is sent by the network device and carries a routing table entry identifier, where the routing table entry identifier is: the identifier of each routing table entry corresponding to the original acquisition mode, which is recorded by the network equipment;
and the second table item deleting module is used for deleting the routing table item corresponding to the routing table item identifier stored in the second table item deleting module.
As can be seen from the above, if the server does not support the identifier based on the acquisition mode to delete the routing table entry stored in the server, even if the network device sends the PD packet carrying the identifier of the original acquisition mode to the server, the server cannot delete the routing table entry corresponding to the original acquisition mode. Therefore, the network device can respectively send the routing table item identifier of each routing table item acquired based on the original acquisition mode to the server through the PD message, and after receiving the PD message, the server can respectively delete the routing table item corresponding to each routing table item identifier based on each routing table item identifier.
An embodiment of the present invention further provides an electronic device, as shown in fig. 8, which includes a processor 801, a communication interface 802, a memory 803, and a communication bus 804, where the processor 801, the communication interface 802, and the memory 803 complete mutual communication through the communication bus 804,
a memory 803 for storing a computer program;
the processor 801 is configured to implement the above-described method for deleting a routing table entry applied to a network device when executing a program stored in the memory 803.
When the electronic device provided by the embodiment of the present invention deletes a routing table entry, after the acquisition mode of the network device for acquiring a routing table entry changes, for each original acquisition mode before the change, the network device may send a PD packet identified by the original acquisition mode to the server, so that the server can delete the routing table entry corresponding to the original acquisition mode stored in the server. And the network device only needs to send the identifier of the original acquisition mode to the server, so that the server can delete each routing table entry corresponding to the original acquisition mode stored in the server, and the network device does not need to respectively inform the server to delete each routing table entry corresponding to the original acquisition mode.
In addition, since the network device only needs to send the identifier of the original acquisition mode to the server, the server can delete the routing table entry corresponding to the original acquisition mode stored in the server based on the identifier of the original acquisition mode, and therefore after the acquired routing table entry is sent to the server, the network device does not need to record the routing table entry corresponding to the original acquisition mode acquired by the network device, and does not influence a subsequent server to delete the routing table entry, so that the storage space of the network device can be saved.
An embodiment of the present invention further provides an electronic device, as shown in fig. 9, which includes a processor 901, a communication interface 902, a memory 903, and a communication bus 904, where the processor 901, the communication interface 902, and the memory 903 complete mutual communication through the communication bus 904,
a memory 903 for storing computer programs;
the processor 901 is configured to implement the above-described method for deleting a routing table entry applied to a server when executing a program stored in the memory 903.
When the electronic device provided by the embodiment of the invention is used for deleting the routing table entry, after the acquisition mode of the network device for acquiring the routing table entry changes, the network device can send the PD message carrying the identifier of the original acquisition mode to the server, and the server can delete the routing table entry corresponding to the original acquisition mode stored in the server after receiving the PD message. Moreover, the network device only needs to send the identifier of the original acquisition mode to the server, the server can delete each routing table entry corresponding to the original acquisition mode stored in the server, and the server does not need to receive messages sent by the network device and informing the server to delete the routing table entry corresponding to the original acquisition mode, and then deletes each routing table entry corresponding to the original acquisition mode. The method for deleting the routing table entry by applying the scheme provided by the embodiment of the invention is simpler and has higher efficiency.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements any of the above steps of the method for deleting a routing table entry applied to a network device.
When deleting a routing table entry by using the computer program stored in the computer-readable storage medium provided in this embodiment, after the network device changes the acquisition mode for acquiring a routing table entry, for each original acquisition mode before the change, the network device may send a PD packet identified by the original acquisition mode to the server, so that the server can delete the routing table entry corresponding to the original acquisition mode stored in the server. And the network device only needs to send the identifier of the original acquisition mode to the server, so that the server can delete each routing table entry corresponding to the original acquisition mode stored in the server, and the network device does not need to respectively inform the server to delete each routing table entry corresponding to the original acquisition mode.
In addition, since the network device only needs to send the identifier of the original acquisition mode to the server, the server can delete the routing table entry corresponding to the original acquisition mode stored in the server based on the identifier of the original acquisition mode, and therefore after the acquired routing table entry is sent to the server, the network device does not need to record the routing table entry corresponding to the original acquisition mode acquired by the network device, and does not influence a subsequent server to delete the routing table entry, so that the storage space of the network device can be saved.
In still another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the above-mentioned routing table item deleting methods applied to a server.
When deleting a routing table entry by using a computer program stored in the computer-readable storage medium provided in this embodiment, after the acquisition mode of the network device for acquiring the routing table entry changes, the network device may send a PD packet carrying an identifier of an original acquisition mode to a server, and the server may delete a routing table entry corresponding to the original acquisition mode stored in the server after receiving the PD packet. Moreover, the network device only needs to send the identifier of the original acquisition mode to the server, the server can delete each routing table entry corresponding to the original acquisition mode stored in the server, and the server does not need to receive messages sent by the network device and informing the server to delete the routing table entry corresponding to the original acquisition mode, and then deletes each routing table entry corresponding to the original acquisition mode. The method for deleting the routing table entry by applying the scheme provided by the embodiment of the invention is simpler and has higher efficiency.
In another embodiment, the present invention further provides a computer program product containing instructions, which when run on a computer, causes the computer to execute any of the above-mentioned methods for deleting a routing table entry applied to a network device.
When the computer program product provided in this embodiment is executed to delete a routing table entry, after the acquisition mode for acquiring a routing table entry is changed, for each original acquisition mode before the change, the network device may send a PD packet identified by the original acquisition mode to the server, so that the server can delete a routing table entry corresponding to the original acquisition mode stored in the server. And the network device only needs to send the identifier of the original acquisition mode to the server, so that the server can delete each routing table entry corresponding to the original acquisition mode stored in the server, and the network device does not need to respectively inform the server to delete each routing table entry corresponding to the original acquisition mode.
In addition, since the network device only needs to send the identifier of the original acquisition mode to the server, the server can delete the routing table entry corresponding to the original acquisition mode stored in the server based on the identifier of the original acquisition mode, and therefore after the acquired routing table entry is sent to the server, the network device does not need to record the routing table entry corresponding to the original acquisition mode acquired by the network device, and does not influence a subsequent server to delete the routing table entry, so that the storage space of the network device can be saved.
In yet another embodiment of the present invention, there is also provided a computer program product containing instructions, which when run on a computer, cause the computer to execute any of the above-mentioned methods for deleting a routing table entry applied to a server.
When the computer program product provided in this embodiment is executed to delete a routing table entry, after the acquisition mode for acquiring the routing table entry is changed, the network device may send a PD packet carrying an identifier of an original acquisition mode to the server, and the server may delete a routing table entry corresponding to the original acquisition mode stored in the server after receiving the PD packet. Moreover, the network device only needs to send the identifier of the original acquisition mode to the server, the server can delete each routing table entry corresponding to the original acquisition mode stored in the server, and the server does not need to receive messages sent by the network device and informing the server to delete the routing table entry corresponding to the original acquisition mode, and then deletes each routing table entry corresponding to the original acquisition mode. The method for deleting the routing table entry by applying the scheme provided by the embodiment of the invention is simpler and has higher efficiency.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, the electronic device, the computer-readable storage medium, and the computer program product embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and in relation to them, reference may be made to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A method for deleting a routing table entry is applied to a network device, wherein the network device is connected with a server, and the method comprises the following steps:
acquiring a routing table entry from a routing information base RIB, and sending the acquired routing table entry and an identification of an acquisition mode adopted when the routing table entry is acquired to the server, so that the server stores the routing table entry and the identification of the acquisition mode;
when the obtaining mode of obtaining the routing table entry changes, sending an opposite terminal closing PD message carrying the identification of the original obtaining mode to the server based on a border gateway monitoring protocol (BMP) aiming at each original obtaining mode before the change, so that the server deletes the routing table entry corresponding to the original obtaining mode stored by the server.
2. The method of claim 1, wherein after the obtaining a routing table entry from the RIB and sending the obtained routing table entry and an identification of an acquisition mode used in obtaining the routing table entry to the server, so that the server stores the routing table entry and the identification of the acquisition mode, further comprising:
determining whether the server supports deletion of a routing table entry stored by the server based on the identification of the acquisition mode;
if so, when the acquisition mode for acquiring the routing table entry changes, sending a PD message carrying the identifier of the original acquisition mode to the server based on the BMP aiming at each original acquisition mode before the change.
3. The method of claim 2, wherein the determining whether the server supports deleting its own stored routing table entry based on the identification of the acquisition mode comprises:
sending a first initial Initiation message to the server based on the BMP, wherein the first Initiation message carries first capability information, and the first capability information indicates that: the network equipment supports deletion of routing table items based on the identification of the acquisition mode;
if a second Initiation message sent by the server and used for responding to the first Initiation message is received, determining that the server supports deletion of a routing table entry stored by the server based on an identification of an acquisition mode, wherein the second Initiation message carries second capability information, and the second capability information indicates that: the server supports deleting the routing table entry stored by the server based on the identification of the acquisition mode.
4. The method of claim 3, wherein the first capability information is stored in a value field in a first type length value TLV in the first Initiation packet, and wherein a value of the type field in the first TLV is 0.
5. The method according to any of claims 2-4, wherein if it is determined that the server does not support deletion of its own stored routing table entry based on the obtaining mode identification, after the obtaining of the routing table entry from the RIB, further comprising:
recording the obtained routing table entry;
when the obtaining mode of obtaining the routing table entry changes, the method further comprises the following steps:
sending a PD message carrying a routing table item identifier to the server based on the BMP, so that the server deletes a routing table item corresponding to the routing table item identifier stored by the server, wherein the routing table item identifier is as follows: and the identifier of each routing table entry corresponding to the original acquisition mode, which is recorded by the network equipment.
6. A method for deleting a routing table entry is applied to a server, wherein the server is connected with a network device, and the method comprises the following steps:
receiving and storing a routing table entry sent by the network device and an identification of an acquisition mode adopted when the network device acquires the routing table entry, wherein the routing table entry is: the network equipment acquires a routing table entry from the RIB;
receiving a PD packet carrying an identifier of an original acquisition mode sent by the network device, where the PD packet is: the network device sends the changed acquisition mode of the routing table entry, and the original acquisition mode is as follows: before changing, the network equipment acquires the acquisition mode of the routing table item;
and deleting the routing table entry corresponding to the original acquisition mode stored by the router based on the identification.
7. The method of claim 6, further comprising:
receiving a first Initiation message sent by the network device based on the BMP, wherein the first Initiation message carries first capability information, and the first capability information indicates that: the network equipment supports deletion of routing table items based on the identification of the acquisition mode;
if the server supports deletion of the routing table entry stored by the server based on the identifier of the acquisition mode, sending a second Initiation message to the network device to inform the network device that the server supports deletion of the routing table entry stored by the server based on the identifier of the acquisition mode, wherein the second Initiation message carries second capability information, and the second capability information indicates that: the server supports deleting the routing table entry stored by the server based on the identification of the acquisition mode.
8. The method according to claim 6 or 7, characterized in that the method further comprises:
receiving a PD packet which is sent by the network device and carries a routing table entry identifier, where the routing table entry identifier is: the identifier of each routing table entry corresponding to the original acquisition mode, which is recorded by the network equipment;
and deleting the routing table entry corresponding to the routing table entry identifier stored in the routing table entry.
9. A device for deleting a routing table entry, applied to a network device, where the network device is connected to a server, the device comprising:
the table entry acquisition module is used for acquiring a routing table entry from an RIB (routing information base), and sending the acquired routing table entry and an acquisition mode identifier adopted when the routing table entry is acquired to the server, so that the server stores the routing table entry and the acquisition mode identifier;
the first message sending module is configured to send, to the server, a PD message carrying an identifier of an original acquisition mode based on a BMP in response to each original acquisition mode before change when an acquisition mode for acquiring a routing table entry changes, so that the server deletes a routing table entry corresponding to the original acquisition mode stored in the server.
10. A routing table item deleting device, applied to a server, where the server is connected to a network device, the device comprising:
a table entry receiving module, configured to receive and store a routing table entry sent by the network device and an identifier of an acquisition mode adopted when the network device acquires the routing table entry, where the routing table entry is: the network equipment acquires a routing table entry from the RIB;
a first message receiving module, configured to receive a PD message that carries an identifier of an original acquisition mode and is sent by the network device, where the PD message is: the network device sends the changed acquisition mode of the routing table entry, and the original acquisition mode is as follows: before changing, the network equipment acquires the acquisition mode of the routing table item;
and the first table item deleting module is used for deleting the routing table item which is stored by the first table item deleting module and corresponds to the original acquisition mode based on the identification.
CN202111189302.4A 2021-10-12 2021-10-12 Method and device for deleting routing table entries Active CN113794644B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111189302.4A CN113794644B (en) 2021-10-12 2021-10-12 Method and device for deleting routing table entries

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111189302.4A CN113794644B (en) 2021-10-12 2021-10-12 Method and device for deleting routing table entries

Publications (2)

Publication Number Publication Date
CN113794644A true CN113794644A (en) 2021-12-14
CN113794644B CN113794644B (en) 2023-05-26

Family

ID=78877904

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111189302.4A Active CN113794644B (en) 2021-10-12 2021-10-12 Method and device for deleting routing table entries

Country Status (1)

Country Link
CN (1) CN113794644B (en)

Citations (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7007100B1 (en) * 2000-12-20 2006-02-28 Nortel Networks Limited Method for synchronization of multicast routing table changes with a plurality of multicast routing protocols
CN102300275A (en) * 2010-06-22 2011-12-28 华为终端有限公司 Switching method in communication process and local route control function entity
CN102412984A (en) * 2011-10-24 2012-04-11 杭州华三通信技术有限公司 Management method and equipment for forwarded table entry
CN102437960A (en) * 2011-12-21 2012-05-02 福建星网锐捷网络有限公司 Detection processing method and system of cluster mode, and network equipment
WO2016011850A1 (en) * 2014-07-23 2016-01-28 华为技术有限公司 Network device and method for sending bgp information
CN106059924A (en) * 2016-08-19 2016-10-26 华为技术有限公司 Information management method, devices and system
CN106161256A (en) * 2016-07-26 2016-11-23 杭州华三通信技术有限公司 A kind of processing method and processing device of Border Gateway Protocol (BGP) route
CN106506376A (en) * 2016-10-27 2017-03-15 杭州华三通信技术有限公司 A kind of initial routing iinformation sending method of monitored neighbours and device
CN106899501A (en) * 2017-03-30 2017-06-27 重庆金美通信有限责任公司 A kind of method that concentrated route control is carried out in distributed communication network
CN107547386A (en) * 2017-06-23 2018-01-05 新华三技术有限公司 Message forwarding method and device
WO2018032962A1 (en) * 2016-08-19 2018-02-22 华为技术有限公司 Method, device and system for information synchronization
WO2018121284A1 (en) * 2016-12-28 2018-07-05 华为技术有限公司 Method for processing routing, and network device
CN109873766A (en) * 2019-03-29 2019-06-11 北京华三通信技术有限公司 Message transmitting method and device
CN110445719A (en) * 2019-07-16 2019-11-12 中国第一汽车股份有限公司 A kind of method for managing route table, device, equipment and storage medium
WO2020057445A1 (en) * 2018-09-19 2020-03-26 华为技术有限公司 Communication system, method, and device
US20200112544A1 (en) * 2018-10-04 2020-04-09 Level 3 Communications, Llc Systems and methods for blocking spoofed traffic
WO2020093958A1 (en) * 2018-11-08 2020-05-14 华为技术有限公司 Route processing method, apparatus, and device
WO2021088439A1 (en) * 2019-11-06 2021-05-14 华为技术有限公司 Method and apparatus for monitoring running state of peer, and storage medium
WO2021098819A1 (en) * 2019-11-22 2021-05-27 北京金山云网络技术有限公司 Route updating method and user cluster
CN113098770A (en) * 2020-01-08 2021-07-09 华为技术有限公司 Message sending method, routing table entry generating method, device and storage medium

Patent Citations (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7007100B1 (en) * 2000-12-20 2006-02-28 Nortel Networks Limited Method for synchronization of multicast routing table changes with a plurality of multicast routing protocols
CN102300275A (en) * 2010-06-22 2011-12-28 华为终端有限公司 Switching method in communication process and local route control function entity
CN102412984A (en) * 2011-10-24 2012-04-11 杭州华三通信技术有限公司 Management method and equipment for forwarded table entry
CN102437960A (en) * 2011-12-21 2012-05-02 福建星网锐捷网络有限公司 Detection processing method and system of cluster mode, and network equipment
WO2016011850A1 (en) * 2014-07-23 2016-01-28 华为技术有限公司 Network device and method for sending bgp information
CN109246008A (en) * 2014-07-23 2019-01-18 华为技术有限公司 The network equipment, system and the method for sending bgp information
CN106161256A (en) * 2016-07-26 2016-11-23 杭州华三通信技术有限公司 A kind of processing method and processing device of Border Gateway Protocol (BGP) route
WO2018032962A1 (en) * 2016-08-19 2018-02-22 华为技术有限公司 Method, device and system for information synchronization
CN106059924A (en) * 2016-08-19 2016-10-26 华为技术有限公司 Information management method, devices and system
CN106506376A (en) * 2016-10-27 2017-03-15 杭州华三通信技术有限公司 A kind of initial routing iinformation sending method of monitored neighbours and device
WO2018121284A1 (en) * 2016-12-28 2018-07-05 华为技术有限公司 Method for processing routing, and network device
CN112039769A (en) * 2016-12-28 2020-12-04 华为技术有限公司 Method for processing route and network equipment
CN106899501A (en) * 2017-03-30 2017-06-27 重庆金美通信有限责任公司 A kind of method that concentrated route control is carried out in distributed communication network
CN107547386A (en) * 2017-06-23 2018-01-05 新华三技术有限公司 Message forwarding method and device
CN110932876A (en) * 2018-09-19 2020-03-27 华为技术有限公司 Communication system, method and device
WO2020057445A1 (en) * 2018-09-19 2020-03-26 华为技术有限公司 Communication system, method, and device
US20200112544A1 (en) * 2018-10-04 2020-04-09 Level 3 Communications, Llc Systems and methods for blocking spoofed traffic
WO2020093958A1 (en) * 2018-11-08 2020-05-14 华为技术有限公司 Route processing method, apparatus, and device
CN109873766A (en) * 2019-03-29 2019-06-11 北京华三通信技术有限公司 Message transmitting method and device
CN110445719A (en) * 2019-07-16 2019-11-12 中国第一汽车股份有限公司 A kind of method for managing route table, device, equipment and storage medium
WO2021088439A1 (en) * 2019-11-06 2021-05-14 华为技术有限公司 Method and apparatus for monitoring running state of peer, and storage medium
WO2021098819A1 (en) * 2019-11-22 2021-05-27 北京金山云网络技术有限公司 Route updating method and user cluster
CN113098770A (en) * 2020-01-08 2021-07-09 华为技术有限公司 Message sending method, routing table entry generating method, device and storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
杨夏;毕艳冰;孙延涛;: "交换式以太网物理拓扑发现的进展与研究" *
柳溶,王建新,杨路明: "基于IPv6选播路由协议的负载平衡研究" *
陆笑天;李曦;周学海;纪金松;: "基于前驱查找的快速IP路由查找和更新方案" *
黄伟: "《基于SDN分级分域架构的QoS约束路由算法》" *

Also Published As

Publication number Publication date
CN113794644B (en) 2023-05-26

Similar Documents

Publication Publication Date Title
TWI631475B (en) System and method for capability monitoring
CN108494755B (en) Method and device for transmitting Application Programming Interface (API) request
CN110580256B (en) Method, device and system for identifying application identification
US9930632B2 (en) M2M application remote registration method, device, system and storage medium
CN109218200B (en) Message processing method and device
CN109561164B (en) NAT table entry management method and device and NAT equipment
CN112513830A (en) Back-source method and related device in content distribution network
CN112839076B (en) Data storage method, data reading method, gateway, electronic equipment and storage medium
CN112929241A (en) Network testing method and device
RU2348066C2 (en) Communication terminal
US11909738B2 (en) Network access control method and device
CN112087532B (en) Information acquisition method, device, equipment and storage medium
CN111064729B (en) Message processing method and device, storage medium and electronic device
CN113794644B (en) Method and device for deleting routing table entries
CN110855627B (en) Application deployment method, device, equipment and medium
US20170353818A1 (en) Method for deleting notification resource, and common service entity
CN110955688A (en) Proxy server, data query method and device, electronic equipment and storage medium
CN107612831B (en) Transmission method and device for data message of access source station
CN113347084B (en) Message forwarding method and device
CN111988745B (en) Target user determining method, device, equipment and medium based on WiFi connection data
CN110944037B (en) Method, computer device and storage medium for client cache change configuration
CN103685367A (en) Offline download system and offline download method
CN111935019A (en) Digital object addressing method, device and equipment and storage medium
CN111917868A (en) Addressing method and device for block chain node, routing equipment and storage medium
CN107547634B (en) Session management method and device

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