WO2021128936A1 - 报文的处理方法及装置 - Google Patents

报文的处理方法及装置 Download PDF

Info

Publication number
WO2021128936A1
WO2021128936A1 PCT/CN2020/113577 CN2020113577W WO2021128936A1 WO 2021128936 A1 WO2021128936 A1 WO 2021128936A1 CN 2020113577 W CN2020113577 W CN 2020113577W WO 2021128936 A1 WO2021128936 A1 WO 2021128936A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
switching device
cpu
port
mac address
Prior art date
Application number
PCT/CN2020/113577
Other languages
English (en)
French (fr)
Inventor
赵茂聪
麻孝强
何志川
Original Assignee
盛科网络(苏州)有限公司
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 盛科网络(苏州)有限公司 filed Critical 盛科网络(苏州)有限公司
Publication of WO2021128936A1 publication Critical patent/WO2021128936A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/20Support for services
    • H04L49/208Port mirroring
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements

Definitions

  • the present invention relates to the field of computers, and in particular to a method and device for processing messages.
  • the traditional network switching equipment test system is shown in Figure 1.
  • the packet sending instrument sends the required messages to the network port of the switch.
  • the message enters the chip port from the network port and then enters the switch chip, and passes through the IPE (Ingress Process Engine, Ingress processing engine), TM (Traffic Management, traffic management), EPE (Egress Process Engine, egress processing engine), and finally sent to the packet receiving instrument through the network port of the switch, and the received packets can be observed on the packet receiving instrument. Confirm the correctness of the message forwarding and editing.
  • IPE Ingress Process Engine, Ingress processing engine
  • TM Traffic Management, traffic management
  • EPE Egress Process Engine, egress processing engine
  • the existing network switching equipment test system relies heavily on external equipment and requires testers and cables. Generally, testers and optical modules are more expensive. In most companies, testers and cable resources are in short supply, and most resources are prioritized. Used for urgent needs, once the demand is high, the resources are not enough, it will affect the work progress and efficiency, and in some work tasks, such as stress testing, the test instrument will be occupied for a long time, which will lead to a waste of resources. Therefore, the testing of general network equipment consumes too much hardware resources and increases the company's operating costs.
  • the embodiment of the present invention provides a message processing method and device, so as to solve the problem that the test of the switching device in the related art needs to rely on a tester and a cable, which results in high test cost and low efficiency.
  • a message processing method including: a processor CPU sends a first message to a switching device; the CPU receives the switching device to process the first message The second message obtained later, wherein, the second message is an out-of-message sent by the switching device through a network port, and the second message is a mirror image of the out-of-message sent by the switching device through the network port Message.
  • a message processing device which is applied to the CPU side of a processor, and includes: a sending module, configured to send a first message to a switching device; and a receiving module, configured to receive The second message obtained after the switching device processes the first message, wherein the second message is an outgoing message sent by the switching device through a network port, and the second message is all The switching device sends out the mirroring message of the message through the network port.
  • the processor CPU sends the first message to the switching device, and then the CPU receives the second message obtained after the switching device processes the first message, wherein the second message is the switching device passing through the network port Send out the message, and the second message is the mirror message sent by the switching device through the network port, which realizes the function of CPU to send and receive packets instead of the tester and cable of the traditional network switching device, thus solving the related technology
  • the testing of switching equipment in China needs to rely on testers and cables, which leads to the problems of high test cost and low efficiency, improves the efficiency of switching equipment testing, and saves corresponding resources at the same time.
  • Figure 1 is a schematic diagram of the structure of a network switching equipment test system in related technologies
  • Fig. 2 is a flowchart of a method for message processing according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of the structure of a network switching equipment test system according to an embodiment of the present invention.
  • FIG. 4 is an optional flowchart 1 of a method for processing a message according to an embodiment of the present invention.
  • Fig. 5 is an optional second flowchart of a message processing method according to an embodiment of the present invention.
  • Fig. 6 is a structural block diagram of a three-layer forwarding networking according to an embodiment of the present invention.
  • Fig. 7 is a schematic structural diagram of a message processing device according to an embodiment of the present invention.
  • FIG. 2 is a flowchart of a message processing method according to an embodiment of the present invention. As shown in FIG. 2, the process includes the following steps:
  • Step S202 the processor CPU sends the first message to the switching device
  • Step S204 the CPU receives a second message obtained after the switching device processes the first message, where the second message is a message sent by the switching device through the network port, and the second message is the switching device through the network port Send out the mirror message of the message.
  • the processor CPU sends the first message to the switching device, and then the CPU receives the second message obtained after the switching device processes the first message, where the second message is the exchange
  • the device sends out messages through the network port, and the second message is a mirrored message that the switching device sends out messages through the network port, which realizes the function of sending and receiving packets through the CPU to replace the tester and cables of the traditional network switching equipment. It solves the problem of high test cost and low efficiency in the related technology that the test of the switching equipment needs to rely on the tester and the cable, improves the efficiency of the switching equipment test, and can save corresponding resources at the same time.
  • the manner in which the processor CPU sends the first message to the switching device involved in step S202 may be: the CPU sends the first message to the first specified switch device port.
  • Fig. 3 is a schematic structural diagram of a network switching equipment test system according to an embodiment of the present invention.
  • step S202 in a specific application scenario may be: the required report is sent by the CPU.
  • the content of the text is stored in the requested memory, and the message is sent to the switch chip port through DMA (Direct Memory Access), and the message enters the chip IPE processing of the switching device.
  • DMA can specify the packet to be sent to the network device On the port corresponding to the panel port, for a switching device, the panel port of the device is actually a chip port of the switching chip, and DMA packets can be sent directly to this chip port through the internal channel.
  • step S204 in a specific application scenario can be: the message is processed by the chip IPE, TM, and EPE of the switching device, and then sent from the network port of the switching device.
  • the present invention configures the mirror ( Mirror) to the CPU, after the message is sent from the switch network exit, there will be a copy of the same message sent to the CPU through DMA, this message will also carry some other information and go to the CPU together, for example, it will carry out the port. Message type, etc. This information will be used by the CPU to parse the message.
  • the method of this embodiment may further include:
  • Step S206 the CPU parses the second message to obtain port information carried in the second message
  • Step S208 the CPU compares the expected port information with the port information carried in the second message
  • step S210 if the comparison result is consistent, the CPU determines that the forwarding of the second message is correct; if the comparison result is inconsistent, the CPU determines that the forwarding of the second message is incorrect.
  • the method of this embodiment may further include:
  • Step S212 the CPU parses the second message to obtain the MAC address information carried in the second message
  • Step S214 the CPU compares the expected MAC address information with the MAC address information carried in the second message
  • step S216 if the comparison result is consistent, the CPU determines that the editing operation on the second message is correct; if the comparison result is inconsistent, the CPU determines that the editing operation on the second message is incorrect.
  • this embodiment based on the outgoing port and the message type carried in the above second message, after the CPU receives the second message obtained after the switching device processes the first message, this embodiment Examples of methods can also include:
  • Step S220 The CPU determines the number of packets received by the second designated port according to the port information and/or the MAC address information.
  • the three-layer forwarding networking situation is used to illustrate the network switching equipment software test system proposed in this embodiment.
  • PC A and PC B communicate through a switch L3_SW.
  • the MAC address of PC A is A
  • the IP address is 1.1.1.2
  • the MAC address of the switch is S
  • the MAC address of PC B is B
  • the IP address is 2.1.1.2.
  • the testing method of this alternative embodiment includes the following two processes:
  • the CPU constructs a message with a destination MAC address: MAC S, a source MAC address: MAC A, a source IP address: 1.1.1.2, and a destination IP address: 2.1.1.2.
  • the CPU sends the constructed message to the chip port corresponding to the switch port P1 through DMA. Then the switch chip will process the message.
  • the CPU expects to receive a message (destination MAC address: MAC B, source MAC address: MAC S, source IP address: 1.1.1.2, destination IP address: 2.1.1.2). If the CPU does not receive the message, there may be a forwarding error, and you need to check the configuration of the chip; if the CPU receives the message, then the CPU will parse the outgoing port information and message content carried in the message. In this example, the CPU will parse Outgoing port a1, destination MAC address b1, source MAC address c1.
  • a1 is not equal to P2, or b1 is not equal to MAC B, or c1 is not equal to MAC S, then the message is forwarded or edited incorrectly; if a1 is equal to P2, b1 is equal to MAC B, and c1 is equal to MAC S, then the message is forwarded and edited correctly , The number of packets received by the CPU plus one, this count will be used for actual packet statistics.
  • the CPU packet sending and receiving function is used to replace the tester and cable of the traditional network switching equipment.
  • the software test does not rely on external equipment, which can improve the efficiency of network switching equipment testing and save resources such as testers. , Improve resource utilization.
  • the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, of course, it can also be implemented by hardware, but in many cases the former is Better implementation.
  • the technical solution of the present invention essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, The optical disc) includes a number of instructions to enable a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the method described in each embodiment of the present invention.
  • a message processing device is also provided, which is used to implement the above-mentioned embodiments and preferred implementations, and the descriptions that have already been described will not be repeated.
  • the term "module” can implement a combination of software and/or hardware with predetermined functions.
  • the devices described in the following embodiments are preferably implemented by software, implementation by hardware or a combination of software and hardware is also possible and conceived.
  • Fig. 7 is a structural block diagram of a message processing device according to an embodiment of the present invention.
  • the device should be set on the CPU side of the processor.
  • the device includes: a sending module 52 configured to send the first message To the switching device; the receiving module 54 is configured to receive a second message obtained after the switching device processes the first message, where the second message is a message sent by the switching device through a network port, and the second message It is a mirroring message that the switching device sends out messages through the network port.
  • the sending module 52 in this embodiment is further configured to send the first packet to the first designated port of the switching device.
  • the apparatus of this embodiment may further include: a first parsing module configured to analyze the second message to obtain the second message after receiving the second message obtained after the switching device processes the first message The port information carried in the message; the first comparison module is set to compare the expected port information with the port information carried in the second message; the first determination module is set to compare the result of the comparison with the port information carried in the second message, It is determined that the forwarding of the second message is correct; if the comparison result is inconsistent, it is determined that the forwarding of the second message is wrong.
  • a first parsing module configured to analyze the second message to obtain the second message after receiving the second message obtained after the switching device processes the first message The port information carried in the message
  • the first comparison module is set to compare the expected port information with the port information carried in the second message
  • the first determination module is set to compare the result of the comparison with the port information carried in the second message, It is determined that the forwarding of the second message is correct; if the comparison result is inconsistent, it is determined that the forwarding of the second message is wrong
  • the apparatus of this embodiment may further include: a third parsing module, configured to analyze the second message to obtain the second message after receiving the second message obtained after the switching device processes the first message Port information and/or MAC address information carried in the message; the third determining module is configured to determine the number of messages received by the second designated port according to the port information and/or MAC address information.
  • a third parsing module configured to analyze the second message to obtain the second message after receiving the second message obtained after the switching device processes the first message Port information and/or MAC address information carried in the message
  • the third determining module is configured to determine the number of messages received by the second designated port according to the port information and/or MAC address information.
  • each of the above modules can be implemented by software or hardware.
  • it can be implemented in the following manner, but not limited to this: the above modules are all located in the same processor; or, the above modules can be combined in any combination.
  • the forms are located in different processors.
  • the embodiment of the present invention also provides a storage medium in which a computer program is stored, wherein the computer program is configured to execute the steps in any one of the foregoing method embodiments when running.
  • the processor CPU sends the first message to the switching device
  • the CPU receives a second message obtained after the switching device processes the first message, where the second message is a message sent by the switching device through a network port, and the second message is a message sent by the switching device through the network port.
  • the second message is a message sent by the switching device through the network port.
  • the foregoing storage medium may include, but is not limited to: U disk, Read-Only Memory (Read-Only Memory, ROM for short), Random Access Memory (Random Access Memory, RAM for short), Various media that can store computer programs, such as mobile hard disks, magnetic disks, or optical disks.
  • An embodiment of the present invention also provides an electronic device, including a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the foregoing method embodiments.
  • the aforementioned electronic device may further include a transmission device and an input-output device, wherein the transmission device is connected to the aforementioned processor, and the input-output device is connected to the aforementioned processor.
  • the foregoing processor may be configured to execute the following steps through a computer program:
  • the processor CPU sends the first message to the switching device
  • the CPU receives a second message obtained after the switching device processes the first message, where the second message is a message sent by the switching device through a network port, and the second message is a message sent by the switching device through the network port.
  • the second message is a message sent by the switching device through the network port.
  • modules or steps of the present invention can be implemented by a general computing device, and they can be concentrated on a single computing device or distributed in a network composed of multiple computing devices.
  • they can be implemented with program codes executable by the computing device, so that they can be stored in the storage device for execution by the computing device, and in some cases, can be executed in a different order than here.

Landscapes

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

Abstract

本发明提供了一种报文的处理方法及装置,其中,该方法包括:处理器CPU将第一报文发送到交换设备;所述CPU接收所述交换设备对所述第一报文进行处理后得到的第二报文,其中,所述第二报文为所述交换设备通过网络端口发出去报文,且所述第二报文为所述交换设备通过网络端口发出去报文的镜像报文。通过本发明,解决了相关技术中对交换设备的测试需要依赖测试仪和线缆,导致测试成本较高且效率低的问题。

Description

报文的处理方法及装置 技术领域
本发明涉及计算机领域,具体而言,涉及一种报文的处理方法及装置。
背景技术
近几年,随着各种应用和服务的高速发展,网络交换设备的功能和性能也越来越强大,为了保证网络交换设备在实际应用中高效稳定,网络交换设备的软件测试也变的越来越重要。软件测试系统主要包括了测试仪、线缆、网络交换设备,通过线缆将测试仪与网络交换设备连接起来,根据实际的应用需求,在测试仪器上发送相应格式的报文,报文进入网络交换设备后,在经过处理后从交换设备的端口发送到测试仪,最后在测试仪上观察收到的报文,确认报文转发编辑的正确性。对于网络设备测试而言,关键在于测试套件如何发送报文到设备以及如何检验报文接收的正确性。
传统的网络交换设备测试系统如图1所示,通过发包仪器发送需要的报文到交换机的网络端口,报文从网络端口进入芯片端口进而进入交换机芯片,经过交换芯片的IPE(Ingress Process Engine,入口处理引擎),TM(Traffic Management,流量管理),EPE(Egress Process Engine,出口处理引擎),最后通过交换机的网络端口发送到收包仪器,在收包仪器上可以观察收到的报文,确认报文转发编辑的正确性。
现有的网络交换设备测试系统对外接设备依赖很大,需要测试仪和线缆,一般测试仪,光模块比较昂贵,在大多数公司中,测试仪和线缆资源紧缺,大多数资源都优先给紧急的需求使用,一旦需求较多时,资源不够,就会影响工作进度和效率,而且在一些工作任务中,如压力测试等会一直占用测试仪器很长时间,这样会导致资源的浪费。所以一般网络设备的测试会消耗过多的硬件资源,提高公司的运营成本。
针对相关技术中的上述问题,目前尚未存在有效的解决方案。
发明内容
本发明实施例提供了一种报文的处理方法及装置,以解决相关技术中对交换设备的测试需要依赖测试仪和线缆,导致测试成本较高且效率低的问题。
根据本发明的一个实施例,提供了一种报文的处理方法,包括:处理器CPU将第一报文发送到交换设备;所述CPU接收所述交换设备对所述第一报文进行处理后得到的第二报文,其中,所述第二报文为所述交换设备通过网络端口发出去报文,且所述第二报文为所述交换设备通过网络端口发出去报文的镜像报文。
根据本发明的另一个实施例,提供了一种报文的处理装置,应用于处理器CPU侧,包括:发送模块,设置为将第一报文发送到交换设备;接收模块,设置为接收所述交换设备对所述第一报文进行处理后得到的第二报文,其中,所述第二报文为所述交换设备通过网络端口发出去报文,且所述第二报文为所述交换设备通过网络端口发出去报文的镜像报文。
通过本发明,通过处理器CPU将第一报文发送到交换设备,进而CPU接收交换设备对第一报文进行处理后得到的第二报文,其中,第二报文为交换设备通过网络端口发出去报文,且第二报文为交换设备通过网络端口发出去报文的镜像报文,实现了通过CPU收发包功能来代替传统网络交换设备的测试仪和线缆,从而解决了相关技术中对交换设备的测试需要依赖测试仪和线缆,导致测试成本较高且效率低的问题,提高交换设备测试的效率,同时可以节省相应的资源。
附图说明
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1是相关技术中的网络交换设备测试系统结构示意图;
图2是根据本发明实施例的报文处理的方法的流程图;
图3是根据本发明实施例的网络交换设备测试系统结构示意图;
图4是根据本发明实施例的报文处理的方法的可选流程图一;
图5是根据本发明实施例的报文处理的方法的可选流程图二;
图6是根据本发明实施例的三层转发组网的结构框图;
图7是根据本发明实施例报文处理装置的结构示意图。
具体实施方式
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
在本实施例中提供了一种报文的处理方法,图2是根据本发明实施例的报文的处理方法的流程图,如图2所示,该流程包括如下步骤:
步骤S202,处理器CPU将第一报文发送到交换设备;
步骤S204,CPU接收交换设备对第一报文进行处理后得到的第二报文,其中,第二报文为交换设备通过网络端口发出去报文,且第二报文为交换设备通过网络端口发出去报文的镜像报文。
通过上述步骤S202和步骤S204,通过处理器CPU将第一报文发送到交换设备,进而CPU接收交换设备对第一报文进行处理后得到的第二报文,其中,第二报文为交换设备通过网络端口发出去报文,且第二报文为交换设备通过网络端口发出去报文的镜像报文,实现了通过CPU收发包功能来代替传统网络交换设备的测试仪和线缆,从而解决了相关技术中对交换设备的测试需要依赖测试仪和线缆,导致测试成本较高且效率低的问题,提高交换设备测试的效率,同时可以节省相应的资源。
在本实施例的可选实施方式中,对于步骤S202中涉及到的处理器CPU将第一报文发送到交换设备的方式,可以是:CPU将第一报文发送到交换设备的第一指定端口。
图3是根据本发明实施例的网络交换设备测试系统的结构示意图,基于图3,本实施例中基于CPU收发包的方法中步骤S202在具体应用场景中可以是:通过CPU将所需的报文内容存储在申请的内存中,通过DMA(Direct Memory Access,直接内存读写)将报文发送到交换机芯片端口,报文进入交换设备的芯片IPE处理,其中,DMA可以指定发包到与网络设备面板口对应的端口上,对于交换设备,设备的面板口实际对于交换芯片的一个芯片端口,DMA发包可以通过内部通道直接发送到这个芯片端口上。
此外,基于图3,对于上述步骤S204在具体应用场景中可以是:报文经过交换设备的芯片IPE、TM、EPE处理后,从交换设备网络端口发送出去,本发明在交换机出口上配置mirror(镜像)到CPU,报文从交换机网络出口发送出去后,会有一份相同的报文会经过DMA发送到CPU,这份报文还会携带一些其他信息一起上CPU,比如说会携带出端口,报文类型等。这些信息会用于CPU解析报文。
在本实施例的可选实施方式中,基于上述第二报文中携带的出端口,报文类型,在CPU接收交换设备对第一报文进行处理后得到的第二报文之后,如图4所示,本实施例的方法还可以包括:
步骤S206,CPU对第二报文进行解析得到第二报文中携带的端口信息;
步骤S208,CPU将所期望的端口信息与第二报文中携带的端口信息进行比较;
步骤S210,在比较结果为一致的情况下,CPU确定第二报文的转发正确;在比较结果不一致的情况下,CPU确定第二报文的转发错误。
通过上述步骤S204至步骤S210可知,解析报文携带的出端口信息, 用来判断报文是从哪个网络端口发送出去,进而确认报文的转发行为是否正确。
在本实施例的可选实施方式中,基于上述第二报文中携带的出端口,报文类型,在CPU接收交换设备对第一报文进行处理后得到的第二报文之后,如图5所示,本实施例的方法还可以包括:
步骤S212,CPU对第二报文进行解析得到第二报文中携带的MAC地址信息;
步骤S214,CPU将所期望的MAC地址信息与第二报文中携带的MAC地址信息进行比较;
步骤S216,在比较结果为一致的情况下,CPU确定对第二报文的编辑操作正确;在比较结果不一致的情况下,CPU确定对第二报文的编辑操作错误。
通过上述步骤S212至步骤S216可知,解析第二报文中携带的报文内容,如MAC地址等,用来确认报文的编辑行为是否正确。
在本实施例的可选实施方式中,基于上述第二报文中携带的出端口,报文类型,在CPU接收交换设备对第一报文进行处理后得到的第二报文之后,本实施例的方法还可以包括:
步骤S218,CPU对第二报文进行解析得到第二报文中携带的端口信息和/或MAC地址信息;
步骤S220,CPU根据端口信息和/或MAC地址信息进行确定第二指定端口接收到的报文数量。
通过上述步骤S218至步骤S220,报文统计,通过解析报文的出端口、报文内容,进行报文过滤,统计出指定端口收到指定报文的个数。
下面结合本实施例的具体实施方式对本申请进行举例说明;
在本可选实施方式中以三层转发组网情况来说明本实施例的提出的网络交换设备软件测试系统,如图6所示,PC A与PC B之间通过交换机 L3_SW进行通信。PC A的MAC地址为A,IP地址为1.1.1.2,交换机的MAC地址为S,PC B的MAC地址为B,IP地址为2.1.1.2。报文(目的MAC地址:MAC S,源MAC地址:MAC A,源IP地址:1.1.1.2,目的IP地址:2.1.1.2)从交换机端口P1进入交换机后,期望从交换机端口P2发出报文(目的MAC地址:MAC B,源MAC地址:MAC S,源IP地址:1.1.1.2,目的IP地址:2.1.1.2),传统的测试方法,将交换机L3_SW通过线缆与测试仪相连,通过测试仪发送相应报文从P1口进入,然后报文会从P2口发送到测试仪,再在测试仪上观察报文是否正确。
基于本可选实施方式中图6中网络交换设备软件测试系统,本可选实施方式的测试方法包括以下两个过程:
1)CPU发包
其中,首先CPU构造目的MAC地址:MAC S,源MAC地址:MAC A,源IP地址:1.1.1.2,目的IP地址:2.1.1.2的报文。CPU将构造好的报文,通过DMA将报文发送到交换机端口P1所对应的芯片端口。然后交换机芯片会对报文进行处理。
2)CPU收包
其中,CPU期望收到报文(目的MAC地址:MAC B,源MAC地址:MAC S,源IP地址:1.1.1.2,目的IP地址:2.1.1.2)。如果CPU没有收到报文,那么可能转发出错,需要去检查芯片的配置;如果CPU收到报文,那么CPU会解析报文携带的出端口信息和报文内容,在本示例中CPU会解析出出端口a1,目的MAC地址b1,源MAC地址c1。如果a1不等于P2,或者b1不等于MAC B,或者c1不等于MAC S,那么报文转发或编辑出错;如果a1等于P2,b1等于MAC B,c1等于MAC S,那么报文转发和编辑正确,CPU收到报文的个数加1,这个计数会用于实际的报文统计。
通过本可选实施方式,利用CPU收发包功能来代替传统网络交换设备的测试仪和线缆,软件测试时不依赖外接的设备,能够提高网络交换设 备测试的效率,同时可以节省测试仪等资源,提高资源利用率。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。
在本实施例中还提供了一种报文的处理装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图7是根据本发明实施例的报文的处理装置的结构框图,该装置应设置为处理器CPU侧,如图7所示,该装置包括:发送模块52,设置为将第一报文发送到交换设备;接收模块54,设置为接收交换设备对第一报文进行处理后得到的第二报文,其中,第二报文为交换设备通过网络端口发出去报文,且第二报文为交换设备通过网络端口发出去报文的镜像报文。
可选地,本实施例中的发送模块52,还设置为将第一报文发送到交换设备的第一指定端口。
可选地,本实施例的装置还可以包括:第一解析模块,设置为在接收交换设备对第一报文进行处理后得到的第二报文之后,对第二报文进行解析得到第二报文中携带的端口信息;第一比较模块,设置为将所期望的端口信息与第二报文中携带的端口信息进行比较;第一确定模块,设置为在比较结果为一致的情况下,确定第二报文的转发正确;在比较结果为不一致的情况下,确定第二报文的转发错误。
可选地,本实施例的装置还可以包括:第二解析模块,设置为在接收交换设备对第一报文进行处理后得到的第二报文之后,对第二报文进行解析得到第二报文中携带的MAC地址信息;第二比较模块,设置为将所期望的MAC地址信息与第二报文中携带的MAC地址信息进行比较;第二确定模块,设置为在比较结果为一致的情况下,确定对第二报文的编辑操作正确;在比较结果不一致的情况下,确定对第二报文的编辑操作错误。
可选地,本实施例的装置还可以包括:第三解析模块,设置为在接收交换设备对第一报文进行处理后得到的第二报文之后,对第二报文进行解析得到第二报文中携带的端口信息和/或MAC地址信息;第三确定模块,设置为根据端口信息和/或MAC地址信息进行确定第二指定端口接收到的报文数量。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。
本发明的实施例还提供了一种存储介质,该存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,处理器CPU将第一报文发送到交换设备;
S2,CPU接收交换设备对第一报文进行处理后得到的第二报文,其中,第二报文为交换设备通过网络端口发出去报文,且第二报文为交换设备通过网络端口发出去报文的镜像报文。
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。
本发明的实施例还提供了一种电子装置,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。
可选地,上述电子装置还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。
可选地,在本实施例中,上述处理器可以被设置为通过计算机程序执行以下步骤:
S1,处理器CPU将第一报文发送到交换设备;
S2,CPU接收交换设备对第一报文进行处理后得到的第二报文,其中,第二报文为交换设备通过网络端口发出去报文,且第二报文为交换设备通过网络端口发出去报文的镜像报文。
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (10)

  1. 一种报文的处理方法,包括:
    处理器CPU将第一报文发送到交换设备;
    所述CPU接收所述交换设备对所述第一报文进行处理后得到的第二报文,其中,所述第二报文为所述交换设备通过网络端口发出去报文,且所述第二报文为所述交换设备通过网络端口发出去报文的镜像报文。
  2. 根据权利要求1所述的方法,其中,处理器CPU将第一报文发送到交换设备,包括:
    所述CPU将第一报文发送到所述交换设备的第一指定端口。
  3. 根据权利要求1所述的方法,其中,在所述CPU接收所述交换设备对所述第一报文进行处理后得到的第二报文之后,所述方法还包括:
    所述CPU对所述第二报文进行解析得到所述第二报文中携带的端口信息;
    所述CPU将所期望的端口信息与所述第二报文中携带的端口信息进行比较;
    在比较结果为一致的情况下,所述CPU确定所述第二报文的转发正确;在所述比较结果不一致的情况下,所述CPU确定所述第二报文的转发错误。
  4. 根据权利要求1所述的方法,其中,在所述CPU接收所述交换设备对所述第一报文进行处理后得到的第二报文之后,所述方法还包括:
    所述CPU对所述第二报文进行解析得到所述第二报文中携带的MAC地址信息;
    所述CPU将所期望的MAC地址信息与所述第二报文中携带的MAC地址信息进行比较;
    在比较结果为一致的情况下,所述CPU确定对所述第二报文的编辑操作正确;在所述比较结果不一致的情况下,所述CPU确定对所述第二报文的编辑操作错误。
  5. 根据权利要求1所述的方法,其中,在所述CPU接收所述交换设备对所述第一报文进行处理后得到的第二报文之后,所述方法还包括:
    所述CPU对所述第二报文进行解析得到所述第二报文中携带的端口信息和/或MAC地址信息;
    所述CPU根据所述端口信息和/或MAC地址信息进行确定第二指定端口接收到的报文数量。
  6. 一种报文的处理装置,应用于处理器CPU侧,包括:
    发送模块,设置为将第一报文发送到交换设备;
    接收模块,设置为接收所述交换设备对所述第一报文进行处理后得到的第二报文,其中,所述第二报文为所述交换设备通过网络端口发出去报文,且所述第二报文为所述交换设备通过网络端口发出去报文的镜像报文。
  7. 根据权利要求6所述的装置,其中,
    所述发送模块,还设置为将第一报文发送到所述交换设备的第一指定端口。
  8. 根据权利要求6所述的装置,其中,所述装置还包括:
    第一解析模块,设置为在接收所述交换设备对所述第一报文进行处理后得到的第二报文之后,对所述第二报文进行解析得到所述第二 报文中携带的端口信息;
    第一比较模块,设置为将所期望的端口信息与所述第二报文中携带的端口信息进行比较;
    第一确定模块,设置为在比较结果为一致的情况下,确定所述第二报文的转发正确;在所述比较结果为不一致的情况下,确定所述第二报文的转发错误。
  9. 根据权利要求6所述的装置,其中,所述装置还包括:
    第二解析模块,设置为在接收所述交换设备对所述第一报文进行处理后得到的第二报文之后,对所述第二报文进行解析得到所述第二报文中携带的MAC地址信息;
    第二比较模块,设置为将所期望的MAC地址信息与所述第二报文中携带的MAC地址信息进行比较;
    第二确定模块,设置为在比较结果为一致的情况下,确定对所述第二报文的编辑操作正确;在所述比较结果不一致的情况下,确定对所述第二报文的编辑操作错误。
  10. 根据权利要求6所述的装置,其中,所述装置还包括:
    第三解析模块,设置为在接收所述交换设备对所述第一报文进行处理后得到的第二报文之后,对所述第二报文进行解析得到所述第二报文中携带的端口信息和/或MAC地址信息;
    第三确定模块,设置为根据所述端口信息和/或MAC地址信息进行确定第二指定端口接收到的报文数量。
PCT/CN2020/113577 2019-12-26 2020-09-04 报文的处理方法及装置 WO2021128936A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911368905.3A CN111131090A (zh) 2019-12-26 2019-12-26 报文的处理方法及装置
CN201911368905.3 2019-12-26

Publications (1)

Publication Number Publication Date
WO2021128936A1 true WO2021128936A1 (zh) 2021-07-01

Family

ID=70503313

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/113577 WO2021128936A1 (zh) 2019-12-26 2020-09-04 报文的处理方法及装置

Country Status (2)

Country Link
CN (1) CN111131090A (zh)
WO (1) WO2021128936A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111131090A (zh) * 2019-12-26 2020-05-08 盛科网络(苏州)有限公司 报文的处理方法及装置

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101854648A (zh) * 2010-04-14 2010-10-06 华为技术有限公司 通信设备单板的测试方法、设备和测试系统
CN105656708A (zh) * 2014-11-19 2016-06-08 中兴通讯股份有限公司 单板测试方法及装置
CN106330604A (zh) * 2016-08-23 2017-01-11 杭州迪普科技有限公司 一种端口连通性测试的方法及装置
US20180054416A1 (en) * 2015-03-03 2018-02-22 Zte Corporation Method and device for uploading protocol packet to cpu
CN108390796A (zh) * 2018-02-10 2018-08-10 盛科网络(苏州)有限公司 一种网络时延测试方法及装置
CN110493073A (zh) * 2019-07-12 2019-11-22 苏州浪潮智能科技有限公司 一种网络交换机端口功能的测试方法和系统
CN111131090A (zh) * 2019-12-26 2020-05-08 盛科网络(苏州)有限公司 报文的处理方法及装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002184948A (ja) * 2000-12-12 2002-06-28 Hitachi Ltd 半導体集積回路装置の製造方法
CN101873236B (zh) * 2010-06-13 2014-04-30 中兴通讯股份有限公司 一种报文的测试方法及系统
CN103036734A (zh) * 2011-10-10 2013-04-10 盛科网络(苏州)有限公司 网络芯片逻辑验证方法及系统
CN102970187B (zh) * 2012-12-04 2015-09-09 华为技术有限公司 一种单板测试方法、装置及系统

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101854648A (zh) * 2010-04-14 2010-10-06 华为技术有限公司 通信设备单板的测试方法、设备和测试系统
CN105656708A (zh) * 2014-11-19 2016-06-08 中兴通讯股份有限公司 单板测试方法及装置
US20180054416A1 (en) * 2015-03-03 2018-02-22 Zte Corporation Method and device for uploading protocol packet to cpu
CN106330604A (zh) * 2016-08-23 2017-01-11 杭州迪普科技有限公司 一种端口连通性测试的方法及装置
CN108390796A (zh) * 2018-02-10 2018-08-10 盛科网络(苏州)有限公司 一种网络时延测试方法及装置
CN110493073A (zh) * 2019-07-12 2019-11-22 苏州浪潮智能科技有限公司 一种网络交换机端口功能的测试方法和系统
CN111131090A (zh) * 2019-12-26 2020-05-08 盛科网络(苏州)有限公司 报文的处理方法及装置

Also Published As

Publication number Publication date
CN111131090A (zh) 2020-05-08

Similar Documents

Publication Publication Date Title
WO2021135532A1 (zh) 云网络漏洞挖掘方法、装置、电子设备及介质
CN107241315B (zh) 银行网关接口的接入方法、装置及计算机可读存储介质
CN110750592B (zh) 数据同步的方法、装置和终端设备
WO2021164261A1 (zh) 云网络设备的测试方法、存储介质和计算机设备
CN110324198A (zh) 丢包处理方法和丢包处理装置
US20080162690A1 (en) Application Management System
US10944636B2 (en) Dynamically identifying criticality of services and data sources
CN107133231B (zh) 一种数据获取方法和装置
CN111984561B (zh) 一种bmc的ipmi命令处理方法、系统、设备以及介质
US7562156B2 (en) System and method for decoding communications between nodes of a cluster server
US9917747B2 (en) Problem detection in a distributed digital network through distributed packet analysis
CN116056126A (zh) 仿真测试方法、装置、计算机设备和计算机可读存储介质
WO2021128936A1 (zh) 报文的处理方法及装置
CN107040613A (zh) 一种报文传输方法及系统
CN111447273B (zh) 云处理系统及基于云处理系统的数据处理方法
CN115033407B (zh) 一种适用于云计算的采集识别流量的系统和方法
CN110266554B (zh) 一种私有通信协议的测试方法
CN114143079B (zh) 包过滤策略的验证装置及方法
CN110798371A (zh) 一种私有通信协议的测试方法
CN113872826B (zh) 网卡端口稳定性测试方法、系统、终端及存储介质
CN111314805B (zh) 一种gpon系统互通omci消息的调试方法和装置
US20110270970A1 (en) Network device testing system and method
CN112737872B (zh) 一种arinc664p7端系统跨网测试系统和方法
CN115277558B (zh) 报文发送方法、装置、计算机存储介质及电子设备
US20230066835A1 (en) Methods, systems and computer readable media for improving remote direct memory access performance

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20906490

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20906490

Country of ref document: EP

Kind code of ref document: A1