Traffic mirroring method, switch, controller, electronic equipment and storage medium
By creating a service bridge and a traffic mirroring bridge in a virtual switch, using traffic mirroring bridges, network cards and switches for traffic mirroring, the operational problems caused by network traffic overload in the cloud network platform are solved, and traffic mirroring is realized The normal operation and isolation of business and customer business.
Patent Information
- Application Number
- CN202410773534.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-06-14
AI Technical Summary
In cloud network platform, when the traffic is mirrored, the network traffic exceeds the carrying capacity of the service network card or network element server, causing the traffic mirroring service to fail to operate normally.
By creating service bridges and traffic mirroring bridges in virtual switches, using traffic mirroring bridges, traffic mirroring network cards and traffic mirroring switches for traffic mirroring services, realizing isolation between traffic mirroring services and customer services, ensuring that in large traffic situations The next two do not affect each other.
It ensures the normal operation of traffic mirroring services and customer services under large traffic conditions, improves the rationality of traffic mirroring processes, and avoids packet loss and service failure caused by network traffic overload.
Smart Images

Figure CN118921379A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a traffic mirroring method, a switch, a controller, an electronic device and a storage medium. Background Art
[0002] Traffic mirroring is a network traffic processing technology that copies the real online traffic to a mirror service through a specific configuration. Traffic mirroring can provide detailed analysis of traffic data for security auditing, intrusion detection, business analysis and other scenarios without affecting online services.
[0003] In cloud network platforms, whether public or private, when performing traffic mirroring, network traffic is mirrored to the network element server through the service network card, and then the network traffic is aggregated on the network element server before being sent to the customer's virtual machine. However, this method may cause the network traffic to exceed the carrying capacity of the service network card or network element server, resulting in the inability of the traffic mirroring service to operate normally. Summary of the invention
[0004] In view of the above problems, the embodiments of the present application propose a traffic mirroring method, a switch, a controller, an electronic device and a storage medium to improve the rationality of the traffic mirroring process and ensure the normal operation of the traffic mirroring service.
[0005] According to one aspect of an embodiment of the present application, a traffic mirroring method is provided, which is applied to a virtual switch, wherein the virtual switch interacts with a network controller for data exchange, and a service bridge and a traffic mirroring bridge are created in the virtual switch; the method comprises:
[0006] Receiving the first flow table sent by the network controller through the service bridge, and copying the network traffic of the mirror source according to the first flow table to obtain the first mirror network traffic, and forwarding the first mirror network traffic to the traffic mirror bridge;
[0007] The first mirrored network traffic sent by the business bridge is received through the traffic mirroring bridge, and the second flow table issued by the network controller is received through the traffic mirroring bridge, the second mirrored network traffic is filtered out from the first mirrored network traffic according to the second flow table, and the second mirrored network traffic is forwarded to the traffic mirroring switch via the traffic mirroring network card.
[0008] Optionally, the network traffic of the mirror source is copied according to the first flow table to obtain the first mirror network traffic, and the first mirror network traffic is forwarded to the traffic mirror bridge, including: according to the mirror source information and the mirror action type contained in the first flow table, the network traffic of the mirror source is copied to obtain the first mirror network traffic; according to the transmission port information contained in the first flow table, the first mirror network traffic is forwarded to the traffic mirror bridge.
[0009] Optionally, before receiving the first flow table sent by the network controller through the service bridge, the method further includes: creating a port for interconnecting the service bridge and the traffic mirroring bridge.
[0010] Optionally, filtering out the second mirrored network traffic from the first mirrored network traffic according to the second flow table, and forwarding the second mirrored network traffic to the traffic mirrored switch via the traffic mirrored network card, including: filtering out the second mirrored network traffic from the first mirrored network traffic according to the filtering conditions contained in the second flow table; and forwarding the second mirrored network traffic to the traffic mirrored switch via the traffic mirrored network card according to the mirroring destination information contained in the second flow table.
[0011] Optionally, after forwarding the first mirrored network traffic to the traffic mirroring bridge, it also includes: deleting the first flow table; after forwarding the second mirrored network traffic to the traffic mirroring switch via the traffic mirroring network card, it also includes: deleting the second flow table.
[0012] Optionally, before receiving the first flow table issued by the network controller through the service bridge, it also includes: configuring the service network traffic forwarding priority and the mirror network traffic forwarding priority in the service bridge, and the service network traffic forwarding priority is higher than the mirror network traffic forwarding priority.
[0013] According to another aspect of an embodiment of the present application, a traffic mirroring method is provided, which is applied to a network controller, wherein the network controller interacts with a virtual switch for data exchange, and a service bridge and a traffic mirroring bridge are created in the virtual switch; the method comprises:
[0014] Generate a first flow table corresponding to the traffic mirroring service, and send the first flow table to the service bridge, wherein the first flow table is used to instruct the service bridge to copy the network traffic of the mirroring source to obtain the first mirrored network traffic, and forward the first mirrored network traffic to the traffic mirroring bridge;
[0015] Generate a second flow table corresponding to the traffic mirroring service, and send the second flow table to the traffic mirroring bridge, wherein the second flow table is used to instruct the traffic mirroring bridge to filter out the second mirroring network traffic from the first mirroring network traffic, and forward the second mirroring network traffic to the traffic mirroring switch via the traffic mirroring network card.
[0016] Optionally, generating a first flow table corresponding to the traffic mirroring service includes: generating a first flow table corresponding to the traffic mirroring service when the traffic mirroring service starts; generating a second flow table corresponding to the traffic mirroring service includes: generating a second flow table corresponding to the traffic mirroring service when the traffic mirroring service starts.
[0017] Optionally, the method further includes: after the traffic mirroring service ends, deleting the first flow table and the second flow table.
[0018] According to another aspect of an embodiment of the present application, a virtual switch is provided, wherein the virtual switch interacts with a network controller for data, and a service bridge and a traffic mirroring bridge are created in the virtual switch; the virtual switch comprises:
[0019] A first processing module is used to receive a first flow table issued by the network controller through the service bridge, and copy the network traffic of the mirror source according to the first flow table to obtain a first mirror network traffic, and forward the first mirror network traffic to the traffic mirror bridge;
[0020] The second processing module is used to receive the first mirrored network traffic sent by the business bridge through the traffic mirroring bridge, and receive the second flow table issued by the network controller through the traffic mirroring bridge, filter out the second mirrored network traffic from the first mirrored network traffic according to the second flow table, and forward the second mirrored network traffic to the traffic mirroring switch via the traffic mirroring network card.
[0021] Optionally, the first processing module includes: a copying unit, used to copy the network traffic of the mirror source according to the mirror source information and the mirror action type contained in the first flow table to obtain the first mirror network traffic; a first forwarding unit, used to forward the first mirror network traffic to the traffic mirroring bridge according to the transmission port information contained in the first flow table.
[0022] Optionally, the virtual switch further includes: a creation module, configured to create a port for interconnecting the service bridge and the traffic mirroring bridge.
[0023] Optionally, the second processing module includes: a screening unit, used to screen out the second mirrored network traffic from the first mirrored network traffic according to the screening conditions contained in the second flow table; a second forwarding unit, used to forward the second mirrored network traffic to the traffic mirroring switch via the traffic mirroring network card according to the mirroring destination information contained in the second flow table.
[0024] Optionally, the virtual switch also includes: a first deletion module, used to delete the first flow table after the first processing module forwards the first mirrored network traffic to the traffic mirroring bridge; a second deletion module, used to delete the second flow table after the second processing module forwards the second mirrored network traffic to the traffic mirroring switch via the traffic mirroring network card.
[0025] Optionally, the virtual switch further includes: a configuration module, used to configure a service network traffic forwarding priority and a mirror network traffic forwarding priority in the service bridge, wherein the service network traffic forwarding priority is higher than the mirror network traffic forwarding priority.
[0026] According to another aspect of an embodiment of the present application, a network controller is provided, wherein the network controller interacts with a virtual switch for data, and a service bridge and a traffic mirroring bridge are created in the virtual switch; the network controller comprises:
[0027] A first generation module is used to generate a first flow table corresponding to the traffic mirroring service, and send the first flow table to the service bridge, wherein the first flow table is used to instruct the service bridge to copy the network traffic of the mirroring source to obtain the first mirrored network traffic, and forward the first mirrored network traffic to the traffic mirroring bridge;
[0028] The second generation module is used to generate a second flow table corresponding to the traffic mirroring service, and send the second flow table to the traffic mirroring bridge. The second flow table is used to instruct the traffic mirroring bridge to filter out the second mirroring network traffic from the first mirroring network traffic, and forward the second mirroring network traffic to the traffic mirroring switch via the traffic mirroring network card.
[0029] Optionally, the first generation module is specifically used to generate a first flow table corresponding to the traffic mirroring service when the traffic mirroring service starts; the second generation module is specifically used to generate a second flow table corresponding to the traffic mirroring service, including: generating a second flow table corresponding to the traffic mirroring service when the traffic mirroring service starts.
[0030] Optionally, the network controller further includes: a third deleting module, configured to delete the first flow table and the second flow table after the traffic mirroring service ends.
[0031] According to another aspect of an embodiment of the present application, an electronic device is provided, comprising a processor and a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium; when the computer program is executed by the processor, the processor executes the traffic mirroring method as described in any one of the above items.
[0032] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the processor executes the traffic mirroring method as described in any one of the above items.
[0033] In the embodiment of the present application, the virtual switch interacts with the network controller for data exchange, and a service bridge and a traffic mirroring bridge are created in the virtual switch; the virtual switch receives the first flow table issued by the network controller through the service bridge, and copies the network traffic of the mirror source according to the first flow table to obtain the first mirrored network traffic, and forwards the first mirrored network traffic to the traffic mirroring bridge; the virtual switch receives the first mirrored network traffic sent by the service bridge through the traffic mirroring bridge, and receives the second flow table issued by the network controller through the traffic mirroring bridge, and selects the second mirrored network traffic from the first mirrored network traffic according to the second flow table, and forwards the second mirrored network traffic to the traffic mirroring switch via the traffic mirroring network card. It can be seen from this that in the embodiment of the present application, the traffic mirroring service is performed through a separate traffic mirroring bridge, a traffic mirroring network card and a traffic mirroring switch, which realizes the isolation between the traffic mirroring service and the customer service, so that the traffic mirroring service and the user service do not affect each other, thereby ensuring that the traffic mirroring service and the customer service can run normally and smoothly under large traffic conditions, and improving the rationality of the traffic mirroring process.
[0034] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solution of the embodiment of the present application, the drawings required for use in the description of the embodiment of the present application will be briefly introduced below. Obviously, the drawings described below are only some drawings of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 It is a network architecture diagram of an embodiment of the present application.
[0037] Figure 2 This is a control plane architecture diagram of an embodiment of the present application.
[0038] Figure 3 It is an application environment architecture diagram of an embodiment of the present application.
[0039] Figure 4 It is a flow chart of the steps of a traffic mirroring method according to an embodiment of the present application.
[0040] Figure 5 This is a flowchart of the steps of another traffic mirroring method according to an embodiment of the present application.
[0041] Figure 6 It is a structural block diagram of a virtual switch according to an embodiment of the present application.
[0042] Figure 7 It is a structural block diagram of a network controller according to an embodiment of the present application.
[0043] Figure 8 It is a structural block diagram of an electronic device according to an embodiment of the present application.
[0044] Fig. 9 It is a structural block diagram of a computer-readable storage medium in an embodiment of the present application. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0046] In the related technology, in the cloud network platform, whether it is a public cloud or a private cloud, when performing traffic mirroring, the network traffic is mirrored to the network element server through the business network card, and then the network traffic is aggregated on the network element server before being sent to the customer's virtual machine. However, when the network traffic is large, this method has the following problems: First, when the business network traffic of the cloud host is greater than 50% of the network card traffic, the business network card will copy a copy of the business network traffic as the mirror network traffic, so that the total network traffic will exceed the carrying capacity of the business network card, resulting in packet loss of the business network traffic. Second, since the mirrored network traffic is aggregated on the network element server, and since there will not be many network element servers deployed, when the mirrored network traffic exceeds the carrying capacity of the network element server, the network element server will be unable to process the mirrored network traffic normally, causing service failures.
[0047] In response to the above problems, it is proposed in the embodiments of the present application to perform traffic mirroring services through traffic mirroring bridges, traffic mirroring network cards and traffic mirroring switches, so as to isolate the traffic mirroring services and customer services, so as to achieve the goal of not affecting each other in the case of large traffic, thereby ensuring the normal and smooth operation of the traffic mirroring services and customer services.
[0048] The traffic mirroring method in the embodiment of the present application can be applied to the traffic mirroring process in a private cloud or a public cloud, and the beneficial effect is more obvious in large network traffic. For example, in a private cloud, especially for financial customers in a private cloud, the traffic mirroring method in the embodiment of the present application can produce more obvious beneficial effects.
[0049] First, the application environment of the embodiments in this application is introduced.
[0050] The embodiments of the present application can be applied to a cloud network platform.
[0051] The cloud network platform supports multi-AZ (Availability Zone) resource layout, ultra-large cluster scale, and software and hardware collaboration. The core capabilities of the resource pool meet the requirements of ultra-large-scale, high-performance, secure and reliable cloud services.
[0052] The cloud network platform has super-large-scale resource pool management and scheduling capabilities, supports super-large-scale data center networking and multi-AZ architecture deployment, has the ability to manage resource pool networks with a large number of nodes, supports a large number of servers in a single AZ, and increases the Region scale by multiple times, reaching the industry's advanced level, meeting the various business needs of enterprises.
[0053] The cloud network platform has been fully commercialized and deployed on the live network. As an independent and controllable cloud base, it provides a high-performance, high-availability and high-reliability basic cloud network base.
[0054] The cloud network platform is a distributed network platform that supports platform-based network elements, provides a rich API (Application Program Interface), and supports high customization. The cloud network platform is transparent in the entire link of services, can quickly converge faults, and provide extreme performance. The full-link redundant disaster recovery architecture provides customers with a highly reliable and available platform.
[0055] The cloud network platform provides segmented network products for various scenarios, including VPC (Virtual Private Cloud), subnets, routing, security groups, load balancing, NAT (Network Address Translation) gateways, VPN (Virtual Private Network) connections, peer connections, dedicated line access, etc.
[0056] The VPC product in the cloud network platform achieves multi-tenant isolation through overlay technology, which can help users build exclusive cloud network space and achieve logical isolation between different private networks. In the VPC network, users can plan and use cloud resources like using their own data center, divide different network segments, flexibly set routes, and access the Internet through elastic IP (Internet Protocol) or NAT gateway.
[0057] The network products of the cloud network platform connect multiple VPCs on the cloud through peer-to-peer connections or high-speed connections between clouds; through dedicated line access and VPN connections, the intercommunication problem between the local IDC (Internet Data Center) and multiple VPCs on the cloud is solved, helping customers to easily build a hybrid cloud. The cloud network platform has a high degree of adaptability and can adapt to a variety of forwarding plane devices and support a variety of southbound protocols: OpenFlow (OpenFlow is a network communication protocol that belongs to the data link layer and can control the forwarding plane of online switches or routers, thereby changing the network path taken by network data packets), NETCONF (Network Configuration Protocol), SSH (Secure Shell), etc. Northbound interfaces, southbound interfaces, etc. are independent modules, which are easy to modify.
[0058] Reference Figure 1 , shows a network architecture diagram of an embodiment of the present application. It should be noted that, Figure 1 The network architecture shown is only for illustration and is not intended to limit the embodiments of the present application. In actual applications, there may be more or fewer network elements.
[0059] like Figure 1 As shown, the virtual network can be divided into the following layers:
[0060] The first layer is the cloud functional area (equivalent to Figure 1The cloud function part in the cloud is responsible for accessing the external network, including external network traffic, NAS (Network Attached Storage) traffic, dedicated line POP (Point Of Presence), high-speed devices between clouds, VPN devices, etc., and can use multi-active access. The network elements deployed in this area include AGW (Access Gateway), SGW (Serving Gateway), VPNGW (Virtual Private Network Gateway), DCGW (Data Center Gateway), etc. AGW is responsible for publishing public network CIDR (Classless Inter Domain Routing), and SGW is responsible for speed limiting. The network elements in the cloud function area are deployed in a distributed cluster.
[0061] The second layer is the network element service area (equivalent to Figure 1 The network service area in the network element service area provides tenants with network services from layer 3 to layer 7, including dedicated lines, IGW (Internet Gateway), NAT gateway, VPN access, LB (Load Balancer), etc. The network elements in the network element service area are deployed in a distributed cluster.
[0062] The third layer is the resource access layer (equivalent to Figure 1 AZ1 and AZ2 in the diagram) are responsible for providing virtual network access services for VMs (Virtual Machines), containers, and bare metal machines. The network element types are DVRs (Digital Video Recorders) and SmartNICs (Smart Network Interface Controllers).
[0063] Figure 1 In the diagram, leaf represents a leaf node (such as a leaf switch), spine represents a spine node (such as a spine switch), Super-spine represents a super-spine node, dci-leaf represents a data center interconnect leaf node, and b-leaf represents a b-leaf node.
[0064] Reference Figure 2 , shows a control plane architecture diagram of an embodiment of the present application. It should be noted that, Figure 2 The control plane architecture shown is only for illustration and is not intended to limit the embodiments of the present application. In actual applications, there may be more or fewer network elements.
[0065] like Figure 2 As shown in the figure, the control plane architecture can be divided into the following layers:
[0066] Access layer: Deploy VNET (Virtual Network)-API and access layer services (such as gostone), whose functions are access, authentication, authorization, current limiting and fuse functions of cloud network API. Its external API is accessed from here. The current current limiting functions provided include interface-level and tenant-level speed limits. Upstream components can interact with the access layer through HTTP (HyperText Transfer Protocol). Upstream components can include component 1, component 2, component 3 (such as yacos component, gostack component, steel component, etc.), etc., and also include management background. The access layer can interact with the service layer through HTTP.
[0067] Service layer: divided into three parts: monitoring, service governance and business services. The business service part is the core service part, which is generally divided according to the product, including VPC, EIP (Elastic IP), LB, NAT, dedicated line, intranet DNS (Domain Name System), DTC (Data Transmission Control), Inspector, etc. The service governance part includes VNET service discovery, configuration center, VNET service deployment, VNET OPS (Open Programmability System), etc. The monitoring part is mainly responsible for the availability of the business and the statistical reporting of data, including netprobe (network monitoring), network visualization, basic monitoring, log monitoring, etc. The service layer can interact with the storage layer through HTTP / Feign Client (virtual client).
[0068] Storage layer: responsible for data storage services, responsible for storing business data and runtime data. The storage layer can include cache (such as Redis cluster), relational database (such as MySQL master-slave cluster), distributed cluster (such as Kafka cluster), search engine cluster (such as ES (Elasticsearch, search) cluster), key-value storage cluster (such as etcd cluster, etcd cluster is an open source, distributed, reliable key-value storage system for configuration sharing and service discovery), etc.
[0069] The architecture design of the control plane splits the neutron-server (central service) into two parts: server (service) and manager (management). The server is responsible for processing external API requests (mostly writing to the database), and the manager is responsible for synchronizing data with various controllers on the computing nodes (mostly reading from the database). The manager is equipped with a two-level cache to ensure read performance. A group of managers is deployed in each AZ to ensure access efficiency within the AZ, fault isolation, and improve scalability. The manager communicates with various controllers on the computing nodes through HTTP. The message queue nodes are divided into compute nodes, AGW nodes, IGW nodes, LB nodes, VPN nodes, FW (Firewall) nodes, etc. according to their functions. The corresponding types of controllers are deployed on them, and the controller uses cache to save real-time data. The characteristics of this design are: controllable business, scalable services, high performance, full distribution, and support for a large number of business nodes.
[0070] Above Figure 1 AZ1 and AZ2 in the Figure 2 The business service part may involve the traffic mirroring method in the embodiment of the present application.
[0071] Traffic mirroring concepts include:
[0072] Mirror Source: The elastic network card that needs to mirror the network traffic;
[0073] Mirror Target: The ENIC that receives the mirrored network traffic.
[0074] Traffic Mirror Session: The process of mirroring network traffic from a source to a destination using specified filter criteria.
[0075] Filter conditions (Mirror Filter): Contains inbound and outbound rules, used to filter the network traffic mirrored in the mirroring session;
[0076] Inbound rules and outbound rules: contain five-tuple information and collection / non-collection (i.e., mirroring / non-mirroring) action types. The five-tuple information may include mirroring source address, mirroring source port, mirroring destination address, mirroring destination port, and protocol type.
[0077] Reference Figure 3 , shows an application environment architecture diagram of an embodiment of the present application. The traffic mirroring method in the embodiment of the application is applied to Figure 3In the application environment architecture shown in the figure, it should be noted that Figure 3 The application environment architecture shown is only for illustration and is not intended to limit the embodiments of the present application. In actual applications, there may be more or fewer network elements.
[0078] like Figure 3 As shown, the application environment architecture may include: virtual machine 1, virtual machine 2, service bridge, service network card, service switch, traffic mirroring bridge, traffic mirroring network card, traffic mirroring switch, and traffic analysis system. Among them, the service network traffic of virtual machine 1 and virtual machine 2 can be transmitted based on the path of the service bridge, service network card, and service switch, and the mirrored network traffic can be transmitted based on the path of the service bridge, traffic mirroring bridge, traffic mirroring network card, traffic mirroring switch, and traffic analysis system. The above-mentioned service bridge can be called Bridge1, the traffic mirroring bridge can be called Bridge2, the service network card can be called aggregate network card 1, and the traffic mirroring network card can be called aggregate network card 2.
[0079] In the embodiment of the present application, the above-mentioned Figure 3 The service bridge and traffic mirror bridge in OVS can exchange data with the network controller. The network controller can be an SDN (Software Defined Network) controller, etc.
[0080] The roles of the SDN controller in traffic mirroring can include:
[0081] Separation of control plane and data plane: SDN controllers achieve flexible management and control of network traffic by separating the control plane from the data plane of the network. In traffic mirroring, SDN controllers can centrally control network traffic and achieve refined identification and diversion of traffic.
[0082] Programmatic configuration: SDN controllers support network configuration and management through programming. In traffic mirroring, SDN controllers can dynamically adjust traffic mirroring policies and rules according to business needs to achieve real-time control of network traffic.
[0083] Standardized interfaces: SDN controllers use standardized interfaces for communication and control, allowing devices from different vendors to be seamlessly integrated and interoperable. In traffic mirroring, this helps achieve collaborative work and unified management of multi-vendor devices.
[0084] The functions of OVS in traffic mirroring include:
[0085] Virtual switch: OVS is a high-quality, multi-layer virtual switch that can be used to form a virtual network and implement information exchange between virtual machines. In traffic mirroring, OVS can act as a virtual switch to forward the traffic that needs to be mirrored to the specified target port or device.
[0086] Component composition: OVS is mainly composed of three parts: ovsdb-server (database server), ovs-vswitchd (core component) and ovs kernel module (kernel module). Among them, ovsdb-server is used to store the configuration information of the virtual switch; ovs-vswitchd is responsible for communicating with the upper-level controller and processing data packets; ovs kernelmodule is responsible for processing operations such as packet switching and tunneling.
[0087] OpenFlow support: OVS supports the OpenFlow protocol and can communicate and control with the SDN controller. This allows OVS to receive traffic mirroring policies and rules from the SDN controller and perform mirroring operations on network traffic based on these policies and rules.
[0088] VXLAN (Virtual eXtensible Local Area Network, extensible virtual local area network) support: OVS also supports VXLAN technology, which can build cross-domain cluster sharing to implement audit security resource pools. In traffic mirroring, this helps to achieve cross-domain traffic mirroring and auditing.
[0089] In summary, the SDN controller and OVS work together in traffic mirroring. The SDN controller provides global network control and management capabilities, while OVS acts as a virtual switch to implement specific traffic forwarding and mirroring operations. Through the collaborative work of the SDN controller and OVS, refined identification, diversion, and mirroring of network traffic can be achieved, providing strong support for network security auditing and troubleshooting.
[0090] Reference Figure 4 , shows a flow chart of the steps of a traffic mirroring method in an embodiment of the present application. Figure 4 The traffic mirroring method shown is applied to a network controller, the network controller interacts with a virtual switch for data, and a service bridge and a traffic mirroring bridge are created in the virtual switch.
[0091] like Figure 4 As shown, the traffic mirroring method may include the following steps:
[0092] Step 401, the network controller generates a first flow table corresponding to the traffic mirroring service, and sends the first flow table to the service bridge, wherein the first flow table is used to instruct the service bridge to copy the network traffic of the mirroring source to obtain the first mirrored network traffic, and forward the first mirrored network traffic to the traffic mirroring bridge.
[0093] The network controller can control the forwarding of network traffic by sending flow tables to the virtual switch. The flow table in traffic mirroring is an important component of the virtual switch for implementing traffic replication and forwarding. By configuring the flow table, you can flexibly define which network traffic needs to be mirrored and how to handle the mirrored network traffic.
[0094] In the embodiment of the present application, since a service bridge and a traffic mirroring bridge are created in the virtual switch, the traffic mirroring service is divided into two bridges, the service bridge and the traffic mirroring bridge, for execution. Therefore, the network controller can send flow tables to the service bridge and the traffic mirroring bridge respectively to instruct the service bridge and the traffic mirroring bridge to perform corresponding operations respectively.
[0095] In an embodiment of the present application, the network controller may generate a first flow table corresponding to the traffic mirroring service, and send the first flow table to the service bridge. The first flow table is used to instruct the service bridge to copy the network traffic of the mirror source to obtain the first mirrored network traffic, and forward the first mirrored network traffic to the traffic mirroring bridge.
[0096] Exemplarily, the first flow table may include mirror source information, mirror action type, transmission port information, etc. Among them, the mirror source information may include a mirror source address and a mirror source port, the mirror action type refers to the action type being mirror, and the transmission port information may include a transmission port between a service bridge and a traffic mirror bridge. Of course, the first flow table may also include other information, such as a protocol type, etc., which is not limited in this embodiment.
[0097] Step 402: The network controller generates a second flow table corresponding to the traffic mirroring service, and sends the second flow table to the traffic mirroring bridge. The second flow table is used to instruct the traffic mirroring bridge to filter out the second mirrored network traffic from the first mirrored network traffic, and forward the second mirrored network traffic to the traffic mirroring switch via the traffic mirroring network card.
[0098] In an embodiment of the present application, the network controller can generate a second flow table corresponding to the traffic mirroring service, and send the second flow table to the traffic mirroring bridge. The second flow table is used to instruct the traffic mirroring bridge to filter out the second mirroring network traffic from the first mirroring network traffic, and forward the second mirroring network traffic to the traffic mirroring switch via the traffic mirroring network card.
[0099] Exemplarily, the second flow table may include screening conditions, mirror destination information, and the like. Among them, the screening conditions may include inbound rules and outbound rules. The inbound rules and outbound rules may include five-tuple information and collection / non-collection (i.e., mirroring / non-mirroring) action types. The five-tuple information may include a mirror source address, a mirror source port, a mirror destination address, a mirror destination port, and a protocol type. The mirror destination information may include a mirror destination address and a mirror destination port. Of course, the second flow table may also include other information, which is not limited in this embodiment.
[0100] Reference Figure 5 , shows a step flow chart of another traffic mirroring method according to an embodiment of the present application. Figure 1 The traffic mirroring method shown is applied to a virtual switch, the virtual switch interacts with a network controller for data, and a service bridge and a traffic mirroring bridge are created in the virtual switch.
[0101] like Figure 5 As shown, the traffic mirroring method may include the following steps:
[0102] Step 501: The virtual switch receives a first flow table sent by a network controller through a service bridge, copies the network traffic of the mirror source according to the first flow table to obtain first mirrored network traffic, and forwards the first mirrored network traffic to the traffic mirroring bridge.
[0103] After receiving the first flow table sent by the network controller through the service bridge, the virtual switch copies the network traffic of the mirror source according to the first flow table to obtain the first mirror network traffic, and forwards the first mirror network traffic to the traffic mirror bridge.
[0104] In an optional implementation, the process of copying the network traffic of the mirror source according to the first flow table to obtain the first mirror network traffic, and forwarding the first mirror network traffic to the traffic mirror bridge may include: copying the network traffic of the mirror source according to the mirror source information and the mirror action type contained in the first flow table to obtain the first mirror network traffic; and forwarding the first mirror network traffic to the traffic mirror bridge according to the transmission port information contained in the first flow table.
[0105] In the embodiment of the present application, in order to realize the interaction between the service bridge and the traffic mirroring bridge, a port for interconnecting the service bridge and the traffic mirroring bridge may be created.
[0106] The process of creating a port for interconnecting the service bridge and the traffic mirroring bridge can be represented as follows, where bridge1 represents the service bridge and bridge2 represents the traffic mirroring bridge:
[0107] ovs-vsctl add-br bridge2; create a bridge (network bridge) named bridge2
[0108] ovs-vsctl add-port bridge2 patch-to-bridge2-in; add an inline port to bridge2, the port name is patch-to-bridge2-in
[0109] ovs-vsctl set interface bridge2 type=patch options:peer=patch-to-bridge2-in;
[0110] Set the attribute of patch-to-bridge2-in to patch, and set bridge2 to be associated with patch-to-bridge2-in
[0111] ovs-vsctl add-port bridge1 patch-to-bridge2-in; add an inline port to bridge1, the port name is patch-to-bridge2-in
[0112] ovs-vsctl set interface patch-to-bridge2-in type=patch options:peer=bridge2;
[0113] Set the attribute of patch-to-bridge2-in to patch, and set patch-to-bridge2-in to be associated with bridge2
[0114] ovs-vsctl add-port bridge1 patch-to-bridge1-out; add an inline port to bridge1, the port name is patch-to-bridge1-out
[0115] ovs-vsctl set interface bridge1 type=patch options:peer=patch-to-bridge1-out;
[0116] Set the attribute of patch-to-bridge1-out to patch, and set bridge2 to patch-to-bridge2-in
[0117] ovs-vsctl add-port bridge1 patch-to-bridge1-out; add an inline port to bridge1, the port name is patch-to-bridge1-out
[0118] ovs-vsctl set interface patch-to-bridge1-out type=patch options:peer=bridge1; Set the attribute of patch-to-bridge1-out to patch, and set patch-to-bridge1-out to be associated with bridge1
[0119] For example, the first flow table may be in the form of:
[0120] table=0, tcp, in_port=vxlan0, nw_src=3.3.3.28 actions=clone(output:patch_br1_to_br2)gototable: 10
[0121] Among them, table indicates the flow table number, tcp (Transmission Control Protocol) indicates the protocol type, in_port indicates the inbound port number, nw_src indicates the source IP address, actions indicates the action type, clone indicates the mirroring (i.e. copying) action, br1 indicates bridge1, and br2 indicates bridge2. This flow table means that a copy of the traffic with source IP address 3.3.3.28 is sent from bridge1 to bridge2 through the patch port.
[0122] Step 502: The virtual switch receives the first mirrored network traffic sent by the service bridge through the traffic mirroring bridge, and receives the second flow table issued by the network controller through the traffic mirroring bridge, filters out the second mirrored network traffic from the first mirrored network traffic according to the second flow table, and forwards the second mirrored network traffic to the traffic mirroring switch via the traffic mirroring network card.
[0123] After receiving the first mirrored network traffic sent by the service bridge through the traffic mirroring bridge and receiving the second flow table sent by the network controller through the traffic mirroring bridge, the virtual switch filters out the second mirrored network traffic from the first mirrored network traffic according to the second flow table, and forwards the second mirrored network traffic to the traffic mirroring switch via the traffic mirroring network card.
[0124] In an optional implementation, the process of filtering out the second mirrored network traffic from the first mirrored network traffic according to the second flow table, and forwarding the second mirrored network traffic to the traffic mirrored switch via the traffic mirrored network card may include: filtering out the second mirrored network traffic from the first mirrored network traffic according to the filtering conditions contained in the second flow table; and forwarding the second mirrored network traffic to the traffic mirrored switch via the traffic mirrored network card according to the mirrored destination information contained in the second flow table. The second mirrored network traffic refers to the mirrored network traffic that meets the filtering conditions in the first mirrored network traffic.
[0125] The network controller sends the second flow table to the traffic mirroring bridge. The traffic mirroring bridge matches the first mirrored network traffic according to the egress and ingress rules defined in the screening conditions in the second flow table. If a match is found, the traffic mirroring bridge forwards this part of the traffic and forwards it to a separate physical network card traffic mirroring network card on the computing node through VXLAN encapsulation. The destination address is the probe of the traffic analysis system set by the customer. The probe is deployed on a dedicated traffic mirroring switch and connected to the customer's traffic analysis system.
[0126] The screening process can be expressed as follows:
[0127] proto src_cidr src_port dst_cidr dst_port priority action(match ornot match); Set the source address, source port, destination address, destination port, protocol number, and perform a match or non-match action
[0128] ovs-ofctl-O Openflow15 add-flow bridge2 "table = 0, priority = 50, in_port = 1, actions = goto_table = 5"; Use the Openflow15 protocol to add a flow table to bridge2, set table0 priority to 50, inbound port to 1, and jump to flow table 5
[0129] ovs-ofctl-O Openflow15 add-flow bridge2 "table = 0, priority = 10, actions = goto_table: 200"; add the flow table to bridge2 through the Openflow15 protocol, and jump the action to flow table 200
[0130] ovs-ofctl-O Openflow15 add-flow bridge2 "table = 5, priority = 50, ip, nw_dst = bridge2 actions = set_filter: bridge2->nw_dst, goto_table: 10"; Use the Openflow15 protocol to set the flow table for bridge2 and set forwarding rules
[0131] ovs-ofctl-O Openflow15 add-flow bridge2 "table = 10, priority = 50, actions = set_field: fa: 16: 3e: 85: e0: b7-> eth_dst, output: 2; Use the Openflow15 protocol to add the flow table to bridge2, set the target MAC address, and forward to port 2
[0132] In the embodiment of the present application, traffic mirroring service is performed through a separate traffic mirroring bridge, a traffic mirroring network card and a traffic mirroring switch, thereby achieving isolation between the traffic mirroring service and the customer service, so that the traffic mirroring service and the user service do not affect each other, thereby ensuring that the traffic mirroring service and the customer service can run normally and smoothly under large traffic conditions, thereby improving the rationality of the traffic mirroring process.
[0133] For example, in Figure 3 In the architecture shown, when it is necessary to mirror the traffic of virtual machine 1, virtual machine 1 is the mirror source, and the network controller sends a first flow table to the service bridge connected to the mirror source. After receiving the first flow table, the service bridge copies the network traffic of virtual machine 1 to obtain the first mirror network traffic, and the service bridge sends the first mirror network traffic to the traffic mirror bridge. The network controller sends a second flow table to the traffic mirror bridge connected to the service bridge. After receiving the second flow table, the traffic mirror bridge filters out the second mirror network traffic from the first mirror network traffic according to the screening conditions in the second flow table, and the traffic mirror bridge sends the second mirror network traffic to the traffic mirror network card, and then the traffic mirror network card sends the second mirror network traffic to the traffic mirror switch, and then the traffic mirror switch sends the second mirror network traffic to the traffic analysis system, and the traffic analysis system performs subsequent analysis and processing on the second mirror network traffic.
[0134] In the embodiment of the present application, the number of flow tables is considered to be a key factor limiting the scalability of the cluster. If a flow table entry is set for each business instance running on the cluster, the performance, scalability and maintainability of the cluster network will be greatly affected. As for the business system, the interaction between the business instance on a single node and the business instance on other nodes is actually very limited, so more than 80% of the flow table entries are actually unnecessary. Therefore, the network controller in the embodiment of the present application adopts a design of generating flow tables on demand, that is, only a small number of default flow tables are included at startup. As the business instance started on the node begins to establish a network connection with other entities, the flow table is established; as the business instance disappears, the flow table is deleted. This design greatly improves the scalability of the cluster and the flow table query performance of a single node, and also has a good effect on the network convergence of the cluster. Correspondingly, the first message of the network connection will have a millisecond delay in the process of establishing the flow table, and subsequent messages will be quickly forwarded or discarded as the flow table is established.
[0135] Accordingly, in an optional implementation, the process of the network controller generating a first flow table corresponding to the traffic mirroring service may include: generating the first flow table corresponding to the traffic mirroring service when the traffic mirroring service starts. The process of the network controller generating a second flow table corresponding to the traffic mirroring service may include: generating the second flow table corresponding to the traffic mirroring service when the traffic mirroring service starts. That is to say, when the traffic mirroring service is needed, the network controller generates the corresponding flow table again to realize the on-demand generation of the flow table.
[0136] Accordingly, in an optional implementation manner, the network controller may also delete the first flow table and the second flow table after the traffic mirroring service ends, so that the network controller can clear useless flow tables in time.
[0137] Accordingly, in an optional implementation, the virtual switch may also delete the first flow table after the service bridge forwards the first mirror network traffic to the traffic mirror bridge. The virtual switch may also delete the second flow table after the traffic mirror bridge forwards the second mirror network traffic to the traffic mirror switch via the traffic mirror network card, so that the virtual switch can clear useless flow tables in a timely manner.
[0138] In the embodiment of the present application, considering that the service bridge involves service network traffic forwarding and mirror network traffic forwarding, and service network traffic forwarding has a higher requirement for real-time performance. Therefore, in an optional implementation, the virtual switch can also configure the service network traffic forwarding priority and the mirror network traffic forwarding priority in the service bridge, and the service network traffic forwarding priority is higher than the mirror network traffic forwarding priority.
[0139] In the embodiment of the present application, two physical aggregation network cards are bound respectively through two bridges, that is, the service bridge is bound to the service network card, and the traffic mirroring bridge is bound to the traffic mirroring network card, so that the mirrored network traffic and the service network traffic are respectively passed through different physical network cards, and the mirrored network traffic will not affect the forwarding of the service network traffic. At the same time, the priority of the service network traffic forwarding of the service bridge is increased at the bottom layer, so that the forwarding of the service network traffic can be guaranteed first. In addition, the screening of the mirrored network traffic is all performed on the traffic mirroring bridge, so that the number of flow tables on the service bridge can be reduced, the pressure on the flow table on the service bridge can be reduced, and the matching efficiency of the service traffic can be increased, thereby ensuring the forwarding efficiency and reliability of the service traffic.
[0140] In the embodiment of the present application, the mirrored network traffic is forwarded through a separate traffic mirroring switch, which is separated from the service switch, so that the mirrored network traffic will not affect the service network traffic. For example, if the entire network traffic needs to be mirrored, if the traffic is aggregated to a group of network element servers in the traditional way, a large number of network element servers will be required to handle such a large traffic throughput. By distributing the five-tuple information of the traffic and the collection / non-collection control to a separate traffic mirroring bridge of each computing node, it can be ensured that the traffic mirroring of the entire network will not be aggregated to a group of network element servers to cause traffic congestion, which can greatly save server resources.
[0141] In the embodiment of the present application, the above process can achieve isolation of the traffic mirroring service and the customer's real business in the private cloud through a separate traffic mirroring bridge, traffic mirroring network card, and traffic mirroring switch, so that in the case of large traffic in the private cloud, the traffic mirroring service and the customer's real business do not affect each other, thereby ensuring the normal and smooth operation of the traffic mirroring service and the customer's business.
[0142] Reference Figure 6 , shows a structural block diagram of a virtual switch in an embodiment of the present application. The virtual switch interacts with a network controller for data exchange, and a service bridge and a traffic mirroring bridge are created in the virtual switch.
[0143] like Figure 6 As shown, a virtual switch may include the following modules:
[0144] The first processing module 601 is used to receive the first flow table sent by the network controller through the service bridge, and copy the network traffic of the mirror source according to the first flow table to obtain the first mirror network traffic, and forward the first mirror network traffic to the traffic mirror bridge;
[0145] The second processing module 602 is used to receive the first mirrored network traffic sent by the business bridge through the traffic mirroring bridge, and receive the second flow table issued by the network controller through the traffic mirroring bridge, filter out the second mirrored network traffic from the first mirrored network traffic according to the second flow table, and forward the second mirrored network traffic to the traffic mirroring switch via the traffic mirroring network card.
[0146] Optionally, the first processing module 601 includes: a copying unit, used to copy the network traffic of the mirror source according to the mirror source information and the mirror action type contained in the first flow table to obtain the first mirror network traffic; a first forwarding unit, used to forward the first mirror network traffic to the traffic mirroring bridge according to the transmission port information contained in the first flow table.
[0147] Optionally, the virtual switch further includes: a creation module, configured to create a port for interconnecting the service bridge and the traffic mirroring bridge.
[0148] Optionally, the second processing module 602 includes: a screening unit, used to screen out the second mirrored network traffic from the first mirrored network traffic according to the screening conditions contained in the second flow table; and a second forwarding unit, used to forward the second mirrored network traffic to the traffic mirroring switch via the traffic mirroring network card according to the mirroring destination information contained in the second flow table.
[0149] Optionally, the virtual switch also includes: a first deletion module, used to delete the first flow table after the first processing module 601 forwards the first mirrored network traffic to the traffic mirroring bridge; a second deletion module, used to delete the second flow table after the second processing module 602 forwards the second mirrored network traffic to the traffic mirroring switch via the traffic mirroring network card.
[0150] Optionally, the virtual switch further includes: a configuration module, used to configure a service network traffic forwarding priority and a mirror network traffic forwarding priority in the service bridge, wherein the service network traffic forwarding priority is higher than the mirror network traffic forwarding priority.
[0151] Reference Figure 7 , shows a structural block diagram of a network controller according to an embodiment of the present application. The network controller interacts with a virtual switch for data exchange, and a service bridge and a traffic mirroring bridge are created in the virtual switch.
[0152] like Figure 7 As shown, the network controller may include the following modules:
[0153] A first generating module 701 is used to generate a first flow table corresponding to the traffic mirroring service, and send the first flow table to the service bridge, wherein the first flow table is used to instruct the service bridge to copy the network traffic of the mirroring source to obtain the first mirrored network traffic, and forward the first mirrored network traffic to the traffic mirroring bridge;
[0154] The second generation module 702 is used to generate a second flow table corresponding to the traffic mirroring service, and send the second flow table to the traffic mirroring bridge. The second flow table is used to instruct the traffic mirroring bridge to filter out the second mirrored network traffic from the first mirrored network traffic, and forward the second mirrored network traffic to the traffic mirroring switch via the traffic mirroring network card.
[0155] Optionally, the first generation module 701 is specifically used to generate a first flow table corresponding to the traffic mirroring service when the traffic mirroring service starts; the second generation module 702 is specifically used to generate a second flow table corresponding to the traffic mirroring service, including: generating a second flow table corresponding to the traffic mirroring service when the traffic mirroring service starts.
[0156] Optionally, the network controller further includes: a third deleting module, configured to delete the first flow table and the second flow table after the traffic mirroring service ends.
[0157] In the embodiment of the present application, traffic mirroring service is performed through a separate traffic mirroring bridge, a traffic mirroring network card and a traffic mirroring switch, thereby achieving isolation between the traffic mirroring service and the customer service, so that the traffic mirroring service and the user service do not affect each other, thereby ensuring that the traffic mirroring service and the customer service can run normally and smoothly under large traffic conditions, thereby improving the rationality of the traffic mirroring process.
[0158] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0159] In an embodiment of the present application, an electronic device is also provided. The electronic device may include a processor and a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium; when the computer program is executed by the processor, the processor executes the traffic mirroring method of any of the above embodiments.
[0160] Reference Figure 8 , shows a structural block diagram of an electronic device according to an embodiment of the present application. Figure 8 As shown, the electronic device 80 includes a processor 801 and a computer-readable storage medium 802 , on which a computer program 8021 is stored.
[0161] The processor 801 is used to execute a computer program 8021 stored on a computer-readable storage medium 802. When the processor 801 executes the computer program 8021, it implements the traffic mirroring method of any of the above embodiments and can achieve the same technical effect. To avoid repetition, it is not repeated here.
[0162] The processor 801 mentioned above may include but is not limited to: a central processing unit (CPU), a network processor (NP), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0163] The computer-readable storage medium 802 mentioned above may include but is not limited to: read-only memory (ROM), random access memory (RAM), compact disc read-only memory (CD-ROM), electronic erasable programmable read-only memory (EEPROM), hard disk, floppy disk, flash memory, etc.
[0164] In an embodiment of the present application, a computer-readable storage medium is further provided, on which a computer program is stored. The computer program can be executed by a processor of an electronic device. When the computer program is executed by the processor, the processor executes the traffic mirroring method described in any of the above embodiments.
[0165] Reference Fig. 9 , shows a block diagram of a computer-readable storage medium according to an embodiment of the present application. Fig. 9 As shown, a computer program 901 is stored on a computer-readable storage medium 90. When the computer program 901 is executed by a processor, the processor executes the traffic mirroring method described in any of the above embodiments and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0166] The various embodiments in this specification are interrelated, and each embodiment is described in a progressive manner. Each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referenced to each other.
[0167] It should be noted that all actions of acquiring signals, information or data in this application are carried out in compliance with the relevant data protection laws and policies of the country where they are located and with the authorization given by the owner of the corresponding device.
[0168] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0169] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.
[0170] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
[0171] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0172] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0173] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0174] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0175] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0176] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. In summary, the content of this specification should not be understood as limiting the present application.
Claims
1. A traffic mirroring method, It is characterized in that Applied to a virtual switch, the virtual switch interacts with a network controller for data exchange, and a service bridge and a traffic mirroring bridge are created in the virtual switch; the method comprises: Receiving the first flow table sent by the network controller through the service bridge, and copying the network traffic of the mirror source according to the first flow table to obtain the first mirror network traffic, and forwarding the first mirror network traffic to the traffic mirror bridge; The first mirrored network traffic sent by the business bridge is received through the traffic mirroring bridge, and the second flow table issued by the network controller is received through the traffic mirroring bridge, the second mirrored network traffic is filtered out from the first mirrored network traffic according to the second flow table, and the second mirrored network traffic is forwarded to the traffic mirroring switch via the traffic mirroring network card.
2. The method according to claim 1, It is characterized in that Copying the network traffic of the mirror source according to the first flow table to obtain first mirror network traffic, and forwarding the first mirror network traffic to the traffic mirror bridge, including: According to the mirror source information and the mirror action type included in the first flow table, copy the network traffic of the mirror source to obtain the first mirror network traffic; The first mirrored network traffic is forwarded to the traffic mirroring bridge according to the transmission port information included in the first flow table.
3. The method according to claim 1, It is characterized in that Before receiving the first flow table sent by the network controller through the service bridge, the method further includes: A port for interconnecting the service bridge and the traffic mirroring bridge is created.
4. The method according to claim 1, It is characterized in that Filtering out second mirrored network traffic from the first mirrored network traffic according to the second flow table, and forwarding the second mirrored network traffic to the traffic mirrored switch via the traffic mirrored network card, including: Filtering the second mirrored network traffic from the first mirrored network traffic according to the filtering condition included in the second flow table; According to the mirroring destination information included in the second flow table, the second mirrored network traffic is forwarded to the traffic mirroring switch via the traffic mirroring network card.
5. The method according to claim 1, It is characterized in that After forwarding the first mirror network traffic to the traffic mirror bridge, the method further includes: deleting the first flow table; After forwarding the second mirror network traffic to the traffic mirror switch via the traffic mirror network card, the method further includes: deleting the second flow table.
6. The method according to claim 1, It is characterized in that Before receiving the first flow table sent by the network controller through the service bridge, the method further includes: The service network traffic forwarding priority and the mirror network traffic forwarding priority in the service bridge are configured, and the service network traffic forwarding priority is higher than the mirror network traffic forwarding priority.
7. A traffic mirroring method, It is characterized in that Applied to a network controller, the network controller interacts with a virtual switch for data exchange, and a service bridge and a traffic mirroring bridge are created in the virtual switch; the method comprises: Generate a first flow table corresponding to the traffic mirroring service, and send the first flow table to the service bridge, wherein the first flow table is used to instruct the service bridge to copy the network traffic of the mirroring source to obtain the first mirrored network traffic, and forward the first mirrored network traffic to the traffic mirroring bridge; Generate a second flow table corresponding to the traffic mirroring service, and send the second flow table to the traffic mirroring bridge, wherein the second flow table is used to instruct the traffic mirroring bridge to filter out the second mirroring network traffic from the first mirroring network traffic, and forward the second mirroring network traffic to the traffic mirroring switch via the traffic mirroring network card.
8. The method according to claim 7, It is characterized in that Generating a first flow table corresponding to the traffic mirroring service, comprising: generating a first flow table corresponding to the traffic mirroring service when the traffic mirroring service starts; Generating a second flow table corresponding to the traffic mirroring service includes: generating a second flow table corresponding to the traffic mirroring service when the traffic mirroring service starts.
9. The method according to claim 7, It is characterized in that The method further comprises: After the traffic mirroring service ends, the first flow table and the second flow table are deleted.
10. A virtual switch, It is characterized in that The virtual switch interacts with the network controller for data exchange, and a service bridge and a traffic mirroring bridge are created in the virtual switch; the virtual switch includes: A first processing module is used to receive a first flow table issued by the network controller through the service bridge, and copy the network traffic of the mirror source according to the first flow table to obtain a first mirror network traffic, and forward the first mirror network traffic to the traffic mirror bridge; The second processing module is used to receive the first mirrored network traffic sent by the business bridge through the traffic mirroring bridge, and receive the second flow table issued by the network controller through the traffic mirroring bridge, filter out the second mirrored network traffic from the first mirrored network traffic according to the second flow table, and forward the second mirrored network traffic to the traffic mirroring switch via the traffic mirroring network card.
11. A network controller, It is characterized in that The network controller interacts with the virtual switch for data exchange, and a service bridge and a traffic mirroring bridge are created in the virtual switch; the network controller includes: A first generation module is used to generate a first flow table corresponding to the traffic mirroring service, and send the first flow table to the service bridge, wherein the first flow table is used to instruct the service bridge to copy the network traffic of the mirroring source to obtain the first mirrored network traffic, and forward the first mirrored network traffic to the traffic mirroring bridge; The second generation module is used to generate a second flow table corresponding to the traffic mirroring service, and send the second flow table to the traffic mirroring bridge. The second flow table is used to instruct the traffic mirroring bridge to filter out the second mirroring network traffic from the first mirroring network traffic, and forward the second mirroring network traffic to the traffic mirroring switch via the traffic mirroring network card.
12. An electronic device, It is characterized in that The electronic device includes a processor and a computer-readable storage medium, and a computer program is stored on the computer-readable storage medium; when the computer program is executed by the processor, the processor executes the traffic mirroring method according to any one of claims 1 to 6, or executes the traffic mirroring method according to any one of claims 7 to 9.
13. A computer-readable storage medium, It is characterized in that A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the processor executes the traffic mirroring method according to any one of claims 1 to 6, or executes the traffic mirroring method according to any one of claims 7 to 9.
Citation Information
Patent Citations
SDN-based remote flow mirroring control method, implementation method and related equipment
CN108429652A
Open vSwitch-based OpenStack cloud platform virtual probe mirroring method
CN108494657A
Traffic mirroring method and device, virtual machine platform and storage medium
CN112235158A
Flow processing method and device
CN113098787A
Network traffic unvarnished transmission method and device based on cloud platform, and storage medium
CN113726637A
Cited By
Distributed flow mirror image acquisition method realized based on ovs flow table and VXLAN protocol
CN119484554A
Simulation environment construction method and device based on cloud native, medium and equipment
CN119603363A
Distributed virtual machine network traffic auditing method and system
CN119966903A
