CN108965137B - Message processing method and device - Google Patents

Message processing method and device Download PDF

Info

Publication number
CN108965137B
CN108965137B CN201810805036.5A CN201810805036A CN108965137B CN 108965137 B CN108965137 B CN 108965137B CN 201810805036 A CN201810805036 A CN 201810805036A CN 108965137 B CN108965137 B CN 108965137B
Authority
CN
China
Prior art keywords
routing table
target
address
router
flow rule
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810805036.5A
Other languages
Chinese (zh)
Other versions
CN108965137A (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.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C 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 Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201810805036.5A priority Critical patent/CN108965137B/en
Publication of CN108965137A publication Critical patent/CN108965137A/en
Application granted granted Critical
Publication of CN108965137B publication Critical patent/CN108965137B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering

Landscapes

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

Abstract

The present disclosure provides a method and an apparatus for processing a packet, which are applied to a router in a Border Gateway Protocol (BGP) network, where the router may receive a first flow rule policy sent by a first device, and determine whether a target routing table corresponding to an address to be matched and a next hop address exists in a local routing table of the router. If the local routing table does not have the target routing table, the router forwards the target message of which the received target address is matched with the address to be matched according to the local routing table. Based on the above processing, even if only the first flow rule policy is received, when the local routing table does not have the target routing table, the router can forward the received message according to the local routing table, and does not forward the message according to the invalid flow rule policy, thereby avoiding service interruption.

Description

Message processing method and device
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method and an apparatus for processing a packet.
Background
A matching item corresponding to an address to be matched may be defined in a Flow rule (english: Flow Specification, abbreviated as Flowspec) policy, for example, the address to be matched may be a matching item corresponding to a source address, a destination address, a source port, a destination port, a protocol type, and the like to be matched. The Flow Spec policy may be stored in the network device, and when a destination address of a certain message received by the network device matches with the address to be matched, the network device may forward the message according to the next hop address.
A Border Gateway Protocol (BGP) network may include a controller and a plurality of network devices. If a BGP connection exists between two network devices, the two network devices are BGP neighbors to each other. In the BGP network, after a certain network device receives a flow rule policy from a BGP neighbor or a controller, the network device needs to check the validity of an address to be matched and a next hop address in the flow rule policy to determine the validity of the flow rule policy. When determining the validity of the flow rule policy, the network device further needs to obtain, from the BGP neighbor or the controller, a routing table (which may be referred to as a first routing table) corresponding to the address to be matched and a routing table (which may be referred to as a second routing table) corresponding to the next hop address, and then, the network device performs validity check on the address to be matched and the next hop address according to the first routing table, the second routing table, the local routing table, and the longest mask matching rule, respectively.
Disclosure of Invention
The present disclosure aims to provide a method and an apparatus for processing a packet, which can avoid interruption of a network service. The specific technical scheme is as follows:
in a first aspect, to achieve the above object, the present disclosure discloses a method for processing a packet, where the method is applied to a router in a BGP network, and the method includes:
receiving a first flow rule strategy sent by first equipment, wherein the first flow rule strategy comprises an address to be matched and a next hop address;
judging whether a target routing table corresponding to the address to be matched and the next hop address exists in a local routing table of the router or not;
and if the target routing table does not exist in the local routing table, forwarding the target message of which the received destination address is matched with the address to be matched according to the local routing table.
In a second aspect, to achieve the above object, the present disclosure further discloses a packet processing apparatus, where the apparatus is applied to a router in a BGP network, and the apparatus includes:
the device comprises a receiving module, a sending module and a judging module, wherein the receiving module is used for receiving a first flow rule strategy sent by first equipment, and the first flow rule strategy comprises an address to be matched and a next hop address;
a judging module, configured to judge whether a target routing table corresponding to the address to be matched and the next hop address exists in a local routing table of the router;
and the first processing module is used for forwarding the received target message with the destination address matched with the address to be matched according to the local routing table if the target routing table does not exist in the local routing table.
In order to achieve the above object, the present disclosure further discloses a router, which includes a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of the first aspect when executing the program stored in the memory.
In a fourth aspect, to achieve the above object, the present disclosure also discloses a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to: the method steps of the first aspect are implemented.
The message processing method and device provided by the present disclosure may be applied to a router in a BGP network, where the router may receive a first flow rule policy sent by a first device, and determine whether a target routing table corresponding to an address to be matched and a next hop address exists in a local routing table of the router. If the local routing table does not have the target routing table, the router forwards the target message of which the received target address is matched with the address to be matched according to the local routing table. Based on the above processing, even if only the first flow rule policy is received, when the local routing table does not have the target routing table, the router can forward the received message according to the local routing table, and does not forward the message according to the invalid flow rule policy, thereby avoiding service interruption.
Of course, it is not necessary for any product or method of practicing the disclosure to achieve all of the advantages set forth above at the same time.
Drawings
In order to more clearly illustrate the technical solutions of the present disclosure or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a framework diagram of a networking architecture provided by the present disclosure;
fig. 2 is a flowchart of a message processing method provided in the present disclosure;
fig. 3 is a flowchart of an example of a message processing method provided by the present disclosure;
fig. 4 is a flowchart of an example of a message processing method provided by the present disclosure;
fig. 5 is a structural diagram of a message processing apparatus provided in the present disclosure;
fig. 6 is a block diagram of a router provided by the present disclosure.
Detailed Description
The technical solutions in the present disclosure will be described clearly and completely with reference to the accompanying drawings in the present disclosure, and it is to be understood that the described embodiments are only a part of the embodiments of the present disclosure, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
The present disclosure provides a method and an apparatus for processing a packet, which may be applied to a router (which may be referred to as a target router), where the target router may be any router in a BGP network, and referring to fig. 1, fig. 1 is a framework diagram of a networking architecture provided by the present disclosure, which is a possible application scenario. The networking includes: router R1, router R2, router R3, router R4, router R5, and router R6. The router R1, the router R2, and the router R3 are boundary routers of 65000 Autonomous Systems (AS), and the router R1, the router R2, and the router R3 are neighbors of an Internal Border Gateway Protocol (IBGP). Router R4, router R5, and router R6 are border routers of AS 65001, and router R4, router R5, and router R6 are IBGP neighbors of each other. Router R1 and router R4 are External Border Gateway Protocol (EBGP) neighbors to each other, router R2 and router R5 are EBGP neighbors to each other, and router R3 and router R6 are EBGP neighbors to each other. The router R1 may be set as a general control router, i.e. all messages need to pass through the router R1. When the router R1 fails, the message can be processed by the router R2 and the router R3. The routing table corresponding to a certain destination address Dest1 in the autonomous domain 65001 is issued to the autonomous domain 65000 through three links of the router R4-the router R1, the router R5-the router R2 and the router R6-the router R1.
Because the controller is not usually configured with a routing table, the router can only receive the flow rule policy issued by the controller. The router can determine the effectiveness of the flow rule policy according to the address to be matched and the next hop address in the local routing table and the flow rule policy. When the local routing table of the router does not have a routing table (i.e. a target routing table) corresponding to the address to be matched and the next hop address in the flow rule policy, that is, the flow rule policy is invalid, the router forwards the received message according to the local routing table. Based on the above processing, even if only the flow rule policy is received, when the local routing table does not have the target routing table, the router can forward the received message according to the local routing table, and does not forward the message according to the invalid flow rule policy, thereby avoiding service interruption.
Referring to fig. 2, fig. 2 is a flowchart of a message processing method provided by the present disclosure, where the method is applied to a target router in a BGP network, and the method may include the following steps.
S201: and receiving a first flow rule strategy sent by the first equipment.
The first flow rule strategy comprises an address to be matched and a next hop address. The address to be matched and the next hop address can be set by technical personnel according to business requirements and used for controlling the transmission of the message of which the destination address is matched with the address to be matched according to a specified path, and the address to be matched can be an interface address of a certain network device or a network address of a subnet containing a plurality of network devices. The first device may be an EBGP neighbor of the target router, an IBGP neighbor of the target router, or a controller.
In an embodiment of the present disclosure, the target router may receive a flow rule policy (i.e., a first flow rule policy) sent by the first device. For example, the target router may receive the first flow rule policy from its EBGP neighbor, may receive the first flow rule policy from its IBGP neighbor, and may receive the first flow rule policy directly from the controller.
S202: and judging whether a target routing table corresponding to the address to be matched and the next hop address exists in a local routing table of the target router.
Wherein the target router may receive Update messages for BGP neighbors, including EBGP neighbors and IEBGP neighbors, to generate the local routing table. When a link in the network fails, the target router may also receive an Update message of a BGP neighbor to delete the routing table corresponding to the link.
In the embodiment of the present disclosure, after receiving the first flow rule policy, the target router may analyze the first flow rule policy to obtain an address to be matched and a next hop address in the first flow rule policy. Then, the target router may determine whether a routing table (i.e., a target routing table) corresponding to the address to be matched and the next-hop address exists in its local routing table. When the target router determines that the target routing table exists in the local routing table, the target router may determine that the address to be matched and the next hop address are valid, that is, may determine that the first flow rule policy is valid. When the target router judges that the target routing table does not exist in the local routing table, the first flow rule strategy is invalid at the moment.
S203: if the local routing table does not have the target routing table, forwarding the target message of which the received destination address is matched with the address to be matched according to the local routing table.
In the embodiment of the present disclosure, when the target router determines that the target routing table does not exist in the local routing table, if the target router receives a message (i.e., a target message) whose destination address is matched with the address to be matched, that is, the destination address of the target message is the address to be matched, or the destination address of the target message belongs to a subnet corresponding to the address to be matched. At this time, the target router needs to forward the target packet according to the local routing table.
Optionally, the target router may forward the target packet according to the optimal routing table in the local routing table, so as to improve packet forwarding efficiency. Step S203 may include the following processing procedures: determining a routing table to be selected matched with a destination address of a target message in a local routing table; determining an optimal routing table in the routing table to be selected according to a preset routing table lookup rule; and sending the target message to an interface corresponding to the next hop address in the optimal routing table to complete the forwarding processing of the target message.
The preset routing table lookup rule can be set by a technician according to experience. For example, the preset routing table lookup rule may be determined according to the longest mask matching rule, or the preset routing table lookup rule may also be determined according to the management distance of the routing table and the metric value of the routing table, and the number of routing tables matching the destination address in the local routing table of the target router may be multiple.
In the embodiment of the present disclosure, the target router may first query the local routing table to obtain each routing table (i.e., the routing table to be selected) matching the destination address of the target packet. Then, the target router can determine the optimal routing table in the routing table to be selected according to the preset routing table lookup rule. Finally, the target router can send the target message to the interface corresponding to the next hop address in the optimal routing table, so that the target message is transmitted from the interface to the network device connected with the interface, and the forwarding processing of the target message is completed.
When determining the optimal routing table, the target router may first determine the temporary routing table in the to-be-selected routing table according to the longest mask matching rule. If the temporary routing table is one, the target router can take the temporary routing table as the optimal routing table; if the number of the temporary routing tables is multiple, the target router can determine the temporary routing table with the minimum management distance from the multiple temporary routing tables as the preferred routing table. If the preferred routing table is one, the target router can take the preferred routing table as the optimal routing table; if the preferred routing table is multiple, the target router may determine the preferred routing table with the smallest metric value from the multiple preferred routing tables as the optimal routing table.
Optionally, when the first flow rule policy is valid, the target router may forward the received packet according to the first flow rule policy. The method may further comprise the steps of: if the local routing list has the target routing list, the received target message is forwarded according to the first flow rule strategy.
In the embodiment of the present disclosure, when the target router determines that the target routing table exists in the local routing table, that is, the first flow rule policy is valid at this time. If the target router receives the target message, the target router can forward the target message according to the first flow rule policy.
When the target packet is forwarded, the target router may send the target packet to an interface corresponding to the next hop address in the first flow rule policy, so that the target packet is transmitted from the interface to a network device connected to the interface, thereby completing forwarding processing of the target packet. The next hop address in the first flow rule policy is usually the network address of a certain interface of the target router.
The target router can also send the first flow rule policy to other network devices when the first flow rule policy is valid, so as to implement automatic deployment of the flow rule policy. Accordingly, if the target routing table exists in the local routing table of the target router, the method may further include the following processing steps.
Step one, a next hop address in the first flow rule strategy and a next hop address in the target routing table are modified into a network address of an interface between the target router and the second device.
The second device is a device having a BGP neighbor relationship with the target router, and the second device may be one or multiple devices.
When the target router determines that the target routing table exists in the local routing table, that is, the first flow rule policy is valid, the target router may modify a next hop address in the first flow rule policy and a next hop address in the target routing table into a network address of an interface connected to the second device.
For example, referring to fig. 1, when the target router is router R1, at this time, the second devices may be router R2 and router R3, and router R1 may modify the next hop address in the first flow rule policy and the next hop address in the target routing table to the network address of the interface connected to router R2 itself, and at the same time, modify the next hop address in the first flow rule policy and the next hop address in the target routing table to the network address of the interface connected to router R3 itself.
And step two, sending the modified first flow rule strategy and the modified target routing table to the second equipment, so that the second equipment can forward the received message according to the modified first flow rule strategy and the modified target routing table.
In the embodiment of the present disclosure, the target router may send the modified first flow rule policy and the modified target routing table to the second device, so that the second device forwards the received packet according to the modified first flow rule policy and the modified target routing table.
After the second device receives the modified first-flow rule policy and the modified target routing table, because the target router uniformly modifies the first-flow rule policy and the next-hop address of the target routing table, the second device can also determine that the modified first-flow rule policy is valid, and then can forward the received message according to the modified first-flow rule policy.
In addition, when a link failure occurs in the BGP network, the target router updates the local routing table according to the Update message of the BGP neighbor, which may cause the target router to determine that the first flow rule policy is invalid according to the local routing table, and at this time, the target router sends the Update message for the target routing table to the BGP neighbor. After receiving the Update message, the BGP neighbor may determine that the modified first flow rule policy is invalid.
Therefore, the method and the device can realize the automatic deployment of the flow rule strategy, and further realize the transmission of the BGP network control message according to the specified path.
Referring to fig. 3, fig. 3 is a flowchart of an example of a message processing method provided by the present disclosure, where the method may be applied to the router R4 in fig. 1, and is described as an example of issuing a first flow rule policy to the router R4 by a controller, where the method may include the following steps.
S301: and receiving the first flow rule strategy sent by the controller.
The first flow rule policy includes an address Dest1 to be matched and a corresponding next hop address (a network address of an interface between the router R4 and the router R5 is referred to as a first interface address).
S302: and judging whether a target routing table corresponding to the address Dest1 to be matched and the first interface address exists in the local routing table, if the target routing table does not exist in the local routing table, executing S303-S305, and if the target routing table exists in the local routing table, executing S306-S308.
S303: when a target message with the destination address matched with the address Dest1 to be matched is received, a routing table to be selected matched with the destination address of the target message is determined in the local routing table.
S304: and determining the optimal routing table in the routing table to be selected according to a preset routing table lookup rule.
S305: and sending the target message to an interface corresponding to the next hop address in the optimal routing table to complete the forwarding processing of the target message.
S306: when a target message with the destination address matched with the address Dest1 to be matched is received, the target message is sent to the interface corresponding to the first interface address, so that the forwarding processing of the target message is completed.
S307: and modifying the first interface address in the first flow rule policy and the first interface address in the target routing table into the network address of the interface connected with the router R1.
S308: and sending the modified first flow rule strategy and the modified target routing table to the router R1, so that the router R1 forwards the received message according to the modified first flow rule strategy and the modified target routing table.
Referring to fig. 4, fig. 4 is a flowchart of an example of a message processing method provided by the present disclosure, where the method may be applied to the router R1 in fig. 1, and is described as an example of issuing a second flow rule policy to the router R1 by a controller, where the method may include the following steps.
S401: and receiving the second flow rule strategy sent by the controller.
The second flow rule policy includes the address Dest1 to be matched and a corresponding next hop address (the network address of the interface between the router R1 and the router R4 is referred to as a second interface address).
S402: and judging whether a target routing table corresponding to the address Dest1 to be matched and the second interface address exists in the local routing table, if the target routing table does not exist in the local routing table, executing S403-S405, and if the target routing table exists in the local routing table, executing S406-S408.
S403: when a target message with the destination address matched with the address Dest1 to be matched is received, a routing table to be selected matched with the destination address of the target message is determined in the local routing table.
S404: and determining the optimal routing table in the routing table to be selected according to a preset routing table lookup rule.
S405: and sending the target message to an interface corresponding to the next hop address in the optimal routing table to complete the forwarding processing of the target message.
S406: and when a target message with the destination address matched with the address Dest1 to be matched is received, sending the target message to an interface corresponding to the second interface address so as to complete the forwarding processing of the target message.
S407: and modifying the second interface address in the second flow rule policy and the second interface address in the target routing table into the network address of the interface connected with the router R2, and sending the modified second flow rule policy and the modified target routing table to the router R2, so that the router R2 forwards the received message according to the modified second flow rule policy and the modified target routing table.
S408: and modifying the second interface address in the second flow rule policy and the second interface address in the target routing table into the network address of the interface connected with the router R3, and sending the modified second flow rule policy and the modified target routing table to the router R3, so that the router R3 forwards the received message according to the modified second flow rule policy and the modified target routing table.
The present disclosure does not limit the execution order of step S407 and step S408.
As can be seen from the above, based on the message processing method of the present disclosure, the router may receive the first flow rule policy sent by the first device, and determine whether a target routing table corresponding to the address to be matched and the next hop address exists in the local routing table of the router. If the local routing table does not have the target routing table, the router forwards the target message of which the received target address is matched with the address to be matched according to the local routing table. Based on the above processing, even if only the first flow rule policy is received, when the local routing table does not have the target routing table, the router can forward the received message according to the local routing table, and does not forward the message according to the invalid flow rule policy, thereby avoiding service interruption.
Corresponding to the embodiment of the method in fig. 2, referring to fig. 5, fig. 5 is a structural diagram of a message processing apparatus provided by the present disclosure, where the apparatus may be applied to a router in a BGP network, and the apparatus includes:
a receiving module 501, configured to receive a first flow rule policy sent by a first device, where the first flow rule policy includes an address to be matched and a next hop address;
a determining module 502, configured to determine whether a target routing table corresponding to the address to be matched and the next hop address exists in a local routing table of the router;
a first processing module 503, configured to forward, if the target routing table does not exist in the local routing table, a target packet whose destination address matches the address to be matched according to the local routing table.
Optionally, the apparatus further comprises:
and the second processing module is used for forwarding the received target message according to the first flow rule policy if the target routing table exists in the local routing table.
Optionally, the apparatus further comprises:
a third processing module, configured to modify, if the target routing table exists in the local routing table, a next hop address in the first flow rule policy and a next hop address in the target routing table to be a network address of an interface where the router is connected to a second device, where the second device is a device that has a BGP neighbor relationship with the router;
and sending the modified first flow rule strategy and the modified target routing table to the second equipment, so that the second equipment can forward the received message according to the modified first flow rule strategy and the modified target routing table.
Optionally, the first processing module 503 is specifically configured to determine, in the local routing table, a to-be-selected routing table that is matched with the destination address of the target packet;
determining an optimal routing table in the routing table to be selected according to a preset routing table lookup rule;
and sending the target message to an interface corresponding to the next hop address in the optimal routing table to complete the forwarding processing of the target message.
As can be seen from the above, based on the message processing apparatus of the present disclosure, the router may receive the first flow rule policy sent by the first device, and determine whether a target routing table corresponding to the address to be matched and the next hop address exists in the local routing table of the router. If the local routing table does not have the target routing table, the router forwards the target message of which the received target address is matched with the address to be matched according to the local routing table. Based on the above processing, even if only the first flow rule policy is received, when the local routing table does not have the target routing table, the router can forward the received message according to the local routing table, and does not forward the message according to the invalid flow rule policy, thereby avoiding service interruption.
The present disclosure also provides a router, as shown in fig. 6, including a processor 601, a communication interface 602, a memory 603, and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 complete mutual communication via the communication bus 604,
a memory 603 for storing a computer program;
the processor 601 is configured to, when executing the program stored in the memory 603, cause the router to perform the following steps, including:
receiving a first flow rule strategy sent by first equipment, wherein the first flow rule strategy comprises an address to be matched and a next hop address;
judging whether a target routing table corresponding to the address to be matched and the next hop address exists in a local routing table of the router or not;
and if the target routing table does not exist in the local routing table, forwarding the target message of which the received destination address is matched with the address to be matched according to the local routing table.
Optionally, the method further includes:
if the local routing table has the target routing table, forwarding the received target message according to the first flow rule strategy.
Optionally, the method further includes:
if the target routing table exists in the local routing table, modifying a next hop address in the first flow rule policy and a next hop address in the target routing table into a network address of an interface connected between the router and a second device, wherein the second device is a device having a BGP neighbor relationship with the router;
and sending the modified first flow rule strategy and the modified target routing table to the second equipment, so that the second equipment can forward the received message according to the modified first flow rule strategy and the modified target routing table.
Optionally, the forwarding the target packet whose destination address matches the address to be matched according to the local routing table includes:
determining a routing table to be selected matched with the destination address of the target message in the local routing table;
determining an optimal routing table in the routing table to be selected according to a preset routing table lookup rule;
and sending the target message to an interface corresponding to the next hop address in the optimal routing table to complete the forwarding processing of the target message.
The communication bus mentioned in the router may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. 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 router and other devices.
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; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or other Programmable logic devices, discrete Gate or transistor logic devices, or discrete hardware components.
In this disclosure, a first flow rule policy sent by a first device may be received, and whether a target routing table corresponding to an address to be matched and a next hop address exists in a local routing table of a router is determined. If the local routing table does not have the target routing table, forwarding the target message of which the received destination address is matched with the address to be matched according to the local routing table. Based on the above processing, even if only the first flow rule policy is received, when the target routing table does not exist in the local routing table, the received message can be forwarded according to the local routing table, and the message cannot be forwarded according to the invalid flow rule policy, thereby avoiding service interruption.
In another embodiment provided by the present disclosure, 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 message processing methods described above.
In yet another embodiment provided by the present disclosure, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the message processing methods of the above embodiments.
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, in whole or in part, the processes or functions described in accordance with the present disclosure. 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, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (8)

1. A message processing method is applied to a router in a BGP network, and the method comprises the following steps:
receiving a first flow rule strategy sent by first equipment, wherein the first flow rule strategy comprises an address to be matched and a next hop address;
judging whether a target routing table corresponding to the address to be matched and the next hop address exists in a local routing table of the router or not;
if the local routing table does not have the target routing table, forwarding the target message of which the received destination address is matched with the address to be matched according to the local routing table;
if the target routing table exists in the local routing table, modifying a next hop address in the first flow rule policy and a next hop address in the target routing table into a network address of an interface connected between the router and a second device, wherein the second device is a device having a BGP neighbor relationship with the router;
and sending the modified first flow rule strategy and the modified target routing table to the second equipment, so that the second equipment can forward the received message according to the modified first flow rule strategy and the modified target routing table.
2. The method of claim 1, further comprising:
if the local routing table has the target routing table, forwarding the received target message according to the first flow rule strategy.
3. The method according to claim 1, wherein the forwarding the received destination packet whose destination address matches the address to be matched according to the local routing table includes:
determining a routing table to be selected matched with the destination address of the target message in the local routing table;
determining an optimal routing table in the routing table to be selected according to a preset routing table lookup rule;
and sending the target message to an interface corresponding to the next hop address in the optimal routing table to complete the forwarding processing of the target message.
4. A message processing apparatus, applied to a router in a border gateway protocol BGP network, the apparatus comprising:
the device comprises a receiving module, a sending module and a judging module, wherein the receiving module is used for receiving a first flow rule strategy sent by first equipment, and the first flow rule strategy comprises an address to be matched and a next hop address;
a judging module, configured to judge whether a target routing table corresponding to the address to be matched and the next hop address exists in a local routing table of the router;
a first processing module, configured to forward a target packet whose destination address matches the address to be matched according to the local routing table if the target routing table does not exist in the local routing table;
a third processing module, configured to modify, if the target routing table exists in the local routing table, a next hop address in the first flow rule policy and a next hop address in the target routing table to be a network address of an interface where the router is connected to a second device, where the second device is a device that has a BGP neighbor relationship with the router;
and sending the modified first flow rule strategy and the modified target routing table to the second equipment, so that the second equipment can forward the received message according to the modified first flow rule strategy and the modified target routing table.
5. The apparatus of claim 4, further comprising:
and the second processing module is used for forwarding the received target message according to the first flow rule policy if the target routing table exists in the local routing table.
6. The apparatus according to claim 4, wherein the first processing module is specifically configured to determine, in the local routing table, a routing table to be selected that matches a destination address of the target packet;
determining an optimal routing table in the routing table to be selected according to a preset routing table lookup rule;
and sending the target message to an interface corresponding to the next hop address in the optimal routing table to complete the forwarding processing of the target message.
7. The router is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing the communication between the processor and the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 3 when executing a program stored in the memory.
8. A machine-readable storage medium having stored thereon machine-executable instructions that, when invoked and executed by a processor, cause the processor to: carrying out the method steps of any one of claims 1 to 3.
CN201810805036.5A 2018-07-20 2018-07-20 Message processing method and device Active CN108965137B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810805036.5A CN108965137B (en) 2018-07-20 2018-07-20 Message processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810805036.5A CN108965137B (en) 2018-07-20 2018-07-20 Message processing method and device

Publications (2)

Publication Number Publication Date
CN108965137A CN108965137A (en) 2018-12-07
CN108965137B true CN108965137B (en) 2021-03-19

Family

ID=64497587

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810805036.5A Active CN108965137B (en) 2018-07-20 2018-07-20 Message processing method and device

Country Status (1)

Country Link
CN (1) CN108965137B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109995657B (en) * 2019-03-19 2021-06-08 新华三技术有限公司合肥分公司 Flow forwarding method and device
CN111181825B (en) * 2019-12-31 2021-12-21 智车优行科技(北京)有限公司 Information processing method and apparatus, electronic device, and storage medium
CN113992584B (en) * 2021-10-26 2023-03-21 新华三信息安全技术有限公司 Message forwarding method and device
CN114363191B (en) * 2021-12-24 2023-11-10 中国联合网络通信集团有限公司 Route diffusion simulation method and device based on node and IP address
CN115022225B (en) * 2022-05-31 2023-11-10 东风电驱动***有限公司 Message forwarding method, device, equipment and readable storage medium
CN115865801A (en) * 2022-12-01 2023-03-28 中兴通讯股份有限公司 Message transmission method, electronic device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1859316A (en) * 2005-05-06 2006-11-08 株式会社日立制作所 Packet transfer apparatus
CN104243317A (en) * 2014-09-26 2014-12-24 杭州华三通信技术有限公司 Method and device for forwarding IP (internet protocol) routes
CN106302461A (en) * 2016-08-16 2017-01-04 杭州华三通信技术有限公司 A kind of method and device checking traffic policy legitimacy
CN106470158A (en) * 2016-09-13 2017-03-01 杭州迪普科技股份有限公司 Message forwarding method and device
CN107404439A (en) * 2016-05-18 2017-11-28 华为技术有限公司 For redirecting the method and system, the network equipment and control device of data flow
CN107404442A (en) * 2016-05-19 2017-11-28 中兴通讯股份有限公司 Flow processing method and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2498517B (en) * 2012-01-10 2019-02-27 Media Network Services As Data transport
US9559952B2 (en) * 2013-05-06 2017-01-31 Cisco Technology, Inc. Routing internet protocol version 6 link-local addresses in a network environment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1859316A (en) * 2005-05-06 2006-11-08 株式会社日立制作所 Packet transfer apparatus
CN104243317A (en) * 2014-09-26 2014-12-24 杭州华三通信技术有限公司 Method and device for forwarding IP (internet protocol) routes
CN107404439A (en) * 2016-05-18 2017-11-28 华为技术有限公司 For redirecting the method and system, the network equipment and control device of data flow
CN107404442A (en) * 2016-05-19 2017-11-28 中兴通讯股份有限公司 Flow processing method and system
CN106302461A (en) * 2016-08-16 2017-01-04 杭州华三通信技术有限公司 A kind of method and device checking traffic policy legitimacy
CN106470158A (en) * 2016-09-13 2017-03-01 杭州迪普科技股份有限公司 Message forwarding method and device

Also Published As

Publication number Publication date
CN108965137A (en) 2018-12-07

Similar Documents

Publication Publication Date Title
CN108965137B (en) Message processing method and device
EP3122004B1 (en) Traffic switching method, device, and system
US20200220803A1 (en) Link-State Advertisement LSA Sending Method, Apparatus, and System
CN103460648A (en) Methods, systems, and computer readable media for screening Diameter messages within a Diameter signaling router (DSR) having a distributed message processor architecture
US11005760B2 (en) Ensuring data locality for secure transmission of data
US8855113B2 (en) Link state identifier collision handling
CN110430135B (en) Message processing method and device
JP7434504B2 (en) Route handling methods and network devices
US9282025B2 (en) Medium access control address protection method and switch
CN114143283A (en) Tunnel self-adaptive configuration method and device, center-end equipment and communication system
CN116260618A (en) Method and device for blocking IP address, electronic equipment and storage medium
CN109067657B (en) Message processing method and device
CN106789664B (en) Route aggregation method and device
US11343153B2 (en) BGP logical topology generation method, and device
US20190334814A1 (en) Path establishment method and device, and network node
CN112165428B (en) Traffic cleaning method and device and first boundary routing equipment
CN105207911A (en) IS-IS protocol message authentication method and system
CN113014481B (en) Method, device, equipment and storage medium for transmitting link state notification
CN113852572B (en) Message processing method and device
WO2023024867A1 (en) Network diagnosis method for multi-chassis link aggregation networking and network access device
CN111107006B (en) Routing management method and device
CN114301913B (en) Request processing method and system
CN116074265B (en) Switch port state configuration method, device, equipment and storage medium
US20230261982A1 (en) Node configuration method, controller, and node
US11252162B2 (en) Enhancement to the IS-IS protocol for eliminating unwanted network traffic

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