CN112054969A - Method and device for realizing message mirroring - Google Patents

Method and device for realizing message mirroring Download PDF

Info

Publication number
CN112054969A
CN112054969A CN201910492414.3A CN201910492414A CN112054969A CN 112054969 A CN112054969 A CN 112054969A CN 201910492414 A CN201910492414 A CN 201910492414A CN 112054969 A CN112054969 A CN 112054969A
Authority
CN
China
Prior art keywords
port
ports
destination
mirror
flow
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.)
Granted
Application number
CN201910492414.3A
Other languages
Chinese (zh)
Other versions
CN112054969B (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.)
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 CN201910492414.3A priority Critical patent/CN112054969B/en
Priority to PCT/CN2020/092873 priority patent/WO2020244439A1/en
Publication of CN112054969A publication Critical patent/CN112054969A/en
Application granted granted Critical
Publication of CN112054969B publication Critical patent/CN112054969B/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
    • H04L49/00Packet switching elements
    • H04L49/20Support for services
    • H04L49/208Port mirroring
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Abstract

A method and device for implementing message mirror image are disclosed. The method for realizing message mirroring comprises the following steps: selecting a destination port from a plurality of member ports of a destination mirror port configured by a port; the destination mirror image port is an aggregation port, and the aggregation port is a logic port and comprises a plurality of member ports sharing bandwidth; and copying the message needing mirroring on the port, and forwarding the copied message to the destination port. The technical scheme can improve the bandwidth utilization rate of the image monitoring service.

Description

Method and device for realizing message mirroring
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for implementing message mirroring.
Background
The port Mirroring (port Mirroring) function realizes monitoring on a network by forwarding data traffic of one or more source ports to a certain designated port on a switch or a router, wherein the designated port is called as a "Mirroring port" or a "destination port", and the traffic of the network can be monitored and analyzed through the Mirroring port without significantly affecting the normal throughput of the source ports. The mirror image function is used in the enterprise, network data in the enterprise can be well monitored and managed, and when the network fails, the fault can be quickly positioned.
However, when the capacity of the current network user is expanded, the traffic of the destination mirror port may be significantly increased due to the continuous increase or the increase of the number of the traffic of the source port to be mirrored, and the situations of message overflow and incomplete message mirror may occur. On the other hand, a situation may occur in which a part of the port bandwidth is insufficient and a part of the port bandwidth is wasted between a plurality of mirror ports.
Disclosure of Invention
The invention provides a method and a device for realizing message mirroring, which can improve the bandwidth utilization rate of mirroring monitoring service.
According to a first aspect of the present application, an embodiment of the present invention provides a method for implementing a message mirror, including:
selecting a destination port from a plurality of member ports of a destination mirror port configured by a port; the destination mirror image port is an aggregation port, and the aggregation port is a logic port and comprises a plurality of member ports sharing bandwidth;
and copying the message needing mirroring on the port, and forwarding the copied message to the destination port.
According to a second aspect of the present application, an embodiment of the present invention provides an apparatus for implementing message mirroring, including:
a destination port selection module for selecting a destination port from a plurality of member ports of a destination mirror port configured for the port; the destination mirror image port is an aggregation port, and the aggregation port is a logic port and comprises a plurality of member ports sharing bandwidth;
and the message mirroring module is used for copying the message needing mirroring on the port and forwarding the copied message to the destination port.
According to a third aspect of the present application, an embodiment of the present invention provides an apparatus for implementing message mirroring, including:
the message mirror image realization method comprises a memory, a processor and a program which is stored on the memory and can run on the processor, wherein the program which realizes the message mirror image realizes the steps of the message mirror image realization method when being executed by the processor.
According to a fourth aspect of the present application, an embodiment of the present invention provides a computer-readable storage medium, where a program for implementing a message mirror image is stored on the computer-readable storage medium, and when executed by a processor, the program for implementing a message mirror image implements the steps of the method for implementing a message mirror image.
Compared with the related art, the method and the device for implementing message mirroring provided by the embodiments of the present invention select a destination port from a plurality of member ports of a destination mirror port configured in a port, copy a message that needs mirroring on the port, and forward the copied message to the destination port, where the destination mirror port is an aggregation port, and the aggregation port is a logical port and includes a plurality of member ports sharing bandwidth. The mirror image method of the embodiment of the invention can improve the bandwidth utilization rate of the mirror image monitoring service.
Drawings
Fig. 1 is a flowchart of a method for implementing message mirroring in embodiment 1 of the present invention;
fig. 2 is a schematic diagram of an apparatus for implementing message mirroring in embodiment 2 of the present invention;
fig. 3 is a flowchart of a port mirror configuration process according to example 1 of the present invention;
fig. 4 is a flowchart of a port mirror validation process according to example 2 of the present invention;
fig. 5 is a flow chart of a port mirror routing procedure of example 3 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 will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
The steps illustrated in the flow charts of the figures may be performed in a computer system such as a set of computer-executable instructions. Also, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.
Example 1
As shown in fig. 1, an embodiment of the present invention provides a method for implementing message mirroring, including:
step S110, selecting a destination port from a plurality of member ports of a destination mirror port configured by a port; the destination mirror image port is an aggregation port, and the aggregation port is a logic port and comprises a plurality of member ports sharing bandwidth;
step S120, the message needing mirroring on the port is copied, and the copied message is forwarded to the destination port;
in the above embodiment, after a plurality of ports are added to one aggregation port, the aggregation port is used as a destination mirror port of a mirror message, so that a plurality of mirror ports can share a bandwidth and protect each other, thereby improving the bandwidth utilization rate of the mirror monitoring service.
In one embodiment, selecting a destination port from a plurality of member ports of a destination mirror port of a port configuration comprises:
selecting a destination port from a plurality of member ports of a destination mirror port configured by the port according to a routing strategy; or all member ports of the destination mirror image port are used as destination ports;
in one embodiment, the routing policy comprises: a flow-by-flow routing strategy or a packet-by-packet routing strategy;
the flow-by-flow routing strategy determines a member port to carry out message mirroring through a routing algorithm based on flow characteristics of a mirror flow; the packet-by-packet routing strategy randomly selects a member port to carry out message mirroring;
in one embodiment, the stream characteristics of the mirrored stream include one or more key fields of the mirrored stream;
wherein the key field comprises at least one of: a source MAC (Media Access Control) Address, a destination MAC Address, a source IP Address, a destination IP Address, a TOS (Type of Service) value, a source port number, a destination port number, a protocol Type;
the type of service TOS may be used to prioritize the packets to implement queue scheduling.
In one embodiment, the routing algorithm comprises: a cyclic redundancy check algorithm or a hash algorithm;
in one embodiment, the selecting the destination port from the plurality of member ports of the destination mirror port according to the routing policy includes:
determining a routing value R of the mirror image flow through a routing algorithm based on the flow characteristics of the mirror image flow; or determining the routing value R of the mirror flow based on a random number;
taking a routing value R to M modulo to obtain a sub-logic port number I; mapping each member port in the aggregation port into one or more sub-logic ports according to the bandwidth capacity, wherein the total number of the sub-logic ports contained in the aggregation port is M;
determining a target port according to the sub-logic port number I and the mapping relation between the member port and the sub-logic port number;
in one embodiment, the message to be mirrored on the port includes an incoming message or an outgoing message of the port;
in one embodiment, the method further comprises:
newly building a logic port as an aggregation port, and adding a physical port as a member port in the aggregation port;
newly building a mirror image instance, and setting a target mirror image port of the mirror image instance as the aggregation port;
applying the mirror image instance to a port needing mirror image service;
in one embodiment, the method further comprises:
when a certain member port in the aggregation ports is abnormal, other member ports in the aggregation ports share the mirror flow of the abnormal member port; and when the abnormal member port is recovered to be normal, the mirror image flow shared by other member ports is switched back to the recovered member port.
That is, the attribute of the aggregation port can ensure the flow of the N member ports, and load sharing is performed under normal conditions, so that once a certain link is unavailable, the flow can be quickly switched to other links, and safety protection is provided for flow monitoring.
In one embodiment, when an abnormality occurs in one of the aggregation ports, the sharing, by the other aggregation ports, a mirror flow of the abnormal member port includes:
recalculating the total number M' of the sub-logic ports contained in the aggregation port according to the member ports which work normally in the aggregation port; each normally working member port in the aggregation ports is mapped into one or more sub-logic ports according to the bandwidth capacity;
determining a routing value R of the mirror image flow through a routing algorithm based on the flow characteristics of the mirror image flow; or determining the routing value R of the mirror flow based on a random number;
carrying out modular operation on M 'again by using the routing value R of the mirror flow carried by the abnormal member port to obtain a new sub logic port number I';
and re-determining the target port according to the new sub-logic port number I' and the mapping relation between the member port and the sub-logic port number.
Example 2
As shown in fig. 2, an embodiment of the present invention provides an apparatus for implementing message mirroring, including:
a destination port selection module 10, configured to select a destination port from a plurality of member ports of a destination mirror port configured by a port; the destination mirror image port is an aggregation port, and the aggregation port is a logic port and comprises a plurality of member ports sharing bandwidth;
a message mirroring module 20, configured to copy the message that needs mirroring on the port, and forward the copied message to the destination port;
in one embodiment, the destination port selection module is configured to select a destination port from a plurality of member ports of a destination mirror port of a port configuration by:
selecting a destination port from a plurality of member ports of a destination mirror port configured by the port according to a routing strategy; or all member ports of the destination mirror image port are used as destination ports;
in one embodiment, the routing policy comprises: a flow-by-flow routing strategy or a packet-by-packet routing strategy;
the flow-by-flow routing strategy determines a member port to carry out message mirroring through a routing algorithm based on flow characteristics of a mirror flow; the packet-by-packet routing strategy randomly selects a member port to carry out message mirroring;
in one embodiment, the stream characteristics of the mirrored stream include one or more key fields of the mirrored stream;
wherein the key field comprises at least one of: a source MAC address, a destination MAC address, a source IP address, a destination IP address, a TOS value, a source port number, a destination port number, and a protocol type;
in one embodiment, the routing algorithm comprises: a cyclic redundancy check algorithm or a hash algorithm;
in one embodiment, the destination port selection module is configured to select a destination port from a plurality of member ports of a destination mirror port according to a routing policy by:
determining a routing value R of the mirror image flow through a routing algorithm based on the flow characteristics of the mirror image flow; or determining the routing value R of the mirror flow based on a random number;
taking a routing value R to M modulo to obtain a sub-logic port number I; mapping each member port in the aggregation port into one or more sub-logic ports according to the bandwidth capacity, wherein the total number of the sub-logic ports contained in the aggregation port is M;
determining a target port according to the sub-logic port number I and the mapping relation between the member port and the sub-logic port number;
in one embodiment, the message to be mirrored on the port includes an incoming message or an outgoing message of the port;
in one embodiment, the apparatus further comprises: a configuration module;
the configuration module is used for newly building a logic port as an aggregation port, and adding a physical port as a member port in the aggregation port; newly building a mirror image instance, and setting a target mirror image port of the mirror image instance as the aggregation port; applying the mirror image instance to a port needing mirror image service;
in an embodiment, the message mirror module is further configured to, when a certain member port of the aggregation ports is abnormal, share a mirror flow of the abnormal member port by other member ports of the aggregation ports; and when the abnormal member port is recovered to be normal, the mirror image flow shared by other member ports is switched back to the recovered member port.
That is, the attribute of the aggregation port can ensure the flow of the N member ports, and load sharing is performed under normal conditions, so that once a certain link is unavailable, the flow can be quickly switched to other links, and safety protection is provided for flow monitoring.
In an embodiment, the message mirroring module is configured to, when a certain member port of the aggregation ports is abnormal, share a mirror flow of the abnormal member port by other member ports of the aggregation ports in the following manners:
recalculating the total number M' of the sub-logic ports contained in the aggregation port according to the member ports which work normally in the aggregation port; each normally working member port in the aggregation ports is mapped into one or more sub-logic ports according to the bandwidth capacity;
determining a routing value R of the mirror image flow through a routing algorithm based on the flow characteristics of the mirror image flow; or determining the routing value R of the mirror flow based on a random number;
carrying out modular operation on M 'again by using the routing value R of the mirror flow carried by the abnormal member port to obtain a new sub logic port number I';
and re-determining the target port according to the new sub-logic port number I' and the mapping relation between the member port and the sub-logic port number.
Example 3
The embodiment of the invention provides a device for realizing message mirroring, which comprises:
the method includes a memory, a processor, and a program stored in the memory and capable of running on the processor, where the program for implementing message mirroring implements the steps of the method for implementing message mirroring described in embodiment 1 above when executed by the processor.
Example 4
An embodiment of the present invention provides a computer-readable storage medium, where a program for implementing a message mirror image is stored in the computer-readable storage medium, and when the program for implementing a message mirror image is executed by a processor, the steps of the method for implementing a message mirror image described in embodiment 1 above are implemented.
Each flow in the method for implementing message mirroring is described below by examples 1 to 3.
Example 1
This example illustrates a port mirror configuration flow. As shown in fig. 3, the configuration flow may include the following steps:
s101, newly building an aggregation port (named aggregation port is LAG 1);
wherein, the aggregation port (Trunk) is a logical port. Different aggregation methods can be adopted to connect a plurality of network links in parallel, and one high-bandwidth logic port can improve the bandwidth, redundancy and elasticity of the links and realize load balance.
S102, adding member ports for an aggregation port (LAG 1);
s103, newly building a mirror image instance (named mirror image instance is S1);
s104, configuring the destination port of the mirror image instance (S1) as an aggregation port (LAG 1);
wherein, the destination port of the mirror instance is generally configured as an aggregation port; under the condition of small flow, the destination port of the mirror image instance can be configured as a physical port, but under the conditions of large flow, capacity expansion requirement and resource permission, the destination port is suitable to be configured as an aggregation port.
S105, the routing strategy of the mirror instance (S1) is configured.
Wherein the routing strategy may include: a packet-by-packet routing strategy or a flow-by-flow routing strategy;
the flow-by-flow routing strategy can generate a routing value through a predetermined algorithm; wherein the predetermined algorithm may include: CRC (Cyclic Redundancy Check) 16, CRC32, HASH (HASH).
And S106, applying the mirror image instance to the source port needing mirror image.
The source port may be multiple, that is, the traffic supporting multiple source ports is mirrored to one destination port.
Example 2
This example illustrates a validation process of a port image, which may include the following steps, as shown in fig. 4:
s101, judging the message direction of a port, executing an outgoing message S102, and executing an incoming message S103;
s102, packaging the message;
wherein, inquiring MAC (Media Access Control) address of next hop IP, and packaging the MAC address as destination MAC address and information of Local Area Network (VLAN) and the like into a two-layer header of the message;
s103, judging whether the port is configured with mirror image service, if so, executing S105, otherwise, executing S104;
s104, forwarding the service normally, and ending;
s105, forwarding the original message through a normal forwarding service;
s106, judging whether a destination port of the mirror image service is an aggregation port, if so, executing S108, otherwise, executing S107;
s107, copying the message, acquiring a physical port as a target mirror image port, forwarding the copied message through the physical port, and ending;
s108, the message is copied, and the copied message is forwarded through the aggregation port.
Wherein, a destination port can be selected from a plurality of member ports of the aggregation port according to a routing strategy; or all member ports of the aggregation port are used as destination ports;
the routing strategy comprises the following steps: a flow-by-flow routing strategy or a packet-by-packet routing strategy;
under the flow-by-flow routing strategy, each flow can select a designated member port to send based on flow characteristics when a plurality of flows are sent to a destination; under the strategy of selecting route by packet, when a plurality of flows are sent to a destination, each flow can select a designated member port to send based on a random value.
Example 3
This example illustrates a routing process, which, as shown in FIG. 5, may include the following steps:
s101, judging a routing strategy, executing S102 when the routing strategy is packet-by-packet routing, and executing S103 when the routing strategy is flow-by-flow routing;
s102, obtaining the random value as the route value R, and executing the step S104.
Wherein, the random value can be obtained by selecting some bits of a system RTC (Real-Time Clock) as the random value;
that is, the routing values are obtained according to the time points, and each time point can obtain a random value; in the same stream, the random value obtained at the next time point may not be the same as the random value obtained at the current time point.
S103, calculating a routing value R by using the K element parameter group as an input parameter of a routing algorithm;
determining a K element parameter group according to a message key field;
wherein, the key field in the message can be selected to uniquely identify a stream;
wherein the key field may include: source MAC, destination MAC, source IP, destination IP, TOS value, source port number, destination port number, protocol type, etc.;
forming a plurality of key fields into a K element parameter group;
wherein the routing algorithm that generates the routing values, e.g., CRC16, CRC32, HASH;
alternatively, if manual configuration is not performed, a default algorithm of the system may be used.
S104, determining a sub-logic port number I according to the routing value R and the logic member number N of the aggregation port;
wherein I ═ mod (R/N). N is the number of logical members of the aggregation port, for example, the aggregation port includes 1 port of 100G and 5 ports of 10G, and then a total of 15 logical ports of 10G are provided, where N is 15. R is the routing value calculated in step 103, and the value I obtained by modulo R/N is the sub-logical port number; mod () is a modulo operation;
s105, determining a target port according to the sub logic port number I and the mapping relation between the member port and the sub logic port number;
the mapping relationship between the member port and the sub-logical port number includes: the aggregation ports comprise 1 port of 100G and 5 ports of 10G, the sub-logic port number corresponding to the 100G port is 0-9, and the 5 ports of 10G correspond to the sub-logic port numbers 10-14 respectively. Mirror messages with I values of 0-9 are all sent to the 100G port.
Therefore, due to the fact that the bandwidths of the ports are different, the traffic can be guaranteed to be distributed according to the bandwidth ratio by adopting the mode of the logic ports.
Examples 4 to 7 describe the mirror image implementation method by taking a mirror image implementation flow on the core router device as an example.
Example 4
The example is applied to a core router device, an incoming packet of a port a1 is mirrored to an aggregation port T1, a routing policy is to select a route one by one, a port mirroring service M1 is configured, the aggregation port T1 includes three members, which are respectively a port P1 of 100G, a port P2 of 10G, a port P3 of 10G, and a port P1 is configured with a route one by one routing policy, and a routing algorithm is designated as CRC 32.
For the ingress traffic of the port a1, the port attribute table is checked first, and it is found that the port is configured with ingress mirror image service, at this time, a message is copied to go through the mirror image flow, the original message continues to execute normal forwarding service (for example, checking the route of the destination IP, selecting an egress port and forwarding the next hop, which is not the focus of this document, and will be outlined), the copied mirror image message continues to be checked, and it is found that the destination mirror image port is an aggregation port including three members, and the routing policy is flow-by-flow routing. And selecting the source MAC, the destination MAC, the source IP, the destination IP, the TOS value, the source port number and the destination port number (if the message does not contain four-layer information, the port number can be ignored) of the mirror image message as input parameters of a CRC32 routing algorithm, and calculating to obtain a routing value R. The number of logical ports of the destination image port T1 is determined to be N-12, that is, T1 includes 12 10G ports. The value obtained by taking the modulus of R/12 is used as the selected logical port number, the port P1 corresponding to 0-9, the port P2 corresponding to 10 and the port P3 corresponding to 11. And sending the mirror image message to a member port of T1, and finishing the mirror image main body flow.
Example 5
This example applies to a core router device, where the incoming packet of port a1 is mirrored to aggregation port T1, and the link exception and recovery flow is as follows.
Assuming that the mirror message is sent to the member port P2 of T1, if the abnormality occurs at this time in the port P2, the number of logical ports is reduced from 12 to 11, and the logical port number is recalculated (the value obtained by modulo R/11 is used as the new logical port number). After the new logical port number is obtained, the traffic of P2 can be switched to P1 or P3 quickly without manual intervention.
When the logical link corresponding to the port P2 is recovered, the number of logical ports is recovered from 11 to 12, and the logical port number is recalculated (using the value obtained by modulo R/12 as the new logical port number). The P2 port participates in the forwarding of the traffic again, and the corresponding traffic will be switched back to the P2 port without packet loss.
Example 6
This example applies to a core router device, where outgoing messages from port a2 are mirrored to aggregation port T2, and the mirroring mode is full replication mode.
The port mirror traffic M2 is configured, the mirror mode is full replication mode, and the aggregate port T2 includes two members, which are 100G port P3 and 10G port P4 respectively. The outgoing packet from source port a2 is encapsulated by two layers. Checking and finding that the output port of the mirror image service is configured as an aggregation port and the mirror image mode is a full-copy mode, firstly forwarding the packaged message from the output port, and going through a normal forwarding flow; then, the number 2 of physical members of the aggregation port is obtained, and after successive replication, the message is sent to the port P3 of 100G and the port P4 of 10G.
Example 7
The example is applied to a core router device, and it is assumed that a 100G port A3 is newly added, and an ingress packet and an egress packet of the mirror port A3 are required, and since a destination mirror port T1 (aggregation port) has a risk of bandwidth overrun, a 100G member port can be newly added to the aggregation port T1.
The specific operation can be divided into two steps: step one, a 100G member P5 is added to a target mirror image port T1, and the existing port mirror image service is not affected; and secondly, applying the existing port mirror image service M1 to the A3 port, and adding a mirror image source port to meet new requirements.
The mirroring business processes of examples 1 to 7 described above support the following functions in addition to the conventional port mirroring:
(1) the member ports of the aggregation port share the bandwidth, and the total bandwidth is dynamically adjusted by increasing or decreasing the number of the member ports.
In a many-to-one mirroring mode (a plurality of mirror sources mirror to one destination) in the related art, when the messages of the mirror sources are increased, only part of the messages of the mirror sources can be introduced to the newly added destination ports by increasing the destination ports, and the deployment is inconvenient. In the methods of examples 1 to 7 of the present application, at an initial stage of deployment, N ports are placed in one aggregation port, so that bandwidth of a target mirror port is greatly expanded, and a phenomenon of bandwidth waste due to a small amount of traffic of a part of ports is avoided. In addition, if further capacity expansion is needed, only member ports need to be added, and the deployment is also very convenient.
(2) A plurality of member ports of the aggregation port can be mutually protected, and when a certain member port is abnormal, the mirror image message can be quickly switched to other member ports.
The attribute of the aggregation port can ensure the flow of N member ports, load sharing is carried out under normal conditions, once a certain link is unavailable, the flow can be quickly switched to other links, and safety protection is provided for flow monitoring.
(3) Aggregation ports support multiple routing strategies: packet-by-packet, stream-by-stream, and various load sharing algorithms, etc.
The method supports various routing algorithms such as CRC16, CRC32, HASH and the like, and ensures that a plurality of flows can be uniformly shared to N member ports; and simultaneously, the configuration of a packet-by-packet or flow-by-flow routing strategy is supported.
(4) The aggregation port can support sharing of the image source message to a plurality of member ports, and can also support full copying of the image source message to all the member ports.
By default, the packets from the source port are shared evenly among the plurality of member ports. If the application needs to copy the mirror image completely, the message of the source port is processed according to the following steps of 1: the N mode is copied to N member ports, and all destination ports receive the same message, so that the requirement that a plurality of flow monitoring terminals monitor all messages simultaneously is supported.
It will be understood by those of ordinary skill 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, 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. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, 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 accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, 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 those skilled in the art.
It should be noted that the present invention can be embodied in other specific forms, and various changes and modifications can be made by those skilled in the art without departing from the spirit and scope of the invention.

Claims (10)

1. A method for implementing message mirroring comprises the following steps:
selecting a destination port from a plurality of member ports of a destination mirror port configured by a port; the destination mirror image port is an aggregation port, and the aggregation port is a logic port and comprises a plurality of member ports sharing bandwidth;
and copying the message needing mirroring on the port, and forwarding the copied message to the destination port.
2. The method of claim 1, wherein:
the selecting a destination port from a plurality of member ports of a destination mirror port configured for a port includes:
selecting a destination port from a plurality of member ports of a destination mirror port configured by the port according to a routing strategy; or all member ports of the destination mirror port are used as destination ports.
3. The method of claim 2, wherein:
the routing strategy comprises: a flow-by-flow routing strategy or a packet-by-packet routing strategy;
the flow-by-flow routing strategy determines a member port to carry out message mirroring through a routing algorithm based on flow characteristics of a mirror flow; and the packet-by-packet routing strategy randomly selects a member port to carry out message mirroring.
4. The method of claim 3, wherein:
the selecting a destination port from a plurality of member ports of a destination mirror port according to a routing strategy includes:
determining a routing value R of the mirror image flow through a routing algorithm based on the flow characteristics of the mirror image flow; or determining the routing value R of the mirror flow based on a random number;
taking a routing value R to M modulo to obtain a sub-logic port number I; mapping each member port in the aggregation port into one or more sub-logic ports according to the bandwidth capacity, wherein the total number of the sub-logic ports contained in the aggregation port is M;
and determining the target port according to the sub-logic port number I and the mapping relation between the member port and the sub-logic port number.
5. The method of claim 1, wherein the method further comprises:
newly building a logic port as an aggregation port, and adding a physical port as a member port in the aggregation port;
newly building a mirror image instance, and setting a target mirror image port of the mirror image instance as the aggregation port;
the mirror instance is applied to a port requiring mirroring services.
6. The method of claim 1, wherein the method further comprises:
when a certain member port in the aggregation ports is abnormal, other member ports in the aggregation ports share the mirror flow of the abnormal member port; and when the abnormal member port is recovered to be normal, the mirror image flow shared by other member ports is switched back to the recovered member port.
7. The method of claim 6, wherein:
when a certain member port in the aggregation ports is abnormal, the other member ports in the aggregation ports share the mirror flow of the abnormal member port, including:
recalculating the total number M' of the sub-logic ports contained in the aggregation port according to the member ports which work normally in the aggregation port; each normally working member port in the aggregation ports is mapped into one or more sub-logic ports according to the bandwidth capacity;
determining a routing value R of the mirror image flow through a routing algorithm based on the flow characteristics of the mirror image flow; or determining the routing value R of the mirror flow based on a random number;
carrying out modular operation on M 'again by using the routing value R of the mirror flow carried by the abnormal member port to obtain a new sub logic port number I';
and re-determining the target port according to the new sub-logic port number I' and the mapping relation between the member port and the sub-logic port number.
8. The method of claim 3, wherein:
the stream characteristics of the mirror stream comprise one or more key fields of the mirror stream;
wherein the key field comprises at least one of: source media access control MAC address, destination MAC address, source IP address, destination IP address, type of service TOS value, source port number, destination port number, protocol type.
9. An apparatus for implementing message mirroring, comprising:
a memory, a processor and a program for implementing message mirroring stored in the memory and executable on the processor, wherein the program for implementing message mirroring implements the steps of the method for implementing message mirroring according to any one of the preceding claims 1 to 8 when executed by the processor.
10. A computer readable storage medium, on which a program for implementing message mirroring is stored, which when executed by a processor implements the steps of the method for implementing message mirroring according to any one of claims 1 to 8.
CN201910492414.3A 2019-06-06 2019-06-06 Method and device for realizing message mirror image Active CN112054969B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910492414.3A CN112054969B (en) 2019-06-06 2019-06-06 Method and device for realizing message mirror image
PCT/CN2020/092873 WO2020244439A1 (en) 2019-06-06 2020-05-28 Method and apparatus for realizing message mirroring, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910492414.3A CN112054969B (en) 2019-06-06 2019-06-06 Method and device for realizing message mirror image

Publications (2)

Publication Number Publication Date
CN112054969A true CN112054969A (en) 2020-12-08
CN112054969B CN112054969B (en) 2023-03-24

Family

ID=73609440

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910492414.3A Active CN112054969B (en) 2019-06-06 2019-06-06 Method and device for realizing message mirror image

Country Status (2)

Country Link
CN (1) CN112054969B (en)
WO (1) WO2020244439A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112953949A (en) * 2021-03-01 2021-06-11 恒安嘉新(北京)科技股份公司 Message header processing method, device, equipment and storage medium of network message
CN113556345A (en) * 2021-07-22 2021-10-26 锐捷网络股份有限公司 Message processing method, device, equipment and medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114374658B (en) * 2021-12-28 2024-02-09 北京北信源软件股份有限公司 Local area network flow remote mirror image output method, device and equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010055274A1 (en) * 2000-02-22 2001-12-27 Doug Hegge System and method for flow mirroring in a network switch
US20060176880A1 (en) * 2005-02-04 2006-08-10 Bare Ballard C Mesh mirroring with path tags
CN103200129A (en) * 2013-04-05 2013-07-10 张小云 Mirroring method and device of unusual messages
CN103368775A (en) * 2013-07-09 2013-10-23 杭州华三通信技术有限公司 Traffic backup method and core switching equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102299846B (en) * 2011-08-19 2014-09-10 杭州华三通信技术有限公司 Method for transmitting BFD (Bidirectional Forwarding Detection) message and equipment
CN102447619B (en) * 2011-11-10 2014-09-17 华为技术有限公司 Load sharing mode selecting method, device and system
US9455895B2 (en) * 2013-01-17 2016-09-27 International Business Machines Corporation Data link layer switch frame forwarding analysis
CN110971391B (en) * 2018-09-30 2022-03-11 新华三技术有限公司合肥分公司 Message forwarding method and network equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010055274A1 (en) * 2000-02-22 2001-12-27 Doug Hegge System and method for flow mirroring in a network switch
US20060176880A1 (en) * 2005-02-04 2006-08-10 Bare Ballard C Mesh mirroring with path tags
CN103200129A (en) * 2013-04-05 2013-07-10 张小云 Mirroring method and device of unusual messages
CN103368775A (en) * 2013-07-09 2013-10-23 杭州华三通信技术有限公司 Traffic backup method and core switching equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112953949A (en) * 2021-03-01 2021-06-11 恒安嘉新(北京)科技股份公司 Message header processing method, device, equipment and storage medium of network message
CN113556345A (en) * 2021-07-22 2021-10-26 锐捷网络股份有限公司 Message processing method, device, equipment and medium
CN113556345B (en) * 2021-07-22 2024-04-19 锐捷网络股份有限公司 Message processing method, device, equipment and medium

Also Published As

Publication number Publication date
CN112054969B (en) 2023-03-24
WO2020244439A1 (en) 2020-12-10

Similar Documents

Publication Publication Date Title
RU2530338C2 (en) Prepared connection based on state of communication lines of providers (plsb) with routed redundancy
Kodialam et al. Dynamic routing of bandwidth guaranteed tunnels with restoration
US8817594B2 (en) Technique establishing a forwarding path in a network system
US8477769B2 (en) Flexible shared mesh protection services for intelligent TDM-based optical transport networks
US8472325B2 (en) Network availability enhancement technique for packet transport networks
CN112054969B (en) Method and device for realizing message mirror image
EP3462687B1 (en) Method for determining forwarding path, and control device
Schollmeier et al. Improving the resilience in IP networks
EP3399703B1 (en) Method for implementing load balancing, apparatus, and network system
US9678840B2 (en) Fast failover for application performance based WAN path optimization with multiple border routers
US20050259646A1 (en) Virtual network device clusters
EP2159957A1 (en) Method and network device for realizing protection for a shared mesh
JP2003158539A (en) Network transfer system and transfer method
EP3038297B1 (en) Method, system, and device for packet processing
US20050259649A1 (en) System and method for implementing multiple spanning trees per network
CN113162849A (en) Message processing method, device and system
WO2013184121A1 (en) Multi-tenant network provisioning
EP2127252B1 (en) Path management for enhanced protection
AU2020201904B2 (en) Packet transmission method and apparatus
US8665709B2 (en) Use of 1:1 protection state machine for load sharing and alternative protection schemes
CN110611577A (en) Service fast switching method, switching device, network equipment and storage medium
US20180183704A1 (en) Failure protection for software defined networks using multi-topology routing based fast reroute
US20150312151A1 (en) Enhanced load distribution of non-unicast traffic to multi-homed nodes in a port extender environment
US20100034080A1 (en) Method and network control unit for deactivating a network component
EP3602971B1 (en) Apparatus and method of reactive path selection

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