WO2021027420A1 - Method and device used for transmitting data - Google Patents
Method and device used for transmitting data Download PDFInfo
- Publication number
- WO2021027420A1 WO2021027420A1 PCT/CN2020/099391 CN2020099391W WO2021027420A1 WO 2021027420 A1 WO2021027420 A1 WO 2021027420A1 CN 2020099391 W CN2020099391 W CN 2020099391W WO 2021027420 A1 WO2021027420 A1 WO 2021027420A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- information
- network device
- message
- function
- packet
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0631—Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0677—Localisation of faults
Definitions
- This application relates to the field of communication technology, and more specifically, to a method and device for data transmission.
- the network device obtains the message, and carries the data of each network element on the transmission path through which the message passes in the message, and finally carries it to the end of the path, thereby obtaining end-to-end network performance
- the data can be used to measure and evaluate network delay and network congestion.
- the data bandwidth required in the service message will be expanded, which consumes a large amount of network bandwidth.
- This application provides a method and device for data transmission, which can improve the performance of network equipment fault diagnosis.
- a method for data transmission includes: a network device obtains a first packet; the network device determines first information corresponding to the first packet, and the first information indicates that the network device The first stage of processing the first message; after the network device determines the first information, it saves the first information; after the network device determines the first information, it processes the first message according to the first information; the network After the device processes the first message, the network device avoids sending the first message to the outside of the network device.
- the network device after determining the first information corresponding to the first packet, performs and saves the first information on the obtained first packet, so that when the network device fails, the fault can be accurately located based on the first information.
- the network device processes the first message according to the first information, and after processing the first message, avoids sending the first message to the outside of the network device, avoiding data bandwidth expansion and saving links Bandwidth, thereby improving the performance of network equipment fault diagnosis.
- the first message may be obtained by the network device through an Ethernet interface, and the first message includes the original data message and diagnosis control information.
- the first message may also be a fictitious data message and diagnosis control information consistent with the original data message constructed by the central processing unit CPU.
- the network device may include a three-state content-addressable memory
- the central processing unit CPU configures the three-state content-addressable memory
- the configured three-state content-addressable memory includes identification information consistent with the original data message and diagnostic control Information
- the network device obtains the original data message, the original data message passes through the tri-state content addressing memory, and if it matches the identification information of the original data message successfully, the tri-state content addressing memory outputs the first message, the The first message includes the original data message and diagnostic control information.
- the method further includes: the network device determines second information corresponding to the first packet, and the second information indicates that the network device responds to the first packet.
- the second stage of message processing, the second stage is later than the first stage; the network device saves the second information after determining the second information; the network device saves the third information, and the third information indicates the The stage corresponding to the second information is later than the stage corresponding to the first information; wherein the network device processes the first message according to the first information, including: the network device processes the first message according to the first information and the second information Process the first message.
- the first information and the second information may be information pre-stored in the network device.
- the first information and the second information may be information contained in a computer program stored in a network device, or information contained in a non-computer program (for example, a forwarding table) stored in a network device, where:
- the network device can be a router or a switch, and the forwarding table can be a router or a media access control (MAC) table.
- MAC media access control
- the network device processes the first message according to the first information and the second information, including: the network device determines by looking up at least two tables A first action, the at least two tables include a first table and a second table, the second table is the next table of the first table; and the network device performs the first action on the first packet; wherein , The first information is the identifier of the first table, the second information is the identifier of the second table, and the third information is used to indicate that the second table corresponding to the second information is the first table corresponding to the first information. The next table of the table.
- the network device processing the first message according to the first information and the second information includes: the network device executes at least two functions , Determine a first action, the at least two functions include a first function and a second function, the second function is the next function of the first function; and, the network device performs the first action on the first message ;
- the first information is the identification of the first function
- the second information is the identification of the second function
- the third information is used to indicate that the second function corresponding to the second information is the corresponding The next function of the first function.
- the method before the network device determines the first action by looking up at least two tables, the method further includes: the network device according to the search result of the first table and the first action The message determines the second table.
- the network device After the network device obtains the first message, it processes the data message in the first message. For example, the data message performs table lookup processing to obtain table item return information. Furthermore, the information is processed by at least two functions to obtain the function The network device samples the output result according to the diagnostic control information in the first message to obtain the first information, and saves the first information.
- the first information may include identification information of at least two tables searched by the data packet and input parameters of the processed function.
- the identification information of the table can know the forwarding path of the data message.
- the fault can be accurately located according to the identification information of the table in the first information and the input parameters of the function, thereby improving the fault diagnosis performance of the network device.
- the first message includes the port identifier, the first type, and the first message header; the network device processes the first message, Including: the network device determines the computer program corresponding to the port according to the port identifier; the network device processes the first packet header by executing the computer program corresponding to the port, and multiple pieces of information are passed through the first packet header. Obtained by processing the packet header, the pieces of information include the first information; the network device stores the first information according to the first type, and the first information belongs to the first type.
- the data message in the first message is processed by table lookup and function.
- the processed data message is processed according to the diagnostic control information in the first message to obtain the corresponding first information, and the first information is stored in In the memory.
- the first message further includes first indication information, and the first indication information is used to instruct the network device to determine the connection with the port according to the port identifier.
- the first indication information is also used to instruct the network device to save the first information according to the first type.
- the first indication information is further used to instruct the network device to avoid sending the first packet to the outside of the network device.
- the network device After determining the first information corresponding to the first packet, the network device saves the first information, and processes the first packet according to the first information. At the exit of the network device, it is necessary to determine whether to send the data message to the outside of the network device. If the data message is an original data message, the first message discards the diagnostic control information and sends the original data message to the outside of the network device; if the data message is a fictitious data message, the first message A message cannot be sent to the outside of the network device. Thus avoiding data bandwidth expansion and saving link bandwidth.
- a device for data transmission includes: an acquiring unit configured to acquire a first message; a processing unit configured to determine first information corresponding to the first message, and the first information Instruct the network device to process the first stage of the first message; the processing unit is also used to save the first information after determining the first information; the processing unit is also used to determine the first information according to The first information processes the first message; the processing unit is further configured to avoid sending the first message to the outside of the network device after processing the first message.
- the processing unit is further configured to: determine second information corresponding to the first packet, and the second information instructs the network device to respond to the first packet.
- the second stage of document processing the second stage is later than the first stage; after the second information is determined, the second information is saved; the third information is saved, and the third information indicates that the stage corresponding to the second information is later
- the processing unit is specifically configured to: process the first message according to the first information and the second information.
- the processing unit is specifically configured to: determine the first action by looking up at least two tables, the at least two tables including the first table and the second table , The second table is the next table of the first table; and, the first action is performed on the first message; wherein, the first information is the identifier of the first table, and the second information is the second The table identifier and the third information are used to indicate that the second table corresponding to the second information is the next table of the first table corresponding to the first information.
- the processing unit is specifically configured to: determine the first action by executing at least two functions, the at least two functions including the first function and the second function , The second function is the next function of the first function; and, the first action is performed on the first message; wherein the first information is the identifier of the first function, and the second information is the second The identifier of the function and the third information are used to indicate that the second function corresponding to the second information is the next function of the first function corresponding to the first information.
- the processing unit is further configured to determine the second table according to the search result of the first table and the first message.
- the processing unit is further configured to: determine the second table according to the search result of the first table and the first message.
- the first message includes the port identifier, the first type, and the first message header; the processing unit is specifically configured to: according to the port identifier, Determine the computer program corresponding to the port; process the first packet header by executing the computer program corresponding to the port, and multiple pieces of information are obtained by processing the first packet header, and the multiple pieces of information include The first information; according to the first type, the first information is stored, and the first information belongs to the first type.
- the first message further includes first indication information, and the first indication information is used to instruct the network device to determine the connection with the port according to the port identifier.
- the first indication information is also used to instruct the network device to save the first information according to the first type.
- the first indication information is also used to instruct the network device to avoid sending the first packet to the outside of the network device.
- a network device including a processor and a memory.
- the memory is used to store a computer program
- the processor is used to call and run the computer program stored in the memory, so that the network device executes the foregoing first aspect or the method in any possible implementation manner of the first aspect.
- the network device further includes a transceiver. Further optionally, there are one or more processors.
- the memory is one or more.
- the foregoing memory may be integrated with the processor, or the memory and the processor may be provided separately.
- the aforementioned transceiver may include a receiver and/or a transmitter.
- the present application provides a system for data transmission, and the system includes the network device described in the third aspect.
- this application provides a computer-readable medium for storing a computer program, and the computer program includes instructions for executing the first aspect or any possible implementation of the first aspect.
- a chip in which instructions are stored, when running on a receiving device, the chip is made to execute the method in the first aspect or any possible implementation of the first aspect.
- the chip further includes a memory, and the memory and the processor are connected to the memory through a circuit or a wire.
- the chip also includes a communication interface.
- a computer program product includes: computer program code, when the computer program code is executed by the communication unit or communication interface, and the processing unit or processor of the receiving device, the sending device is executed The first aspect or the method in any possible implementation of the first aspect.
- Figure 1 shows a schematic diagram of INT/IOAM forwarding
- Figure 2 shows an architecture diagram applicable to an embodiment of the present application
- FIG. 3 is a schematic flowchart of a method for data transmission provided by an embodiment of the present application.
- Figure 4 is a schematic diagram of the format of the first message
- FIG. 5 shows a schematic block diagram for obtaining first information according to an embodiment of the present application
- FIG. 6 shows another architecture diagram applicable to the embodiments of the present application.
- FIG. 7 shows another architecture diagram applicable to the embodiments of the present application.
- Fig. 8 is a schematic block diagram of an apparatus for data transmission according to the present application.
- Fig. 9 is a schematic block diagram of a network device used for data transmission in the present application.
- FIG. 1 shows a schematic diagram of INT/IOAM forwarding.
- the initial message is composed of a transport header and a payload.
- INT/IOAM carries the data of all nodes on the path that it passes through in the initial message, and sends it to the next node until the data at the end node of the path is carried in the initial message.
- the transmission path of the initial message is node A-node B-node E.
- the data 0 of node A is carried in the initial message to form a new message, and the generated new message is transmitted to node B.
- the data 1 of node B is carried in the message received by node B and transmitted to node E.
- the data 2 of node E is carried in this message.
- Node E is the end node. Node E sends a new message carrying the data of node A, node B, and node E to the INT/IOAM system for data processing.
- the initial message carries the data of the path traversed. Specifically, it may be data of nodes on the path. When the path has more nodes or the data size is too large, the size of the message transmitted on the path is larger. Larger packets need to occupy a larger data bandwidth. Increase bandwidth consumption. In addition, in the process of service flow transmission, when a network fails, the fault needs to be accurately located.
- a related technology provides a means of obtaining forwarding behavior in a single step. The single-step operation is based on the instruction operation mechanism to gradually collect and forward data to locate the business. During single-step operation, normal business may not be processed. Thus causing normal business interruption.
- the embodiments of the present application provide a method for data transmission, which can improve the performance of network device fault diagnosis.
- Figure 2 shows an architecture diagram applicable to an embodiment of the present application.
- the trigger source triggers diagnosis for a specific service, generates diagnosis control information that can control the network device to process the service to be diagnosed, and transmits the control information to be diagnosed to the subsequent processing unit.
- Each level of processing unit includes a diagnosis module for identifying the diagnosis indication information. While the business is running normally, data collection is performed on the business to be diagnosed through the data bus bypass based on the diagnosis control information. Store the data collected at each level in the diagnostic data memory. Perform fault analysis based on collected business data to be diagnosed. By collecting data by bypassing the data bus, the impact of interruption to normal services can be reduced during fault diagnosis.
- FIG. 3 is a schematic flowchart of a method 300 for data transmission according to an embodiment of the present application.
- the method 300 is applicable to the architecture shown in FIG. 2.
- the method 300 includes steps S310 to S350, and each step in the method 300 will be described in detail below.
- S310 The network device obtains the first packet.
- the network device Before performing fault diagnosis of the network device, the network device obtains the first packet, where the network device may be a router, a network switch, a firewall, a load balancer, etc., which is not limited in the embodiment of the present application.
- the first message is composed of two parts, an original data message and diagnostic control information.
- the external port of the network device receives the original data message.
- the original data message received by the external port enters the trigger source, and the trigger source generates diagnostic control information for specific services, so that the original data message obtains the first message after passing through the trigger source.
- the trigger source is a component in the network device, which can be the ternary content addressable memory (TCAM) mentioned below, or it can be in the central processing unit (CPU).
- TCAM ternary content addressable memory
- CPU central processing unit
- a program solidified in used to start the monitoring, and the user triggers to send a message.
- Figure 4 shows the format of the first message.
- the first message includes four parts, namely, an Ethernet (Ethernet, ETH) header, a control header (control header), a packet header (packet header), and a packet payload (packet payload).
- the header and the message header are the parts that must be carried, and the ETH header and the packet payload are optional.
- the first message when the first message is sent to the network device through the ETH link, the first message needs to carry the ETH header before the control header. In some embodiments, when the first message does not need to be sent to the network device through the ETH link, the first message does not need to carry an ETH header.
- the control header includes diagnostic control information, and the diagnostic control information is used to control the diagnostic module in the network device to process the data message in the first message.
- the diagnosis control information includes diagnosis instruction information, and the diagnosis instruction information is used for the network device to identify the data to be diagnosed and start data collection processing of the service to be diagnosed. For example, when the diagnosis indication information is 1, the data collection process for the service to be diagnosed is started, and when the diagnosis indication information is 0, the data collection process for the diagnosis service is not started.
- the above method of starting the data collection and processing of the first message according to the diagnosis indication information is only for the convenience of description, and there may be other ways of indicating the diagnosis information, as long as it can accurately indicate whether to start the data collection and processing of the first message.
- the embodiment of the present application does not limit this.
- control header of the first packet further includes first indication information, that is, forwarding basic information, which is used to classify services of the network device.
- first indication information may include information such as source port and forwarding domain.
- the control header of the first message further includes a first type, that is, a data type, which is used to indicate what kind of data the network device collects.
- a data type which is used to indicate what kind of data the network device collects.
- different data types correspond to different collected data information.
- the data types in the first message are classified into table item forwarding data, processing data 1, and processing data 2.
- the data type is 1, it means the forwarding data of the collection table entry, when the data type is 2, it means the processing data 1 is collected, and when the data type is 3, it means the processing data 2 is collected, or when the data type is When 0, it means to collect all types of data in the first message.
- the above data type information instructs the network device to collect the corresponding type of data only for convenience of description, and there may be other indication methods, as long as it can clearly indicate which type of data to collect, this embodiment of the application does not limit this .
- S320 The network device determines first information corresponding to the first packet, and the first information indicates the first stage of processing the first packet by the network device.
- the first stage of processing the first packet by the network device can be understood as the first processing of the first packet by the network device, for example, the first packet searches the first table.
- the network device determines the first information according to the port information of the received first packet. For example, the network device determines the computer program corresponding to the first message according to the port information included in the first message, where the computer program includes the first information.
- the network device determines the first information according to the fields in the first message. For example, the network device searches the routing table according to the destination IP address in the first packet to obtain an entry that matches the destination IP address, where the matching entry includes the first information.
- the network device After determining the first information, the network device saves the first information.
- the network device After determining the first information corresponding to the first packet, the network device stores the first information in the memory.
- the network device After determining the first information, the network device processes the first packet according to the first information.
- the network device includes at least one inlet pipe, such as inlet pipe 1, inlet pipe 2, ... inlet pipe n, and each inlet pipe includes a diagnostic module. After the network device obtains the first message, it processes the original data message in the first message according to the determined first information.
- the network device determines second information corresponding to the first packet, and the second information indicates a second stage of processing the first packet by the network device, wherein the second stage is later than the first stage. After determining the second information, the network device saves the second information.
- the first information and the second information may be information pre-stored in the network device.
- the first information and the second information may be information contained in a computer program stored in a network device, or information contained in a non-computer program (for example, a forwarding table) stored in a network device, where:
- the network device can be a router or a switch, and the forwarding table can be a router or a media access control (MAC) table.
- MAC media access control
- the network device may also store third information, where the third information indicates that the phase corresponding to the second information is later than the phase corresponding to the first information, which is not limited in this embodiment of the application.
- the first action may include deleting a header in the first message, deleting at least one field in the first header in the first message, and calculating the sum check code of the first message ( checksum), subtract one from the time to live (TTL) value of the first message, add a message header to the first message, or determine the physical or logical egress port of the first message.
- the first information is the identifier of the first table
- the second information is the identifier of the second table
- the third information is used to indicate that the second table corresponding to the second information is the next table of the first table corresponding to the first information.
- the network device determines the first table searched by the first packet according to the port identification information included in the first packet, and obtains the entry data after searching the first table.
- the network device The second table searched by the first packet is determined according to the entry data returned by the first table and the entry information of the first packet.
- the network device when the network device receives the first message, the network device needs to determine the forwarding path of the first message in these four tables, that is, the first message is in the four tables. Whether the forwarding path in the chip is ABCD or ACBD.
- the network device first determines that the first table searched by the first packet is table A according to the port identification information included in the first packet, and then the network device searches the first table (ie, table A) according to the first packet and returns The entry data and the port identification information of the first message determine that the next table of table A is table B, and so on, the next table of table B is table C, and the next table of table C is table D, so It is determined that the table lookup order of the first message in the chip is ABCD. During the table lookup process, the network device saves the identification information (ie, the first information and the second information) of the table of the first message lookup table, which is used to indicate the path for the network device to process the first message. When a chip fails, the forwarding path of the first packet inside the chip can be clearly known according to the stored first information, so as to realize accurate fault location.
- the identification information ie, the first information and the second information
- the entry data is further processed by at least two functions to obtain the execution results of the at least two functions.
- the network device determines the first action by executing at least two functions, the at least two functions including a first function and a second function, the second function is the next function of the first function; and the network device performs the first action
- the message performs the first action; where the first information is the identifier of the first function, the second information is the identifier of the second function, and the third information is used to indicate that the second function corresponding to the second information is The next function of the first function corresponding to the first information.
- the processed original data message is transmitted through the data bus between each level of ingress pipelines inside the network device.
- the diagnostic module processes the processed data message according to the diagnostic control information in the first message to obtain the first information, that is, the diagnostic module hangs on each level of the data bus, and the network device responds to the waiting data according to the diagnostic control information.
- Diagnosis business data collection while not occupying normal business data processing bandwidth, an additional part of processing is added to monitor the processing of normal business data, so as to achieve fault diagnosis without affecting normal business.
- FIG. 5 shows a schematic block diagram for obtaining first information according to an embodiment of the present application.
- the data type of the processed original data message includes table item return data, processing data 1 to processing data n (n is a positive integer greater than or equal to 1), and the diagnostic control information includes data type information (ie The first type) and collection indication information, where the collection indication information indicates whether to perform data collection, for example, when the collection indication information flag is 1, it indicates that data collection is required; when the collection indication information flag is 0 When, it means that data collection is not required.
- the network device collects corresponding data in the processed original data message according to the data type in the diagnosis control information. For example, if the data type is 1, the table item of the collected data type is 1 returns data, and the data type is 2, the processing data of the collected data type is 2 (for example, the data processed by the function), or the collected data type is 0, All types of data are collected.
- the network device obtains the first information after collecting data according to the diagnosis control information.
- the first information includes the type of collected data, indicating which type of data the currently collected data is; when the network device includes a multi-level diagnostic module, the first information also includes the collection address, which is used to indicate the currently collected data. Collected by the first-level diagnostic module.
- the first information may not include the collection address.
- the type, length, value (TLV) of the diagnostic control information defines the type of collected data, and the network device performs data collection on the processed original data message according to the diagnostic control information
- TLV type, length, value
- data collection can be performed on the processed original data messages by way of data bus bypass.
- the first information may include the identification of the first table
- the second information may include the identification of the second table
- the network device uses the first field in the first message as a search key to find in the lookup table whether there is an entry that matches the first field. If there is an entry that matches the first field in the first packet in the table searched by the network device, the first information includes the identifier of the first entry, where the first entry is the same as that of the first packet The entry that matches the first field in. If there is no entry that matches the first field in the first message in the table searched by the network device, the first information includes the identifier of the lookup table.
- accurate fault location can be performed based on the identification of the first entry in the first information or the identification of the look-up table, thereby improving the performance of fault diagnosis of the network device.
- the content of the verification table is consistent with the content of the lookup table.
- the memory storing the look-up table fails, the contents of the look-up table stored on the memory may change.
- the matching field of the first entry that has not changed may not be equal to the matching field of the first entry that has changed.
- the network device can use the verification table to verify whether the first entry has changed. If the result of the verification is that the first entry has changed, it can be determined that the memory is faulty.
- the first information may also include the identifier of the first entry and the information used to indicate that the memory is faulty.
- the memory failure can be determined according to the identifier of the first entry in the first information and the information indicating the memory failure and the failure can be accurately located, thereby improving the performance of network device failure diagnosis.
- the first message further includes first indication information, where the first indication information is used to instruct the network device to determine the computer program corresponding to the port according to the port identifier.
- the network device For example: instruct the network device to obtain the destination media access control (MAC) address from the Ethernet frame header, and instruct the network device to use the destination MAC address as the search key to search for the matching entry in the MAC table, and indicate the matching Obtain the information of the outgoing port or the next hop from the table entry.
- MAC media access control
- the computer program for processing the Ethernet frame may include the computer program for processing the IP message
- the first indication information is also used to instruct the network device to obtain the destination IP address from the IP header, and instruct the network device to use the destination IP address
- the matching entry is searched in the routing table and the port information or next hop information is obtained from the matching entry.
- the first information may also include input parameters.
- the at least two functions include a first function and a second function, wherein the first parameter is obtained by the network device executing the first function, and the first parameter is the network device
- the input parameters used to execute the second function are stored in the first information.
- the network device may be a router.
- the router includes a network processor and a memory.
- a computer program is stored in the memory.
- the network processor may process the original data message by executing the computer program.
- the computer program includes the first function and the second function.
- the original data message is an Ethernet frame.
- the Ethernet frame and the frame check sequence (FCS) field are received by the router.
- the first function is used to calculate the FCS number according to the Ethernet frame.
- the first parameter is FCS number.
- the second function is used to determine whether an error occurs in the Ethernet frame during transmission according to the number contained in the FCS field and the FCS number calculated according to the first function.
- the network device can instruct the network device according to the first instruction information before the outlet pipe of the terminal device Avoid sending the diagnostic control information in the first message to the outside of the network device.
- a 1-bit (bit) field is reserved in the control header of the first message to indicate whether the data message in the first message is a real data message or a fictitious data message.
- bit when the first indication information flag bit is 1, it means that the original data message is a real data message, and the network device needs to forward the original data message to the external interface through the egress pipe; when the first indication information flag When the bit is 0, it means that the data message is a fictitious data message, and the network device does not need to send the fictitious data message to the outside of the network device.
- FIG. 6 shows another architecture diagram applicable to the embodiments of the present application.
- the trigger source may be a data message consistent with the original data message, which is constructed by a controller (for example, a central processing unit (CPU)) and directly inserted into the chip.
- a controller for example, a central processing unit (CPU)
- S310 may be that the first message is constructed by the controller, where the first message includes a fictitious data message and diagnostic control information constructed by the controller and consistent with the original data message.
- the header of the fictitious data message is consistent with the header of the original data message.
- the fictitious data message and the original data message have the same MAC Information, the same Internet protocol (IP) quintuple information, etc.
- the first message constructed by the controller enters the network device for processing.
- steps S320 to S350 which will not be repeated here.
- the data message in the first message is a fictitious data message in the architecture diagram shown in FIG. 6, it is necessary to discard all the fictitious data message and diagnostic control information at the exit of the network device. For example, the network device deletes the fictitious data message and diagnostic control information without sending it to the outside of the network device, thereby avoiding data bandwidth expansion and saving link bandwidth.
- FIG. 7 shows another architecture diagram applicable to the embodiments of the present application.
- the trigger source may be a ternary content addressable memory (TCAM) set on the ingress data channel of the network device.
- TCAM can be configured by the CPU.
- the CPU configures identification information (IP, MAC, etc.) and diagnostic control information consistent with the original data message to the TCAM.
- S310 may be that when a data message enters the TCAM, if the data message matches the identification information of the data message in the TCAM successfully, then the data message and the diagnostic control information constitute the first message, and the first message The message enters the network device for processing.
- the specific processing process please refer to steps S320 to S350, which will not be repeated here.
- the form of the trigger source is merely an example, and the embodiment of the present application does not limit this, as long as it can trigger a diagnosis for a specific service and generate diagnostic control information that meets the requirements.
- the device 800 includes an acquiring unit 810 and a processing unit 820.
- the obtaining unit 810 is used to obtain the first message.
- the first message includes three different forms of first messages shown in FIG. 2, FIG. 6 and FIG. 7 in the embodiment of the present application.
- the processing unit 820 is configured to determine first information corresponding to the first packet, the first information indicating the first stage of processing the first packet by the network device;
- the processing unit 820 is further configured to save the first information after determining the first information
- the processing unit 820 is further configured to process the first message according to the first information after determining the first information;
- the processing unit 820 is further configured to avoid sending the first message to the outside of the network device after processing the first message.
- the processing unit 820 is further configured to determine second information corresponding to the first packet, the second information indicating a second stage of processing the first packet by the network device, and the second stage is later than the The first stage;
- processing unit 820 is further configured to save the second information after determining the second information
- the first information and the second information may be information pre-stored in the network device.
- the first information and the second information may be information contained in a computer program stored in a network device, or information contained in a non-computer program (for example, a forwarding table) stored in a network device, where:
- the network device can be a router or a switch, and the forwarding table can be a router or a media access control (MAC) table.
- MAC media access control
- the processing unit 820 is further configured to store third information, the third information indicating that the stage corresponding to the second information is later than the stage corresponding to the first information;
- processing unit 820 is further specifically configured to process the first message according to the first information and the second information.
- the processing unit 820 is specifically configured to look up at least two tables and determine a first action, the at least two tables include a first table and a second table, and the second table is the next table of the first table; Perform the first action on the first message; wherein, the first information is the identifier of the first table, the second information is the identifier of the second table, and the third information is used to indicate the second information corresponding to the The second table is the next table of the first table corresponding to the first information.
- the processing unit 820 may be a network processor.
- the at least two tables are stored in a memory coupled to the network processor.
- the original data message may be an Ethernet frame.
- the original data message includes the Ethernet frame header and payload.
- the Ethernet frame header includes an Ethernet type (EtherType) field.
- the first table is used to determine whether the payload contains Internet Protocol version 4 (IPv4) packets.
- the matching field of the first table includes 0x0800.
- the action field of the first table includes the identifier of the second table.
- the identifier of the second table may be the storage address of the second table.
- the second table is used to determine the next hop of the IPv4 packet.
- the matching field of the second table includes the IPv4 prefix
- the action field of the second table includes the address of the next hop.
- the network processor uses the value of the EtherType field in the Ethernet frame header as a search key, and determines an entry matching the Ethernet frame in the first table. When the value of the EtherType field is 0x0800, the network processor determines that the payload contains an IPv4 packet. Furthermore, the network processor determines that the next table is the second table according to the first table. Furthermore, the network processor obtains the destination IP address from the payload. Using the destination IP address as a search key, search for an entry that matches the IPv4 packet in the second table. When the destination IP address matches the IPv4 prefix, the network processor determines the next hop corresponding to the IPv4 packet.
- the processing unit 820 is further specifically configured to determine the first action by executing at least two functions, the at least two functions including a first function and a second function, and the second function is the first function And perform the first action on the first message; wherein the first information is the identifier of the first function, the second information is the identifier of the second function, and the third The information is used to indicate that the second function corresponding to the second information is the next function of the first function corresponding to the first information.
- the processing unit is further configured to determine the second table according to the search result of the first table and the first message.
- the network device determines the first table searched by the first packet according to the port identification information included in the first packet, and obtains the entry data after searching the first table.
- the network device The second table searched by the first packet is determined according to the entry data returned by the first table and the entry information of the first packet.
- the network device when the network device receives the first message, the network device needs to determine the forwarding path of the first message in these four tables, that is, the first message is in the four tables. Whether the forwarding path in the chip is ABCD or ACBD.
- the network device first determines that the first table searched by the first packet is table A according to the port identification information included in the first packet, and then the network device searches the first table (ie, table A) according to the first packet and returns The entry data and the port identification information of the first message determine that the next table of table A is table B, and so on, the next table of table B is table C, and the next table of table C is table D, so It is determined that the table lookup order of the first message in the chip is ABCD. During the table lookup process, the network device saves the identification information (ie, the first information and the second information) of the table of the first message lookup table, which is used to indicate the path for the network device to process the first message. When a chip fails, the forwarding path of the first packet inside the chip can be clearly known according to the stored first information, so as to realize accurate fault location.
- the identification information ie, the first information and the second information
- the first message includes the first message including the port identifier, the first type, and the first message header.
- the processing unit 820 is also specifically configured to determine the computer program corresponding to the port according to the port identifier; by executing the computer program corresponding to the port, the first packet header is processed, and multiple pieces of information are passed through the first packet header.
- the pieces of information are obtained by processing the message header, and the pieces of information include the first information; the first information is stored according to the first type, and the first information belongs to the first type.
- the first message further includes first indication information, the first indication information is used to instruct the network device to determine the computer program corresponding to the port according to the port identifier; the first indication information is also used to indicate The network device saves the first information according to the first type.
- the first indication information is also used to instruct the network device to avoid sending the first packet to the outside of the network device.
- the network device after determining the first information corresponding to the first packet, saves the first information and processes the first packet according to the first information.
- the first information is used for network device failure analysis.
- the network device processes the first message, data bandwidth expansion is avoided, link bandwidth is saved, and the performance of network device fault diagnosis is improved.
- Figure 9 is a schematic diagram of a network device involved in this application.
- the network device 900 includes a memory 901, a transceiver 903, and a processor 902.
- the transceiver 903, the processor 902, and the memory 901 are connected through the bus system 905, the memory 901 is used to store instructions, and the processor 902 is used to execute the instructions stored in the memory 901 to control the transceiver.
- the device 903 receives or transmits signals.
- the present application also provides a computer-readable storage medium that stores instructions in the computer-readable storage medium.
- the computer executes each of the operations performed by the network device in the method shown in FIG. 3 above. step.
- This application also provides a computer program product containing instructions.
- the computer program product runs on a computer, the computer executes the steps performed by the network device in the method shown in FIG. 3.
- This application also provides a chip including a processor.
- the processor is used to read and run the computer program stored in the memory to execute the corresponding operation and/or process executed by the terminal device in the communication method provided by this application.
- the chip further includes a memory, the memory and the processor are connected to the memory through a circuit or a wire, and the processor is used to read and execute the computer program in the memory.
- the chip further includes a communication interface, and the processor is connected to the communication interface.
- the communication interface is used to receive data and/or information that needs to be processed, and the processor obtains the data and/or information from the communication interface, and processes the data and/or information.
- the communication interface can be an input and output interface.
- the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, rather than corresponding to the embodiments of the present application.
- the implementation process constitutes any limitation.
- the processor may be a central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more of them used to control the technology of the application Integrated circuits for program execution, etc.
- the processor may be a digital signal processor device, a microprocessor device, an analog-to-digital converter, a digital-to-analog converter, etc.
- the processor can distribute control and signal processing functions of terminal devices or network devices among these devices according to their respective functions.
- the processor may have the function of operating one or more software programs, and the software programs may be stored in the memory.
- the functions of the processor can be realized by hardware, or by hardware executing corresponding software.
- the hardware or software includes one or more modules corresponding to the above-mentioned functions.
- the memory can be read-only memory (ROM), other types of static storage devices that can store static information and instructions, random access memory (RAM), or other types that can store information and instructions
- Dynamic storage devices can also be electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM), or other optical disk storage, optical disc storage ( Including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program codes in the form of instructions or data structures and can Any other medium accessed by the computer, etc.
- EEPROM electrically erasable programmable read-only memory
- CD-ROM compact disc read-only memory
- optical disc storage Including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.
- magnetic disk storage media or other magnetic storage devices or can be used to carry or store desired program codes in the form of instructions or data structures and can Any other medium
- the memory and the memory involved in the foregoing embodiments may be physically independent units, or the memory may also be integrated with the processor.
- At least one refers to one or more
- multiple refers to two or more.
- And/or describes the association relationship of the associated objects, indicating that there can be three types of relationships, for example, A and/or B, which can mean that A exists alone, A and B exist at the same time, and B exists alone. Among them, A and B can be singular or plural.
- the character “/” generally indicates that the associated objects are in an “or” relationship.
- “The following at least one item” and similar expressions refer to any combination of these items, including any combination of single items or plural items.
- At least one of a, b, and c can represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple.
- the disclosed system, device, and method may be implemented in other ways.
- the device embodiments described above are merely illustrative, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation.
- multiple units or components can be combined or integrated into another system, or some features can be omitted or not implemented.
- the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
- the units described as separate components may not be physically separated, and the components displayed as units may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the technical solution of the present application.
- each unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
- the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
- the technical solution of this application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application.
- the aforementioned storage media include: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program code .
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Provided by the present application is a method used for transmitting data. The method comprises: a network device obtaining a first message; the network device determines first information corresponding to the first message, the first message indicating a first stage of the network device processing the first message; the network device saving the first information after determining the first information; the network device processing the first message according to the first information after determining the first information; and the network device avoiding sending the first message to the outside of the network device after the network device has processed the first message. The technical solution provided by the present application is capable of improving the fault diagnosis performance of the network device.
Description
本申请要求于2019年08月09日提交中国专利局、申请号为201910736136.1、名称为“用于数据传输的方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on August 9, 2019, with application number 201910736136.1, titled "Method and Device for Data Transmission", the entire content of which is incorporated into this application by reference .
本申请涉及通信技术领域,并且更具体地,涉及一种用于数据传输的方法和装置。This application relates to the field of communication technology, and more specifically, to a method and device for data transmission.
在现有的网络监测方法中,网络设备获取报文,并将该报文所经过的传输路径上各个网元的数据承载在报文中,最终携带到路径末端,从而获取端到端的网络性能数据,可用于网络延时、网络拥塞情况的测量和评估。但由于报文中承载大量的数据,会导致业务报文中所需的数据带宽膨胀,对网络带宽的消耗较大。同时,在这种端到端的业务分析过程中,难以实现在不影响正常业务的同时精准定位网络设备故障,降低了网络设备故障诊断的性能。In the existing network monitoring method, the network device obtains the message, and carries the data of each network element on the transmission path through which the message passes in the message, and finally carries it to the end of the path, thereby obtaining end-to-end network performance The data can be used to measure and evaluate network delay and network congestion. However, due to the large amount of data carried in the message, the data bandwidth required in the service message will be expanded, which consumes a large amount of network bandwidth. At the same time, in this kind of end-to-end service analysis process, it is difficult to accurately locate network device faults without affecting normal services, which reduces the performance of network device fault diagnosis.
因此,如何提高网络设备故障诊断的性能成为亟待解决的问题。Therefore, how to improve the performance of network device fault diagnosis has become an urgent problem to be solved.
发明内容Summary of the invention
本申请提供了一种用于数据传输的方法和装置,能够提高网络设备故障诊断的性能。This application provides a method and device for data transmission, which can improve the performance of network equipment fault diagnosis.
第一方面,提供了一种用于数据传输的方法,该方法包括:网络设备获得第一报文;网络设备确定所述第一报文对应的第一信息,该第一信息指示网络设备对该第一报文进行处理的第一阶段;网络设备确定第一信息后,保存该第一信息;网络设备确定第一信息后,根据该第一信息对该第一报文进行处理;该网络设备对第一报文进行处理后,网络设备避免将该第一报文发送至网络设备的外部。In a first aspect, a method for data transmission is provided. The method includes: a network device obtains a first packet; the network device determines first information corresponding to the first packet, and the first information indicates that the network device The first stage of processing the first message; after the network device determines the first information, it saves the first information; after the network device determines the first information, it processes the first message according to the first information; the network After the device processes the first message, the network device avoids sending the first message to the outside of the network device.
上述技术方案中,网络设备确定第一报文对应的第一信息后,对获得的第一报文进行并保存第一信息,使得在网络设备发生故障时,根据第一信息能够准确定位故障。另外,网络设备根据第一信息对第一报文进行处理,并在对第一报文进行处理后,避免将该第一报文发送至网络设备的外部,避免造成数据带宽膨胀,节省链路带宽,从而提高网络设备故障诊断的性能。In the above technical solution, after determining the first information corresponding to the first packet, the network device performs and saves the first information on the obtained first packet, so that when the network device fails, the fault can be accurately located based on the first information. In addition, the network device processes the first message according to the first information, and after processing the first message, avoids sending the first message to the outside of the network device, avoiding data bandwidth expansion and saving links Bandwidth, thereby improving the performance of network equipment fault diagnosis.
可选地,该第一报文可以为网络设备通过以太网接口获得的,该第一报文包括原始数据报文和诊断控制信息。Optionally, the first message may be obtained by the network device through an Ethernet interface, and the first message includes the original data message and diagnosis control information.
可选地,该第一报文还可以为中央处理器CPU构造的与原始数据报文一致的虚构数据报文和诊断控制信息。Optionally, the first message may also be a fictitious data message and diagnosis control information consistent with the original data message constructed by the central processing unit CPU.
可选地,网络设备可以包括三态内容寻址存储器,中央处理器CPU配置该三态内容寻址存储器,配置后的三态内容寻址存储器包括与原始数据报文一致的标识信息以及诊断控制信息,网络设备获得原始数据报文,该原始数据报文经过三态内容寻址存储器,若与原始数据报文的标识信息匹配成功,则该三态内容寻址存储器输出第一报文,该第一报文包括原始数据报文与诊断控制信息。Optionally, the network device may include a three-state content-addressable memory, the central processing unit CPU configures the three-state content-addressable memory, and the configured three-state content-addressable memory includes identification information consistent with the original data message and diagnostic control Information, the network device obtains the original data message, the original data message passes through the tri-state content addressing memory, and if it matches the identification information of the original data message successfully, the tri-state content addressing memory outputs the first message, the The first message includes the original data message and diagnostic control information.
结合第一方面,在第一方面的某些可能的实现方式中,该方法还包括:该网络设备确定该第一报文对应的第二信息,该第二信息指示该网络设备对该第一报文进行处理的第二 阶段,该第二阶段晚于该第一阶段;该网络设备在确定第二信息后,保存该第二信息;该网络设备保存第三信息,该第三信息指示该第二信息对应的阶段晚于该第一信息对应的阶段;其中,该网络设备根据该第一信息对该第一报文进行处理,包括:该网络设备根据该第一信息以及该第二信息对该第一报文进行处理。With reference to the first aspect, in some possible implementations of the first aspect, the method further includes: the network device determines second information corresponding to the first packet, and the second information indicates that the network device responds to the first packet. The second stage of message processing, the second stage is later than the first stage; the network device saves the second information after determining the second information; the network device saves the third information, and the third information indicates the The stage corresponding to the second information is later than the stage corresponding to the first information; wherein the network device processes the first message according to the first information, including: the network device processes the first message according to the first information and the second information Process the first message.
其中,该第一信息和第二信息可以为网络设备中预先保存的信息。Wherein, the first information and the second information may be information pre-stored in the network device.
作为一种示例,该第一信息和第二信息可以是网络设备保存的计算机程序中包含的信息,也可以是网络设备中保存的非计算机程序(例如,转发表)中包含的信息,其中,网路设备可以为路由器或交换机,转发表可以是由路由器或媒体访问控制(MAC)表。As an example, the first information and the second information may be information contained in a computer program stored in a network device, or information contained in a non-computer program (for example, a forwarding table) stored in a network device, where: The network device can be a router or a switch, and the forwarding table can be a router or a media access control (MAC) table.
结合第一方面,在第一方面的某些可能的实现方式中,网络设备根据第一信息以及第二信息对该第一报文进行处理,包括:该网络设备通过查找至少两个表,确定第一动作,该至少两个表包括第一表和第二表,该第二表是该第一表的下一个表;以及,该网络设备对该第一报文执行该第一动作;其中,该第一信息是该第一表的标识、第二信息是该第二表的标识、第三信息用于指示该第二信息对应的该第二表是该第一信息对应的该第一表的下一个表。With reference to the first aspect, in some possible implementation manners of the first aspect, the network device processes the first message according to the first information and the second information, including: the network device determines by looking up at least two tables A first action, the at least two tables include a first table and a second table, the second table is the next table of the first table; and the network device performs the first action on the first packet; wherein , The first information is the identifier of the first table, the second information is the identifier of the second table, and the third information is used to indicate that the second table corresponding to the second information is the first table corresponding to the first information. The next table of the table.
结合第一方面,在第一方面的某些可能的实现方式中,该网络设备根据该第一信息以及第二信息对该第一报文进行处理,包括:该网络设备通过执行至少两个函数,确定第一动作,该至少两个函数包括第一函数和第二函数,该第二函数是该第一函数的下一个函数;以及,该网络设备对该第一报文执行该第一动作;其中,该第一信息是该第一函数的标识、第二信息是该第二函数的标识、第三信息用于指示该第二信息对应的该第二函数是该第一信息对应的该第一函数的下一个函数。With reference to the first aspect, in some possible implementation manners of the first aspect, the network device processing the first message according to the first information and the second information includes: the network device executes at least two functions , Determine a first action, the at least two functions include a first function and a second function, the second function is the next function of the first function; and, the network device performs the first action on the first message ; Wherein, the first information is the identification of the first function, the second information is the identification of the second function, and the third information is used to indicate that the second function corresponding to the second information is the corresponding The next function of the first function.
结合第一方面,在第一方面的某些可能的实现方式中,网络设备通过查找至少两个表,确定第一动作之前,该方法还包括:网络设备根据第一表的查找结果和第一报文确定第二表。With reference to the first aspect, in some possible implementations of the first aspect, before the network device determines the first action by looking up at least two tables, the method further includes: the network device according to the search result of the first table and the first action The message determines the second table.
网络设备获得第一报文后,对第一报文中的数据报文进行处理,例如数据报文进行查表处理,获得表项返回信息,进一步,该信息经过至少两个函数处理,得到函数的输出结果,网络设备根据第一报文中的诊断控制信息对该输出结果进行采样处理获得第一信息,并保存该第一信息。After the network device obtains the first message, it processes the data message in the first message. For example, the data message performs table lookup processing to obtain table item return information. Furthermore, the information is processed by at least two functions to obtain the function The network device samples the output result according to the diagnostic control information in the first message to obtain the first information, and saves the first information.
可选地,该第一信息可以包括数据报文查找的至少两个表的标识信息以及经过处理的函数的输入参数。其中,该表的标识信息可以知道数据报文的转发路径。当网络设备发生故障时,可以根据该第一信息中的表的标识信息以及函数的输入参数准确定位故障,从而提高网络设备的故障诊断性能。Optionally, the first information may include identification information of at least two tables searched by the data packet and input parameters of the processed function. Among them, the identification information of the table can know the forwarding path of the data message. When a network device fails, the fault can be accurately located according to the identification information of the table in the first information and the input parameters of the function, thereby improving the fault diagnosis performance of the network device.
结合第一方面,在第一方面的某些可能的实现方式中,该第一报文包括端口的标识,第一类型以及第一报文头;该网络设备对该第一报文进行处理,包括:该网络设备根据端口的标识,确定与该端口对应的计算机程序;该网络设备通过执行该端口对应的计算机程序,对该第一报文头进行处理,多片信息是通过对该第一报文头进行处理获得的,该多片信息包括该第一信息;该网络设备根据该第一类型,保存该第一信息,该第一信息属于该第一类型。With reference to the first aspect, in some possible implementations of the first aspect, the first message includes the port identifier, the first type, and the first message header; the network device processes the first message, Including: the network device determines the computer program corresponding to the port according to the port identifier; the network device processes the first packet header by executing the computer program corresponding to the port, and multiple pieces of information are passed through the first packet header. Obtained by processing the packet header, the pieces of information include the first information; the network device stores the first information according to the first type, and the first information belongs to the first type.
第一报文中的数据报文经过查表和函数处理,处理后的数据报文根据该第一报文中的诊断控制信息进行处理得到相应的第一信息,并将该第一信息保存在存储器中。The data message in the first message is processed by table lookup and function. The processed data message is processed according to the diagnostic control information in the first message to obtain the corresponding first information, and the first information is stored in In the memory.
结合第一方面,在第一方面的某些可能的实现方式中,该第一报文还包括第一指示信息,该第一指示信息用于指示该网络设备根据端口的标识,确定与该端口对应的计算机程序;该第一指示信息还用于指示该网络设备根据该第一类型,保存该第一信息。With reference to the first aspect, in some possible implementations of the first aspect, the first message further includes first indication information, and the first indication information is used to instruct the network device to determine the connection with the port according to the port identifier. Corresponding computer program; the first indication information is also used to instruct the network device to save the first information according to the first type.
结合第一方面,在第一方面的某些可能的实现方式中,该第一指示信息还用于指示该网络设备避免将该第一报文发送至该网络设备的外部。With reference to the first aspect, in some possible implementation manners of the first aspect, the first indication information is further used to instruct the network device to avoid sending the first packet to the outside of the network device.
网络设备在确定第一报文对应的第一信息后,保存第一信息,并根据第一信息对第一报文进行处理。在网络设备的出口处需要判断是否将数据报文发送至网络设备的外部。若该数据报文为原始数据报文,则该第一报文丢弃诊断控制信息,将该原始数据报文发送至网络设备外部;若该数据报文为虚构的数据报文时,则该第一报文不能被发送至网络设备的外部。从而避免造成数据带宽膨胀,节省链路带宽。After determining the first information corresponding to the first packet, the network device saves the first information, and processes the first packet according to the first information. At the exit of the network device, it is necessary to determine whether to send the data message to the outside of the network device. If the data message is an original data message, the first message discards the diagnostic control information and sends the original data message to the outside of the network device; if the data message is a fictitious data message, the first message A message cannot be sent to the outside of the network device. Thus avoiding data bandwidth expansion and saving link bandwidth.
第二方面,提供了一种用于数据传输的装置,该装置包括:获取单元,用于获得第一报文;处理单元,用于确定第一报文对应的第一信息,该第一信息指示该网络设备对该第一报文进行处理的第一阶段;该处理单元还用于在确定第一信息后,保存该第一信息;该处理单元还用于在确定第一信息后,根据该第一信息对该第一报文进行处理;该处理单元还用于对该第一报文进行处理后,避免将该第一报文发送至网络设备外部。In a second aspect, a device for data transmission is provided. The device includes: an acquiring unit configured to acquire a first message; a processing unit configured to determine first information corresponding to the first message, and the first information Instruct the network device to process the first stage of the first message; the processing unit is also used to save the first information after determining the first information; the processing unit is also used to determine the first information according to The first information processes the first message; the processing unit is further configured to avoid sending the first message to the outside of the network device after processing the first message.
结合第二方面,在第二方面的某些可能的实现方式中,该处理单元还用于:确定该第一报文对应的第二信息,该第二信息指示该网络设备对该第一报文进行处理的第二阶段,该第二阶段晚于该第一阶段;在确定第二信息后,保存该第二信息;保存第三信息,该第三信息指示该第二信息对应的阶段晚于该第一信息对应的阶段;该处理单元具体用于:根据该第一信息以及该第二信息对该第一报文进行处理。With reference to the second aspect, in some possible implementations of the second aspect, the processing unit is further configured to: determine second information corresponding to the first packet, and the second information instructs the network device to respond to the first packet. The second stage of document processing, the second stage is later than the first stage; after the second information is determined, the second information is saved; the third information is saved, and the third information indicates that the stage corresponding to the second information is later At a stage corresponding to the first information; the processing unit is specifically configured to: process the first message according to the first information and the second information.
结合第二方面,在第二方面的某些可能的实现方式中,该处理单元具体用于:通过查找至少两个表,确定第一动作,该至少两个表包括第一表和第二表,该第二表是该第一表的下一个表;以及,对该第一报文执行该第一动作;其中,该第一信息是该第一表的标识、第二信息是该第二表的标识、第三信息用于指示该第二信息对应的该第二表是该第一信息对应的该第一表的下一个表。With reference to the second aspect, in some possible implementations of the second aspect, the processing unit is specifically configured to: determine the first action by looking up at least two tables, the at least two tables including the first table and the second table , The second table is the next table of the first table; and, the first action is performed on the first message; wherein, the first information is the identifier of the first table, and the second information is the second The table identifier and the third information are used to indicate that the second table corresponding to the second information is the next table of the first table corresponding to the first information.
结合第二方面,在第二方面的某些可能的实现方式中,该处理单元具体用于:通过执行至少两个函数,确定第一动作,该至少两个函数包括第一函数和第二函数,该第二函数是该第一函数的下一个函数;以及,对该第一报文执行该第一动作;其中,该第一信息是该第一函数的标识、第二信息是该第二函数的标识、第三信息用于指示该第二信息对应的该第二函数是该第一信息对应的该第一函数的下一个函数。With reference to the second aspect, in some possible implementations of the second aspect, the processing unit is specifically configured to: determine the first action by executing at least two functions, the at least two functions including the first function and the second function , The second function is the next function of the first function; and, the first action is performed on the first message; wherein the first information is the identifier of the first function, and the second information is the second The identifier of the function and the third information are used to indicate that the second function corresponding to the second information is the next function of the first function corresponding to the first information.
结合第二方面,在第二方面的某些可能的实现方式中,该处理单元还用于:根据该第一表的查找结果和该第一报文确定该第二表。With reference to the second aspect, in some possible implementation manners of the second aspect, the processing unit is further configured to determine the second table according to the search result of the first table and the first message.
结合第二方面,在第二方面的某些可能的实现方式中,该处理单元还用于:根据第一表的查找结果和第一报文确定第二表。With reference to the second aspect, in some possible implementations of the second aspect, the processing unit is further configured to: determine the second table according to the search result of the first table and the first message.
结合第二方面,在第二方面的某些可能的实现方式中,该第一报文包括端口的标识,第一类型以及第一报文头;该处理单元具体用于:根据端口的标识,确定与该端口对应的计算机程序;通过执行该端口对应的计算机程序,对该第一报文头进行处理,多片信息是通过对该第一报文头进行处理获得的,该多片信息包括该第一信息;根据该第一类型,保存该第一信息,该第一信息属于该第一类型。With reference to the second aspect, in some possible implementations of the second aspect, the first message includes the port identifier, the first type, and the first message header; the processing unit is specifically configured to: according to the port identifier, Determine the computer program corresponding to the port; process the first packet header by executing the computer program corresponding to the port, and multiple pieces of information are obtained by processing the first packet header, and the multiple pieces of information include The first information; according to the first type, the first information is stored, and the first information belongs to the first type.
结合第二方面,在第二方面的某些可能的实现方式中,该第一报文还包括第一指示信息,该第一指示信息用于指示该网络设备根据端口的标识,确定与该端口对应的计算机程序;该第一指示信息还用于指示该网络设备根据该第一类型,保存该第一信息。With reference to the second aspect, in some possible implementations of the second aspect, the first message further includes first indication information, and the first indication information is used to instruct the network device to determine the connection with the port according to the port identifier. Corresponding computer program; the first indication information is also used to instruct the network device to save the first information according to the first type.
结合第二方面,在第二方面的某些可能的实现方式中,该第一指示信息还用于指示该网络设备避免将该第一报文发送至该网络设备的外部。With reference to the second aspect, in some possible implementation manners of the second aspect, the first indication information is also used to instruct the network device to avoid sending the first packet to the outside of the network device.
第三方面,提供了一种网络设备,包括处理器和存储器。存储器用于存储计算机程序,处理器用于调用并运行存储器中存储的计算机程序,使得网络设备执行上述第一方面或第一方面任意可能的实现方式中的方法。In a third aspect, a network device is provided, including a processor and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory, so that the network device executes the foregoing first aspect or the method in any possible implementation manner of the first aspect.
可选地,该网络设备还包括收发器。进一步可选地,该处理器为一个或多个。该存储器为一个或多个。Optionally, the network device further includes a transceiver. Further optionally, there are one or more processors. The memory is one or more.
可选地,上述存储器可以与处理器集成在一起,或者存储器与处理器分离设置。Optionally, the foregoing memory may be integrated with the processor, or the memory and the processor may be provided separately.
上述的收发器可以包括接收器和/或发射器。The aforementioned transceiver may include a receiver and/or a transmitter.
第四方面,本申请提供一种用于数据传输的系统,所述系统包括上述第三方面所述的网络设备。In a fourth aspect, the present application provides a system for data transmission, and the system includes the network device described in the third aspect.
第五方面,本申请提供一种计算机可读介质,用于存储计算机程序,该计算机程序包括用于执行第一方面或第一方面的任意可能的实现方式中的方法的指令。In a fifth aspect, this application provides a computer-readable medium for storing a computer program, and the computer program includes instructions for executing the first aspect or any possible implementation of the first aspect.
第六方面,提供了一种芯片,其中存储有指令,当其在接收装置上运行时,使得该芯片执行第一方面或第一方面的任意可能的实现方式中的方法。In a sixth aspect, a chip is provided, in which instructions are stored, when running on a receiving device, the chip is made to execute the method in the first aspect or any possible implementation of the first aspect.
可选地,该芯片还包括存储器,存储器与处理器通过电路或电线与存储器连接。Optionally, the chip further includes a memory, and the memory and the processor are connected to the memory through a circuit or a wire.
进一步可选地,该芯片还包括通信接口。Further optionally, the chip also includes a communication interface.
第七方面,提供了一种计算机程序产品,该计算机程序产品包括:计算机程序代码,当该计算机程序代码被接收装置的通信单元或通信接口、以及处理单元或处理器运行时,使得发送装置执行上述第一方面或第一方面的任意可能的实现方式中的方法。In a seventh aspect, a computer program product is provided, the computer program product includes: computer program code, when the computer program code is executed by the communication unit or communication interface, and the processing unit or processor of the receiving device, the sending device is executed The first aspect or the method in any possible implementation of the first aspect.
为了更清楚地说明本申请实施例或背景技术中的技术方案,下面将对本申请实施例或背景技术中所需要使用的附图进行说明。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background art, the following will describe the drawings that need to be used in the embodiments of the present application or the background art.
图1示出了INT/IOAM的转发示意图;Figure 1 shows a schematic diagram of INT/IOAM forwarding;
图2示出了适用于本申请实施例的架构图;Figure 2 shows an architecture diagram applicable to an embodiment of the present application;
图3是本申请实施例提供的用于数据传输的方法的示意性流程图;FIG. 3 is a schematic flowchart of a method for data transmission provided by an embodiment of the present application;
图4是第一报文的格式示意图;Figure 4 is a schematic diagram of the format of the first message;
图5示出了本申请实施例提供的获得第一信息的示意性框图;FIG. 5 shows a schematic block diagram for obtaining first information according to an embodiment of the present application;
图6示出了适用于本申请实施例的另一种架构图;FIG. 6 shows another architecture diagram applicable to the embodiments of the present application;
图7示出了适用于本申请实施例的又一种架构图;FIG. 7 shows another architecture diagram applicable to the embodiments of the present application;
图8是本申请用于数据传输的装置的示意性框图;Fig. 8 is a schematic block diagram of an apparatus for data transmission according to the present application;
图9是本申请用于数据传输的网络设备的示意性框图。Fig. 9 is a schematic block diagram of a network device used for data transmission in the present application.
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述。显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下可以获得其他实施例。The technical solutions in the embodiments of the present application will be clearly described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, those of ordinary skill in the art can obtain other embodiments without creative work.
当前运用于网络设备监测典型的相关技术有内联网遥测/带内操作管理维护(intranet telemetry/in-band operation,administration and maintenance,INT/IOAM)。图1示出了INT/IOAM的转发示意图。如图1所示,初始报文由传输头(transport header)和负载(payload)构成。在业务流传输过程中,INT/IOAM将所有经过的路径上各个节点的数据承载在初始报文中,向下个节点发送,直至路径末端节点的数据承载在初始报文中。例如图1中,初始报文的传输路径为节点A-节点B-节点E。初始报文经过节点A后,节点A的数据0承载在初始报文中构成新的报文,并将生成的新报文传输至节点B。节点B的数据1承载在节点B接收到的报文中并传输至节点E。节点E的数据2承载在该报文中。节点E为末端节点。节点E将携带节点A、节点B以及节点E的数据的新报文发送至INT/IOAM系统中进行数据处理。Typical related technologies currently used in network equipment monitoring include intranet telemetry/in-band operation, administration and maintenance (INT/IOAM). Figure 1 shows a schematic diagram of INT/IOAM forwarding. As shown in Figure 1, the initial message is composed of a transport header and a payload. In the service flow transmission process, INT/IOAM carries the data of all nodes on the path that it passes through in the initial message, and sends it to the next node until the data at the end node of the path is carried in the initial message. For example, in Figure 1, the transmission path of the initial message is node A-node B-node E. After the initial message passes through node A, the data 0 of node A is carried in the initial message to form a new message, and the generated new message is transmitted to node B. The data 1 of node B is carried in the message received by node B and transmitted to node E. The data 2 of node E is carried in this message. Node E is the end node. Node E sends a new message carrying the data of node A, node B, and node E to the INT/IOAM system for data processing.
初始报文携带所经过路径的数据。具体地,可以是路径上的节点的数据。当路径的节点较多或数据的尺寸太大,路径上传输的报文的尺寸较大。尺寸较大的报文需要占用较大的数据带宽。加大带宽消耗。另外,在业务流传输过程中,当网络发生故障,需要精准定位故障。一种相关技术提供了单步运行获取转发行为的手段。单步运行基于指令运行的机制逐步收集转发数据,进行业务定位。在单步运行时,可能导致正常的业务无法处理。从而引起正常业务中断。The initial message carries the data of the path traversed. Specifically, it may be data of nodes on the path. When the path has more nodes or the data size is too large, the size of the message transmitted on the path is larger. Larger packets need to occupy a larger data bandwidth. Increase bandwidth consumption. In addition, in the process of service flow transmission, when a network fails, the fault needs to be accurately located. A related technology provides a means of obtaining forwarding behavior in a single step. The single-step operation is based on the instruction operation mechanism to gradually collect and forward data to locate the business. During single-step operation, normal business may not be processed. Thus causing normal business interruption.
有鉴于此,本申请实施例提供了一种用于数据传输的方法,能够提高网络设备故障诊断的性能。In view of this, the embodiments of the present application provide a method for data transmission, which can improve the performance of network device fault diagnosis.
图2示出了适用于本申请实施例的架构图。如图2所示,触发源针对特定业务触发诊断,产生能够控制网络设备对待诊断业务进行处理的诊断控制信息,并将该待诊断控制信息传输至后续处理单元。每一级处理单元都包括一个诊断模块,用于识别该诊断指示信息。在业务正常进行的同时,根据该诊断控制信息通过数据总线旁路对该待诊断业务进行数据采集。将每一级采集的数据存储在诊断数据存储器中。根据采集的待诊断业务数据进行故障分析。通过在数据总线旁路采集数据,可以在故障诊断时减小对正常业务的造成中断的影响。Figure 2 shows an architecture diagram applicable to an embodiment of the present application. As shown in Figure 2, the trigger source triggers diagnosis for a specific service, generates diagnosis control information that can control the network device to process the service to be diagnosed, and transmits the control information to be diagnosed to the subsequent processing unit. Each level of processing unit includes a diagnosis module for identifying the diagnosis indication information. While the business is running normally, data collection is performed on the business to be diagnosed through the data bus bypass based on the diagnosis control information. Store the data collected at each level in the diagnostic data memory. Perform fault analysis based on collected business data to be diagnosed. By collecting data by bypassing the data bus, the impact of interruption to normal services can be reduced during fault diagnosis.
图3是本申请实施例提供的用于数据传输的方法300的示意性流程图。该方法300适用于如图2所示的架构中。方法300包括步骤S310至S350,下面将详细说明方法300中的各个步骤。FIG. 3 is a schematic flowchart of a method 300 for data transmission according to an embodiment of the present application. The method 300 is applicable to the architecture shown in FIG. 2. The method 300 includes steps S310 to S350, and each step in the method 300 will be described in detail below.
S310,网络设备获得第一报文。S310: The network device obtains the first packet.
在进行网络设备故障诊断之前,网络设备获得第一报文,其中,网络设备可以为路由器、网络交换机、防火墙以及负载均衡器等,本申请实施例对此不作限定。Before performing fault diagnosis of the network device, the network device obtains the first packet, where the network device may be a router, a network switch, a firewall, a load balancer, etc., which is not limited in the embodiment of the present application.
在一种可能的实现方式中,该第一报文由原始数据报文和诊断控制信息两部分构成。如图2所示,网络设备的外部端口接收原始数据报文。外部端口接收的原始数据报文进入到触发源,触发源产生针对特定业务的诊断控制信息,从而原始数据报文经过触发源后得到第一报文。In a possible implementation manner, the first message is composed of two parts, an original data message and diagnostic control information. As shown in Figure 2, the external port of the network device receives the original data message. The original data message received by the external port enters the trigger source, and the trigger source generates diagnostic control information for specific services, so that the original data message obtains the first message after passing through the trigger source.
在一些实施例中,触发源是网络设备中的一个部件,可以是下文提到的三态内容寻址存储器(ternary content addressable memory,TCAM),也可以是在中央处理器(central processing unit,CPU)中固化的一段程序,用于启动监测,由用户触发下发报文。In some embodiments, the trigger source is a component in the network device, which can be the ternary content addressable memory (TCAM) mentioned below, or it can be in the central processing unit (CPU). A program solidified in ), used to start the monitoring, and the user triggers to send a message.
图4示出了第一报文的格式。如图4所示,第一报文包括四部分,即以太网(Ethernet, ETH)头、控制头(control header)、报文头(packet header)以及报文负载(packet payload),其中,控制头和报文头是必须携带的部分,ETH头以及报文负载(packet payload)为可选的。Figure 4 shows the format of the first message. As shown in Figure 4, the first message includes four parts, namely, an Ethernet (Ethernet, ETH) header, a control header (control header), a packet header (packet header), and a packet payload (packet payload). The header and the message header are the parts that must be carried, and the ETH header and the packet payload are optional.
例如,当第一报文是通过ETH链路发送至网络设备中,则该第一报文需要在控制头前携带ETH头。在一些实施例中,当该第一报文不需要通过ETH链路发送至网络设备中,则该第一报文不需要携带ETH头。For example, when the first message is sent to the network device through the ETH link, the first message needs to carry the ETH header before the control header. In some embodiments, when the first message does not need to be sent to the network device through the ETH link, the first message does not need to carry an ETH header.
该控制头包括诊断控制信息,该诊断控制信息用于控制网络设备中的诊断模块对该第一报文中的数据报文进行处理。其中,该诊断控制信息包括诊断指示信息,该诊断指示信息用于网络设备识别待诊断数据,启动对待诊断业务的数据采集处理。例如,当诊断指示信息为1时,启动对该待诊断业务的数据采集处理,当诊断指示信息为0时,不启动对该诊断业务的数据采集处理。The control header includes diagnostic control information, and the diagnostic control information is used to control the diagnostic module in the network device to process the data message in the first message. Wherein, the diagnosis control information includes diagnosis instruction information, and the diagnosis instruction information is used for the network device to identify the data to be diagnosed and start data collection processing of the service to be diagnosed. For example, when the diagnosis indication information is 1, the data collection process for the service to be diagnosed is started, and when the diagnosis indication information is 0, the data collection process for the diagnosis service is not started.
上述根据诊断指示信息启动对第一报文数据采集处理的方法仅仅是为了便于说明,还可以有其它诊断信息指示的方式,只要能准确指示是否启动对第一报文的数据采集处理即可,本申请实施例对此并不作限定。The above method of starting the data collection and processing of the first message according to the diagnosis indication information is only for the convenience of description, and there may be other ways of indicating the diagnosis information, as long as it can accurately indicate whether to start the data collection and processing of the first message. The embodiment of the present application does not limit this.
可选地,该第一报文的控制头还包括第一指示信息,即转发基础信息,用于网络设备做业务分类。例如,该第一指示信息可以包括源端口、转发域等信息。Optionally, the control header of the first packet further includes first indication information, that is, forwarding basic information, which is used to classify services of the network device. For example, the first indication information may include information such as source port and forwarding domain.
可选地,该第一报文的控制头还包括第一类型,即数据类型,用于指示该网络设备采集何种数据。其中,不同数据类型对应不同采集的数据信息。比如,该第一报文中的数据类型分为表项类转发数据、加工数据1、加工数据2。当该数据类型为1时,表示采集表项类转发数据,当该数据类型为2时,表示采集加工数据1,当该数据类型为3时,表示采集加工数据2,或者当该数据类型为0时,表示采集该第一报文中的所有类型的数据。Optionally, the control header of the first message further includes a first type, that is, a data type, which is used to indicate what kind of data the network device collects. Among them, different data types correspond to different collected data information. For example, the data types in the first message are classified into table item forwarding data, processing data 1, and processing data 2. When the data type is 1, it means the forwarding data of the collection table entry, when the data type is 2, it means the processing data 1 is collected, and when the data type is 3, it means the processing data 2 is collected, or when the data type is When 0, it means to collect all types of data in the first message.
上述数据类型信息指示网络设备对相应类型数据进行采集的方法仅仅是为了便于说明,还可以有其它指示的方式,只要能清楚指示采集何种类型数据即可,本申请实施例对此并不作限定。The above data type information instructs the network device to collect the corresponding type of data only for convenience of description, and there may be other indication methods, as long as it can clearly indicate which type of data to collect, this embodiment of the application does not limit this .
S320,网络设备确定第一报文对应的第一信息,该第一信息指示网络设备对第一报文进行处理的第一阶段。S320: The network device determines first information corresponding to the first packet, and the first information indicates the first stage of processing the first packet by the network device.
其中,网络设备对第一报文进行处理的第一阶段可以理解为网络设备对第一报文进行的第一次处理,例如,第一报文查找第一张表等。Among them, the first stage of processing the first packet by the network device can be understood as the first processing of the first packet by the network device, for example, the first packet searches the first table.
可选地,网络设备根据接收的第一报文的端口信息确定该第一信息。例如,网络设备根据第一报文中包括的端口信息确定第一报文对应的计算机程序,其中,该计算机程序中包括第一信息。Optionally, the network device determines the first information according to the port information of the received first packet. For example, the network device determines the computer program corresponding to the first message according to the port information included in the first message, where the computer program includes the first information.
或者,网络设备根据第一报文中的字段确定第一信息。例如,网络设备根据第一报文中的目的IP地址,查找路由表,获得与该目的IP地址匹配的表项,其中,该匹配表项中包含第一信息。Or, the network device determines the first information according to the fields in the first message. For example, the network device searches the routing table according to the destination IP address in the first packet to obtain an entry that matches the destination IP address, where the matching entry includes the first information.
S330,网络设备在确定第一信息后,保存第一信息。S330: After determining the first information, the network device saves the first information.
网络设备确定第一报文对应的第一信息后,将该第一信息保存在存储器中。After determining the first information corresponding to the first packet, the network device stores the first information in the memory.
S340,网络设备在确定第一信息后,根据第一信息对第一报文进行处理。S340: After determining the first information, the network device processes the first packet according to the first information.
如图2所示,网络设备内部包括至少一个入口管道,例如入口管道1、入口管道2...入口管道n,每一个入口管道包括一个诊断模块。当网络设备获得第一报文后,根据确定的第一信息对第一报文中的原始数据报文进行处理。As shown in Fig. 2, the network device includes at least one inlet pipe, such as inlet pipe 1, inlet pipe 2, ... inlet pipe n, and each inlet pipe includes a diagnostic module. After the network device obtains the first message, it processes the original data message in the first message according to the determined first information.
在一些实施例中,网络设备确定第一报文对应的第二信息,该第二信息指示网络设备对第一报文进行处理的第二阶段,其中,该第二阶段晚于第一阶段。网络设备在确定该第二信息后,保存该第二信息。In some embodiments, the network device determines second information corresponding to the first packet, and the second information indicates a second stage of processing the first packet by the network device, wherein the second stage is later than the first stage. After determining the second information, the network device saves the second information.
其中,该第一信息和第二信息可以为网络设备中预先保存的信息。Wherein, the first information and the second information may be information pre-stored in the network device.
作为一种示例,该第一信息和第二信息可以是网络设备保存的计算机程序中包含的信息,也可以是网络设备中保存的非计算机程序(例如,转发表)中包含的信息,其中,网路设备可以为路由器或交换机,转发表可以是由路由器或媒体访问控制(MAC)表。As an example, the first information and the second information may be information contained in a computer program stored in a network device, or information contained in a non-computer program (for example, a forwarding table) stored in a network device, where: The network device can be a router or a switch, and the forwarding table can be a router or a media access control (MAC) table.
可选地,网络设备还可以保存第三信息,其中,该第三信息指示第二信息对应的阶段晚于第一信息对应的阶段,本申请实施例对此不作限定。Optionally, the network device may also store third information, where the third information indicates that the phase corresponding to the second information is later than the phase corresponding to the first information, which is not limited in this embodiment of the application.
例如,原始数据报文进入网络设备后查找至少两张表,其中,该至少两张表包括第一表和第二表,第二表为第一表的下一个表,确定第一动作。并对该原始数据报文执行第一动作。其中,该第一动作可以包括删除第一报文中的一个报文头、删除第一报文中的第一个报文头中的至少一个字段、计算第一报文的总和校验码(checksum)、将第一报文的生存时间值(time to live,TTL)的值减一、在第一报文中增加一个报文头或者确定第一报文的物理出端口或者逻辑出端口。第一信息是第一表的标识、第二信息是第二表的标识、第三信息用于指示第二信息对应的第二表是第一信息对应的第一表的下一个表。For example, after the original data message enters the network device, at least two tables are searched, where the at least two tables include a first table and a second table, and the second table is the next table of the first table, and the first action is determined. And perform the first action on the original data message. Wherein, the first action may include deleting a header in the first message, deleting at least one field in the first header in the first message, and calculating the sum check code of the first message ( checksum), subtract one from the time to live (TTL) value of the first message, add a message header to the first message, or determine the physical or logical egress port of the first message. The first information is the identifier of the first table, the second information is the identifier of the second table, and the third information is used to indicate that the second table corresponding to the second information is the next table of the first table corresponding to the first information.
可选地,当网络设备获得第一报文后,根据第一报文中包括的端口标识信息确定该第一报文查找的第一表,查完第一表后得到表项数据,网络设备根据该第一表返回的表项数据和第一报文的入口信息确定该第一报文查找的第二表。Optionally, after the network device obtains the first packet, it determines the first table searched by the first packet according to the port identification information included in the first packet, and obtains the entry data after searching the first table. The network device The second table searched by the first packet is determined according to the entry data returned by the first table and the entry information of the first packet.
假设芯片内部包括A、B、C、D四张表,当网络设备接收到第一报文后,网络设备需要先确定该第一报文在这四张表中的转发路径,即第一报文在芯片中的转发路径是A-B-C-D还是A-C-B-D。网络设备先根据第一报文中包括的端口标识信息确定该第一报文查找的第一表为表A,然后网络设备根据该第一报文查找第一表(即表A)后返回的表项数据和第一报文的端口标识信息确定表A的下一张表为表B,依次类推,表B的下一张表为表C,表C的下一张表为表D,从而确定该第一报文在芯片中的查表顺序为A-B-C-D。网络设备在查表过程中会保存该第一报文查找表的表的标识信息(即第一信息和第二信息),用于指示网络设备对第一报文进行处理的路径。当芯片发生故障时,可以根据保存的第一信息清楚的知道该第一报文在芯片内部的转发路径,从而实现故障的精准定位。Assuming that the chip contains four tables A, B, C, and D, when the network device receives the first message, the network device needs to determine the forwarding path of the first message in these four tables, that is, the first message is in the four tables. Whether the forwarding path in the chip is ABCD or ACBD. The network device first determines that the first table searched by the first packet is table A according to the port identification information included in the first packet, and then the network device searches the first table (ie, table A) according to the first packet and returns The entry data and the port identification information of the first message determine that the next table of table A is table B, and so on, the next table of table B is table C, and the next table of table C is table D, so It is determined that the table lookup order of the first message in the chip is ABCD. During the table lookup process, the network device saves the identification information (ie, the first information and the second information) of the table of the first message lookup table, which is used to indicate the path for the network device to process the first message. When a chip fails, the forwarding path of the first packet inside the chip can be clearly known according to the stored first information, so as to realize accurate fault location.
可选地,当原始数据报文经过查表返回表项信息后,进一步该表项数据经过至少两个函数处理得到该至少两个函数的执行结果。网络设备通过执行至少两个函数,确定第一动作,该至少两个函数包括第一函数和第二函数,该第二函数是该第一函数的下一个函数;以及该网络设备对该第一报文执行该第一动作;其中,该第一信息是该第一函数的标识、第二信息是该第二函数的标识、第三信息用于指示该第二信息对应的该第二函数是该第一信息对应的该第一函数的下一个函数。Optionally, after the original data message returns entry information through a table lookup, the entry data is further processed by at least two functions to obtain the execution results of the at least two functions. The network device determines the first action by executing at least two functions, the at least two functions including a first function and a second function, the second function is the next function of the first function; and the network device performs the first action The message performs the first action; where the first information is the identifier of the first function, the second information is the identifier of the second function, and the third information is used to indicate that the second function corresponding to the second information is The next function of the first function corresponding to the first information.
在得到经过处理后的原始数据报文后,为了不影响数据报文的正常传输,处理后的原始数据报文在网络设备内部的每一级入口管道间通过数据总线传输的同时,网络设备的诊断模块根据该第一报文中的诊断控制信息对处理后的数据报文进行处理得到第一信息,即诊断模块旁挂在每一级数据总线上,网络设备根据该诊断控制信息对该待诊断业务进行数据采集,在不占用正常业务数据处理带宽的同时,额外增加一部分处理来对正常业务数据 的处理过程进行监测,从而实现在不影响正常业务的同时进行故障诊断。After the processed original data message is obtained, in order not to affect the normal transmission of the data message, the processed original data message is transmitted through the data bus between each level of ingress pipelines inside the network device. The diagnostic module processes the processed data message according to the diagnostic control information in the first message to obtain the first information, that is, the diagnostic module hangs on each level of the data bus, and the network device responds to the waiting data according to the diagnostic control information. Diagnosis business data collection, while not occupying normal business data processing bandwidth, an additional part of processing is added to monitor the processing of normal business data, so as to achieve fault diagnosis without affecting normal business.
图5示出了本申请实施例提供的获得第一信息的示意性框图。如图5所示,该处理后的原始数据报文数据类型包括表项返回数据、加工数据1到加工数据n(n为大于等于1的正整数),该诊断控制信息包括数据类型信息(即第一类型)和采集指示信息,其中,该采集指示信息指示是否进行数据采集,例如,当该采集指示信息标志位为1时,则表示需要进行数据采集;当该采集指示信息标志位为0时,则表示不需要进行数据采集。FIG. 5 shows a schematic block diagram for obtaining first information according to an embodiment of the present application. As shown in Figure 5, the data type of the processed original data message includes table item return data, processing data 1 to processing data n (n is a positive integer greater than or equal to 1), and the diagnostic control information includes data type information (ie The first type) and collection indication information, where the collection indication information indicates whether to perform data collection, for example, when the collection indication information flag is 1, it indicates that data collection is required; when the collection indication information flag is 0 When, it means that data collection is not required.
当该诊断控制信息中的采集指示信息标志位为1时,网络设备根据该诊断控制信息中的数据类型对处理后的原始数据报文中相应的数据进行采集。例如,数据类型为1,则采集数据类型为1的表项返回数据,数据类型为2,则采集数据类型为2的加工数据(例如,经过函数处理的数据),或者采集数据类型为0,则采集所有类型的数据。When the collection indication information flag bit in the diagnosis control information is 1, the network device collects corresponding data in the processed original data message according to the data type in the diagnosis control information. For example, if the data type is 1, the table item of the collected data type is 1 returns data, and the data type is 2, the processing data of the collected data type is 2 (for example, the data processed by the function), or the collected data type is 0, All types of data are collected.
网络设备根据诊断控制信息采集数据完成后,得到第一信息。该第一信息包括采集数据类型,指示当前采集的数据为哪种类型的数据;当网络设备包括多级诊断模块时,该第一信息中还包括采集地址,用于指示当前采集的数据为哪一级的诊断模块采集的。The network device obtains the first information after collecting data according to the diagnosis control information. The first information includes the type of collected data, indicating which type of data the currently collected data is; when the network device includes a multi-level diagnostic module, the first information also includes the collection address, which is used to indicate the currently collected data. Collected by the first-level diagnostic module.
可选地,当该诊断模块只有一级时,该第一信息中可以不包括采集地址。Optionally, when the diagnostic module has only one level, the first information may not include the collection address.
上述技术方案中,诊断控制信息中通过类型、长度、数值(type,length,value,TLV)定义了采集的数据类型,在网络设备根据该诊断控制信息对处理后的原始数据报文进行数据采集时,当需要对该待诊断业务的所有数据进行分析时,可以通过迭代的方式,每次采集不同类型的数据,直至所述类型的数据全部采集完成,从而可以减小对存储器的消耗,降低故障诊断的实现成本。In the above technical solution, the type, length, value (TLV) of the diagnostic control information defines the type of collected data, and the network device performs data collection on the processed original data message according to the diagnostic control information When it is necessary to analyze all the data of the service to be diagnosed, different types of data can be collected each time in an iterative manner until all the types of data are collected, thereby reducing the consumption of memory and reducing Implementation cost of fault diagnosis.
在故障分析时,为了不影响正常业务的处理,可以通过数据总线旁路的方式对处理后的原始数据报文进行数据采集。During failure analysis, in order not to affect the processing of normal services, data collection can be performed on the processed original data messages by way of data bus bypass.
可选地,在一些可能的实现方式中,第一信息可以包括第一表的标识,第二信息包括第二表的标识,便于在网络设备发生故障时,能够清楚知道第一报文在转发过程中经过哪些表,有利于故障定位。Optionally, in some possible implementations, the first information may include the identification of the first table, and the second information may include the identification of the second table, so that when a network device fails, it can be clearly known that the first packet is being forwarded. Which tables are passed during the process will help locate the fault.
例如,网络设备以第一报文中的第一字段为查找关键字,在查找表中查找是否存在与该第一字段匹配的表项。若网络设备所查找的表中存在与第一报文中的第一字段匹配的表项,则第一信息包括第一表项的标识,其中,该第一表项为与该第一报文中的第一字段匹配的表项。若网络设备所查找的表中不存在与第一报文中的第一字段匹配的表项,则第一信息包括该查找表的标识。在网络设备发生故障时,可以根据第一信息中的第一表项的标识或该查找表的标识进行精准故障定位,从而提高网络设备故障诊断的性能。For example, the network device uses the first field in the first message as a search key to find in the lookup table whether there is an entry that matches the first field. If there is an entry that matches the first field in the first packet in the table searched by the network device, the first information includes the identifier of the first entry, where the first entry is the same as that of the first packet The entry that matches the first field in. If there is no entry that matches the first field in the first message in the table searched by the network device, the first information includes the identifier of the lookup table. When a network device fails, accurate fault location can be performed based on the identification of the first entry in the first information or the identification of the look-up table, thereby improving the performance of fault diagnosis of the network device.
可选地,在一些可能的实现方式中,当网络设备保存了查找表与用于对该查找表进行验证的验证表,其中,该验证表的内容与查找表的内容一致。当存储该查找表的存储器发生故障时,存储器上保存的查找表的内容可能发生变化。例如未发生变化的第一表项的匹配域可能不等于发生变化的第一表项的匹配域。以第一表项为例,当网络设备确定发生变化的表项与第一字段匹配后,网络设备可以使用验证表对第一表项是否发生变化进行验证。如果验证的结果为第一表项发生了变化,则可以确定存储器发生故障,此时,该第一信息中还可以包括第一表项的标识以及用于指示存储器发生故障的信息。在网络设备发生故障时,可以根据第一信息中的第一表项的标识以及指示存储器发生故障的信息确定存储器发生故障并精准定位故障,从而提高网络设备故障诊断的性能。Optionally, in some possible implementation manners, when the network device saves a lookup table and a verification table used to verify the lookup table, the content of the verification table is consistent with the content of the lookup table. When the memory storing the look-up table fails, the contents of the look-up table stored on the memory may change. For example, the matching field of the first entry that has not changed may not be equal to the matching field of the first entry that has changed. Taking the first entry as an example, after the network device determines that the changed entry matches the first field, the network device can use the verification table to verify whether the first entry has changed. If the result of the verification is that the first entry has changed, it can be determined that the memory is faulty. At this time, the first information may also include the identifier of the first entry and the information used to indicate that the memory is faulty. When the network device fails, the memory failure can be determined according to the identifier of the first entry in the first information and the information indicating the memory failure and the failure can be accurately located, thereby improving the performance of network device failure diagnosis.
可选地,在一些可能的实现方式中,第一报文还包括第一指示信息,该第一指示信息用于指示网络设备根据端口标识确定与该端口对应的计算机程序。Optionally, in some possible implementation manners, the first message further includes first indication information, where the first indication information is used to instruct the network device to determine the computer program corresponding to the port according to the port identifier.
例如:指示网络设备从以太网帧头中获取目的介质访问控制(media access control,MAC)地址,指示网络设备以目的MAC地址为查找关键字,在MAC表中查找匹配的表项,指示从匹配的表项中获取出端口的信息或者下一跳的信息。For example: instruct the network device to obtain the destination media access control (MAC) address from the Ethernet frame header, and instruct the network device to use the destination MAC address as the search key to search for the matching entry in the MAC table, and indicate the matching Obtain the information of the outgoing port or the next hop from the table entry.
当用于处理以太网帧的计算机程序可以包含用于处理IP报文的计算机程序时,该第一指示信息还用于指示网络设备从IP头中获取目的IP地址,指示网络设备以目的IP地址为查找关键字,在路由表中查找匹配的表项并从匹配的表项中获取出端口的信息或者下一跳的信息。When the computer program for processing the Ethernet frame may include the computer program for processing the IP message, the first indication information is also used to instruct the network device to obtain the destination IP address from the IP header, and instruct the network device to use the destination IP address To search for keywords, the matching entry is searched in the routing table and the port information or next hop information is obtained from the matching entry.
可选地,在一些可能的实现方式中,第一信息还可以包括输入参数。例如,当网络设备执行至少两个函数时,其中,该至少两个函数包括第一函数和第二函数,其中,第一参数是网络设备执行第一函数获得的,该第一参数为网络设备执行第二函数使用的输入参数。第一信息中保存每个函数的输入参数,当网络设备发生故障时,可以根据该输入参数判断该函数是否正确执行,从而精准定位故障,提高网络设备故障诊断性能。Optionally, in some possible implementation manners, the first information may also include input parameters. For example, when the network device executes at least two functions, the at least two functions include a first function and a second function, wherein the first parameter is obtained by the network device executing the first function, and the first parameter is the network device The input parameters used to execute the second function. The input parameters of each function are stored in the first information. When a network device fails, it can be judged whether the function is executed correctly according to the input parameters, so as to accurately locate the fault and improve the performance of network device fault diagnosis.
举例来说,所述网络设备可以是路由器。所述路由器包括网络处理器以及存储器。所述存储器中存储计算机程序。所述网络处理器可以通过执行所述计算机程序,对原始数据报文进行处理。具体地,所述计算机程序包括所述第一函数和所述第二函数。在一种可能的设计中,所述原始数据报文是以太网帧。所述以太网帧以及帧校验序列(frame check sequence,FCS)域被所述路由器接收。所述第一函数用于根据所述以太网帧计算FCS number。所述第一参数为FCS number。所述第二函数用于根据所述FCS域包含的number以及根据第一函数计算的FCS number,确定所述以太网帧在传输过程中是否发生错误。当所述FCS域包含的number与根据第一函数计算的FCS number相等时,确定所述以太网帧没有发生错误。当所述FCS域包含的number与根据第一函数计算的FCS number不相等时,确定所述以太网帧发生错误。For example, the network device may be a router. The router includes a network processor and a memory. A computer program is stored in the memory. The network processor may process the original data message by executing the computer program. Specifically, the computer program includes the first function and the second function. In a possible design, the original data message is an Ethernet frame. The Ethernet frame and the frame check sequence (FCS) field are received by the router. The first function is used to calculate the FCS number according to the Ethernet frame. The first parameter is FCS number. The second function is used to determine whether an error occurs in the Ethernet frame during transmission according to the number contained in the FCS field and the FCS number calculated according to the first function. When the number included in the FCS field is equal to the FCS number calculated according to the first function, it is determined that no error has occurred in the Ethernet frame. When the number included in the FCS field is not equal to the FCS number calculated according to the first function, it is determined that an error has occurred in the Ethernet frame.
S350,网络设备对第一报文进行处理后,该网络设备避免将第一报文发送至所述网络设备的外部。S350: After the network device processes the first packet, the network device avoids sending the first packet to the outside of the network device.
网络设备在对第一报文中的原始数据报文进行处理后,为了避免造成数据带宽膨胀,节省链路带宽,网络设备可以在终端设备的出口管道前,根据该第一指示信息指示网络设备避免将第一报文中的诊断控制信息发送至网络设备的外部。After the network device processes the original data message in the first message, in order to avoid data bandwidth expansion and save link bandwidth, the network device can instruct the network device according to the first instruction information before the outlet pipe of the terminal device Avoid sending the diagnostic control information in the first message to the outside of the network device.
可选地,在该第一报文的控制头中预留1比特(bit)字段来指示该第一报文中的数据报文为真实的数据报文还是虚构的数据报文。例如,该第一指示信息标志位为1时,则表示该原始数据报文为真实的数据报文,网络设备需要通过出口管道将原始数据报文转发至外部接口;当该第一指示信息标志位为0时,则表示该数据报文为虚构数据报文,网络设备不需要将该虚构数据报文发送至网络设备外部。Optionally, a 1-bit (bit) field is reserved in the control header of the first message to indicate whether the data message in the first message is a real data message or a fictitious data message. For example, when the first indication information flag bit is 1, it means that the original data message is a real data message, and the network device needs to forward the original data message to the external interface through the egress pipe; when the first indication information flag When the bit is 0, it means that the data message is a fictitious data message, and the network device does not need to send the fictitious data message to the outside of the network device.
图6示出了适用于本申请实施例的另一种架构图。如图6所示,该触发源可以为与原始数据报文一致的数据报文,由控制器(例如,中央处理器(central processing unit,CPU))构造并直接下插到芯片中。此时S310可以为该第一报文由控制器构造,其中该第一报文包括控制器构造的与原始数据报文一致的虚构数据报文和诊断控制信息。FIG. 6 shows another architecture diagram applicable to the embodiments of the present application. As shown in FIG. 6, the trigger source may be a data message consistent with the original data message, which is constructed by a controller (for example, a central processing unit (CPU)) and directly inserted into the chip. At this time, S310 may be that the first message is constructed by the controller, where the first message includes a fictitious data message and diagnostic control information constructed by the controller and consistent with the original data message.
其中,如图4所示的数据报文格式图,该虚构数据报文的报文头与原始数据报文的报 文头一致,例如,该虚构数据报文与原始数据报文具有相同的MAC信息、相同的互联网协议(internet protocol,IP)五元组信息等。Among them, as shown in the data message format diagram shown in Figure 4, the header of the fictitious data message is consistent with the header of the original data message. For example, the fictitious data message and the original data message have the same MAC Information, the same Internet protocol (IP) quintuple information, etc.
控制器构造的第一报文进入网络设备中进行处理,具体的处理过程可参见步骤S320至S350,此处不再赘述。The first message constructed by the controller enters the network device for processing. For the specific processing process, refer to steps S320 to S350, which will not be repeated here.
应说明,由于在图6所示的架构图中,第一报文中的数据报文为虚构数据报文,所以在网络设备的出口处需要将该虚构数据报文和诊断控制信息全部丢弃,例如,网络设备将虚构数据报文和诊断控制信息删除,不用发送至网络设备外部,从而避免造成数据带宽膨胀,节省链路带宽。It should be noted that since the data message in the first message is a fictitious data message in the architecture diagram shown in FIG. 6, it is necessary to discard all the fictitious data message and diagnostic control information at the exit of the network device. For example, the network device deletes the fictitious data message and diagnostic control information without sending it to the outside of the network device, thereby avoiding data bandwidth expansion and saving link bandwidth.
图7示出了适用于本申请实施例的又一种架构图。如图7所示,触发源可以为在网络设备的入口数据通道上设置的三态内容寻址存储器(ternary content addressable memory,TCAM)。该TCAM可以通过CPU配置,例如CPU将与原始数据报文一致的标识信息(IP、MAC等)以及诊断控制信息配置给TCAM。FIG. 7 shows another architecture diagram applicable to the embodiments of the present application. As shown in FIG. 7, the trigger source may be a ternary content addressable memory (TCAM) set on the ingress data channel of the network device. The TCAM can be configured by the CPU. For example, the CPU configures identification information (IP, MAC, etc.) and diagnostic control information consistent with the original data message to the TCAM.
此时S310可以为,当数据报文进入TCAM时,若数据报文与该TCAM中的数据报文的标识信息匹配成功,则该数据报文与诊断控制信息构成第一报文,该第一报文进入网络设备中进行处理。具体的处理过程可参见步骤S320至S350,此处不再赘述。At this time, S310 may be that when a data message enters the TCAM, if the data message matches the identification information of the data message in the TCAM successfully, then the data message and the diagnostic control information constitute the first message, and the first message The message enters the network device for processing. For the specific processing process, please refer to steps S320 to S350, which will not be repeated here.
应说明,在本申请实施例中,触发源的形式仅仅为举例说明,本申请实施例对此并不作限定,只要能够针对特定业务触发诊断并产生符合要求的诊断控制信息即可。It should be noted that in the embodiment of the present application, the form of the trigger source is merely an example, and the embodiment of the present application does not limit this, as long as it can trigger a diagnosis for a specific service and generate diagnostic control information that meets the requirements.
以上结合图1至图7详细说明了本申请实施例的用于数据传输的方法。以下,结合图8将详细说明根据本申请实施例的用于数据传输的装置。The method for data transmission in the embodiment of the present application is described in detail above with reference to FIGS. 1 to 7. Hereinafter, the device for data transmission according to an embodiment of the present application will be described in detail with reference to FIG. 8.
如图8所示,装置800包括获取单元810和处理单元820。As shown in FIG. 8, the device 800 includes an acquiring unit 810 and a processing unit 820.
其中,该获取单元810用于获得第一报文。Wherein, the obtaining unit 810 is used to obtain the first message.
可选地,该第一报文包括本申请实施例中图2、图6以及图7中三种不同形式的第一报文。Optionally, the first message includes three different forms of first messages shown in FIG. 2, FIG. 6 and FIG. 7 in the embodiment of the present application.
处理单元820用于确定该第一报文对应的第一信息,该第一信息指示该网络设备对该第一报文进行处理的第一阶段;The processing unit 820 is configured to determine first information corresponding to the first packet, the first information indicating the first stage of processing the first packet by the network device;
处理单元820还用于在确定第一信息后,保存该第一信息;The processing unit 820 is further configured to save the first information after determining the first information;
处理单元820还用于在确定第一信息后,根据该第一信息对该第一报文进行处理;The processing unit 820 is further configured to process the first message according to the first information after determining the first information;
处理单元820还用于对该第一报文进行处理后,避免将该第一报文发送至网络设备外部。The processing unit 820 is further configured to avoid sending the first message to the outside of the network device after processing the first message.
可选地,处理单元820还用于确定该第一报文对应的第二信息,该第二信息指示该网络设备对该第一报文进行处理的第二阶段,该第二阶段晚于该第一阶段;Optionally, the processing unit 820 is further configured to determine second information corresponding to the first packet, the second information indicating a second stage of processing the first packet by the network device, and the second stage is later than the The first stage;
可选地,处理单元820还用于在确定第二信息后,保存该第二信息;Optionally, the processing unit 820 is further configured to save the second information after determining the second information;
其中,该第一信息和第二信息可以为网络设备中预先保存的信息。Wherein, the first information and the second information may be information pre-stored in the network device.
作为一种示例,该第一信息和第二信息可以是网络设备保存的计算机程序中包含的信息,也可以是网络设备中保存的非计算机程序(例如,转发表)中包含的信息,其中,网路设备可以为路由器或交换机,转发表可以是由路由器或媒体访问控制(MAC)表。As an example, the first information and the second information may be information contained in a computer program stored in a network device, or information contained in a non-computer program (for example, a forwarding table) stored in a network device, where: The network device can be a router or a switch, and the forwarding table can be a router or a media access control (MAC) table.
可选地,处理单元820还用于保存第三信息,该第三信息指示该第二信息对应的阶段晚于该第一信息对应的阶段;Optionally, the processing unit 820 is further configured to store third information, the third information indicating that the stage corresponding to the second information is later than the stage corresponding to the first information;
可选地,处理单元820还具体用于根据该第一信息以及该第二信息对该第一报文进行 处理。Optionally, the processing unit 820 is further specifically configured to process the first message according to the first information and the second information.
可选地,该处理单元820具体用于查找至少两张表,确定第一动作,该至少两个表包括第一表和第二表,该第二表是该第一表的下一个表;对该第一报文执行该第一动作;其中,该第一信息是该第一表的标识、第二信息是该第二表的标识、第三信息用于指示该第二信息对应的该第二表是该第一信息对应的该第一表的下一个表。Optionally, the processing unit 820 is specifically configured to look up at least two tables and determine a first action, the at least two tables include a first table and a second table, and the second table is the next table of the first table; Perform the first action on the first message; wherein, the first information is the identifier of the first table, the second information is the identifier of the second table, and the third information is used to indicate the second information corresponding to the The second table is the next table of the first table corresponding to the first information.
举例来说,处理单元820可以是网络处理器。该至少两个表被保存在该网络处理器耦合的存储器中。在一种可能的设计中,该原始数据报文可以是以太网帧。该原始数据报文包括以太网帧头以及payload。该以太网帧头包括以太网类型(EtherType)域。该第一表用于确定该payload是否包含因特网协议第四版(Internet Protocol version 4,IPv4)报文。该第一表的匹配域包括0x0800。该第一表的动作域包括第二表的标识。该第二表的标识可以是该第二表的存储地址。该第二表用于确定IPv4报文的下一跳。该第二表的匹配域包括IPv4前缀,该第二表的动作域包括下一跳的地址。该网络处理器以该以太网帧头中的EtherType域的值为查找关键字,在该第一表中确定与该以太网帧匹配的表项。当EtherType域的值为0x0800时,该网络处理器确定该payload中包含IPv4报文。并且,该网络处理器根据该第一表确定下一个表为该第二表。进而,该网络处理器从该payload中获取目的IP地址。以该目的IP地址为查找关键字,在该第二表中查找与该IPv4报文匹配的表项。当该目的IP地址与该IPv4前缀匹配时,该网络处理器确定该IPv4报文对应的下一跳。For example, the processing unit 820 may be a network processor. The at least two tables are stored in a memory coupled to the network processor. In one possible design, the original data message may be an Ethernet frame. The original data message includes the Ethernet frame header and payload. The Ethernet frame header includes an Ethernet type (EtherType) field. The first table is used to determine whether the payload contains Internet Protocol version 4 (IPv4) packets. The matching field of the first table includes 0x0800. The action field of the first table includes the identifier of the second table. The identifier of the second table may be the storage address of the second table. The second table is used to determine the next hop of the IPv4 packet. The matching field of the second table includes the IPv4 prefix, and the action field of the second table includes the address of the next hop. The network processor uses the value of the EtherType field in the Ethernet frame header as a search key, and determines an entry matching the Ethernet frame in the first table. When the value of the EtherType field is 0x0800, the network processor determines that the payload contains an IPv4 packet. Furthermore, the network processor determines that the next table is the second table according to the first table. Furthermore, the network processor obtains the destination IP address from the payload. Using the destination IP address as a search key, search for an entry that matches the IPv4 packet in the second table. When the destination IP address matches the IPv4 prefix, the network processor determines the next hop corresponding to the IPv4 packet.
可选地,该处理单元820还具体用于通过执行至少两个函数,确定第一动作,所述至少两个函数包括第一函数和第二函数,所述第二函数是所述第一函数的下一个函数;以及对所述第一报文执行所述第一动作;其中,所述第一信息是所述第一函数的标识、第二信息是所述第二函数的标识、第三信息用于指示所述第二信息对应的所述第二函数是所述第一信息对应的所述第一函数的下一个函数。Optionally, the processing unit 820 is further specifically configured to determine the first action by executing at least two functions, the at least two functions including a first function and a second function, and the second function is the first function And perform the first action on the first message; wherein the first information is the identifier of the first function, the second information is the identifier of the second function, and the third The information is used to indicate that the second function corresponding to the second information is the next function of the first function corresponding to the first information.
可选地,所述处理单元还用于:根据所述第一表的查找结果和所述第一报文确定所述第二表。Optionally, the processing unit is further configured to determine the second table according to the search result of the first table and the first message.
可选地,当网络设备获得第一报文后,根据第一报文中包括的端口标识信息确定该第一报文查找的第一表,查完第一表后得到表项数据,网络设备根据该第一表返回的表项数据和第一报文的入口信息确定该第一报文查找的第二表。Optionally, after the network device obtains the first packet, it determines the first table searched by the first packet according to the port identification information included in the first packet, and obtains the entry data after searching the first table. The network device The second table searched by the first packet is determined according to the entry data returned by the first table and the entry information of the first packet.
假设芯片内部包括A、B、C、D四张表,当网络设备接收到第一报文后,网络设备需要先确定该第一报文在这四张表中的转发路径,即第一报文在芯片中的转发路径是A-B-C-D还是A-C-B-D。网络设备先根据第一报文中包括的端口标识信息确定该第一报文查找的第一表为表A,然后网络设备根据该第一报文查找第一表(即表A)后返回的表项数据和第一报文的端口标识信息确定表A的下一张表为表B,依次类推,表B的下一张表为表C,表C的下一张表为表D,从而确定该第一报文在芯片中的查表顺序为A-B-C-D。网络设备在查表过程中会保存该第一报文查找表的表的标识信息(即第一信息和第二信息),用于指示网络设备对第一报文进行处理的路径。当芯片发生故障时,可以根据保存的第一信息清楚的知道该第一报文在芯片内部的转发路径,从而实现故障的精准定位。Assuming that the chip contains four tables A, B, C, and D, when the network device receives the first message, the network device needs to determine the forwarding path of the first message in these four tables, that is, the first message is in the four tables. Whether the forwarding path in the chip is ABCD or ACBD. The network device first determines that the first table searched by the first packet is table A according to the port identification information included in the first packet, and then the network device searches the first table (ie, table A) according to the first packet and returns The entry data and the port identification information of the first message determine that the next table of table A is table B, and so on, the next table of table B is table C, and the next table of table C is table D, so It is determined that the table lookup order of the first message in the chip is ABCD. During the table lookup process, the network device saves the identification information (ie, the first information and the second information) of the table of the first message lookup table, which is used to indicate the path for the network device to process the first message. When a chip fails, the forwarding path of the first packet inside the chip can be clearly known according to the stored first information, so as to realize accurate fault location.
可选地,该第一报文包括第一报文包括端口的标识,第一类型以及第一报文头。该处理单元820还具体用于根据端口的标识,确定与该端口对应的计算机程序;通过执行该端 口对应的计算机程序,对该第一报文头进行处理,多片信息是通过对该第一报文头进行处理获得的,该多片信息包括该第一信息;根据该第一类型,保存该第一信息,该第一信息属于该第一类型。Optionally, the first message includes the first message including the port identifier, the first type, and the first message header. The processing unit 820 is also specifically configured to determine the computer program corresponding to the port according to the port identifier; by executing the computer program corresponding to the port, the first packet header is processed, and multiple pieces of information are passed through the first packet header. The pieces of information are obtained by processing the message header, and the pieces of information include the first information; the first information is stored according to the first type, and the first information belongs to the first type.
可选地,该第一报文还包括第一指示信息,该第一指示信息用于指示该网络设备根据端口的标识,确定与该端口对应的计算机程序;该第一指示信息还用于指示该网络设备根据该第一类型,保存该第一信息。Optionally, the first message further includes first indication information, the first indication information is used to instruct the network device to determine the computer program corresponding to the port according to the port identifier; the first indication information is also used to indicate The network device saves the first information according to the first type.
可选地,该第一指示信息还用于指示该网络设备避免将该第一报文发送至该网络设备的外部。Optionally, the first indication information is also used to instruct the network device to avoid sending the first packet to the outside of the network device.
本领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不加赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of description, the specific working process of the device and unit described above can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
根据本申请实施例的装置,网络设备在确定第一报文对应的第一信息后,保存第一信息并根据第一信息对第一报文进行处理。其中,第一信息用于进行网络设备故障分析。另外,网络设备在对第一报文进行处理后,从而避免数据带宽膨胀,节省链路带宽,提高了网络设备故障诊断的性能。According to the apparatus of the embodiment of the present application, after determining the first information corresponding to the first packet, the network device saves the first information and processes the first packet according to the first information. Among them, the first information is used for network device failure analysis. In addition, after the network device processes the first message, data bandwidth expansion is avoided, link bandwidth is saved, and the performance of network device fault diagnosis is improved.
图9为本申请所涉及的网络设备的示意图。如图9所示,网络设备900包括存储器901、收发器903以及处理器902。其中,收发器903、处理器902以及存储器901通过所述总线系统905相连,所述存储器901用于存储指令,所述处理器902用于执行所述存储器901存储的指令,以控制所述收发器903接收或发送信号。Figure 9 is a schematic diagram of a network device involved in this application. As shown in FIG. 9, the network device 900 includes a memory 901, a transceiver 903, and a processor 902. The transceiver 903, the processor 902, and the memory 901 are connected through the bus system 905, the memory 901 is used to store instructions, and the processor 902 is used to execute the instructions stored in the memory 901 to control the transceiver. The device 903 receives or transmits signals.
本领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不加赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of description, the specific working process of the device and unit described above can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
本申请还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当该指令在计算机上运行时,使得计算机执行上述如图3所示的方法中网络设备执行的各个步骤。The present application also provides a computer-readable storage medium that stores instructions in the computer-readable storage medium. When the instructions are run on a computer, the computer executes each of the operations performed by the network device in the method shown in FIG. 3 above. step.
本申请还提供了一种包含指令的计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行如图3所示的方法中网络设备执行的各个步骤。This application also provides a computer program product containing instructions. When the computer program product runs on a computer, the computer executes the steps performed by the network device in the method shown in FIG. 3.
本申请还提供一种芯片,包括处理器。该处理器用于读取并运行存储器中存储的计算机程序,以执行本申请提供的通信方法中由终端设备执行的相应操作和/或流程。可选地,该芯片还包括存储器,该存储器与该处理器通过电路或电线与存储器连接,处理器用于读取并执行该存储器中的计算机程序。进一步可选地,该芯片还包括通信接口,处理器与该通信接口连接。通信接口用于接收需要处理的数据和/或信息,处理器从该通信接口获取该数据和/或信息,并对该数据和/或信息进行处理。该通信接口可以是输入输出接口。This application also provides a chip including a processor. The processor is used to read and run the computer program stored in the memory to execute the corresponding operation and/or process executed by the terminal device in the communication method provided by this application. Optionally, the chip further includes a memory, the memory and the processor are connected to the memory through a circuit or a wire, and the processor is used to read and execute the computer program in the memory. Further optionally, the chip further includes a communication interface, and the processor is connected to the communication interface. The communication interface is used to receive data and/or information that needs to be processed, and the processor obtains the data and/or information from the communication interface, and processes the data and/or information. The communication interface can be an input and output interface.
应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that, in the various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, rather than corresponding to the embodiments of the present application. The implementation process constitutes any limitation.
以上各实施例中,处理器可以为中央处理器(central processing unit,CPU)、微处理器、特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请技术方案程序执行的集成电路等。例如,处理器可以是数字信号处理器设备、微处理器设备、模数转换器、数模转换器等。处理器可以根据这些设备各自的功能而在这些设备之间分配终端设备或网络设备的控制和信号处理的功能。此外,处理器可以具有操 作一个或多个软件程序的功能,软件程序可以存储在存储器中。处理器的所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。In the above embodiments, the processor may be a central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more of them used to control the technology of the application Integrated circuits for program execution, etc. For example, the processor may be a digital signal processor device, a microprocessor device, an analog-to-digital converter, a digital-to-analog converter, etc. The processor can distribute control and signal processing functions of terminal devices or network devices among these devices according to their respective functions. In addition, the processor may have the function of operating one or more software programs, and the software programs may be stored in the memory. The functions of the processor can be realized by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-mentioned functions.
存储器可以是只读存储器(read-only memory,ROM)、可存储静态信息和指令的其它类型的静态存储设备、随机存取存储器(random access memory,RAM)或可存储信息和指令的其它类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其它磁存储设备,或者还可以是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其它介质等。The memory can be read-only memory (ROM), other types of static storage devices that can store static information and instructions, random access memory (RAM), or other types that can store information and instructions Dynamic storage devices can also be electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM), or other optical disk storage, optical disc storage ( Including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program codes in the form of instructions or data structures and can Any other medium accessed by the computer, etc.
可选的,上述实施例中涉及的存储器与存储器可以是物理上相互独立的单元,或者,存储器也可以和处理器集成在一起。Optionally, the memory and the memory involved in the foregoing embodiments may be physically independent units, or the memory may also be integrated with the processor.
本申请实施例中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示单独存在A、同时存在A和B、单独存在B的情况。其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项”及其类似表达,是指的这些项中的任意组合,包括单项或复数项的任意组合。例如,a,b和c中的至少一项可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。In the embodiments of the present application, "at least one" refers to one or more, and "multiple" refers to two or more. "And/or" describes the association relationship of the associated objects, indicating that there can be three types of relationships, for example, A and/or B, which can mean that A exists alone, A and B exist at the same time, and B exists alone. Among them, A and B can be singular or plural. The character "/" generally indicates that the associated objects are in an "or" relationship. "The following at least one item" and similar expressions refer to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, and c can represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple.
本领域普通技术人员可以意识到,本文中公开的实施例中描述的各单元及算法步骤,能够以电子硬件、计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。A person of ordinary skill in the art may be aware that the units and algorithm steps described in the embodiments disclosed herein can be implemented by a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of description, the specific working process of the above-described system, device, and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, the disclosed system, device, and method may be implemented in other ways. For example, the device embodiments described above are merely illustrative, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be omitted or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元也可以不是物理上分开的,作为单元显示的部件也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本申请技术方案的目的。The units described as separate components may not be physically separated, and the components displayed as units may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the technical solution of the present application.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, the functional units in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机 软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of this application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program code .
以上所述,仅为本申请的具体实施方式,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific implementations of this application. Any person skilled in the art can easily conceive of changes or substitutions within the technical scope disclosed in this application, which should be covered by the protection scope of this application. The protection scope of this application shall be subject to the protection scope of the claims.
Claims (22)
- 一种用于数据传输的方法,其特征在于,包括:A method for data transmission, characterized in that it comprises:网络设备获得第一报文;The network device obtains the first message;所述网络设备确定所述第一报文对应的第一信息,所述第一信息指示所述网络设备对所述第一报文进行处理的第一阶段;Determining, by the network device, first information corresponding to the first packet, the first information indicating the first stage of processing the first packet by the network device;所述网络设备保存所述第一信息,并根据所述第一信息对所述第一报文进行处理;The network device saves the first information, and processes the first message according to the first information;所述网络设备避免将所述第一报文发送至所述网络设备的外部。The network device avoids sending the first message to the outside of the network device.
- 根据权利要求1所述的方法,其特征在于,还包括:The method according to claim 1, further comprising:所述网络设备确定所述第一报文对应的第二信息,所述第二信息指示所述网络设备对所述第一报文进行处理的第二阶段,所述第二阶段晚于所述第一阶段;The network device determines second information corresponding to the first packet, and the second information indicates a second stage in which the network device processes the first packet, and the second stage is later than the The first stage;所述网络设备保存所述第二信息;Storing the second information by the network device;其中,所述网络设备根据所述第一信息对所述第一报文进行处理,包括:The processing by the network device on the first message according to the first information includes:所述网络设备根据所述第一信息以及所述第二信息对所述第一报文进行处理。The network device processes the first message according to the first information and the second information.
- 根据权利要求2所述的方法,其特征在于,所述网络设备保存第三信息,所述第三信息指示所述第二信息对应的阶段晚于所述第一信息对应的阶段。The method according to claim 2, wherein the network device stores third information, the third information indicating that the phase corresponding to the second information is later than the phase corresponding to the first information.
- 根据权利要求2或3所述的方法,其特征在于,所述网络设备根据所述第一信息以及所述第二信息对所述第一报文进行处理,包括:The method according to claim 2 or 3, wherein the network device processing the first message according to the first information and the second information comprises:所述网络设备通过查找至少两个表,确定第一动作,所述至少两个表包括第一表和第二表,所述第二表是所述第一表的下一个表;以及The network device determines the first action by looking up at least two tables, the at least two tables including a first table and a second table, and the second table is the next table of the first table; and所述网络设备对所述第一报文执行所述第一动作;其中,The network device performs the first action on the first message; wherein,所述第一信息是所述第一表的标识、所述第二信息是所述第二表的标识、所述第三信息用于指示所述第二信息对应的所述第二表是所述第一信息对应的所述第一表的下一个表。The first information is the identifier of the first table, the second information is the identifier of the second table, and the third information is used to indicate that the second table corresponding to the second information is the The next table of the first table corresponding to the first information.
- 根据权利要求2-4中任一所述的方法,其特征在于,所述网络设备根据所述第一信息以及所述第二信息对所述第一报文进行处理,包括:The method according to any one of claims 2-4, wherein the processing by the network device on the first message according to the first information and the second information comprises:所述网络设备通过执行至少两个函数,确定第一动作,所述至少两个函数包括第一函数和第二函数,所述第二函数是所述第一函数的下一个函数;以及The network device determines the first action by executing at least two functions, the at least two functions including a first function and a second function, the second function being the next function of the first function; and所述网络设备对所述第一报文执行所述第一动作;其中,The network device performs the first action on the first message; wherein,所述第一信息是所述第一函数的标识、所述第二信息是所述第二函数的标识、所述第三信息用于指示所述第二信息对应的所述第二函数是所述第一信息对应的所述第一函数的下一个函数。The first information is the identifier of the first function, the second information is the identifier of the second function, and the third information is used to indicate that the second function corresponding to the second information is the The next function of the first function corresponding to the first information.
- 根据权利要求4所述的方法,其特征在于,所述网络设备通过查找至少两个表,确定第一动作之前,所述方法还包括:The method according to claim 4, wherein before the network device determines the first action by looking up at least two tables, the method further comprises:所述网络设备根据所述第一表的查找结果和所述第一报文确定所述第二表。The network device determines the second table according to the search result of the first table and the first message.
- 根据权利要求1至6中任一项所述的方法,其特征在于,所述第一报文包括端口的标识,第一类型以及第一报文头;The method according to any one of claims 1 to 6, wherein the first message includes a port identifier, a first type, and a first message header;所述网络设备根据所述第一信息对所述第一报文进行处理,包括:The processing by the network device on the first message according to the first information includes:所述网络设备根据所述端口的标识,确定与所述端口对应的计算机程序;The network device determines the computer program corresponding to the port according to the port identifier;所述网络设备通过执行所述端口对应的计算机程序,对所述第一报文头进行处理,多片信息是通过对所述第一报文头进行处理获得的,所述多片信息包括所述第一信息;The network device processes the first packet header by executing the computer program corresponding to the port, and multiple pieces of information are obtained by processing the first packet header, and the multiple pieces of information include all pieces of information. The first information;所述网络设备根据所述第一类型,保存所述第一信息,所述第一信息属于所述第一类型。The network device stores the first information according to the first type, and the first information belongs to the first type.
- 根据权利要求7所述的方法,其特征在于,所述第一报文还包括第一指示信息,所述第一指示信息用于指示所述网络设备根据所述端口的标识,确定与所述端口对应的计算机程序;The method according to claim 7, wherein the first message further includes first indication information, and the first indication information is used to instruct the network device to determine the connection with the port according to the identifier of the port. Computer program corresponding to the port;所述第一指示信息还用于指示所述网络设备根据所述第一类型,保存所述第一信息。The first indication information is also used to instruct the network device to save the first information according to the first type.
- 根据权利要求8所述的方法,其特征在于,所述第一指示信息还用于指示所述网络设备避免将所述第一报文发送至所述网络设备的外部。The method according to claim 8, wherein the first indication information is further used to instruct the network device to avoid sending the first packet to the outside of the network device.
- 根据权利要求1至9中任一项所述的方法,其特征在于,所述方法用于内联网遥测/带内操作管理维护INT/IOAM。The method according to any one of claims 1 to 9, wherein the method is used for intranet telemetry/in-band operation management and maintenance INT/IOAM.
- 一种用于数据传输的装置,其特征在于,其特征在于,包括:A device for data transmission, characterized in that it comprises:获取单元,用于获得第一报文;The obtaining unit is used to obtain the first message;处理单元,用于确定第一报文对应的第一信息,所述第一信息指示所述网络设备对所述第一报文进行处理的第一阶段;A processing unit, configured to determine first information corresponding to a first packet, the first information indicating the first stage of processing the first packet by the network device;所述处理单元还用于保存所述第一信息,并根据所述第一信息对所述第一报文进行处理;避免将所述第一报文发送至网络设备外部。The processing unit is further configured to save the first information, and process the first message according to the first information; avoid sending the first message to the outside of the network device.
- 根据权利要求11所述的装置,其特征在于,所述处理单元还用于:The device according to claim 11, wherein the processing unit is further configured to:确定所述第一报文对应的第二信息,所述第二信息指示所述网络设备对所述第一报文进行处理的第二阶段,所述第二阶段晚于所述第一阶段;Determining second information corresponding to the first message, the second information indicating a second stage of processing the first message by the network device, the second stage being later than the first stage;在确定所述第二信息后,保存所述第二信息;After determining the second information, save the second information;所述处理单元具体用于:The processing unit is specifically used for:根据所述第一信息以及所述第二信息对所述第一报文进行处理。The first message is processed according to the first information and the second information.
- 根据权利要求12所述的装置,其特征在于,所述处理单元还用于:保存第三信息,所述第三信息指示所述第二信息对应的阶段晚于所述第一信息对应的阶段。The device according to claim 12, wherein the processing unit is further configured to store third information, the third information indicating that the phase corresponding to the second information is later than the phase corresponding to the first information .
- 根据权利要求12或13所述的装置,其特征在于,所述处理单元具体用于:The device according to claim 12 or 13, wherein the processing unit is specifically configured to:通过查找至少两个表,确定第一动作,所述至少两个表包括第一表和第二表,所述第二表是所述第一表的下一个表;以及Determine the first action by looking up at least two tables, the at least two tables including a first table and a second table, the second table being the next table of the first table; and对所述第一报文执行所述第一动作;其中,Perform the first action on the first message; wherein,所述第一信息是所述第一表的标识、所述第二信息是所述第二表的标识、所述第三信息用于指示所述第二信息对应的所述第二表是所述第一信息对应的所述第一表的下一个表。The first information is the identifier of the first table, the second information is the identifier of the second table, and the third information is used to indicate that the second table corresponding to the second information is the The next table of the first table corresponding to the first information.
- 根据权利要求12-14中任一所述的装置,其特征在于,所述处理单元具体用于:The device according to any one of claims 12-14, wherein the processing unit is specifically configured to:通过执行至少两个函数,确定第一动作,所述至少两个函数包括第一函数和第二函数,所述第二函数是所述第一函数的下一个函数;以及Determining the first action by executing at least two functions, the at least two functions including a first function and a second function, the second function being the next function of the first function; and对所述第一报文执行所述第一动作;其中,Perform the first action on the first message; wherein,所述第一信息是所述第一函数的标识、所述第二信息是所述第二函数的标识、所述第三信息用于指示所述第二信息对应的所述第二函数是所述第一信息对应的所述第一函数 的下一个函数。The first information is the identifier of the first function, the second information is the identifier of the second function, and the third information is used to indicate that the second function corresponding to the second information is the The next function of the first function corresponding to the first information.
- 根据权利要求14所述的装置,其特征在于,所述处理单元还用于:The device according to claim 14, wherein the processing unit is further configured to:根据所述第一表的查找结果和所述第一报文确定所述第二表。The second table is determined according to the search result of the first table and the first message.
- 根据权利要求11至16中任一项所述的装置,其特征在于,所述第一报文包括端口的标识,第一类型以及第一报文头;The device according to any one of claims 11 to 16, wherein the first message includes a port identifier, a first type, and a first message header;所述处理单元具体用于:The processing unit is specifically used for:根据所述端口的标识,确定与所述端口对应的计算机程序;Determine the computer program corresponding to the port according to the identifier of the port;通过执行所述端口对应的计算机程序,对所述第一报文头进行处理,多片信息是通过对所述第一报文头进行处理获得的,所述多片信息包括所述第一信息;The first packet header is processed by executing the computer program corresponding to the port, and multiple pieces of information are obtained by processing the first packet header, and the multiple pieces of information include the first information ;根据所述第一类型,保存所述第一信息,所述第一信息属于所述第一类型。According to the first type, the first information is stored, and the first information belongs to the first type.
- 根据权利要求17所述的装置,其特征在于,所述第一报文还包括第一指示信息,所述第一指示信息用于指示所述网络设备根据所述端口的标识,确定与所述端口对应的计算机程序;The apparatus according to claim 17, wherein the first message further includes first indication information, and the first indication information is used to instruct the network device to determine the connection with the port according to the identifier of the port. Computer program corresponding to the port;所述第一指示信息还用于指示所述网络设备根据所述第一类型,保存所述第一信息。The first indication information is also used to instruct the network device to save the first information according to the first type.
- 根据权利要求18所述的装置,其特征在于,所述第一指示信息还用于指示所述网络设备避免将所述第一报文发送至所述网络设备的外部。The apparatus according to claim 18, wherein the first indication information is further used to instruct the network device to avoid sending the first message to the outside of the network device.
- 根据权利要求11至19中任一项所述的装置,其特征在于,所述装置位于网络设备中。The device according to any one of claims 11 to 19, wherein the device is located in a network device.
- 一种网络设备,其特征在于,包括:A network device, characterized by comprising:存储器,用于存储计算机程序;Memory, used to store computer programs;处理器,用于执行所述存储器中存储的计算机程序,以使得所述装置执行如权利要求1至10中任一项所述的用于数据传输的方法。The processor is configured to execute a computer program stored in the memory, so that the device executes the method for data transmission according to any one of claims 1 to 10.
- 一种计算机可读存储介质,包括计算机程序,当其在计算机上运行时,使得所述计算机执行如权利要求1至10中任一项所述的用于数据传输的方法。A computer-readable storage medium, comprising a computer program, which when running on a computer, causes the computer to execute the method for data transmission according to any one of claims 1 to 10.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910736136.1 | 2019-08-09 | ||
CN201910736136.1A CN112350844B (en) | 2019-08-09 | 2019-08-09 | Method and device for data transmission |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021027420A1 true WO2021027420A1 (en) | 2021-02-18 |
Family
ID=74367028
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/099391 WO2021027420A1 (en) | 2019-08-09 | 2020-06-30 | Method and device used for transmitting data |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112350844B (en) |
WO (1) | WO2021027420A1 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113364778B (en) * | 2021-06-07 | 2022-07-29 | 新华三技术有限公司 | Message processing method and device |
CN115550153A (en) * | 2021-06-29 | 2022-12-30 | 中兴通讯股份有限公司 | Message processing method, network processor and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108521371A (en) * | 2018-03-09 | 2018-09-11 | 新华三技术有限公司 | Message forwarding method and device |
US20180367371A1 (en) * | 2017-06-16 | 2018-12-20 | Cisco Technology, Inc. | Handling controller and node failure scenarios during data collection |
CN109309605A (en) * | 2018-11-26 | 2019-02-05 | 北京邮电大学 | Band network telemetry system and method |
CN109743340A (en) * | 2019-04-04 | 2019-05-10 | 华为技术有限公司 | The method and network equipment of Message processing |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107769987B (en) * | 2016-08-16 | 2021-05-11 | 深圳市中兴微电子技术有限公司 | Message forwarding performance evaluation method and device |
CN108111432B (en) * | 2017-12-27 | 2021-07-02 | 新华三技术有限公司 | Message forwarding method and device |
CN108449228B (en) * | 2018-03-05 | 2020-03-17 | 新华三技术有限公司 | Message processing method and network equipment |
-
2019
- 2019-08-09 CN CN201910736136.1A patent/CN112350844B/en active Active
-
2020
- 2020-06-30 WO PCT/CN2020/099391 patent/WO2021027420A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180367371A1 (en) * | 2017-06-16 | 2018-12-20 | Cisco Technology, Inc. | Handling controller and node failure scenarios during data collection |
CN108521371A (en) * | 2018-03-09 | 2018-09-11 | 新华三技术有限公司 | Message forwarding method and device |
CN109309605A (en) * | 2018-11-26 | 2019-02-05 | 北京邮电大学 | Band network telemetry system and method |
CN109743340A (en) * | 2019-04-04 | 2019-05-10 | 华为技术有限公司 | The method and network equipment of Message processing |
Also Published As
Publication number | Publication date |
---|---|
CN112350844A (en) | 2021-02-09 |
CN112350844B (en) | 2024-03-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10469367B2 (en) | Segment routing network processing of packets including operations signaling and processing of packets in manners providing processing and/or memory efficiencies | |
US11228515B2 (en) | Data packet detection method, device, and system | |
US7668107B2 (en) | Hardware implementation of network testing and performance monitoring in a network device | |
JP2021166390A (en) | Bit-forwarding ingress router, bit-forwarding router, and method of operation, administration, maintenance, and test | |
JP4774357B2 (en) | Statistical information collection system and statistical information collection device | |
US7701936B2 (en) | Obtaining path information related to a bridged network | |
WO2017206841A1 (en) | Method and device for determining quality of service of network apparatus | |
US20080101241A1 (en) | Ethernet OAM at intermediate nodes in a PBT network | |
US9680720B1 (en) | Operations, administration, and maintenance (OAM) engine | |
CN107171883B (en) | Method, device and equipment for detecting forwarding table | |
CN110557342B (en) | Apparatus for analyzing and mitigating dropped packets | |
US20050276230A1 (en) | Communication statistic information collection apparatus | |
US20220255857A1 (en) | Packet Processing Method, Network Node, and System | |
WO2017000802A1 (en) | Service fault location method and device | |
CN113542049B (en) | Method for detecting packet loss in computer network, network device and storage medium | |
WO2021027420A1 (en) | Method and device used for transmitting data | |
CN111614505B (en) | Message processing method and gateway equipment | |
JPWO2011052729A1 (en) | Packet relay device, packet relay method and program | |
US11909650B2 (en) | Internet protocol operations and management option | |
US11784937B2 (en) | Dropped packet detection and classification for networked devices | |
US11283720B1 (en) | Methods and systems for accelerated health monitoring for load balancers | |
EP4371284A1 (en) | Path assurance in shared transport | |
WO2020242653A1 (en) | Trace routing in virtual networks | |
WO2024000139A1 (en) | Packet forwarding | |
WO2023287719A1 (en) | Path assurance in shared transport |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20852874 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20852874 Country of ref document: EP Kind code of ref document: A1 |