CN111526102A - Method and device for encapsulating remote port mirror image, electronic equipment and storage medium - Google Patents

Method and device for encapsulating remote port mirror image, electronic equipment and storage medium Download PDF

Info

Publication number
CN111526102A
CN111526102A CN202010350576.6A CN202010350576A CN111526102A CN 111526102 A CN111526102 A CN 111526102A CN 202010350576 A CN202010350576 A CN 202010350576A CN 111526102 A CN111526102 A CN 111526102A
Authority
CN
China
Prior art keywords
port
mirror image
aggregation
configuration information
remote
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
CN202010350576.6A
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.)
Beijing Star Net Ruijie Networks Co Ltd
Original Assignee
Beijing Star Net Ruijie Networks Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Star Net Ruijie Networks Co Ltd filed Critical Beijing Star Net Ruijie Networks Co Ltd
Priority to CN202010350576.6A priority Critical patent/CN111526102A/en
Publication of CN111526102A publication Critical patent/CN111526102A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/70Virtual switches
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0631Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/084Configuration by using pre-existing information, e.g. using templates or copying from other elements

Landscapes

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

Abstract

The embodiment of the invention provides a method and a device for encapsulating a remote port mirror image, electronic equipment and a storage medium. The method comprises the following steps: acquiring configuration information of each packaged remote port mirror image in the network equipment; judging whether a mirror image destination port of each encapsulation remote port mirror image is an aggregation port or not according to the configuration information; if the mirror image destination port of the mirror image of the first packaging remote port is an aggregation port, acquiring a member port of the aggregation port; and changing the configuration information of the mirror image of the first packaging remote port, and setting the mirror image destination port in the configuration information as a member port of the aggregation port. According to the method for encapsulating the remote port mirror image, provided by the embodiment of the invention, after the mirror image destination port of the encapsulated remote port mirror image is judged to be the aggregation port, the destination port is changed into the member port of the aggregation port, so that the purpose that the remote port mirror image is encapsulated to the aggregation port is realized, and the problem that the ERSPAN cannot support the destination port as the aggregation port is solved.

Description

Method and device for encapsulating remote port mirror image, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a method and a device for packaging a remote port mirror image, electronic equipment and a storage medium.
Background
Mirroring refers to a technology on a network device for copying and transmitting a packet flow passing through a port to a network monitoring device, and the technology is mainly used for monitoring and analyzing a data flow on a switch. The data flow of some ports (hereinafter referred to as mirror source ports) on the switch to be monitored can be copied by using a mirror image technology, and sent to the analysis equipment through the port (hereinafter referred to as mirror destination port) connected with the flow analysis equipment, and network monitoring and troubleshooting can be carried out on the analysis equipment.
The mirror image is divided into an input mirror image and an output mirror image, the input mirror image copies the message input from the mirror image source port to the mirror image destination port and sends the message to the analysis equipment, and the output mirror image copies the message output from the mirror image source port to the mirror image destination port and sends the message to the analysis equipment. After the message is copied, normal forwarding is not influenced.
Remote port mirroring (RSPAN) is an extension of local port mirroring (SPAN) and breaks the limitation that source and destination ports must be on the same device, allowing multiple network devices to be spanned between the source and destination ports. Encapsulating remote port images (ERSPAN) is an extension of remote port images (RSPAN). In the common remote port mirror image, the mirror image data message can only be transmitted in two layers and cannot pass through the routed network, and the mirror image message can be transmitted between the routed networks by encapsulating the remote port mirror image.
The function of the ERSPAN is to encapsulate all mirrored messages into IP messages through a GRE tunnel, and route the IP messages to the destination port of the remote mirroring device. The determination of the mirror image destination port is to obtain which physical port the mirror image goes out through the routing logic according to the configured IP address of the outgoing direction. Unlike SPAN and RSPAN, which specify the egress type by directly configuring the egress instance, ERSPAN determines the egress type by configuring the destination port IP address and looking up the egress instance through routing logic.
In hardware, the method can be realized by directly setting a register of a port based on an input mirror image and an output mirror image of the port. The determination of the mirror image outlet type of the ERSPAN is realized through routing logic, if the outlet direction IP is an aggregation port IP, the installation of the list item of the original scheme fails due to the fact that the chip subtracts TRUNK hardware list items, the return does not support errors, and the function that the ERSPAN mirror image outlet is the aggregation port cannot be effective.
Therefore, how to solve the problem of mirroring the packaged remote port with the aggregation port as the outlet is an important issue to be solved urgently.
Disclosure of Invention
In view of the defects in the prior art, embodiments of the present invention provide a method and an apparatus for encapsulating a remote port image, an electronic device, and a storage medium.
In a first aspect, an embodiment of the present invention provides a method for encapsulating a remote port image, which is applied to a network device, and includes:
acquiring configuration information of each packaged remote port mirror image in the network equipment;
judging whether a mirror image destination port of each encapsulation remote port mirror image is an aggregation port or not according to the configuration information;
if the mirror image destination port of the mirror image of the first packaging remote port is an aggregation port, acquiring a member port of the aggregation port;
and changing the configuration information of the mirror image of the first packaging remote port, and setting the mirror image destination port in the configuration information as a member port of the aggregation port.
As in the foregoing method, optionally, the determining whether the mirror destination port of each encapsulated remote port mirror is an aggregation port includes:
acquiring the IP address of the destination port of each encapsulated remote port mirror image according to the configuration information of each encapsulated remote port mirror image;
and judging whether the destination port of the corresponding encapsulated remote port mirror image is an aggregation port or not according to the IP address.
As above, optionally, the acquiring the member port of the aggregation port includes:
acquiring all online member ports of the aggregation port;
if the number of the online member ports is larger than 1, determining a source port corresponding to the aggregation port and a member port mapping table according to the number of the source ports corresponding to the aggregation port and the number of the online member ports;
correspondingly, the setting of the mirroring destination port in the configuration information as the member port of the aggregation port includes:
and setting the mirror image destination port of each source port corresponding to the aggregation port in the configuration information as the corresponding member port of the aggregation port according to the source port and member port mapping table.
As above, optionally, the acquiring the member port of the aggregation port includes:
acquiring all online member ports of the aggregation port;
if the number of the online member ports is more than 1, calculating hash values of various message flows to be mirrored corresponding to the aggregation port;
determining a hash value and a member port mapping table corresponding to the aggregation port according to the hash value and the number of the online member ports;
correspondingly, the setting of the mirroring destination port in the configuration information as the member port of the aggregation port includes:
and setting the mirror destination port of each message flow to be mirrored corresponding to the aggregation port in the configuration information as the member port of the aggregation port corresponding to the hash value according to the hash value and the member port mapping table.
The method as described above, optionally, further includes:
and if the current online member port number of the aggregation port is 0, generating alarm information aiming at the encapsulation remote port mirror image corresponding to the aggregation port.
In a second aspect, an embodiment of the present invention provides an apparatus for encapsulating a remote port image, where the apparatus is applied in a network device, and the apparatus includes:
the first acquisition module is used for acquiring configuration information of each packaged remote port mirror image in the network equipment;
the judging module is used for judging whether the mirror image destination port of each encapsulated remote port mirror image is an aggregation port or not according to the configuration information;
the second obtaining module is used for obtaining a member port of the aggregation port if a mirror image destination port of the mirror image of the first packaging remote port is the aggregation port;
and the changing module is used for changing the configuration information of the mirror image of the first packaging remote port and setting the mirror image destination port in the configuration information as a member port of the aggregation port.
Optionally, the determining module is specifically configured to:
acquiring the IP address of the destination port of each encapsulated remote port mirror image according to the configuration information of each encapsulated remote port mirror image;
and judging whether the destination port of the corresponding encapsulated remote port mirror image is an aggregation port or not according to the IP address.
Optionally, the second obtaining module is specifically configured to:
acquiring all online member ports of the aggregation port;
correspondingly, the device further comprises:
a first mapping module, configured to determine, if the number of online member ports is greater than 1, a source port and a member port mapping table corresponding to the aggregation port according to the number of source ports corresponding to the aggregation port and the number of online member ports;
correspondingly, the modification module is specifically configured to:
and setting the mirror image destination port of each source port corresponding to the aggregation port in the configuration information as the corresponding member port of the aggregation port according to the source port and member port mapping table.
Optionally, the second obtaining module is specifically configured to:
acquiring all online member ports of the aggregation port;
correspondingly, the device further comprises:
the second mapping module is used for calculating hash values of various message flows to be mirrored corresponding to the aggregation port if the number of the online member ports is greater than 1;
determining a hash value and a member port mapping table corresponding to the aggregation port according to the hash value and the number of the online member ports;
correspondingly, the modification module is specifically configured to:
and setting the mirror destination port of each message flow to be mirrored corresponding to the aggregation port in the configuration information as the member port of the aggregation port corresponding to the hash value according to the hash value and the member port mapping table.
The above apparatus, optionally, further comprises:
and the alarm module is used for generating alarm information aiming at the encapsulation remote port mirror image corresponding to the aggregation port if the number of the current online member ports of the aggregation port is 0.
In a third aspect, an embodiment of the present invention provides an electronic device, including:
the processor and the memory are communicated with each other through a bus; the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform a method comprising: acquiring configuration information of each packaged remote port mirror image in the network equipment; judging whether a mirror image destination port of each encapsulation remote port mirror image is an aggregation port or not according to the configuration information; if the mirror image destination port of the mirror image of the first packaging remote port is an aggregation port, acquiring a member port of the aggregation port; and changing the configuration information of the mirror image of the first packaging remote port, and setting the mirror image destination port in the configuration information as a member port of the aggregation port.
In a fourth aspect, an embodiment of the present invention provides a storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the following method: acquiring configuration information of each packaged remote port mirror image in the network equipment; judging whether a mirror image destination port of each encapsulation remote port mirror image is an aggregation port or not according to the configuration information; if the mirror image destination port of the mirror image of the first packaging remote port is an aggregation port, acquiring a member port of the aggregation port; and changing the configuration information of the mirror image of the first packaging remote port, and setting the mirror image destination port in the configuration information as a member port of the aggregation port.
According to the method for encapsulating the remote port mirror image, provided by the embodiment of the invention, after the mirror image destination port of the encapsulated remote port mirror image is judged to be the aggregation port, the destination port is changed into the member port of the aggregation port, so that the purpose that the remote port mirror image is encapsulated to the aggregation port is realized, and the problem that the ERSPAN cannot support the destination port as the aggregation port is solved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for encapsulating a remote port image according to an embodiment of the present invention;
fig. 2 is a schematic mirror image diagram of an AP port as a mirror image outlet according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an apparatus for encapsulating a remote port mirror according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic flowchart of a method for encapsulating a remote port image according to an embodiment of the present invention, which is applied to a network device, and as shown in fig. 1, the method includes:
step S11, obtaining configuration information of each packaged remote port mirror image in the network equipment;
specifically, if a packet flow on a network device, such as a switch, is to be monitored, an Encapsulated Remote Port mirror (ERSPAN) may be configured based on a Port configuration or an ERSPAN may be configured based on a packet flow, specifically, an ERSPAN may be configured on a register of a monitored Port (i.e., a mirror source Port) on the network device, or an ERSPAN may be configured on each Port through which a specific data flow that meets a monitoring condition passes, and a hardware resource is installed under the condition that the ERSPAN configuration is complete and a configured flow is generated, so that the packet flow to be monitored is mirrored to a destination Port. In order to solve the problem, in the embodiment of the present invention, first, configuration information of all ERSPAN on a network device is obtained, specifically, the network device may collect configuration information of each port, screen out the ERSPAN configuration information from the configuration information, or actively report the configuration information to the network device after the port is set to be configured to complete the ERSPAN, so that the network device may obtain all the ERSPAN configuration information of itself.
Step S12, according to the configuration information, judging whether the mirror destination port of each packaged remote port mirror image is an aggregation port;
specifically, the network device acquires an IP address of a destination port of each ERSPAN according to configuration information of each ERSPAN; and judging whether the destination port of the corresponding encapsulated remote port mirror image is an aggregation port or not according to the IP address of the destination port. For example, the network device configures an IP address of a destination port through the ERSPAN, finds an egress instance through the routing logic to determine the type of the egress, and in practical application, the network device may store the IP addresses of all AP ports in advance, so as to determine whether the destination port of each ERSPAN is an AP port through comparison.
Step S13, if the mirror image destination port of the first package remote port mirror image is an aggregation port, acquiring a member port of the aggregation port;
step S14, changing configuration information of the first package remote port mirror image, and setting a mirror image destination port in the configuration information as a member port of the aggregation port.
Specifically, if the mirror destination port configured by a certain ERSPAN is an AP port, the network device obtains all member ports of the AP port, for example, the network device may store the member port of each AP port in advance, and monitor the online status of each member port in real time, and if it is determined that the mirror destination port configured by a certain ERSPAN is an AP port, obtain all online member ports of the AP port, that is, available member ports, change the ERSPAN configuration, change an aggregation port in the destination port in the ERSPAN configuration to an available member port of the aggregation port, for example, set the first online member port in the AP port to the mirror destination port of the ERSPAN, and the like, thereby solving the problem that the destination port cannot be supported in the ERSPAN as an aggregation port, and implementing the function of the ERSPAN.
According to the method for encapsulating the remote port mirror image, provided by the embodiment of the invention, after the mirror image destination port of the encapsulated remote port mirror image is judged to be the aggregation port, the destination port is changed into the member port of the aggregation port, so that the purpose that the remote port mirror image is encapsulated to the aggregation port is realized, and the problem that the ERSPAN cannot support the destination port as the aggregation port is solved.
On the basis of the foregoing embodiment, further, the acquiring the member port of the aggregation port includes:
acquiring all online member ports of the aggregation port;
if the number of the online member ports is larger than 1, determining a source port corresponding to the aggregation port and a member port mapping table according to the number of the source ports corresponding to the aggregation port and the number of the online member ports;
correspondingly, the setting of the mirroring destination port in the configuration information as the member port of the aggregation port includes:
and setting the mirror image destination port of each source port corresponding to the aggregation port in the configuration information as the corresponding member port of the aggregation port according to the source port and member port mapping table.
Specifically, if the destination port of the mirror image of the ERSPAN is an AP port, and there are a plurality of online member ports of the AP port, an Equal-Cost multi-path Routing (ECMP) idea may be utilized to implement dynamic mapping to generate a plurality of groups of mirror images, so as to achieve the purpose of balanced output of the mirror image traffic from the AP port. The network device determines a source port corresponding to the aggregation port and a member port mapping table according to the number of the source ports corresponding to the aggregation port and the number of online member ports, and sets a mirror destination port of each source port corresponding to the aggregation port in the ERSPAN configuration information as a member port of the aggregation port corresponding to the mirror destination port according to the mapping table.
For example, fig. 2 is a schematic diagram of a mirror image with an AP port as a mirror image exit according to an embodiment of the present invention, as shown in fig. 2, ports with port IDs 1 to 4 and 6 are all online ports (i.e., an UP state), a port 5 is an offline port (i.e., a Down state), and a port 3 to 4 is an online member port of the AP port. The flow is from 1, 6 ports in to 2 ports out. ERSPAN is configured at ports 1 and 6, a mirror image outlet is an AP port, an aggregation port of a mirror image destination port is converted into a member port of the mirror image destination port, a mapping relation can be made between flow source port information and the member port, a message flow with the source port being the port 1 flows out from a member port 3, and a message flow with the source port being the port 6 flows out from a member port 4. And evenly distributing the source ports to the member ports according to the flow, and adding mapping tables of the member ports mirroring different source ports. And (4) the subsequent different source flows come in, and the AP member port outlet is directly selected by maintaining a mapping table without mapping. In addition, the change information of the source port and the destination port can be managed in real time, the mapping table is updated, and the phenomenon that the mirror image fails after the member port of the AP port is changed is avoided.
On the basis of the foregoing embodiments, further, the acquiring the member port of the aggregation port includes:
acquiring all online member ports of the aggregation port;
if the number of the online member ports is more than 1, calculating hash values of various message flows to be mirrored corresponding to the aggregation port;
determining a hash value and a member port mapping table corresponding to the aggregation port according to the hash value and the number of the online member ports;
correspondingly, the setting of the mirroring destination port in the configuration information as the member port of the aggregation port includes:
and setting the mirror destination port of each message flow to be mirrored corresponding to the aggregation port in the configuration information as the member port of the aggregation port corresponding to the hash value according to the hash value and the member port mapping table.
Specifically, because the number of the ERSPAN source ports and the number of the destination ports may not be equal, in order to achieve a better balancing effect, the ERSPAN source ports and the destination ports may be converted into a flow-based mirror image, hash values of various message flows to be mirrored corresponding to an aggregation port are calculated, the number of the member ports of the AP port is complemented, a plurality of groups of mirror images are generated, the hash values corresponding to mantissas are respectively matched, and the mirror images are mirrored to different member ports. For example, an Access Control List (ACL) may be used to match a hash value of an original packet, and according to the hash value and the number of online member ports of an AP port, a hash value and a member port mapping table corresponding to the AP port are determined, and when the online member ports change, the hash value and the member port mapping table are recalculated to generate, so as to avoid a phenomenon that a mirror image fails after the member ports of the AP port change.
The method for encapsulating the remote port mirror image provided by the embodiment of the invention has the advantages that after the mirror image destination port of the encapsulated remote port mirror image is judged to be the aggregation port, the destination port is changed into the member port of the aggregation port, the purpose of encapsulating the remote port mirror image to the aggregation port is realized, and the purpose of uniformly outputting the mirror image flow of the encapsulated remote port from the aggregation port is realized through the mapping table.
On the basis of the above embodiment, further, the method further includes:
and if the current online member port number of the aggregation port is 0, generating alarm information aiming at the encapsulation remote port mirror image corresponding to the aggregation port.
Specifically, if the number of online member ports of an AP port of a destination port of the ERSPAN is 0, that is, there is no available member port for the AP port, an alarm message is generated, an error is returned, and it is prompted that the aggregation port cannot mirror the message.
Further, if the mirror destination port of the encapsulated remote port mirror is a physical port, processing is directly performed according to the existing ERSPAN, in practical application, the network device may be provided with a physical port mirror module and an aggregation port mirror module, the network device firstly determines that the outlet is a physical port according to the destination port information in the ERSPAN configuration information, and then directly uses the physical port mirror module, and if the outlet is determined to be an aggregation port, the aggregation port mirror module is used. If the physical port mirror image module is used, selecting an optimal physical port according to the ID of the aggregation port through an ECMP algorithm, and mirroring the message stream to the specified physical port through the physical port mirror image module; if the aggregation port mirror image module is used, because of the limitation of a chip, the aggregation port ECMP logic cannot be directly used, the aggregation port mirror image module is quoted, a source port and member port mapping table or a hash value and member port mapping table is introduced, and one member port in the AP member ports is selected as a mirror image outlet, so that the purpose port of the device mirror image of the chip is an encapsulated remote port mirror image of the AP port, other mirror image functions are not interfered, and meanwhile, the equalization method selected by the member ports can be changed according to service requirements and is more flexible than hardware realization.
The method for encapsulating the remote port mirror image provided by the embodiment of the invention has the advantages that after the mirror image destination port of the encapsulated remote port mirror image is judged to be the aggregation port, the destination port is changed into the member port of the aggregation port, the purpose of encapsulating the remote port mirror image to the aggregation port is realized, and the purpose of uniformly outputting the mirror image flow of the encapsulated remote port from the aggregation port is realized through the mapping table.
Based on the same inventive concept, an embodiment of the present invention further provides an apparatus for encapsulating a remote port image, which is applied to a network device, and as shown in fig. 3, the apparatus includes: a first obtaining module 31, a judging module 32, a second obtaining module 33 and a changing module 34, wherein:
the first obtaining module 31 is configured to obtain configuration information of each encapsulated remote port mirror in the network device; the judging module 32 is configured to judge whether a mirror destination port of each of the encapsulated remote port mirrors is an aggregation port according to the configuration information; the second obtaining module 33 is configured to obtain a member port of the aggregation port if a mirror destination port of the mirror image of the first package remote port is the aggregation port; the changing module 34 is configured to change configuration information of the mirror image of the first encapsulated remote port, and set a destination port of the mirror image in the configuration information as a member port of the aggregation port.
As with the above apparatus, optionally, the determining module 32 is specifically configured to:
acquiring the IP address of the destination port of each encapsulated remote port mirror image according to the configuration information of each encapsulated remote port mirror image;
and judging whether the destination port of the corresponding encapsulated remote port mirror image is an aggregation port or not according to the IP address.
As with the above apparatus, optionally, the second obtaining module 33 is specifically configured to:
acquiring all online member ports of the aggregation port;
correspondingly, the device further comprises:
a first mapping module, configured to determine, if the number of online member ports is greater than 1, a source port and a member port mapping table corresponding to the aggregation port according to the number of source ports corresponding to the aggregation port and the number of online member ports;
accordingly, the modification module 34 is specifically configured to:
and setting the mirror image destination port of each source port corresponding to the aggregation port in the configuration information as the corresponding member port of the aggregation port according to the source port and member port mapping table.
As with the above apparatus, optionally, the second obtaining module 33 is specifically configured to:
acquiring all online member ports of the aggregation port;
correspondingly, the device further comprises:
the second mapping module is used for calculating hash values of various message flows to be mirrored corresponding to the aggregation port if the number of the online member ports is greater than 1;
determining a hash value and a member port mapping table corresponding to the aggregation port according to the hash value and the number of the online member ports;
accordingly, the modification module 34 is specifically configured to:
and setting the mirror destination port of each message flow to be mirrored corresponding to the aggregation port in the configuration information as the member port of the aggregation port corresponding to the hash value according to the hash value and the member port mapping table.
The above apparatus, optionally, further comprises:
and the alarm module is used for generating alarm information aiming at the encapsulation remote port mirror image corresponding to the aggregation port if the number of the current online member ports of the aggregation port is 0.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 4, the electronic device includes: a processor (processor)41, a memory (memory)42, and a bus 43;
wherein, the processor 41 and the memory 42 complete the communication with each other through the bus 43;
processor 41 is configured to call program instructions in memory 42 to perform the methods provided by the above-described method embodiments, including, for example: acquiring configuration information of each packaged remote port mirror image in the network equipment; judging whether a mirror image destination port of each encapsulation remote port mirror image is an aggregation port or not according to the configuration information; if the mirror image destination port of the mirror image of the first packaging remote port is an aggregation port, acquiring a member port of the aggregation port; and changing the configuration information of the mirror image of the first packaging remote port, and setting the mirror image destination port in the configuration information as a member port of the aggregation port.
An embodiment of the present invention discloses a computer program product, which includes a computer program stored on a non-transitory computer readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer can execute the methods provided by the above method embodiments, for example, the method includes: acquiring configuration information of each packaged remote port mirror image in the network equipment; judging whether a mirror image destination port of each encapsulation remote port mirror image is an aggregation port or not according to the configuration information; if the mirror image destination port of the mirror image of the first packaging remote port is an aggregation port, acquiring a member port of the aggregation port; and changing the configuration information of the mirror image of the first packaging remote port, and setting the mirror image destination port in the configuration information as a member port of the aggregation port.
Embodiments of the present invention provide a non-transitory computer-readable storage medium storing computer instructions, where the computer instructions cause the computer to perform the methods provided by the above method embodiments, for example, obtaining configuration information of each encapsulated remote port image in a network device; judging whether a mirror image destination port of each encapsulation remote port mirror image is an aggregation port or not according to the configuration information; if the mirror image destination port of the mirror image of the first packaging remote port is an aggregation port, acquiring a member port of the aggregation port; and changing the configuration information of the mirror image of the first packaging remote port, and setting the mirror image destination port in the configuration information as a member port of the aggregation port.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
The above-described embodiments of the apparatuses and the like are merely illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the embodiments of the present invention, and are not limited thereto; although embodiments of the present invention have been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for encapsulating a remote port image, applied to a network device, comprising:
acquiring configuration information of each packaged remote port mirror image in the network equipment;
judging whether a mirror image destination port of each encapsulation remote port mirror image is an aggregation port or not according to the configuration information;
if the mirror image destination port of the mirror image of the first packaging remote port is an aggregation port, acquiring a member port of the aggregation port;
and changing the configuration information of the mirror image of the first packaging remote port, and setting the mirror image destination port in the configuration information as a member port of the aggregation port.
2. The method of claim 1, wherein the determining whether the mirror destination port of each of the encapsulated remote port mirrors is an aggregation port comprises:
acquiring the IP address of the destination port of each encapsulated remote port mirror image according to the configuration information of each encapsulated remote port mirror image;
and judging whether the destination port of the corresponding encapsulated remote port mirror image is an aggregation port or not according to the IP address.
3. The method of claim 1, wherein said obtaining the member ports of the aggregation port comprises:
acquiring all online member ports of the aggregation port;
if the number of the online member ports is larger than 1, determining a source port corresponding to the aggregation port and a member port mapping table according to the number of the source ports corresponding to the aggregation port and the number of the online member ports;
correspondingly, the setting of the mirroring destination port in the configuration information as the member port of the aggregation port includes:
and setting the mirror image destination port of each source port corresponding to the aggregation port in the configuration information as the corresponding member port of the aggregation port according to the source port and member port mapping table.
4. The method of claim 1, wherein said obtaining the member ports of the aggregation port comprises:
acquiring all online member ports of the aggregation port;
if the number of the online member ports is more than 1, calculating hash values of various message flows to be mirrored corresponding to the aggregation port;
determining a hash value and a member port mapping table corresponding to the aggregation port according to the hash value and the number of the online member ports;
correspondingly, the setting of the mirroring destination port in the configuration information as the member port of the aggregation port includes:
and setting the mirror destination port of each message flow to be mirrored corresponding to the aggregation port in the configuration information as the member port of the aggregation port corresponding to the hash value according to the hash value and the member port mapping table.
5. The method of claim 3 or 4, further comprising:
and if the current online member port number of the aggregation port is 0, generating alarm information aiming at the encapsulation remote port mirror image corresponding to the aggregation port.
6. An apparatus for encapsulating a remote port image for use in a network device, comprising:
the first acquisition module is used for acquiring configuration information of each packaged remote port mirror image in the network equipment;
the judging module is used for judging whether the mirror image destination port of each encapsulated remote port mirror image is an aggregation port or not according to the configuration information;
the second obtaining module is used for obtaining a member port of the aggregation port if a mirror image destination port of the mirror image of the first packaging remote port is the aggregation port;
and the changing module is used for changing the configuration information of the mirror image of the first packaging remote port and setting the mirror image destination port in the configuration information as a member port of the aggregation port.
7. The apparatus of claim 6, wherein the second obtaining module is specifically configured to:
acquiring all online member ports of the aggregation port;
correspondingly, the device further comprises:
a first mapping module, configured to determine, if the number of online member ports is greater than 1, a source port and a member port mapping table corresponding to the aggregation port according to the number of source ports corresponding to the aggregation port and the number of online member ports;
correspondingly, the modification module is specifically configured to:
and setting the mirror image destination port of each source port corresponding to the aggregation port in the configuration information as the corresponding member port of the aggregation port according to the source port and member port mapping table.
8. The apparatus of claim 6, wherein the second obtaining module is specifically configured to:
acquiring all online member ports of the aggregation port;
correspondingly, the device further comprises:
the second mapping module is used for calculating hash values of various message flows to be mirrored corresponding to the aggregation port if the number of the online member ports is greater than 1;
determining a hash value and a member port mapping table corresponding to the aggregation port according to the hash value and the number of the online member ports;
correspondingly, the modification module is specifically configured to:
and setting the mirror destination port of each message flow to be mirrored corresponding to the aggregation port in the configuration information as the member port of the aggregation port corresponding to the hash value according to the hash value and the member port mapping table.
9. An electronic device, comprising:
the processor and the memory are communicated with each other through a bus; the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the method of any of claims 1 to 5.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1 to 5.
CN202010350576.6A 2020-04-28 2020-04-28 Method and device for encapsulating remote port mirror image, electronic equipment and storage medium Withdrawn CN111526102A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010350576.6A CN111526102A (en) 2020-04-28 2020-04-28 Method and device for encapsulating remote port mirror image, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010350576.6A CN111526102A (en) 2020-04-28 2020-04-28 Method and device for encapsulating remote port mirror image, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111526102A true CN111526102A (en) 2020-08-11

Family

ID=71905034

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010350576.6A Withdrawn CN111526102A (en) 2020-04-28 2020-04-28 Method and device for encapsulating remote port mirror image, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111526102A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113556345A (en) * 2021-07-22 2021-10-26 锐捷网络股份有限公司 Message processing method, device, equipment and medium
CN113839883A (en) * 2021-09-30 2021-12-24 杭州迪普科技股份有限公司 Configuration method of port aggregation group

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN113839883A (en) * 2021-09-30 2021-12-24 杭州迪普科技股份有限公司 Configuration method of port aggregation group
CN113839883B (en) * 2021-09-30 2023-05-26 杭州迪普科技股份有限公司 Configuration method of port aggregation group

Similar Documents

Publication Publication Date Title
US10135702B2 (en) Methods, systems, and computer readable media for testing network function virtualization (NFV)
US10778577B2 (en) Status monitoring of inline network tools
US10949233B2 (en) Optimized virtual network function service chaining with hardware acceleration
US8855116B2 (en) Virtual local area network state processing in a layer 2 ethernet switch
US8705551B2 (en) Method and system for management of flood traffic over multiple 0:N link aggregation groups
US11206210B2 (en) Packet processing method and system, and device
US11729102B2 (en) Active-active cluster control method and control node
US9882741B2 (en) Communication apparatus and communication method
US11018937B2 (en) Determining an effect of a network configuration change
US20170118108A1 (en) Real Time Priority Selection Engine for Improved Burst Tolerance
WO2023278211A1 (en) Dynamic proxy response to application container
EP3491810A1 (en) System and method for providing transmission of compliance requirements for cloud-based applications
US20140280864A1 (en) Methods of Representing Software Defined Networking-Based Multiple Layer Network Topology Views
CN106603550B (en) A kind of Network Isolation method and device
JP2017518720A (en) Proactive network failure handling
CN105939267B (en) Outband management method and device
US10630579B1 (en) Ensuring separate paths for network traffic between source devices and a destination device
CN110191064B (en) Flow load balancing method, device, equipment, system and storage medium
CN111526102A (en) Method and device for encapsulating remote port mirror image, electronic equipment and storage medium
US20200084142A1 (en) Predictive routing in multi-network scenarios
CN109309617A (en) Disaster tolerance switching method, relevant device and computer storage medium
Lee et al. Overload and failure management in service function chaining
CN105591934A (en) Flow table management method and device
US20190229991A1 (en) Method and system for managing control connections with a distributed control plane
CN110875889A (en) Method and device for acquiring path

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: 20200811

WW01 Invention patent application withdrawn after publication