A remote mirroring system and method based on a p4 programmable chip

The remote mirroring system based on the P4 programmable chip solves the problems of large resource consumption, low efficiency and complicated operation in the existing remote mirroring technology. It realizes fine-grained remote mirroring, is suitable for Internet environment, simplifies operation process and reduces network resource consumption.

CN116074333BActive Publication Date: 2025-10-31CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211662965.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-23
Publication Date
2025-10-31
Estimated Expiration
2042-12-23

AI Technical Summary

Technical Problem

Existing network devices suffer from problems such as high resource consumption, impact on data forwarding efficiency, complex operation, and lack of support for fine-grained packet filtering when implementing remote mirroring, especially in high-traffic scenarios where it is difficult to effectively acquire data packets of interest.

Method used

A remote mirroring system based on the P4 programmable chip is adopted. By configuring channels and data transmission channels, and utilizing the programmability of the P4 chip to customize ACL and meter functions, fine-grained remote mirroring is achieved. VXLAN tunnel encapsulation is performed directly on the data plane, reducing resource consumption and maintaining data forwarding efficiency, and supporting fine-grained packet filtering.

Benefits of technology

It achieves low resource consumption, does not affect data forwarding efficiency, has controllable mirror traffic, and is widely applicable. It can effectively obtain data packets of interest in the Internet environment and simplifies the operation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116074333B_ABST
    Figure CN116074333B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of computer network communication and proposes a remote mirroring scheme that is easy to operate, fine-grained, and has low resource consumption. The scheme is based on the p4 programmable data forwarding plane and can mirror the packets of interest of a specified network element to the operation and maintenance equipment, which facilitates the location of network faults.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer network communication, and in particular to a remote mirroring system and method based on a p4 programmable chip. Background Technology

[0002] In network operations and maintenance, it is often necessary to obtain certain fields from data packets as important evidence for fault analysis. Mirroring effectively meets this need. Mirroring includes local mirroring and remote mirroring. Remote mirroring is more suitable for live network applications, thus a simple and effective remote mirroring reduces the difficulty of network operations and maintenance. Remote mirroring is inseparable from the data forwarding plane. The forwarding plane of devices in existing networks is generally based on ASIC network chips, NP chips, and general-purpose processors.

[0003] Since the mirroring function of network chips is fixed, most chips can only designate the mirroring management port as a physical port, which can only realize local port mirroring. If remote mirroring is to be realized, an additional support chip, such as an FPGA, is generally required to realize remote mirroring. After mirroring, the packets are encapsulated with VPN using FPGA and sent to the target device.

[0004] Based on general-purpose processor forwarding devices, the Data Plane Development Kit (DPDK) is typically used to migrate network data processing to user space. This data plane maintains great flexibility and has been widely used in data center networks. DPDK processing of network data packets usually requires the cooperation of network protocol stack suites, such as the open-source VPP. These software programs typically have rich and powerful built-in fault location methods. For example, VPP provides trace and pcap tools. Trace prints out the packet flow process between nodes, facilitating fault location. Pcap packets can save all processed packets, but it has certain limitations. Mirroring and capturing packets from the soft forwarding data plane involves packet copying, which severely impacts network data forwarding efficiency. It also does not support fine-grained packet filtering, making it difficult to capture desired data in high-traffic scenarios. Resource consumption is also a concern. For example, tracing prints out the entire packet flow within VPP nodes in a fixed format, consuming significant storage resources. Furthermore, it is difficult to operate; the information obtained from trace and pcap is stored on the operating network element device, requiring manual copying back to the maintenance equipment for analysis. Summary of the Invention

[0005] In view of this, the present invention proposes a remote mirroring scheme that is easy to operate, fine-grained, and has low resource consumption. The scheme is based on the p4 programmable data forwarding plane and can mirror the packets of interest of a specified network element to the maintenance equipment, which facilitates the location of network faults.

[0006] In a first aspect, the present invention provides a remote mirroring system based on a p4 programmable chip, the system comprising:

[0007] The initiating target server is deployed on the operations and maintenance server. It is used to initiate remote mirroring and to receive and analyze mirroring packets.

[0008] Configure the channel, supporting configurations including: obtaining the support status of the service response end, testing the connectivity of the data transmission channel, and initiating remote mirroring.

[0009] The data transmission channel is used to send the mirrored messages back to the initiating target server.

[0010] The mirror source network element is used to provide remote mirroring services through the management port, perform mirroring functions, and send the encapsulated packets to the initiating target server. It adopts the p4 programmable data forwarding plane, and based on the programmability of p4, it customizes the ACL, mirrors the packets of interest, encapsulates the mirrored packets in the tunnel, and sends them to the data transmission channel.

[0011] Secondly, the present invention provides a remote mirroring method based on a p4 programmable chip, the method comprising the following steps:

[0012] S1, the initiating target server triggers remote mirroring. According to the configuration, it queries the remote mirroring supported features of the mirror source network element. If it does not support them, the remote mirroring ends; if it does support them, it captures packets from the specified network interface card locally.

[0013] S2, the initiating target server starts a mirror test of the source network element. The source network element constructs a packet according to the configuration message and sends it back to the initiating target server via the data transmission channel. The initiating target server determines whether the data transmission channel is connected based on the packet capture results locally. If the data transmission channel is normal, proceed to the next step.

[0014] S3, the initiating target server constructs an image message based on the input, triggering the image function of the image source network element.

[0015] S4: The mirror source network element configures the VXLAN tunnel, mirror, ACL, register, and / or meter entries of the p4 data plane in sequence according to the message, completes the mirroring of the p4 data plane interest packets, and sends them back to the initiating target server.

[0016] S5: The initiating target server analyzes and determines whether remote mirroring has been completed based on the response message and the network interface packets captured by tcpdump.

[0017] S6: Disable remote mirroring.

[0018] This application has the following main advantages over the prior art:

[0019] 1. Low resource consumption: In this solution, remote mirroring directly encapsulates the packets mirrored on the data plane of the target network element into a VXLAN tunnel, without consuming storage or other resources of the target network element device.

[0020] 2: It does not affect the forwarding efficiency of the data plane. By using the mirror function of the P4 chip, compared with the soft forwarding plane based on DPDK, packet copying will not affect the forwarding efficiency.

[0021] 3. Traffic is controllable after mirroring, with minimal impact on the server. After enabling remote mirroring, if a large number of interest packets are mirrored to the server from the remote mirroring source network element, it may cause network congestion on the server in a short period of time. This solution uses the register function of p4 to define the number of mirrored packets, which greatly reduces the network traffic on the server.

[0022] 4. Fine-grained mirroring scheme: By using multiple ACL matching items, it can effectively filter packets of interest, avoid mirroring a large number of unnecessary packets, and save network resources.

[0023] 5. Simple to implement: The remote mirroring device uses resources such as meter, mirror, and ACL, which are required by most network forwarding data planes. Therefore, the implementation requires very little modification to the data plane, greatly reducing the impact on the data plane.

[0024] 6. Wide applicability: The solution uses gRPC for the channel configuration and VXLAN as the data transmission channel, which has very low requirements for the underlying network. As long as it supports Layer 3 forwarding, it can effectively traverse the Internet network for remote mirroring. Attached Figure Description

[0025] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of this invention or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0026] Figure 1 Overall topology diagram; Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0028] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms, and “multiple” generally includes at least two unless the context clearly indicates otherwise.

[0029] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0030] Depending on the context, the words “if” or “suppose” as used here can be interpreted as “when” or “in response to determination” or “in response to detection.” Similarly, depending on the context, the phrases “if determination” or “if detection (of the stated condition or event)” can be interpreted as “when determination” or “in response to determination” or “when detection (of the stated condition or event)” or “in response to detection (of the stated condition or event).”

[0031] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a product or system comprising a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a product or system. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in a product or system that includes those elements.

[0032] Furthermore, the timing of the steps in the following method embodiments is merely an example and not a strict limitation.

[0033] This invention provides a remote mirroring system based on a p4 programmable chip. The overall network topology of this solution is shown in the attached figure. Figure 1As shown. The entire scheme consists of the following parts: the initiating target server, the mirror source network element, the configuration channel for transmitting configuration data between the initiating target server and the mirror source network element, and the data transmission channel for transmitting mirrored packets back to the initiating target server.

[0034] Initiating target server: Used to initiate remote mirroring and to receive mirror messages for analysis. It is generally deployed on the operations and maintenance server, such as the operations and maintenance server deployed in the Beijing area of ​​the topology diagram.

[0035] Configure the channel, shown by the red dashed line in the topology diagram. Supported configurations include: obtaining service response support status, testing data transmission channel connectivity, and initiating remote mirroring.

[0036] The data transmission channel is used to send the mirrored messages back to the initiating target server.

[0037] The source network element provides remote mirroring services through its management port, performs mirroring functions, and sends the encapsulated packets to the initiating target server, as shown by the network elements in Shanghai and Guangzhou in the diagram. It employs a p4 programmable data forwarding plane, leveraging p4's programmability to define custom ACLs, mirroring packets of interest, encapsulating the mirrored packets in a tunnel, and then sending them to the data transmission channel.

[0038] This solution uses the register function of P4 to specify the number of mirrored packets, and the meter function of P4 to control the sending rate of mirrored packets. It also uses the packet construction function of the P4 chip to test the connectivity of the data transmission channel.

[0039] The present invention also provides a remote mirroring method based on a p4 programmable chip, the method comprising the following steps:

[0040] S1: The initiating target server triggers remote mirroring. Based on the configuration, it queries the remote mirroring supported features of the mirroring source network element. If not supported, the remote mirroring ends. If supported, it captures packets from the specified network interface card locally.

[0041] During implementation, the configuration channel uses gRPC to deliver services, and the defined services are shown in Table 1:

[0042]

[0043] Table 1 Services defined by gRPC

[0044] First, the initiating target server calls ServiceGet to obtain the image feature support information and port list of the image source network element, including the features listed in Table 2 below.

[0045] MirrorSuppport MirrorNumberSupport RateLimitSupport TunnelTestSupport Support remote mirroring Supports specifying the number of mirror packets Supports specified image resolution. Supports backhaul channel connectivity detection

[0046] Table 2 Features supported by mirror source network elements

[0047] S2: The initiating target server starts a mirror test of the source network element. The source network element constructs a packet according to the configuration message and sends it to the initiating target server via the data transmission channel. The initiating target server determines whether the data transmission channel is connected based on the packet capture results locally. If the data transmission channel is normal, proceed to the next step.

[0048] In practice, after obtaining the supported features at the remote end, a connectivity test of the data transmission channel is initiated based on whether tunnel connectivity detection is supported. The initiating target server first starts tcpdump, then calls the MirrorTest service to trigger the packet construction function of the mirror source network element, constructing a preset number of packets (10 packets by default), encapsulating them in VXLAN, and sending them to the initiating target server. After waiting for a response from the mirror source network element, the initiating target server determines the connectivity of the data transmission channel based on the captured packets. If the packet reception rate reaches a preset threshold, the connectivity is considered normal; the default threshold is 70%.

[0049] S3: The initiating target server constructs an image message based on the input, triggering the image function of the image source network element.

[0050] In practice, after completing the connectivity test of the data transmission channel, the initiating target server calls the MirrorSet service to initiate remote mirroring, and the message sent includes the content shown in Figure 3 below:

[0051] Enable Enable remote mirroring FilterDstMac Filter ACLs to specify the destination MAC address TunnelDstlp DIP of the return channel tunnel FilterSrcMac Filter ACLs to specify source MAC TunnelVni Vni of the return channel tunnel FilterEtherType Filtering ACLs specify the Ethernet type PktNumber Number of mirrored packets FilterDstlpAddr Filtering ACLs by specifying the destination IP MirrorDirect Mirror direction ingress / egress FilterSrclpAddr Source IP MirrorPort Mirror Port FilterProtocol Protocol type FilterDstPort Destination port number FilterSrcPort Source port number

[0052] Table 3 Message content for enabling / disabling mirroring

[0053] S4: The mirror source network element configures the vxlantunnel, mirror, acl, register and / or meter entries of the p4 data plane in sequence according to the message, completes the mirroring of the p4 data plane interest packets and sends them to the initiating target server.

[0054] In practice, the mirror source network element determines based on the message transmitted from the initiating end.

[0055] The Enable field enables mirroring configuration and distributes entries to the P4 forwarding plane. The most important entries include the ACL table, whose action is mirroring. Depending on the mirroring direction of the message, `ingress_acl` and `egress_acl` are defined in the chip's ingress match-action and egress match-action phases, respectively. Next, the P4 forwarding plane defines and distributes the encapsulation information corresponding to the VXLAN tunnel in the egress match-action phase, and sets the number of mirrored packets in the register table based on the `PktNumber` bit in the message.

[0056]

[0057] Table 4 Ingress-ACL hardware table key-action

[0058]

[0059] Table 5 shows the key-action of the egress-acl hardware table.

[0060] Based on the mirror_type configured in the ACL, the P4 forwarding plane completes the format encapsulation of mirror packets during the ingress-deparse and egress-deparse phases. During the egress match-action phase, based on the encapsulated content, it distinguishes between source packets, ingress-mirror packets, and egress-mirror packets. For both ingress-mirror and egress-mirror packets, it specifies the next-hop outgoing interface as the VXLAN tunnel interface and, according to the corresponding encapsulation information in the P4 forwarding plane's next-hop table, sets the destination IP to the initiating target server, completing the VXLAN header encapsulation and routing.

[0061] S5: The initiating target server analyzes and determines whether remote mirroring has been completed based on the response message and the network interface packets captured by tcpdump.

[0062] In practice, the initiating target server captures the packets received in the network card and obtains the VXLAN-encapsulated image packets.

[0063] S6: Disable remote mirroring.

[0064] In practice, after the analysis is completed, the initiating target server calls MirrorSet to shut down the remote mirror. After receiving the message, the mirror source network element shuts down the mirror according to the Enable field and deletes the previously issued ACL and VXLAN encapsulation entries in the p4 data plane.

[0065] This completes a remote mirroring operation.

[0066] It is understood that the system provided in the embodiments of the present invention can also be used to implement the steps in the methods provided in other embodiments of the present invention.

[0067] The present invention also provides a computer device. The computer device is manifested in the form of a general-purpose computing device. The components of the computer device may include, but are not limited to: one or more processors or processing units, system memory, and buses connecting different system components.

[0068] Computer devices typically include a variety of computer system-readable media. These media can be any available media that can be accessed by a computer device, including volatile and non-volatile media, and removable and non-removable media.

[0069] The system memory may include a computer system readable medium in the form of volatile memory, and the memory may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.

[0070] The processing unit executes various functional applications and data processing by running programs stored in the system memory, such as implementing the methods provided in other embodiments of the present invention.

[0071] The present invention also provides a storage medium containing computer-executable instructions and storing a computer program thereon, which, when executed by a processor, implements the methods provided in other embodiments of the present invention.

[0072] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.

Claims

1. A remote mirroring system based on a p4 programmable chip, characterized in that, The system includes: The initiating target server is deployed on the operation and maintenance server and is used to initiate remote mirroring and to receive and analyze mirroring packets. Configure the channel, supporting configurations including: obtaining the support status of the service response end, testing the connectivity of the data transmission channel, and initiating remote mirroring; The data transmission channel is used to send the mirrored message back to the initiating target server; The mirror source network element is used to provide remote mirroring services through the management port, perform mirroring functions, and send the encapsulated packets to the initiating target server. It adopts the p4 programmable data forwarding plane, and based on the programmability of p4, it customizes the ACL, mirrors the packets of interest, encapsulates the mirrored packets in the tunnel, and sends them to the data transmission channel.

2. The remote mirroring system according to claim 1, characterized in that, The p4-based programmability includes: Use p4's register function to specify the number of mirrored packets; and / or, Use the meter function of p4 to control the sending rate of mirrored messages; and / or, Use p4's message construction function to test the connectivity of the data transmission channel.

3. A remote mirroring method based on a p4 programmable chip, characterized in that, The method includes the following steps: S1, the initiating target server triggers remote mirroring. According to the configuration, it queries the remote mirroring supported features of the mirror source network element. If it does not support them, the remote mirroring ends; if it does support them, it captures packets from the specified network interface card locally. S2, the initiating target server starts the mirror test of the mirror source network element. The mirror source network element constructs a packet according to the configuration message and sends it back to the initiating target server through the data transmission channel. The initiating target server determines whether the data transmission channel is connected based on the packet results captured locally. After the data transmission channel is normal, proceed to the next step. S3, the initiating target server constructs an image message based on the input, triggering the image function of the image source network element; S4: The mirror source network element configures the VXLAN tunnel, mirror, ACL, register and / or meter entries of the p4 data plane in sequence according to the message, completes the mirroring of the p4 data plane interest packets and sends them back to the initiating target server. S5: The initiating target server analyzes and determines whether the remote mirroring is complete based on the response message and the network interface packets captured by tcpdump. S6: Disable remote mirroring.

4. The remote mirroring method according to claim 3, characterized in that, The remote mirroring features supported by the query mirror source network element include: The configuration channel uses gRPC to deliver services, and the defined services include SericGet, MirrorTest, and MirrorSet. The initiating target server calls ServiceGet to obtain the image feature support information and port list of the image source network element.

5. The remote mirroring method according to claim 3, characterized in that, The mirror test of enabling the mirror source network element includes, The initiating target server first starts tcpdump, then calls the MirrorTest service to trigger the packet construction function of the mirror source network element, constructs a preset number of packets, encapsulates them in VXLAN, and sends them to the initiating target server. The determination of whether the data transmission channel is connected includes, After waiting for the mirror source network element to return a response, the initiating target server judges the connectivity of the data transmission channel based on the captured packets. If the packet reception rate reaches a preset threshold, the connectivity is considered normal.

6. The remote mirroring method according to claim 3, characterized in that, The image building message includes the initiating target server calling the MirrorSet service to initiate a remote image.

7. The remote mirroring method according to claim 3, characterized in that, The completion of the mirroring of p4 data plane interest packets includes, The P4 forwarding plane completes the format encapsulation of the mirrored packets in the ingress-deparse and egress-deparse phases. It then completes the encapsulation of the VXLAN header and routes the route based on the encapsulation information in the next-hop table of the p4 forwarding plane.

8. The remote mirroring method according to claim 3, characterized in that, The shutdown of the remote mirror includes, The initiating target server calls MirrorSet to shut down the remote mirror. The mirror source network element shuts down the mirror after receiving the message, and deletes the ACL and VXLAN encapsulation entries issued before the p4 data plane.

9. A computing device, comprising: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable program, which causes the processor to perform the operation corresponding to the remote mirroring method as described in any one of claims 3-8.

10. A computer storage medium storing at least one executable program that causes a processor to perform operations corresponding to the remote mirroring method as described in any one of claims 3-8.

Citation Information

Patent Citations

  • Message mirroring method and network device for supporting the remote message mirror

    CN101035033A

  • Reflection attack defense method and device, electronic equipment and storage medium

    CN112804200A