CN110519116B - Cyclic redundancy check code storage comparison module and switching equipment performance test system - Google Patents

Cyclic redundancy check code storage comparison module and switching equipment performance test system Download PDF

Info

Publication number
CN110519116B
CN110519116B CN201910631114.9A CN201910631114A CN110519116B CN 110519116 B CN110519116 B CN 110519116B CN 201910631114 A CN201910631114 A CN 201910631114A CN 110519116 B CN110519116 B CN 110519116B
Authority
CN
China
Prior art keywords
cyclic redundancy
redundancy check
check code
packet
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910631114.9A
Other languages
Chinese (zh)
Other versions
CN110519116A (en
Inventor
董春雷
刘勤让
吕平
李沛杰
沈剑良
陈艇
宋克
刘冬培
虎艳宾
张帆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Information Engineering University of PLA Strategic Support Force
Original Assignee
Information Engineering University of PLA Strategic Support Force
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 Information Engineering University of PLA Strategic Support Force filed Critical Information Engineering University of PLA Strategic Support Force
Priority to CN201910631114.9A priority Critical patent/CN110519116B/en
Publication of CN110519116A publication Critical patent/CN110519116A/en
Application granted granted Critical
Publication of CN110519116B publication Critical patent/CN110519116B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors
    • H04L43/0847Transmission error
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0852Delays

Landscapes

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

Abstract

The invention provides a cyclic redundancy check code storage comparison module and a switching equipment performance test system, which relate to the technical field of switching equipment, wherein the module comprises a first cyclic redundancy check code storage unit, a second cyclic redundancy check code storage unit and a third cyclic redundancy check code storage unit, wherein the first cyclic redundancy check code storage unit is used for receiving and sending a first cyclic redundancy check code of an ith data packet to be forwarded to switching equipment to be tested and writing the first cyclic redundancy check code into a storage space in sequence; the first cyclic redundancy check code reading unit is used for reading the first cyclic redundancy check code from the storage space in sequence when the first cyclic redundancy check code storage unit receives the second cyclic redundancy check code of the ith data packet after forwarding; and the comparison unit is used for comparing whether the first cyclic redundancy check code is consistent with the second cyclic redundancy check code so as to judge whether the packet forwarding of the ith data packet is correct. The cyclic redundancy check code storage and comparison module provided by the embodiment of the invention can detect whether the packet forwarding sequence of the switching equipment is correct or not, so that the labor cost is saved, and the detection accuracy is improved.

Description

Cyclic redundancy check code storage comparison module and switching equipment performance test system
Technical Field
The invention relates to the technical field of switching equipment, in particular to a cyclic redundancy check code storage comparison module and a switching equipment performance test system.
Background
In the development stage of the switching device, how to verify that the switching device successfully has the packet forwarding function is a very important topic. The existing verification means is mainly based on packet counting at the transmitting and receiving ends, and whether the packet forwarding function of the switching equipment is normal is verified by counting and comparing the number of data packets transmitted by the transmitting end and the number of data packets received by the receiving end. This is too restrictive, and it can only be verified from the surface whether the switching device can forward the packet to the destination port, and it cannot be verified whether the forwarding order of the packet forwarded to the destination port is correct. If the forwarding order of the data packets is not consistent with the specified forwarding order in the forwarding process, the whole forwarding process is failed.
However, in the prior art, it is only manually detected whether the sequence of the data packets received by the receiving end is consistent with the specified packet forwarding sequence to verify the packet forwarding sequence, which not only consumes a lot of human resources, but also makes errors easily when the number of the packets is large.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a crc storage comparison module and a switching device performance testing system, which can detect whether a packet forwarding sequence of a switching device is correct, more comprehensively check packet forwarding performance of the switching device, and facilitate saving of labor cost and improvement of detection accuracy.
In a first aspect, an embodiment of the present invention provides a cyclic redundancy check code storage comparison module, including: the first cyclic redundancy check code storage unit is used for receiving a first cyclic redundancy check code of the ith data packet to be forwarded sent to the switching equipment to be tested and writing the first cyclic redundancy check code into a storage space in sequence; the first cyclic redundancy check code reading unit is used for reading the first cyclic redundancy check code from the storage space in sequence when the first cyclic redundancy check code storage unit receives the second cyclic redundancy check code of the ith data packet forwarded by the switching equipment to be tested; and the comparison unit is used for comparing whether the first cyclic redundancy check code is consistent with the second cyclic redundancy check code or not and judging whether the packet forwarding of the ith data packet is correct or not according to the comparison result.
With reference to the first aspect, an embodiment of the present invention provides a first possible implementation manner of the first aspect, where the first cyclic redundancy check code storage unit is further configured to record a first time value at a writing time of a first cyclic redundancy check code, and record a second time value at a receiving time of a second cyclic redundancy check code; the first cyclic redundancy check code reading unit is also used for reading a first time value when the first cyclic redundancy check code storage unit receives the second cyclic redundancy check code; the comparing unit is further configured to calculate a forwarding delay time value of the ith packet according to the second time value and the first time value.
With reference to the first or second possible implementation manner of the first aspect, an embodiment of the present invention provides the first possible implementation manner of the first aspect, wherein the switch device to be tested is a switch chip or a switch network.
In a second aspect, an embodiment of the present invention further provides a packet comparison statistic apparatus, including: a packet counter module, a packet delay statistics module, and a crc storage comparison module provided in the second aspect and one of the possible embodiments thereof; the cyclic redundancy check code storage and comparison module is respectively connected with the packet counter module and the packet delay statistical module; the cyclic redundancy check code storage and comparison module is used for sending a judgment result of whether the packet forwarding is correct to the packet counter module and sending a forwarding delay time value to the packet delay statistical module; the packet counter module is used for metering the packet quantity of packet forwarding errors according to the judgment result, metering the packet quantity sent to the switching equipment to be tested and receiving the packet quantity forwarded from the switching equipment to be tested; the packet delay statistic module is used for counting the maximum packet delay value, the minimum packet delay value and the average packet delay value according to the forwarding delay time value.
In a third aspect, an embodiment of the present invention further provides a system for testing performance of a switching device, where the system includes: at least one traffic generator, and the packet comparison statistic device provided in the second aspect; the flow generator comprises a packet generation module, a route management module and a cyclic redundancy check code extraction module; the packet generation module is respectively connected with the route management module and the cyclic redundancy check code extraction module; the cyclic redundancy check code extraction module is also connected with a cyclic redundancy check code storage comparison module in the data packet comparison statistical device; the packet generating module is used for generating a data packet for testing; the route management module is used for realizing the function of table look-up of the route; the cyclic redundancy check code extraction module is used for extracting a first cyclic redundancy check code of a data packet before entering the switching equipment to be tested and a second cyclic redundancy check code of the data packet forwarded by the switching equipment to be tested, and sending the first cyclic redundancy check code and the second cyclic redundancy check code to the cyclic redundancy check code storage and comparison module.
With reference to the third aspect, an embodiment of the present invention provides a first possible implementation manner of the third aspect, where the packet generating module includes a configuration unit, a packet sending control unit, a payload generating unit, a packet header generating unit, and an entire packet encapsulating unit; the configuration unit is connected with the packet sending control unit; the packet sending control unit and the whole packet packaging unit are connected with each other and are respectively connected with the effective load generating unit and the packet head generating unit; the whole package packaging unit is respectively connected with the route management module and the cyclic redundancy check code extraction module; the configuration unit is used for configuring a control register in the flow generator; the packet sending control unit is used for generating an internal control signal according to the configuration signal sent by the control register; the packet header generating unit is used for generating a packet header according to the internal control signal; the effective load generating unit is used for generating effective load data according to the length value of the effective load sent by the packet sending control unit; the whole packet packaging unit is used for generating a splicing packet according to the packet header and the payload data, and calculating a corresponding cyclic redundancy check code according to the splicing packet so as to add the cyclic redundancy check code to the splicing packet to obtain a data packet to be forwarded.
In a fourth aspect, an embodiment of the present invention further provides a cyclic redundancy check code storage comparison method, where the method includes: receiving a first cyclic redundancy check code of an ith data packet to be forwarded sent to the switching equipment to be tested, and writing the first cyclic redundancy check code into a storage space in sequence; when the first cyclic redundancy check code storage unit receives a second cyclic redundancy check code of an ith data packet forwarded by the switching equipment to be tested, reading the first cyclic redundancy check code from the storage space in sequence; and comparing whether the first cyclic redundancy check code is consistent with the second cyclic redundancy check code, and judging whether the packet forwarding of the ith data packet is correct according to the comparison result.
With reference to the fourth aspect, an embodiment of the present invention further provides a first possible implementation manner of the fourth aspect, where after the step of writing the first cyclic redundancy check codes into the storage space in sequence, the method further includes: and recording a first time value of the writing time of the first cyclic redundancy check code.
With reference to the first possible implementation manner of the fourth aspect, an embodiment of the present invention further provides a second possible implementation manner of the fourth aspect, where when the first cyclic redundancy check code storage unit receives a second cyclic redundancy check code of an ith data packet forwarded by the switch device to be tested, the method further includes: and recording a second time value of the receiving moment of the second cyclic redundancy check code, and reading the first time value.
With reference to the second possible implementation manner of the fourth aspect, an embodiment of the present invention further provides a third possible implementation manner of the fourth aspect, where the method further includes: and calculating the forwarding delay time value of the ith data packet according to the second time value and the first time value.
The embodiment of the invention has the following beneficial effects:
the invention provides a cyclic redundancy check code storage comparison module and a switching equipment performance test system, wherein the module comprises a first cyclic redundancy check code storage unit, a second cyclic redundancy check code storage unit and a first forwarding unit, wherein the first cyclic redundancy check code storage unit is used for receiving and sending a first cyclic redundancy check code of an ith data packet to be forwarded to switching equipment to be tested and writing the first cyclic redundancy check code into a storage space in sequence; the first cyclic redundancy check code reading unit is used for reading the first cyclic redundancy check code from the storage space in sequence when the first cyclic redundancy check code storage unit receives the second cyclic redundancy check code of the ith data packet forwarded by the switching equipment to be tested; and the comparison unit is used for comparing whether the first cyclic redundancy check code is consistent with the second cyclic redundancy check code or not and judging whether the packet forwarding of the ith data packet is correct or not according to the comparison result. The cyclic redundancy check code storage and comparison module provided by the embodiment of the invention judges the packet forwarding correctness by extracting the cyclic redundancy check code from the data packet before and after forwarding and comparing, the read-write addresses of the storage space for storing and sending the cyclic redundancy check code and the time value of the cyclic redundancy check code are sequentially increased, and when the packet receiving sequence is inconsistent with the packet sending sequence, the comparison result can be wrong, so that whether the packet forwarding sequence of the switching equipment is correct can be detected.
Additional features and advantages of the disclosure will be set forth in the description which follows, or in part may be learned by the practice of the above-described techniques of the disclosure, or may be learned by practice of the disclosure.
In order to make the aforementioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic diagram of a packet counting method;
fig. 2 is a schematic structural diagram of a crc storage comparison module according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a packet comparison statistics apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a performance testing system of a switching device according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a switching device;
fig. 6 is a schematic structural diagram of another switching device performance testing system according to an embodiment of the present invention;
FIG. 7 is a diagram of independent memory based on different source, destination port and priority;
fig. 8 is a flowchart of a crc storage comparison method according to an embodiment of the present invention.
Icon:
20-a cyclic redundancy check code storage comparison module; 21-a first cyclic redundancy check code storage unit; 22-a first cyclic redundancy check code reading unit; 23-a comparison unit; 30-a packet counter module; 40-packet delay statistic module; 100-packet comparison statistics means; 200-flow generator.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all embodiments of the present invention. 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.
In the big data era, countless devices (mobile phones, computers and intelligent wearable devices) are generating data in human society, and the data are continuously imported into a data center through a network just like a brook importing into the sea. In a data center, these mass data flow between servers through switching devices. If the data center of the big data era is the brain of the society, the exchange equipment is like blood vessels in the brain and supports the operation of the brain.
Cyclic Redundancy Check (CRC) is one of the most commonly used error Check codes in the field of data communications, and is characterized in that the lengths of the information field and the Check field can be arbitrarily selected. The cyclic redundancy check is a data transmission error detection function, performs polynomial calculation on data, attaches the obtained result to the back of a frame, and a receiving device also executes a similar algorithm to ensure the correctness and the integrity of data transmission.
In the development stage, how to verify that the switching device successfully has the packet forwarding function is a very important issue. The existing verification means is mainly based on packet counting at the transmitting and receiving ends, and whether the packet forwarding function of the switching equipment is normal is verified by counting and comparing the number of data packets transmitted by the transmitting end and the number of data packets received by the receiving end. The existing verification technology verifies the function of the switch device by means of whether the packet counts are equal, and referring to fig. 1, a schematic diagram of a packet counting method is shown, which can only verify whether the switch device can forward the data packet to the destination port from the surface, but cannot verify whether the forwarding sequence of the data packet forwarded to the destination port is correct. The existing means can only detect whether the sequence of the data packets received by the receiving end is consistent with the specified packet forwarding sequence through manual work, so that a large amount of human resources are consumed, and errors are easy to occur when the number of the packets is large.
Based on this, the cyclic redundancy check code storage and comparison module and the switching device performance test system provided by the embodiments of the present invention can detect whether the packet forwarding sequence of the switching device is correct, more comprehensively check the packet forwarding performance of the switching device, and are beneficial to saving the labor cost and improving the detection accuracy.
For the convenience of understanding the present embodiment, a crc storage comparison module disclosed in the present embodiment is first described in detail.
The first embodiment is as follows:
as shown in fig. 2, which is a schematic structural diagram of a crc storage comparison module according to an embodiment of the present invention, as can be seen from fig. 2, the crc storage comparison module 20 includes a first crc storage unit 21, a first crc reading unit 22, and a comparison unit 23, which are connected in sequence. Wherein the functions of each unit are as follows:
first, the first crc storage unit 21 is configured to receive a first crc of an ith to-be-forwarded data packet sent to the to-be-tested switch device, and write the first crc into the storage space in sequence.
Here, the switching device to be tested may be a switching chip or a switching network. In order to test the packet forwarding performance of the switch device to be tested, it is necessary to simulate sending a data packet to the switch device to be tested for forwarding, and measure the packet forwarding performance of the switch device according to the actual forwarding condition.
Specifically, for each to-be-forwarded data packet sent to the to-be-tested switching device, the cyclic redundancy check code of the data packet is calculated in advance, and the cyclic redundancy check code and the corresponding data packet are encapsulated into a to-be-forwarded data packet to be provided to the to-be-tested switching device for forwarding. Here, before the data packet to be forwarded enters the device to be tested, the first cyclic redundancy check code in the data packet to be forwarded is extracted and received and stored by the first cyclic redundancy check code storage unit 21, where the first cyclic redundancy check codes are written into the storage space in sequence in the order of reception. For example, for the first cyclic redundancy check code of the ith (i is a natural number) data packet to be forwarded, the sequence of the check codes stored in the storage space is correspondingly the ith.
Secondly, the first crc reading unit 22 is configured to read the first crc from the storage space in sequence when the first crc storage unit 21 receives the second crc of the ith data packet forwarded by the switch device to be tested.
In the process of testing the packet forwarding performance of the switch device, the first cyclic redundancy check code storage unit 21 also receives a second cyclic redundancy check code of the data packet forwarded by the switch device to be tested. Here, when the first cyclic redundancy check code storage unit 21 receives the second cyclic redundancy check code of the ith data packet after forwarding, the cyclic redundancy check code in the ith order, that is, the first cyclic redundancy check code corresponding to the ith data packet to be forwarded, sent to the switching device to be tested is automatically read from the storage space.
In addition, the comparing unit 23 is configured to compare whether the first cyclic redundancy check code is consistent with the second cyclic redundancy check code, and determine whether packet forwarding of the ith data packet is correct according to the comparison result.
The comparing unit 23 compares the first cyclic redundancy check code of the ith data packet to be forwarded, which is read by the first cyclic redundancy check code reading unit 22, with the second cyclic redundancy check code of the ith data packet, which is received by the first cyclic redundancy check code storage unit 21, and if the first cyclic redundancy check code and the second cyclic redundancy check code are consistent, it indicates that the packet forwarding of the ith data packet is correct, that is, the content and the sequence of the data packet are both correct. Otherwise, it indicates that the packet forwarding of the ith data packet is incorrect, and may be that the content of the ith data packet is in error or the sequence is in error.
Here, for a certain batch of data packet exchanges, if a packet loss occurs in the middle, or the sequence is incorrect, or a packet is wrong, the comparison result of the check code in the comparing unit 23 is inconsistent.
In the cyclic redundancy check code storage and comparison module 20 provided in the embodiment of the present invention, the read/write addresses of the storage space for storing and sending the cyclic redundancy check code are sequentially and incrementally increased, so that the module has a packet sequence check function, and when the packet receiving sequence is inconsistent with the packet sending sequence, the first cyclic redundancy check code and the second cyclic redundancy check code will be inconsistent, so that the comparison result is inconsistent. Therefore, whether the packet forwarding sequence of the switching equipment is correct or not is automatically detected, and compared with the traditional manual detection method, the manual input time of verification personnel is effectively reduced, so that the labor cost is saved, the error probability caused by manual work is reduced, and the detection accuracy is improved.
In another possible embodiment, the first crc storage unit 21 in the crc storage comparing module 20 is further configured to record a first time value of a writing time of the first crc, that is, when the first crc is written into the storage space, the writing time value of the first crc is also written into the storage space together with the first crc; furthermore, the first cyclic redundancy check code storage unit 21 also records a second time value of the reception time of the second cyclic redundancy check code. In addition, the first crc reading unit 22 is further configured to read a first time value when the first crc storage unit 21 receives the second crc; then, the comparing unit 23 is further configured to calculate a forwarding delay time value of the ith packet according to the second time value and the first time value.
Therefore, by recording the storage time of the first cyclic redundancy check code of each data packet to be forwarded and the receiving time of the second cyclic redundancy check code of each forwarded data packet, the calculated forwarding delay time value is correct under the condition that any data packet is compared and shows that the packet forwarding is correct. Therefore, the forwarding delay time between packet sending and receiving caused by forwarding of each data packet by the switching equipment can be obtained, so that the forwarding performance of the switching equipment to be tested can be measured from the forwarding delay angle of the data packet, and the performance test is more comprehensive.
The module comprises a first cyclic redundancy check code storage unit, a second cyclic redundancy check code storage unit and a comparison unit, wherein the first cyclic redundancy check code storage unit is used for receiving a first cyclic redundancy check code of an ith data packet to be forwarded, which is sent to switching equipment to be tested, and writing the first cyclic redundancy check code into a storage space in sequence; the first cyclic redundancy check code reading unit is used for reading the first cyclic redundancy check code from the storage space in sequence when the first cyclic redundancy check code storage unit receives the second cyclic redundancy check code of the ith data packet forwarded by the switching equipment to be tested; and the comparison unit is used for comparing whether the first cyclic redundancy check code is consistent with the second cyclic redundancy check code or not and judging whether the packet forwarding of the ith data packet is correct or not according to the comparison result. The module can detect whether the packet forwarding sequence of the switching equipment is correct or not, more comprehensively detect the packet forwarding performance of the switching equipment, and is favorable for saving labor cost and improving detection accuracy.
Example two:
the embodiment of the present invention further provides a data packet comparison and statistics apparatus, referring to fig. 3, which is a schematic structural diagram of the data packet comparison and statistics apparatus, as can be seen from fig. 3, the apparatus includes a cyclic redundancy check code storage and comparison module 20, and a packet counter module 30 and a packet delay statistics module 40 respectively connected thereto, which are provided in the first embodiment and possible implementations thereof. The functions of each module are as follows:
and the cyclic redundancy check code storage and comparison module 20 is configured to send a determination result of whether packet forwarding is correct to the packet counter module 30, and is further configured to send a forwarding delay time value to the packet delay statistics module.
The packet counter module 30 is configured to measure the number of packets with errors in packet forwarding according to the determination result, measure the number of packets sent to the switch device to be tested, and receive the number of packets forwarded from the switch device to be tested. Here, by counting the number of packets transmitted and the number of packets received and forwarded, it can be checked whether a packet loss occurs, for example, if the number of packets transmitted and the number of packets received are not the same, it indicates that a packet loss exists. The quantity of packets with errors in forwarding reflects the condition of the packets with errors, and the packet error rate can be calculated.
And the packet delay counting module 40 is configured to count a maximum packet delay value, a minimum packet delay value, and an average packet delay value according to the forwarding delay time value. The performance of the switching device can be evaluated more finely and in multiple dimensions by the three parameters obtained by the packet delay statistical module 40.
The implementation principle and the generated technical effect of the data packet comparison and statistics device provided by the embodiment of the present invention are the same as those of the aforementioned crc storage and comparison module embodiment, and for a brief description, corresponding contents in the aforementioned embodiment can be referred to where the embodiment of the device is not mentioned.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the above described packet comparison and statistics apparatus may refer to the corresponding process in the above described crc storage comparison module embodiment, and is not described herein again.
Example three:
the embodiment of the invention also provides a performance test system of the switching equipment, which comprises: at least one traffic generator, and the packet comparison statistic device provided in the second aspect; the flow generator comprises a packet generation module, a route management module and a cyclic redundancy check code extraction module.
Wherein, the packet generation module is respectively connected with the route management module and the cyclic redundancy check code extraction module; the cyclic redundancy check code extraction module is also connected with a cyclic redundancy check code storage and comparison module in the data packet comparison and statistics device.
The flow generator is a tool capable of generating data flow of a specific type, a specific length and a specific rate, and has the main functions of simulating a real flow excitation source in the flow simulation and Field-Programmable Gate Array (FPGA) prototype verification process, and generating the data flow through the structure of a data packet to achieve the purpose of testing a device to be tested or an application to be tested.
In the flow generator, a packet generation module is used for generating a data packet for testing; the route management module is used for realizing the function of route table look-up; the cyclic redundancy check code extraction module is used for extracting a first cyclic redundancy check code of a data packet before entering the switching equipment to be tested and a second cyclic redundancy check code of the data packet forwarded by the switching equipment to be tested, and sending the first cyclic redundancy check code and the second cyclic redundancy check code to the cyclic redundancy check code storage and comparison module.
Referring to fig. 4, a schematic structural diagram of a performance testing system for switching devices according to an embodiment of the present invention is provided, in the embodiment shown in fig. 4, the testing system has a plurality of flow generators 200, and each flow generator 200 is connected to a switching device. Moreover, the cyclic Redundancy check code extraction module, i.e. the crc (cyclic Redundancy check) module, of each traffic generator 200 is connected to the cyclic Redundancy check code storage and comparison module 20 in the packet comparison and statistics apparatus 100.
In this embodiment, referring to fig. 5, the structure of the switch device includes three key modules: a transceiver, a protocol controller and a switching network. The transceiver is mainly used for realizing the processing of transceiving data; the protocol controller is mainly used for analyzing the port protocol; the switching network is used for realizing non-blocking and low-delay data exchange among a plurality of switching ports. The switching equipment can realize non-blocking, low-time delay, high reliability and flexible switching among a plurality of ports.
On the basis of fig. 4, referring to fig. 6, which is a schematic structural diagram of another switching device performance testing system, in the embodiment shown in fig. 6, the packet generation module in the traffic generator 200 includes a configuration unit, a packet sending control unit, a payload generation unit, a packet header generation unit, and an entire packet encapsulation unit.
Wherein, the configuration unit is connected with the packet sending control unit; the packet sending control unit and the whole packet packaging unit are connected with each other and are respectively connected with the effective load generating unit and the packet head generating unit; the whole package packaging unit is respectively connected with the route management module and the cyclic redundancy check code extraction module. Here, the functions of the respective units are as follows:
the configuration unit is used to configure the control registers in the traffic generator 200. It assumes the task of the user to configure the control registers of the entire traffic generator 200.
The packet sending control unit is used for generating an internal control signal according to the configuration signal sent by the control register. It receives the configuration signal from the control register, and after processing it, it generates the internal control signals related to the packet length, packet interval, packet number, and packet start/stop, and these internal control signals act on the payload (payload) generating unit, packet header generating unit, and whole packet encapsulating unit.
The packet header generating unit is used for generating a packet header according to the internal control signal. The method comprises the steps of receiving a packet header content related control signal from a control register, and generating a packet header with specific content, wherein each field of the packet header takes a fixed value or a random value according to the packet header content control signal.
The payload (payload) generating unit is used for generating payload data according to the payload length value sent by the packet sending control unit. Here, after the payload generation unit receives a payload length value (in bytes, a fixed value or a random value within a specified range) generated by the packetization control unit, the payload generation unit generates AXI _ Stream format data of a corresponding data length.
And the whole packet packaging unit is used for generating a splicing packet according to the packet header and the payload data, and calculating a corresponding cyclic redundancy check code according to the splicing packet so as to add the cyclic redundancy check code to the splicing packet to obtain a data packet to be forwarded. The whole packet packaging unit receives the packet header output by the packet header generating unit and the payload generated by the payload generating unit, splices the packet header and the payload at a specified packet header end position, and performs cyclic redundancy check calculation and addition on the spliced packet as required to obtain a finally generated packet.
Here, when packets have different priorities, independent storage spaces may be established according to differences in source ports, destination ports, and priorities, for verifying in-sequence forwarding of packets of the same priority between the same source and destination ports (in-sequence forwarding test of the same priority), and in-priority forwarding between different priorities between the same source and destination ports (in-sequence forwarding test of different priorities, that is, strict priority forwarding). A schematic diagram of independent memory space based on different source, destination port and priority is shown in fig. 7. Where s represents the source port, r represents the destination port, and p represents priority. Thus, the performance Test system for the switching Device provided in the embodiment of the present invention may also be used to verify the in-sequence forwarding characteristics of packets with the same priority of a DUT (Device Under Test), and verify the in-sequence forwarding characteristics of packets with different priorities of the DUT.
In addition, in the case that the switching device has a function of recalculating and replacing the cyclic redundancy check code (for example, the switching device includes a protocol controller having a function of recalculating the cyclic redundancy check code for the sent data frame and replacing the old cyclic redundancy check code with the new cyclic redundancy check code), if the frame content of the data frame is abnormally changed during the forwarding process, the receiving device cannot check that the frame content is changed during the forwarding process of the data frame through the cyclic redundancy check. The performance test system of the switching device provided by the embodiment of the invention can successfully check the event that the frame content is changed under the condition through the storage and comparison of the cyclic redundancy check codes.
In order to improve the verification speed of the switch device performance testing system in this embodiment, in one implementation manner, the flow generator 200 and the data packet comparison and statistics device 100 in the system may be implemented by using a hardware description language verilog programming, and may be downloaded to an FPGA (Field Programmable Gate Array) after being implemented comprehensively, so as to implement a hardware accelerated verification scheme for verifying the forwarding correctness of the switch device packet based on the FPGA. In this way, the FPGA-based software-defined traffic generator 200 can flexibly configure the protocol type, number, length, interval, etc. of the packets of each port, and has high speed, flexibility and extensibility.
The switch device performance test system provided by the embodiment of the invention has the same technical characteristics as the cyclic redundancy check code storage and comparison module provided by the embodiment, so that the same technical problems can be solved, and the same technical effects can be achieved.
Example four:
the embodiment of the present invention further provides a cyclic redundancy check code storage comparison method, referring to fig. 8, which is a schematic flow chart of the method, and as can be seen from fig. 8, the method includes the following steps:
step 102: and receiving a first cyclic redundancy check code of the ith to-be-forwarded data packet sent to the to-be-tested switching equipment, and writing the first cyclic redundancy check code into the storage space in sequence.
Step 104: and when the first cyclic redundancy check code storage unit receives the second cyclic redundancy check code of the ith data packet forwarded by the switching equipment to be tested, reading the first cyclic redundancy check code from the storage space in sequence.
Step 106: and comparing whether the first cyclic redundancy check code is consistent with the second cyclic redundancy check code, and judging whether the packet forwarding of the ith data packet is correct according to the comparison result.
In another embodiment, after the step of writing the first cyclic redundancy check codes into the storage space in sequence, the method further includes: and recording a first time value of the writing time of the first cyclic redundancy check code. And when the first cyclic redundancy check code storage unit receives the second cyclic redundancy check code of the ith data packet forwarded by the switching equipment to be tested, the method further comprises the following steps: and recording a second time value of the receiving moment of the second cyclic redundancy check code, and reading the first time value. And then, calculating the forwarding delay time value of the ith data packet according to the second time value and the first time value.
Therefore, by recording the storage time of the first cyclic redundancy check code of each data packet to be forwarded and the receiving time of the second cyclic redundancy check code of each forwarded data packet, the calculated forwarding delay time value is correct under the condition that any data packet is compared and shows that the packet forwarding is correct. Therefore, the forwarding delay time between packet sending and receiving caused by forwarding of each data packet by the switching equipment can be obtained, so that the forwarding performance of the switching equipment to be tested can be measured from the forwarding delay angle of the data packet, and the performance test is more comprehensive.
The computer program product for performing the crc storage comparison method provided in the embodiments of the present invention includes a computer readable storage medium storing a nonvolatile program code executable by a processor, where instructions included in the program code may be used to execute the method described in the foregoing method embodiments, and specific implementation may refer to the method embodiments, and is not described herein again.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Unless specifically stated otherwise, the relative steps, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of the present invention.
In all examples shown and described herein, any particular value should be construed as merely exemplary, and not as a limitation, and thus other examples of example embodiments may have different values.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, in the description of the embodiments of the present invention, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (10)

1. A crc storage comparison module, comprising:
the first cyclic redundancy check code storage unit is used for receiving a first cyclic redundancy check code of the ith data packet to be forwarded sent to the switching equipment to be tested and writing the first cyclic redundancy check code into a storage space in sequence;
a first cyclic redundancy check code reading unit, configured to read the first cyclic redundancy check code from the storage space in sequence when the first cyclic redundancy check code storage unit receives the second cyclic redundancy check code of the ith data packet forwarded by the switch device to be tested;
and the comparison unit is used for comparing whether the first cyclic redundancy check code is consistent with the second cyclic redundancy check code or not and judging whether the packet forwarding of the ith data packet is correct or not according to the comparison result.
2. The CRC storage comparison module of claim 1,
the first cyclic redundancy check code storage unit is further used for recording a first time value of the writing time of the first cyclic redundancy check code and recording a second time value of the receiving time of the second cyclic redundancy check code;
the first cyclic redundancy check code reading unit is further configured to read the first time value when the first cyclic redundancy check code storage unit receives the second cyclic redundancy check code;
the comparing unit is further configured to calculate a forwarding delay time value of the ith data packet according to the second time value and the first time value.
3. The crc storage comparison module of claim 2, wherein the switch device under test is a switch chip or a switch network.
4. A packet comparison statistics apparatus, comprising: a packet counter module, a packet delay statistics module, and a cyclic redundancy check code storage comparison module of any of the above claims 2-3;
the cyclic redundancy check code storage and comparison module is respectively connected with the packet counter module and the packet delay statistical module; the cyclic redundancy check code storage and comparison module is used for sending a judgment result of whether packet forwarding is correct to the packet counter module and sending the forwarding delay time value to the packet delay statistic module;
the packet counter module is used for metering the packet quantity of packet forwarding errors according to the judgment result, metering the packet quantity sent to the switching equipment to be tested and receiving the packet quantity forwarded from the switching equipment to be tested;
the packet delay statistic module is used for counting the maximum packet delay value, the minimum packet delay value and the average packet delay value according to the forwarding delay time value.
5. A switching device performance testing system, comprising: at least one traffic generator, and the packet comparison statistics apparatus of claim 4;
the flow generator comprises a packet generation module, a routing management module and a cyclic redundancy check code extraction module; the packet generation module is respectively connected with the routing management module and the cyclic redundancy check code extraction module; the cyclic redundancy check code extraction module is also connected with a cyclic redundancy check code storage comparison module in the data packet comparison and statistics device;
the packet generation module is used for generating a data packet for testing;
the route management module is used for realizing the function of table look-up of the route;
the cyclic redundancy check code extraction module is used for extracting a first cyclic redundancy check code of a data packet before entering the switching equipment to be tested and a second cyclic redundancy check code of the data packet forwarded by the switching equipment to be tested, and sending the first cyclic redundancy check code and the second cyclic redundancy check code to the cyclic redundancy check code storage and comparison module.
6. The switching device performance test system of claim 5, wherein the packet generation module comprises a configuration unit, a packet sending control unit, a payload generation unit, a packet header generation unit, and a whole packet encapsulation unit;
the configuration unit is connected with the packet sending control unit; the packet sending control unit and the whole packet packaging unit are connected with each other and are respectively connected with the payload generation unit and the packet header generation unit; the whole package packaging unit is respectively connected with the routing management module and the cyclic redundancy check code extraction module;
the configuration unit is used for configuring a control register in the flow generator;
the packet sending control unit is used for generating an internal control signal according to the configuration signal sent by the control register;
the packet header generating unit is used for generating a packet header according to the internal control signal;
the payload generating unit is used for generating payload data according to the length value of the payload sent by the packet sending control unit;
and the whole packet packaging unit is used for generating a splicing packet according to the packet header and the payload data, and calculating a corresponding cyclic redundancy check code according to the splicing packet so as to add the cyclic redundancy check code to the splicing packet to obtain a data packet to be forwarded.
7. A method for comparing crc stores, the method comprising:
receiving a first cyclic redundancy check code of an ith to-be-forwarded data packet sent to the to-be-tested switching equipment, and writing the first cyclic redundancy check code into a storage space in sequence;
when the first cyclic redundancy check code storage unit receives a second cyclic redundancy check code of an ith data packet forwarded by the switching equipment to be tested, reading the first cyclic redundancy check code from the storage space in sequence;
and comparing whether the first cyclic redundancy check code is consistent with the second cyclic redundancy check code, and judging whether the packet forwarding of the ith data packet is correct according to the comparison result.
8. The crc storage comparison method of claim 7, wherein after the step of sequentially writing the first crc into the storage space, further comprising:
and recording a first time value of the writing time of the first cyclic redundancy check code.
9. The crc storage comparison method as claimed in claim 8, wherein when the first crc storage unit receives the second crc of the ith data packet forwarded by the switch device to be tested, the method further comprises:
and recording a second time value of the receiving moment of the second cyclic redundancy check code, and reading the first time value.
10. The crc storage comparison method of claim 9, further comprising: and calculating the forwarding delay time value of the ith data packet according to the second time value and the first time value.
CN201910631114.9A 2019-07-12 2019-07-12 Cyclic redundancy check code storage comparison module and switching equipment performance test system Active CN110519116B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910631114.9A CN110519116B (en) 2019-07-12 2019-07-12 Cyclic redundancy check code storage comparison module and switching equipment performance test system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910631114.9A CN110519116B (en) 2019-07-12 2019-07-12 Cyclic redundancy check code storage comparison module and switching equipment performance test system

Publications (2)

Publication Number Publication Date
CN110519116A CN110519116A (en) 2019-11-29
CN110519116B true CN110519116B (en) 2021-01-22

Family

ID=68623112

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910631114.9A Active CN110519116B (en) 2019-07-12 2019-07-12 Cyclic redundancy check code storage comparison module and switching equipment performance test system

Country Status (1)

Country Link
CN (1) CN110519116B (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6775804B1 (en) * 2000-11-28 2004-08-10 Nortel Networks Limited Determining integrity of a packet
CN103780322B (en) * 2014-01-26 2015-09-09 中国电子科技集团公司第五十八研究所 The express network communication chip method of testing of low cost and high reliability and circuit
CN106789430B (en) * 2016-12-26 2019-11-05 深圳市风云实业有限公司 A kind of point-to-point link fault detection method

Also Published As

Publication number Publication date
CN110519116A (en) 2019-11-29

Similar Documents

Publication Publication Date Title
US7953014B2 (en) FPGA-based network device testing equipment for high load testing
US8085673B2 (en) Method and apparatus for generating bi-directional network traffic and collecting statistics on same
US9253062B2 (en) Byte by byte received data integrity check
US8042004B2 (en) Diagnosing communications between computer systems
CN107547304A (en) Network card testing method, device and machinable medium
CN112653600A (en) Network card performance testing method and device based on USB network card and electronic equipment
US20070179733A1 (en) Methods and apparatus for testing a link between chips
CN109743301A (en) A kind of data receiving-transmitting system and method based on Modbus agreement
CN104639390B (en) The test method and device of system
CN114048520B (en) Detection system for cross-chip access control
CN116056126A (en) Simulation test method, simulation test device, computer equipment and computer readable storage medium
CN101800672B (en) Equipment detection method and equipment
US10176068B2 (en) Methods, systems, and computer readable media for token based message capture
CN106372026A (en) Link detection method and receiving device
CN104780123B (en) A kind of network pack receiving and transmitting processing unit and its design method
CN110519116B (en) Cyclic redundancy check code storage comparison module and switching equipment performance test system
CN108089987B (en) Function verification method and device
CN112148537B (en) Bus monitoring device and method, storage medium and electronic device
CN112350897A (en) Network testing device based on dynamic connection end-to-end reliable transmission protocol
CN111654405A (en) Method, device, equipment and storage medium for fault node of communication link
CN103516631A (en) Communication device
CN113872826B (en) Network card port stability testing method, system, terminal and storage medium
CN110768871A (en) Test method and system for automatically counting data transmission correctness of DCS (distributed control system)
CN112118156B (en) Filtering method and device for Ethernet protocol test
CN110958079B (en) Test method, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant