WO2021012601A1 - Message processing method and device, apparatus, and readable storage medium - Google Patents

Message processing method and device, apparatus, and readable storage medium Download PDF

Info

Publication number
WO2021012601A1
WO2021012601A1 PCT/CN2019/126996 CN2019126996W WO2021012601A1 WO 2021012601 A1 WO2021012601 A1 WO 2021012601A1 CN 2019126996 W CN2019126996 W CN 2019126996W WO 2021012601 A1 WO2021012601 A1 WO 2021012601A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
target
pipeline
control message
container
Prior art date
Application number
PCT/CN2019/126996
Other languages
French (fr)
Chinese (zh)
Inventor
丁瑞
卢华
朱伏生
张继栋
Original Assignee
广东省新一代通信与网络创新研究院
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 广东省新一代通信与网络创新研究院 filed Critical 广东省新一代通信与网络创新研究院
Publication of WO2021012601A1 publication Critical patent/WO2021012601A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/70Virtual switches

Definitions

  • the present invention relates to the field of communication technology, and in particular to a message processing method, device, equipment and readable storage medium.
  • programmable switches have been greatly applied in cloud data centers, network slicing, etc. They have the ability to flexibly define the data processing flow of forwarding equipment and are independent of the forwarding equipment protocol. Features such as forwarding and device independence.
  • the change process of traditional network equipment is usually when the user finds that the current equipment of the network service deployment cannot be supported, the demand is fed back to the equipment manufacturer. The equipment manufacturer will consider the user’s purchase scale, whether the hardware supports the function, etc. It takes months or even years to release a solution, which cannot meet the requirements of rapid business iteration in the Internet era.
  • the interfaces in the existing switches are often not fully utilized due to various reasons, and there is a lot of waste. Therefore, how to improve the utilization rate of programmable switches has become a technical problem to be solved urgently.
  • the main purpose of the present invention is to provide a message processing method, device, equipment, and readable storage medium, which aims to solve the technical problem of how to improve the utilization rate of the programmable switch.
  • the present invention provides a message processing method, the message processing method includes:
  • the control message is sent from the target pipeline where the control message is located to the target container, so that the target container can perform protocol processing on the control message, wherein
  • the target container is a container where the virtual interface corresponding to the target pipeline where the control message is located is located.
  • the method includes:
  • the forwarding table on the target pipeline where the business message is located is obtained, and based on the forwarding table, the business message is placed on the target pipeline where the business message is located.
  • the target pipeline is issued.
  • the step of sending the service message in the target pipeline where the service message is located based on the forwarding table includes:
  • the step of sending the control message from the target pipeline where the control message is located to the target container includes:
  • the control message is sent from the target pipeline where the control message is located to the CPU interface, and the control message is delivered to the target container through the CPU interface.
  • the step of sending the control message from the target pipeline where the control message is located to the CPU interface, and transferring the control message to the target container through the CPU interface includes:
  • the control message is sent from the target physical port to the CPU interface, and the control message is transferred to the virtual interface corresponding to the target physical port through the CPU interface, and the target physical port corresponds to The virtual interface of the transfer the control message to the target container.
  • the present invention also provides a message processing device, the message processing device includes:
  • a mapping module which is used to map the physical ports of each pipeline planned in advance to a virtual interface, and add the virtual interface to the container corresponding to the virtual interface;
  • the detection module is used to determine the target pipeline of the received message in each of the pipelines, and detect whether the message in each of the target pipelines is a control message, wherein the message includes a control message and a service message Text
  • the sending module is configured to send the control message from the target pipeline where the control message is located to the target container if the message is a control message, so that the target container can respond to the control message Protocol processing is performed, wherein the target container is a container where the virtual interface corresponding to the target pipeline where the control message is located is located.
  • the message processing device further includes:
  • the acquiring module is configured to, if the message in the target pipeline is a business message, acquire the forwarding table of the target pipeline where the business message is located, and place the business message in the forwarding table based on the forwarding table.
  • the target pipeline where the business message is located is sent out.
  • the message processing device further includes:
  • the sending module is configured to obtain routing information corresponding to the service message in the forwarding table, and send the service message from the target pipeline where the service message is located according to the routing information.
  • the present invention also provides a message processing device
  • the message processing device includes: a memory, a processor, and a computer program stored on the memory and running on the processor, wherein:
  • the present invention also provides a computer storage medium
  • a computer program is stored on the computer storage medium, and when the computer program is executed by a processor, the steps of the message processing method described above are realized.
  • the present invention maps the physical ports of each pipeline planned in advance to virtual interfaces, and adds the virtual interface to the container corresponding to the virtual interface; determines the target pipeline that receives the message in each pipeline, and detects Whether the message in each target pipeline is a control message, where the message includes a control message and a service message; if the message is a control message, the control message is sent from all
  • the target pipeline in which the control message is located is sent to a target container for the target container to perform protocol processing on the control message, wherein the target container is the virtual interface corresponding to the target pipeline in which the control message is located The container it is in.
  • a programmable switch By first mapping the physical ports on each pipeline to a virtual interface when receiving a message, and when the target pipeline receives the message, and when it is determined that the message is a control message, the control message is sent to the target container .
  • a programmable switch can be virtualized into multiple logical switches, so that users do not need to purchase any additional services or products, which greatly improves the utilization rate of the switch itself, and also brings convenience to the network design.
  • Multiple network functions can be deployed in fusion, which greatly reduces the user's capital expenditure and operating costs, and solves the technical problem of low utilization of programmable switches in the prior art.
  • Figure 1 is a schematic diagram of the terminal ⁇ device structure of the hardware operating environment involved in the solution of the embodiment of the present invention
  • FIG. 3 is a schematic diagram of functional modules of the message processing device of the present invention.
  • FIG. 4 is a physical structure diagram of the programmable switch of the message processing method of the present invention.
  • Figure 5 is an internal schematic diagram of the programmable switch of the message processing method of the present invention.
  • Fig. 6 is a schematic flowchart of a message processing method of the present invention.
  • Figure 7 is an application scenario diagram of the message processing method of the present invention.
  • Fig. 8 is a schematic diagram of a scene of a message processing method of the present invention.
  • Fig. 1 is a schematic diagram of a terminal structure of a hardware operating environment involved in a solution of an embodiment of the present invention.
  • the terminal in the embodiment of the present invention is an electronic device.
  • the terminal may include a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002.
  • the communication bus 1002 is used to implement connection and communication between these components.
  • the user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface.
  • the network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
  • the memory 1005 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as a magnetic disk memory.
  • the memory 1005 may also be a storage device independent of the foregoing processor 1001.
  • the terminal may also include a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, and so on.
  • sensors such as light sensors, motion sensors and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, where the ambient light sensor can adjust the brightness of the display screen according to the brightness of the ambient light, and the proximity sensor can turn off the display screen and/or when the terminal device is moved to the ear Backlight.
  • the terminal device can also be equipped with other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc., which will not be repeated here.
  • terminal structure shown in FIG. 1 does not constitute a limitation on the terminal, and may include more or fewer components than shown in the figure, or combine some components, or arrange different components.
  • a memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a message processing program.
  • the network interface 1004 is mainly used to connect to the back-end server and communicate with the back-end server;
  • the user interface 1003 is mainly used to connect to the client (user side) and communicate with the client;
  • the processor 1001 can be used to call the message processing program stored in the memory 1005 and perform the following operations:
  • the control message is sent from the target pipeline where the control message is located to the target container, so that the target container can perform protocol processing on the control message, wherein
  • the target container is a container where the virtual interface corresponding to the target pipeline where the control message is located is located.
  • the present invention provides a message processing method.
  • the message processing method includes the following steps:
  • Step S10 Map the physical ports of each pipeline planned in advance to virtual interfaces, and add the virtual interfaces to the containers corresponding to the virtual interfaces;
  • the virtual interface may be a virtual interface after a physical port is mapped.
  • the pipeline that needs to be applied is planned first, and the message to be input and output from the programmable switch is determined, and after planning the various pipelines that need to be applied .
  • the physical ports on these pipelines are mapped to virtual interfaces, and these virtual interfaces are placed in the containers corresponding to the respective pipelines.
  • a pipeline corresponds to only one container, but a container can correspond to multiple pipelines, that is, all virtual interfaces of a pipeline can only be placed in one container, and a container can place all virtual interfaces of multiple pipelines.
  • the interface in a container is fixed to the interface on that assembly line.
  • the role of the container is logical isolation, while the role of the pipeline is physical isolation.
  • the programmable switch can also be divided into two planes: the control plane and the forwarding plane. If you want to achieve one virtual multiple, one physical switch implements multiple logically isolated virtual switches, mainly to implement the control plane Virtualization with forwarding plane. And each pipeline (pipeline) of the programmable chip in the programmable switch can be regarded as an independent forwarding plane. There is a running protocol stack in the container, each container is an independent network name space, and each container can be the control plane of a complete protocol stack.
  • the physical structure of a programmable switch includes a control plane and a forwarding plane.
  • the control plane includes operating system, virtual interface, CPU, container, etc.
  • the forwarding plane includes a programmable chip, a traffic manager, pipeline 1 to pipeline N, and physical ports on each pipeline, and each physical port is divided into inbound and outbound directions.
  • the programmable chip completes the forwarding of data packets by performing "match-action", usually composed of multiple pipelines, each pipeline is divided into ingress (Ingress) and outgoing (Egress), there are multiple pipelines between the incoming and outgoing directions
  • the shared flow management unit is responsible for completing message replication and flow scheduling.
  • Each pipeline can be loaded with different forwarding logic independently.
  • the forwarding logic can be implemented by a specific programming language.
  • a certain port of the switch is fixed to a certain one.
  • the first pipeline is relatively special.
  • a port on the pipeline is connected to the CPU on the local control plane of the switch for sending control messages. This port is a visible interface to the system, similar to an ordinary " Network card", that is, CPU port.
  • the virtual interface is added to the container, and the attribution relationship between the physical port and each pipeline is determined, so the physical port and the virtual interface have a one-to-one correspondence, so each container can correspond to Specific physical port.
  • each container can correspond to Specific physical port.
  • FIG 5 including programmable chips, device drivers, kernels, chip management, protocol agents, control plane 1 to control plane N, there are protocol stacks, protocol plug-ins, virtual interface X, etc. in container 1, and container N There are protocol plug-ins, protocol stacks, virtual interface Y, etc., and each control plane includes a container. Virtualization of the control plane uses containers for lightweight isolation.
  • each container is an independent network name space.
  • Add the required virtual interface to the container so that the control message received from a certain physical port will be received in the container.
  • the routing information is read from the kernel through a protocol plug-in module, and when the routing information changes, the protocol proxy module outside the container is notified to write the forwarding table of the corresponding pipeline outside the container.
  • each pipeline in the programmable chip corresponds to its own
  • the virtual switch that is, pipeline 1 corresponds to virtual switch 1 (that is, control plane 1)
  • pipeline N corresponds to virtual switch N (that is, control plane N)
  • control plane 1 that is, container 1
  • each virtual interface X the control plane N (ie container N) includes a protocol plug-in, a protocol stack, and each virtual interface Y.
  • Step S20 Determine the target pipeline of the received message in each of the pipelines, and detect whether the message in each of the target pipelines is a control message, where the message includes a control message and a service message;
  • the target pipeline may be the pipeline that receives the message.
  • Step S30 if the message is a control message, the control message is sent to the target container from the target pipeline where the control message is located, so that the target container can perform an agreement on the control message Processing, wherein the target container is a container where the virtual interface corresponding to the target pipeline where the control message is located is located.
  • the target container is the container corresponding to the target pipeline. If it is determined that there are control messages in each target pipeline, the control message is passed from the target pipeline where the control message is located to the target container corresponding to the target pipeline, so that the target container can perform the control message on the control message.
  • Protocol processing that is, the protocol stack in the target container performs protocol processing on the control message.
  • each container can be equivalent to a separate virtual switch to implement different protocol processing.
  • the business orchestration module implements the processes of port mapping, forwarding plane initialization, and container creation. For example, as shown in Figure 6.
  • Port mapping is performed according to the service configuration and networking conditions, that is, the physical ports on the pipeline 1 to the pipeline N in the programmable chip are mapped to virtual interfaces, that is, the operation of 1 in the figure. Place each virtual interface in container 1 to container N in turn, and each container runs a protocol stack and a protocol plug-in. Then initialize the forwarding plane where the programmable chip is located. Load the corresponding forwarding logic to the pipeline from the business orchestration, that is, load the forwarding logic 1 to the pipeline 1, and load the forwarding logic N to the pipeline N, which is the operation of 2 in the figure. Then transfer the forwarding logic to the container through the pipeline, that is, the operation in the figure 3, and after the processing in the container is completed, it is output through the pipeline.
  • one pipeline ie pipeline
  • the back-end server selects a consistent hash by stream, similar to a load balancer.
  • the control plane of the access pipeline establishes a neighbor relationship with the external network ingress device through the virtual interface, and at the same time announces routing information for traffic diversion.
  • the back-end service cluster establishes a neighbor relationship with the consistent hash pipeline and announces VIP (ie virtual IP) information.
  • VIP ie virtual IP
  • the consistent hashing pipeline After the consistent hashing pipeline receives the routing announcement, it will form in the local routing table that the same VIP has multiple next hops, and each next hop represents a physical server; it is kept alive through the protocol neighbor relationship Information; if a certain backend server is abnormal, the neighbor relationship will be lost. At this time, there will be one hop less in the routing table, and the protocol plug-in will update the forwarding table of the corresponding pipeline.
  • the access pipeline will establish a neighbor relationship with the consistent hash pipeline through the intranet physical network and announce a specific VIP, which is one of the VIP segments of the cluster and is used for the backhaul of messages.
  • the consistent hash pipeline announces the routing information of the VIP segment to the intranet physical network for traffic diversion.
  • the next hop address information will be queried through the corresponding logic of the control plane, that is, which cluster needs to be sent to, and after the speed limit and billing functions are performed , Encapsulate the message in the tunnel, the outer IP address of the tunnel is the VIP of a certain cluster, and finally sent to the internal physical network.
  • the consistent hashing pipeline performs consistent hashing according to the physical server information under the VIP, thereby selecting a server, and at the same time modifying the outer IP of the tunnel to the address information of the physical server, and sending it to the intranet physical network.
  • the internal physical network finally forwards the message to the corresponding server. Due to the existence of the consistent hashing algorithm, it is guaranteed that when the back-end server is abnormal, only 1/N connections are affected (N is the number of servers in the back-end cluster). At the same time, the consistent hashing algorithm can be selected , Can be well adapted to stateful and stateless applications.
  • the traffic from the physical server is encapsulated with a fixed IP address in the outer layer of the tunnel. This address is the VIP accessing the pipeline, and then sent to the internal physical network.
  • the internal physical network will transfer the traffic to consistency Hash pipeline.
  • the consistent hash pipeline finds the next hop according to the VIP information announced by the access pipeline, and modifies the outer IP of the tunnel to the next hop information, and then sends it to the internal physical network. And after the receiving pipeline receives the outgoing message, it performs decapsulation and sends it to the external network.
  • the physical ports of each pre-planned pipeline are mapped to virtual interfaces, and the virtual interfaces are added to the container corresponding to the virtual interface; the destination of the received message is determined in each pipeline Pipeline, and detect whether the message in each target pipeline is a control message, where the message includes a control message and a service message; if the message is a control message, the control message The message is sent from the target pipeline where the control message is located to a target container for the target container to perform protocol processing on the control message, wherein the target container is corresponding to the target pipeline where the control message is located The container where the virtual interface is located.
  • a programmable switch By first mapping the physical ports on each pipeline to a virtual interface when receiving a message, and when the target pipeline receives the message, and when it is determined that the message is a control message, the control message is sent to the target container .
  • a programmable switch can be virtualized into multiple logical switches, so that users do not need to purchase any additional services or products, which greatly improves the utilization rate of the switch itself, and also brings convenience to the network design.
  • Multiple network functions can be deployed in fusion, which greatly reduces the user's capital expenditure and operating costs, and solves the technical problem of low utilization of programmable switches in the prior art.
  • step S20 of the first embodiment of the present invention After the step of controlling whether the message is a message, it includes:
  • Step a If the message in the target pipeline is a business message, obtain the forwarding table of the target pipeline where the business message is located, and place the business message in the business message based on the forwarding table.
  • the target pipeline where the text is located is issued.
  • the message that is not a control message can be used as a business message, and the transfer on the target pipeline where the business message is located can be obtained.
  • Publish determine the egress port of the target pipeline according to the routing information in the forwarding table, and send business packets from the target pipeline.
  • the forwarding table includes various routing information.
  • each pipeline is provided with its corresponding forwarding table, and in which pipeline a message is received, the message is sent from which pipeline.
  • the service message is directly sent, thereby ensuring the efficiency of the programmable switch message sending.
  • the step of sending the service message in the target pipeline where the service message is located based on the forwarding table includes:
  • Step a1 Obtain routing information corresponding to the service message in the forwarding table, and send the service message from the target pipeline where the service message is located according to the routing information.
  • Each routing information stored in the message table determines the routing information corresponding to the service message, and determines the egress port in the target pipeline according to this routing information, and then sends the business message from the egress port in the target pipeline.
  • the routing information corresponding to the service message is obtained in the forwarding table, and the service message is sent according to the routing information, thereby ensuring the efficiency of the programmable switch message sending.
  • step of sending the control message from the target pipeline where the control message is located to the target container includes:
  • Step b In the target pipeline where the control message is located, obtain the physical port connected to the processor CPU among the physical ports, and use the physical port connected to the CPU as the CPU interface;
  • Step c Send the message from the target pipeline where the control message is located to the CPU interface, and transfer the control message to the target container through the CPU interface.
  • control message can be sent from the target pipeline where the control message is located to the CPU interface, and forwarded to the corresponding virtual interface through the kernel in the CPU, and then the message is passed to the target container through this virtual interface .
  • the step of sending the control message from the target pipeline where the control message is located to the CPU interface and passing the control message to the target container through the CPU interface includes:
  • Step c1 Obtain the target physical port corresponding to the target pipeline where the control message is located, and determine the preset number corresponding to the target physical port, and determine the connection with the target in each virtual interface based on the preset number.
  • each physical interface has a preset number
  • the virtual interface will also have a corresponding number.
  • a sub-interface is established on the interface connected to the CPU, and its id is x; each pipeline needs to be fixed to implement some logic.
  • the tag id is equal to the port number x, and the port can be set as the CPU interface.
  • the kernel will transfer it to the corresponding sub-interface according to the tag id, thus realizing the relationship between the physical port and the virtual interface. Mapping between.
  • the target pipeline obtains the message, first determine whether the message is a control message, and when the message is a control message, determine the physical port of the target pipeline where the control message is located (that is, the target physical port), and According to the preset number corresponding to the ingress port, the virtual interface corresponding to the target physical port is determined in each virtual interface according to the preset number.
  • Step c2 Send the control message from the target physical port to the CPU interface, and transfer the control message to the virtual interface corresponding to the target physical port through the CPU interface, and pass the target The virtual interface corresponding to the physical port transfers the control message to the target container.
  • the control message is sent from the target physical port of the target pipeline where the control message is located to the CPU interface, and the control message is passed to the virtual interface corresponding to the target physical port through the core corresponding to the CPU interface, and the control is controlled through this virtual interface
  • the message is passed to the target container so that the target container can process the control message.
  • the virtual interface is determined by determining the preset number of the target physical port of the target pipeline, and the message is sent to this virtual interface, thereby improving the accuracy of sending the message to the virtual interface.
  • an embodiment of the present invention also provides a message processing device, and the message processing device includes:
  • a mapping module which is used to map the physical ports of each pipeline planned in advance to a virtual interface, and add the virtual interface to the container corresponding to the virtual interface;
  • the detection module is used to determine the target pipeline of the received message in each of the pipelines, and detect whether the message in each of the target pipelines is a control message, wherein the message includes a control message and a service message Text
  • the sending module is configured to send the control message from the target pipeline where the control message is located to the target container if the message is a control message, so that the target container can respond to the control message Protocol processing is performed, wherein the target container is a container where the virtual interface corresponding to the target pipeline where the control message is located is located.
  • the message processing device further includes:
  • the forwarding table on the target pipeline where the business message is located is obtained, and based on the forwarding table, the business message is placed on the target pipeline where the business message is located.
  • the target pipeline is issued.
  • the message processing device further includes:
  • the transfer module is also used to:
  • the control message is sent from the target pipeline where the control message is located to the CPU interface, and the control message is delivered to the target container through the CPU interface.
  • the transfer module is also used to:
  • the control message is sent from the target physical port to the CPU interface, and the control message is transferred to the virtual interface corresponding to the target physical port through the CPU interface, and the target physical port corresponds to The virtual interface of the transfer the control message to the target container.
  • each functional module of the message processing device can refer to the various embodiments of the message processing method of the present invention, which will not be repeated here.
  • the present invention also provides a message processing device.
  • the message processing device includes a memory, a processor, a communication bus, and a message processing program stored on the memory:
  • the communication bus is used to realize connection and communication between the processor and the memory
  • the processor is configured to execute the message processing program to implement the steps of the embodiments of the message processing method described above.
  • the present invention also provides a computer-readable storage medium that stores one or more programs, and the one or more programs may also be executed by one or more processors to implement The steps of each embodiment of the foregoing message processing method.
  • the technical solution of the present invention essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM) as described above. , Magnetic disk, optical disk), including several instructions to make a terminal device (can be a mobile phone, computer, server, air conditioner, or network device, etc.) execute the method described in each embodiment of the present invention.

Abstract

Disclosed by the present invention are a message processing method and device, an apparatus and a readable storage medium. The method comprises: mapping a physical port of each of pre-planned assembly lines as a virtual interface, and adding the virtual interface into a container corresponding to the virtual interface; determining a target assembly line in the assembly lines for receiving messages, and detecting whether a message in the target assembly line is a control message, the messages including control messages and service messages; if the message is a control message, sending the control message from the target assembly line containing the control message to a target container such that the target container performs protocol processing to the control message, the target container being the container where the virtual interface corresponding to the target assembly line containing the control message is located. The present invention improves the use ratio of programmable switches.

Description

报文处理方法、装置、设备及可读存储介质Message processing method, device, equipment and readable storage medium 技术领域Technical field
本发明涉及通信技术领域,尤其涉及一种报文处理方法、装置、设备以及可读存储介质。The present invention relates to the field of communication technology, and in particular to a message processing method, device, equipment and readable storage medium.
背景技术Background technique
随着网络可编程性的概念变得越来越受到关注,可编程交换机在云数据中心、网络切片等方面得到了极大的应用,其具备可灵活定义转发设备数据处理流程、转发设备协议无关转发、设备无关性等特性。相比之下,传统网络设备的变更流程通常是当用户发现网络的业务部署当前设备无法支持时,将需求反馈给设备商,设备商会考虑用户的采购规模、硬件是否支持该功能等因素,可能需要数月甚至数年之后才能发布解决方案,无法满足互联网时代业务快速迭代的要求。而现有的交换机中的接口由于各种原因经常无法完全利用到,存在很大的浪费现象。因此,如何提高可编程交换机的利用率成为了目前亟待解决的技术问题。As the concept of network programmability has become more and more concerned, programmable switches have been greatly applied in cloud data centers, network slicing, etc. They have the ability to flexibly define the data processing flow of forwarding equipment and are independent of the forwarding equipment protocol. Features such as forwarding and device independence. In contrast, the change process of traditional network equipment is usually when the user finds that the current equipment of the network service deployment cannot be supported, the demand is fed back to the equipment manufacturer. The equipment manufacturer will consider the user’s purchase scale, whether the hardware supports the function, etc. It takes months or even years to release a solution, which cannot meet the requirements of rapid business iteration in the Internet era. However, the interfaces in the existing switches are often not fully utilized due to various reasons, and there is a lot of waste. Therefore, how to improve the utilization rate of programmable switches has become a technical problem to be solved urgently.
发明内容Summary of the invention
本发明的主要目的在于提供一种报文处理方法、装置、设备及可读存储介质,旨在解决如何提高可编程交换机的利用率的技术问题。The main purpose of the present invention is to provide a message processing method, device, equipment, and readable storage medium, which aims to solve the technical problem of how to improve the utilization rate of the programmable switch.
为实现上述目的,本发明提供一种报文处理方法,所述报文处理方法包括:To achieve the above objective, the present invention provides a message processing method, the message processing method includes:
将预先规划的各流水线的物理端口映射为虚接口,并将所述虚接口加入至所述虚接口对应的容器;Mapping the physical ports of each pipeline planned in advance to virtual interfaces, and adding the virtual interfaces to the containers corresponding to the virtual interfaces;
在各所述流水线中确定接收到报文的目标流水线,并检测各所述目标流水线中的报文是否为控制报文,其中,所述报文包括控制报文和业务报文;Determine the target pipeline of the received message in each of the pipelines, and detect whether the message in each of the target pipelines is a control message, where the message includes a control message and a service message;
若存在所述报文为控制报文,则将所述控制报文从所述控制报文所在的目标流水线发送至目标容器,以供所述目标容器对所述控制报文进行协议处理,其中所述目标容器为所述控制报文所在的目标流水线对应的所述虚接口 所在的容器。If the message is a control message, the control message is sent from the target pipeline where the control message is located to the target container, so that the target container can perform protocol processing on the control message, wherein The target container is a container where the virtual interface corresponding to the target pipeline where the control message is located is located.
可选地,所述依次检测各所述目标流水线中的报文是否为控制报文的步骤之后,包括:Optionally, after the step of sequentially detecting whether the messages in each of the target pipelines are control messages, the method includes:
若存在所述目标流水线中的报文是业务报文,则获取所述业务报文所在的目标流水线上的转发表,基于所述转发表将所述业务报文在所述业务报文所在的目标流水线进行发出。If the message in the target pipeline is a business message, the forwarding table on the target pipeline where the business message is located is obtained, and based on the forwarding table, the business message is placed on the target pipeline where the business message is located. The target pipeline is issued.
可选地,所述基于所述转发表将所述业务报文在所述业务报文所在的目标流水线进行发出的步骤,包括:Optionally, the step of sending the service message in the target pipeline where the service message is located based on the forwarding table includes:
获取所述转发表中所述业务报文对应的路由信息,并根据所述路由信息将所述业务报文从所述业务报文所在的目标流水线进行发出。Obtain routing information corresponding to the service message in the forwarding table, and send the service message from the target pipeline where the service message is located according to the routing information.
可选地,所述将所述控制报文从所述控制报文所在的目标流水线发送至目标容器的步骤,包括:Optionally, the step of sending the control message from the target pipeline where the control message is located to the target container includes:
获取各所述物理端口中与处理器CPU相连的物理端口,并将与所述CPU相连的所述物理端口作为CPU接口;Acquiring a physical port connected to a processor CPU among the physical ports, and using the physical port connected to the CPU as a CPU interface;
将所述控制报文从所述控制报文所在的目标流水线发送到所述CPU接口,并通过所述CPU接口将所述控制报文传递到目标容器。The control message is sent from the target pipeline where the control message is located to the CPU interface, and the control message is delivered to the target container through the CPU interface.
可选地,所述将所述控制报文从所述控制报文所在的目标流水线发送到所述CPU接口,并通过所述CPU接口将所述控制报文传递到目标容器的步骤,包括:Optionally, the step of sending the control message from the target pipeline where the control message is located to the CPU interface, and transferring the control message to the target container through the CPU interface includes:
获取所述控制报文所在的目标流水线对应的目标物理端口,并确定所述目标物理端口对应的预设编号,基于所述预设编号在各所述虚接口中确定与所述目标物理端口对应的虚接口;Obtain the target physical port corresponding to the target pipeline where the control message is located, and determine the preset number corresponding to the target physical port, and determine the corresponding target physical port in each virtual interface based on the preset number Virtual interface;
将所述控制报文从所述目标物理端口发送到所述CPU接口,并通过所述CPU接口将所述控制报文传递到所述目标物理端口对应的虚接口,通过所述目标物理端口对应的虚接口将所述控制报文传递到所述目标容器。The control message is sent from the target physical port to the CPU interface, and the control message is transferred to the virtual interface corresponding to the target physical port through the CPU interface, and the target physical port corresponds to The virtual interface of the transfer the control message to the target container.
此外,为实现上述目的,本发明还提供一种报文处理装置,所述报文处理装置包括:In addition, in order to achieve the above objective, the present invention also provides a message processing device, the message processing device includes:
映射模块,用于将预先规划的各流水线的物理端口映射为虚接口,并将所述虚接口加入至所述虚接口对应的容器;A mapping module, which is used to map the physical ports of each pipeline planned in advance to a virtual interface, and add the virtual interface to the container corresponding to the virtual interface;
检测模块,用于在各所述流水线中确定接收到报文的目标流水线,并检 测各所述目标流水线中的报文是否为控制报文,其中,所述报文包括控制报文和业务报文;The detection module is used to determine the target pipeline of the received message in each of the pipelines, and detect whether the message in each of the target pipelines is a control message, wherein the message includes a control message and a service message Text
发送模块,用于若存在所述报文为控制报文,则将所述控制报文从所述控制报文所在的目标流水线发送至目标容器,以供所述目标容器对所述控制报文进行协议处理,其中所述目标容器为所述控制报文所在的目标流水线对应的所述虚接口所在的容器。The sending module is configured to send the control message from the target pipeline where the control message is located to the target container if the message is a control message, so that the target container can respond to the control message Protocol processing is performed, wherein the target container is a container where the virtual interface corresponding to the target pipeline where the control message is located is located.
可选地,所述报文处理装置,还包括:Optionally, the message processing device further includes:
获取模块,用于若存在所述目标流水线中的报文是业务报文,则获取所述业务报文所在的目标流水线上的转发表,基于所述转发表将所述业务报文在所述业务报文所在的目标流水线进行发出。The acquiring module is configured to, if the message in the target pipeline is a business message, acquire the forwarding table of the target pipeline where the business message is located, and place the business message in the forwarding table based on the forwarding table. The target pipeline where the business message is located is sent out.
可选地,所述报文处理装置,还包括:Optionally, the message processing device further includes:
发出模块,用于获取所述转发表中所述业务报文对应的路由信息,并根据所述路由信息将所述业务报文从所述业务报文所在的目标流水线进行发出。The sending module is configured to obtain routing information corresponding to the service message in the forwarding table, and send the service message from the target pipeline where the service message is located according to the routing information.
此外,为实现上述目的,本发明还提供一种报文处理设备;In addition, in order to achieve the above objective, the present invention also provides a message processing device;
所述报文处理设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其中:The message processing device includes: a memory, a processor, and a computer program stored on the memory and running on the processor, wherein:
所述计算机程序被所述处理器执行时实现如上所述的报文处理方法的步骤。When the computer program is executed by the processor, the steps of the message processing method described above are implemented.
此外,为实现上述目的,本发明还提供计算机存储介质;In addition, in order to achieve the above object, the present invention also provides a computer storage medium;
所述计算机存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如上述的报文处理方法的步骤。A computer program is stored on the computer storage medium, and when the computer program is executed by a processor, the steps of the message processing method described above are realized.
本发明通过将预先规划的各流水线的物理端口映射为虚接口,并将所述虚接口加入至所述虚接口对应的容器;在各所述流水线中确定接收到报文的目标流水线,并检测各所述目标流水线中的报文是否为控制报文,其中,所述报文包括控制报文和业务报文;若存在所述报文为控制报文,则将所述控制报文从所述控制报文所在的目标流水线发送至目标容器,以供所述目标容器对所述控制报文进行协议处理,其中所述目标容器为所述控制报文所在的目标流水线对应的所述虚接口所在的容器。通过在接收到报文时,先将各个 流水线上的物理端口映射为虚接口,并在目标流水线接收到报文时,并在确定报文为控制报文时,将控制报文发送至目标容器。从而可以实现一台可编程交换机虚拟成多个逻辑交换机,可以让用户无需额外购买任何额外的服务或者产品,极大的提升了交换机本身的利用率,也给组网设计带来了便利,并且多个网络功能可以进行融合部署,极大的降低了用户的资本性支出和运营成本,解决了现有技术中可编程交换机的利用率较低的技术问题。The present invention maps the physical ports of each pipeline planned in advance to virtual interfaces, and adds the virtual interface to the container corresponding to the virtual interface; determines the target pipeline that receives the message in each pipeline, and detects Whether the message in each target pipeline is a control message, where the message includes a control message and a service message; if the message is a control message, the control message is sent from all The target pipeline in which the control message is located is sent to a target container for the target container to perform protocol processing on the control message, wherein the target container is the virtual interface corresponding to the target pipeline in which the control message is located The container it is in. By first mapping the physical ports on each pipeline to a virtual interface when receiving a message, and when the target pipeline receives the message, and when it is determined that the message is a control message, the control message is sent to the target container . In this way, a programmable switch can be virtualized into multiple logical switches, so that users do not need to purchase any additional services or products, which greatly improves the utilization rate of the switch itself, and also brings convenience to the network design. Multiple network functions can be deployed in fusion, which greatly reduces the user's capital expenditure and operating costs, and solves the technical problem of low utilization of programmable switches in the prior art.
附图说明Description of the drawings
图1是本发明实施例方案涉及的硬件运行环境的终端\装置结构示意图;Figure 1 is a schematic diagram of the terminal\device structure of the hardware operating environment involved in the solution of the embodiment of the present invention;
图2为本发明报文处理方法第一实施例的流程示意图;2 is a schematic flowchart of the first embodiment of the message processing method of the present invention;
图3为本发明报文处理装置的功能模块示意图;3 is a schematic diagram of functional modules of the message processing device of the present invention;
图4为本发明报文处理方法的可编程交换机的物理结构图;4 is a physical structure diagram of the programmable switch of the message processing method of the present invention;
图5为本发明报文处理方法的可编程交换机的内部原理图;Figure 5 is an internal schematic diagram of the programmable switch of the message processing method of the present invention;
图6为本发明报文处理方法的流程示意图;Fig. 6 is a schematic flowchart of a message processing method of the present invention;
图7为本发明报文处理方法的应用场景图;Figure 7 is an application scenario diagram of the message processing method of the present invention;
图8为本发明报文处理方法的的场景示意图。Fig. 8 is a schematic diagram of a scene of a message processing method of the present invention.
本发明目的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization of the objectives, functional characteristics and advantages of the present invention will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It should be understood that the specific embodiments described here are only used to explain the present invention, but not to limit the present invention.
如图1所示,图1是本发明实施例方案涉及的硬件运行环境的终端结构示意图。As shown in Fig. 1, Fig. 1 is a schematic diagram of a terminal structure of a hardware operating environment involved in a solution of an embodiment of the present invention.
本发明实施例终端为电子设备。The terminal in the embodiment of the present invention is an electronic device.
如图1所示,该终端可以包括:处理器1001,例如CPU,网络接口1004,用户接口1003,存储器1005,通信总线1002。其中,通信总线1002用于实现这些组件之间的连接通信。用户接口1003可以包括显示屏(Display)、输入 单元比如键盘(Keyboard),可选用户接口1003还可以包括标准的有线接口、无线接口。网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口)。存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储装置。As shown in FIG. 1, the terminal may include a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to implement connection and communication between these components. The user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as a magnetic disk memory. Optionally, the memory 1005 may also be a storage device independent of the foregoing processor 1001.
可选地,终端还可以包括摄像头、RF(Radio Frequency,射频)电路,传感器、音频电路、WiFi模块等等。其中,传感器比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示屏的亮度,接近传感器可在终端设备移动到耳边时,关闭显示屏和/或背光。当然,终端设备还可配置陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。Optionally, the terminal may also include a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, and so on. Among them, sensors such as light sensors, motion sensors and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, where the ambient light sensor can adjust the brightness of the display screen according to the brightness of the ambient light, and the proximity sensor can turn off the display screen and/or when the terminal device is moved to the ear Backlight. Of course, the terminal device can also be equipped with other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc., which will not be repeated here.
本领域技术人员可以理解,图1中示出的终端结构并不构成对终端的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the terminal structure shown in FIG. 1 does not constitute a limitation on the terminal, and may include more or fewer components than shown in the figure, or combine some components, or arrange different components.
如图1所示,作为一种计算机存储介质的存储器1005中可以包括操作系统、网络通信模块、用户接口模块以及报文处理程序。As shown in FIG. 1, a memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a message processing program.
在图1所示的终端中,网络接口1004主要用于连接后台服务器,与后台服务器进行数据通信;用户接口1003主要用于连接客户端(用户端),与客户端进行数据通信;而处理器1001可以用于调用存储器1005中存储的报文处理程序,并执行以下操作:In the terminal shown in FIG. 1, the network interface 1004 is mainly used to connect to the back-end server and communicate with the back-end server; the user interface 1003 is mainly used to connect to the client (user side) and communicate with the client; and the processor 1001 can be used to call the message processing program stored in the memory 1005 and perform the following operations:
将预先规划的各流水线的物理端口映射为虚接口,并将所述虚接口加入至所述虚接口对应的容器;Mapping the physical ports of each pipeline planned in advance to virtual interfaces, and adding the virtual interfaces to the containers corresponding to the virtual interfaces;
在各所述流水线中确定接收到报文的目标流水线,并检测各所述目标流水线中的报文是否为控制报文,其中,所述报文包括控制报文和业务报文;Determine the target pipeline of the received message in each of the pipelines, and detect whether the message in each of the target pipelines is a control message, where the message includes a control message and a service message;
若存在所述报文为控制报文,则将所述控制报文从所述控制报文所在的目标流水线发送至目标容器,以供所述目标容器对所述控制报文进行协议处理,其中所述目标容器为所述控制报文所在的目标流水线对应的所述虚接口所在的容器。If the message is a control message, the control message is sent from the target pipeline where the control message is located to the target container, so that the target container can perform protocol processing on the control message, wherein The target container is a container where the virtual interface corresponding to the target pipeline where the control message is located is located.
参照图2,本发明提供一种报文处理方法,在报文处理方法一实施例中,报文处理方法包括以下步骤:2, the present invention provides a message processing method. In an embodiment of the message processing method, the message processing method includes the following steps:
步骤S10,将预先规划的各流水线的物理端口映射为虚接口,并将所述虚接口加入至所述虚接口对应的容器;Step S10: Map the physical ports of each pipeline planned in advance to virtual interfaces, and add the virtual interfaces to the containers corresponding to the virtual interfaces;
虚接口可以是物理端口进行映射后的虚拟接口。在可编程交换机进行工作之前,需要先进行组网,也先规划好需要应用到的流水线,以及确定哪份报文从可编程交换机中进行输入输出,并当规划好需要应用到的各个流水线后,将这些流水线上的物理端口映射为虚接口,并将这些虚接口放置在各自流水线对应的容器中。需要说明的是,一个流水线仅对应一个容器,但一个容器可以对应多个流水线,也就是一个流水线的所有虚接口只能放置在一个容器中,而一个容器可以放置多个流水线的所有虚接口,且一个容器里面的接口,固定对应那条流水线上的接口。并且容器的作用是逻辑隔离,而流水线的作用是物理隔离。The virtual interface may be a virtual interface after a physical port is mapped. Before the programmable switch can work, it needs to be networked, and the pipeline that needs to be applied is planned first, and the message to be input and output from the programmable switch is determined, and after planning the various pipelines that need to be applied , The physical ports on these pipelines are mapped to virtual interfaces, and these virtual interfaces are placed in the containers corresponding to the respective pipelines. It should be noted that a pipeline corresponds to only one container, but a container can correspond to multiple pipelines, that is, all virtual interfaces of a pipeline can only be placed in one container, and a container can place all virtual interfaces of multiple pipelines. And the interface in a container is fixed to the interface on that assembly line. And the role of the container is logical isolation, while the role of the pipeline is physical isolation.
并且在本实施例中,还可以将可编程交换机分成控制面和转发面两个平面,如果要实现一虚多,一台物理交换机实现多台逻辑上隔离的虚拟交换机,主要就是需要实现控制面与转发面的虚拟化。而可编程交换机中可编程芯片的每条流水线(流水线)可以当成一个独立的转发面。容器中有运行协议栈,每个容器是一个独立的网络名称空间,每个容器都可以是一个完整的协议栈的控制面。And in this embodiment, the programmable switch can also be divided into two planes: the control plane and the forwarding plane. If you want to achieve one virtual multiple, one physical switch implements multiple logically isolated virtual switches, mainly to implement the control plane Virtualization with forwarding plane. And each pipeline (pipeline) of the programmable chip in the programmable switch can be regarded as an independent forwarding plane. There is a running protocol stack in the container, each container is an independent network name space, and each container can be the control plane of a complete protocol stack.
另外为辅助理解对本实施例中的可编程交换机的理解,下面进行举例说明。In addition, in order to assist understanding of the programmable switch in this embodiment, an example is given below.
例如,如图4所示,可编程交换机的物理结构包括控制面和转发面。而控制面包括操作系统、虚接口、CPU、容器等。转发面包括可编程芯片、流量管理器、流水线1至流水线N,以及每条流水线上的物理端口,并且每个物理端口又划分为入向和出向。可编程芯片通过执行“匹配-动作”来完成数据包的转发,通常会由多条流水线组成,每条流水线分成入向(Ingress)和出向(Egress),入向和出向之间是多条流水线之间共享的流量管理单元,负责完成报文的复制和流量调度,每条流水线可以独立加载不同的转发逻辑,转发逻辑可以通过特定的编程语言来实现,交换机的某个端口固定归属于某条特定的流水线,其中第一条流水线相对特殊,该流水线上一个端口与交换机 本地控制面的CPU相连,用于实现控制报文的上送,该端口为系统可见的接口,类似于一块普通的“网卡”,即CPU端口。For example, as shown in Figure 4, the physical structure of a programmable switch includes a control plane and a forwarding plane. The control plane includes operating system, virtual interface, CPU, container, etc. The forwarding plane includes a programmable chip, a traffic manager, pipeline 1 to pipeline N, and physical ports on each pipeline, and each physical port is divided into inbound and outbound directions. The programmable chip completes the forwarding of data packets by performing "match-action", usually composed of multiple pipelines, each pipeline is divided into ingress (Ingress) and outgoing (Egress), there are multiple pipelines between the incoming and outgoing directions The shared flow management unit is responsible for completing message replication and flow scheduling. Each pipeline can be loaded with different forwarding logic independently. The forwarding logic can be implemented by a specific programming language. A certain port of the switch is fixed to a certain one. A specific pipeline. The first pipeline is relatively special. A port on the pipeline is connected to the CPU on the local control plane of the switch for sending control messages. This port is a visible interface to the system, similar to an ordinary " Network card", that is, CPU port.
并且在本实施例中,是将虚接口加入到容器中,物理端口与每条流水线之间的归属关系是确定的,所以物理端口与虚接口是一一对应的关系,因此每个容器可以对应特定的物理端口。例如,如图5所示,包括可编程芯片、设备驱动、内核、芯片管理、协议代理、控制面1至控制面N,容器1中存在协议栈、协议插件、虚接口X等,容器N中存在协议插件、协议栈、虚接口Y等,并且每一个控制面均包含有一个容器。控制面的虚拟化通过容器来进行轻量级的隔离。即在控制面创建多个容器,容器数量与流水线数量保持一致,每个容器都是独立的网络名称空间。将所需的虚接口添加到容器中,这样就可以实现从某个物理端口收到的控制报文会在容器中收到。将协议栈运行在容器中,协议栈通过虚接口与协议对等体之间建立邻居,从而实现路由的学习与传递。通过一个协议插件模块从内核中读取路由信息,当路由信息发生变化时,通知到容器外的协议代理模块写容器外对应的流水线的转发表。And in this embodiment, the virtual interface is added to the container, and the attribution relationship between the physical port and each pipeline is determined, so the physical port and the virtual interface have a one-to-one correspondence, so each container can correspond to Specific physical port. For example, as shown in Figure 5, including programmable chips, device drivers, kernels, chip management, protocol agents, control plane 1 to control plane N, there are protocol stacks, protocol plug-ins, virtual interface X, etc. in container 1, and container N There are protocol plug-ins, protocol stacks, virtual interface Y, etc., and each control plane includes a container. Virtualization of the control plane uses containers for lightweight isolation. That is, multiple containers are created on the control plane, the number of containers is the same as the number of pipelines, and each container is an independent network name space. Add the required virtual interface to the container, so that the control message received from a certain physical port will be received in the container. Run the protocol stack in the container, and establish neighbors between the protocol stack and the protocol peer through the virtual interface, so as to realize routing learning and transmission. The routing information is read from the kernel through a protocol plug-in module, and when the routing information changes, the protocol proxy module outside the container is notified to write the forwarding table of the corresponding pipeline outside the container.
又例如,如图8所示,当将各个流水线上的物理端口映射为虚接口,并将虚接口放置在容器中后,就是各个虚拟机了,并且可编程芯片中每条流水线均对应有各自的虚拟交换机,即流水线1对应虚拟交换机1(也就是控制面1)、一直到流水线N对应虚拟交换机N(也就是控制面N),并且控制面1(即容器1)包括协议栈、协议插、以及各个虚接口X;控制面N(即容器N)包括协议插件、协议栈、以及各个虚接口Y等。For another example, as shown in Figure 8, when the physical ports on each pipeline are mapped to virtual interfaces and the virtual interfaces are placed in the container, there are virtual machines, and each pipeline in the programmable chip corresponds to its own The virtual switch, that is, pipeline 1 corresponds to virtual switch 1 (that is, control plane 1), until pipeline N corresponds to virtual switch N (that is, control plane N), and control plane 1 (that is, container 1) includes protocol stack and protocol plug , And each virtual interface X; the control plane N (ie container N) includes a protocol plug-in, a protocol stack, and each virtual interface Y.
步骤S20,在各所述流水线中确定接收到报文的目标流水线,并检测各所述目标流水线中的报文是否为控制报文,其中,所述报文包括控制报文和业务报文;Step S20: Determine the target pipeline of the received message in each of the pipelines, and detect whether the message in each of the target pipelines is a control message, where the message includes a control message and a service message;
目标流水线可以是接收到报文的流水线。当在各个流水线中有检测到存在有流水线接收到报文时,需要检查该流水线接收到的报文是否为控制报文,若是控制报文则需要将该报文发送到此报文所在流水线对应的容器中,以便容器进行协议处理,若是业务报文,则可以直接将报文从流水线中发出到外网。The target pipeline may be the pipeline that receives the message. When it is detected that there is a message received by the pipeline in each pipeline, it is necessary to check whether the message received by the pipeline is a control message, if it is a control message, the message needs to be sent to the corresponding pipeline of the message , So that the container can process the protocol. If it is a business message, it can directly send the message from the pipeline to the external network.
步骤S30,若存在所述报文为控制报文,则将所述控制报文从所述控制报 文所在的目标流水线发送至目标容器,以供所述目标容器对所述控制报文进行协议处理,其中所述目标容器为所述控制报文所在的目标流水线对应的所述虚接口所在的容器。Step S30, if the message is a control message, the control message is sent to the target container from the target pipeline where the control message is located, so that the target container can perform an agreement on the control message Processing, wherein the target container is a container where the virtual interface corresponding to the target pipeline where the control message is located is located.
目标容器是目标流水线对应的容器。若经过判断发现在各个目标流水线中存在报文为控制报文时,则将控制报文从控制报文所在的目标流水线传递到该目标流水线对应的目标容器中,以便目标容器对控制报文进行协议处理,即目标容器中的协议栈对控制报文进行协议处理。需要说明的是,每个容器可以相当于一个单独的虚拟交换机,以实现不同的协议处理。而在实际应用中,可根据具体的业务场景,由业务编排模块实现端口映射、转发面初始化、容器的创建等流程。例如,如图6所示。根据业务配置以及组网情况进行端口映射,也就是将可编程芯片中的流水线1至流水线N上的物理端口映射为虚接口,即图中①的操作。依次将各个虚接口放置在容器1至容器N中,且每个容器中均运行有协议栈和协议插件。然后再初始化可编程芯片所在的转发面。从业务编排中分别加载相应的转发逻辑到流水线,即将转发逻辑1加载到流水线1,将转发逻辑N加载到流水线N,即图中②的操作。再通过流水线将转发逻辑传递到容器中,即图中③的操作,并在容器中处理完成后,通过流水线进行输出。The target container is the container corresponding to the target pipeline. If it is determined that there are control messages in each target pipeline, the control message is passed from the target pipeline where the control message is located to the target container corresponding to the target pipeline, so that the target container can perform the control message on the control message. Protocol processing, that is, the protocol stack in the target container performs protocol processing on the control message. It should be noted that each container can be equivalent to a separate virtual switch to implement different protocol processing. In practical applications, according to specific business scenarios, the business orchestration module implements the processes of port mapping, forwarding plane initialization, and container creation. For example, as shown in Figure 6. Port mapping is performed according to the service configuration and networking conditions, that is, the physical ports on the pipeline 1 to the pipeline N in the programmable chip are mapped to virtual interfaces, that is, the operation of ① in the figure. Place each virtual interface in container 1 to container N in turn, and each container runs a protocol stack and a protocol plug-in. Then initialize the forwarding plane where the programmable chip is located. Load the corresponding forwarding logic to the pipeline from the business orchestration, that is, load the forwarding logic 1 to the pipeline 1, and load the forwarding logic N to the pipeline N, which is the operation of ② in the figure. Then transfer the forwarding logic to the container through the pipeline, that is, the operation in the figure ③, and after the processing in the container is completed, it is output through the pipeline.
另外为辅助理解本实施例中一种可编程交换机一虚多的应用场景,下面进行举例说明。In addition, in order to assist the understanding of the application scenario of a programmable switch in this embodiment, an example is given below.
例如,如图7所示,假设一台可编程交换机上同时运行两种网络业务,一条流水线(即流水线)负责接入功能,执行限速、计费、隧道封装等操作;另一条流水线负责对后端服务器进行逐流一致性哈希的选择,类似于负载均衡器。接入流水线的控制面通过虚接口与外网入口设备建立邻居关系,同时宣告路由信息,用于引流。后端服务集群与一致性哈希流水线建立邻居关系,同时宣告VIP(即虚拟IP)信息,每个集群分配有一个VIP,且所有集群VIP在同一网段内,比如192.168.1.0/25。一致性哈希流水线在收到路由宣告后,在本地的路由表中会形成同一个VIP有多个下一跳的情况,每个下一跳代表一台物理服务器;通过协议邻居关系作为保活信息;如果后端某台服务器异常,则会导致邻居关系丢失,此时路由表中会少一跳,协议插件会更新对应流水线的转发表。而接入流水线会与一致性哈希流水线通过内网物理网络建 立邻居关系,宣告特定的VIP,该VIP为集群VIP段中的某一个,用于报文的回程。一致性哈希流水线向内网物理网络宣告VIP段的路由信息,用于引流。For example, as shown in Figure 7, assuming that two network services are running on a programmable switch at the same time, one pipeline (ie pipeline) is responsible for access functions, and performs operations such as speed limit, billing, and tunnel encapsulation; the other pipeline is responsible for The back-end server selects a consistent hash by stream, similar to a load balancer. The control plane of the access pipeline establishes a neighbor relationship with the external network ingress device through the virtual interface, and at the same time announces routing information for traffic diversion. The back-end service cluster establishes a neighbor relationship with the consistent hash pipeline and announces VIP (ie virtual IP) information. Each cluster is assigned a VIP, and all cluster VIPs are in the same network segment, such as 192.168.1.0/25. After the consistent hashing pipeline receives the routing announcement, it will form in the local routing table that the same VIP has multiple next hops, and each next hop represents a physical server; it is kept alive through the protocol neighbor relationship Information; if a certain backend server is abnormal, the neighbor relationship will be lost. At this time, there will be one hop less in the routing table, and the protocol plug-in will update the forwarding table of the corresponding pipeline. The access pipeline will establish a neighbor relationship with the consistent hash pipeline through the intranet physical network and announce a specific VIP, which is one of the VIP segments of the cluster and is used for the backhaul of messages. The consistent hash pipeline announces the routing information of the VIP segment to the intranet physical network for traffic diversion.
并且对于入向流量,流量从外网入口进入接入流水线后,通过控制面相应的逻辑会查询到下一跳的地址信息,即需要送到具体哪个集群,执行限速、计费等功能后,将报文进行隧道封装,隧道外层IP地址为某个集群的VIP,最后发送给内网物理网络。由于一致性哈希流水线宣告了该VIP段的路由信息,内网物理网络将流量导入到一致性哈希流水线宣告了该VIP段的路由信息,内网物理网络将流量导入到一致性哈希流水线,一致性哈希流水线根据该VIP下面的物理服务器信息进行一致性哈希,从而选择某台服务器,同时将隧道外层IP修改成该物理服务器的地址信息,并发送给内网物理网络。内网物理网络最终将报文转给对应的服务器。由于一致性哈希算法的存在,保证了后端服务器异常的情况下,只影响了1/N的连接(N为后端集群中服务器的数量),同时可以通过对一致性哈希的算法选择,能够很好的适应有状态及无状态的应用。And for inbound traffic, after the traffic enters the access pipeline from the external network entrance, the next hop address information will be queried through the corresponding logic of the control plane, that is, which cluster needs to be sent to, and after the speed limit and billing functions are performed , Encapsulate the message in the tunnel, the outer IP address of the tunnel is the VIP of a certain cluster, and finally sent to the internal physical network. Since the consistent hash pipeline announces the routing information of the VIP segment, the intranet physical network imports the traffic to the consistent hash pipeline and announces the routing information of the VIP segment, and the intranet physical network imports the traffic to the consistent hash pipeline , The consistent hashing pipeline performs consistent hashing according to the physical server information under the VIP, thereby selecting a server, and at the same time modifying the outer IP of the tunnel to the address information of the physical server, and sending it to the intranet physical network. The internal physical network finally forwards the message to the corresponding server. Due to the existence of the consistent hashing algorithm, it is guaranteed that when the back-end server is abnormal, only 1/N connections are affected (N is the number of servers in the back-end cluster). At the same time, the consistent hashing algorithm can be selected , Can be well adapted to stateful and stateless applications.
对于出向流量,从物理服务器出来的流量,隧道外层封装固定的IP地址,该地址为接入流水线的VIP,然后发送给内网物理网络,同理内网物理网络会将流量转给一致性哈希流水线。一致性哈希流水线根据接入流水线宣告的VIP信息找到下一跳,从而修改隧道外层IP为该下一跳信息,然后发送给内网物理网络。并在接收流水线收到出向报文后,执行解封装发送到外网。For outbound traffic, the traffic from the physical server is encapsulated with a fixed IP address in the outer layer of the tunnel. This address is the VIP accessing the pipeline, and then sent to the internal physical network. Similarly, the internal physical network will transfer the traffic to consistency Hash pipeline. The consistent hash pipeline finds the next hop according to the VIP information announced by the access pipeline, and modifies the outer IP of the tunnel to the next hop information, and then sends it to the internal physical network. And after the receiving pipeline receives the outgoing message, it performs decapsulation and sends it to the external network.
在本实施例中,通过将预先规划的各流水线的物理端口映射为虚接口,并将所述虚接口加入至所述虚接口对应的容器;在各所述流水线中确定接收到报文的目标流水线,并检测各所述目标流水线中的报文是否为控制报文,其中,所述报文包括控制报文和业务报文;若存在所述报文为控制报文,则将所述控制报文从所述控制报文所在的目标流水线发送至目标容器,以供所述目标容器对所述控制报文进行协议处理,其中所述目标容器为所述控制报文所在的目标流水线对应的所述虚接口所在的容器。通过在接收到报文时,先将各个流水线上的物理端口映射为虚接口,并在目标流水线接收到报文时,并在确定报文为控制报文时,将控制报文发送至目标容器。从而可以实现一台可编程交换机虚拟成多个逻辑交换机,可以让用户无需额外购买任何额外 的服务或者产品,极大的提升了交换机本身的利用率,也给组网设计带来了便利,并且多个网络功能可以进行融合部署,极大的降低了用户的资本性支出和运营成本,解决了现有技术中可编程交换机的利用率较低的技术问题。In this embodiment, the physical ports of each pre-planned pipeline are mapped to virtual interfaces, and the virtual interfaces are added to the container corresponding to the virtual interface; the destination of the received message is determined in each pipeline Pipeline, and detect whether the message in each target pipeline is a control message, where the message includes a control message and a service message; if the message is a control message, the control message The message is sent from the target pipeline where the control message is located to a target container for the target container to perform protocol processing on the control message, wherein the target container is corresponding to the target pipeline where the control message is located The container where the virtual interface is located. By first mapping the physical ports on each pipeline to a virtual interface when receiving a message, and when the target pipeline receives the message, and when it is determined that the message is a control message, the control message is sent to the target container . In this way, a programmable switch can be virtualized into multiple logical switches, so that users do not need to purchase any additional services or products, which greatly improves the utilization rate of the switch itself, and also brings convenience to the network design. Multiple network functions can be deployed in fusion, which greatly reduces the user's capital expenditure and operating costs, and solves the technical problem of low utilization of programmable switches in the prior art.
进一步地,在本发明第一实施例的基础上,提出了本发明报文处理方法的第二实施例,本实施例是本发明第一实施例的步骤S20,检测各所述目标流水线中的报文是否为控制报文的步骤之后,包括:Further, on the basis of the first embodiment of the present invention, a second embodiment of the message processing method of the present invention is proposed. This embodiment is step S20 of the first embodiment of the present invention. After the step of controlling whether the message is a message, it includes:
步骤a,若存在所述目标流水线中的报文是业务报文,则获取所述业务报文所在的目标流水线上的转发表,基于所述转发表将所述业务报文在所述业务报文所在的目标流水线进行发出。Step a: If the message in the target pipeline is a business message, obtain the forwarding table of the target pipeline where the business message is located, and place the business message in the business message based on the forwarding table. The target pipeline where the text is located is issued.
当经过判断发现在各个目标流水线中的报文中,存在有报文不是控制报文,则可以将不是控制报文的报文作为业务报文,并获取该业务报文所在目标流水线上的转发表,根据转发表中的路由信息确定目标流水线上的出口端口,并将业务报文从目标流水线进行发出。其中,转发表包括有各个路由信息。并且在本实施例中每条流水线均设置有各自对应的转发表,并且在哪条流水线中接收到报文,就从哪条流水线发出该报文。When it is found after judgment that there is a message in each target pipeline that is not a control message, the message that is not a control message can be used as a business message, and the transfer on the target pipeline where the business message is located can be obtained. Publish, determine the egress port of the target pipeline according to the routing information in the forwarding table, and send business packets from the target pipeline. Among them, the forwarding table includes various routing information. And in this embodiment, each pipeline is provided with its corresponding forwarding table, and in which pipeline a message is received, the message is sent from which pipeline.
在本实施例中,通过在确定报文不是控制报文时,直接将业务报文进行发出,从而保障了可编程交换机报文发文的效率。In this embodiment, when it is determined that the message is not a control message, the service message is directly sent, thereby ensuring the efficiency of the programmable switch message sending.
具体地,基于所述转发表将所述业务报文在所述业务报文所在的目标流水线进行发出的步骤,包括:Specifically, the step of sending the service message in the target pipeline where the service message is located based on the forwarding table includes:
步骤a1,获取所述转发表中所述业务报文对应的路由信息,并根据所述路由信息将所述业务报文从所述业务报文所在的目标流水线进行发出。Step a1: Obtain routing information corresponding to the service message in the forwarding table, and send the service message from the target pipeline where the service message is located according to the routing information.
在报文表中存储的各个路由信息确定业务报文对应的路由信息,并根据此路由信息确定目标流水线中的出口端口,再将业务报文从目标流水线中的出口端口进行发出。Each routing information stored in the message table determines the routing information corresponding to the service message, and determines the egress port in the target pipeline according to this routing information, and then sends the business message from the egress port in the target pipeline.
在本实施例中,通过在转发表中获取业务报文对应的路由信息,并根据路由信息将业务报文进行发出,从而保障了可编程交换机报文发文的效率。In this embodiment, the routing information corresponding to the service message is obtained in the forwarding table, and the service message is sent according to the routing information, thereby ensuring the efficiency of the programmable switch message sending.
进一步地,将所述控制报文从所述控制报文所在的目标流水线发送至目标容器的步骤,包括:Further, the step of sending the control message from the target pipeline where the control message is located to the target container includes:
步骤b,在所述控制报文所在的目标流水线中,获取各所述物理端口中与处理器CPU相连的物理端口,并将与所述CPU相连的所述物理端口作为CPU接口;Step b: In the target pipeline where the control message is located, obtain the physical port connected to the processor CPU among the physical ports, and use the physical port connected to the CPU as the CPU interface;
在控制报文所在的目标流水线中中虽然存在多个物理端口,但在该控制报文所在的目标流水线中中存在有一个物理端口与交换机本地控制面的CPU相连,并将此端口作为CPU接口,以便用于实现控制报文的上送,且该物理端口为系统可见的接口,类似于一块普通的“网卡”。Although there are multiple physical ports in the target pipeline where the control message is located, there is a physical port in the target pipeline where the control message is connected to the CPU of the local control plane of the switch, and this port is used as the CPU interface , So as to be used to realize the upload of control messages, and the physical port is a visible interface of the system, similar to an ordinary "network card".
步骤c,将所述报文从所述控制报文所在的目标流水线发送到所述CPU接口,并通过所述CPU接口将所述控制报文传递到目标容器。Step c: Send the message from the target pipeline where the control message is located to the CPU interface, and transfer the control message to the target container through the CPU interface.
当确定CPU接口后,可以将控制报文从控制报文所在的目标流水线发送到CPU接口,并通过CPU中的内核转发给相应的虚接口,再通过此虚接口将报文传递到目标容器中。When the CPU interface is determined, the control message can be sent from the target pipeline where the control message is located to the CPU interface, and forwarded to the corresponding virtual interface through the kernel in the CPU, and then the message is passed to the target container through this virtual interface .
在本实施例中,通过确定CPU接口,并将控制报文从控制报文所在的目标流水线发送到CPU接口,再从CPU接口发送到虚接口,从而保障了报文发送到虚接口的准确性。In this embodiment, by determining the CPU interface and sending the control message from the target pipeline where the control message is located to the CPU interface, and then from the CPU interface to the virtual interface, the accuracy of the message sent to the virtual interface is guaranteed. .
具体地,将所述控制报文从所述控制报文所在的目标流水线发送到所述CPU接口,并通过所述CPU接口将所述控制报文传递到目标容器的步骤,包括:Specifically, the step of sending the control message from the target pipeline where the control message is located to the CPU interface and passing the control message to the target container through the CPU interface includes:
步骤c1,获取所述控制报文所在的目标流水线对应的目标物理端口,并确定所述目标物理端口对应的预设编号,基于所述预设编号在各所述虚接口中确定与所述目标物理端口对应的虚接口;Step c1: Obtain the target physical port corresponding to the target pipeline where the control message is located, and determine the preset number corresponding to the target physical port, and determine the connection with the target in each virtual interface based on the preset number. The virtual interface corresponding to the physical port;
在将流水线中的物理端口映射为虚接口后,由于每个物理接口都具备一个预设的编号,因此,虚接口也会具有对应的编号。假设为x,那么在与CPU相连的接口上建立子接口,其id为x;每个流水线上需要固定实现一部分逻辑,对于需要上送的控制报文,如果该报文来自端口x,则可以认为标记id等于端口号x,并可以设出端口为CPU接口,报文从CPU接口收到后,内核会根据标记id将其转到对应的子接口上,从而实现了物理端口与虚接口之间的映射。也就是在目标流水线获取到报文后,先确定报文是否为控制报文,并在报文为控制报文时,确定控制报文所在的目标流水线的物理端口(即目标物理端口),并且此入口端口对应的预设编号,根据此预设编号在各个虚 接口中确定与目标物理端口对应的虚接口。After the physical ports in the pipeline are mapped to virtual interfaces, since each physical interface has a preset number, the virtual interface will also have a corresponding number. Suppose it is x, then a sub-interface is established on the interface connected to the CPU, and its id is x; each pipeline needs to be fixed to implement some logic. For the control message that needs to be sent, if the message comes from port x, you can It is considered that the tag id is equal to the port number x, and the port can be set as the CPU interface. After the message is received from the CPU interface, the kernel will transfer it to the corresponding sub-interface according to the tag id, thus realizing the relationship between the physical port and the virtual interface. Mapping between. That is, after the target pipeline obtains the message, first determine whether the message is a control message, and when the message is a control message, determine the physical port of the target pipeline where the control message is located (that is, the target physical port), and According to the preset number corresponding to the ingress port, the virtual interface corresponding to the target physical port is determined in each virtual interface according to the preset number.
步骤c2,将所述控制报文从所述目标物理端口发送到所述CPU接口,并通过所述CPU接口将所述控制报文传递到所述目标物理端口对应的虚接口,通过所述目标物理端口对应的虚接口将所述控制报文传递到所述目标容器。Step c2: Send the control message from the target physical port to the CPU interface, and transfer the control message to the virtual interface corresponding to the target physical port through the CPU interface, and pass the target The virtual interface corresponding to the physical port transfers the control message to the target container.
将控制报文从控制报文所在的目标流水线的目标物理端口发送到CPU接口,并通过CPU接口对应的内核将控制报文传递到与目标物理端口对应的虚接口,并通过此虚接口将控制报文传递到目标容器,以便目标容器对控制报文进行处理。The control message is sent from the target physical port of the target pipeline where the control message is located to the CPU interface, and the control message is passed to the virtual interface corresponding to the target physical port through the core corresponding to the CPU interface, and the control is controlled through this virtual interface The message is passed to the target container so that the target container can process the control message.
在本实施例中,通过确定目标流水线的目标物理端口的预设编号,来确定虚接口,并将报文发送到此虚接口,从而提高了报文发送到虚接口的准确性。In this embodiment, the virtual interface is determined by determining the preset number of the target physical port of the target pipeline, and the message is sent to this virtual interface, thereby improving the accuracy of sending the message to the virtual interface.
此外,参照图3,本发明实施例还提出一种报文处理装置,所述报文处理装置包括:In addition, referring to FIG. 3, an embodiment of the present invention also provides a message processing device, and the message processing device includes:
映射模块,用于将预先规划的各流水线的物理端口映射为虚接口,并将所述虚接口加入至所述虚接口对应的容器;A mapping module, which is used to map the physical ports of each pipeline planned in advance to a virtual interface, and add the virtual interface to the container corresponding to the virtual interface;
检测模块,用于在各所述流水线中确定接收到报文的目标流水线,并检测各所述目标流水线中的报文是否为控制报文,其中,所述报文包括控制报文和业务报文;The detection module is used to determine the target pipeline of the received message in each of the pipelines, and detect whether the message in each of the target pipelines is a control message, wherein the message includes a control message and a service message Text
发送模块,用于若存在所述报文为控制报文,则将所述控制报文从所述控制报文所在的目标流水线发送至目标容器,以供所述目标容器对所述控制报文进行协议处理,其中所述目标容器为所述控制报文所在的目标流水线对应的所述虚接口所在的容器。The sending module is configured to send the control message from the target pipeline where the control message is located to the target container if the message is a control message, so that the target container can respond to the control message Protocol processing is performed, wherein the target container is a container where the virtual interface corresponding to the target pipeline where the control message is located is located.
可选地,所述报文处理装置,还包括:Optionally, the message processing device further includes:
若存在所述目标流水线中的报文是业务报文,则获取所述业务报文所在的目标流水线上的转发表,基于所述转发表将所述业务报文在所述业务报文所在的目标流水线进行发出。If the message in the target pipeline is a business message, the forwarding table on the target pipeline where the business message is located is obtained, and based on the forwarding table, the business message is placed on the target pipeline where the business message is located. The target pipeline is issued.
可选地,所述报文处理装置,还包括:Optionally, the message processing device further includes:
获取所述转发表中所述业务报文对应的路由信息,并根据所述路由信息将所述业务报文从所述业务报文所在的目标流水线进行发出。Obtain routing information corresponding to the service message in the forwarding table, and send the service message from the target pipeline where the service message is located according to the routing information.
可选地,所述传递模块还用于:Optionally, the transfer module is also used to:
在所述控制报文所在的目标流水线中,获取各所述物理端口中与处理器CPU相连的物理端口,并将与所述CPU相连的所述物理端口作为CPU接口;In the target pipeline where the control message is located, acquiring the physical port connected to the processor CPU among the physical ports, and using the physical port connected to the CPU as the CPU interface;
将所述控制报文从所述控制报文所在的目标流水线发送到所述CPU接口,并通过所述CPU接口将所述控制报文传递到目标容器。The control message is sent from the target pipeline where the control message is located to the CPU interface, and the control message is delivered to the target container through the CPU interface.
可选地,所述传递模块还用于:Optionally, the transfer module is also used to:
获取所述控制报文所在的目标流水线对应的目标物理端口,并确定所述目标物理端口对应的预设编号,基于所述预设编号在各所述虚接口中确定与所述目标物理端口对应的虚接口;Obtain the target physical port corresponding to the target pipeline where the control message is located, and determine the preset number corresponding to the target physical port, and determine the corresponding target physical port in each virtual interface based on the preset number Virtual interface;
将所述控制报文从所述目标物理端口发送到所述CPU接口,并通过所述CPU接口将所述控制报文传递到所述目标物理端口对应的虚接口,通过所述目标物理端口对应的虚接口将所述控制报文传递到所述目标容器。The control message is sent from the target physical port to the CPU interface, and the control message is transferred to the virtual interface corresponding to the target physical port through the CPU interface, and the target physical port corresponds to The virtual interface of the transfer the control message to the target container.
其中,报文处理装置的各个功能模块实现的步骤可参照本发明报文处理方法的各个实施例,此处不再赘述。Among them, the steps implemented by each functional module of the message processing device can refer to the various embodiments of the message processing method of the present invention, which will not be repeated here.
本发明还提供一种报文处理设备,所述报文处理设备包括:存储器、处理器、通信总线以及存储在所述存储器上的报文处理程序:The present invention also provides a message processing device. The message processing device includes a memory, a processor, a communication bus, and a message processing program stored on the memory:
所述通信总线用于实现处理器和存储器之间的连接通信;The communication bus is used to realize connection and communication between the processor and the memory;
所述处理器用于执行所述报文处理程序,以实现上述报文处理方法各实施例的步骤。The processor is configured to execute the message processing program to implement the steps of the embodiments of the message processing method described above.
本发明还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者一个以上程序,所述一个或者一个以上程序还可被一个或者一个以上的处理器执行以用于实现上述报文处理方法各实施例的步骤。The present invention also provides a computer-readable storage medium that stores one or more programs, and the one or more programs may also be executed by one or more processors to implement The steps of each embodiment of the foregoing message processing method.
本发明计算机可读存储介质具体实施方式与上述报文处理方法各实施例基本相同,在此不再赘述。The specific implementation manner of the computer-readable storage medium of the present invention is basically the same as each embodiment of the foregoing message processing method, and will not be repeated here.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括 为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。It should be noted that in this article, the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, It also includes other elements that are not explicitly listed, or elements inherent to the process, method, article, or system. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, article or system that includes the element.
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The sequence numbers of the foregoing embodiments of the present invention are only for description, and do not represent the superiority of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better.的实施方式。 Based on this understanding, the technical solution of the present invention essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM) as described above. , Magnetic disk, optical disk), including several instructions to make a terminal device (can be a mobile phone, computer, server, air conditioner, or network device, etc.) execute the method described in each embodiment of the present invention.
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only the preferred embodiments of the present invention, and do not limit the scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the description and drawings of the present invention, or directly or indirectly applied to other related technical fields , The same reason is included in the scope of patent protection of the present invention.

Claims (10)

  1. 一种报文处理方法,其特征在于,所述报文处理方法包括以下步骤:A message processing method, characterized in that the message processing method includes the following steps:
    将预先规划的各流水线的物理端口映射为虚接口,并将所述虚接口加入至所述虚接口对应的容器;Mapping the physical ports of each pipeline planned in advance to virtual interfaces, and adding the virtual interfaces to the containers corresponding to the virtual interfaces;
    在各所述流水线中确定接收到报文的目标流水线,并检测各所述目标流水线中的报文是否为控制报文,其中,所述报文包括控制报文和业务报文;Determine the target pipeline of the received message in each of the pipelines, and detect whether the message in each of the target pipelines is a control message, where the message includes a control message and a service message;
    若存在所述报文为控制报文,则将所述控制报文从所述控制报文所在的目标流水线发送至目标容器,以供所述目标容器对所述控制报文进行协议处理,其中所述目标容器为所述控制报文所在的目标流水线对应的所述虚接口所在的容器。If the message is a control message, the control message is sent from the target pipeline where the control message is located to the target container, so that the target container can perform protocol processing on the control message, wherein The target container is a container where the virtual interface corresponding to the target pipeline where the control message is located is located.
  2. 如权利要求1所述的报文处理方法,其特征在于,所述检测各所述目标流水线中的报文是否为控制报文的步骤之后,包括:5. The message processing method according to claim 1, wherein after the step of detecting whether the message in each of the target pipelines is a control message, the method comprises:
    若存在所述目标流水线中的报文是业务报文,则获取所述业务报文所在的目标流水线上的转发表,基于所述转发表将所述业务报文在所述业务报文所在的目标流水线进行发出。If the message in the target pipeline is a business message, the forwarding table on the target pipeline where the business message is located is obtained, and based on the forwarding table, the business message is placed on the target pipeline where the business message is located. The target pipeline is issued.
  3. 如权利要求2所述的报文处理方法,其特征在于,所述基于所述转发表将所述业务报文在所述业务报文所在的目标流水线进行发出的步骤,包括:3. The message processing method according to claim 2, wherein the step of sending the business message in the target pipeline where the business message is located based on the forwarding table comprises:
    获取所述转发表中所述业务报文对应的路由信息,并根据所述路由信息将所述业务报文从所述业务报文所在的目标流水线进行发出。Obtain routing information corresponding to the service message in the forwarding table, and send the service message from the target pipeline where the service message is located according to the routing information.
  4. 如权利要求1所述的报文处理方法,其特征在于,所述将所述控制报文从所述控制报文所在的目标流水线发送至目标容器的步骤,包括:The message processing method according to claim 1, wherein the step of sending the control message from the target pipeline where the control message is located to the target container comprises:
    在所述控制报文所在的目标流水线中,获取各所述物理端口中与处理器CPU相连的物理端口,并将与所述CPU相连的所述物理端口作为CPU接口;In the target pipeline where the control message is located, acquiring the physical port connected to the processor CPU among the physical ports, and using the physical port connected to the CPU as the CPU interface;
    将所述控制报文从所述控制报文所在的目标流水线发送到所述CPU接口,并通过所述CPU接口将所述控制报文传递到目标容器。The control message is sent from the target pipeline where the control message is located to the CPU interface, and the control message is delivered to the target container through the CPU interface.
  5. 如权利要求4所述的报文处理方法,其特征在于,所述将所述控制报文从所述控制报文所在的目标流水线发送到所述CPU接口,并通过所述CPU接口将所述控制报文传递到目标容器的步骤,包括:The message processing method according to claim 4, wherein the control message is sent to the CPU interface from the target pipeline where the control message is located, and the CPU interface The steps to control the message delivery to the target container include:
    获取所述控制报文所在的目标流水线对应的目标物理端口,并确定所述目标物理端口对应的预设编号,基于所述预设编号在各所述虚接口中确定与所述目标物理端口对应的虚接口;Obtain the target physical port corresponding to the target pipeline where the control message is located, and determine the preset number corresponding to the target physical port, and determine the corresponding target physical port in each virtual interface based on the preset number Virtual interface;
    将所述控制报文从所述目标物理端口发送到所述CPU接口,并通过所述CPU接口将所述控制报文传递到所述目标物理端口对应的虚接口,通过所述目标物理端口对应的虚接口将所述控制报文传递到所述目标容器。The control message is sent from the target physical port to the CPU interface, and the control message is transferred to the virtual interface corresponding to the target physical port through the CPU interface, and the target physical port corresponds to The virtual interface of the transfer the control message to the target container.
  6. 一种报文处理装置,其特征在于,所述报文处理装置包括:A message processing device, characterized in that, the message processing device includes:
    映射模块,用于将预先规划的各流水线的物理端口映射为虚接口,并将所述虚接口加入至所述虚接口对应的容器;A mapping module, which is used to map the physical ports of each pipeline planned in advance to a virtual interface, and add the virtual interface to the container corresponding to the virtual interface;
    检测模块,用于在各所述流水线中确定接收到报文的目标流水线,并检测各所述目标流水线中的报文是否为控制报文,其中,所述报文包括控制报文和业务报文;The detection module is used to determine the target pipeline of the received message in each of the pipelines, and detect whether the message in each of the target pipelines is a control message, wherein the message includes a control message and a service message Text
    发送模块,用于若存在所述报文为控制报文,则将所述控制报文从所述控制报文所在的目标流水线发送至目标容器,以供所述目标容器对所述控制报文进行协议处理,其中所述目标容器为所述控制报文所在的目标流水线对应的所述虚接口所在的容器。The sending module is configured to send the control message from the target pipeline where the control message is located to the target container if the message is a control message, so that the target container can respond to the control message Protocol processing is performed, wherein the target container is a container where the virtual interface corresponding to the target pipeline where the control message is located is located.
  7. 如权利要求6所述的报文处理装置,其特征在于,所述报文处理装置,还包括:8. The message processing device of claim 6, wherein the message processing device further comprises:
    获取模块,用于若存在所述目标流水线中的报文是业务报文,则获取所述业务报文所在的目标流水线上的转发表,基于所述转发表将所述业务报文在所述业务报文所在的目标流水线进行发出。The acquiring module is configured to, if the message in the target pipeline is a business message, acquire the forwarding table of the target pipeline where the business message is located, and place the business message in the forwarding table based on the forwarding table. The target pipeline where the business message is located is sent out.
  8. 如权利要求7所述的报文处理装置,其特征在于,所述报文处理装置,还包括:8. The message processing device according to claim 7, wherein the message processing device further comprises:
    发出模块,用于获取所述转发表中所述业务报文对应的路由信息,并根 据所述路由信息将所述业务报文从所述业务报文所在的目标流水线进行发出。The sending module is used to obtain routing information corresponding to the service message in the forwarding table, and send the service message from the target pipeline where the service message is located according to the routing information.
  9. 一种报文处理设备,其特征在于,所述报文处理设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的报文处理程序,所述报文处理程序被所述处理器执行时实现如权利要求1至6中任一项所述的报文处理方法的步骤。A message processing device, characterized in that, the message processing device includes: a memory, a processor, and a message processing program stored on the memory and running on the processor, and the message processing When the program is executed by the processor, the steps of the message processing method according to any one of claims 1 to 6 are realized.
  10. 一种可读存储介质,其特征在于,所述可读存储介质上存储有报文处理程序,所述报文处理程序被处理器执行时实现如权利要求1至6中任一项所述的报文处理方法的步骤。A readable storage medium, wherein a message processing program is stored on the readable storage medium, and when the message processing program is executed by a processor, the message processing program according to any one of claims 1 to 6 is realized. The steps of the message processing method.
PCT/CN2019/126996 2019-07-19 2019-12-20 Message processing method and device, apparatus, and readable storage medium WO2021012601A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910660074.0 2019-07-19
CN201910660074.0A CN110392002B (en) 2019-07-19 2019-07-19 Message processing method, device, equipment and readable storage medium

Publications (1)

Publication Number Publication Date
WO2021012601A1 true WO2021012601A1 (en) 2021-01-28

Family

ID=68286974

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/126996 WO2021012601A1 (en) 2019-07-19 2019-12-20 Message processing method and device, apparatus, and readable storage medium

Country Status (2)

Country Link
CN (1) CN110392002B (en)
WO (1) WO2021012601A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110392002B (en) * 2019-07-19 2020-10-23 广东省新一代通信与网络创新研究院 Message processing method, device, equipment and readable storage medium
CN111030944A (en) * 2019-11-25 2020-04-17 杭州迪普科技股份有限公司 Message sending method and equipment
CN111935148B (en) * 2020-08-11 2021-06-18 北京卓讯科信技术有限公司 Control method and device for data plane signaling message
CN112616153B (en) * 2020-12-08 2023-07-25 京信网络系统股份有限公司 Container processing method, device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007036099A1 (en) * 2005-09-30 2007-04-05 Huawei Technologies Co., Ltd. An ip intercommunication gateway and a method for implementing ip domain intercommunication in ngn
CN105207873A (en) * 2015-08-31 2015-12-30 华为技术有限公司 Message processing method and apparatus
US20160020940A1 (en) * 2012-09-14 2016-01-21 Microsoft Technology Licensing, Llc Automated Datacenter Network Failure Mitigation
CN108199982A (en) * 2018-01-03 2018-06-22 腾讯科技(深圳)有限公司 Message processing method, device, storage medium and computer equipment
CN110392002A (en) * 2019-07-19 2019-10-29 广东省新一代通信与网络创新研究院 Message processing method, device, equipment and readable storage medium storing program for executing

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007036099A1 (en) * 2005-09-30 2007-04-05 Huawei Technologies Co., Ltd. An ip intercommunication gateway and a method for implementing ip domain intercommunication in ngn
US20160020940A1 (en) * 2012-09-14 2016-01-21 Microsoft Technology Licensing, Llc Automated Datacenter Network Failure Mitigation
CN105207873A (en) * 2015-08-31 2015-12-30 华为技术有限公司 Message processing method and apparatus
CN108199982A (en) * 2018-01-03 2018-06-22 腾讯科技(深圳)有限公司 Message processing method, device, storage medium and computer equipment
CN110392002A (en) * 2019-07-19 2019-10-29 广东省新一代通信与网络创新研究院 Message processing method, device, equipment and readable storage medium storing program for executing

Also Published As

Publication number Publication date
CN110392002B (en) 2020-10-23
CN110392002A (en) 2019-10-29

Similar Documents

Publication Publication Date Title
CN108768817B (en) Virtual network networking system and data packet sending method
CN111885075B (en) Container communication method, device, network equipment and storage medium
WO2021012601A1 (en) Message processing method and device, apparatus, and readable storage medium
TWI746506B (en) Method and device for network load balancing, control and network interaction
WO2021242428A1 (en) Loop prevention in virtual l2 networks
US11765080B2 (en) Layer-2 networking span port in a virtualized cloud environment
US9203750B2 (en) Ethernet frame translation to internet protocol over infiniband
US11777848B2 (en) Scalable routing and forwarding of packets in cloud infrastructure
CN107579900B (en) Method, device and system for accessing VX L AN network from V L AN network
US20190052598A1 (en) Managing network connectivity between cloud computing service endpoints and virtual machines
CN105684376A (en) Location services on a data exchange layer
US10693785B2 (en) Method and system for forwarding data, virtual load balancer, and readable storage medium
CN111565142B (en) Message processing method and device and computer readable storage medium
US11777897B2 (en) Cloud infrastructure resources for connecting a service provider private network to a customer private network
US20200296027A1 (en) Enablement of multi-path routing in virtual edge systems
US11496599B1 (en) Efficient flow management utilizing control packets
US11695692B2 (en) Transparent high availability for customer virtual machines achieved using a hypervisor-based side channel bonding and monitoring
US20240039847A1 (en) Highly-available host networking with active-active or active-backup traffic load-balancing
US20240031282A1 (en) Layer-2 networking span port in a virtualized cloud environment
US11876710B2 (en) Dynamic IP routing in a cloud environment
CN114650290A (en) Network connection method, processing device, terminal and storage medium
US20230396579A1 (en) Cloud infrastructure resources for connecting a service provider private network to a customer private network
US11929976B2 (en) Virtual network routing gateway that supports address translation for dataplane as well as dynamic routing protocols (control plane)
US20230013110A1 (en) Techniques for processing network flows
CN117880097A (en) Cloud tenant EIP migration method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19938868

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19938868

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 19938868

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 11/08/2022)

122 Ep: pct application non-entry in european phase

Ref document number: 19938868

Country of ref document: EP

Kind code of ref document: A1