Testing method applied to optical module of white box switch

文档序号:1025190 发布日期:2020-10-27 浏览:28次 中文

阅读说明:本技术 一种应用于白盒交换机光模块的测试方法 (Testing method applied to optical module of white box switch ) 是由 张锡鑫 袁福利 周庆飞 于 2020-06-24 设计创作,主要内容包括:本发明提供一种应用于白盒交换机光模块的测试方法,所述白盒交换机内设置有若干端口,端口用于插接光模块;所述方法包括如下步骤:S1.将白盒交换机内所有端口划分为端口组将端口组串行连接形成环路;S2.配置白盒交换机对光模块进行基本功能测试,所述基本功能测试包括光模块在位识别测试以及链路连通测试;S3.配置白盒交换机依次对每个端口组与相邻端口组连接的端口进行光模块兼容性测试;S4.配置白盒交换机对光模块进行流量测试,在端口组之间建立双向的流量风暴,检测各端口是否有传输错误。(The invention provides a testing method applied to an optical module of a white box switch, wherein a plurality of ports are arranged in the white box switch and are used for plugging the optical module; the method comprises the following steps: s1, dividing all ports in a white box switch into port groups, and connecting the port groups in series to form a loop; s2, configuring a white box switch to perform basic function tests on the optical module, wherein the basic function tests comprise an optical module in-place identification test and a link communication test; s3, configuring a white box switch to sequentially perform optical module compatibility test on the ports of each port group connected with the adjacent port group; and S4, configuring the white box switch to perform flow test on the optical module, establishing a bidirectional flow storm among the port groups, and detecting whether each port has a transmission error.)

1. A testing method applied to an optical module of a white box switch is characterized in that a plurality of ports are arranged in the white box switch, and the ports are used for plugging the optical module;

the method comprises the following steps:

s1, dividing all ports in a white box switch into port groups, and connecting the port groups in series to form a loop;

s2, configuring a white box switch to perform basic function tests on the optical module, wherein the basic function tests comprise an optical module in-place identification test and a link communication test;

s3, configuring a white box switch to sequentially perform optical module compatibility test on the ports of each port group connected with the adjacent port group;

and S4, configuring the white box switch to perform flow test on the optical module, establishing a bidirectional flow storm among the port groups, and detecting whether each port has a transmission error.

2. The method for testing the optical module of the white box switch as claimed in claim 1, wherein the step S1 comprises the following steps:

s11, setting all ports in the white box switch into a sequence, and setting two adjacent ports into a port group;

s12, connecting adjacent port groups by using cables;

and S13, connecting the last port of the last port group with the first port of the first port group by using a cable to form a snake-shaped annular connection.

3. The method as claimed in claim 1, wherein the optical module compatibility test in step S3 includes optical module on-site detection, link connectivity detection, port optical module model information detection, and port switch test.

4. The method for testing the optical module of the white box switch as claimed in claim 2, wherein the step S2 comprises the following steps:

s21, configuring a white box switch to judge whether all optical modules are in place;

if yes, go to step S22;

if not, prompting that the optical module is not in place and the test is not passed, and returning to the step S21;

s22, configuring a white box switch to judge whether all ports are connected;

if yes, go to step S23;

if not, prompting that the link fails and the test fails, and returning to the step S21;

and S23, creating the same number of vlans as the number of the port groups, and adding the ports of each port group into the same vlan.

5. The method for testing the optical module of the white box switch as claimed in claim 2, wherein the step S3 comprises the following steps:

s31, setting a serial number of a port as p, and setting an initial value of p as 2;

s32, positioning a port with a port number p;

s33, judging whether the port p optical module is in place;

if not, prompting that the p-port optical module is not in place, and entering step S37;

if yes, go to step S34;

s34, judging whether the links of the port p are communicated;

if not, prompting that the link is not connected, and entering the step S37;

if yes, go to step S35;

s35, detecting the model information of the optical module on the port p;

s36, carrying out port switch test on the port p;

s37, increasing the value of p by 2, and judging whether the port p reaches the maximum port number;

if yes, go to step S4;

if not, the process returns to step S32.

6. The method for testing the optical module of the white box switch as claimed in claim 4, wherein the step S35 comprises the following steps:

s351, judging whether the port p reads information or not;

if not, prompting that the information is read incorrectly, and entering step S355;

if yes, go to step S352;

s352, setting an information reading threshold;

s353, reading the model number and hardware information of the optical module of the port p, searching the hardware information of the optical module of the corresponding model in a standard database, and judging whether the hardware information read by the optical module of the model is consistent with the stored hardware information;

if not, go to step S355;

if yes, go to step S354;

s354, judging whether the information reading times reach an information reading threshold value;

if yes, go to step S36;

if not, returning to the step S353;

and S355, prompting that the port p fails in the test.

7. The method for testing the optical module of the white box switch as claimed in claim 4, wherein the step S36 comprises the following steps:

s361, setting a port switching frequency threshold value;

s362, closing the port p, and waiting for setting a first time period;

s363, judging whether the port state and the optical power information of the port p +1 are abnormal or not;

if yes, prompting that the port is closed abnormally, and entering a step S367;

s364, opening a port p and waiting for setting a second time period;

s365, judging whether the port state and the optical power information of the port p +1 are abnormal or not;

if yes, prompting that the port is abnormally opened, and entering step S367;

if not, go to step S366;

s366, judging whether the port switching frequency reaches a port switching frequency threshold value;

if yes, prompting that the port p compatibility test is passed, and entering step S37;

if not, returning to the step S362;

s367, prompting that the port p compatibility test is failed, and entering the step S37.

8. The method for testing the optical module of the white box switch as claimed in claim 6, wherein in step S363, the expected port state and optical power information of the port p +1 after the port p is closed are obtained;

acquiring the actual port state and optical power information of the port p + 1;

comparing the expected port state and the optical power information of the port p +1 with the actual port state and the optical power information, and judging whether the port p +1 is abnormal or not;

in step S365, the expected port state and optical power information of the port p +1 after the port p is opened are obtained;

acquiring the actual port state and optical power information of the port p + 1;

and comparing the expected port state and the optical power information of the port p +1 with the actual port state and the optical power information to judge whether the abnormality exists.

9. The method for testing the optical module of the white box switch as claimed in claim 4, wherein the step S4 comprises the following steps:

s41, configuring a white box switch to create downlink flow taking a first port of a first port group as a source MAC and taking a last port of a last port group as a destination MAC;

s42, configuring the white box switch to create uplink flow of an MAC (media access control) taking the last port of the last port group as a source MAC and taking the first port of the first port group as a destination MAC;

s43, configuring uplink flow and downlink flow to be sent simultaneously, forming a flow storm, and setting a duration time threshold of the flow storm;

s44, configuring the white box switch within a duration threshold, and checking whether each port has an FCS error at set time intervals;

if so, prompting the number of wrong port numbers and the number of errors, and prompting that the port test fails;

and if not, prompting that the flow test is passed.

10. The testing method applied to the optical module of the white-box switch as claimed in claim 9, wherein in step S44, the white-box switch is configured to check whether the FCS error exists on the port between the source MAC and the destination MAC within the duration threshold at every set time period.

Technical Field

The invention belongs to the technical field of optical module testing, and particularly relates to a testing method applied to an optical module of a white box switch.

Background

vlan, a Virtual Local Area Network (vlan) is a short name for Virtual Local Area Network (lan).

FCS, a short for Frame Check Sequence, is a Frame Check Sequence in which special Check code characters are added to frames in a communication protocol for error detection and correction.

The white box switch is a flexible and efficient network device, and a user can deploy different applications and services with personalized characteristics on the same hardware system according to needs. The software decoupling module has the function of decoupling software, can reduce the cost and improve the use flexibility, constructs different components and modules for the special requirements of manufacturers, and is popular among various manufacturers and data centers. Particularly in large data centers. The biggest highlight of the white box switch is the strong openness of the white box switch, so the white box switch has richer choices in the aspects of operating systems, software and the like.

An optical module is an optoelectronic device that performs photoelectric and electro-optical conversion. The sending end of the optical module converts the electric signal into an optical signal, and the receiving end converts the optical signal into the electric signal. Optical modules are classified according to their packaging formats, and SFP, SFP +, SFF, gigabit ethernet interface converter (GBIC), and the like are common. The optical modules can take on the function of transmitting data to and from the switch, and are an important component of the whole data center network.

According to statistics, a large part of the switch-degree faults occur at the optical modules connected to the switch ports, and the stable operation of the optical modules has a crucial influence on the reliability of the operation of the whole switch and even the whole data center. If the optical module fails to work or fails after a long time, network interruption may be caused. Therefore, the compatibility and reliability of optical modules in use are important components in testing white box switches.

In the conventional compatibility test of the optical modules of the white box switch, the number and the types of the optical modules are large, and a plurality of items to be tested are also large, but the test among all the test items is independent, and some test items have dependency, so that the test time is limited, and the test is not flexible.

Therefore, it is very necessary to provide a testing method applied to the optical module of the white box switch to solve the above-mentioned drawbacks in the prior art.

Disclosure of Invention

The invention provides an automatic testing method for an optical module of a white box switch, aiming at the defects that in the prior art, in the compatibility test of the optical module of the white box switch, the number and the types of the optical modules are large, and the number of items to be tested is large, so that the time required by the test work is greatly increased, and the efficiency is low.

The invention provides a testing method applied to an optical module of a white box switch, wherein a plurality of ports are arranged in the white box switch and are used for plugging the optical module;

the method comprises the following steps:

s1, dividing all ports in a white box switch into port groups, and connecting the port groups in series to form a loop;

s2, configuring a white box switch to perform basic function tests on the optical module, wherein the basic function tests comprise an optical module in-place identification test and a link communication test;

s3, configuring a white box switch to sequentially perform optical module compatibility test on the ports of each port group connected with the adjacent port group;

and S4, configuring the white box switch to perform flow test on the optical module, establishing a bidirectional flow storm among the port groups, and detecting whether each port has a transmission error.

Further, the step S1 specifically includes the following steps:

s11, setting all ports in the white box switch into a sequence, and setting two adjacent ports into a port group;

s12, connecting adjacent port groups by using cables;

and S13, connecting the last port of the last port group with the first port of the first port group by using a cable to form a snake-shaped annular connection. The last port is connected to the first port by a cable in order to form a broadcast storm in the traffic test.

Further, in step S3, the optical module compatibility test includes optical module on-site detection, link connectivity detection, port optical module model information detection, and port switch test.

Further, the step S2 specifically includes the following steps:

s21, configuring a white box switch to judge whether all optical modules are in place;

if yes, go to step S22;

if not, prompting that the optical module is not in place and the test is not passed, and returning to the step S21;

s22, configuring a white box switch to judge whether all ports are connected;

if yes, go to step S23;

if not, prompting that the link fails and the test fails, and returning to the step S21;

and S23, creating the same number of vlans as the number of the port groups, and adding the ports of each port group into the same vlan. The basic function test ensures that each optical module is in place, ports in the same vlan are connected through an optical path, and adjacent port groups are directly connected through cables, namely, link communication is ensured.

Further, the step S3 specifically includes the following steps:

s31, setting a serial number of a port as p, and setting an initial value of p as 2;

s32, positioning a port with a port number p;

s33, judging whether the port p optical module is in place;

if not, prompting that the p-port optical module is not in place, and entering step S37;

if yes, go to step S34;

s34, judging whether the links of the port p are communicated;

if not, prompting that the link is not connected, and entering the step S37;

if yes, go to step S35;

s35, detecting the model information of the optical module on the port p;

s36, carrying out port switch test on the port p;

s37, increasing the value of p by 2, and judging whether the port p reaches the maximum port number;

if yes, go to step S4;

if not, the process returns to step S32. And port compatibility testing is carried out, so that the type information detection of the optical module of the port and the port switch testing are carried out under the condition that the optical module is in place and the port link is communicated.

Further, the step S35 specifically includes the following steps:

s351, judging whether the port p reads information or not;

if not, prompting that the information is read incorrectly, and entering step S355;

if yes, go to step S352;

s352, setting an information reading threshold;

s353, reading the model number and hardware information of the optical module of the port p, searching the hardware information of the optical module of the corresponding model in a standard database, and judging whether the hardware information read by the optical module of the model is consistent with the stored hardware information;

if not, go to step S355;

if yes, go to step S354;

s354, judging whether the information reading times reach an information reading threshold value;

if yes, go to step S36;

if not, returning to the step S353;

and S355, prompting that the port p fails in the test. And detecting the model information of the optical module to ensure that the hardware information of the corresponding optical module model is consistent with the corresponding content in the standard test result library.

Further, the step S36 specifically includes the following steps:

s361, setting a port switching frequency threshold value;

s362, closing the port p, and waiting for setting a first time period;

s363, judging whether the port state and the optical power information of the port p +1 are abnormal or not;

if yes, prompting that the port is closed abnormally, and entering a step S367;

s364, opening a port p and waiting for setting a second time period;

s365, judging whether the port state and the optical power information of the port p +1 are abnormal or not;

if yes, prompting that the port is abnormally opened, and entering step S367;

if not, go to step S366;

s366, judging whether the port switching frequency reaches a port switching frequency threshold value;

if yes, prompting that the port p compatibility test is passed, and entering step S37;

if not, returning to the step S362;

s367, prompting that the port p compatibility test is failed, and entering the step S37. The port switch test is carried out by mutually matching two optical modules which are connected in pairs by adjacent port groups through cables.

Further, in step S363, the expected port state and the optical power information of the port p +1 after the port p is closed are obtained;

acquiring the actual port state and optical power information of the port p + 1;

comparing the expected port state and the optical power information of the port p +1 with the actual port state and the optical power information, and judging whether the port p +1 is abnormal or not;

in step S365, the expected port state and optical power information of the port p +1 after the port p is opened are obtained;

acquiring the actual port state and optical power information of the port p + 1;

and comparing the expected port state and the optical power information of the port p +1 with the actual port state and the optical power information to judge whether the abnormality exists.

Further, whether the port state and the optical power information of the port p +1 are abnormal or not is judged, and simultaneously, a system log is recorded.

Further, in step S365, it is determined whether the port state and the optical power information of the port p +1 are abnormal, and a system log is recorded. The system log is used to analyze test procedure usage.

Further, the step S4 specifically includes the following steps:

s41, configuring a white box switch to create downlink flow taking a first port of a first port group as a source MAC and taking a last port of a last port group as a destination MAC;

s42, configuring the white box switch to create uplink flow of an MAC (media access control) taking the last port of the last port group as a source MAC and taking the first port of the first port group as a destination MAC;

s43, configuring uplink flow and downlink flow to be sent simultaneously, forming a flow storm, and setting a duration time threshold of the flow storm;

s44, configuring the white box switch within a duration threshold, and checking whether each port has an FCS error at set time intervals;

if so, prompting the number of wrong port numbers and the number of errors, and prompting that the port test fails;

and if not, prompting that the flow test is passed. And the flow test is realized by setting a large amount of flow storms in a time period.

Further, in step S44, the white box switch is configured to check whether the port between the source MAC and the destination MAC has FCS errors at a set time interval within the duration threshold. Passing the continuous FCS error packet indicates that the flow test fails.

The beneficial effect of the invention is that,

the testing method applied to the optical modules of the white box switch provided by the invention realizes the testing of all the optical modules in the white box switch, covers the basic function testing, the compatibility testing and the flow testing, completes all the testing items at one time, improves the testing efficiency, tests comprehensively and ensures the reliability of the optical modules.

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 port connections of the white box switch of the present invention.

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.

15页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种PAM4光模块、测试装置及系统

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!