Method and device for realizing error reporting based on SONiC switch

文档序号:974732 发布日期:2020-11-03 浏览:24次 中文

阅读说明:本技术 一种基于SONiC交换机实现错误回报的方法及装置 (Method and device for realizing error reporting based on SONiC switch ) 是由 詹家驊 于 2020-06-24 设计创作,主要内容包括:本发明提供一种基于SONiC交换机实现错误回报的方法及装置,所述SONiC交换机包括交换机芯片和CPU;所述方法步骤:S1.在CPU设置配置模块、报文处理模块以及远程过程调用模块,并设置远程过程调用模块与远端主控平台连接;S2.配置模块为交换机芯片配置过滤包访问控制功能;S3.交换机芯片根据过滤包访问控制功能获取交换机传输中丢弃的报文信息,并将丢弃的报文信息复制后传输到CPU的报文处理模块;S4.报文处理模块将丢弃的报文信息处理后与交换机信息打包,再通过远程过程调用模块传输到远端主控平台。(The invention provides a method and a device for realizing error return based on a SONiC switch, wherein the SONiC switch comprises a switch chip and a CPU; the method comprises the following steps: s1, a configuration module, a message processing module and a remote process calling module are arranged on a CPU, and the remote process calling module is connected with a remote main control platform; s2, configuring a filtering packet access control function for the switch chip by a configuration module; s3, the switch chip acquires the discarded message information in the switch transmission according to the filtering packet access control function, copies the discarded message information and transmits the copied message information to a message processing module of the CPU; and S4, the message processing module processes the discarded message information, packages the discarded message information with the switch information, and transmits the discarded message information to the remote main control platform through the remote process calling module.)

1. A method for realizing error return based on SONiC switch is characterized in that the SONiC switch comprises a switch chip and a CPU;

the method comprises the following steps:

s1, a configuration module, a message processing module and a remote process calling module are arranged on a CPU, and the remote process calling module is connected with a remote main control platform;

s2, configuring a filtering packet access control function for the switch chip by a configuration module;

s3, the switch chip acquires the discarded message information in the switch transmission according to the filtering packet access control function, copies the discarded message information and transmits the copied message information to a message processing module of the CPU;

and S4, after the message processing module analyzes and processes the discarded message information, the analyzed discarded message information and the switch information are transmitted to a remote main control platform through the remote process calling module.

2. The method for implementing error reporting based on the SONiC switch of claim 1, further comprising the steps of:

and S5, the remote main control platform sends detection messages to the appointed switches at regular time, and the inter-switch path detection is carried out according to whether each switch sends return messages or not.

3. The method of claim 1, wherein the step S2 is as follows:

s21, the remote master control platform starts switch filtering packet access control configuration and sends the filtering packet access control configuration to the switch;

s22, after receiving the filter packet access control configuration, the remote process calling module of the switch stores the configuration in a configuration database;

s23, the configuration module converts access control of the filter packet into function setting according to configuration database change and stores the function setting in an application database;

and S24, converting the function setting into a bottom layer code by a code conversion tool of the switch, and updating the bottom layer code to the switch chip by a code deployment tool.

4. The method of claim 3, wherein the step S2 further comprises the steps of:

and S25, configuring the cabinet number, the switch number and the remote main control platform IP by the configuration module, and writing the configured cabinet number, the switch number and the remote main control platform IP into a configuration database.

5. The method of claim 1, wherein the step S4 is as follows:

s41, the message processing module analyzes the quintuple of the discarded message and the packet loss reason according to the discarded message information and sends the quintuple and the packet loss reason to the remote process calling module;

s42, the remote procedure call module acquires the information of the switch;

and S43, the remote process calling module transmits the quintuple of the discarded message, the packet loss reason and the switch information to a remote main control platform.

6. The method of claim 2, wherein the step S5 is as follows:

s51, the remote main control platform sends a detection message to a remote procedure call module of the appointed switch at regular time;

s52, the remote procedure call module sends the detection message to a switch chip;

s53, the switch chip generates a return message according to the detection message;

s54, the message processing module processes the return message and then sends the processed return message to the remote calling module;

and S55, the remote calling module returns the return message to the remote main control platform, meanwhile, the detection message is forwarded to the next switch, and the next switch repeats the steps S52-S55.

7. A device for realizing error return based on a SONiC switch is characterized in that the SONiC switch comprises a switch chip and a CPU;

the device comprises:

the CPU module setting unit (1) is used for setting a configuration module, a message processing module and a remote process calling module in a CPU, and setting the remote process calling module to be connected with a remote main control platform;

the filtering packet access control configuration unit (2) is used for configuring a module to configure a filtering packet access control function for the switch chip;

a discarded message detection unit (3) for setting the switch chip to obtain the discarded message information in the switch transmission according to the filtering packet access control function, and copying the discarded message information and transmitting the copied message information to the message processing module of the CPU;

the error reporting unit (4) is used for setting a message processing module to analyze and process the discarded message information, and then transmitting the analyzed discarded message information and the switch information to the remote main control platform through a remote process calling module;

and the path detection unit (5) is used for setting the transmission detection message sent by the remote main control platform to the appointed switch at regular time and carrying out inter-switch path detection according to whether each switch sends the return message.

8. The apparatus for implementing error reporting based on SONiC switch of claim 7, wherein the filter packet access control configuration unit (2) comprises:

the configuration starting subunit (2.1) is used for setting a remote main control platform to start the switch filtering packet access control configuration and sending the filtering packet access control configuration to the switch;

a configuration storage subunit (2.2) for storing the configuration to the configuration database after the remote procedure call module of the switch receives the filter packet access control configuration;

a configuration conversion subunit (2.3) for setting the configuration module to convert the access control of the filter packet into function setting according to the change of the configuration database and storing the function setting in the application database;

and the code conversion subunit (2.4) is used for setting a code conversion tool of the switch to convert the function setting into the bottom code, and the code deployment tool updates the bottom code to the switch chip.

9. The apparatus for implementing error reporting based on SONiC switch of claim 7, wherein the error reporting unit (4) comprises:

the message analysis subunit (4.1) is used for setting the message processing module to analyze the quintuple of the discarded message and the packet loss reason according to the discarded message information and then sending the message to the remote process calling module;

the exchanger information acquisition subunit (4.2) is used for setting a remote procedure call module to acquire the exchanger information;

and the error reporting subunit (4.3) is used for setting that the remote procedure call module transmits the quintuple of the discarded message, the packet loss reason and the switch information to the remote main control platform.

10. The apparatus for implementing error reporting based on SONiC switch of claim 7, wherein the path detection unit (5) comprises:

a detection message sending subunit (5.1) for setting the remote main control platform to send the detection message to the remote procedure call module of the appointed switch at regular time;

a detection message forwarding subunit (5.2) for setting a remote procedure call module to send the detection message to the switch chip;

a return message generating subunit (5.3) for setting the switch chip to generate a return message according to the detection message;

a message return subunit (5.4) for setting the message processing module to process the return message and then send the processed return message to the remote calling module;

and the detection message continuous transmission subunit (5.5) is used for setting a remote calling module to return the return message to the remote main control platform and simultaneously transmitting the detection message to the next switch.

Technical Field

The invention belongs to the technical field of switch network detection, and particularly relates to a method and a device for realizing error reporting based on a SONiC switch.

Background

SONiC, Software for Open Networking in the Cloud, an Open computing project proposed by microsoft, designed primarily for the use environment of the data center. This item provides a collection of overlay software and can run on different switch hardware through the abstraction layer interface.

ACL is a set of mechanisms for filtering messages and executing specified actions by the abbreviation of Access Control List.

gPCs, an acronym for Google removal Procedure Calls, the remote Procedure call architecture proposed by Google, are transported based on the HTTP/2 protocol.

At present, a Spine/Leaf topological architecture is usually adopted in a mainstream data center, the architecture can easily perform linear expansion on equipment of the data center, and can also bring the advantages of load balance and redundancy.

In a data center, most of the equipment is housed in cabinets. In a large data center, the number of cabinets can reach thousands, and each cabinet can be provided with more than ten switches, and in such a case, if a problem occurs in equipment or a physical line, it is difficult to quickly find out the equipment with the problem for troubleshooting.

Existing link detection technologies such as IEEE 802.3ag, IEEE 802.3ah implement L2 link detection. The ICMP protocol may implement path detection at L3. The existing detection mechanism can only report the problems of L2 and L3 individually, and the information can be received only by the message transmitting end or the device with the problem, so that the information cannot be presented in a unified and centralized way. The conventional diagnostic tools such as Ethernet OAM and IPv4 ICMP cannot effectively and quickly lock the faulty path because of the existence of multiple paths.

Therefore, it is very necessary to provide a method and an apparatus for implementing error reporting based on a SONiC switch to overcome the above-mentioned drawbacks in the prior art.

Disclosure of Invention

Aiming at the defects that the existing data center in the prior art is complex in topological structure and is difficult to clearly locate a problem point when a network path has a problem, the invention provides a method and a device for realizing error reporting based on a SONiC switch, so as to solve the technical problems.

In a first aspect, the present invention provides a method for implementing error reporting based on a SONiC switch, where the SONiC switch includes a switch chip and a CPU;

the method comprises the following steps:

s1, a configuration module, a message processing module and a remote process calling module are arranged on a CPU, and the remote process calling module is connected with a remote main control platform;

s2, configuring a filtering packet access control function for the switch chip by a configuration module;

s3, the switch chip acquires the discarded message information in the switch transmission according to the filtering packet access control function, copies the discarded message information and transmits the copied message information to a message processing module of the CPU;

and S4, after the message processing module analyzes and processes the discarded message information, the analyzed discarded message information and the switch information are transmitted to a remote main control platform through the remote process calling module.

Further, the method also comprises the following steps:

and S5, the remote main control platform sends detection messages to the appointed switches at regular time, and the inter-switch path detection is carried out according to whether each switch sends return messages or not.

Further, the step S2 specifically includes the following steps:

s21, the remote master control platform starts switch filtering packet access control configuration and sends the filtering packet access control configuration to the switch;

s22, after receiving the filter packet access control configuration, the remote process calling module of the switch stores the configuration in a configuration database;

s23, the configuration module converts access control of the filter packet into function setting according to configuration database change and stores the function setting in an application database;

and S24, converting the function setting into a bottom layer code by a code conversion tool of the switch, and updating the bottom layer code to the switch chip by a code deployment tool.

Further, step S2 further includes the following steps:

and S25, configuring the cabinet number, the switch number and the remote main control platform IP by the configuration module, and writing the configured cabinet number, the switch number and the remote main control platform IP into a configuration database.

Further, the step S4 specifically includes the following steps:

s41, the message processing module analyzes the quintuple of the discarded message and the packet loss reason according to the discarded message information and sends the quintuple and the packet loss reason to the remote process calling module;

s42, the remote procedure call module acquires the information of the switch;

and S43, the remote process calling module transmits the quintuple of the discarded message, the packet loss reason and the switch information to a remote main control platform. The quintuple is a communication term that refers to a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol.

Further, in step S42, the remote procedure call module obtains the switch information from the configuration database;

the switch information comprises the cabinet number of the switch and the switch number.

Further, the step S5 specifically includes the following steps:

s51, the remote main control platform sends a detection message to a remote procedure call module of the appointed switch at regular time;

s52, the remote procedure call module sends the detection message to a switch chip;

s53, the switch chip generates a return message according to the detection message;

s54, the message processing module processes the return message and then sends the processed return message to the remote calling module;

and S55, the remote calling module returns the return message to the remote main control platform, meanwhile, the detection message is forwarded to the next switch, and the next switch repeats the steps S52-S55.

In a second aspect, the present invention provides a device for implementing error reporting based on a SONiC switch, where the SONiC switch includes a switch chip and a CPU;

the device comprises:

the CPU module setting unit is used for setting a configuration module, a message processing module and a remote process calling module in the CPU, and setting the remote process calling module to be connected with a remote main control platform;

the filter packet access control configuration unit is used for configuring the module to configure a filter packet access control function for the switch chip;

the discarded message detection unit is used for setting a message processing module which is used for acquiring the discarded message information in the transmission of the switch by the switch chip according to the filtering packet access control function, copying the discarded message information and transmitting the copied message information to the CPU;

the error reporting unit is used for setting a message processing module to analyze and process the discarded message information, and transmitting the analyzed discarded message information and the switch information to the remote main control platform through the remote process calling module;

and the path detection unit is used for setting the transmission detection message sent by the remote main control platform to the appointed switch at regular time and carrying out inter-switch path detection according to whether each switch sends the return message.

Further, the filter packet access control configuration unit includes:

the configuration starting subunit is used for setting a remote main control platform to start the switch filtering packet access control configuration and sending the filtering packet access control configuration to the switch;

the configuration storage subunit is used for storing the configuration to a configuration database after the remote procedure call module of the switch receives the filter packet access control configuration;

the configuration conversion subunit is used for setting the configuration module to convert the access control of the filter packet into function setting according to the change of the configuration database and storing the function setting in the application database;

and the code conversion subunit is used for setting a code conversion tool of the switch to convert the function setting into the bottom layer code, and the code deployment tool updates the bottom layer code to the switch chip.

Further, the error reporting unit includes:

the message analysis subunit is used for setting the message processing module to analyze the quintuple of the discarded message and the packet loss reason according to the discarded message information and then sending the message to the remote procedure calling module;

the switch information acquisition subunit is used for setting the remote procedure call module to acquire the switch information;

and the error reporting subunit is used for setting the remote process calling module to transmit the quintuple of the discarded message, the packet loss reason and the switch information to the remote main control platform.

Further, the path detecting unit includes:

the detection message sending subunit is used for setting the remote main control platform to send the detection message to the remote procedure call module of the specified switch at regular time;

the detection message forwarding subunit is used for setting a remote procedure calling module to send the detection message to the switch chip;

a return message generating subunit (5.3) for setting the switch chip to generate a return message according to the detection message;

the message returning subunit is used for setting the message processing module to process the returned message and then send the processed returned message to the remote calling module;

and the detection message continuous transmission subunit is used for setting the remote calling module to return the return message to the remote main control platform and simultaneously transmitting the detection message to the next switch.

The beneficial effect of the invention is that,

the method and the device for realizing the error return based on the SONiC switch, provided by the invention, can be used for quickly positioning the switch equipment and reasons with problems in a large-scale and complex network environment and improving the efficiency and accuracy of troubleshooting of operation and maintenance personnel, so that the data center can save more resources in the configuration and task allocation of the operation and maintenance personnel and obtain greater elasticity.

In addition, the invention has reliable design principle, simple structure and very wide application prospect.

Therefore, compared with the prior art, the invention has prominent substantive features and remarkable progress, and the beneficial effects of the implementation are also obvious.

Drawings

In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present invention, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.

FIG. 1 is a first schematic flow chart of the method of the present invention;

FIG. 2 is a second schematic flow chart of the method of the present invention;

FIG. 3 is a schematic diagram of the internal structure of the switch of the present invention;

in the figure, 1-a CPU module setting unit; 2-filter packet access control configuration unit; 2.1-configuring the opening subunit; 2.2-configuring the storage subunit; 2.3-configuration conversion subunit; 2.4-a transcoding subunit; 3-a discarded message detection unit; 4-an error reporting unit; 4.1-message parsing subunit; 4.2-switch information acquisition subunit; 4.3-error reporting subunit; 5-a path detection unit; 5.1-detecting the message sending subunit; 5.2-detecting the message forwarding subunit; 5.3-return message generating subunit; 5.4-message back sub-unit; 5.5-detecting the message continuous transmission subunit.

Detailed Description

In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is only a part of the embodiment of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种交换机链路选择方法、系统、终端及存储介质

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!