Link protocol analysis method, network chip and computing device

By integrating the analysis function module in the network chip to collect and record the transmission process of the physical layer code stream, the problem of link connection fault diagnosis and test result judgment in high-speed communication links is solved, and accurate fault diagnosis and stable link test results are achieved.

CN120238474APending Publication Date: 2025-07-01XFUSION DIGITAL TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510398692.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-31
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

Current technology is difficult to achieve accurate fault diagnosis and accurate judgment of link test results for link connection problems, especially in high-speed communication links, signal attenuation, interference and timing problems are serious, resulting in an increase in the probability of link connection failure.

Method used

By integrating the analysis function module in the network chip, the transmission process of the physical layer code stream is collected and recorded, reflecting the dynamic changes in the working state of the physical layer, thereby achieving accurate fault diagnosis of link connection problems and accurate judgment of link test results.

Benefits of technology

It realizes accurate fault diagnosis of link connection problems and accurate judgment of link test results, which can reflect the dynamic changes of physical layer code streams during transmission, interpret the entire process of link communication, and ensure the quality and stability of network services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120238474A_ABST
    Figure CN120238474A_ABST
Patent Text Reader

Abstract

The invention discloses a link protocol analysis method, a network chip and computing equipment. The method is applied to a network chip comprising a network protocol interface, the network chip is integrated with an analysis function module, the analysis function module communicates with the network protocol interface, and the method comprises the following steps: acquiring transmission information of the network protocol interface through an acquisition module, the transmission information comprises a code stream in a sending direction and a code stream in a receiving direction of the network protocol interface; and outputting transmission data obtained based on the code stream in the sending direction and the code stream in the receiving direction through an output module so as to determine a link problem based on the transmission data. The process recording of the physical layer code stream is realized through the analysis function module, that is, the transmission process of the physical layer code stream is recorded as comprehensively as possible, so that the transmission data can reflect the dynamic change condition of the physical layer code stream in the transmission process; therefore, accurate fault diagnosis of link connection problems and accurate judgment of link test results can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technologies, and in particular, to a link protocol analysis method, a network chip, and a computing device. Background Art

[0002] With the rapid development of information technology, remarkable progress has been made in computers and communication networks, and the communication link rate has shown an explosive growth trend. For example, the current single-link rate has reached as high as 200 Gb / s. The improvement of the communication link rate has laid a foundation for the high-speed transmission of data and greatly promoted the wide application of cutting-edge technologies such as cloud computing, big data, and artificial intelligence.

[0003] With the growth of the communication link rate and bandwidth, the signal faces a more complex physical environment during transmission, and problems such as signal attenuation, interference, and timing issues become more serious, resulting in a significant increase in the probability of communication link connection failures. In an actual network environment, situations such as momentary link breaks or inability to establish a link connection frequently occur, seriously affecting the quality and stability of network services.

[0004] The stability of the link connection depends on the communication protocol of the underlying physical layer. In the physical layer, data is transmitted in the form of the most primitive binary code stream, without yet undergoing frame encapsulation at the link layer and packet encapsulation at the network layer, that is, there are no concepts of frames and packets yet.

[0005] Current technologies are difficult to achieve accurate fault diagnosis of link connection problems and accurate judgment of link test results. Summary of the Invention

[0006] A link protocol analysis method, a network chip, and a computing device provided by this application can record the transmission process of the physical layer code stream as comprehensively as possible, so as to reflect the dynamic changes in the working state of the physical layer, thereby achieving accurate fault diagnosis of link connection problems and accurate judgment of link test results.

[0007] To achieve the above object, the embodiments of this application adopt the following technical solutions:

[0008] In a first aspect, an embodiment of this application provides a link protocol analysis method, which is applied to a network chip of a network protocol interface, and the network chip is integrated with an analysis function module, and the analysis function module communicates with the network protocol interface. Through a collection module, the transmission information of the network protocol interface is collected, and the transmission information includes the code stream in the sending direction and the code stream in the receiving direction of the network protocol interface; through an output module, transmission data obtained based on the code stream in the sending direction and the code stream in the receiving direction is output, so as to facilitate the determination of link problems based on the transmission data.

[0009] This application realizes the process recording of the physical layer bitstream through an analysis function module, that is, records the transmission process of the physical layer bitstream as comprehensively as possible, so that the transmission data obtained from the bitstream in the sending direction and the bitstream in the receiving direction can reflect the dynamic changes of the physical layer bitstream during the transmission process, that is, the entire process of link communication can be interpreted, thereby enabling accurate fault diagnosis of link connection problems and accurate judgment of link test results.

[0010] In a possible implementation manner, the transmission data is the bitstream in the sending direction and the bitstream in the receiving direction. Through an output module, the bitstream in the sending direction and the bitstream in the receiving direction are output to facilitate the determination of link problems based on the bitstream in the sending direction and the bitstream in the receiving direction. For example: Analyze the bitstream through a protocol analysis tool or other means to determine link problems. Since the transmission process of the physical layer bitstream is recorded, that is, it can reflect the dynamic changes of the physical layer bitstream during the transmission process, thereby enabling accurate fault diagnosis of link connection problems and accurate judgment of link test results.

[0011] In a possible implementation manner, the transmission information of the network protocol interface collected by the acquisition module is stored in the storage module; then in response to a first output instruction, through the output module, the bitstream in the sending direction and the bitstream in the receiving direction stored in the storage module are output to facilitate the determination of link problems based on the bitstream in the sending direction and the bitstream in the receiving direction. The first output request is an instruction for requesting the output of the bitstream in the sending direction and the bitstream in the receiving direction. By storing the bitstream in the sending direction and the bitstream in the receiving direction in the storage module, and subsequently in response to the first output instruction, output the bitstream stored in the storage module, so as to realize the output of the physical layer bitstream in the case of an output requirement / link problem determination requirement, interpret the entire process of link communication, and thereby realize accurate fault diagnosis of link connection problems and accurate judgment of link test results.

[0012] In a possible implementation, through a parsing module, the bitstreams in the transmission direction and the reception direction are parsed to obtain parsing results corresponding to the bitstreams in the transmission direction and the reception direction respectively; through an adjustment module, the parsing results corresponding to the bitstreams in the transmission direction and the reception direction are phase-aligned to obtain corresponding protocol analysis results; the corresponding protocol analysis results are the transmitted data. By parsing the collected bitstreams through the analysis module and the adjustment module of the analysis function module and performing relative alignment on the parsing results, protocol analysis results are obtained, realizing the process recording of the physical layer bitstream. The link protocol analysis results can reflect the dynamic changes of the physical layer bitstream during the transmission process, can interpret the entire process of link communication, and can accurately locate link connection problems or reasonably and accurately judge link test results in accordance with the link protocol specifications. Moreover, the time when the two chips start sending bitstreams is inconsistent. Therefore, the bitstreams in the transmission direction and the reception direction may be in different phases in the initialization stage, and there is an association relationship between the bitstreams in the transmission direction and the reception direction during the link connection establishment process. Through this association relationship, the Tx parsing result and the Rx parsing result are phase-aligned to ensure that the protocol analysis results obtained after alignment can accurately reflect the complete communication process of link establishment.

[0013] In a possible implementation, the corresponding protocol analysis results are stored in a storage module; in response to a second output instruction, through an output module, the corresponding protocol analysis results are output to facilitate the determination of link problems based on the corresponding protocol analysis results; wherein, the second output instruction is an instruction for requesting the output of protocol analysis results. By storing the corresponding protocol analysis results in the storage module and subsequently outputting the protocol analysis results stored in the storage module in response to the second output instruction, it is possible to output the protocol analysis results in the case of an output requirement / link problem determination requirement, so as to interpret the entire process of link communication, thereby realizing accurate fault diagnosis of link connection problems and accurate judgment of link test results.

[0014] In a possible implementation, the network protocol interface supports the BASE-KR link protocol. The bitstreams in the transmission direction and the reception direction include: the auto-negotiation bitstream in the transmission direction and the auto-negotiation bitstream in the reception direction. Through the parsing module, based on the data structure of the auto-negotiation code, the auto-negotiation bitstream in the transmission direction and the auto-negotiation bitstream in the reception direction are parsed to obtain the parsing results in the transmission direction and the reception direction of the auto-negotiation bitstream. Through the adjustment module, based on the correlation between the echo random number field and the transmit random field of the auto-negotiation code, the parsing results in the transmission direction and the reception direction of the auto-negotiation bitstream are phase-aligned to obtain the corresponding protocol analysis results. For the auto-negotiation bitstream, based on the data structure of the auto-negotiation code, the auto-negotiation bitstream is parsed to obtain the parsing results in the transmission direction and the reception direction of the auto-negotiation bitstream. The parsing results can convert the auto-negotiation bitstream into information that can be understood by the user; and based on the correlation between the echo random number field and the transmit random field of the auto-negotiation code, the parsing results are phase-aligned to obtain the corresponding protocol analysis results.

[0015] In a possible implementation, the correlation between the echo random number field and the transmit random field of the auto-negotiation code is specifically as follows: when the confirmation field of the auto-negotiation code in the reception direction indicates that the auto-negotiation code sent by the local chip meets the requirements by the peer chip, the value of the echo random number field of the auto-negotiation code in the reception direction is the same as the value of the transmit random field of the auto-negotiation code in the transmission direction on the previous page; when the confirmation field of the auto-negotiation code in the transmission direction indicates that the auto-negotiation code sent by the peer chip meets the requirements by the local chip, the value of the echo random number field of the auto-negotiation code in the transmission direction is the same as the value of the transmit random field of the auto-negotiation code in the reception direction on the previous page.

[0016] In a possible implementation, the bitstreams in the transmission direction and the reception direction further include: the link training bitstream in the transmission direction and the link training bitstream in the reception direction. Through the parsing module, based on the data structure of the link training code, the link training bitstream in the transmission direction and the link training bitstream in the reception direction are parsed to obtain the parsing results in the transmission direction and the reception direction of the link training bitstream. Through the adjustment module, based on the correlation between the link training bitstream in the transmission direction and the link training bitstream in the reception direction, the parsing results in the transmission direction and the reception direction of the link training bitstream are phase-aligned to obtain the corresponding protocol analysis results. For the link training bitstream, based on the data structure of the link training code, the link training bitstream is parsed to obtain the parsing results in the transmission direction and the reception direction of the link training bitstream. The parsing results can convert the link training bitstream into information that can be understood by the user; and based on the correlation of the link training code, the parsing results are phase-aligned to obtain the corresponding protocol analysis results.

[0017] Second aspect, an embodiment of the present application provides a chip, including: a network protocol interface and an analysis function module, where the analysis function module communicates with the network protocol interface, and the analysis function module is used to implement the link protocol analysis method in the first aspect and its various possible implementation manners, and the output module of the analysis function module is a preset export interface on the network chip.

[0018] Third aspect, an embodiment of the present application provides a computing device, including: a network chip, where the network chip includes: a network protocol interface and an analysis function module, and the analysis function module communicates with the network protocol interface; the analysis function module is used to implement the link protocol analysis method in the first aspect and its various possible implementation manners.

[0019] Fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions run on a computing device, the computing device is enabled to implement the link protocol analysis method in the first aspect and its various possible implementation manners.

[0020] Fifth aspect, an embodiment of the present application provides a computer program product, which includes computer program instructions. When the computer program instructions run on a computing device, the computing device is enabled to implement the link protocol analysis method in the first aspect and its various possible implementation manners. Description of the Drawings

[0021] Figure 1 It is a schematic structural diagram of a network protocol layering model provided by an embodiment of the present application;

[0022] Figure 2 It is a schematic structural diagram of internal functional modules of a network chip provided by an embodiment of the present application;

[0023] Figure 3 It is a schematic flowchart of a link protocol analysis method provided by an embodiment of the present application;

[0024] Figure 4 It is a schematic structural diagram of another network chip provided by an embodiment of the present application;

[0025] Figure 5 It is a schematic flowchart of another link protocol analysis method provided by an embodiment of the present application;

[0026] Figure 6 It is a schematic diagram of the establishment process of a link connection of a BASE-SR link protocol provided by an embodiment of the present application;

[0027] Figure 7Schematic diagram of the synchronized code stream collected in the BASE-SR link protocol provided by the embodiment of the present application;

[0028] Figure 8 Schematic diagram of the structure of another network chip provided by the embodiment of the present application;

[0029] Figure 9 Schematic diagram of the process of another link protocol analysis method provided by the embodiment of the present application;

[0030] Figure 10 Schematic diagram of the establishment process of the link connection of a BASE-KR link protocol provided by the embodiment of the present application;

[0031] Figure 11 Schematic diagram of the data format of the auto-negotiation code provided by the embodiment of the present application;

[0032] Figure 12 Schematic diagram of the auto-negotiation code stream received by the Rx of the local device and the auto-negotiation code stream sent by the Tx provided by the embodiment of the present application;

[0033] Figure 13 Schematic diagram of the data format of the link training code stream provided by the embodiment of the present application;

[0034] Figure 14 Schematic diagram of the link training code stream received by the Rx of the local device and the link training code stream sent by the Tx provided by the embodiment of the present application;

[0035] Figure 15 Example diagram of the link protocol analysis result of the auto-negotiation code stream provided by the embodiment of the present application;

[0036] Figure 16 Example diagram of the link protocol analysis result of the link training code stream provided by the embodiment of the present application;

[0037] Figure 17 Schematic diagram of the process of another link protocol analysis method provided by the embodiment of the present application. Detailed implementation manners

[0038] The terms "first", "second", "third", etc. in the specification, claims and drawings of the present application are used to distinguish different objects, rather than to limit a specific order.

[0039] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or more advantageous than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present relevant concepts in a specific manner.

[0040] For the sake of clear and concise description of the following embodiments, a brief introduction to the related technologies is given first:

[0041] Bitstream: It is a binary bitstream, which can also be called a Bitstream. It refers to a data stream composed of a series of binary digits 0 and 1 (bits). The bitstream is transmitted through physical media (such as cables, optical fibers, etc.). The bitstream is the most basic form in data communication and represents the information at the lowest and most atomic level.

[0042] The network protocol layering model, which can be called the Network Communication Protocol Stack, is a set of frameworks used in computer networks to organize and implement communication protocols at different levels.

[0043] For the convenience of understanding, the following is combined with Figure 1 , taking the network protocol layering model as the OSI model (Open Systems Interconnection Model) as an example, to introduce the network protocol layering model.

[0044] As Figure 1 shown, the OSI model includes, from bottom to top, the Physical Layer, the Data Link Layer, the Network Layer, the Transport Layer, the Session Layer, the Presentation Layer, and the Application Layer.

[0045] Among them, the physical layer is the bottom layer of the OSI model and directly interacts with the physical medium. The physical layer is responsible for transmitting the binary bitstream (i.e., the original bitstream) on the physical medium, and defines the electrical characteristics (such as voltage level, signal level) related to the physical medium, mechanical characteristics (such as interface shape, number of pins), functional characteristics (such as functions of each pin, signal meaning), and procedural characteristics (such as signal transmission timing, transmission control steps). Its role is to provide a reliable bitstream (bit) transmission service for the data link layer. In Ethernet, for example, the physical layer stipulates the physical medium standards such as twisted pairs and optical fibers, as well as the transmission methods of signals on these physical media.

[0046] Among them, the data link layer is responsible for organizing the bit stream provided by the physical layer into frames for transmission. It realizes its functions through the Media Access Control (MAC) sublayer and the Logical Link Control (LLC) sublayer. The main task of the data link layer is to ensure the reliable transmission of data between adjacent nodes, convert the unreliable binary bit stream from the physical layer into reliable frame transmission, and at the same time perform operations such as error detection and correction, and flow control.

[0047] Among them, the network layer is responsible for encapsulating the frames provided by the data link layer into packets to realize the transmission of packets between different nodes in the network. Specifically, the network layer is responsible for route selection, that is, selecting the best path for the packet from the source node to the destination node; the network layer is also responsible for congestion control to prevent network congestion from causing performance degradation.

[0048] Among them, the transport layer is responsible for data segmentation and reassembly, connection management, flow control and error control. The transport layer divides the packets of the application layer into appropriate packets for transmission and reassembles them at the receiving end, providing a transparent data transmission service for the application layer.

[0049] Among them, the session layer is responsible for establishing, managing and terminating sessions, and coordinating the communication between various processes on different hosts. Exemplarily, in applications such as remote login and file transfer, the session layer ensures the normal maintenance of the session between the two end devices.

[0050] Among them, the presentation layer is responsible for handling issues such as data representation, encryption and decryption, compression and decompression, etc., to ensure the compatibility of data formats between different systems. That is, the presentation layer converts the data of the application layer into a format suitable for network transmission and then converts it back to a format suitable for application program processing at the receiving end.

[0051] Among them, the application layer is the top layer of the OSI model, directly interacting with user application programs, and is responsible for handling the communication requirements specific to application programs. Specifically, the application layer defines the rules and interfaces for communication between application programs. The application layer converts user data into a format suitable for network transmission, transmits it through the lower-layer protocols, and at the same time receives the lower-layer data and converts it into a form that users can understand and presents it to users.

[0052] It should be noted that the network protocol layering model also includes the TCP / IP model. The TCP / IP model generally has a five-layer structure. In the five-layer structure, the functions of the physical layer, data link layer, network layer, and transport layer are similar to those of the corresponding layers of the OSI model, and the functions of the session layer and presentation layer in the OSI model are merged into the application layer, simplifying the layer structure.

[0053] Link connection: In network communication, it refers to the direct communication path established between two physical devices through a physical medium. It is the basis for data transmission, ensuring reliable data transmission between two points. Link connection usually involves the functions of the physical layer in the network protocol layering model.

[0054] Specifically, the establishment of a link connection can be understood as follows: Connecting two physical devices through a physical medium to achieve an actual connection at the physical level (i.e., physical connection), which serves as the basis for data transmission. Here, the physical medium includes wired media such as optical fibers, twisted pairs, and coaxial cables, as well as wireless media such as radio waves and infrared rays. After establishing the physical connection, the two physical devices achieve correct configuration of communication parameters through the interaction of specific code streams. When all necessary communication parameters are correctly configured, the establishment of the link connection is achieved.

[0055] Since the communication protocol of the physical layer stipulates the relevant characteristics of the physical medium, such as electrical, mechanical, functional, and procedural characteristics. For example, the communication protocol of the physical layer in Ethernet standardizes the physical media standards such as twisted pairs and optical fibers, as well as the transmission mode of signals on the medium. These standards and specifications are the basis for the establishment of link connections and data transmission. Only by meeting the requirements of the communication protocol of the physical layer can the establishment of link connections be achieved between physical devices. Therefore, the link connection (the establishment of the link connection) depends on the communication protocol of the physical layer, and data is transmitted in the form of the most primitive binary code stream in the physical layer.

[0056] A link protocol analysis method provided by an embodiment of the present application is applied to a network chip including a network protocol interface, and the network chip is integrated with an analysis function module, and the analysis function module communicates with the network protocol interface. Through the acquisition module, the transmission information of the network protocol interface is acquired, and the transmission information includes the code stream in the sending direction and the code stream in the receiving direction of the network protocol interface. Through the output module, the transmission data obtained based on the code stream in the sending direction and the code stream in the receiving direction is output, so as to determine link problems based on the transmission data. The present application realizes the process recording of the physical layer code stream through the analysis function module, that is, records as comprehensively as possible the transmission process of the physical layer code stream, so that the transmission data obtained based on the code stream in the sending direction and the code stream in the receiving direction can reflect the dynamic change situation of the physical layer code stream during the transmission process, that is, can interpret the entire process of link communication, thereby enabling accurate fault diagnosis of link connection problems and accurate judgment of link test results.

[0057] Furthermore, the transmission data can reflect the dynamic change situation of the physical layer code stream during the transmission process, can reflect the change of the bit error rate, the fluctuation of the signal strength, etc., and can realize long-term monitoring of the performance indicators of the physical layer, so as to identify potential problem trends and take preventive measures to avoid the occurrence of greater faults.

[0058] Embodiment 1:

[0059] The following combines Figure 2 and Figure 3 to introduce in detail a link protocol analysis method provided by an embodiment of the present application.

[0060] A link protocol analysis method provided by an embodiment of the present application is applied to a physical device of a network protocol, that is, a physical device with a network protocol interface, such as a network chip with a network protocol interface.

[0061] Among them, a network protocol refers to a series of rules and standards specified in network communication to ensure that data can be accurately and efficiently transmitted between different physical devices. These rules and standards cover all aspects from the physical layer to the application layer, including how to format data, how to address, route, detect and correct errors, etc. Exemplarily, network protocols include: Ethernet, Fibre Channel (FC), Fibre Channel over Ethernet (Fibre Channel based on Ethernet), Infiniband IB, etc.

[0062] Furthermore, the physical layer protocol mechanisms corresponding to the network protocol include: Auto-negotiation, Training, Synchronization, etc.

[0063] Auto-negotiation is a protocol mechanism used to automatically set the optimal working parameters between two devices, that is, a mechanism for the physical devices on both sides of the link connection defined in the network protocol to communicate and confirm the working parameters with each other. Among them, the working parameters include: link rate, duplex model (including: full-duplex model, half-duplex mode), flow control mechanism (for example: traffic control Pause), forward error correction (FEC) mode.

[0064] Training is a protocol mechanism used to initialize the communication link and adjust the link parameters to make the communication link reach the optimal performance state, that is, a process in which the physical devices on both sides of the link connection defined in the network protocol adjust the link parameters to meet the communication requirements. Among them, the link parameters include: Equalization, Pre-emphasis and De-emphasis, Voltage Level Adjustiment, etc.

[0065] Synchronization is a protocol mechanism used to ensure the accurate transmission of data between a sender and a receiver. Specifically, in the physical layer, synchronization refers to clock synchronization, that is, how to enable the receiver to accurately identify the position of each code (bit) in order to correctly decode the received code stream.

[0066] Among them, a network chip with a network protocol interface refers to an integrated circuit that can support or implement one or more network protocols. Specifically, the network protocol interface in the chip is a functional module for realizing data communication between a physical device and a network. That is, a network chip with a network protocol interface is an integrated circuit, and the network protocol interface is a part of the integrated circuit. The network protocol interface is responsible for handling tasks at the physical layer and the data link layer, ensuring that the network chip with a network protocol interface can correctly send and receive data and support higher-level network functions. Network chips with network protocol interfaces include, but are not limited to: network card chips, switch chips (such as Layer 2 switch LSW chips), physical layer (PHY) chips, and network processor (NP) chips. Among them, network cards include: network interface card (NIC), fiber channel host bus adapter (FC HBA), converged network adapter (CNA), Infiniband host channel adapter (IB HCA), etc.

[0067] First, in combination with Figure 2 , a detailed introduction is provided to an analysis function module provided by an embodiment of the present application, which is used to implement a link protocol analysis method provided by an embodiment of the present application.

[0068] As Figure 2 shown, the analysis function module 200 is integrated inside a network chip with a network protocol interface, that is, the analysis function module 200 is set on the application-specific integrated circuit (ASIC) of the network chip with a network protocol interface.

[0069] Among them, the application-specific integrated circuit ASIC is an integrated circuit specifically designed for a specific application or function and can efficiently execute specific tasks. For a network chip with a network protocol interface, its corresponding ASIC integrates multiple functional modules to achieve comprehensive processing capabilities from the physical layer to the data link layer.

[0070] Specifically, as Figure 2As shown, the application specific integrated circuit includes (integrates): an analysis function module 200, an interface function module 210, a physical layer function module 220, and a link layer function module 230.

[0071] Among them, the interface function module 210 is the interface part directly connected between a network chip with a network protocol interface and a physical medium, and is used to provide a connection interface that adapts to different physical media, so that the ASIC with a network protocol interface chip can be correctly connected to and perform data interaction with various physical media (such as coaxial cables, optical fibers, twisted pairs, etc.), thereby realizing the physical connection between the local network interface device and the peer network interface device.

[0072] Exemplarily, the interface function module 210 may be an MDI (Media Dependent Interface) function module. MDI refers to the physical and electrical connection interface between a network chip with a network protocol interface and a physical medium. That is, the MDI function module can be simply understood as an interface for connecting to a physical medium.

[0073] Among them, the physical layer function module 220 is responsible for performing signal encoding / decoding, modulation / demodulation, clock recovery, signal synchronization, etc., to ensure that data can be transmitted on the physical medium. Specifically, signal encoding / decoding means encoding the data sent by the link layer function module 220 for transmission through the physical medium, and performing the opposite operation during reception, that is, decoding the received code stream; signal modulation / demodulation means converting an electrical signal or an optical signal into a form suitable for a specific physical medium and performing the corresponding reverse operation; clock recovery means extracting clock information from the received code stream to ensure correct sampling; signal synchronization ensures that the data between the receiving end and the sending end is synchronized, and signal synchronization includes bit synchronization and frame synchronization.

[0074] Among them, the link layer function module 230, which can also be called a MAC (Media Access Control layer) function module, is responsible for frame generation and parsing, that is, generating a correct frame format according to the network protocol and parsing the received data frame. Specifically, the link layer function module 230 is also used for error detection and correction, flow control, etc.

[0075] Further, the data interaction between the interface function module 210, the physical layer function module 220, and the link layer function module 230 is specifically as follows: When sending data to the peer device, the link layer function module 230 constructs a corresponding data frame and transmits the data frame to the physical layer function module 220. The physical layer function module 220 encodes the data frame to obtain a binary bit stream suitable for transmission on the physical medium and transmits the binary bit stream to the interface function module 210. The interface function module 210 converts the bit stream into a form suitable for physical medium transmission (such as an electrical signal or an optical signal) and sends it to the peer device through the physical medium. When receiving data sent by the peer device, the interface function module 210 receives the signal from the physical medium, converts it back into a physical layer bit stream, and sends it to the physical layer function module. The physical layer function module decodes the received bit stream to obtain the corresponding data frame and sends the corresponding data frame to the link layer module. The link layer module receives the corresponding data frame and processes the data frame. That is, the data frame is transmitted between the physical layer function module 230 and the physical layer function module 220, while the (physical layer) bit stream is transmitted between the interface function module 210 and the physical layer function module 220. That is, the physical layer function module 220 sends the encoded bit stream to the interface function module 210, and the interface function module 210 sends the bit stream sent by the peer device received to the physical layer function module 220.

[0076] Specifically, both the interface function module 210 and the physical layer function module 220 include a transmit function module (Transmit, Tx) and a receive function module (Receive, Rx) inside. In other expressions, they can also be called the transmit interface (Tx) and the receive interface (Rx). Figure 2 In some descriptions, they are only represented by Tx and Rx. The Rx of the interface function module 210 is used to receive the bit stream sent by the peer device. The interface function module 210 transmits the received bit stream to the physical layer function module 220. The Rx of the physical layer function module 220 is used to receive the bit stream sent by the interface function module 210. For the convenience of description, the bit stream received by the Rx of the interface function module 210 and sent to the physical layer function module 220 is called the bit stream in the receive direction. Similarly, the Tx of the physical layer function module 220 is used to send the bit stream to the interface function module 210, and the Tx of the interface function module 210 is used to send the bit stream to the peer device. For the convenience of description, the bit stream sent by the Tx of the physical layer function module 220 to the interface function module 210 is called the bit stream in the transmit direction.

[0077] Similarly, the link layer function module 230 also includes Rx and Tx inside. The Rx of the link layer function module 230 is used to receive the data frame sent by the physical layer function module 220, and the Tx of the link layer function module 230 is used to send the data frame to the physical layer function module 220.

[0078] It should be noted that, as Figure 2 shown, the interface function module 210, the physical layer function module 220, and the link layer function module 230 work together to form a complete network protocol interface.

[0079] Among them, the analysis function module 200 is used to collect the (physical layer) bitstream transmitted between the interface function module 210 and the physical layer function module 220, and output the collected bitstream. That is, the analysis function module 200 is used to collect the bitstream in the transmission direction and the bitstream in the reception direction.

[0080] Specifically, as Figure 2 shown, the analysis function module 200 includes: a collection module 201 and an export module 202.

[0081] Among them, the collection module 201 is connected to the Tx of the physical layer function module 220, and is used to collect the bitstream transmitted by the physical layer function module 220 to the interface function module 210, that is, the bitstream in the transmission direction. And the collection module 201 is connected to the Rx of the interface function module 210, and is used to collect the bitstream received by the interface function module 210 from the peer device, that is, the bitstream in the reception direction.

[0082] The collection module 201 can be implemented based on a processing core running a corresponding program, running corresponding code through an FPGA (Field Programmable Gate Array), or hardened hardware. Specifically, the first method is to run a corresponding program based on the processing core to implement the function of the collection module 201. One or more processing cores are integrated inside the ASIC, and these processing cores can execute specific software programs to implement the corresponding functions; the second method is to run corresponding code through the FPGA to implement the function of the collection module 201. For example, use the FPGA as a part of the ASIC or work with the ASIC, and configure the FPGA through the corresponding code to implement the function of the collection module 201; the third method is to implement the collection module 201 with hardened hardware, that is, permanently solidify the function of the collection module 201 into the ASIC through the physical design and manufacturing process.

[0083] Among them, the export module 202 is connected to the collection module 201. The collection module 201 transmits the collected bitstream in the reception direction and the bitstream in the transmission direction to the export module 202, and the export module 202 outputs the received bitstream in the reception direction and the bitstream in the transmission direction to the protocol analysis tool for the protocol analysis tool to perform link protocol analysis.

[0084] The output module 202 can be an additional interface on the ASIC. Therefore, the output module 202 can be referred to as an export interface. The interface protocol of this export interface can be the I2C (Inter-Integrated Circuit) protocol, the serial port protocol (UART), etc. The export interface is used to output the bitstreams in the receiving direction and the sending direction collected by the acquisition module 201 to a protocol analysis tool, so as to facilitate the protocol analysis tool to perform link protocol analysis.

[0085] The above combination Figure 2 , has introduced in detail an analysis function module provided by an embodiment of the present application. Next, in combination with Figure 3 This will be introduced in detail a link protocol analysis method provided by an embodiment of the present application.

[0086] As Figure 3 shown, a link protocol analysis method provided by an embodiment of the present application includes the following steps:

[0087] S301. Collect the bitstreams in the sending direction and the receiving direction of the network protocol interface.

[0088] Since the network protocol interface is jointly composed of an interface function module, a physical layer function module, and a link layer function module, the bitstream transmitted by the physical layer function module to the interface function module and output through the interface function module, that is, the bitstream in the sending direction, can also be directly referred to as the bitstream in the sending direction of the network protocol interface. Similarly, the bitstream received by the interface function module from the peer device, that is, the bitstream in the receiving direction, can also be directly referred to as the bitstream in the receiving direction of the network protocol interface.

[0089] Specifically, through the acquisition module in the analysis function module, collect the bitstream transmitted by the interface function module to the physical layer function module, that is, the bitstream in the receiving direction, and collect the bitstream transmitted by the physical layer function module to the interface function module, that is, the bitstream in the sending direction; and transmit the collected bitstreams in the receiving direction and the sending direction to the output module in the analysis function module.

[0090] In a possible implementation manner, the acquisition module in the analysis function module starts to collect the bitstreams in the sending direction and the receiving direction of the network protocol interface in response to a preset trigger operation. Exemplarily, the preset trigger operations include: initialization of a network chip with a network protocol interface, detecting that there is bitstream transmission between the interface function module and the physical layer function module, etc. In addition, the preset trigger operation can also be: a start command input through a command interface, etc.

[0091] S302. Output the collected bitstreams in the sending direction and the receiving direction.

[0092] Specifically, the output module in the analysis function module outputs the bitstreams in the receiving direction and the sending direction transmitted by the acquisition module to the corresponding preset protocol analysis tool, so that the protocol analysis tool can obtain the link protocol analysis result based on the bitstreams in the receiving direction and the sending direction.

[0093] Among them, the protocol analysis tool is a tool for protocol analysis based on bitstreams, mainly used to capture and parse the bitstreams transmitted in the physical layer to interpret the entire process of link communication. Exemplarily, the protocol analysis tools include: Saleae Logic Analyzers and PicoScope.

[0094] For ease of understanding, the following takes the BASE-KR protocol standard and the BASE-SR link protocol as examples to illustrate a link protocol analysis method provided by an embodiment of the present application.

[0095] The BASE-KR link protocol refers to an Ethernet physical layer link protocol (standard) using a backplane and copper cables as physical media, mainly used for intra-rack or short-distance backplane communication in data centers and enterprise networks. The BASE-KR link protocol includes: 10GBASE-KR, 25GBASE-KR, 40GBASE-KR4, 50GBASE-KR, etc. The link connection establishment process of the BASE-KR link protocol is as follows: self-negotiation is performed by sending and receiving self-negotiation bitstreams. After self-negotiation is completed, training is performed by sending and receiving training bitstreams. After training is completed, the BASE-KR link connection is established. Therefore, for the BASE-KR link protocol, the acquisition module in the analysis function module acquires the self-negotiation bitstreams in the receiving direction and the sending direction, and the output module outputs the self-negotiation bitstreams to the corresponding protocol analysis tool. Similarly, the acquisition module in the analysis function module acquires the training bitstreams in the receiving direction and the sending direction, and the output module outputs the training bitstreams to the corresponding protocol analysis tool, so that the protocol analysis tool can implement BASE-KR link protocol analysis based on the self-negotiation bitstreams and the training bitstreams.

[0096] The BASE-SR link protocol refers to the Ethernet physical layer link protocol (standard) that uses short-reach optical modules or direct-connect copper cables as the physical medium, mainly for high-speed interconnection between devices such as servers and switches within a data center. The BASE-SR link protocol includes: 10GBASE-SR, 25GBASE-SR, 50GBASE-SR, etc. The process of establishing a link connection for the BASE-SR link protocol is as follows: Link synchronization is achieved by sending and receiving a specific synchronization code stream, and the received synchronization code stream is detected. If the detection is completed, the link synchronization is successful. According to the specification requirements, when link synchronization is continuously performed 4 times, a BASE-SR link connection is established. Therefore, for BASE-SR, by analyzing the synchronization code stream in the receiving direction and the synchronization code stream in the sending direction collected by the acquisition module in the functional module, and outputting the synchronization code stream to the corresponding protocol analysis tool through the output module, the BASE-SR link protocol analysis can be realized based on the synchronization code stream by the protocol analysis tool.

[0097] In the embodiments of the present application, by integrating an analysis functional module inside a network chip with a network protocol interface, the acquisition module in the analysis functional module collects the code stream in the sending direction and the code stream in the receiving direction, and outputs / exports the collected code stream through the output module, so that the code stream can be analyzed by the corresponding protocol analysis tool. Therefore, through the analysis functional module integrated inside the network chip with a network protocol interface, the process record of the physical layer code stream is realized and output, so that the link protocol analysis can be carried out based on the physical layer code stream by the protocol analysis tool to obtain the link protocol analysis result. The link protocol analysis result can reflect the dynamic change situation of the physical layer code stream during the transmission process, that is, the entire process of link communication can be interpreted. By comparing with the link protocol specification, the link connection problem can be accurately located, or the link test result can be reasonably and accurately judged.

[0098] Embodiment 2:

[0099] The following combines Figures 4 - 7 , and details another link protocol analysis method provided by the embodiments of the present application.

[0100] First, in combination with Figure 4 , details another analysis functional module provided by the embodiments of the present application, which is used to implement a link protocol analysis method provided by the embodiments of the present application.

[0101] As Figure 4 shown, the application-specific integrated circuit ASIC includes (integrates): an analysis functional module 400, an interface functional module 410, a physical layer functional module 420, and a link layer functional module 430.

[0102] It should be noted that the interface function module 410, the physical layer function module 420, and the link layer function module 430 are the same as the interface function module 210, the physical layer function module 220, and the link layer function module 230 in the first embodiment. Therefore, for details, please refer to the interface function module 210, the physical layer function module 220, and the link layer function module 230 in the first embodiment, which will not be elaborated here.

[0103] Among them, the analysis function module 400 includes: an acquisition module 401, a storage module 402, and an output module 403.

[0104] Among them, the acquisition module 401 is connected to the Tx of the physical layer function module 420 and is used to acquire the bitstream in the transmission direction. And the acquisition module 401 is connected to the Rx of the interface function module 410 and is used to acquire the bitstream in the reception direction.

[0105] Among them, the storage module 402 is connected to the acquisition module 401. The acquisition module 401 sends the acquired bitstream in the transmission direction and the bitstream in the reception direction to the storage module 402, and the storage module 402 stores the received bitstream in the transmission direction and the bitstream in the reception direction. That is, the storage module 402 is used to store the bitstream acquired by the acquisition module 401.

[0106] The storage module 402 can be a buffer inside the ASIC and is used to store the bitstream acquired by the acquisition module 401. The buffer is a high-speed storage layer located between the processing core and the main memory. The storage module 402 can also be a memory inside the ASIC. The ASIC memory refers to a storage unit designed specifically for storing the bitstream acquired by the acquisition module 401 (i.e., implementing the function of the storage module 402) and integrated into the ASIC, which can be SRAM (Static Random Access Memory), DRAM (Dynamic Random Access Memory), or ROM (Read Only Memory), etc.

[0107] Among them, the output module 403 is connected to the storage module 402 and is used to output the bitstream stored in the storage module 402 (i.e., the bitstream in the reception direction and the bitstream in the transmission direction).

[0108] In a possible implementation manner, the output module 403 provides corresponding interfaces for receiving the first output instruction. The corresponding interfaces include: a command interface, a tool interface, etc., for receiving instructions input externally. Among them, the first output instruction is an instruction used to request the output module 403 (i.e., the analysis function module 400) to output the bitstream externally. Specifically, the output module 403, in response to the received first output instruction, acquires / reads the stored bitstream in the transmission direction and the bitstream in the reception direction from the storage module 402 and outputs them to the corresponding protocol analysis tool for the protocol analysis tool to perform link protocol analysis.

[0109] The above combination Figure 4 introduced in detail an analysis function module provided in an embodiment of the present application. Next, in combination with Figure 5 a link protocol analysis method provided in an embodiment of the present application will be introduced in detail.

[0110] As Figure 5 shown, a link protocol analysis method provided in an embodiment of the present application includes the following steps:

[0111] S501. Collect the code streams in the transmission direction and the reception direction of the network protocol interface.

[0112] Specifically, through the collection module in the analysis function module, collect the code streams transmitted from the interface function module to the physical layer function module, that is, the code streams in the reception direction, and collect the code streams transmitted from the physical layer function module to the interface function module, that is, the code streams in the transmission direction; and transmit the collected code streams to the storage module in the analysis function module.

[0113] In a possible implementation manner, the collection module in the analysis function module responds to a preset trigger operation, starts to collect the code streams in the transmission direction and the reception direction of the network protocol interface, and stops collecting the code streams in response to the successful establishment of the link connection.

[0114] Specifically, the physical layer function module in the ASIC can detect whether the link connection is successfully established. When the physical layer function module detects that the link connection is successfully established, it can send an interrupt signal, a stop instruction, a successful establishment notification, etc. to the collection module, and the collection module stops collecting the code streams in response to the interrupt signal, the stop instruction, the successful establishment notification, etc. Alternatively, when the physical layer function module detects that the link connection is successfully established, it can modify the corresponding flag bit inside the ASIC to a successful establishment flag, and the collection module stops collecting the code streams in response to the corresponding flag bit being the successful establishment flag.

[0115] It should be noted that in addition to the above-described ways of characterizing the successful establishment of the link connection, it is also possible to characterize the successful establishment of the link connection by sending a specific level signal, etc., which is not specifically limited in the present application.

[0116] S502. Store the collected code streams in the transmission direction and the reception direction.

[0117] Specifically, the storage module stores the code streams in the transmission direction and the reception direction transmitted by the collection module.

[0118] Among them, the storage module defines the storage of the code stream in the sending direction and the code stream in the receiving direction according to the size of the storage space, ensuring that the storage module can complete the storage of all necessary code streams (data) during a link establishment process. Exemplarily, the storage module stores all necessary code streams (data) during the most recent link establishment process. Further, when the storage space of the storage module is large enough to store all necessary code streams (data) during multiple link establishment processes, when the amount of code stream data stored in the storage module exceeds the storage space, all necessary code streams (data) during the most recent link establishment process will overwrite the code streams (data) during the earliest link establishment process.

[0119] S503. When receiving the first output instruction, output the stored code stream in the sending direction and the code stream in the receiving direction.

[0120] Specifically, when the output module receives the first output instruction, the output module reads or obtains the stored code stream in the sending direction and the code stream in the receiving direction from the storage module, and outputs them to the corresponding protocol analysis tool. So that the protocol analysis tool can obtain the link protocol analysis result based on the code stream in the receiving direction and the code stream in the sending direction.

[0121] For the convenience of understanding, the following combines Figure 6 and Figure 7 , taking the BASE-SR link protocol as an example, to illustrate a link protocol analysis method provided by an embodiment of the present application.

[0122] First, combine Figure 6 to illustrate the link connection establishment process of the BASE-SR link protocol.

[0123] S601. The two end devices send and receive synchronization code streams.

[0124] Among them, the two end devices are two network interface devices (i.e., network chips with network protocol interfaces) connected through a physical medium.

[0125] Among them, the synchronization code stream refers to a series of coding patterns or signals used during data transmission to help maintain synchronization between the two end devices.

[0126] For the BASE-SR link protocol, the synchronization code stream is the IDLE (COMMA) code stream. The IDLE code stream is sent by the communication system when there is no valid data to be transmitted, in order to keep the link active and prevent the link from entering the low-power or disconnected state due to long-term lack of data transmission. The COMMA code is a specially designed code pattern used as a marker for it to help the receiving end identify the boundary of the code stream. That is, through the COMMA code, the receiving device can detect the start and end of the code stream, so as to correctly split and parse the received code stream. The IDLE (COMMA) code stream refers to the IDLE code stream containing the COMMA code, which is sent when there is no valid data transmission, and because of the COMMA code it contains, it can provide the necessary synchronization information without adding additional overhead.

[0127] Specifically, in the link initialization stage, the two-end devices start to send and receive the IDLE (COMMA) code stream to ensure that the two-end devices can correctly identify each other and prepare for subsequent data transmission.

[0128] S602: The two-end devices respectively verify whether the received synchronization code stream is correct.

[0129] Specifically, the two-end devices respectively verify the code pattern of the received synchronization code stream to check whether it conforms to the expected code pattern, ensure that the received synchronization code stream is correct, and thus confirm that the two-end devices have been successfully aligned and are ready for data communication.

[0130] When the two-end devices respectively verify that the received synchronization code stream is incorrect, S601 is performed again.

[0131] When the two-end devices respectively verify that the received synchronization code stream is correct, S603 is performed.

[0132] S603: The link synchronization is successful.

[0133] Specifically, in the BASE-SR link protocol, it is specified that 4 link synchronizations need to be successfully completed, that is, 4 synchronization code streams are continuously received and verified correctly, before S604 can be performed.

[0134] S604: Establish a link connection.

[0135] Based on the link connection establishment process of the BASE-SR link protocol as Figure 6 shown, an example of a link protocol analysis method provided by the embodiments of the present application is given.

[0136] The acquisition module of the analysis function module acquires the synchronization code stream sent by the physical layer function module received by the interface function module of the local device (the network chip with a network protocol interface at the local end), that is, the synchronization code stream in the transmission direction, and acquires the synchronization code stream sent by the peer device received by the interface function module, that is, the synchronization code stream in the reception direction, and transmits the acquired synchronization code stream to the storage module.

[0137] For the BASE-SR link protocol, the synchronization code stream in the transmission direction and the synchronization code stream in the reception direction acquired by the acquisition module are as Figure 7 shown:

[0138] For Rx (that is, the synchronization code stream in the reception direction), the received Rx IDLE (COMMA) code stream is docked and subjected to COMMA Detect (synchronization detection) processing, as Figure 7 shown. COMMA Detect 1, COMMA Detect2, COMMADetect 3, COMMA Detect 4 represent four comma detections performed on the received IDLE (COMMA) code stream, and the synchronization code stream (that is, the acquired synchronization code stream in the reception direction) IDLE (COMMA)R1, IDLE (COMMA)R2, IDLE (COMMA)R3, IDLE (COMMA)R4 is obtained.

[0139] For Tx (that is, the synchronization code stream in the transmission direction), the IDLE (COMMA) code stream is sent, as Figure 7 shown. IDLE (COMMA)T1, IDLE (COMMA)T2, IDLE (COMMA)T3, IDLE (COMMA)T4 are the synchronization code streams in the transmission direction acquired by the acquisition module.

[0140] The storage module stores the synchronization code stream in the transmission direction and the synchronization code stream in the reception direction transmitted by the acquisition module, that is, the storage module stores the synchronization code stream in the transmission direction and the synchronization code stream in the reception direction as Figure 7 shown. Subsequently, when the output module receives the first output instruction, it outputs the stored code stream in the transmission direction and the code stream in the reception direction to the corresponding protocol analysis tool, so that the protocol analysis tool can obtain the link protocol analysis result based on the code stream in the reception direction and the code stream in the transmission direction.

[0141] In the embodiments of the present application, by integrating an analysis function module inside a network chip with a network protocol interface, the acquisition module in the analysis function module acquires the code streams in the transmission direction and the reception direction, and stores the acquired code streams in the storage module; in response to a first output command, the output module obtains / reads the stored code streams from the storage module and outputs / exports them externally, so as to analyze the code streams through a corresponding protocol analysis tool. Therefore, through the analysis function module integrated inside the network chip with a network protocol interface, the process record of the physical layer code stream is realized, and the physical layer code stream is output as required, so as to perform link protocol analysis based on the physical layer code stream through a protocol analysis tool to obtain a link protocol analysis result, which can reflect the dynamic change situation of the physical layer code stream during the transmission process, that is, the entire process of link communication can be interpreted, and by comparing with the link protocol specification, the link connection problem can be accurately located, or the link test result can be reasonably and accurately judged.

[0142] Embodiment 3:

[0143] Next, in combination with Figures 8 - 16 , another link protocol analysis method provided by the embodiments of the present application will be introduced in detail.

[0144] First, in combination with Figure 8 , another analysis function module provided by the embodiments of the present application will be introduced in detail, which is used to implement a link protocol analysis method provided by the embodiments of the present application.

[0145] As Figure 8 shown, the application-specific integrated circuit ASIC includes (integrates): an analysis function module 800, an interface function module 810, a physical layer function module 820, and a link layer function module 830.

[0146] It should be noted that the interface function module 810, the physical layer function module 820, and the link layer function module 830 are the same as the interface function module 210, the physical layer function module 220, and the link layer function module 230 in Embodiment 1. Therefore, for details, please refer to the interface function module 210, the physical layer function module 220, and the link layer function module 230 in Embodiment 1, which will not be elaborated here.

[0147] Among them, the analysis function module 800 includes: an acquisition module 801, a parsing module 802, an adjustment module 803, a storage module 804, and an output module 805.

[0148] Among them, the acquisition module 801 is connected to the Tx of the physical layer function module 820 for acquiring the code stream in the transmission direction, and the acquisition module 801 is connected to the Rx of the interface function module 810 for acquiring the code stream in the reception direction.

[0149] Among them, the parsing module 802 is connected to the acquisition module 801. The acquisition module 801 respectively sends the bitstreams in the transmission direction and the reception direction to the parsing module 802. The parsing module 802 analyzes the bitstreams in the transmission direction and the reception direction respectively based on the protocol specifications, and obtains the parsing results (Tx parsing results) corresponding to the bitstream in the transmission direction and the parsing results (Rx parsing results) corresponding to the bitstream in the reception direction. That is, the parsing module 802 is used to parse the bitstream to obtain the parsing results.

[0150] The parsing module 802 can be implemented by running the corresponding program based on the processing core, running the corresponding code through the FPGA (Field Programmable Gate Array), or hardened hardware. Generally, the parsing module 802 is implemented by running the corresponding program based on the processing core or running the corresponding code through the FPGA. Because the protocol specifications corresponding to different link protocols are different, and the protocol specifications relied on by the parsing modules of the analysis function modules in different ASICs are different, that is, the specific implementation functions of the parsing modules are different. Therefore, the protocol analysis functions relying on different protocol specifications can be quickly and conveniently implemented by modifying the corresponding program run by the processing core or the corresponding code run by the FPGA.

[0151] Among them, the adjustment module 803 is connected to the parsing module 802. The parsing module 802 respectively sends the Tx parsing results and the Rx parsing results to the adjustment module 803. The adjustment module 803 performs phase alignment on the Tx parsing results and the Rx parsing results to obtain the protocol analysis results.

[0152] Since the Tx channel and the Rx channel of the network chip with a network protocol interface are respectively operated by two independent state machines, and there may be a difference in the initialization time between the local chip and the peer chip, this leads to inconsistent link initialization start times, that is, the times when the two chips start sending bitstreams are inconsistent. Therefore, the bitstreams in the transmission direction and the reception direction may be in different phases during the initialization stage. However, during the process of establishing a link connection, there is an association relationship between the bitstreams in the transmission direction and the reception direction. For example, some fields / bit values in the current bitstream in the transmission direction are determined based on some / bit values in the previous bitstream in the reception direction. This association relationship requires phase alignment of the Tx parsing results and the Rx parsing results to ensure that the obtained protocol analysis results after alignment can accurately reflect the complete communication process of link establishment.

[0153] The adjustment module 803 can also be implemented by running a corresponding program based on a processing core, running corresponding code through an FPGA (Field Programmable Gate Array), or hardened hardware. Generally, the adjustment module 803 is implemented by running a corresponding program based on a processing core or running corresponding code through an FPGA. Since the corresponding association relationships may be different for different link protocols, that is, the specific implemented functions of the adjustment module 803 are different, the phase alignment function of different association relationships can be quickly and conveniently implemented by modifying the corresponding program run by the processing core or the corresponding code run by the FPGA.

[0154] Among them, the storage module 804 is connected to the adjustment module 803. The adjustment module 803 sends the obtained protocol analysis result to the storage module 804, and the storage module 804 stores the received protocol analysis result. That is, the storage module 804 stores the protocol analysis result obtained by the adjustment module 803.

[0155] Among them, the output module 805 is connected to the storage module 804 and is used to output the protocol analysis result stored by the storage module 804.

[0156] In a possible implementation manner, the output module 805 provides corresponding interfaces for receiving a second output instruction. The corresponding interfaces include: a command interface, a tool interface, etc., for receiving instructions input externally. Among them, the second output instruction is an instruction used to request the output module 805 to output the protocol analysis result externally. Specifically, in response to the received second output instruction, the output module 805 obtains / reads the stored protocol analysis result from the storage module 804 and outputs it. By directly outputting the link protocol analysis result, it can reflect the dynamic changes of the physical layer code stream during the transmission process, that is, it can interpret the entire process of link communication. By comparing with the link protocol specification, it can accurately locate link connection problems or make reasonable and accurate judgments on link test results.

[0157] The above combination Figure 8 , has introduced in detail an analysis function module provided by an embodiment of the present application. Next, in combination with Figure 9 will introduce in detail a link protocol analysis method provided by an embodiment of the present application.

[0158] As Figure 9 shown, a link protocol analysis method provided by an embodiment of the present application includes the following steps:

[0159] S901. Collect the code stream in the transmission direction and the code stream in the reception direction of the network protocol interface itself.

[0160] It should be noted that the above S901 is the same as S501 in the second embodiment. Therefore, for the specific implementation manner of S901, please refer to S501 in the second embodiment, which will not be elaborated here.

[0161] S902. Parse the bitstreams in the transmission direction and the reception direction that are collected respectively, to obtain the Tx parsing result and the Rx parsing result.

[0162] Specifically, the parsing module parses the bitstream in the transmission direction based on the protocol specification corresponding to the link protocol of the network protocol interface, to obtain the parsing result (Tx parsing result) corresponding to the bitstream in the transmission direction; and parses the bitstream in the reception direction, to obtain the parsing result (Rx parsing result) corresponding to the bitstream in the reception direction.

[0163] S903. Align the phases of the Tx parsing result and the Rx parsing result, to obtain the protocol analysis result.

[0164] Specifically, the adjustment module aligns the phases of the Tx parsing result and the Rx parsing result based on the correlation relationship corresponding to the link protocol, to obtain the protocol analysis result.

[0165] S904. Store the obtained protocol analysis result.

[0166] Specifically, the storage module stores the protocol analysis result obtained after the adjustment module adjusts / aligns the phases.

[0167] Among them, the storage module defines the storage situation of the protocol analysis result according to the size of the storage space, to ensure that the storage module can complete saving the protocol analysis results corresponding to all necessary bitstreams during one link establishment process. Exemplarily, the storage module saves the protocol analysis results corresponding to all necessary bitstreams during the most recent link establishment process. Further, when the storage space of the storage module is large enough to save the protocol analysis results corresponding to all necessary bitstreams during multiple link establishment processes, when the data volume of the protocol analysis results stored in the storage module exceeds the storage space, then the protocol analysis results corresponding to all necessary bitstreams during the most recent link establishment process will overwrite the protocol analysis results corresponding to the bitstreams during the earliest link establishment process.

[0168] S905. When receiving the second output command, output the stored protocol analysis result.

[0169] Specifically, when the output module receives the second output instruction, the output module reads or obtains the stored protocol analysis result from the storage module and outputs it. The protocol analysis result can reflect the dynamic change situation of the physical layer bitstream during the transmission process, that is, it can interpret the entire process of link communication. Comparing with the link protocol specification, it can accurately locate link connection problems or make reasonable and accurate judgments on link test results.

[0170] For the convenience of understanding, the following combines Figures 10 - 16, taking the BASE-KR link protocol as an example, this application embodiment provides a link protocol analysis method.

[0171] First, in combination with Figure 10 describe the establishment process of the link connection of the BASE-KR link protocol.

[0172] Among them, the link connection establishment process of the BASE-KR link protocol includes: an Auto-Negotiation process and a Training process.

[0173] S1001. The two-end devices send and receive the auto-negotiation code stream.

[0174] Among them, the auto-negotiation code stream refers to a specific signal used to exchange the ability information of both parties when a network device (a network chip with a network protocol interface) is initialized or the link is re-established. The auto-negotiation code stream refers to the combination of multiple auto-negotiation codes, that is, the auto-negotiation code stream includes multiple auto-negotiation codes.

[0175] Specifically, the two-end devices start to send and receive the auto-negotiation code stream. The auto-negotiation code stream contains information about device capabilities and parameters. Through the auto-negotiation code stream, the two-end devices can determine each other's capabilities and best working parameters.

[0176] In combination with Figure 11 , introduce in detail the data format of the auto-negotiation code in this application embodiment.

[0177] As Figure 11 shown, the auto-negotiation code includes a Delimiter, a Code Word, and a Random Bit (PR), that is, an 8-bit delimiter, a 48-bit code word, and a 1-bit random bit.

[0178] Among them, the delimiter is used to identify the start and end of an auto-negotiation code. In the field of communication and data processing, the delimiter refers to a special character or bit sequence used to mark the start and end of a data packet, field, or specific data structure. It is like an identifier that helps the receiving end accurately identify the boundary of an auto-negotiation code, so as to correctly parse / recognize the received information. The delimiter has a unique bit pattern, making it easy to be recognized in a continuous code stream; and by using the delimiter, the receiving-end device can distinguish different code words, avoiding data confusion and ensuring the reliability of data exchange.

[0179] Specifically, for the auto-negotiation code stream, the delimiter helps the receiving-end device accurately locate and identify the 48-bit code word in each auto-negotiation code. And through the delimiter, the auto-negotiation code can be recognized from the code stream.

[0180] Among them, the random bits are used to increase the randomness of the auto-negotiation code and prevent misidentification. Random bits generally refer to one or more bits used to increase the randomness of a data stream (auto-negotiation code) in the fields of communication and data processing. They can be inserted into the data stream to help ensure the uniqueness of the code, assist in the synchronization process, or be used for specific protocol requirements. It should be noted that the random bits can be completely randomly generated or pseudo-random sequences generated based on a certain algorithm or rule.

[0181] Among them, the 48-bit codeword in the auto-negotiation code can be called a "page". Specifically, as Figure 11 shown. The 48-bit codeword includes: Selector Field, Echoed Nonce Field, Pause, Remote Fault Indicator (RF), Acknowledge (Ack), Next Page (NP), Transmitted Nonce Field, Technology Ability Field, and Forward Error Correction Capability (FEC Capability).

[0182] The Selector Field has a length of 5 bits and is used to identify a specific selection or configuration, involving protocol versions, modes, or other elements that need to be distinguished. Specifically, the Selector Field is used to refer to the protocol being followed. For example, for the BASE-KR link protocol, the value of the Selector Field is 5b’00001, identifying IEEE802.3.

[0183] The Echoed Nonce Field has a length of 5 bits and contains a random value previously received from the receiving device. Its purpose is to verify the identities and statuses of both communication parties to ensure the security and correctness of the connection. For the BASE-KR link protocol, if the Ack bit of the auto-negotiation code in the transmission direction has a value of 1b’0, the value of this Echoed Nonce Field is 5b’00000. If the Ack bit of the auto-negotiation code in the transmission direction has a value of 1b’1, the value of this Echoed Nonce Field is the value of the Transmitted Random Field of the previous page of the auto-negotiation code received in the receiving direction (Rx).

[0184] The Pause Field has a length of 3 bits and is used to indicate whether the device supports or uses the pause flow control protocol for flow control. Among them, the pause flow control protocol is a flow control mechanism that allows the receiving party to notify the sending party to temporarily stop sending data so that the receiving party has time to process the data in its buffer, avoiding data overflow and data loss.

[0185] The length of the remote fault indication field is 1 bit, which is used to indicate whether a fault / error occurs at the remote end (i.e., the peer end). That is, this remote fault indication field is used to indicate whether there is a fault / error in the peer device, or to indicate whether there is a fault / error in the connection to the peer device, which helps to quickly diagnose faults and respond to network problems. Exemplarily, if the remote fault indication field is 0, it can indicate that no remote fault is detected, that is, the peer device of the link is working properly; if the remote fault indication field is 1, it can indicate that a remote fault is detected, that is, there may be some problems in the peer device of the link, such as cable disconnection, device failure, etc.

[0186] The length of the acknowledgment field is 1 bit, which is used to confirm that the received auto-negotiation code page meets the requirements, that is, to indicate whether the receiver has successfully received and recognized the auto-negotiation code page sent by the sender. If the receiver can receive and parse / interpret the auto-negotiation code page, it will respond by setting the Ack field to a specific value.

[0187] The length of the next page field is 1 bit, which is used to indicate whether there is a next page of the auto-negotiation code page or an extended page after the current auto-negotiation code page. In the BASE-KR link protocol, the basic auto-negotiation code page may not be sufficient to convey all necessary information or specific technical capabilities. Therefore, the "next page" mechanism is introduced to allow devices to send more information. Exemplarily, if the value of NP is 0, it means there are no more pages, that is, this is the last or only auto-negotiation code page; if the value of NP is 1, it means there is a next auto-negotiation code page, that is, there is additional information to be transmitted later.

[0188] The length of the transmit random number field is 5 bits, which contains the random number generated in this transmission and is used for authentication and encryption purposes to increase the security of communication. Specifically, each time a new auto-negotiation code page is sent, the value of each transmit random number field is updated. By continuously updating the transmit random number field, the uniqueness of each auto-negotiation code (auto-negotiation code page) can be ensured, which helps to verify the identities of both communication parties and prevent replay attacks.

[0189] The length of the technical capabilities field is 23 bits, which is used to indicate various interface modes and technical capabilities supported by the device. Specifically, the technical capabilities field is used to indicate the physical layer link protocols and technologies supported by the device, including: different link protocols, interface rates supported by the link, duplex modes, etc. By sharing this capability information, both parties participating in the auto-negotiation can find the best configuration that they both support, thereby optimizing the data transmission efficiency and stability.

[0190] The length of the forward error correction capability field is 4 bits, which is used to indicate the forward error correction modes supported by the link, including: BASE-FEC, RS-FEC, etc. Through the forward error correction capability field, it is ensured that the two end devices can select the most suitable FEC mode according to their respective capabilities and requirements to optimize the transmission efficiency and data integrity.

[0191] The above combination Figure 11 introduced in detail the data structure of the auto-negotiation code. The auto-negotiation code stream received by the local device Rx and the auto-negotiation code stream sent by Tx (i.e., the auto-negotiation code stream in the receiving direction and the auto-negotiation code stream in the sending direction) are as Figure 12 shown. As Figure 12 shown, while the local device Tx sends multiple pages of auto-negotiation code to the peer device, the local device Rx receives multiple pages of auto-negotiation code sent by the peer device. Further, for the establishment of the BASE-KR link, it is necessary to complete the auto-negotiation through the interaction of multiple pages of auto-negotiation code.

[0192] S1002. The two end devices confirm the working parameters according to the auto-negotiation code stream.

[0193] Specifically, the receiving end device analyzes the received auto-negotiation code stream and extracts the necessary parameter information, so as to determine the best working parameters that both end devices can support, such as data rate, coding method, etc.

[0194] S1003. Determine whether the auto-negotiation is completed.

[0195] When the auto-negotiation is completed, S1004 is performed.

[0196] When the auto-negotiation is not completed, S1001 is continued, that is, the auto-negotiation code stream is resent and received until the auto-negotiation is successful.

[0197] S1004. The two end devices send and receive the link training code stream.

[0198] Once the negotiation is successful, the two end devices start to send and receive the link training code stream.

[0199] Among them, the link training code stream is used to calibrate and optimize the link parameters to ensure that the link can transmit data stably and achieve the best performance. The link training code stream refers to the combination of multiple link training codes, that is, the link training code stream includes multiple link training codes.

[0200] Combined with Figure 13 , the data format of the link training code in the embodiments of the present application is introduced in detail.

[0201] As Figure 13As shown in the figure, the link training code includes: Frame Marker, Coefficient Update, Status Report, and Training Pattern. Specifically, the length of the link training code is 548 bytes, including 4 bytes of Frame Marker, 16 bytes of Coefficient Update, 16 bytes of Status Report, and 512 bytes of Training Pattern.

[0202] The Frame Marker serves as the identifier of the link training code, used to mark the start or end of a training code, which is crucial for the receiving device to recognize and process each individual link training code.

[0203] Coefficient Update is used to instruct the peer device to adjust or update link parameters. These parameters may include equalization settings, amplitude changes, etc., with the aim of optimizing link performance. In an adaptive equalization system, by continuously adjusting these coefficients, channel loss and distortion can be compensated, thereby improving the signal quality.

[0204] Status Report is used to report to the peer device the current link parameter adjustment or update situation of the local device, including but not limited to information such as amplitude changes and equalization setting changes. This enables the two devices to connect to each other's status in a timely manner, facilitating corresponding adjustments or measures.

[0205] The Training Pattern is a PRBS11 pseudo-random code (Pseudo-Random Binary Sequence of length 11), which tests the signal quality and integrity of the link through a specific pattern of pseudo-random sequence. Specifically, by comparing the transmitted and received PRBS11 sequences, errors in the transmission process can be detected, and then the overall performance of the link can be evaluated.

[0206] The above combination Figure 13 introduces in detail the data structure of the link training code. The link training code streams received by the local device Rx and transmitted by the local device Tx (i.e., the link training code streams in the receiving direction and the transmitting direction) are as Figure 14 shown. As Figure 14 shown, while the local device Tx sends multiple link training codes to the peer device, the local device Rx receives multiple link training codes sent by the peer device. Further, for the establishment of the BASE-KR link, multiple link training code interactions are required to complete the training.

[0207] S1005. The two devices confirm the link parameters according to the link training code stream.

[0208] Specifically, the receiving device analyzes the received link training bitstream, confirms whether the link parameters meet the requirements, so as to further adjust and optimize the link parameters to ensure the stability and reliability of the link.

[0209] S1006. Determine whether the training is completed.

[0210] When the training is completed, S1007 is performed.

[0211] When the training is not completed, S1001 is continued, that is, the auto-negotiation bitstream is resent and received until the auto-negotiation is successful, and then the link training bitstream is resent and received until the training is successful.

[0212] S1007. Establish a link connection.

[0213] Based on the Figures 10 - 14 link connection establishment process of the BASE-KR link protocol as shown, an example is given to introduce a link protocol analysis method provided by an embodiment of the present application.

[0214] For the auto-negotiation process, the acquisition module of the analysis function module acquires the auto-negotiation bitstream sent by the physical layer function module received by the interface function module of the local device (the network chip with a network protocol interface at the local end), that is, the auto-negotiation bitstream in the sending direction, and acquires the auto-negotiation bitstream sent by the peer device received by the interface function module, that is, the auto-negotiation bitstream in the receiving direction, and transmits the acquired auto-negotiation bitstream to the parsing module. Specifically, the auto-negotiation bitstream in the sending direction (Tx auto-negotiation bitstream) and the auto-negotiation bitstream in the receiving direction (Rx auto-negotiation bitstream) acquired by the acquisition module are as Figure 11 shown.

[0215] The parsing module parses the acquired Tx auto-negotiation bitstream and Rx auto-negotiation bitstream based on the data structure of the auto-negotiation code (that is, the protocol specification of the BASE-KR link protocol) to obtain the Tx parsing result and Rx parsing result of the auto-negotiation bitstream; the adjustment module adjusts the phase and aligns the Tx parsing result and Rx parsing result according to the correlation between the Tx auto-negotiation bitstream and Rx auto-negotiation bitstream to obtain the link protocol analysis result of the auto-negotiation bitstream. For easy understanding, the following Figure 15 takes two pages of auto-negotiation codes as an example to introduce how to obtain the link protocol analysis result.

[0216] As Figure 15As shown in (a), the link protocol analysis results of the auto-negotiation code of pageN, that is, the parsing results of the Rx auto-negotiation code and Tx auto-negotiation code of pageN. The value of the selection field of the Rx auto-negotiation code is 0x01, indicating the IEEE802.3 protocol; the value of the selection field of the Tx auto-negotiation code is 0x01, indicating the IEEE802.3 protocol. If the confirmation field of the Rx auto-negotiation code is 0x0, the echo random number field of the Rx auto-negotiation code is 0x00; if the confirmation field of the Tx auto-negotiation code is 0x1, the echo random number field is the value of the sending random field of the Rx auto-negotiation code in PageN-1, exemplarily 0x10. The pause field of the Rx auto-negotiation code is 0x0, that is, the pause flow control protocol is not supported; the pause field of the Tx auto-negotiation code is 0x0, that is, the pause flow control protocol is not supported. The remote fault indication field of the Rx auto-negotiation code is 0x0, indicating that there is no fault in the local device, that is, the peer device indicates that its peer device (local device) does not have a fault; the remote fault indication field of the Tx auto-negotiation code is 0x0, that is, there is no fault in the peer device. The confirmation field of the Rx auto-negotiation code is 0x0, that is, the peer device indicates that the auto-negotiation code sent by the local device does not meet the requirements; the confirmation field of the Tx auto-negotiation code is 0x1, that is, the local device indicates that the auto-negotiation code sent by the peer device meets the requirements. The next page field of the Tx auto-negotiation code is 0x0, that is, there is no next page of auto-negotiation code; the next page field of the Rx auto-negotiation code is 0x0, that is, there is no next page of auto-negotiation code. The sending random number field of the Tx auto-negotiation code is 0x12; the sending random number field of the Rx auto-negotiation code is 0x0B. The technical capability field of the Rx auto-negotiation code is 0x000405, which means that the interface mode supported by the link is 25G-KR / CR, 10G-KR, 1000-KX; the technical capability field of the Tx auto-negotiation code is 0x000404, which means that the interface mode supported by the link is 25G-KR / CR, 10G-KR. The forward error correction capability field of the Rx auto-negotiation code is 0xC, which means that the FEC mode used by the link is 25G-BASE-FEC, RS-FEC; the forward error correction capability field of the Tx auto-negotiation code is 0xC, which means that the FEC mode used by the link is 25G-BASE-FEC, RS-FEC.

[0217] like Figure 15As shown in (b) of [document name], the link protocol analysis result of the auto-negotiation code of page N+1, which is the parsing result of the Rx auto-negotiation code and Tx auto-negotiation code of page N. The value of the selection field of the Rx auto-negotiation code is 0x01, indicating the IEEE802.3 protocol; the value of the selection field of the Tx auto-negotiation code is 0x01, indicating the IEEE802.3 protocol. The confirmation field of the Rx auto-negotiation code is 0x1, and the echo random number field of the Rx auto-negotiation code is 0x0B, which is the same as the value of the transmit random field of the Tx auto-negotiation code in PageN; the confirmation field of the Tx auto-negotiation code is 0x1, and the echo random number field of the Tx auto-negotiation code is 0x12, which is the same as the value of the transmit random field of the Rx auto-negotiation code in PageN. The pause field of the Rx auto-negotiation code is 0x0, that is, it does not support the pause flow control protocol; the pause field of the Tx auto-negotiation code is 0x0, that is, it does not support the pause flow control protocol. The remote fault indication field of the Rx auto-negotiation code is 0x0, indicating that there is no fault in the local device, that is, the peer device indicates that its peer device (i.e., the local device) has no fault; the remote fault indication field of the Tx auto-negotiation code is 0x0, that is, the peer device has no fault. The confirmation field of the Rx auto-negotiation code is 0x1, that is, the peer device indicates that the auto-negotiation code sent by the local device meets the requirements; the confirmation field of the Tx auto-negotiation code is 0x1, that is, the local device indicates that the auto-negotiation code sent by the peer device meets the requirements. The next page field of the Tx auto-negotiation code is 0x0, that is, there is no next page auto-negotiation code; the next page field of the Rx auto-negotiation code is 0x0, that is, there is no next page auto-negotiation code. The transmit random number field of the Tx auto-negotiation code is 0x14; the transmit random number field of the Rx auto-negotiation code is 0x0E. The technical capability field of the Rx auto-negotiation code is 0x000405, which indicates that the interface modes supported by the link are 25G-KR / CR, 10G-KR, 1000-KX; the technical capability field of the Tx auto-negotiation code is 0x000404, which indicates that the interface modes supported by the link are 25G-KR / CR, 10G-KR. The forward error correction capability field of the Rx auto-negotiation code is 0xC, which indicates that the FEC mode used by the link is 25G-BASE-FEC, RS-FEC; the forward error correction capability field of the Tx auto-negotiation code is 0xC, which indicates that the FEC mode used by the link is 25G-BASE-FEC, RS-FEC.

[0218] For the training process, the acquisition module of the analysis function module acquires the link training code stream sent by the physical layer function module received by the interface function module of the local device (the network chip with a network protocol interface at the local end), that is, the link training code stream in the transmission direction, and acquires the link training code stream sent by the peer device received by the interface function module, that is, the link training code stream in the reception direction, and transmits the acquired link training code stream to the parsing module. Specifically, the link training code stream in the transmission direction (Tx link training code stream) and the link training code stream in the reception direction (Rx link training code stream) acquired by the acquisition module are as Figure 14 shown.

[0219] Based on the data structure of the link training code (i.e., the protocol specification of the BASE-KR link protocol), the parsing module parses the acquired Tx link training code stream and Rx link training code stream to obtain the Tx parsing result and Rx parsing result of the link training code stream; the adjustment module adjusts the phase and aligns the Tx parsing result and Rx parsing result according to the correlation between the Tx link training code stream and the Rx link training code stream to obtain the link protocol analysis result of the link training code stream. For ease of understanding, the following combines Figure 16 Taking two frames of link training codes as an example, the obtained link protocol analysis result is introduced by way of example. First, it is introduced that Coefficient(+1) represents the equalization coefficient after level conversion, ensuring that the signal can be more accurately recognized by the receiving end after level conversion; Coefficient(0) represents the coefficient of the signal amplitude, which is directly related to the strength of the signal; Coefficient(-1) represents the equalization coefficient before level conversion, which is applied to the stage before the level conversion of the signal, and the purpose is to preprocess the signal so as to better adapt to the subsequent transmission process.

[0220] As Figure 16As shown in (a) of , the link protocol analysis result of the link training code stream of FrameN, that is, the parsing results of the Rx link training code and the Tx link training code of FrameN. The value of the frame marker of the Rx link training code is 0xFFFFF000, indicating a KR training code; the value of the frame marker of the Tx link training code is 0xFFFFF000, indicating a KR training code. The value of the system update of the Rx link training code is 0x00010100, that is, Coefficient(+1)hold, Coefficient(0)hold, Coefficient(-1)hold, indicating that the equalization coefficient after level conversion remains unchanged, the coefficient of the signal amplitude remains unchanged, and the equalization coefficients before and after level conversion remain unchanged; the value of the system update of the Tx link training code is 0x00000110, that is, Coefficient(+1)hold, Coefficient(0)increment, Coefficient(-1)decrement, indicating that the equalization coefficient after level conversion remains unchanged, the coefficient of the signal amplitude will increase, and the equalization coefficient before level conversion will be decreased. The value of the status report of the Rx link training code is 0x00010101, that is, Coefficient(+1)updated, Coefficient(0)updated, Coefficient(-1)updated, indicating that the equalization coefficient after level conversion is updated, the coefficient of the signal amplitude is updated, and the equalization coefficient before level conversion is updated; the value of the status report of the Tx link training code is 0x00010101, that is, Coefficient(+1)updated, Coefficient(0)updated, Coefficient(-1)updated, indicating that the equalization coefficient after level conversion is updated, the coefficient of the signal amplitude is updated, and the equalization coefficient before level conversion is updated; the training modes of the Rx link training code and the Tx link training code are PRBS11 random codes.

[0221] As Figure 16As shown in (b) of , the link protocol analysis result of the link training code of FrameN+1, that is, the parsing results of the Rx link training code and the Tx link training code of FrameN+1. The value of the frame marker of the Rx link training code is 0xFFFFF000, indicating a KR training code; the value of the frame marker of the Tx link training code is 0xFFFFF000, indicating a KR training code. The value of the system update of the Rx link training code is 0x00010000, that is, Coefficient(+1)increment, Coefficient(0)hold, Coefficient(-1)hold, indicating that the equalization coefficient after the level conversion will be reduced, the coefficient of the signal amplitude remains unchanged, and the equalization coefficient before the level conversion remains unchanged; the value of the system update of the Tx link training code is 0x00000100, that is, Coefficient(+1)hold, Coefficient(0)increment, Coefficient(-1)hold, indicating that the equalization coefficient after the level conversion remains unchanged, the coefficient of the signal amplitude will be reduced, and the equalization coefficient before the level conversion remains unchanged. The value of the status report of the Rx link training code is 0x00010101, that is, Coefficient(+1)not_updated, Coefficient(0)updated, Coefficient(-1)updated, indicating that the equalization coefficient after the level conversion is not updated, the coefficient of the signal amplitude is updated, and the equalization coefficient before the level conversion is updated; the value of the status report of the Tx link training code is 0x00010101, that is, Coefficient(+1)updated, Coefficient(0)updated, Coefficient(-1)not_updated, indicating that the equalization coefficient after the level conversion is updated, the coefficient of the signal amplitude is updated, and the equalization coefficient before the level conversion is not updated; the training modes of the Rx link training code and the Tx link training code are PRBS11 random codes.

[0222] The storage module stores the protocol analysis result obtained by the adjustment module, such as Figure 15 and Figure 16 The protocol analysis result shown. Subsequently, when the output module receives the second output instruction, it outputs the stored protocol analysis result. This link protocol analysis result can reflect the dynamic changes of the physical layer code stream during the transmission process, that is, it can interpret the entire process of link communication. By comparing with the link protocol specification, the link connection problem can be accurately located, or the link test result can be reasonably and accurately judged.

[0223] In the embodiments of the present application, by integrating an analysis function module inside a network chip with a network protocol interface, the acquisition module in the analysis function module acquires the code streams in the transmission direction and the reception direction. The analysis module and the adjustment module parse the acquired code streams, perform phase alignment on the parsing results to obtain a protocol analysis result, and the storage module stores the protocol analysis result; the output module, in response to a second output command, obtains / reads the stored protocol analysis result from the storage module and outputs / exports it externally. By means of the analysis function module integrated inside the network chip with a network protocol interface, process recording of the physical layer code stream is realized, and the protocol analysis result is output as required. The link protocol analysis result can reflect the dynamic changes of the physical layer code stream during the transmission process, that is, the entire process of link communication can be interpreted. By referring to the link protocol specification, the link connection problem can be accurately located, or the link test result can be reasonably and accurately judged.

[0224] It should be noted that for Embodiment 1, Embodiment 2, and Embodiment 3, the switching between Embodiment 1, Embodiment 2, and Embodiment 3 can be achieved by means of a switch switching module, setting an initial level, inputting a specific command, etc.

[0225] Embodiment 4:

[0226] The following combines Figure 17 , and details a link protocol analysis method provided by the embodiments of the present application. The link protocol analysis method is applied to a network chip including a network protocol interface, and the network chip is integrated with an analysis function module. The analysis function module communicates with the network protocol interface, and the analysis function module includes: an acquisition module and an output module.

[0227] As Figure 17 shown, a link protocol analysis method provided by the embodiments of the present application includes the following steps:

[0228] S1701. Through the acquisition module, acquire the transmission information of the network protocol interface.

[0229] Among them, the transmission information includes: the code streams in the transmission direction and the reception direction of the network protocol interface.

[0230] S1702. Through the output module, output the transmission data obtained based on the code streams in the transmission direction and the reception direction, so as to facilitate the determination of link problems based on the transmission data.

[0231] Among them, the transmission data obtained based on the code stream in the sending direction and the code stream in the receiving direction includes: the code stream in the sending direction and the code stream in the receiving direction, that is, through the output module, the code stream in the sending direction and the code stream in the receiving direction are output, so as to determine link problems based on the code stream in the sending direction and the code stream in the receiving direction. Exemplarily, the code stream in the sending direction and the code stream in the receiving direction are output to a protocol analysis tool, and the protocol analysis tool can perform protocol analysis on the code stream in the sending direction and the code stream in the receiving direction to obtain a link protocol analysis result.

[0232] Further, in a possible implementation manner, the analysis function module further includes: a parsing module and an adjustment module. Before performing S1702, a link protocol analysis method provided by an embodiment of the present application further includes:

[0233] Through the parsing module, the code stream in the sending direction and the code stream in the receiving direction are parsed to obtain parsing results corresponding to the code stream in the sending direction and the code stream in the receiving direction respectively; through the adjustment module, the parsing results corresponding to the code stream in the sending direction and the code stream in the receiving direction are phase-aligned to obtain corresponding protocol analysis results; the corresponding protocol analysis results are transmission data.

[0234] Specifically, through the output module, the corresponding protocol analysis results are output, so as to determine link problems based on the corresponding protocol analysis results.

[0235] Exemplarily, when the network protocol interface supports the BASE-KR link protocol, the code stream in the sending direction and the code stream in the receiving direction include: the auto-negotiation code stream in the sending direction and the auto-negotiation code stream in the receiving direction. Further, the code stream in the sending direction and the code stream in the receiving direction further include: the link training code stream in the sending direction and the link training code stream in the receiving direction.

[0236] For the auto-negotiation code stream in the sending direction and the auto-negotiation code stream in the receiving direction, through the parsing module, based on the data structure of the auto-negotiation code, the auto-negotiation code stream in the sending direction and the auto-negotiation code stream in the receiving direction are parsed to obtain the sending direction parsing result and the receiving direction parsing result of the auto-negotiation code stream; through the adjustment module, based on the correlation between the echo random number field and the transmit random field of the auto-negotiation code, the sending direction parsing result and the receiving direction parsing result of the auto-negotiation code stream are phase-aligned to obtain corresponding protocol analysis results. Among them, the sending direction parsing result is the parsing result corresponding to the auto-negotiation code stream in the sending direction, and similarly, the receiving direction parsing result is the parsing result corresponding to the auto-negotiation code stream in the receiving direction.

[0237] Among them, the association relationship between the echo random number field of the auto-negotiation code and the transmission random field includes: when the confirmation field of the auto-negotiation code in the receiving direction indicates that the peer chip instructs that the auto-negotiation code sent by the local chip meets the requirements, the value of the echo random number field of the auto-negotiation code in the receiving direction is the same as the value of the transmission random field of the auto-negotiation code in the previous page in the sending direction; when the confirmation field of the auto-negotiation code in the sending direction indicates that the local chip instructs that the auto-negotiation code sent by the peer chip meets the requirements, the value of the echo random number field of the auto-negotiation code in the sending direction is the same as the value of the transmission random field of the auto-negotiation code in the previous page in the receiving direction. Further, when the determination field of the auto-negotiation code in the receiving direction indicates that the peer chip instructs that the auto-negotiation code sent by the local chip does not meet the requirements, the value of the echo random number field of the auto-negotiation code in the receiving direction is a set value; similarly, when the determination field of the auto-negotiation code in the sending direction indicates that the local chip instructs that the auto-negotiation code sent by the peer chip does not meet the requirements, the value of the echo random field of the auto-negotiation code in the sending direction is a set value.

[0238] For the link training code stream in the sending direction and the link training code stream in the receiving direction, through the parsing module, based on the data structure of the link training code stream, the link training code stream in the sending direction and the link training code stream in the receiving direction are parsed to obtain the parsing result in the sending direction and the parsing result in the receiving direction of the link training code stream; through the adjustment module, based on the association relationship between the link training code stream in the sending direction and the link training code stream in the receiving direction, the parsing result in the sending direction and the parsing result in the receiving direction of the link training code stream are phase-aligned to obtain the corresponding protocol analysis result.

[0239] Further, in a possible implementation manner, the analysis function module further includes a storage module, and stores the transmission data obtained based on the code stream in the sending direction and the code stream in the receiving direction into the storage module; in response to an output instruction, through the output module, outputs the transmission data stored in the storage module, so as to facilitate determining link problems based on the transmission data; where the output instruction is an instruction for requesting the transmission data stored in the output module.

[0240] When the transmission data is: the code stream in the sending direction and the code stream in the receiving direction, in response to the first output instruction, through the output module, outputs the code stream in the sending direction and the code stream in the receiving direction stored in the storage module, so as to facilitate determining link problems based on the code stream in the sending direction and the code stream in the receiving direction. Where the first output instruction is an instruction for requesting the code stream in the sending direction and the code stream in the receiving direction stored in the storage module.

[0241] When the transmitted data is the corresponding protocol analysis result obtained by the parsing module and the adjustment module, in response to the second output instruction, the corresponding protocol analysis result stored in the storage module is output through the output module, so as to determine the link problem based on the protocol analysis result. The second output instruction is an instruction used to request the output of the corresponding protocol analysis result stored in the storage module.

[0242] An embodiment of the present application provides a link protocol analysis method, which is applied to a network chip including a network protocol interface, and the network chip is integrated with an analysis function module, and the analysis function module communicates with the network protocol interface. Through the acquisition module, the transmission information of the network protocol interface is acquired, and the transmission information includes the code stream in the sending direction and the code stream in the receiving direction of the network protocol interface; through the output module, the transmission data obtained based on the code stream in the sending direction and the code stream in the receiving direction is output, so as to determine the link problem based on the transmission data. The present application realizes the process recording of the physical layer code stream through the analysis function module, that is, records the transmission process of the physical layer code stream as comprehensively as possible, so that the transmission data obtained based on the code stream in the sending direction and the code stream in the receiving direction can reflect the dynamic change situation of the physical layer code stream during the transmission process, that is, can interpret the entire process of link communication, thereby enabling accurate fault diagnosis of link connection problems and accurate judgment of link test results.

[0243] In addition, an embodiment of the present application also provides a network chip, which includes: a network protocol interface and an analysis function module, and the analysis function module communicates with the network protocol interface. The analysis protocol interface is used to implement the link protocol analysis method in the above embodiment, and the output module in the analysis function module is a preset export interface on the network chip; the acquisition module in the analysis function module can be implemented by running a corresponding program based on a processing core, running a corresponding code through a field programmable gate array (FPGA), or hardened hardware. Further, the storage module of the analysis function module can be a cache of the network chip or a memory of the network chip. The parsing module and the adjustment module of the analysis function module are generally implemented by running a corresponding program based on a processing core or running a corresponding code through an FPGA.

[0244] An embodiment of the present application also provides a computing device, which includes: a network chip, and the network chip includes: a network protocol interface and an analysis function module, and the analysis function module communicates with the network protocol interface; the analysis function module is used to implement the link protocol analysis method in the above embodiment. Exemplarily, the computing device includes: a server, a personal computer (PC), a laptop computer, an embedded processor, a network switch, etc.

[0245] The embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored. When the computer program runs on a computer, the computer is caused to execute the link protocol analysis method in the above embodiments.

[0246] For the explanations and beneficial effects descriptions of the relevant content in any of the above-provided computer-readable storage media, reference can be made to the corresponding embodiments above, and details are not repeated here.

[0247] The embodiments of the present application further provide a computer program product containing instructions. When the instructions run on a computer, the computer is caused to execute any of the link protocol analysis methods in the above embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or a wireless manner (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains one or more integrated media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as an SSD), etc.

[0248] It should be noted that the devices for storing computer instructions or computer programs provided in the embodiments of the present application, such as but not limited to, the above-mentioned memory, computer-readable storage medium, and communication chip, etc., are all non-transitory.

[0249] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that the computer can access or a data storage device such as a server or data center that contains one or more media integrated therein. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc.

[0250] Although the present application has been described in conjunction with various embodiments, however, in the process of implementing the claimed present application, those skilled in the art can understand and implement other variations of the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "one" does not exclude a plurality. A single processor or other unit can implement several functions recited in the claims. Certain measures are recited in mutually different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0251] Although the present application has been described in conjunction with specific features and their embodiments, it is obvious that various modifications and combinations can be made without departing from the spirit and scope of the present application. Accordingly, the present specification and the drawings are merely exemplary descriptions of the present application defined by the appended claims, and are considered to have covered any and all modifications, variations, combinations, or equivalents within the scope of the present application. Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these changes and modifications.

Claims

1. A link protocol analysis method, characterized in that: Applied to a network chip including a network protocol interface, the network chip is integrated with an analysis function module, the analysis function module communicates with the network protocol interface, the analysis function module includes: a collection module and an output module, the method includes: Collecting transmission information of the network protocol interface through the acquisition module, wherein the transmission information includes a code stream in a sending direction and a code stream in a receiving direction of the network protocol interface; The output module outputs transmission data obtained based on the code stream in the sending direction and the code stream in the receiving direction, so as to determine the link problem based on the transmission data.

2. The method according to claim 1, characterized in that The transmission data is the code stream in the sending direction and the code stream in the receiving direction, and the outputting of the transmission data obtained based on the code stream in the sending direction and the code stream in the receiving direction by the output module includes: The code stream in the sending direction and the code stream in the receiving direction are output through the output module, so as to determine the link problem based on the code stream in the sending direction and the code stream in the receiving direction.

3. The method according to claim 2, characterized in that The analysis function module further includes: a storage module, and the method further includes: The code stream in the sending direction and the code stream in the receiving direction collected by the collection module are stored in the storage module; The step of outputting the code stream in the sending direction and the code stream in the receiving direction through the output module includes: In response to a first output instruction, the code stream in the sending direction and the code stream in the receiving direction stored in the storage module are output through the output module, so as to determine the link problem based on the code stream in the sending direction and the code stream in the receiving direction; wherein the first output instruction is an instruction for requesting the output of the code stream in the sending direction and the code stream in the receiving direction.

4. The method according to claim 1, characterized in that The analysis function module further includes: a parsing module and an adjustment module. Before the output module outputs the transmission data obtained based on the code stream in the sending direction and the code stream in the receiving direction, the method further includes: The code stream in the sending direction and the code stream in the receiving direction are parsed by the parsing module to obtain parsing results corresponding to the code stream in the sending direction and the code stream in the receiving direction respectively; The adjustment module is used to phase-align the analysis results corresponding to the code stream in the sending direction and the code stream in the receiving direction to obtain corresponding protocol analysis results; the corresponding protocol analysis results are the transmission data.

5. The method according to claim 4, characterized in that The analysis function module further includes: a storage module, and the method further includes: Storing the corresponding protocol analysis result in the storage module; Outputting the transmission data obtained based on the code stream in the sending direction and the code stream in the receiving direction through the output module includes: In response to a second output instruction, the corresponding protocol analysis result is output through the output module, so as to determine the link problem based on the corresponding protocol analysis result; wherein the second output instruction is an instruction for requesting the output of the protocol analysis result.

6. The method according to claim 4 or 5, characterized in that: The network protocol interface supports the BASE-KR link protocol, and the code stream in the sending direction and the code stream in the receiving direction include: an auto-negotiation code stream in the sending direction and an auto-negotiation code stream in the receiving direction; The parsing module parses the code stream in the sending direction and the code stream in the receiving direction to obtain parsing results corresponding to the code stream in the sending direction and the code stream in the receiving direction, respectively, including: By means of the analysis module, based on the data structure of the auto-negotiation code, the auto-negotiation code stream in the sending direction and the auto-negotiation code stream in the receiving direction are analyzed to obtain a sending direction analysis result and a receiving direction analysis result of the auto-negotiation code stream; The adjusting module phase-aligns the analysis results corresponding to the code stream in the sending direction and the code stream in the receiving direction to obtain corresponding protocol analysis results, including: Through the adjustment module, based on the association between the echo random number field and the sending random field of the self-negotiation code, the sending direction analysis result and the receiving direction analysis result of the self-negotiation code stream are phase-aligned to obtain the corresponding protocol analysis result.

7. The method according to claim 6, characterized in that The association relationship between the echo random number field and the sending random field of the auto-negotiation code includes: When the confirmation field of the auto-negotiation code in the receiving direction indicates that the auto-negotiation code sent by the local end meets the requirements, the value of the echo random number field of the auto-negotiation code in the receiving direction is consistent with the value of the sending random field of the auto-negotiation code in the sending direction on the previous page; when the confirmation field of the auto-negotiation code in the sending direction indicates that the auto-negotiation code sent by the local end meets the requirements, the value of the echo random number field of the auto-negotiation code in the sending direction is the same as the value of the sending random field of the auto-negotiation code in the receiving direction on the previous page.

8. The method according to claim 6, characterized in that The code stream in the sending direction and the code stream in the receiving direction further include: a link training code stream in the sending direction and a link training code stream in the receiving direction; The parsing module parses the code stream in the sending direction and the code stream in the receiving direction to obtain parsing results corresponding to the code stream in the sending direction and the code stream in the receiving direction, respectively, including: By means of the analysis module, based on the data structure of the link training code, the link training code stream in the sending direction and the link training code stream in the receiving direction are analyzed to obtain the analysis result of the link training code stream in the sending direction and the analysis result of the link training code stream in the receiving direction; The adjusting module phase-aligns the analysis results corresponding to the code stream in the sending direction and the code stream in the receiving direction to obtain corresponding protocol analysis results, including: Through the adjustment module, based on the association between the link training code stream in the sending direction and the link training code in the receiving direction, the sending direction analysis result and the receiving direction analysis result of the link training code stream are phase aligned to obtain the corresponding protocol analysis result.

9. A network chip, characterized in that: include: A network protocol interface and an analysis function module, wherein the analysis function module communicates with the network protocol interface, and the analysis function module is used to implement the link protocol analysis method as described in any one of claims 1-8, and the output module in the analysis function module is a preset export interface on the network chip.

10. A computing device, characterized in that include: A network chip, the network chip comprising: a network protocol interface and an analysis function module, the analysis function module communicating with the network protocol interface; The analysis function module is used to implement the link protocol analysis method as described in any one of claims 1-8.

Citation Information

Cited By

  • Method for realizing link auto-negotiation based on Ethernet protocol

    CN121750765A