[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN112351050A - Method, device, communication equipment and storage medium for mirroring data stream - Google Patents

Method, device, communication equipment and storage medium for mirroring data stream Download PDF

Info

Publication number
CN112351050A
CN112351050A CN201910722352.0A CN201910722352A CN112351050A CN 112351050 A CN112351050 A CN 112351050A CN 201910722352 A CN201910722352 A CN 201910722352A CN 112351050 A CN112351050 A CN 112351050A
Authority
CN
China
Prior art keywords
label
mirror image
mirroring
session
port
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.)
Withdrawn
Application number
CN201910722352.0A
Other languages
Chinese (zh)
Inventor
牛金明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201910722352.0A priority Critical patent/CN112351050A/en
Priority to PCT/CN2020/104536 priority patent/WO2021023028A1/en
Publication of CN112351050A publication Critical patent/CN112351050A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24568Data stream processing; Continuous queries

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention provides a method, a device, communication equipment and a storage medium for mirroring data streams, wherein a mirror image table is preset, the mirror image table comprises a label mirror image table, the label mirror image table comprises a label mirror image session, and one label mirror image session comprises a mirror image identifier, at least one layer of label layer, label values corresponding to each label layer, a source mirror image entity identifier associated with each label value and a destination port; when receiving the data flow of source port, then can match corresponding target label mirror image conversation in the mirror image table according to the mirror image sign of source port when, and then sieve out from the data flow of source port and send to corresponding destination port with target label mirror image conversation assorted target data, and the data flow to other parts of source port then can not the mirror image, can avoid the secondary after the mirror image to seek, can promote mirror image control's accuracy and efficiency again, can avoid carrying out the mirror image to other data flows of source port and the wasting of resources that leads to simultaneously again, promote user experience satisfaction.

Description

Method, device, communication equipment and storage medium for mirroring data stream
Technical Field
The present invention relates to the field of communications, and in particular, to a method, an apparatus, a communication device, and a storage medium for mirroring a data stream.
Background
The mirroring function simply means to mirror the monitored traffic to the monitoring port, so as to perform fault location, traffic analysis, traffic backup, and the like on the monitored traffic. The port where the monitored traffic is located is called a source port, the monitoring port is also called a destination port, and the destination port is directly connected with a network analyzer and the like.
In the related art, the mirroring implementation is to mirror all the data streams of the source port to the destination port, and this mirroring implementation has the advantages of simple implementation but has the following disadvantages:
all data flows of a source port are mirrored to a destination port, the mirrored data volume is large, the mirroring efficiency is low, especially in some application scenarios, when only a part of specific data flows in the source port flow need to be subjected to fault location, flow analysis or flow backup, etc., the required specific data flows need to be searched for twice from a large number of mirrored data flows, the searching process is tedious and needs a large amount of time, while other large numbers of mirrored data flows are useless data flows, but rather interfere with the searching analysis of the specific data, and simultaneously, a great deal of resource waste is caused. Therefore, the manner of directly mirroring all data streams of the source port in the related art does not well satisfy the requirement that only data streams specified by the source port are mirrored.
Disclosure of Invention
The method, the device, the communication equipment and the storage medium for mirroring the data stream provided by the embodiment of the invention solve the problem that the requirement that only the data stream specified by the source port needs to be mirrored cannot be met in a mode of directly and completely mirroring the data stream of the source port in the related technology.
To solve the foregoing technical problem, an embodiment of the present invention provides a method for mirroring a data stream, including:
when receiving a data stream of a port provided with a mirror image identifier, matching a corresponding target mirror image session in a mirror image table according to the mirror image identifier, wherein the mirror image table comprises a label mirror image table, the label mirror image table comprises label mirror image sessions, and one label mirror image session comprises the mirror image identifier, at least one layer of label layer, a label value corresponding to each label layer, a source mirror image entity identifier associated with each label value, and a destination port;
when the matched target mirror image session comprises a target label mirror image session, screening out a target data stream matched with the target label mirror image session from the data stream as a data stream to be mirrored;
and sending the data stream to be mirrored to a destination port in the target label mirroring session.
To solve the foregoing technical problem, an embodiment of the present invention further provides an apparatus for mirroring a data stream, including:
the matching processing module is used for matching a corresponding target mirror image session in a mirror image table according to a mirror image identifier when receiving a data stream of a port provided with the mirror image identifier, wherein the mirror image table comprises a label mirror image table, the label mirror image table comprises label mirror image sessions, and one label mirror image session comprises the mirror image identifier, at least one layer of label layer, a label value corresponding to each label layer, a source mirror image entity identifier associated with each label value and a destination port;
and the mirror image processing module is used for screening out a target data stream matched with the target label mirror image session from the data stream as a data stream to be mirror image when the target mirror image session comprises the target label mirror image session, and sending the data stream to be mirror image to a target port in the target label mirror image session.
In order to solve the above technical problem, an embodiment of the present invention further provides a communication device, including a processor and a memory;
the processor is adapted to execute the computer program stored in the memory to implement the steps of the method of mirroring data streams as described above.
To solve the above technical problem, an embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program, where the computer program is executable by a processor to implement the steps of the method for mirroring data streams as described above.
Advantageous effects
According to the method, the device, the communication equipment and the storage medium for mirroring the data stream, provided by the embodiment of the invention, the mirroring table is preset, the mirroring table comprises a label mirroring table, the label mirroring table comprises label mirroring sessions, and one label mirroring session comprises a mirroring identifier, at least one layer of label layer, a label value corresponding to each label layer, a source mirroring entity identifier associated with each label value and a destination port; a mirror image identifier is correspondingly arranged on the port needing mirror image processing; when receiving the data flow of the port (namely the source port) provided with the mirror image identification, the corresponding target mirror image conversation can be matched in the mirror image table according to the mirror image identification, when the matched target mirror image conversation comprises the target label mirror image conversation, the target data flow matched with the target label mirror image conversation is screened from the data flow of the source port and is used as the data flow to be mirrored and sent to the corresponding target port, namely the target data flow matched with the label value of each label layer in the target label mirror image conversation and the source mirror image entity identification related to each label value is screened from the data flow of the source port and is sent to the corresponding target port, so that the data flow of the set part of the source port is mirrored, and the data flow of other parts can not be mirrored, thereby avoiding the secondary searching after mirroring, and improving the accuracy and the mirroring control of the data flow, meanwhile, resource waste caused by mirroring other data flows of the source port can be avoided, and user experience satisfaction is improved.
Additional features and corresponding advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
Fig. 1 is a schematic flow chart of a tag mirror table according to a first embodiment of the present invention;
fig. 2 is a flowchart illustrating a method for mirroring data streams according to a first embodiment of the present invention;
fig. 3 is a schematic structural diagram of a device for mirroring data streams according to a second embodiment of the present invention;
fig. 4 is a schematic diagram of a generation flow of a tag mirroring session according to a second embodiment of the present invention;
FIG. 5 is a diagram illustrating a data flow mirroring process according to a second embodiment of the present invention;
fig. 6 is a schematic structural diagram of a communication device according to a third embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention are described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The first embodiment is as follows:
the method aims at the problems that in the related art, the method for directly mirroring all data streams of a source port (referred to as a port mirroring method in this embodiment) has large data volume of mirroring, is low in efficiency, and cannot well meet the requirement that only data streams specified by the source port need to be mirrored. In the method for mirroring a data stream according to this embodiment, a mirror table including a label mirror table may be preset, and one or more label mirror sessions may be set in the label mirror table according to a requirement, where one label mirror session includes a mirror identifier, at least one layer of label layer, a label value corresponding to each label layer, a source mirror entity identifier associated with each label value, and a destination port; and correspondingly setting a mirror image identifier for the port needing mirror image processing. Based on the above setting, when the data stream of the port (also called source port) provided with the mirror image identifier is received and the corresponding target tag mirror image session is matched in the mirror image table according to the mirror image identifier, the part of the target data stream matched (also corresponding) with the target tag mirror image session in the data stream of the source port can be mirrored, so that the data stream of the set part of the source port can be mirrored, and the data streams of other parts of the source can not be mirrored, so that the data stream needing mirroring can be greatly reduced, secondary search of the designated data stream after mirroring can be avoided, the accuracy of data stream mirror image control, the mirror image efficiency and the resource utilization rate are improved, and the user experience satisfaction is improved.
For ease of understanding, the present embodiment will be described below with an exemplary setting process of the tag mirror table.
Referring to fig. 1, a setting process of the tag mirror table in the embodiment includes:
s101: a label mirroring session is created.
In this embodiment, the created label mirror session includes a mirror identifier, at least one label layer, and a label value corresponding to each label layer. In this embodiment, the mirror identifiers of different tag mirror sessions are different, that is, the mirror identifier can uniquely identify one tag mirror session.
In this embodiment, the number of label layers included in the label mirroring session may be flexibly set according to a specific application scenario and requirements, for example, the number of label layers may be set as one layer, two layers or three layers according to requirements; of course, in some application scenarios, three or more layers may be provided according to specific requirements. In this embodiment, the specific setting of the tag value corresponding to each tag layer may also be flexibly set according to the specific application scenario and the requirement. For example, in some application scenarios of the present embodiment, the tag value may be set as an incoming tag value.
S102: and associating the source mirror image entity and setting a mirror image destination port.
The source mirror entity in this embodiment may also be determined flexibly according to specific application scenarios and requirements. For example, in one example, the source mirroring entity can include, but is not limited to, at least one of a tunnel, a pseudowire, and a L3VPN (Virtual Private Network). In this embodiment, associating the source mirror entity includes associating the label value of each layer in the label mirror session created in S101 with the source mirror entity identifier of the corresponding source mirror entity. The source mirror entity identifier in this embodiment may be any identifier or identification information capable of uniquely identifying the source mirror entity.
It should be understood that the destination port in this step can also be flexibly configured according to a specific application scenario.
Through the two steps, all required label mirror image sessions can be configured according to the current application scene. Of course, in some examples, tag mirroring sessions may also be added or deleted or modified dynamically at a later time.
S103: and generating a forwarding information table.
In an example of this embodiment, the generated forwarding information table may include, but is not limited to, a logical port table and a mirror table; wherein:
the logical port table includes each logical port (i.e., a port in this embodiment) obtained by converting and mapping according to physical resource information of the device or the system, and each logical port has a corresponding entity, which may include, but is not limited to, entities such as a tunnel, a pseudo wire, an L3VPN, and the like; for each logical port in the logical port table, determining which entities corresponding to the logical ports are entities associated in the label mirror session by combining the label mirror session generated in the previous two steps, and marking the logical ports respectively by adopting mirror identifiers in the corresponding label mirror session (or adopting other identifiers having a unique mapping relation with the mirror identifiers); this allows for which logical ports in the logical port table need to be mirrored. Correspondingly, summarizing the label mirror image sessions obtained in the previous two steps to obtain the label mirror image table included in the mirror image table.
For example, in an example, the mirror identifier in each label mirror session may be set as a mirror session ID, and the obtained label mirror table is shown in table 1 below:
TABLE 1
Figure BDA0002157660010000061
In this example, it is assumed that the resulting logical port table is shown in table 2 below:
TABLE 2
Figure BDA0002157660010000062
Figure BDA0002157660010000071
In table 2, the second logical port, the ith logical port, and the nth logical port are all provided with mirror identifiers, which indicates that these logical ports are source ports that need to be mirrored.
In addition, it should be understood that, in some examples of this embodiment, one logical port may not have a corresponding mirror identifier, indicating that the logical port does not need to be mirrored; one logical port may also correspond to one or two or more mirror identifiers, indicating that the logical port needs to be mirrored. When one logical port corresponds to two or more mirror identifiers, the mirror modes corresponding to the mirror identifiers may be the same or different. For example, one mirror identifier may be a mirror identifier corresponding to a port mirror mode in the related art, and the other mirror identifier is a mirror identifier of a tag mirror mode provided in this embodiment; the combination can be flexibly set according to specific requirements.
It should be understood that, in the present embodiment, the corresponding tag mirroring session may be generated after the above logical port table is obtained; and in some examples, dynamic updates to the tag mirroring sessions in the tag mirroring tables described above may be supported.
Based on the above arrangement, an exemplary method for mirroring data streams in this embodiment is shown in fig. 2, which includes but is not limited to:
s201: when receiving a data stream of a port (hereinafter referred to as a source port) provided with a mirror identifier, matching a corresponding target mirror session in a mirror table according to the mirror identifier of the source port.
As shown above, the mirror table includes a label mirror table, the label mirror table includes a label mirror session, and one label mirror session includes a mirror identifier, at least one label layer, a label value corresponding to each label layer, a source mirror entity identifier associated with each label value, and a destination port.
Alternatively, the mirror identifier here may be, but is not limited to, a mirror session ID having a unique identification characteristic in the system, as shown in table 1 above.
S202: when the matched target mirror image session comprises a target label mirror image session, screening out a target data stream matched with the target label mirror image session from the data stream of the source port as a data stream to be mirrored; that is, the target data stream matched with the label value of each label layer in the target label mirror session and the source mirror entity identifier associated with each label value is screened from the data stream of the source port as the data stream to be mirrored.
S203: and sending the data stream to be mirrored to a destination port in the target label mirroring session. For example, a copy of the data stream to be mirrored from the data stream of the source port is sent to the destination port, and the source data of the source port is forwarded according to the normal traffic. Therefore, the mirror image data flow received by the destination port is the designated target data flow in the label mirror image session, so that the data flow needing mirror image can be greatly reduced, secondary search of the designated data flow after mirror image can be avoided, and the accuracy of data flow mirror image control, mirror image efficiency and resource utilization rate are improved.
Optionally, in some application scenarios of this embodiment, the label mirroring manner provided in this embodiment may be flexibly combined with a port mirroring manner in the related art for use, and at this time, the mirroring table may further include a port mirroring table, where the port mirroring table includes a port mirroring session. For example, as shown in the above analysis, when a mirror identifier corresponding to a tag mirror mode and a mirror identifier corresponding to a port mirror mode are set for a certain source port, the priority of the tag mirror mode of the source port may be set to be higher than that of the port mirror mode, that is, the priority of the tag mirror session of the source port is higher than that of the port mirror session. At this time, when the data stream is received by the source port, and the target mirror image session matched according to the mirror image identifier of the source port includes the target port mirror image session and the target tag mirror image session, the data stream of the source port may be mirror-processed only according to the target tag mirror image session, and the port mirror image processing is no longer performed on the source port.
In other application scenarios of this embodiment, when all data flows of the source port need to be monitored comprehensively, the priority of the tag mirroring mode of the source port may be set to be lower than that of the port mirroring mode, that is, the priority of the tag mirroring session of the source port is lower than that of the port mirroring session. At this time, when the data stream is received by the source port, and the target mirror image session matched according to the mirror image identifier of the source port includes the target port mirror image session and the target tag mirror image session, the data stream of the source port may be mirror-processed only according to the target port mirror image session, and the tag mirror image processing is no longer performed on the source port.
Of course, in other application scenarios of this embodiment, both the tag mirroring and the port mirroring may be performed on the source port according to requirements (for example, when the destination ports of the tag mirroring and the port mirroring are different or have other specific requirements). That is, the port mirroring mode and the tag mirroring mode can be flexibly combined according to specific applications.
In this embodiment, when a matched target mirroring session only includes a target port mirroring session for a certain source port, the data stream of the source port may be mirrored according to the matched target port mirroring session.
In addition, as shown above, in this embodiment, the number of layers in the label mirroring session, the label value of each layer, and the source mirroring entity associated with the label value of each layer may all be flexibly set. For ease of understanding, the present embodiment is described below with reference to several exemplary tag mirroring session structures as examples.
In one example, for a label mirroring session that includes a label layer whose label value can be, but is not limited to, an incoming label value of a tunnel, pseudowire, or L3VPN to be mirrored, the source mirroring entity identification associated with the incoming label value corresponds to an identification of the tunnel, pseudowire, or L3 VPN.
In one example, for a label mirroring session including two label layers, a first label value of a first label layer is a first incoming label value of a first tunnel to be mirrored, and a first source mirroring entity identifier associated with the first incoming label value is an identifier of the first tunnel;
a second label value of the second label layer is a second tunnel to be mirrored, a second pseudo-line or a second incoming label value of a second L3VPN, and a second source mirroring entity identifier associated with the second incoming label value corresponds to an identifier of the second tunnel, the second pseudo-line or the second L3 VPN;
in this example, when the second label value of the second label layer is the second incoming label value of the second tunnel to be mirrored, the first tunnel is a ring tunnel, and the second tunnel is the tunnel to be mirrored under the first tunnel.
In one example, for a label mirroring session including three label layers, a first label value of a first label layer is a first incoming label value of a first tunnel to be mirrored, a first source mirroring entity identifier associated with the first incoming label value is an identifier of the first tunnel, and the first tunnel is a ring tunnel;
a second label value of the second label layer is a second tunnel second incoming label value of a second tunnel to be mirrored under the first tunnel, and a second source mirror image entity identifier associated with the second incoming label value corresponds to an identifier of the second tunnel, a second pseudo wire or a second L3 VPN;
and the third label value of the third label layer is a third pseudo-line to be mirrored or a third incoming label value of the third L3VPN, and the third source mirroring entity identifier associated with the third incoming label value corresponds to the identifier of the third pseudo-line or the third L3 VPN.
Therefore, the specific structure of the label mirroring session in this embodiment can also be flexibly set according to specific requirements; the method can perform multi-layer screening control on the target data stream needing mirroring to realize fine-grained mirroring, and can better meet the requirements of various application scenarios, such as but not limited to various application scenarios which need to accurately acquire the required mirroring data stream at the NNI (Network Node Interface) side in a packet transport Network.
Example two:
the present invention provides a device for mirroring data streams, which can be disposed in various communication devices as network nodes, please refer to fig. 3, including:
the matching processing module 301 is configured to, when receiving a data stream of a port provided with a mirror identifier, match a corresponding target mirror session in a mirror table according to the mirror identifier, where the mirror table includes a tag mirror table, the tag mirror table includes a tag mirror session, and one tag mirror session includes the mirror identifier, at least one tag layer, a tag value corresponding to each tag layer, a source mirror entity identifier associated with each tag value, and a destination port; for a specific matching process, please refer to the above embodiments, which are not described herein.
The mirror image processing module 302 is configured to, when the target mirror image session includes a target label mirror image session, screen out a target data stream matched with the target label mirror image session from the data streams as a data stream to be mirrored; that is, the target data stream matched with the label value of each label layer in the target label mirror session and the source mirror entity identifier associated with each label value is screened from the data stream of the source port as the data stream to be mirrored. For a specific processing procedure, please refer to the above embodiments, which are not described herein again.
For ease of understanding, the present embodiment is described below with reference to several application scenarios as examples.
Scene one: the label mirror session includes three label layers, which are a ring tunnel label + a pseudowire label (or an L3VPN label), respectively.
First, a label mirroring session is created.
The mirror image label information comprises a label layer and a label value, the label layer is three layers, and the label value of each layer is the incoming label value (also can be the incoming label value of L3VPN) of the ring tunnel, the tunnel and the pseudo wire to be mirrored.
And secondly, associating the source mirror image entity and designating a mirror image destination port.
Please refer to fig. 4, which includes:
s401: a tag mirroring session ID is set.
S402: and setting a first layer of tags, specifically indicating incoming tag values corresponding to the ring tunnel, and associating the ring tunnel ID. For example, the ring tunnel ID to be mirrored is 65532 and the incoming label value is 18.
S403: setting a second layer label, specifically an incoming label value corresponding to the tunnel, and associating the tunnel ID; for example, the tunnel ID to be mirrored is 1 and the incoming label is 16.
S404: and setting a third layer label, specifically to an incoming label value of the pseudo wire, and associating the pseudo wire ID, for example, a data flow with a pseudo wire ID of 1 and an incoming label value of 205800.
S405: and configuring a destination port of the image. For example, mirroring to a destination port value of 205800, associating PW ID1, the label mirroring of destination ports gei-1/1 is gei-1/1 ports. This creates a layer label of 3 for a label mirroring session with a first layer label value of 18, an associated ring tunnel ID of 65532, a second layer label value of 16, an associated tunnel ID1, a third layer label value of 205800, an associated PW ID1, destination ports gei-1/1.
And thirdly, generating a forwarding information table, and finishing data flow mirroring according to the forwarding information table.
The forwarding information table includes a logical port table and a mirror table, and for a specific generation process, reference is made to the foregoing embodiments, which are not described herein again.
For the mirroring process of the data stream, please refer to fig. 5, which includes:
s501: the hardware receives the data stream of the logical port.
S502: determining whether the logical port enables port mirroring from the logical port table, if yes, proceeding to S503; otherwise, go to S506.
S503: determining whether the logical port enables the tag mirroring from the logical port table, if so, going to S504; otherwise, go to S505.
S504: and reading a target label mirror image session corresponding to the label mirror image table, matching a target data stream (namely, a data stream to be mirrored) corresponding to the target label mirror image session from the data stream of the logic port, and sending the target data stream to the target port of the corresponding slot position.
S505: and carrying out normal service processing on the data stream of the port.
S506: determining whether the port enables port mirroring from the logical port table, if yes, going to S504; otherwise, go to S507.
S507: and carrying out port mirroring on the data stream of the logical port.
Scene two: the label mirroring session includes two layers of labels, tunnel label + pseudowire label (L3VPN label), respectively.
First, a label mirroring session is created.
The mirror image label information comprises a label layer and a label value, the label layer is two layers, and the label value of each layer is the incoming label value of the tunnel to be mirrored and the pseudo wire (also can be the incoming label value of the L3 VPN);
and secondly, associating the source mirror image entity and designating a mirror image destination port.
The source mirroring entity is a tunnel, a pseudowire (or an L3 VPN). A first layer of labels, specifically label values corresponding to the tunnel, and associating the tunnel ID; the second layer label value refers to the pseudowire or L3VPN label value and, in association with the pseudowire ID (which may also be the L3VPN ID), specifies the destination port of the image. For example, if mirroring a data stream with tunnel ID1, incoming label 16, pseudowire ID1, and incoming label 205800, mirroring to a destination port gei-1/1, a layer 2 label can be created, where the first layer label value is 16, tunnel ID1 is associated, the second layer label value is 205800, PW ID1 is associated, and label mirroring sessions of destination ports gei-1/1 are associated.
And thirdly, generating a forwarding information table, and finishing data flow mirroring according to the forwarding information table.
The forwarding information table includes a logical port table and a label mirror table, and for a specific processing flow, please refer to fig. 5, which is not described herein again.
Scene three: the label mirroring session comprises a label layer which is a tunnel label or a pseudo wire label or an L3VPN label:
first, a label mirroring session is created.
The mirror image label information comprises a label layer and a label value, wherein the label layer is a layer and is an incoming label value of a tunnel or a pseudo wire or an L3VPN to be mirrored.
And secondly, associating the source mirror image entity and designating a mirror image destination port.
The source mirroring entity includes, but is not limited to, a tunnel, a pseudowire, or an L3 VPN. Associating the source mirror image entity is to associate the mirror image label value with the source mirror image entity, specifically to the incoming label value corresponding to the tunnel or the pseudo wire or the L3VPN, and to associate the tunnel ID or the pseudo wire ID or the L3VPN ID; and specifies the destination port of the image. For example, to mirror a data stream with tunnel ID1 and ingress label 16 to destination port gei-1/1, a layer 1 label with a label value of 16 may be created to associate with the tunnel ID1 and the label mirroring session for destination ports gei-1/1.
And thirdly, generating a forwarding information table, and finishing data flow mirroring according to the forwarding information table.
As described above, the forwarding information table includes a logical port table and a label mirror table. Generating a logic port table according to the physical resource information of the device; if the label mirror image exists, a label mirror image table is required to be generated and mirror image marking is carried out, and the priority of the label mirror image is higher than that of the port mirror image. And the hardware processing module acquires the information of the mirror image through the forwarding information table. The first part of data flow is forwarded according to normal service; and the second data flow is forwarded to the destination port of the mirror image according to the mirror image forwarding table entry. For a detailed processing flow, please refer to fig. 5, which is not described herein again.
Example three:
the present embodiment also provides a communication device, as shown in fig. 6, which includes a processor 601, a memory 602, and a communication bus 603;
the communication bus 603 is used for realizing communication connection between the processor 601 and the memory 602;
in one example, the processor 601 may be used to execute a computer program stored in the memory 602 to implement the steps of the method of mirroring data streams as in the embodiments above.
The present embodiments also provide a computer-readable storage medium including volatile or non-volatile, removable or non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, computer program modules or other data. Computer-readable storage media include, but are not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash Memory or other Memory technology, CD-ROM (Compact disk Read-Only Memory), Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer.
In one example, the computer readable storage medium in the present embodiment may be used for storing a computer program, which may be executed by a processor to implement the steps of the method of mirroring data streams as in the above embodiments.
The present embodiment also provides a computer program (or computer software), which can be distributed on a computer readable medium and executed by a computing device to implement at least one step of the method for mirroring data streams as shown in the above embodiments; and in some cases at least one of the steps shown or described may be performed in an order different than that described in the embodiments above.
The present embodiments also provide a computer program product comprising a computer readable means on which any of the computer programs as set out above is stored. The computer readable means in this embodiment may include a computer readable storage medium as shown above.
It will be apparent to those skilled in the art that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software (which may be implemented in computer program code executable by a computing device), firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit.
In addition, communication media typically embodies computer readable instructions, data structures, computer program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to one of ordinary skill in the art. Thus, the present invention is not limited to any specific combination of hardware and software.
The foregoing is a more detailed description of embodiments of the present invention, and the present invention is not to be considered limited to such descriptions. For those skilled in the art to which the invention pertains, several simple deductions or substitutions can be made without departing from the spirit of the invention, and all shall be considered as belonging to the protection scope of the invention.

Claims (10)

1. A method of mirroring a data stream, comprising:
when receiving a data stream of a port provided with a mirror image identifier, matching a corresponding target mirror image session in a mirror image table according to the mirror image identifier, wherein the mirror image table comprises a label mirror image table, the label mirror image table comprises label mirror image sessions, and one label mirror image session comprises the mirror image identifier, at least one layer of label layer, a label value corresponding to each label layer, a source mirror image entity identifier associated with each label value, and a destination port;
when the matched target mirror image session comprises a target label mirror image session, screening out a target data stream matched with the target label mirror image session from the data stream as a data stream to be mirrored;
and sending the data stream to be mirrored to a destination port in the target label mirroring session.
2. The method of mirroring data streams of claim 1, wherein the mirroring table further comprises a port mirroring table, the port mirroring table comprising a port mirroring session;
when the matched target mirror image session comprises a target port mirror image session and a target label mirror image session, carrying out mirror image processing on the data stream of the port only according to the target label mirror image session, or carrying out mirror image processing on the data stream of the port only according to the target port mirror image session.
3. The method of mirroring data streams according to claim 1, wherein when the matched target mirroring session only includes a target port mirroring session, mirroring the data streams of the ports according to the target port mirroring session.
4. A method of mirroring data streams according to any of claims 1 to 3, wherein the mirroring identity is a mirroring session ID having a unique identifying property in the system.
5. The method of mirroring data flows according to any of claims 1 to 3, wherein when the label mirroring session comprises a label layer, a label value of the label layer is an incoming label value of a tunnel, a pseudo wire or an L3 virtual private network L3VPN to be mirrored, and a source mirroring entity identity associated with the incoming label value corresponds to an identity of the tunnel, the pseudo wire or the L3 VPN.
6. The method for mirroring data streams according to any one of claims 1 to 3, wherein when the label mirroring session includes two label layers, a first label value of a first label layer is a first incoming label value of a first tunnel to be mirrored, and a first source mirroring entity identifier associated with the first incoming label value is an identifier of the first tunnel;
a second label value of a second label layer is a second tunnel to be mirrored, a second pseudo-line or a second incoming label value of a second L3VPN, and a second source mirroring entity identifier associated with the second incoming label value corresponds to an identifier of the second tunnel, the second pseudo-line or the second L3 VPN;
and when the second label value of the second label layer is the second incoming label value of the second tunnel to be mirrored, the first tunnel is a ring tunnel, and the second tunnel is the tunnel to be mirrored under the first tunnel.
7. The method for mirroring data flows according to any one of claims 1 to 3, wherein when the label mirroring session includes three label layers, a first label value of a first label layer is a first incoming label value of a first tunnel to be mirrored, a first source mirroring entity identifier associated with the first incoming label value is an identifier of the first tunnel, and the first tunnel is a ring tunnel;
a second label value of a second label layer is a second entry label value of a second tunnel to be mirrored under the first tunnel, and a second source mirror entity identifier associated with the second entry label value corresponds to an identifier of the second tunnel, a second pseudo wire or a second L3 VPN;
and a third label value of the third label layer is a third pseudo-line to be mirrored or a third incoming label value of a third L3VPN, and a third source mirroring entity identifier associated with the third incoming label value corresponds to an identifier of the third pseudo-line or the third L3 VPN.
8. An apparatus for mirroring a data stream, comprising:
the matching processing module is used for matching a corresponding target mirror image session in a mirror image table according to a mirror image identifier when receiving a data stream of a port provided with the mirror image identifier, wherein the mirror image table comprises a label mirror image table, the label mirror image table comprises label mirror image sessions, and one label mirror image session comprises the mirror image identifier, at least one layer of label layer, a label value corresponding to each label layer, a source mirror image entity identifier associated with each label value and a destination port;
and the mirror image processing module is used for screening out a target data stream matched with the target label mirror image session from the data streams as a data stream to be mirrored when the target mirror image session comprises a target label mirror image session, and sending the data stream to be mirrored to a target port in the target label mirror image session.
9. A communication device comprising a processor, a memory;
the processor is adapted to execute a computer program stored in the memory to implement the steps of the method of mirroring data streams according to any of claims 1-7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which is executable by a processor to implement the steps of the method of mirroring data streams as defined in any one of claims 1 to 7.
CN201910722352.0A 2019-08-06 2019-08-06 Method, device, communication equipment and storage medium for mirroring data stream Withdrawn CN112351050A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910722352.0A CN112351050A (en) 2019-08-06 2019-08-06 Method, device, communication equipment and storage medium for mirroring data stream
PCT/CN2020/104536 WO2021023028A1 (en) 2019-08-06 2020-07-24 Data stream mirroring method, apparatus, communication device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910722352.0A CN112351050A (en) 2019-08-06 2019-08-06 Method, device, communication equipment and storage medium for mirroring data stream

Publications (1)

Publication Number Publication Date
CN112351050A true CN112351050A (en) 2021-02-09

Family

ID=74367179

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910722352.0A Withdrawn CN112351050A (en) 2019-08-06 2019-08-06 Method, device, communication equipment and storage medium for mirroring data stream

Country Status (2)

Country Link
CN (1) CN112351050A (en)
WO (1) WO2021023028A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114827055A (en) * 2022-04-25 2022-07-29 北京百度网讯科技有限公司 Data mirroring method and device, electronic equipment and switch cluster

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112953949B (en) * 2021-03-01 2023-01-06 恒安嘉新(北京)科技股份公司 Message header processing method, device, equipment and storage medium of network message

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101667966A (en) * 2009-06-11 2010-03-10 中兴通讯股份有限公司 Method and system for realizing far-end mirror image of router
US20130259046A1 (en) * 2012-03-29 2013-10-03 Avaya Inc. Remote mirroring
CN104243211A (en) * 2014-09-22 2014-12-24 北京星网锐捷网络技术有限公司 Data stream mirroring method and device
CN105915516A (en) * 2016-04-15 2016-08-31 杭州华三通信技术有限公司 Security-detection-based data flow obtaining method and apparatus

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101667966A (en) * 2009-06-11 2010-03-10 中兴通讯股份有限公司 Method and system for realizing far-end mirror image of router
US20130259046A1 (en) * 2012-03-29 2013-10-03 Avaya Inc. Remote mirroring
CN104243211A (en) * 2014-09-22 2014-12-24 北京星网锐捷网络技术有限公司 Data stream mirroring method and device
CN105915516A (en) * 2016-04-15 2016-08-31 杭州华三通信技术有限公司 Security-detection-based data flow obtaining method and apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114827055A (en) * 2022-04-25 2022-07-29 北京百度网讯科技有限公司 Data mirroring method and device, electronic equipment and switch cluster

Also Published As

Publication number Publication date
WO2021023028A1 (en) 2021-02-11

Similar Documents

Publication Publication Date Title
CN109981457B (en) Message processing method, network node and system
US10158561B2 (en) Data plane learning of bi-directional service chains
EP3664372B1 (en) Network management method and related device
US20150188802A1 (en) System for supporting multi-tenant based on private ip address in virtual private cloud networks and operating method thereof
CN109714239B (en) Management message issuing method, VNFM (virtual network management frequency) equipment and server
US20230006909A1 (en) Cluster wide packet tracing
CN111010329B (en) Message transmission method and device
EP3761576A1 (en) Method and device for notification of binding information, and storage medium
CN112543108B (en) Network isolation policy management method and network isolation policy management system
CN109167700B (en) Detection method and device for Segment Routing (SR) tunnel
CN112351050A (en) Method, device, communication equipment and storage medium for mirroring data stream
CN110661713B (en) Message forwarding method and device
US20150381560A1 (en) Logical interface encoding
CN112565045A (en) Method, device, equipment and storage medium for forwarding EVPN (error vector magnitude) message
US20240121301A1 (en) Secure communications of storage tenants that share a storage cluster system
CN112929197A (en) Network communication method, device, equipment and storage medium
CN111600833A (en) Network operating system and message forwarding method
CN116264538A (en) Data processing method, device, equipment and computer storage medium
CN108833435B (en) Network access control method and device and network system
US20200351246A1 (en) Systems and methods for hierarchical access control in a network environment
CN110266597B (en) Flow control method, device, equipment and storage medium
CN116074231B (en) Message forwarding path determining method, device, network equipment and storage medium
CN113923174B (en) Message distribution method, device and medium
CN110738234B (en) Role prediction method and device
CN109474527B (en) Message forwarding method and device

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20210209

WW01 Invention patent application withdrawn after publication