CN117135094A - In-band detection implementation method and device, network communication equipment and readable storage medium - Google Patents

In-band detection implementation method and device, network communication equipment and readable storage medium Download PDF

Info

Publication number
CN117135094A
CN117135094A CN202311137083.4A CN202311137083A CN117135094A CN 117135094 A CN117135094 A CN 117135094A CN 202311137083 A CN202311137083 A CN 202311137083A CN 117135094 A CN117135094 A CN 117135094A
Authority
CN
China
Prior art keywords
band detection
band
expected
message
field
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311137083.4A
Other languages
Chinese (zh)
Inventor
何志川
徐海青
李磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Centec Communications Co Ltd
Original Assignee
Suzhou Centec Communications Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Centec Communications Co Ltd filed Critical Suzhou Centec Communications Co Ltd
Priority to CN202311137083.4A priority Critical patent/CN117135094A/en
Publication of CN117135094A publication Critical patent/CN117135094A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/18Protocol analysers

Landscapes

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

Abstract

The application provides an in-band detection implementation method and device, network communication equipment and a readable storage medium, and relates to the technical field of network communication. When the received data message to be transmitted is determined to substantially meet the in-band detection operation requirement matched with the expected in-band detection protocol type, the field insertion position offset of the preset detection field content corresponding to the expected in-band detection protocol type at the data message to be transmitted is determined, then the message editing table entry corresponding to the expected in-band detection protocol type is directly called, the preset detection field content is inserted into the data message to be transmitted based on the determined field insertion position offset for message forwarding, and therefore the same editing table entry is utilized for editing the same field content corresponding to the expected in-band detection protocol type in the data message to be transmitted of different message protocol types to realize in-band detection operation, so that the table entry resource consumption of network communication equipment is reduced, and the in-band detection capability of the network communication equipment is improved.

Description

In-band detection implementation method and device, network communication equipment and readable storage medium
Technical Field
The present application relates to the field of network communications technologies, and in particular, to a method and apparatus for implementing in-band detection, a network communications device, and a readable storage medium.
Background
With the continuous development of scientific technology, the current network communication technology puts higher demands on network quality so as to ensure that corresponding network quality can support high network quality demand services such as industrial interconnection services, high-definition video services, internet of vehicles services and the like. On this basis, the network operators generally need to sense the network quality in real time and adjust the network link condition according to the service requirements in time, so as to ensure that the high-network-quality service can be normally implemented.
Currently, a network operator generally superimposes field contents corresponding to an in-band network measurement protocol on a data packet to be forwarded by using the in-band network measurement protocol, so that the data packet to be forwarded can carry the field contents of the in-band network measurement protocol to be transmitted in a monitored network, thereby sensing the actual network quality of the monitored network in real time.
It should be noted that, because of many common message protocol types (for example, IPv4 message protocol, IPv6 message protocol, MPLS (Multi-Protocal Label Switching) message protocol, SRv message protocol, etc.), and many common measurement protocol types (for example, INT (In-band Network Telemetry) detection protocol, IFA (In-band Flow Analyzer) detection protocol, alternate measurement detection protocol, etc.) of In-band network measurement protocols, the network operator needs to separately create, at the network communication device as a network monitoring node, a message editing table entry corresponding to each data message protocol type under different In-band network measurement protocol types, so as to ensure that, by using the created message editing table entry, a data message to be forwarded of the data message protocol type can be edited into an In-band network detection message required by the corresponding In-band network measurement protocol type. In this case, the network communication device needs to consume a large amount of table entry resources to record the message editing table entries of various in-band network measurement protocol types configured separately for different data message protocol types, and there is a problem of table entry resource waste.
Disclosure of Invention
Accordingly, an object of the present application is to provide a method and apparatus for implementing in-band detection, a network communication device, and a readable storage medium, which can edit the same field content corresponding to the expected in-band detection protocol type in the data messages to be transmitted with different message protocol types by using the same editing table entry, so that the data messages to be transmitted with different message protocol types can perform in-band detection operation under the action of the same editing table entry, thereby effectively reducing the table entry resource consumption of the network communication device, and improving the in-band detection capability of the network communication device.
In order to achieve the above object, the technical scheme adopted by the embodiment of the application is as follows:
in a first aspect, the present application provides a method for implementing in-band detection, applied to a network communication device, where the method includes:
for each received data message to be transmitted, detecting whether the data message to be transmitted accords with the in-band detection operation requirement of the expected in-band detection protocol type;
under the condition that the data message to be transmitted accords with the in-band detection operation requirement matched with the expected in-band detection protocol type, determining a field insertion position offset of the preset detection field content corresponding to the expected in-band detection protocol type at the data message to be transmitted;
Calling a message editing table item corresponding to the expected in-band detection protocol type, and inserting the content of the preset detection field into the data message to be transmitted based on the field insertion position offset;
and forwarding the data message to be transmitted after finishing the detection field insertion operation so as to realize in-band detection operation aiming at the expected in-band detection protocol type.
In an optional embodiment, the network communication device stores in-band detection matching rules corresponding to different in-band detection protocol types, and the step of detecting whether the data packet to be transmitted meets the in-band detection job requirement of the expected in-band detection protocol type includes:
extracting a target matching rule corresponding to the expected in-band detection protocol type from all stored in-band detection matching rules;
extracting message quintuple information of the data message to be transmitted, and carrying out information matching on the extracted message quintuple information and the target matching rule;
if the extracted message quintuple information is successfully matched with the target matching rule, judging that the data message to be transmitted accords with the in-band detection operation requirement of the expected in-band detection protocol type, otherwise, judging that the data message to be transmitted does not accord with the in-band detection operation requirement of the expected in-band detection protocol type.
In an alternative embodiment, the step of determining the field insertion position offset of the preset detection field content corresponding to the expected in-band detection protocol type at the to-be-transmitted data packet includes:
searching the position offset of a field to be screened matched with the actual message protocol type in all stored preset field position offsets according to the actual message protocol type of the data message to be transmitted;
screening out a target field position offset matched with the expected in-band detection protocol type from the searched field position offset to be screened;
and taking the target field position offset as the field insertion position offset.
In an optional implementation manner, the network communication device stores message editing table entries corresponding to different in-band detection protocol types, each message editing table entry records a reference insertion position extraction policy corresponding to an in-band detection protocol type, and the step of calling a message editing table entry corresponding to the expected in-band detection protocol type and inserting the preset detection field content into the data message to be transmitted based on the field insertion position offset includes:
Extracting target editing list items corresponding to the expected in-band detection protocol types from all stored message editing list items;
according to the reference insertion position extraction strategy of the target editing list item record, determining a field insertion reference position corresponding to the expected in-band detection protocol type in the data message to be transmitted;
performing position offset processing on the field insertion reference position according to the field insertion position offset to obtain an expected field insertion position of preset detection field content in the data message to be transmitted, wherein the preset detection field content corresponds to the expected in-band detection protocol type;
and inserting the content of a preset detection field corresponding to the expected in-band detection protocol type into an expected field insertion position of the data message to be transmitted.
In an alternative embodiment, the method further comprises:
acquiring an in-band network detection request input from outside, wherein the in-band network detection request comprises an in-band detection protocol type to be used;
and taking the type of the in-band detection protocol to be used as the expected type of the in-band detection protocol of the network communication equipment.
In an alternative embodiment, the method further comprises:
And configuring in-band detection matching rules, preset detection field contents and message editing table items of the network communication equipment under different in-band detection protocol types, and configuring preset field position offset of the network communication equipment under different in-band detection protocol types and different bearer message protocol types.
In a second aspect, the present application provides an in-band detection implementation apparatus, applied to a network communication device, the apparatus comprising:
the in-band detection matching module is used for detecting whether the data message to be transmitted accords with the in-band detection operation requirement of the expected in-band detection protocol type or not according to each received data message to be transmitted;
the in-band detection matching module is further configured to determine a field insertion position offset of a preset detection field content corresponding to the expected in-band detection protocol type at the position of the data packet to be transmitted, when it is detected that the data packet to be transmitted meets an in-band detection operation requirement that the expected in-band detection protocol type matches;
the in-band message editing module is used for calling a message editing table item corresponding to the expected in-band detection protocol type, and inserting the content of the preset detection field into the data message to be transmitted based on the field insertion position offset;
And the data transmission communication module is used for forwarding the data message to be transmitted after the detection field insertion operation is completed, so as to realize in-band detection operation aiming at the expected in-band detection protocol type.
In an alternative embodiment, the apparatus further comprises:
the data transmission communication module is further used for acquiring an in-band network detection request input from outside, wherein the in-band network detection request comprises an in-band detection protocol type to be used;
the in-band detection matching module is further configured to use the type of in-band detection protocol to be used as a desired type of in-band detection protocol of the network communication device.
In an alternative embodiment, the apparatus further comprises:
the in-band detection matching module is further configured to configure in-band detection matching rules, preset detection field contents and message editing table entries of the network communication device under different in-band detection protocol types, and configure preset field position offsets of the network communication device under different in-band detection protocol types and different bearer message protocol types.
In a third aspect, the present application provides a network communication device, including a processor, a memory, and a communication unit, where the communication unit is configured to implement a packet transceiving function;
The memory stores a computer program executable by the processor to implement the in-band detection implementation method of any of the preceding embodiments.
In a fourth aspect, the present application provides a readable storage medium having stored thereon a computer program which, when executed by a network communication device, implements the in-band detection implementation method of any of the foregoing embodiments.
In this case, the beneficial effects of the embodiments of the present application may include the following:
when the received data message to be transmitted substantially meets the in-band detection operation requirement matched with the expected in-band detection protocol type, the method and the device determine the field insertion position offset of the preset detection field content corresponding to the expected in-band detection protocol type at the data message to be transmitted, then directly call the message editing list item corresponding to the expected in-band detection protocol type, insert the preset detection field content into the data message to be transmitted based on the determined field insertion position offset, and forward the data message to be transmitted after the detection field insertion operation is completed, so that the same field content corresponding to the expected in-band detection protocol type is edited in the data messages to be transmitted of different message protocol types by using the same editing list item, the in-band detection operation of the data messages to be transmitted of different message protocol types can be performed under the action of the same editing list item, so that the list item resource consumption of network communication equipment is effectively reduced, and the in-band detection capability of the network communication equipment is improved.
In order to make the above objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of a network communication device according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of an in-band detection implementation method according to an embodiment of the present application;
fig. 3 is a flow chart illustrating the sub-steps included in step S210 in fig. 2;
fig. 4 is a flow chart illustrating the sub-steps included in step S220 in fig. 2;
fig. 5 is a flow chart illustrating the sub-steps included in step S230 in fig. 2;
FIG. 6 is a schematic diagram illustrating an operation of a detection field insertion operation according to an embodiment of the present application;
FIG. 7 is a second flowchart of an in-band detection implementation method according to an embodiment of the present application;
FIG. 8 is a third flow chart of an in-band detection implementation method according to an embodiment of the present application;
fig. 9 is a schematic diagram of an in-band detection implementation device according to an embodiment of the present application.
Icon: 10-a network communication device; 11-memory; 12-a processor; 13-a communication unit; 100-in-band detection realizing device; 110-in-band detection matching module; 120-an in-band message editing module; 130-a data transmission communication module.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. The components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
In the description of the present application, it should be understood that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. The specific meaning of the above terms in the present application will be understood in specific cases by those of ordinary skill in the art.
Some embodiments of the present application are described in detail below with reference to the accompanying drawings. The embodiments described below and features of the embodiments may be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating a network communication device 10 according to an embodiment of the application. In the embodiment of the present application, the network communication device 10 may implement a network communication function through a message forwarding operation, and at the same time, the network communication device 10 may implement an in-band detection operation conforming to a specific in-band network measurement protocol type by performing a message editing operation of the specific in-band network measurement protocol type on a received specific data message, so as to edit the specific data message into an in-band network detection message required by the specific in-band network measurement protocol type, and perform a message forwarding process on the in-band network detection message. The specific data message for executing the message editing operation needs to meet the in-band detection operation requirement of the specific in-band network measurement protocol type; the particular in-band network measurement protocol type may be a default in-band detection protocol type used by the network communication device 10 at runtime, or may be a certain in-band detection protocol type specified by a user of the network communication device 10 from among a plurality of in-band detection protocol types, which may include an INT detection protocol, an IFA detection protocol, an alternate measurement detection protocol, etc.
In an embodiment of the present application, the network communication device 10 may include a memory 11, a processor 12, a communication unit 13, and an in-band detection implementation apparatus 100. The memory 11, the processor 12, and the communication unit 13 are electrically connected directly or indirectly to each other, so as to realize data transmission or interaction. For example, the memory 11, the processor 12 and the communication unit 13 may be electrically connected to each other through one or more communication buses or signal lines.
In this embodiment, the Memory 11 may be, but is not limited to, a random access Memory (Random Access Memory, RAM), a Read Only Memory (ROM), a programmable Read Only Memory (Programmable Read-Only Memory, PROM), an erasable Read Only Memory (Erasable Programmable Read-Only Memory, EPROM), an electrically erasable Read Only Memory (Electric Erasable Programmable Read-Only Memory, EEPROM), or the like. Wherein the memory 11 is configured to store a computer program, and the processor 12, upon receiving an execution instruction, can execute the computer program accordingly.
The memory 11 may be further configured to store in-band detection matching rules corresponding to different in-band detection protocol types, where each in-band detection matching rule is used to detect whether a data packet to be transmitted meets an in-band detection job requirement of the corresponding in-band detection protocol type, that is, to detect whether the data packet to be transmitted is suitable for executing a packet editing operation of the corresponding in-band detection protocol type. In one implementation of this embodiment, the in-band detection matching rules may be configured with access control list (Access Control List, ACL) matching rules.
The memory 11 may be further configured to store preset detection field contents corresponding to different in-band detection protocol types. For example, the preset detection field content corresponding to the alternate measurement detection protocol may include specific field content of each of a Flow ID, a Loss Flag, and a Delay Flag, where the Flow ID is used to identify an identity of a corresponding data packet in an in-band network detection process, the Loss Flag is used to perform packet Loss measurement statistics on the corresponding data packet by 0/1 mark staining, and the Delay Flag is used to determine whether measurement Delay is needed for the corresponding data packet by 1/0 mark staining; the preset detection field content corresponding to the INT detection protocol may include specific field content of Switch ID, ingress Port ID, ingess Timestamp, egress Port ID, egress Timestamp, and Quue ID, where the Switch ID is an identity of a corresponding network communication device, the Ingress Port ID is a receiving Port identifier of the corresponding data packet at the network communication device, the Ingess Timestamp is a receiving time stamp of the corresponding data packet at the network communication device, the Egress Port ID is a forwarding time stamp of the corresponding data packet at the network communication device, and the Egress Timestamp is a buffer Queue identifier of the corresponding data packet at the network communication device; the preset detection field content corresponding to the IFA detection protocol may include specific field content of each of a Request Vector, an Action Vector, and a Hop Limit, where the Request Vector is a Request Vector of a corresponding data packet at a network communication device, the Action Vector is an Action Vector of the corresponding data packet at the network communication device, and the Hop Limit is a number-limiting size of the corresponding data packet at the network communication device.
Meanwhile, the memory 11 may be further configured to store preset field position offsets of preset detection field contents corresponding to different in-band detection protocol types under various bearer message protocol types (may include an IPv4 message protocol, an IPv6 message protocol, an MPLS message protocol, a SRv message protocol, etc.), where the preset field position offsets are used to describe position offsets between a field insertion reference position and an actual field insertion position when a data packet corresponding to the bearer message protocol type implements in-band detection operation corresponding to the in-band detection protocol type. The field insertion reference positions of different in-band detection protocol types in the data messages of the same bearing message protocol type can be the same or different. For example, the field insertion reference position of the alternative measurement detection protocol in the data messages of various bearer message protocol types may be a three-layer message header position, and the field insertion reference position of the INT detection protocol in the data messages of various bearer message protocol types may be a four-layer message header position. In one implementation manner of this embodiment, the network communication device may store the preset detection field contents corresponding to each of the different in-band detection protocol types and the preset field position offsets of the preset detection field contents corresponding to each of the different in-band detection protocol types under the various bearer message protocol types in the same data table.
In addition, the memory 11 may be further configured to store message editing entries corresponding to different in-band detection protocol types, where each message editing entry records a reference insertion position extraction policy corresponding to an in-band detection protocol type, so as to extract a field insertion reference position in a data message of a different bearer message protocol type according to the reference insertion position extraction policy. When the same reference insertion position extraction strategy is applied to data messages of different bearer message protocol types, the field insertion reference positions which are correspondingly extracted are consistent, so that the message editing list item where the reference insertion position extraction strategy is located can be shared by various bearer message protocol types. At this time, each of the different in-band detection protocol types corresponds to only one message editing table entry at the memory 11, and the memory 11 may store and record the message editing table entries corresponding to each of the different in-band detection protocol types in the same message editing table.
In this embodiment, the processor 12 may be an integrated circuit chip having signal processing capabilities. The processor 12 may be a general purpose processor including at least one of a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU) and a network processor (Network Processor, NP), a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like that may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present application.
In this embodiment, the communication unit 13 is configured to establish a communication connection between the network communication device 10 and other electronic devices through a network, and send and receive data through the network, where the network includes a wired communication network and a wireless communication network. Thus, the network communication device 10 can implement a messaging function through the communication unit 13.
In this embodiment, the in-band detection implementation means 100 includes at least one software functional module that can be stored in the memory 11 in the form of software or firmware or cured in the operating system of the network communication device 10. The processor 12 may be configured to execute executable modules stored in the memory 11, such as software functional modules and computer programs included in the in-band detection implementation device 100. The network communication device 10 may edit the same field content corresponding to the expected in-band detection protocol type in the to-be-transmitted data messages of different message protocol types by using the same editing table entry through the in-band detection implementation apparatus 100, so that the to-be-transmitted data messages of different message protocol types perform in-band detection operation under the action of the same editing table entry, so as to effectively reduce the table entry resource consumption of the network communication device 10, and improve the in-band detection capability of the network communication device 10 for the message flows of different message protocol types.
It will be appreciated that the block diagram shown in fig. 1 is merely a schematic diagram of one component of the network communication device 10, and that the network communication device 10 may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof.
In the present application, in order to ensure that the network communication device 10 can edit the same field content corresponding to the expected in-band detection protocol type in the to-be-transmitted data messages of different message protocol types by using the same editing table entry, so that the to-be-transmitted data messages of different message protocol types perform in-band detection operation under the action of the same editing table entry, thereby effectively reducing the table entry resource consumption of the network communication device 10, and improving the in-band detection capability of the network communication device 10 for message flows of different message protocol types. The method for realizing in-band detection provided by the application is described in detail below.
Referring to fig. 2, fig. 2 is a flow chart of an in-band detection implementation method according to an embodiment of the application. In the embodiment of the present application, the in-band detection implementation method may include steps S210 to S240.
Step S210, for each received data packet to be transmitted, detects whether the data packet to be transmitted meets the in-band detection job requirement of the expected in-band detection protocol type.
In this embodiment, the expected in-band detection protocol type is an actual in-band detection protocol type currently used by the network communication device 10 and required to achieve an in-band detection job effect, and the expected in-band detection protocol type may be an in-band detection protocol type used by the network communication device 10 by default in operation, or may be an in-band detection protocol type specified by a user of the network communication device 10 from a plurality of in-band detection protocol types.
The network communication device 10 may store in-band detection matching rules corresponding to the in-band detection protocol types, so that when the network communication device 10 receives a data packet to be transmitted, it uses the in-band detection matching rule of the current expected in-band detection protocol type to perform packet feature matching processing on the data packet to be transmitted to determine whether the data packet to be transmitted is suitable for implementing the in-band detection operation effect of the expected in-band detection protocol type.
Optionally, referring to fig. 3, fig. 3 is a flowchart illustrating sub-steps included in step S210 in fig. 2. In the embodiment of the present application, the step S210 may include sub-steps S211 to S213 to effectively detect whether the data packet to be transmitted is suitable for implementing the in-band detection operation effect of the desired in-band detection protocol type.
Sub-step S211 extracts a target matching rule corresponding to the desired in-band detection protocol type from all stored in-band detection matching rules.
And S212, extracting message quintuple information of the data message to be transmitted, and carrying out information matching on the extracted message quintuple information and the target matching rule.
The network communication device 10 may analyze the data message to be transmitted by using a built-in syntax analysis program to obtain message quintuple information of the data message to be transmitted, where the message quintuple information includes a source IP address, a source MAC address, a destination IP address, a destination MAC address and a transport layer protocol type corresponding to the data message to be transmitted. In one implementation manner of this embodiment, the syntax analysis program may be carried by a parser module, and the packet analysis function of the syntax analysis program is implemented by the parser module.
And S213, if the extracted message quintuple information is successfully matched with the target matching rule, judging that the data message to be transmitted meets the in-band detection operation requirement of the expected in-band detection protocol type, otherwise, judging that the data message to be transmitted does not meet the in-band detection operation requirement of the expected in-band detection protocol type.
Therefore, the application can effectively detect whether the data message to be transmitted is suitable for realizing the in-band detection operation effect of the expected in-band detection protocol type by executing the sub-steps S211 to S213.
Step S220, under the condition that the data message to be transmitted accords with the in-band detection operation requirement matched with the expected in-band detection protocol type, determining the field insertion position offset of the preset detection field content corresponding to the expected in-band detection protocol type at the data message to be transmitted.
In this embodiment, when the network communication device 10 detects that a data packet to be transmitted currently meets the in-band detection job requirement matched with the expected in-band detection protocol type, the preset detection field content matched with the expected in-band detection protocol type and suitable for the data packet to be transmitted is found out from all stored preset detection field contents, and then the preset field position offset matched with the expected in-band detection protocol type and the actual message protocol type of the data packet to be transmitted is found out from the preset field position offsets of the preset detection field contents corresponding to the different stored in-band detection protocol types under various bearer message protocol types, so that the found out preset field position offset is used as the field insertion position offset required by the in-band detection job effect of the expected in-band detection protocol type for the data packet to be transmitted.
Optionally, referring to fig. 4, fig. 4 is a flowchart illustrating the sub-steps included in step S220 in fig. 2. In the embodiment of the present application, the step of determining the field insertion position offset of the preset detection field content corresponding to the expected in-band detection protocol type at the data packet to be transmitted in the step S220 may include sub-steps S221 to S223 to effectively determine the field insertion position offset required for each data packet to be transmitted of different message protocol types when the in-band detection operation effect of the expected in-band detection protocol type is achieved.
And step S221, searching the position offset of the field to be screened matched with the actual message protocol type in all stored preset field position offsets according to the actual message protocol type of the data message to be transmitted.
In this embodiment, the field position offset to be screened includes preset field position offsets when in-band detection operation effects of different in-band detection protocol types take effect on the data message of the actual message protocol type.
And sub-step S222, screening the target field position offset matched with the expected in-band detection protocol type from the searched field position offsets to be screened.
In the substep S223, the target field position offset is used as the field insertion position offset of the preset detection field content of the expected in-band detection protocol type at the data packet to be transmitted.
Therefore, the application can effectively determine the field insertion position offset required by each data message to be transmitted with different message protocol types when the in-band detection operation effect of the expected in-band detection protocol type is realized by executing the sub-steps S221 to S223.
Step S230, call the message edit list item corresponding to the expected in-band detection protocol type, insert the preset detection field content into the data message to be transmitted based on the field insertion position offset.
In this embodiment, when the network communication device 10 detects that one data packet to be transmitted currently meets the in-band detection job requirement matched with the expected in-band detection protocol type, according to the association relationship between each in-band detection protocol type and each message editing table entry at the message editing table, a table entry address index of the expected in-band detection protocol type at the message editing table is obtained, then a target message editing table entry corresponding to the expected in-band detection protocol type is extracted from the message editing table according to the obtained table entry address index, then a field insertion reference position in the data packet to be transmitted is determined based on a reference insertion position extraction policy recorded by the extracted target message editing table entry, and then a detection field insertion operation is performed on the data packet to be transmitted based on the content of a preset detection field, the offset of the field insertion position and the field insertion reference position corresponding to the expected in-band detection protocol type, so as to edit the data packet to be transmitted into an in-band detection message required by the expected in-band detection protocol type, thereby obtaining the data packet to be transmitted in the data packet to be transmitted with the same in-band detection protocol type and the same in-band detection protocol type.
Optionally, referring to fig. 5, fig. 5 is a flowchart illustrating the sub-steps included in step S230 in fig. 2. In the embodiment of the present application, the step S230 may include sub-steps S231 to S234 to ensure that the data packets of different message protocol types can edit the same field content corresponding to the desired in-band detection protocol type using the same editing table entry.
Substep S231, extracting a target edit table entry corresponding to the desired in-band detection protocol type from all stored message edit table entries.
And step S232, according to the reference insertion position extraction strategy recorded by the target editing list item, determining the field insertion reference position corresponding to the expected in-band detection protocol type in the data message to be transmitted.
Step S233, performing position offset processing on the field insertion reference position according to the field insertion position offset to obtain an expected field insertion position of the preset detection field content in the data message to be transmitted, wherein the preset detection field content corresponds to the expected in-band detection protocol type;
substep S234, inserting the content of the preset detection field corresponding to the type of the expected in-band detection protocol into the expected field insertion position of the data packet to be transmitted.
Taking the detection field insertion operation shown in fig. 6 as an example, if the expected in-band detection protocol type is an alternate measurement detection protocol, the content of the preset detection field corresponding to the expected in-band detection protocol type is "Flow ID field information, loss Flag field information and Delay Flag field information", the target edit table item corresponding to the expected in-band detection protocol type is "DsFlexEdit" in fig. 6, the field insertion reference position of the target edit table item applied to the data packet to be transmitted is the three-layer message header position "l3_base_offset" of the data packet to be transmitted (i.e., "IPHeader" in fig. 6 is the position of the data packet to be transmitted in the case), the field insertion position Offset of the data packet to be transmitted at the expected in-band detection protocol type is "Offset", the expected field insertion position of the preset detection field content corresponding to the expected in-band detection protocol type in the data packet to be transmitted is "l3_base_offset" in the case "in fig. 6, i.e., the field insertion position of the preset detection field corresponding to the expected in the case of the expected in-band detection protocol type is" Offset ", and the actual field is written in the field to be detected in the case of the actual field to be detected in the case of the field to be detected.
Therefore, the application can ensure that the data messages with different message protocol types can edit the same field content corresponding to the expected in-band detection protocol type by adopting the same editing table entry by executing the substeps S231 to S234.
Step S240, the message forwarding is carried out on the data message to be transmitted after the detection field insertion operation is completed, so as to realize in-band detection operation aiming at the expected in-band detection protocol type.
In this embodiment, when the network communication device 10 edits a data packet to be transmitted into an in-band network detection packet required by an expected in-band detection protocol type by using a packet editing table corresponding to the expected in-band detection protocol type, packet forwarding processing is performed on the in-band network detection packet (i.e., the data packet to be transmitted with the detection field inserted operation completed), so as to implement in-band detection operation for the expected in-band detection protocol type in the current communication network through the in-band network detection packet, thereby ensuring that the data packets to be transmitted of different packet protocol types can perform in-band detection operation under the action of the same editing table, so as to effectively reduce table resource consumption of the network communication device 10 and improve in-band detection capability of the network communication device 10 for packet flows of different packet protocol types.
Therefore, the present application can edit the same field content corresponding to the expected in-band detection protocol type in the to-be-transmitted data messages of different message protocol types by using the same editing list item through executing the steps S210 to S240, so that the to-be-transmitted data messages of different message protocol types can perform in-band detection operation under the action of the same editing list item, thereby effectively reducing the list item resource consumption of the network communication device 10 and improving the in-band detection capability of the network communication device 10 for the message flows of different message protocol types.
Optionally, referring to fig. 7, fig. 7 is a second flowchart of an in-band detection implementation method according to an embodiment of the present application. In the embodiment of the present application, compared to the in-band detection implementation method shown in fig. 2, the in-band detection implementation method shown in fig. 7 may further include step S250 and step S260, so as to ensure that a user of the network communication device 10 can configure what in-band detection operation effect of the in-band detection protocol is implemented by the network communication device 10.
Step S250, an in-band network detection request entered from outside is acquired, wherein the in-band network detection request includes the type of in-band detection protocol to be used.
In this embodiment, the network communication device 10 may be communicatively connected to an input device to obtain an in-band network detection request input by a user of the network communication device 10 on the input device, where the input device may be, but is not limited to, a keyboard, a handwriting pad, a touch screen, etc.; the network communication device 10 may also be communicatively connected to a terminal device held by a user through the communication unit 13, so as to obtain an in-band network detection request issued by the user through the terminal device.
Step S260, the in-band detection protocol type to be used is taken as the expected in-band detection protocol type of the network communication device.
In this embodiment, after receiving the in-band network detection request, the network communication device 10 performs data analysis on the in-band network detection request to obtain an in-band detection protocol type to be used included in the in-band network detection request, and then switches the expected in-band detection protocol type currently used by the network communication device 10 to the in-band detection protocol type to be used, so as to ensure that a user of the network communication device 10 can configure what in-band detection protocol the network communication device 10 implements.
Thus, the present application can ensure that the user of the network communication device 10 can configure what in-band detection protocol the network communication device 10 implements to the in-band detection job effect by executing the above-described step S250 and step S260.
Optionally, referring to fig. 8, fig. 8 is a third flowchart of an in-band detection implementation method according to an embodiment of the present application. In the embodiment of the present application, compared to the in-band detection implementation method shown in fig. 2 or fig. 7, the in-band detection implementation method shown in fig. 8 may further include step S270, so as to ensure that a user of the network communication device 10 can configure an actual message editing scheme when different in-band detection protocol types are applied to data messages of various message protocol types.
Step S270, the in-band detection matching rule, the preset detection field content and the message editing list item of the network communication equipment under different in-band detection protocol types are configured, and the preset field position offset of the network communication equipment under different in-band detection protocol types and different bearer message protocol types is configured.
Thus, the present application can ensure that the user of the network communication device 10 can configure the actual message editing scheme of the different in-band detection protocol types when each of the data messages of the various message protocol types is applied by executing the above step S270.
In the present application, in order to ensure that the network communication device 10 can execute the above-described in-band detection implementation method by the in-band detection implementation means 100, the present application implements the foregoing functions by dividing the in-band detection implementation means 100 into functional blocks. The specific composition of the in-band detection realizing apparatus 100 provided by the present application will be described correspondingly.
Referring to fig. 9, fig. 9 is a schematic diagram of an in-band detection implementation device 100 according to an embodiment of the application. In the embodiment of the present application, the in-band detection implementation device 100 may include an in-band detection matching module 110, an in-band message editing module 120, and a data transmission communication module 130.
The in-band detection matching module 110 is configured to detect, for each received data packet to be transmitted, whether the data packet to be transmitted meets an in-band detection job requirement of a desired in-band detection protocol type.
The in-band detection matching module 110 is further configured to determine a field insertion position offset of a preset detection field content corresponding to the expected in-band detection protocol type at the data packet to be transmitted, when it is detected that the data packet to be transmitted meets an in-band detection job requirement that the expected in-band detection protocol type matches.
The in-band message editing module 120 is configured to invoke a message editing table entry corresponding to a desired in-band detection protocol type, and insert a preset detection field content into the data message to be transmitted based on a field insertion position offset.
The data transmission communication module 130 is configured to forward the data packet to be transmitted after completing the detection field insertion operation, so as to implement in-band detection operation for the expected in-band detection protocol type.
Optionally, in the embodiment of the present application, the data transmission communication module 130 and the in-band detection matching module 110 may each implement other additional functions, and specific functional contents are as follows:
The data transmission communication module 130 is further configured to obtain an in-band network detection request entered externally, where the in-band network detection request includes a type of in-band detection protocol to be used.
The in-band detection matching module 110 is further configured to use the type of in-band detection protocol to be used as the expected type of in-band detection protocol of the network communication device.
In addition, the in-band detection matching module 110 is further configured to configure in-band detection matching rules, preset detection field contents and message editing table entries of the network communication device under different in-band detection protocol types, and configure preset field position offsets of the network communication device under different in-band detection protocol types and different bearer message protocol types.
It should be noted that, the basic principle and the technical effects of the in-band detection implementation device 100 provided by the embodiment of the present application are the same as the in-band detection implementation method described above. For a brief description, reference may be made to the description of the implementation method for in-band detection described above, where this embodiment section is not mentioned.
It can be appreciated that the embodiments of the present application may perform different degrees of functional module division on the in-band detection implementation device 100 according to the various flow embodiments of the in-band detection implementation method described above. For example, each step function may be divided into one single functional module, or two or more step functions may be integrated into one functional module. The foregoing functional modules may be implemented in hardware or in software. It should be noted that, the division manner of the functional modules shown in fig. 9 provided in the embodiment of the present application is merely an illustrative example, and is merely a logic function division, and the in-band detection implementation device 100 may have another division manner in actual implementation.
Thus, alternatively, the data transmission communication module 130 and the in-band detection matching module 110 may be separately provided, for example, the data transmission communication module 130 and/or the in-band detection matching module 110 may be split into more modules; the data transmission communication module 130 and the in-band detection matching module 110 may also be integrated in one module. The specific implementation of the data transmission communication module 130 and the in-band detection matching module 110 is not specifically limited in the present application. It can be appreciated that the specific implementation of the in-band message editing module may refer to the implementation of the data transmission communication module 130 or the in-band detection matching module 110, which is not described herein.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The apparatus embodiments described above are merely illustrative, for example, of the flowcharts and block diagrams in the figures that illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part. The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution in the form of a software product stored in a readable storage medium, comprising several instructions for causing a network communication device (which may be a personal computer, a server, a gateway device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned readable storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In summary, in the method and apparatus for implementing in-band detection, network communication device and readable storage medium provided in the embodiments of the present application, when it is determined that a received data packet to be transmitted substantially meets the in-band detection job requirement matched with an expected in-band detection protocol type, a field insertion position offset of a preset detection field content corresponding to the expected in-band detection protocol type at the data packet to be transmitted is determined, then a message editing table entry corresponding to the expected in-band detection protocol type is directly called, the preset detection field content is inserted into the data packet to be transmitted based on the determined field insertion position offset, and a message forwarding is performed on the data packet to be transmitted after the detection field insertion operation is completed, so that the same field content corresponding to the expected in-band detection protocol type is edited in the data packet to be transmitted of different message protocol types by using the same editing table entry, so that the in-band detection job can be performed on the data packet to be transmitted of different message protocol types under the action of the same editing table entry, thereby effectively reducing table entry resource consumption of the network communication device, and improving in-band detection capability of the network communication device.
The above description is merely illustrative of various embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about variations or substitutions within the scope of the present application, and the application is intended to be covered by the scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims (10)

1. An in-band detection implementation method, applied to a network communication device, the method comprising:
for each received data message to be transmitted, detecting whether the data message to be transmitted accords with the in-band detection operation requirement of the expected in-band detection protocol type;
under the condition that the data message to be transmitted accords with the in-band detection operation requirement matched with the expected in-band detection protocol type, determining a field insertion position offset of the preset detection field content corresponding to the expected in-band detection protocol type at the data message to be transmitted;
calling a message editing table item corresponding to the expected in-band detection protocol type, and inserting the content of the preset detection field into the data message to be transmitted based on the field insertion position offset;
And forwarding the data message to be transmitted after finishing the detection field insertion operation so as to realize in-band detection operation aiming at the expected in-band detection protocol type.
2. The method according to claim 1, wherein the network communication device stores in-band detection matching rules corresponding to different in-band detection protocol types, and the step of detecting whether the data packet to be transmitted meets the in-band detection job requirement of the expected in-band detection protocol type includes:
extracting a target matching rule corresponding to the expected in-band detection protocol type from all stored in-band detection matching rules;
extracting message quintuple information of the data message to be transmitted, and carrying out information matching on the extracted message quintuple information and the target matching rule;
if the extracted message quintuple information is successfully matched with the target matching rule, judging that the data message to be transmitted accords with the in-band detection operation requirement of the expected in-band detection protocol type, otherwise, judging that the data message to be transmitted does not accord with the in-band detection operation requirement of the expected in-band detection protocol type.
3. The method according to claim 1, wherein the network communication device stores preset field position offsets of preset detection field contents corresponding to different in-band detection protocol types under various bearer message protocol types, and the step of determining the field insertion position offset of the preset detection field contents corresponding to the expected in-band detection protocol type at the to-be-transmitted data message includes:
Searching the position offset of a field to be screened matched with the actual message protocol type in all stored preset field position offsets according to the actual message protocol type of the data message to be transmitted;
screening out a target field position offset matched with the expected in-band detection protocol type from the searched field position offset to be screened;
and taking the target field position offset as the field insertion position offset.
4. The method according to claim 1, wherein the network communication device stores message editing entries corresponding to different in-band detection protocol types, each message editing entry records a reference insertion position extraction policy corresponding to an in-band detection protocol type, and the step of calling a message editing entry corresponding to the expected in-band detection protocol type and inserting the preset detection field content into the data message to be transmitted based on the field insertion position offset includes:
extracting target editing list items corresponding to the expected in-band detection protocol types from all stored message editing list items;
according to the reference insertion position extraction strategy of the target editing list item record, determining a field insertion reference position corresponding to the expected in-band detection protocol type in the data message to be transmitted;
Performing position offset processing on the field insertion reference position according to the field insertion position offset to obtain an expected field insertion position of preset detection field content in the data message to be transmitted, wherein the preset detection field content corresponds to the expected in-band detection protocol type;
and inserting the content of a preset detection field corresponding to the expected in-band detection protocol type into an expected field insertion position of the data message to be transmitted.
5. The method according to any one of claims 1-4, further comprising:
acquiring an in-band network detection request input from outside, wherein the in-band network detection request comprises an in-band detection protocol type to be used;
and taking the type of the in-band detection protocol to be used as the expected type of the in-band detection protocol of the network communication equipment.
6. The method of claim 5, wherein the method further comprises:
and configuring in-band detection matching rules, preset detection field contents and message editing table items of the network communication equipment under different in-band detection protocol types, and configuring preset field position offset of the network communication equipment under different in-band detection protocol types and different bearer message protocol types.
7. An in-band detection implementation apparatus, for use with a network communication device, the apparatus comprising:
the in-band detection matching module is used for detecting whether the data message to be transmitted accords with the in-band detection operation requirement of the expected in-band detection protocol type or not according to each received data message to be transmitted;
the in-band detection matching module is further configured to determine a field insertion position offset of a preset detection field content corresponding to the expected in-band detection protocol type at the position of the data packet to be transmitted, when it is detected that the data packet to be transmitted meets an in-band detection operation requirement that the expected in-band detection protocol type matches;
the in-band message editing module is used for calling a message editing table item corresponding to the expected in-band detection protocol type, and inserting the content of the preset detection field into the data message to be transmitted based on the field insertion position offset;
and the data transmission communication module is used for forwarding the data message to be transmitted after the detection field insertion operation is completed, so as to realize in-band detection operation aiming at the expected in-band detection protocol type.
8. The apparatus of claim 7, wherein the apparatus further comprises:
The data transmission communication module is further used for acquiring an in-band network detection request input from outside, wherein the in-band network detection request comprises an in-band detection protocol type to be used;
the in-band detection matching module is further configured to use the type of in-band detection protocol to be used as a desired type of in-band detection protocol of the network communication device.
9. The network communication device is characterized by comprising a processor, a memory and a communication unit, wherein the communication unit is used for realizing a message receiving and transmitting function;
the memory stores a computer program executable by the processor to implement the in-band detection implementation method of any one of claims 1-6.
10. A readable storage medium having stored thereon a computer program, which when executed by a network communication device, implements the in-band detection implementation method of any of claims 1-6.
CN202311137083.4A 2023-09-05 2023-09-05 In-band detection implementation method and device, network communication equipment and readable storage medium Pending CN117135094A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311137083.4A CN117135094A (en) 2023-09-05 2023-09-05 In-band detection implementation method and device, network communication equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311137083.4A CN117135094A (en) 2023-09-05 2023-09-05 In-band detection implementation method and device, network communication equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN117135094A true CN117135094A (en) 2023-11-28

Family

ID=88850722

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311137083.4A Pending CN117135094A (en) 2023-09-05 2023-09-05 In-band detection implementation method and device, network communication equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN117135094A (en)

Similar Documents

Publication Publication Date Title
CN108259347B (en) Message transmission method and device
CN105684382A (en) Packet control method, switch and controller
CN101534248B (en) Deep packet identification method, system and business board
CN112672381B (en) Data association method, device, terminal equipment and medium
CN112532526B (en) Data forwarding method and device and network equipment
US20240106751A1 (en) Method and apparatus for processing detnet data packet
CN111049947B (en) Message forwarding method and device, electronic equipment and storage medium
CN111147519A (en) Data detection method, device, electronic equipment and medium
US20120140640A1 (en) Apparatus and method for dynamically processing packets having various characteristics
CN116939035A (en) Data processing method, device, electronic equipment and storage medium
CN112511438B (en) Method and device for forwarding message by using flow table and computer equipment
CN113765728B (en) Network detection method, device, equipment and storage medium
CN116016388B (en) Message serial editing method and device, electronic equipment and storage medium
CN111262782B (en) Message processing method, device and equipment
CN107210969B (en) Data processing method based on software defined network and related equipment
CN117135094A (en) In-band detection implementation method and device, network communication equipment and readable storage medium
CN112653609B (en) VPN identification application method, device, terminal and storage medium
EP1883187A1 (en) Packet processing device, communication system, packet processing method, and program executing the method
CN111935206B (en) Message processing method, device and network equipment
CN109257372B (en) Message forwarding method, device, storage medium and apparatus based on network convergence
CN114726763A (en) Method and system for detecting service identification capability of DPI system
CN114079634A (en) Message forwarding method and device and computer readable storage medium
CN113923270B (en) Message processing method, device, equipment and readable storage medium
CN116192677B (en) Network flow data differentiated storage method and electronic equipment
CN113747470B (en) Interface traffic analysis method, routing device and storage medium

Legal Events

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