CN113225229B - Distributed lightweight total network remote measuring method and device based on label - Google Patents

Distributed lightweight total network remote measuring method and device based on label Download PDF

Info

Publication number
CN113225229B
CN113225229B CN202110500776.XA CN202110500776A CN113225229B CN 113225229 B CN113225229 B CN 113225229B CN 202110500776 A CN202110500776 A CN 202110500776A CN 113225229 B CN113225229 B CN 113225229B
Authority
CN
China
Prior art keywords
data packet
forwarded
time
time difference
difference threshold
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110500776.XA
Other languages
Chinese (zh)
Other versions
CN113225229A (en
Inventor
潘恬
宋恩格
贾晨昊
高明岚
罗政杰
黄韬
刘韵洁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing University of Posts and Telecommunications
Original Assignee
Beijing University of Posts and Telecommunications
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 Beijing University of Posts and Telecommunications filed Critical Beijing University of Posts and Telecommunications
Priority to CN202110500776.XA priority Critical patent/CN113225229B/en
Publication of CN113225229A publication Critical patent/CN113225229A/en
Application granted granted Critical
Publication of CN113225229B publication Critical patent/CN113225229B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Landscapes

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

Abstract

The embodiment of the invention provides a distributed lightweight class whole-network remote measuring method and a distributed lightweight class whole-network remote measuring device based on a label, which relate to the technical field of network measurement, and the method comprises the following steps: receiving a data packet to be forwarded; determining a forwarding port and next hop equipment for forwarding the data packet to be forwarded by analyzing the data packet to be forwarded; if the difference value between the current time and the first time is greater than the time difference threshold value, writing the equipment state of the network equipment into a data packet to be forwarded in a tag mode, and updating the first time to the current time; judging whether the next hop equipment is the target equipment of the data packet to be forwarded or not; if so, splitting the data packet to be forwarded to obtain a first data packet and a second data packet, forwarding the first data packet to the controller, and forwarding the second data packet to the destination device; if not, forwarding the data packet to be forwarded after the equipment state is written through the forwarding port. By applying the scheme provided by the embodiment of the invention to carry out the whole-network telemetry, the stability of carrying out the whole-network telemetry can be improved.

Description

Distributed lightweight total network remote measuring method and device based on label
Technical Field
The invention relates to the technical field of network measurement, in particular to a label-based distributed lightweight total network telemetry method and a device.
Background
Distributed networks are now becoming more widely used. With the continuous expansion of the scale of the distributed network, the network measurement of the distributed network is developing towards remote, fine and real-time. Among them, the whole network telemetry is one of the main development directions in the network measurement technology. When the network measurement is carried out on the distributed network based on the whole network telemetry technology, the network equipment with the control function carries out remote measurement on the network performance of the distributed network and the equipment state of the network equipment in the distributed network, and a measurement result is obtained. The network devices include switches, routers, and the like. For convenience of description, a network device having a control function in a distributed network is referred to as a controller.
In the prior art, when a distributed network is measured based on a full-network telemetry technology, a controller needs to obtain a topology structure of the distributed network, plan a detection path according to the topology structure of the distributed network, and then sequentially measure device states of network devices in the distributed network according to the planned detection path. However, the topology structure of the distributed network is often changed due to problems such as equipment failure, and the change of the topology structure may cause interruption of the planned probe path, so that it is difficult to perform the whole network telemetry for the planned probe path. Therefore, when the mode is applied to the whole-network remote measurement, the stability is poor.
Disclosure of Invention
The embodiment of the invention aims to provide a label-based distributed lightweight total network telemetry method and a label-based distributed lightweight total network telemetry device so as to improve the stability of total network telemetry. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a distributed lightweight class full-network telemetry method based on tags, which is applied to network devices, and the method includes:
receiving a data packet to be forwarded;
determining a forwarding port and next hop equipment for forwarding the data packet to be forwarded by analyzing the data packet to be forwarded;
if the difference value between the current time and the first time is greater than the time difference threshold, writing the device state of the network device into the data packet to be forwarded in a tag form, and updating the first time to the current time, wherein the first time is: the last time the network device writes the device status into the data packet forwarded by the forwarding port;
judging whether the next hop equipment is the target equipment of the data packet to be forwarded or not;
if so, splitting the data packet to be forwarded to obtain a first data packet and a second data packet, forwarding the first data packet to a controller, and forwarding the second data packet to the destination device, wherein the first data packet comprises: all the device states recorded in the to-be-forwarded data packet, the second data packet includes: information contained when the data packet to be forwarded is not written into the device state;
if not, forwarding the data packet to be forwarded after writing the equipment state through the forwarding port.
In an embodiment of the present invention, writing the device status of the network device into the packet to be forwarded in a form of a tag includes:
judging whether the data packet to be forwarded is written into the equipment state for the first time;
if so, adjusting the first content of a first field included in an IP header in the packet to be forwarded to information representing an INT (in-band Network Telemetry) type, and inserting an INT header behind the IP header, wherein the INT information in the INT header includes: the device state of the network device in the form of a tag, wherein INT option information in the INT header includes: the first content of the first field and the label number of the label already included in the INT information, wherein the first field is a field representing network protocol interface information;
if not, inserting the device state of the network device into the INT information in a tag form;
the splitting the data packet to be forwarded to obtain a first data packet and a second data packet includes:
obtaining the number of the labels recorded in the INT head and the equipment states of all label forms;
generating a first data packet carrying the number of the labels recorded in the INT header and the equipment states of all label forms;
and restoring the information which is contained in the first field in the data packet to be forwarded and represents the INT type into the first content, deleting the INT head from the data packet to be forwarded, and generating a second data packet.
In one embodiment of the invention, the method further comprises:
if the difference value between the current time and the first time is smaller than the time difference threshold, judging whether the equipment state of the network equipment needs to be inserted into the INT information or not according to the number of the labels;
if so, executing the step of judging whether the data packet to be forwarded is written into the equipment state for the first time.
In an embodiment of the present invention, the determining whether the device state of the network device needs to be inserted into the INT information according to the number of the tags includes:
according to the number of the labels, calculating the probability of representing the insertion of the device state of the network device into the INT information;
and determining whether the device state of the network device needs to be inserted into the INT information or not by taking the probability as an influence factor.
In one embodiment of the invention, the method further comprises:
receiving a time difference threshold adjusting instruction sent by a controller, wherein the time difference threshold adjusting instruction is as follows: the controller sends an instruction indicating adjustment of the time difference threshold to the network device according to a first time interval, where the first time interval is: the controller detects a time interval for inserting a device state into a data packet forwarded by the forwarding port by the network device;
adjusting the time difference threshold based on the time difference threshold adjustment instruction.
In an embodiment of the present invention, the adjusting the time difference threshold based on the time difference threshold adjusting instruction includes:
adjusting a time difference adjustment factor for the forwarding port, which is locally stored by the network device, based on the time difference threshold adjustment instruction;
adjusting the time difference threshold according to the following expression:
T2=T1/2S
wherein, T2Indicating the adjusted time difference threshold, T1Representing the time difference threshold before adjustment and S the time difference adjustment factor.
In an embodiment of the present invention, the controller generates the time difference threshold adjustment instruction according to the following manner:
the controller judges whether the first time interval is greater than a preset time length;
if so, generating a time difference threshold adjusting instruction for indicating to reduce the time difference threshold;
otherwise, generating a time difference threshold adjustment instruction for indicating to increase the time difference threshold.
In a second aspect, an embodiment of the present invention provides a distributed lightweight total network telemetry apparatus based on tags, which is applied to network devices, and the apparatus includes:
the first receiving module is used for receiving the data packet to be forwarded;
a determining module, configured to determine a forwarding port and a next hop device for forwarding the packet to be forwarded by analyzing the packet to be forwarded;
a writing module, configured to write the device status of the network device into the to-be-forwarded data packet in a tag form if a difference between the current time and a first time is greater than a time difference threshold, and update the first time to the current time, where the first time is: the last time the network device writes the device status into the data packet forwarded by the forwarding port;
the judging module is used for judging whether the next hop equipment is the target equipment of the data packet to be forwarded or not, if so, the splitting module is triggered, and if not, the forwarding module is triggered;
the splitting module is configured to split the data packet to be forwarded to obtain a first data packet and a second data packet, forward the first data packet to a controller, and forward the second data packet to the destination device, where the first data packet includes: all the device states recorded in the to-be-forwarded data packet, the second data packet includes: information contained when the data packet to be forwarded is not written into the device state;
and the forwarding module is used for forwarding the data packet to be forwarded after the equipment state is written through the forwarding port.
In an embodiment of the present invention, the writing module includes:
the first judgment submodule is used for judging whether the data packet to be forwarded is written into the equipment state for the first time or not if the difference value between the current time and the first time is larger than the time difference threshold, if so, the replacement submodule is triggered, and if not, the insertion submodule is triggered;
the replacing submodule is configured to adjust first content of a first field included in an IP header in the packet to be forwarded to information representing an INT type, and insert an INT header after the IP header, where the INT information in the INT header includes: the device state of the network device in the form of a tag, wherein INT option information in the INT header includes: the first content of the first field and the label number of the label already included in the INT information, wherein the first field is a field representing network protocol interface information;
the inserting sub-module is used for inserting the device state of the network device into the INT information in a tag form;
an update submodule, configured to update the first time to the current time;
the splitting module is specifically configured to:
obtaining the number of the labels recorded in the INT head and the equipment states of all label forms;
generating a first data packet carrying the number of the labels recorded in the INT header and the equipment states of all label forms;
forwarding the first data packet to the controller;
restoring information which is contained in a first field in the data packet to be forwarded and represents an INT type into the first content, deleting the INT head from the data packet to be forwarded, and generating a second data packet;
and forwarding the second data packet to the destination device.
In an embodiment of the present invention, the writing module further includes:
and the second judging submodule is used for judging whether the equipment state of the network equipment needs to be inserted into the INT information according to the number of the tags if the difference value between the current time and the first time is smaller than the time difference threshold, and triggering the first judging submodule to execute the step of judging whether the data packet to be forwarded is written into the equipment state for the first time if the difference value is larger than the time difference threshold.
In an embodiment of the present invention, the second determining submodule is specifically configured to:
if the difference value between the current time and the first time is smaller than the time difference threshold, calculating the probability of representing the insertion of the equipment state of the network equipment into the INT information according to the number of the labels;
and determining whether the device state of the network device needs to be inserted into the INT information or not by taking the probability as an influence factor.
In one embodiment of the present invention, the apparatus further comprises:
a second receiving module, configured to receive a time difference threshold adjustment instruction sent by the controller, where the time difference threshold adjustment instruction is: the controller sends an instruction indicating adjustment of the time difference threshold to the network device according to a first time interval, where the first time interval is: the controller detects a time interval for inserting a device state into a data packet forwarded by the forwarding port by the network device;
and the adjusting module is used for adjusting the time difference threshold based on the time difference threshold adjusting instruction.
In an embodiment of the present invention, the adjusting module is specifically configured to:
adjusting a time difference adjustment factor for the forwarding port, which is locally stored by the network device, based on the time difference threshold adjustment instruction;
adjusting the time difference threshold according to the following expression:
T2=T1/2S
wherein, T2Indicating the adjusted time difference threshold, T1Representing the time difference threshold before adjustment and S the time difference adjustment factor.
In an embodiment of the present invention, if the controller determines that the first time interval is greater than a preset duration, the time difference threshold adjustment instruction is: instructions for instructing a decrease in the time difference threshold, otherwise, the time difference threshold adjustment instructions are: instructions for instructing an increase in the time difference threshold.
In a third aspect, an embodiment of the present invention provides a network device, including a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface complete communication between the memory and the processor through the communication bus;
a memory for storing a computer program;
a processor, configured to implement the steps of the full-network telemetry method according to any one of the first aspect described above when executing a program stored in the memory.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the network-wide telemetry method according to any one of the first aspect.
The embodiment of the invention has the following beneficial effects:
when the scheme provided by the embodiment of the invention is applied to the whole network remote control, the forwarding port and the next hop equipment for forwarding the data packet to be forwarded are determined by analyzing the received data packet to be forwarded, if the difference value between the current time and the first time is greater than the time difference threshold, the equipment state of the network equipment is written into the data packet to be forwarded in a label mode, and the first time is updated to the current time. Then if the next hop device of the data packet to be forwarded is the destination device of the data packet to be forwarded, splitting the data packet to be forwarded to obtain a first data packet and a second data packet, forwarding the first data packet to the controller, and forwarding the second data packet to the destination device; otherwise, forwarding the data packet to be forwarded. Therefore, in the scheme provided by the embodiment of the invention, the device state of the network device is written into the data packet to be forwarded in a tag form, when the data packet to be forwarded reaches the previous hop device of the destination device, the data packet to be forwarded is split, and the first data packet containing all the device states recorded in the data packet to be forwarded is forwarded to the controller, so that the whole network telemetry is realized by using the data packet to be forwarded passing through the network device, and the scheme does not need to obtain the topological structure of the distributed network, and does not need to perform detection path planning according to the topological structure of the distributed network, so that the problem that the whole network telemetry is difficult to perform due to the change of the topological structure is solved, and the stability of the whole network telemetry is improved. Therefore, the scheme provided by the embodiment of the invention is applied to the whole network telemetry, and the stability of the whole network telemetry can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by referring to these drawings.
Fig. 1 is a schematic flowchart of a first distributed lightweight label-based whole-network telemetry method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a second distributed lightweight label-based whole-network telemetry method according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a third distributed lightweight label-based whole-network telemetry method according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a fourth distributed lightweight label-based whole-network telemetry method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a first distributed lightweight all-network telemetry device based on tags according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a second distributed lightweight all-network telemetry device based on tags according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a third distributed lightweight all-network telemetry device based on tags according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a fourth distributed lightweight all-network telemetry device based on tags according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a network device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention are within the scope of the present invention.
Referring to fig. 1, a schematic flow chart of a first distributed lightweight label-based network-wide telemetry method applied to a network device is provided, where the method includes the following steps S101 to S106.
Step S101: and receiving the data packet to be forwarded.
Step S102: and determining a forwarding port and next hop equipment for forwarding the data packet to be forwarded by analyzing the data packet to be forwarded.
The next-hop device refers to a network device that receives a data packet to be forwarded next.
The address information of the source device and the address information of the destination device are recorded in the data packet to be forwarded, and the routing table is stored in the network device, so that the port number of the forwarding port for forwarding the data packet to be forwarded and the address of the next hop device can be determined by analyzing the data packet to be forwarded and comparing the address information of the destination device of the data packet to be forwarded with the information recorded in the routing table, and the forwarding port for the data packet to be forwarded and the next hop device in the network device are also determined.
For example, taking the example that the data packet to be forwarded is transmitted from the host 1 to the host 2, assuming that the routing path of the data packet to be forwarded passes through the host 1, the switch 2, and the host 2 in sequence, the forwarding process of the data packet to be forwarded is as follows 1-4:
step 1: the packet to be forwarded is sent out from port 1 of host 1.
Step 2: the data packet to be forwarded reaches the input port 1 of the switch 1, the switch 1 queries the recorded routing table by using the address information of the destination device recorded in the data packet to be forwarded, determines the output port 1 for forwarding the data packet to be forwarded, and determines the next hop device of the data packet to be forwarded as the switch 2. And forwarding the data packet to be forwarded after the data processing of the switch 1 to the switch 2 from the output port 1.
And step 3: the data packet to be forwarded reaches the input port 2 of the switch 2, the switch 2 queries the recorded routing table by using the address information of the destination device recorded in the data packet to be forwarded, determines the output port 2 for forwarding the data packet to be forwarded, and determines the next hop device of the data packet to be forwarded as the host 2. And forwarding the data packet to be forwarded after the data processing of the switch 1 to the switch 2 from the output port 2.
And 4, step 4: the data packet to be forwarded arrives at the ingress port 3 of the host 2.
Therefore, when the network device is the switch 1, the next hop device is: and the switch 2, the forwarding port is an egress port 1.
Step S103: and if the difference value between the current time and the first time is greater than the time difference threshold, writing the equipment state of the network equipment into the data packet to be forwarded in a tag form, and updating the first time to the current time. Wherein the first time is: the last time the network device written the device state to the packet forwarded by the forwarding port.
The current time may be a clock time recorded by the network device.
The first time is a time when the network device last writes the device status into the packet forwarded by the forwarding port, and therefore the first time represents a time when the device status is written into the packet and forwarded by the forwarding port, and in the network device, one forwarding port corresponds to one first time.
The first time may be recorded in a register of the network device, where one register corresponds to one forwarding port, and the first times may be recorded in a plurality of registers of the network device, where the plurality of registers correspond to the plurality of forwarding ports, respectively.
The time difference threshold may be a predetermined fixed value, for example, 10ms, 5ms, or another value. The time difference threshold may be a dynamic value determined according to information such as the write frequency of the device status.
The device status of the network device may include at least one of the following information: the network device address, the receiving port number for receiving the data packet to be forwarded in the network device, the forwarding port number for forwarding the data packet to be forwarded in the network device, the network delay, the queue depth, the time for writing the device state into the data packet to be forwarded, and the like.
In this step, the device status of the network device is written into the packet to be forwarded in the form of a tag, that is, the device status of the network device is written into the packet to be forwarded in the same data form as the data contained in the packet to be forwarded, where the device status of one network device is one tag.
Step S102 determines a forwarding port for forwarding the data packet to be forwarded, that is, determines a first time corresponding to the forwarding port for determining whether to write the device status of the network device into the data packet to be forwarded in a form of a tag, and if a difference between the current time and the first time is greater than a time difference threshold, writes the device status of the network device into the data packet to be forwarded in a form of a tag.
There are various ways to implement writing the device status of the network device into the packet to be forwarded in the form of a tag.
In one implementation, the device status of the network device may be inserted into a designated location of the packet to be forwarded in the form of a tag.
In another implementation, a specific field in the packet to be forwarded may be replaced with a device status of the network device in the form of a tag.
Step S104: judging whether the next hop device is a target device of the data packet to be forwarded, if so, executing step S105; if not, go to step S106.
In one case, whether the next hop device is the destination device for forwarding the data packet may be determined by determining whether the address of the next hop device is the same as the address of the destination device for forwarding the data packet.
And if the address of the next hop device is the same as the address of the destination device of the data packet to be forwarded, determining that the next hop device is the destination device of the data packet to be forwarded.
And if the address of the next hop device is different from the address of the destination device of the data packet to be forwarded, determining that the next hop device is not the destination device of the data packet to be forwarded.
Step S105: and splitting the data packet to be forwarded to obtain a first data packet and a second data packet, forwarding the first data packet to the controller, and forwarding the second data packet to the destination device.
Wherein the first data packet comprises: all device states recorded in the packet to be forwarded, the second packet comprising: the information contained when the data packet to be forwarded is not written into the device state.
When the next hop device is a destination device of the data packet to be forwarded, the data packet to be forwarded is split because the data packet to be forwarded includes the recorded information of the device state of the network device and the information included in the data packet to be forwarded when the device state is not written in, that is, the information included in the data packet to be forwarded is split, all the device states recorded in the data packet to be forwarded are recorded in the first data packet, and the information included when the data packet to be forwarded is not written in the device state is recorded in the second data packet.
Since the second packet contains information that is contained when the packet to be forwarded is not written in the device state, the information in the second packet is the same information as the information in the packet sent by the source device. This means that the operation of writing the device status of the network device into the packet to be forwarded in the form of a tag and the operation of splitting the packet to be forwarded to obtain the second packet do not affect the normal information transmission between the source device and the destination device.
Step S106: and forwarding the data packet to be forwarded after the equipment state is written through the forwarding port.
When the next hop device is not the destination device of the data packet to be forwarded, after writing the device status of the network device into the data packet to be forwarded in the form of a tag, the data packet to be forwarded is forwarded through the forwarding port determined in step S102.
As can be seen from the above, in the scheme provided in the embodiment of the present invention, a forwarding port and a next hop device for forwarding a data packet to be forwarded are determined by analyzing a received data packet to be forwarded, and if a difference between a current time and a first time is greater than a time difference threshold, a device state of a network device is written in the data packet to be forwarded in a form of a tag, and the first time is updated to the current time. Then if the next hop device of the data packet to be forwarded is the destination device of the data packet to be forwarded, splitting the data packet to be forwarded to obtain a first data packet and a second data packet, forwarding the first data packet to the controller, and forwarding the second data packet to the destination device; otherwise, forwarding the data packet to be forwarded. Therefore, in the scheme provided by the embodiment of the invention, the device state of the network device is written into the data packet to be forwarded in a tag form, when the data packet to be forwarded reaches the previous hop device of the destination device, the data packet to be forwarded is split, and the first data packet containing all the device states recorded in the data packet to be forwarded is forwarded to the controller, so that the whole network telemetry is realized by using the data packet to be forwarded passing through the network device, and the scheme does not need to obtain the topological structure of the distributed network, and does not need to perform detection path planning according to the topological structure of the distributed network, so that the problem that the whole network telemetry is difficult to perform due to the change of the topological structure is solved, and the stability of the whole network telemetry is improved. Therefore, the scheme provided by the embodiment of the invention is applied to the whole network telemetry, and the stability of the whole network telemetry can be improved.
In an embodiment of the present invention, referring to fig. 2, a flowchart of a second label-based distributed lightweight global telemetry method is provided, and compared with the embodiment shown in fig. 1, in this embodiment, if a difference between the current time and the first time is greater than a time difference threshold, step S103 writes a device state of a network device in a form of a label into a packet to be forwarded, and updates the first time to the current time, including the following steps S103A-103D.
Step S103A: if the difference value between the current time and the first time is greater than the time difference threshold, judging whether the data packet to be forwarded is written into the equipment state for the first time, if so, executing the step S103B; if not, step S103C is executed.
And after the condition that the difference value between the current time and the first time is greater than the time difference threshold is met, judging whether the data packet to be forwarded is in a state of writing equipment for the first time.
In one case, whether the data packet to be forwarded is in the state of being written into the device for the first time may be determined by determining whether the data packet to be forwarded includes the device state in the form of a tag. If the data packet to be forwarded contains the equipment state in the form of the label, determining that the data packet to be forwarded is not the equipment state written in the first time; and if the to-be-forwarded data packet does not contain the equipment state in the form of the label, determining that the to-be-forwarded data packet is written into the equipment state for the first time.
In another case, it may be determined whether the packet to be forwarded includes information for characterizing the device status in the form of a tag. If the data packet to be forwarded contains information for representing the equipment state in the label form, determining that the data packet to be forwarded is not written into the equipment state for the first time; and if the data packet to be forwarded does not contain the information for representing the equipment state in the form of the label, determining that the data packet to be forwarded is written into the equipment state for the first time.
Step S103B: and adjusting the first content of a first field contained in an IP header in the data packet to be forwarded into information representing an INT type, and inserting the INT header behind the IP header. Wherein, INT information in INT head includes: the device status of the network device in the form of a tag, and the INT option information in the INT header includes: the first content of the first field and the number of tags of the tag already included in the INT information are fields representing network protocol interface information.
And the device state of the network device in the form of one label is inserted into the INT information every time, adding 1 to the number of labels included in the INT option information.
The IP header includes a plurality of fields, such as a first field, a destination IP field, a source IP field, and the like.
The INT header also includes a plurality of fields, wherein the INT option and the INT information are both fields in the INT header.
The first field is a field indicating network protocol interface information, that is, the first field is used to indicate information represented by the content corresponding to the first field. For example, the first field may be an IP PROTOCOL field, the content of the first field may be "1000", and the content corresponding to the first field may be denoted as EGP (external Gateway PROTOCOL).
The content corresponding to the first field may be the content of the first field following the IP header.
If the first content of the first field in the IP header is "0110", if the information indicating the INT type is "1011", the first content of the first field is adjusted to the information indicating the INT type, that is, "0110" is adjusted to "1011", and the contents of the other fields in the IP header are kept unchanged.
The INT header may be inserted after the last bit included in the IP header. For example, the IP header may be "01101110", the INT header may be "10100011", the INT header is inserted after the IP header, that is, the INT header is inserted after the last bit "0" included in the IP header, and the contents of the IP header and the INT header included in the packet to be forwarded after the INT header are denoted by "0110111010100011".
Step S103C: the device status of the network device is inserted into the INT information in the form of a tag.
When the step is executed, it is stated that the data packet to be forwarded is not written into the device state for the first time, so that the first content of the first field in the data packet to be forwarded has been adjusted to represent the INT type information, and the INT header already exists in the data packet to be forwarded, so that the device state of the network device can be directly inserted into the INT information in the form of a tag.
Step S103D: the first time is updated to the current time.
The first time is updated to the current time, that is, the current time when the device state of the network device is written into the data packet to be forwarded in the form of a tag is recorded as the first time, which is used for judging whether the data packet forwarded by the forwarding port corresponding to the first time next time is written into the device state.
On the basis, the step S105 of splitting the packet to be forwarded to obtain the first packet and the second packet, forwarding the first packet to the controller, and forwarding the second packet to the destination device includes the following steps S105A-105C.
Step S105A: the number of tags recorded in the INT header and the device status of all tag forms are obtained.
In one implementation, the number of tags recorded in the INT header and the device status in all tag forms may be obtained by copying the number of tags included in the INT option information and the contents in the INT information.
In another implementation mode, the number of tags and INT information can be directly extracted from the INT header, and the number of tags recorded in the INT header and the device states of all tag forms can be further obtained.
Step S105B: and generating a first data packet carrying the number of the tags recorded in the INT header and the device states in all tag forms, and forwarding the generated first data packet to the controller.
Since the obtained device status cannot be transmitted in the network alone, only the device status is piggybacked in a data packet, and the device status is transmitted by using the data packet as a carrier.
The controller can obtain the number of the labels recorded in the INT head and the equipment states of all the label forms when receiving the first data packet, and intercept all the equipment states of the label forms in the first data packet according to the recorded number of the labels, so as to further process the equipment states of the network equipment.
Step S105C: and restoring the information which is contained in the first field in the data packet to be forwarded and represents the INT type into first content, deleting the INT head from the data packet to be forwarded, generating a second data packet, and forwarding the generated second data packet to the destination device.
This step is opposite to the above step S103B, since the above step S103B is to write the to-be-forwarded packet from the unwritten device state into the device state for the first time, this step can be understood as to restore the to-be-forwarded packet from the writing into the device state into the to-be-forwarded packet from the unwritten device state, and forward the to-be-forwarded packet from the unwritten device state to the destination device.
As can be seen from the above, in the scheme provided in the embodiment of the present invention, when the device state is written into the to-be-forwarded data packet for the first time, the first content of the first field included in the IP header in the to-be-forwarded data packet is adjusted to information indicating the INT type, the INT header is inserted behind the IP header, and then the device state is written into the to-be-forwarded data packet, the device state can be directly inserted into the INT information of the INT header in the form of a tag, and when the to-be-forwarded data packet reaches the previous-hop device of the destination device, the to-be-forwarded data packet is split. Therefore, the scheme provided by the embodiment of the invention realizes the whole network telemetry without influencing the normal information transmission of the data packet to be forwarded between the source equipment and the destination equipment.
In an embodiment of the present invention, referring to fig. 3, a flowchart of a third distributed lightweight label-based whole-network telemetry method is provided, and compared with the foregoing embodiment shown in fig. 2, in this embodiment, the method further includes the following step S107.
Step S107: if the difference between the current time and the first time is smaller than the time difference threshold, whether the device state of the network device needs to be inserted into the INT information is determined according to the number of the tags, and if so, the step of determining whether the to-be-forwarded data packet is written into the device state for the first time in the step S103A is performed.
In one case, whether the device status of the network device needs to be inserted into the INT information may be determined by setting a number threshold. For example, if the number of tags is greater than a number threshold, the device state of the network device is inserted into the INT information.
The number threshold may be 8, 13, or other values.
Alternatively, the probability of inserting the device state characterizing the network device into the INT information may be calculated based on the number of tags. For example, the probability characterizing the insertion of the device state of a network device into INT information may be calculated according to the following expression:
F(n)=(n+1)/(m+1)
wherein, F (n) represents the probability of inserting the device state of the network device into the INT information, n represents the number of labels, m represents a fixed value, and n is not more than m.
And determining whether the device state of the network device needs to be inserted into the INT information by taking the probability as an influence factor.
The above-mentioned influence factor is a factor influencing the occurrence of an event, but cannot determine whether an event occurs. The larger the influence factor, the more likely the event will occur.
The probability obtained by calculation is used as an influence factor, and if the probability is higher, the possibility that the device state of the network device is inserted into the INT information is higher. However, the decision mechanism for determining whether to insert the device status of the network device into the INT information is only based on the above-mentioned influence factor, and is not a decisive factor for determining whether to insert the device status of the network device into the INT information, that is, although the probability as the influence factor is 0.99, it is possible that the device status of the network device may not be inserted into the INT information.
In this step, the larger the number of tags, the higher the possibility that the to-be-forwarded data packet is written into the device state, which is favorable for writing the device states of multiple network devices into the same to-be-forwarded data packet. Compared with the scheme that the network equipment is written into the data packet to be forwarded according to the relation between the difference value between the current time and the first time and the time difference threshold, the method and the device enable the controller to receive fewer data packets while realizing the whole network telemetry, and reduce the processing load of the controller.
In this step, if it is determined that the device state of the network device needs to be inserted into the INT information according to the number of the tags, a step of determining whether the data packet to be forwarded is written into the device state for the first time is performed.
In an embodiment of the present invention, whether the data packet to be forwarded is written into the device state for the first time may be determined according to the number of the tags.
If the number of the tags is 0, it indicates that the data packet to be forwarded is the first write device state.
If the number of the tags is not 0, it indicates that the data packet to be forwarded is not the first write device state.
As can be seen from the above, in the scheme provided in the embodiment of the present invention, if the difference between the current time and the first time is smaller than the time difference threshold, it is determined whether the device state of the network device needs to be inserted into the INT information according to the number of the tags. The scheme provided by the embodiment of the invention supplements the situation that the difference value between the current time and the first time is smaller than the time difference threshold value on the basis of the scheme provided by the embodiment of the invention, so that the scheme for carrying out whole-network telemetry is more complete and comprehensive.
In one embodiment of the present invention, referring to fig. 4, a schematic flow chart of a fourth distributed lightweight label-based whole-network telemetry method is provided, and compared with the foregoing embodiment shown in fig. 1, the method in this embodiment further includes the following steps S108 to S109.
Step S108: receiving a time difference threshold adjusting instruction sent by a controller, wherein the time difference threshold adjusting instruction is as follows: the controller sends an instruction for adjusting the time difference threshold to the network device according to a first time interval, wherein the first time interval is as follows: the controller detects a time interval for the network device to insert a device status into a packet forwarded by the forwarding port.
Since packet loss may occur in the distributed network, in this case, it is difficult for the controller to receive the first packet containing the device status, and thus difficult to telemeter the network device in the distributed network. Therefore, the controller needs to control the network devices in the distributed network to overcome the problem of packet loss.
The first time interval is a time interval for inserting the device status into the data packet forwarded by the forwarding port by the network device detected by the controller. The controller may receive the first data packet and process the device status included in the first data packet, that is, the controller may correspond the device status included in the first data packet to the network device written in the device status and the forwarding port for forwarding the data packet to be forwarded, so that the first time interval may be determined according to the network device and the forwarding port corresponding to the device status.
For example, if the controller receives two first packets, which are referred to herein as packet 1 and packet 2 for convenience of description, the controller receives packet 1 earlier than packet 2, packet 1 includes the device status inserted by network device 1 into the packet forwarded by forwarding port 1, packet 2 also includes the device status inserted by network device 1 into the packet forwarded by forwarding port 1, and the controller does not receive the packet including the device status inserted by network device 1 into the packet forwarded by forwarding port 1 during the period from the time when packet 1 is received to the time when packet 2 is received, the first time interval is the time interval between the time when packet 1 is received by the controller and the time when packet 2 is received by the controller.
In one case, the controller may generate the time difference threshold adjustment instruction according to the following steps a-C:
step A: and C, judging whether the first time interval is greater than a preset time length or not by the controller, if so, executing the step B, and otherwise, executing the step C.
The preset time period may be a preset fixed value, for example, 1s, 2s, or another value. The preset time duration may also be a value obtained by multiplying the time difference threshold by a fixed coefficient, for example, if the time difference threshold is T and the fixed coefficient is k, the preset time duration is kT.
And B: a time difference threshold adjustment instruction is generated to instruct a decrease of the time difference threshold.
The manner of generating the time difference threshold adjustment instruction indicating to decrease the time difference threshold may be one of the following manners:
the first method is as follows: an instruction is generated to indicate that the time difference threshold is decreased for a length of time. For example, the instruction may be an instruction to reduce the time difference threshold by 1 ms.
The second method comprises the following steps: an instruction is generated indicating that the time difference threshold is shortened to a certain proportion of the original time difference threshold. For example, the instruction may be an instruction to shorten the moveout threshold to one-half of the original moveout threshold.
The third method comprises the following steps: and generating an instruction for adjusting the time difference threshold value to a determined value, wherein the determined value is smaller than the original time difference threshold value. For example, if the original time difference threshold is 10ms, the instruction may be an instruction to adjust the time difference threshold to 8 ms.
And C: a time difference threshold adjustment instruction is generated that indicates an increase in the time difference threshold.
Corresponding to the step B, the manner of generating the time difference threshold adjustment instruction for increasing the time difference threshold may be one of the following manners:
the first method is as follows: an instruction is generated indicating that the time difference threshold is increased for a certain length of time. For example, the instruction may be an instruction to increase the time difference threshold by 1 ms.
The second method comprises the following steps: an instruction is generated indicating that the time difference threshold is extended by a certain multiple of the original time difference threshold. For example, the instruction may be an instruction to extend the time difference threshold to twice the original time difference threshold.
The third method comprises the following steps: and generating an instruction for adjusting the time difference threshold value to a determined value, wherein the determined value is larger than the original time difference threshold value. For example, if the original time difference threshold is 8ms, the instruction may be an instruction to adjust the time difference threshold to 10 ms.
For example, when the preset time length is one minute, if the first time interval is greater than one minute, it indicates that the controller does not detect the device state inserted into the packet forwarded by the forwarding port again within one minute after the controller detects the device state inserted into the packet forwarded by the forwarding port by the network device last time, which indicates that a packet loss problem may occur in the distributed network, and thus the controller cannot detect the device state inserted into the packet forwarded by the forwarding port by the network device. At this time, the controller generates a time difference threshold adjustment instruction for instructing a decrease of the time difference threshold, and the network device receives the time difference threshold adjustment instruction and performs an operation of decreasing the time difference threshold.
If the first time interval is less than one minute, it means that the controller can normally detect that the network device inserts the device status into the packet forwarded by the forwarding port, but in consideration of reducing the processing load of the controller, the controller generates a time difference threshold adjustment instruction for instructing to increase the time difference threshold, and the network device receives the time difference threshold adjustment instruction and performs an operation of increasing the time difference threshold.
Step S109: the time difference threshold is adjusted based on the time difference threshold adjustment instruction.
In one case, if the time difference threshold adjustment instruction is an instruction to adjust the time difference threshold to a certain value, the time difference threshold is adjusted to the value.
In another case, the time difference adjustment factor for the forwarding port, which is locally stored by the network device, is adjusted based on the time difference threshold adjustment instruction.
In this case, the time difference threshold adjustment instruction may be an instruction to instruct the time difference adjustment factor to increase (or decrease) by a certain value. For example, the time difference threshold adjustment instruction may be an instruction indicating that the time difference adjustment factor is plus (or minus) one.
The time difference threshold adjustment instruction may also be an instruction to adjust the time difference adjustment factor to a certain value. For example, the time difference threshold adjustment instruction may be an instruction indicating a time difference adjustment factor of 2.
Furthermore, the value range of the time difference adjustment factor can be limited, and when the time difference adjustment factor is the maximum value of the value range, if the time difference threshold adjustment instruction is an instruction for increasing the time difference adjustment factor, the time difference adjustment factor is not adjusted; when the time difference adjustment factor is the minimum value of the value range, if the time difference threshold adjustment instruction is an instruction to reduce the time difference adjustment factor, the time difference adjustment factor is not adjusted.
In the value range of the time difference adjustment factor, the minimum value may be 0.
Adjusting the moveout threshold according to the following expression:
T2=T1/2S
wherein, T2Indicating the adjusted time difference threshold, T1Denotes a time difference threshold before adjustment, and S denotes a time difference adjustment factor.
The time difference adjustment factor may be a register recorded in the network device, and the time difference threshold is adjusted by adjusting the time difference adjustment factor recorded in the register.
Further, a second time interval for adjusting the time difference adjustment factor may be set, that is, the time difference adjustment factor cannot be adjusted in the second time interval after the time difference adjustment factor is adjusted, so as to ensure that the time difference threshold value is not frequently changed.
As can be seen from the above, in the solution provided in the embodiment of the present invention, the network device receives the time difference threshold adjustment instruction sent by the controller, and adjusts the time difference threshold based on the time difference threshold adjustment instruction, because the time difference threshold is used to control the frequency at which the device status of the network device is written into the packet to be forwarded, the controller can control the frequency at which the device status of the network device is written into the packet to be forwarded by sending the time difference threshold adjustment instruction, and in the case that the frequency at which the device status of the network device is written into the packet to be forwarded needs to be adjusted, the controller only needs to send the time difference threshold adjustment instruction to the network device, so as to adjust the frequency at which the device status of the network device is written into the packet to be forwarded, without performing corresponding operation on the network device, especially in the case that the device statuses of a plurality of network devices need to be adjusted, the workload of workers can be reduced.
Corresponding to the distributed lightweight all-network telemetry method based on the tags, the invention also provides a distributed lightweight all-network telemetry device based on the tags.
Referring to fig. 5, a first distributed lightweight all-network telemetry apparatus based on tags is provided, which is applied to network devices, and comprises:
a first receiving module 501, configured to receive a data packet to be forwarded;
a determining module 502, configured to determine a forwarding port and a next hop device for forwarding the data packet to be forwarded by analyzing the data packet to be forwarded;
a writing module 503, configured to write the device status of the network device into the to-be-forwarded data packet in a form of a tag if a difference between the current time and a first time is greater than a time difference threshold, and update the first time to the current time, where the first time is: the last time the network device writes the device status into the data packet forwarded by the forwarding port;
a determining module 504, configured to determine whether the next hop device is a destination device of the data packet to be forwarded, if so, trigger the splitting module, and if not, trigger the forwarding module;
the splitting module 505 is configured to split the to-be-forwarded data packet if the to-be-forwarded data packet is a first data packet, obtain a second data packet, forward the first data packet to a controller, and forward the second data packet to the destination device, where the first data packet includes: all the device states recorded in the to-be-forwarded data packet, the second data packet includes: information contained when the data packet to be forwarded is not written into the device state;
the forwarding module 506 is configured to forward the to-be-forwarded data packet written in the device state through the forwarding port if the status of the to-be-forwarded data packet is not the same as the status of the device.
As can be seen from the above, in the scheme provided in the embodiment of the present invention, a forwarding port and a next hop device for forwarding a data packet to be forwarded are determined by analyzing a received data packet to be forwarded, and if a difference between a current time and a first time is greater than a time difference threshold, a device state of a network device is written in the data packet to be forwarded in a form of a tag, and the first time is updated to the current time. Then if the next hop device of the data packet to be forwarded is the destination device of the data packet to be forwarded, splitting the data packet to be forwarded to obtain a first data packet and a second data packet, forwarding the first data packet to the controller, and forwarding the second data packet to the destination device; otherwise, forwarding the data packet to be forwarded. Therefore, in the scheme provided by the embodiment of the invention, the device state of the network device is written into the data packet to be forwarded in a tag form, when the data packet to be forwarded reaches the previous hop device of the destination device, the data packet to be forwarded is split, and the first data packet containing all the device states recorded in the data packet to be forwarded is forwarded to the controller, so that the whole network telemetry is realized by using the data packet to be forwarded passing through the network device, and the scheme does not need to obtain the topological structure of the distributed network, and does not need to perform detection path planning according to the topological structure of the distributed network, so that the problem that the whole network telemetry is difficult to perform due to the change of the topological structure is solved, and the stability of the whole network telemetry is improved. Therefore, the scheme provided by the embodiment of the invention is applied to the whole network telemetry, and the stability of the whole network telemetry can be improved.
In an embodiment of the present invention, referring to fig. 6, a second distributed lightweight all-network telemetry apparatus based on tags is provided, and in this embodiment, compared with the foregoing embodiment shown in fig. 5, the writing module 503 includes:
the first judgment sub-module 503A: if the difference between the current time and the first time is greater than the time difference threshold, determining whether the data packet to be forwarded is written into the device state for the first time, if so, triggering the replacement sub-module 503B, and if not, triggering the insertion sub-module 503C;
the replacement submodule 503B: the method is used for adjusting first content of a first field contained in an IP header in the data packet to be forwarded to information representing an INT type, and inserting an INT header behind the IP header, wherein the INT information in the INT header comprises: the device state of the network device in the form of a tag, wherein INT option information in the INT header includes: the first content of the first field and the label number of the label already included in the INT information, wherein the first field is a field representing network protocol interface information;
the insert submodule 503C: the INT information is used for inserting the device state of the network device into the INT information in a tag form;
an update submodule 503D, configured to update the first time to the current time;
the splitting module 505 is specifically configured to:
obtaining the number of the labels recorded in the INT head and the equipment states of all label forms;
generating a first data packet carrying the number of the labels recorded in the INT header and the equipment states of all label forms;
forwarding the first data packet to the controller;
restoring information which is contained in a first field in the data packet to be forwarded and represents an INT type into the first content, deleting the INT head from the data packet to be forwarded, and generating a second data packet;
and forwarding the second data packet to the destination device.
As can be seen from the above, in the scheme provided in the embodiment of the present invention, when the device state is written into the to-be-forwarded data packet for the first time, the first content of the first field included in the IP header in the to-be-forwarded data packet is adjusted to information indicating the INT type, the INT header is inserted behind the IP header, and then the device state is written into the to-be-forwarded data packet, the device state can be directly inserted into the INT information of the INT header in the form of a tag, and when the to-be-forwarded data packet reaches the previous-hop device of the destination device, the to-be-forwarded data packet is split. Therefore, the scheme provided by the embodiment of the invention realizes the whole network telemetry without influencing the normal information transmission of the data packet to be forwarded between the source equipment and the destination equipment.
In an embodiment of the present invention, referring to fig. 7, a schematic structural diagram of a second distributed lightweight label-based whole-network telemetry apparatus is provided, and in this embodiment, compared with the above-mentioned embodiment shown in fig. 5, the writing module 503 further includes:
a second determining submodule 503E, configured to determine, according to the number of tags, whether the device state of the network device needs to be inserted into the INT information if the difference between the current time and the first time is smaller than the time difference threshold, and if so, trigger the first determining submodule to perform the step of determining whether the to-be-forwarded data packet is written into the device state for the first time.
As can be seen from the above, in the scheme provided in the embodiment of the present invention, if the difference between the current time and the first time is smaller than the time difference threshold, it is determined whether the device state of the network device needs to be inserted into the INT information according to the number of the tags. The scheme provided by the embodiment of the invention supplements the situation that the difference value between the current time and the first time is smaller than the time difference threshold value on the basis of the scheme provided by the embodiment of the invention, so that the scheme for carrying out whole-network telemetry is more complete and comprehensive.
In an embodiment of the present invention, the second determining submodule 503E is specifically configured to:
if the difference value between the current time and the first time is smaller than the time difference threshold, calculating the probability of representing the insertion of the equipment state of the network equipment into the INT information according to the number of the labels;
and determining whether the device state of the network device needs to be inserted into the INT information or not by taking the probability as an influence factor.
As can be seen from the above, in the scheme provided by the embodiment of the present invention, the larger the number of tags, the higher the possibility that the to-be-forwarded data packet is written into the device state is, which is favorable for writing the device states of multiple network devices into the same to-be-forwarded data packet. Compared with the scheme that the network equipment is written into the data packet to be forwarded according to the relation between the difference value between the current time and the first time and the time difference threshold, the method and the device enable the controller to receive fewer data packets while realizing the whole network telemetry, and reduce the processing load of the controller.
In one embodiment of the present invention, referring to fig. 8, a schematic structural diagram of a third distributed lightweight all-network telemetry device based on tags is provided, and compared with the foregoing embodiment shown in fig. 5, in this embodiment, the device further includes:
a second receiving module 507, configured to receive a time difference threshold adjusting instruction sent by the controller, where the time difference threshold adjusting instruction is: the controller sends an instruction indicating adjustment of the time difference threshold to the network device according to a first time interval, where the first time interval is: the controller detects a time interval for inserting a device state into a data packet forwarded by the forwarding port by the network device;
an adjusting module 508, configured to adjust the time difference threshold based on the time difference threshold adjusting instruction.
As can be seen from the above, in the solution provided in the embodiment of the present invention, the network device receives the time difference threshold adjustment instruction sent by the controller, and adjusts the time difference threshold based on the time difference threshold adjustment instruction, because the time difference threshold is used to control the frequency at which the device status of the network device is written into the packet to be forwarded, the controller can control the frequency at which the device status of the network device is written into the packet to be forwarded by sending the time difference threshold adjustment instruction, and in the case that the frequency at which the device status of the network device is written into the packet to be forwarded needs to be adjusted, the controller only needs to send the time difference threshold adjustment instruction to the network device, so as to adjust the frequency at which the device status of the network device is written into the packet to be forwarded, without performing corresponding operation on the network device, especially in the case that the device statuses of a plurality of network devices need to be adjusted, the workload of workers can be reduced.
In an embodiment of the present invention, the adjusting module 508 is specifically configured to:
adjusting a time difference adjustment factor for the forwarding port, which is locally stored by the network device, based on the time difference threshold adjustment instruction;
adjusting the time difference threshold according to the following expression:
T2=T1/2S
wherein, T2Indicating the adjusted time difference threshold, T1Representing the time difference threshold before adjustment and S the time difference adjustment factor.
In an embodiment of the present invention, if the controller determines that the first time interval is greater than a preset duration, the time difference threshold adjustment instruction is: instructions for instructing a decrease in the time difference threshold, otherwise, the time difference threshold adjustment instructions are: instructions for instructing an increase in the time difference threshold.
The embodiment of the present invention further provides a network device, as shown in fig. 9, which includes a processor 901, a communication interface 902, a memory 903 and a communication bus 904, where the processor 901, the communication interface 902, and the memory 903 complete mutual communication through the communication bus 904,
a memory 903 for storing computer programs;
the processor 901 is configured to implement the following steps when executing the program stored in the memory 903:
receiving a data packet to be forwarded;
determining a forwarding port and next hop equipment for forwarding the data packet to be forwarded by analyzing the data packet to be forwarded;
if the difference value between the current time and the first time is greater than the time difference threshold, writing the device state of the network device into the data packet to be forwarded in a tag form, and updating the first time to the current time, wherein the first time is: the last time the network device writes the device status into the data packet forwarded by the forwarding port;
judging whether the next hop equipment is the target equipment of the data packet to be forwarded or not;
if so, splitting the data packet to be forwarded to obtain a first data packet and a second data packet, forwarding the first data packet to a controller, and forwarding the second data packet to the destination device, wherein the first data packet comprises: all the device states recorded in the to-be-forwarded data packet, the second data packet includes: information contained when the data packet to be forwarded is not written into the device state;
if not, forwarding the data packet to be forwarded after writing the equipment state through the forwarding port.
The communication bus mentioned in the network device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the network device and other devices.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the above-mentioned tag-based distributed lightweight all-network telemetry methods.
In yet another embodiment, a computer program product containing instructions is also provided, which when run on a computer, causes the computer to perform any of the above embodiments of the tag-based distributed lightweight network-wide telemetry method.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be 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. Also, 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, network device, computer-readable storage medium, and computer program product embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and for related matters, reference may be made to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A distributed lightweight all-network telemetry method based on tags is applied to network equipment, and the method comprises the following steps:
receiving a data packet to be forwarded;
determining a forwarding port and next hop equipment for forwarding the data packet to be forwarded by analyzing the data packet to be forwarded;
if the difference value between the current time and the first time is greater than the time difference threshold, writing the device state of the network device into the data packet to be forwarded in a tag form, and updating the first time to the current time, wherein the first time is: the last time the network device writes the device status into the data packet forwarded by the forwarding port;
judging whether the next hop equipment is the target equipment of the data packet to be forwarded or not;
if so, splitting the data packet to be forwarded to obtain a first data packet and a second data packet, forwarding the first data packet to a controller, and forwarding the second data packet to the destination device, wherein the first data packet comprises: all the device states recorded in the to-be-forwarded data packet, the second data packet includes: information contained when the data packet to be forwarded is not written into the device state;
if not, forwarding the data packet to be forwarded after writing the equipment state through the forwarding port.
2. The method of claim 1, wherein writing the device status of the network device to the packet to be forwarded in the form of a tag comprises:
judging whether the data packet to be forwarded is written into the equipment state for the first time;
if so, adjusting the first content of a first field contained in an IP header in the data packet to be forwarded to information representing an in-band network telemetry (INT) type, and inserting an INT header behind the IP header, wherein the INT information in the INT header comprises: the device state of the network device in the form of a tag, wherein INT option information in the INT header includes: the first content of the first field and the label number of the label already included in the INT information, wherein the first field is a field representing network protocol interface information;
if not, inserting the device state of the network device into the INT information in a tag form;
the splitting the data packet to be forwarded to obtain a first data packet and a second data packet includes:
obtaining the number of the labels recorded in the INT head and the equipment states of all label forms;
generating a first data packet carrying the number of the labels recorded in the INT header and the equipment states of all label forms;
and restoring the information which is contained in the first field in the data packet to be forwarded and represents the INT type into the first content, deleting the INT head from the data packet to be forwarded, and generating a second data packet.
3. The method of claim 2, further comprising:
if the difference value between the current time and the first time is smaller than the time difference threshold, judging whether the equipment state of the network equipment needs to be inserted into the INT information or not according to the number of the labels;
if so, executing the step of judging whether the data packet to be forwarded is written into the equipment state for the first time.
4. The method according to claim 3, wherein said determining whether the device status of the network device needs to be inserted into the INT information according to the number of the tags comprises:
according to the number of the labels, calculating the probability of representing the insertion of the device state of the network device into the INT information;
and determining whether the device state of the network device needs to be inserted into the INT information or not by taking the probability as an influence factor.
5. The method according to any one of claims 1-4, further comprising:
receiving a time difference threshold adjusting instruction sent by a controller, wherein the time difference threshold adjusting instruction is as follows: the controller sends an instruction indicating adjustment of the time difference threshold to the network device according to a first time interval, where the first time interval is: the controller detects a time interval for inserting a device state into a data packet forwarded by the forwarding port by the network device;
adjusting the time difference threshold based on the time difference threshold adjustment instruction.
6. The method of claim 5, wherein the adjusting the time difference threshold based on the time difference threshold adjustment instruction comprises:
adjusting a time difference adjustment factor for the forwarding port, which is locally stored by the network device, based on the time difference threshold adjustment instruction;
adjusting the time difference threshold according to the following expression:
T2=T1/2S
wherein, T2Indicating the adjusted time difference threshold, T1Representing the time difference threshold before adjustment and S the time difference adjustment factor.
7. The method of claim 5 or 6, wherein the controller generates the time difference threshold adjustment instruction in the following manner:
the controller judges whether the first time interval is greater than a preset time length;
if so, generating a time difference threshold adjusting instruction for indicating to reduce the time difference threshold;
otherwise, generating a time difference threshold adjustment instruction for indicating to increase the time difference threshold.
8. A distributed lightweight all-network telemetry device based on tags, applied to network equipment, the device comprising:
the first receiving module is used for receiving the data packet to be forwarded;
a determining module, configured to determine a forwarding port and a next hop device for forwarding the packet to be forwarded by analyzing the packet to be forwarded;
a writing module, configured to write the device status of the network device into the to-be-forwarded data packet in a tag form if a difference between the current time and a first time is greater than a time difference threshold, and update the first time to the current time, where the first time is: the last time the network device writes the device status into the data packet forwarded by the forwarding port;
the judging module is used for judging whether the next hop equipment is the target equipment of the data packet to be forwarded or not, if so, the splitting module is triggered, and if not, the forwarding module is triggered;
the splitting module is configured to split the data packet to be forwarded to obtain a first data packet and a second data packet, forward the first data packet to a controller, and forward the second data packet to the destination device, where the first data packet includes: all the device states recorded in the to-be-forwarded data packet, the second data packet includes: information contained when the data packet to be forwarded is not written into the device state;
and the forwarding module is used for forwarding the data packet to be forwarded after the equipment state is written through the forwarding port.
9. The network equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing the communication between the processor and the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 7 when executing a program stored in the memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 7.
CN202110500776.XA 2021-05-08 2021-05-08 Distributed lightweight total network remote measuring method and device based on label Active CN113225229B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110500776.XA CN113225229B (en) 2021-05-08 2021-05-08 Distributed lightweight total network remote measuring method and device based on label

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110500776.XA CN113225229B (en) 2021-05-08 2021-05-08 Distributed lightweight total network remote measuring method and device based on label

Publications (2)

Publication Number Publication Date
CN113225229A CN113225229A (en) 2021-08-06
CN113225229B true CN113225229B (en) 2022-04-05

Family

ID=77094065

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110500776.XA Active CN113225229B (en) 2021-05-08 2021-05-08 Distributed lightweight total network remote measuring method and device based on label

Country Status (1)

Country Link
CN (1) CN113225229B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115459873B (en) * 2022-08-18 2023-05-30 清华大学 Data transmission method, storage medium and device applied to network device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112422498A (en) * 2020-09-04 2021-02-26 网络通信与安全紫金山实验室 In-band network remote measuring method, system and computer readable storage medium
CN112436984A (en) * 2020-11-30 2021-03-02 清华大学 Data center network telemetry method, system, storage medium and telemetry server
CN112702330A (en) * 2020-12-21 2021-04-23 网络通信与安全紫金山实验室 Lightweight in-band network telemetry method and device for Overlay network and storage medium
CN112738914A (en) * 2020-12-24 2021-04-30 西安电子科技大学 Integrated sensing node device and working method thereof

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200067792A1 (en) * 2018-08-21 2020-02-27 Argela Yazilim Ve Bilisim Teknolojileri San Ve Tic A S System and method for in-band telemetry target selection
US11323340B2 (en) * 2019-01-07 2022-05-03 Vmware, Inc. Packet flow monitoring in software-defined networking (SDN) environments

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112422498A (en) * 2020-09-04 2021-02-26 网络通信与安全紫金山实验室 In-band network remote measuring method, system and computer readable storage medium
CN112436984A (en) * 2020-11-30 2021-03-02 清华大学 Data center network telemetry method, system, storage medium and telemetry server
CN112702330A (en) * 2020-12-21 2021-04-23 网络通信与安全紫金山实验室 Lightweight in-band network telemetry method and device for Overlay network and storage medium
CN112738914A (en) * 2020-12-24 2021-04-30 西安电子科技大学 Integrated sensing node device and working method thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于高性能包处理架构VPP的带内网络遥测系统;潘恬 等;《通信学报》;20210331;第42卷(第3期);第75-89页 *

Also Published As

Publication number Publication date
CN113225229A (en) 2021-08-06

Similar Documents

Publication Publication Date Title
US10897391B2 (en) Fault detection method and node device
EP1706959B1 (en) Detection of forwarding problems for external prefixes
US10826823B2 (en) Centralized label-based software defined network
CN105191235A (en) Cut-through processing for slow and fast ports
CN112929241B (en) Network testing method and device
CN113225229B (en) Distributed lightweight total network remote measuring method and device based on label
CN111026324B (en) Updating method and device of forwarding table entry
US20230324868A1 (en) Control system, local device, and remote device
US11088960B2 (en) Information processing apparatus and verification system
US11314772B2 (en) Robust data replication among data centers
KR20190143229A (en) Apparatus and Method for managing Network Trouble Alarm
JP5042125B2 (en) P2P communication control system and control method
CN108768778B (en) Network delay calculation method, device, equipment and storage medium
US10805206B1 (en) Method for rerouting traffic in software defined networking network and switch thereof
WO2021056715A1 (en) Server proxy monitoring method and related product
Mankov et al. Collection of individual packet statistical information in a flow based on P4-switch
CN109218199B (en) Message processing method and device
US20230113776A1 (en) Traffic application amount calculation apparatus, method and program
US10680747B2 (en) System and method to measure and score application health via correctable errors
US20020105914A1 (en) Method and apparatus for setting system time out values in a nodally networked system
CN110928693B (en) Computing equipment and resource allocation method
CN115277504A (en) Network traffic monitoring method, device and system
US20070220485A1 (en) Code Editing for Data Traffic Modification
JP6724583B2 (en) Information processing apparatus, information processing method, program, and information processing system
US7577958B1 (en) Expediting an operation in a computer system

Legal Events

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