BGP message processing method and system

文档序号:1675561 发布日期:2019-12-31 浏览:24次 中文

阅读说明:本技术 一种bgp报文处理方法及系统 (BGP message processing method and system ) 是由 雷棋 兰海翔 李卫群 周发辉 陈军 于 2019-08-30 设计创作,主要内容包括:本发明涉及一种BGP报文处理方法及系统,所述方法包括如下步骤:接收发送设备发送的BGP报文;根据所述BGP报文的权重对所述BGP报文进行分类,将相同权重的所述BGP报文存储至同一个队列;比对所述BGP报文的处理速度和第一预设阈值,当所述处理速度低于所述第一预设阈值时,根据权重从高到低的顺序依次提取对应的所述队列中的所述BGP报文进行处理。本发明的技术方案中,在BGP报文的处理速度较低时,优先处理权重更高的BGP报文,能够避免发生重要BGP报文丢包的现象,防止重要信息的丢失。(The invention relates to a BGP message processing method and a system, wherein the method comprises the following steps: receiving a BGP message sent by a sending device; classifying the BGP messages according to the weights of the BGP messages, and storing the BGP messages with the same weight to the same queue; and comparing the processing speed of the BGP message with a first preset threshold, and when the processing speed is lower than the first preset threshold, sequentially extracting the BGP messages in the corresponding queues from high to low according to the weight for processing. In the technical scheme of the invention, when the processing speed of the BGP message is lower, the BGP message with higher weight is processed preferentially, so that the phenomenon of important BGP message packet loss can be avoided, and the loss of important information is prevented.)

1. A BGP message processing method is characterized in that the method comprises the following steps:

receiving a BGP message sent by a sending device;

classifying the BGP messages according to the weights of the BGP messages, and storing the BGP messages with the same weight to the same queue;

and comparing the processing speed of the BGP message with a first preset threshold, and when the processing speed is lower than the first preset threshold, sequentially extracting the BGP messages in the corresponding queues from high to low according to the weight for processing.

2. The BGP message processing method according to claim 1, wherein before the step of classifying the message according to its weight, the method further comprises the steps of:

and giving corresponding weight to each BGP message to be sent in the sending equipment in advance.

3. The BGP message processing method according to claim 1, wherein the sequentially extracting the BGP messages in the corresponding queues according to the order of weight from high to low to process specifically includes the following steps:

extracting prefix information in the BGP message;

and matching the prefix information with pre-stored prefix information, and determining whether prefix hijacking occurs according to a matching result.

4. The BGP message processing method according to any of claims 1 to 3, wherein after the step of sequentially extracting the BGP messages in the corresponding queues according to the order of weights from high to low for processing, the method further comprises the steps of:

counting the number of BGP messages to be processed in the BGP messages;

and comparing the number of the BGP messages to be processed with a second preset threshold value, and when the number of the BGP messages to be processed is greater than the second preset threshold value, sending a feedback message to the sending equipment to enable the sending equipment to suspend sending the BGP messages.

5. The BGP message processing method according to claim 4, wherein after the step of sending the feedback message to the sending device to cause the sending device to suspend sending the BGP message, the method further comprises the steps of:

and when the number of the BGP messages to be processed is reduced to a third preset threshold value, sending a request message to the sending equipment, so that the sending equipment continues to send the BGP messages, wherein the third preset threshold value is smaller than the second preset threshold value.

6. A BGP message processing system, comprising:

the receiving module is used for receiving the BGP message sent by the sending equipment;

the classification module is used for classifying the BGP messages according to the weights of the BGP messages and storing the BGP messages with the same weight to the same queue;

and the first processing module is used for comparing the processing speed of the BGP message with a first preset threshold value, and when the processing speed is lower than the first preset threshold value, sequentially extracting the BGP messages in the corresponding queues from high to low according to the weight for processing.

7. The BGP message processing system of claim 6, further comprising an entitlement module configured to:

and giving corresponding weight to each BGP message to be sent in the sending equipment in advance.

8. The BGP message processing system of claim 6, wherein the first processing module is specifically configured to:

extracting prefix information in the BGP message;

and matching the prefix information with pre-stored prefix information, and determining whether prefix hijacking occurs according to a matching result.

9. The BGP message processing system according to any of claims 6 to 8, further comprising a second processing module, the second processing module being configured to:

counting the number of BGP messages to be processed in the BGP messages;

and comparing the number of the BGP messages to be processed with a second preset threshold value, and when the number of the BGP messages to be processed is greater than the second preset threshold value, sending a feedback message to the sending equipment to enable the sending equipment to suspend sending the BGP messages.

10. The BGP message processing system of claim 9, wherein the second processing module is further configured to:

and when the number of the BGP messages to be processed is reduced to a third preset threshold value, sending a request message to the sending equipment, so that the sending equipment continues to send the BGP messages, wherein the third preset threshold value is smaller than the second preset threshold value.

Technical Field

The present invention relates to the field of communications technologies, and in particular, to a BGP message processing method and system.

Background

BGP (Border Gateway Protocol) is a dynamic routing Protocol, and is used for network devices between different ASs (Autonomous systems) to exchange routing information, and network devices that mutually exchange routing information are BGP peers.

At present, after a BGP neighbor is established between BGP peers, a sending device sends a BGP message to a receiving device, and if the transmission rate of the BGP message is fast, a packet receiving queue of a communication interface between the sending device and the receiving device is filled up to cause packet loss, and at this time, if an important message is lost, corresponding important information is lost.

Disclosure of Invention

In view of the above-mentioned deficiencies of the prior art, the present invention provides a BGP message processing method and system.

The technical scheme for solving the technical problems is as follows:

in a first aspect, the present invention provides a BGP message processing method, including the following steps:

and receiving the BGP message sent by the sending equipment.

Classifying the BGP messages according to the weights of the BGP messages, and storing the BGP messages with the same weight to the same queue.

And comparing the processing speed of the BGP message with a first preset threshold, and when the processing speed is lower than the first preset threshold, sequentially extracting the BGP messages in the corresponding queues from high to low according to the weight for processing.

In a second aspect, the present invention provides a BGP message processing system, including:

and the receiving module is used for receiving the BGP message sent by the sending equipment.

And the classification module is used for classifying the BGP messages according to the weights of the BGP messages and storing the BGP messages with the same weight to the same queue.

And the first processing module is used for comparing the processing speed of the BGP message with a first preset threshold value, and when the processing speed is lower than the first preset threshold value, sequentially extracting the BGP messages in the corresponding queues from high to low according to the weight for processing.

The BGP message processing method and the system have the beneficial effects that: classifying the received BGP messages according to the weight of the BGP messages, assigning corresponding weight to the BGP messages when the sending equipment generates the BGP messages, storing the BGP messages with the same weight in the same queue after classification, and when the processing speed of the BGP messages is found to be lower than a first preset threshold value, namely the processing efficiency is not good at the moment, possibly causing the BGP messages to be stacked, and at the moment, sequentially processing the BGP messages from high to low according to the weight. In the technical scheme of the invention, when the processing speed of the BGP message is lower, the BGP message with higher weight is processed preferentially, so that the phenomenon of important BGP message packet loss can be avoided, and the loss of important information is prevented.

Drawings

Fig. 1 is a schematic flow chart of a BGP message processing method according to an embodiment of the present invention;

fig. 2 is a schematic structural diagram of a BGP message processing system according to an embodiment of the present invention.

Detailed Description

The principles and features of this invention are described below in conjunction with the following drawings, which are set forth by way of illustration only and are not intended to limit the scope of the invention.

As shown in fig. 1, a BGP message processing method provided in an embodiment of the present invention is applied to a receiving device, and the method includes the following steps:

110, receiving the BGP message sent by the sending device.

Specifically, after the receiving device and the sending device establish a BGP neighbor, the sending device sends a BGP message to the receiving device.

And 120, classifying the BGP messages according to the weights of the BGP messages, and storing the BGP messages with the same weight in the same queue.

Specifically, after the sending device generates the BGP messages, corresponding weights are assigned to the BGP messages according to the types of the BGP messages.

And 130, comparing the processing speed of the BGP message with a first preset threshold, and when the processing speed is lower than the first preset threshold, sequentially extracting the BGP messages in the corresponding queues from high to low according to the weight for processing.

Specifically, when the processing speed of the BGP message is lower than the first preset threshold, it indicates that the current processing performance of the receiving device is not good or network congestion occurs, and at this time, the message with high weight is processed preferentially, so that the phenomenon of packet loss of an important message can be avoided.

In this embodiment, the received BGP messages are classified according to the weight of the BGP message, corresponding weights may be assigned to the BGP messages when the sending device generates the BGP message, the BGP messages with the same weight are stored in the same queue after classification, and when the processing speed of the BGP message is found to be lower than a first preset threshold, that is, when the processing efficiency is not good at this time, the BGP messages may be stacked, and at this time, the BGP messages are sequentially processed according to the order of the weights from high to low. In the technical scheme of the invention, when the processing speed of the BGP message is lower, the BGP message with higher weight is processed preferentially, so that the phenomenon of important BGP message packet loss can be avoided, and the loss of important information is prevented.

Preferably, before the step of classifying the packets according to the weights of the packets, the method further includes the steps of:

and giving corresponding weight to each BGP message to be sent in the sending equipment in advance.

Specifically, after the sending device generates a BGP message to be sent, a weight is assigned to each BGP message according to the type of the BGP message, for example: the weights can be respectively given to the updating message, the keep-alive message, the opening message and the notification message according to the sequence of the weights from high to low.

Preferably, the sequentially extracting the BGP messages in the corresponding queues from high to low according to the weights to process specifically includes the following steps:

and extracting prefix information in the BGP message.

And matching the prefix information with pre-stored prefix information, and determining whether prefix hijacking occurs according to a matching result.

Specifically, prefix hijacking refers to that an update message which does not belong to prefix information of a certain autonomous system is issued to the outside through BGP or a false optimal routing is issued to the outside, so that unreachable of a real network is caused, and great harm is caused to the internet. The method comprises the steps of storing and correspondingly storing information of each sending device and standard prefix information of a BGP message of the sending device in a list in advance, extracting the prefix information of the received BGP message, reading the corresponding standard prefix information in the list according to the information of the sending device corresponding to the BGP message, comparing the prefix information with the standard prefix information, and judging whether prefix hijacking occurs or not according to a comparison result. If the comparison fails and prefix hijacking occurs, immediately sending alarm information to an alarm device for displaying so that a worker can timely process the information.

In the preferred embodiment, prefix hijacking detection is performed on the received BGP message, so that an alarm can be given in time when prefix hijacking occurs, the safety of a communication process can be ensured, and the method is simple and convenient.

Preferably, after the step of sequentially extracting the BGP messages in the corresponding queues from high to low according to the weights for processing, the method further includes the following steps:

and counting the number of BGP messages to be processed in the BGP messages.

And comparing the number of the BGP messages to be processed with a second preset threshold value, and when the number of the BGP messages to be processed is greater than the second preset threshold value, sending a feedback message to the sending equipment to enable the sending equipment to suspend sending the BGP messages.

Specifically, when the processing speed of the BGP message is lower than a first preset threshold, it indicates that the receiving device may have network congestion, and at this time, if the BGP message sent by the sending device is continuously received, the receiving device may be jammed, so that, first, the number of the BGP messages to be processed is counted, the number is compared with a second preset threshold, and when the number is greater than the second preset threshold, it indicates that network congestion has occurred and the receiving device is overloaded, and at this time, a feedback message is sent to the sending device, so that the sending device suspends sending the BGP message, thereby avoiding that the occupancy rate of a processor of the receiving device is high due to receiving a large number of BGP messages, affecting the processing efficiency, or even causing jamming.

In the preferred embodiment, when the number of BGP messages to be processed is too large, the sending device can be notified to suspend sending the BGP messages, so that the processing efficiency is prevented from being reduced due to the reception of a large number of BGP messages by the receiving device.

Preferably, after the step of sending the feedback packet to the sending device and causing the sending device to suspend sending the BGP packet, the method further includes the following steps:

and when the number of the BGP messages to be processed is reduced to a third preset threshold value, sending a request message to the sending equipment, so that the sending equipment continues to send the BGP messages, wherein the third preset threshold value is smaller than the second preset threshold value.

Specifically, with the processing of the BGP message by the receiving device, when the number of the BGP messages to be processed is reduced to the second preset threshold, indicating that network congestion has no longer occurred, the sending device is notified to resend the BGP message at this time, and normal operation of communication is ensured. And setting a buffer range between the pause sending of the BGP message and the resending of the BGP message so as to avoid frequently sending a feedback message and a request message to the sending equipment and reduce the load of the receiving equipment.

As shown in fig. 2, a BGP message processing system provided in an embodiment of the present invention includes:

and the receiving module is used for receiving the BGP message sent by the sending equipment.

And the classification module is used for classifying the BGP messages according to the weights of the BGP messages and storing the BGP messages with the same weight to the same queue.

And the first processing module is used for comparing the processing speed of the BGP message with a first preset threshold value, and when the processing speed is lower than the first preset threshold value, sequentially extracting the BGP messages in the corresponding queues from high to low according to the weight for processing.

Preferably, the system further comprises an empowerment module, wherein the empowerment module is configured to:

and giving corresponding weight to each BGP message to be sent in the sending equipment in advance.

Preferably, the first processing module is specifically configured to:

and extracting prefix information in the BGP message.

And matching the prefix information with pre-stored prefix information, and determining whether prefix hijacking occurs according to a matching result.

Preferably, the system further comprises a second processing module, wherein the second processing module is configured to:

and counting the number of BGP messages to be processed in the BGP messages.

And comparing the number of the BGP messages to be processed with a second preset threshold value, and when the number of the BGP messages to be processed is greater than the second preset threshold value, sending a feedback message to the sending equipment to enable the sending equipment to suspend sending the BGP messages.

Preferably, the second processing module is further configured to:

and when the number of the BGP messages to be processed is reduced to a third preset threshold value, sending a request message to the sending equipment, so that the sending equipment continues to send the BGP messages, wherein the third preset threshold value is smaller than the second preset threshold value.

In the description of the present invention, it is to be understood that the terms "first", "second" and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise. The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:知识中心网络的知识路由方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!