[go: up one dir, main page]

CN114615187A - A logic interface data communication method and device - Google Patents

A logic interface data communication method and device Download PDF

Info

Publication number
CN114615187A
CN114615187A CN202011448182.0A CN202011448182A CN114615187A CN 114615187 A CN114615187 A CN 114615187A CN 202011448182 A CN202011448182 A CN 202011448182A CN 114615187 A CN114615187 A CN 114615187A
Authority
CN
China
Prior art keywords
interface
logical
configuration
network card
kernel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011448182.0A
Other languages
Chinese (zh)
Other versions
CN114615187B (en
Inventor
汪洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN202011448182.0A priority Critical patent/CN114615187B/en
Publication of CN114615187A publication Critical patent/CN114615187A/en
Application granted granted Critical
Publication of CN114615187B publication Critical patent/CN114615187B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/24Multipath
    • H04L45/245Link aggregation, e.g. trunking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering

Landscapes

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

Abstract

本发明公开了一种逻辑接口数据通信方法及装置,通过将逻辑接口的接口配置映射给一个成员接口对应的内核网卡接口,在接收到访问所述逻辑接口自身的数据报文时,将接收的数据报文发送给映射的内核网卡接口,并接收所述内核网卡接口的回应报文,通过所述逻辑接口发送。从而采用内核协议栈来处理和响应到自身报文,提高了设备转发性能。同时减少自身通信协议栈代码适配和开发的工作量,提升产品化开发效率和产品稳定性。本发明减少了链路聚合接口、VLAN接口等三层逻辑接口动态路由表项等开发的巨大投入。

Figure 202011448182

The invention discloses a logical interface data communication method and device. By mapping the interface configuration of a logical interface to a kernel network card interface corresponding to a member interface, when receiving a data message accessing the logical interface itself, the received The data message is sent to the mapped kernel network card interface, and a response message from the kernel network card interface is received and sent through the logical interface. Therefore, the kernel protocol stack is used to process and respond to its own message, which improves the forwarding performance of the device. At the same time, it reduces the workload of its own communication protocol stack code adaptation and development, and improves product development efficiency and product stability. The invention reduces the huge investment in the development of dynamic routing table entries of three-layer logical interfaces such as link aggregation interfaces and VLAN interfaces.

Figure 202011448182

Description

一种逻辑接口数据通信方法及装置A logic interface data communication method and device

技术领域technical field

本申请属于数据通信技术领域,尤其涉及一种基于数据平面开发套件DPDK的逻辑接口数据通信方法及装置。The present application belongs to the technical field of data communication, and in particular, relates to a data communication method and device for a logical interface based on a data plane development kit DPDK.

背景技术Background technique

数据平面开发套件DPDK(Data Plane Development Kit)主要基于Linux系统运行,用于快速数据包处理的函数库与驱动集合,可以极大提高数据处理性能和吞吐量,提高数据平面应用程序的工作效率。DPDK提供内核网卡接口KNI(Kernel NIC Interface),以便于DPDK应用程序与Linux内核之间的通信。该接口允许报文从用户态接收后转发到Linux协议栈去,即允许用户空间应用进入Linux控制平面,该接口较现有的Linux TUN/TAP接口更快,允许用标准Linux网络工具(如ethtool,ifconfig,tcpdump)对DPDK接口进行管理和自身通信。The data plane development kit DPDK (Data Plane Development Kit) is mainly based on the Linux system. It is a set of function libraries and drivers for fast packet processing, which can greatly improve the data processing performance and throughput, and improve the work efficiency of data plane applications. DPDK provides KNI (Kernel NIC Interface) to facilitate communication between DPDK applications and the Linux kernel. This interface allows packets received from user mode to be forwarded to the Linux protocol stack, that is, allows user space applications to enter the Linux control plane. This interface is faster than the existing Linux TUN/TAP interface and allows standard Linux network tools (such as ethtool to be used) , ifconfig, tcpdump) to manage the DPDK interface and communicate with itself.

然而,对于应用了DPDK的网络设备,例如安全准入控制网关等,设备上的逻辑接口如链路聚合接口、VLAN接口、隧道接口等,DPDK并没有提供这样的KNI接口库函数来对接口进行管理和自身通信。因此,如果想要实现对逻辑接口进行管理和自身通信,就必须移植集成封装了自己的协议栈来对接口进行管理。However, for network devices that use DPDK, such as security admission control gateways, and logical interfaces such as link aggregation interfaces, VLAN interfaces, tunnel interfaces, etc., DPDK does not provide such a KNI interface library function to perform interface processing. Manage and communicate with itself. Therefore, if you want to manage the logical interface and communicate with itself, you must transplant, integrate and encapsulate your own protocol stack to manage the interface.

但是由于内核协议栈复杂,重新开发适配逻辑接口承载的虚网卡驱动,工作量大,耗时长。However, due to the complexity of the kernel protocol stack, redeveloping the virtual NIC driver carried by the adaptation logical interface requires a lot of work and takes a long time.

发明内容SUMMARY OF THE INVENTION

本申请的目的是提供一种逻辑接口数据通信方法及装置,在基于DPDK的网络设备上实现逻辑接口通信,减少自身通信协议栈代码适配和开发的工作量,提升产品化开发效率和产品稳定。The purpose of this application is to provide a logical interface data communication method and device, which can realize logical interface communication on DPDK-based network devices, reduce the workload of code adaptation and development of its own communication protocol stack, and improve product development efficiency and product stability. .

为了实现上述目的,本申请技术方案如下:In order to achieve the above purpose, the technical solutions of the present application are as follows:

一种逻辑接口数据通信方法,应用于基于数据平面开发套件DPDK的网络设备,所述逻辑接口数据通信方法,包括:A logical interface data communication method, applied to a network device based on a data plane development kit DPDK, the logical interface data communication method comprising:

创建逻辑接口,将逻辑接口的接口配置映射给一个成员接口对应的内核网卡接口;Create a logical interface and map the interface configuration of the logical interface to the kernel NIC interface corresponding to a member interface;

接收访问所述逻辑接口自身的数据报文,将接收的数据报文发送给映射的内核网卡接口;Receive the data message accessing the logical interface itself, and send the received data message to the mapped kernel network card interface;

接收所述内核网卡接口的回应报文,通过所述逻辑接口发送。Receive a response message from the kernel network card interface, and send it through the logical interface.

可选的,所述将逻辑接口的接口配置映射给一个成员接口对应的内核网卡接口,包括:Optionally, the mapping of the interface configuration of the logical interface to the kernel network card interface corresponding to a member interface includes:

在逻辑接口下无成员接口,开始加入成员接口时,将逻辑接口的接口配置映射给第一个成员接口对应的内核网卡接口;When there is no member interface under the logical interface, when the member interface is added, the interface configuration of the logical interface is mapped to the kernel NIC interface corresponding to the first member interface;

在逻辑接口下移除成员接口时,判断所移除的成员接口是否是第一个成员接口,如果是第一个成员接口,则删除所移除的成员接口对应的内核网卡接口的接口配置,将逻辑接口的接口配置映射给新的第一个成员接口对应的内核网卡接口。When removing a member interface from a logical interface, determine whether the removed member interface is the first member interface. If it is the first member interface, delete the interface configuration of the kernel NIC interface corresponding to the removed member interface. Map the interface configuration of the logical interface to the kernel NIC interface corresponding to the new first member interface.

可选的,所述将逻辑接口的接口配置映射给一个成员接口对应的内核网卡接口,包括:Optionally, the mapping of the interface configuration of the logical interface to the kernel network card interface corresponding to a member interface includes:

在逻辑接口下已有成员接口时,将逻辑接口的接口配置映射给其中一个成员接口对应的内核网卡接口;When there are member interfaces under the logical interface, map the interface configuration of the logical interface to the kernel NIC interface corresponding to one of the member interfaces;

在逻辑接口下移除成员接口时,判断所移除的成员接口的内核网卡接口是否映射了接口配置,如果是,则删除该成员接口对应的内核网卡接口的接口配置,将逻辑接口的接口配置映射给另一个成员接口对应的内核网卡接口。When removing a member interface from a logical interface, determine whether the kernel NIC interface of the removed member interface is mapped with the interface configuration. If so, delete the interface configuration of the kernel NIC interface corresponding to the member interface, and configure the interface configuration of the logical interface. Map to the corresponding kernel NIC interface of another member interface.

进一步的,所述逻辑接口数据通信方法,还包括:Further, the logical interface data communication method further includes:

在删除逻辑接口的接口配置时,删除映射的内核网卡接口的接口配置。When deleting the interface configuration of a logical interface, delete the interface configuration of the mapped kernel NIC interface.

进一步的,所述逻辑接口数据通信方法,还包括:Further, the logical interface data communication method further includes:

在删除逻辑接口时,删除映射的内核网卡接口的接口配置。When deleting a logical interface, delete the interface configuration of the mapped kernel NIC interface.

本申请还提出了一种逻辑接口数据通信装置,应用于基于数据平面开发套件DPDK的网络设备,所述逻辑接口数据通信装置,包括:The present application also proposes a logical interface data communication device, which is applied to a network device based on a data plane development kit DPDK. The logical interface data communication device includes:

配置模块,用于创建逻辑接口,将逻辑接口的接口配置映射给一个成员接口对应的内核网卡接口;The configuration module is used to create a logical interface and map the interface configuration of the logical interface to the kernel network card interface corresponding to a member interface;

自身通信模块,用于接收访问所述逻辑接口自身的数据报文,将接收的数据报文发送给映射的内核网卡接口;接收所述内核网卡接口的回应报文,通过所述逻辑接口发送。The self-communication module is used for receiving the data message accessing the logical interface itself, and sending the received data message to the mapped kernel network card interface; receiving the response message of the kernel network card interface, and sending it through the logical interface.

可选的,所述配置模块将逻辑接口的接口配置映射给一个成员接口对应的内核网卡接口,执行如下操作:Optionally, the configuration module maps the interface configuration of the logical interface to a kernel network card interface corresponding to a member interface, and performs the following operations:

在逻辑接口下无成员接口,开始加入成员接口时,将逻辑接口的接口配置映射给第一个成员接口对应的内核网卡接口;When there is no member interface under the logical interface, when the member interface is added, the interface configuration of the logical interface is mapped to the kernel NIC interface corresponding to the first member interface;

在逻辑接口下移除成员接口时,判断所移除的成员接口是否是第一个成员接口,如果是第一个成员接口,则删除所移除的成员接口对应的内核网卡接口的接口配置,将逻辑接口的接口配置映射给新的第一个成员接口对应的内核网卡接口。When removing a member interface from a logical interface, determine whether the removed member interface is the first member interface. If it is the first member interface, delete the interface configuration of the kernel NIC interface corresponding to the removed member interface. Map the interface configuration of the logical interface to the kernel NIC interface corresponding to the new first member interface.

可选的,所述配置模块将逻辑接口的接口配置映射给一个成员接口对应的内核网卡接口,执行如下操作:Optionally, the configuration module maps the interface configuration of the logical interface to a kernel network card interface corresponding to a member interface, and performs the following operations:

在逻辑接口下已有成员接口时,将逻辑接口的接口配置映射给其中一个成员接口对应的内核网卡接口;When there are member interfaces under the logical interface, map the interface configuration of the logical interface to the kernel NIC interface corresponding to one of the member interfaces;

在逻辑接口下移除成员接口时,判断所移除的成员接口的内核网卡接口是否映射了接口配置,如果是,则删除该成员接口对应的内核网卡接口的接口配置,将逻辑接口的接口配置映射给另一个成员接口对应的内核网卡接口。When removing a member interface from a logical interface, determine whether the kernel NIC interface of the removed member interface is mapped with the interface configuration. If so, delete the interface configuration of the kernel NIC interface corresponding to the member interface, and configure the interface configuration of the logical interface. Map to the corresponding kernel NIC interface of another member interface.

进一步的,所述配置模块,还用于:Further, the configuration module is also used for:

在删除逻辑接口的接口配置时,删除映射的内核网卡接口的接口配置。When deleting the interface configuration of a logical interface, delete the interface configuration of the mapped kernel NIC interface.

进一步的,所述配置模块,还用于:Further, the configuration module is also used for:

在删除逻辑接口时,删除映射的内核网卡接口的接口配置。When deleting a logical interface, delete the interface configuration of the mapped kernel NIC interface.

本申请提出的一种逻辑接口数据通信方法及装置,通过映射逻辑接口的IP地址给成员接口对应的内核网卡接口,从而采用内核协议栈来处理和响应到自身报文,提高了设备转发性能。同时减少自身通信协议栈代码适配和开发的工作量,提升产品化开发效率和产品稳定性。减少了链路聚合接口、VLAN接口等三层逻辑接口动态路由表项等开发的巨大投入。A logical interface data communication method and device proposed in the present application, by mapping the IP address of the logical interface to the kernel network card interface corresponding to the member interface, so as to use the kernel protocol stack to process and respond to its own message, thereby improving the forwarding performance of the device. At the same time, it reduces the workload of its own communication protocol stack code adaptation and development, and improves product development efficiency and product stability. It reduces the huge investment in the development of dynamic routing entries for Layer 3 logical interfaces such as link aggregation interfaces and VLAN interfaces.

附图说明Description of drawings

图1为本申请实施例逻辑接口数据通信方法流程图;FIG. 1 is a flowchart of a logical interface data communication method according to an embodiment of the present application;

图2为本申请实施例链路聚合接口通信方法流程图;FIG. 2 is a flowchart of a communication method for a link aggregation interface according to an embodiment of the present application;

图3为本申请实施例链路聚合接口网络连接示意图;3 is a schematic diagram of a network connection of a link aggregation interface according to an embodiment of the present application;

图4为本申请实施例VLAN接口网络连接示意图;4 is a schematic diagram of a network connection of a VLAN interface according to an embodiment of the present application;

图5为本申请实施例逻辑接口数据通信装置结构示意图。FIG. 5 is a schematic structural diagram of a logical interface data communication apparatus according to an embodiment of the present application.

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application will be described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.

本申请提供的一种逻辑接口数据通信方法及装置,应用于基于DPDK的网络设备,在该网络设备上的逻辑接口,按照本申请的方法进行自身通信。在本申请中逻辑接口以链路聚合接口和VLAN接口为例进行说明,对其他逻辑接口同样适用。链路聚合(英语:LinkAggregation)是一个计算机网络术语,指将多个物理接口汇聚在一起,形成一个逻辑接口,每个物理接口在逻辑接口中就是一个成员接口,以实现出/入流量吞吐量在各成员接口的负荷分担,交换机根据用户配置的接口负荷分担策略决定网络封包从哪个成员接口发送到对端的交换机。当交换机检测到其中一个成员接口的链路发生故障时,就停止在此接口上发送封包,并根据负荷分担策略在剩下的链路中重新计算报文的发送接口,故障接口恢复后再次担任收发接口。链路聚合在增加链路带宽、实现链路传输弹性和工程冗余等方面是一项很重要的技术。虚拟局域网接口(VLAN接口)是一组逻辑上的接口,这些接口并不受物理位置的限制,可以根据功能、部门及应用等因素将它们组织起来,相互之间的通信就好像它们在同一个网段中一样。在本申请的实施例中,将链路聚合接口或VLAN接口中各个物理接口统称为成员接口。对于链路聚合接口,其成员接口就是参加链路聚合的各个物理接口;同样对于VLAN接口,其成员接口就是在同一个VLAN的各个物理接口。A logical interface data communication method and device provided by the present application are applied to a DPDK-based network device, and the logical interface on the network device communicates itself according to the method of the present application. In this application, the logical interface is described by taking the link aggregation interface and the VLAN interface as examples, and the same applies to other logical interfaces. Link Aggregation (English: LinkAggregation) is a computer network term that refers to the aggregation of multiple physical interfaces to form a logical interface. Each physical interface is a member interface in the logical interface to achieve outbound/inbound traffic throughput. In the load sharing of each member interface, the switch determines from which member interface the network packet is sent to the peer switch according to the interface load sharing policy configured by the user. When the switch detects that the link of one of the member interfaces is faulty, it stops sending packets on this interface, and recalculates the sending interface of the packets in the remaining links according to the load sharing policy. After the faulty interface recovers, it takes over again. Transceiver interface. Link aggregation is an important technology in increasing link bandwidth, realizing link transmission elasticity and engineering redundancy. Virtual LAN interface (VLAN interface) is a group of logical interfaces. These interfaces are not limited by physical location. They can be organized according to factors such as functions, departments, and applications, and communicate with each other as if they are in the same the same in the network segment. In the embodiments of the present application, each physical interface in the link aggregation interface or the VLAN interface is collectively referred to as a member interface. For a link aggregation interface, its member interfaces are all physical interfaces participating in the link aggregation; for a VLAN interface, its member interfaces are all physical interfaces in the same VLAN.

本申请的一个实施例,如图1所示,提供了一种逻辑接口数据通信方法,包括:An embodiment of the present application, as shown in FIG. 1, provides a logical interface data communication method, including:

步骤S110、创建逻辑接口,将逻辑接口的接口配置映射给一个成员接口对应的内核网卡接口。Step S110: Create a logical interface, and map the interface configuration of the logical interface to a kernel network card interface corresponding to a member interface.

目前应用了DPDK的网络设备,例如安全准入控制网关等,其上的每个物理接口都会有对应KNI接口,然而对于逻辑接口,并没有提供对应的KNI接口。无论是物理接口还是逻辑接口在接收到数据报文后,如果不是访问自身的,就进行转发。而如果是访问接口自身的数据报文,就是自身通信数据报文。对于自身通信数据报文,物理接口通过DPDK提供的KNI接口允许报文从用户态接收后转发到Linux协议栈去实现自身通信,而DPDK并没有为逻辑接口提供这样的KNI接口。因此本申请的技术方案就是希望在逻辑接口上也能利用Linux协议栈来实现逻辑接口的自身通信,而不需要额外开发适配逻辑接口承载的虚网卡驱动。Currently, network devices that use DPDK, such as security admission control gateways, have corresponding KNI interfaces for each physical interface. However, for logical interfaces, there is no corresponding KNI interface. Whether it is a physical interface or a logical interface, after receiving a data packet, if it does not access itself, it forwards it. And if it is a data packet of the access interface itself, it is a data packet of its own communication. For its own communication data packets, the physical interface allows the KNI interface provided by the DPDK to allow the packet to be received from the user mode and then forwarded to the Linux protocol stack to realize its own communication, while the DPDK does not provide such a KNI interface for the logical interface. Therefore, the technical solution of the present application is to hope that the Linux protocol stack can also be used on the logical interface to realize the self-communication of the logical interface, without additionally developing and adapting the virtual network card driver carried by the logical interface.

通常逻辑接口的创建,一般来说可以先创建逻辑接口,然后将成员接口加入到创建的逻辑接口。例如,在网络设备A上创建链路聚合接口aggregateport1,然后将网络设备A的物理接口Ethernet1、物理接口Ethernet2加入到aggregateport1。又例如,在网络设备A上创建VLAN接口VLAN10,然后将网络设备A的物理接口Ethernet1、物理接口Ethernet2加入到VLAN10。所创建的链路聚合接口aggregateport1、VLAN10就是逻辑接口,物理接口Ethernet1、物理接口Ethernet2是成员接口。Usually, when creating a logical interface, generally speaking, you can create a logical interface first, and then add member interfaces to the created logical interface. For example, create a link aggregation interface aggregateport1 on network device A, and then add the physical interface Ethernet1 and physical interface Ethernet2 of network device A to aggregateport1. For another example, create a VLAN interface VLAN10 on the network device A, and then add the physical interface Ethernet1 and the physical interface Ethernet2 of the network device A to the VLAN10. The created link aggregation interfaces aggregateport1 and VLAN10 are logical interfaces, and the physical interfaces Ethernet1 and Ethernet2 are member interfaces.

逻辑接口的创建过程中,还需要对逻辑接口进行配置,逻辑接口的接口配置通常包括IP地址、接口状态、最大传输单元MTU等。接口状态有up和down两种状态。需要说明的是,逻辑接口的接口配置可以在创建逻辑接口后就进行配置,也可以在将成员接口加入后再进行配置,本申请对此不做限制。In the process of creating a logical interface, it is also necessary to configure the logical interface. The interface configuration of the logical interface usually includes the IP address, the interface status, and the maximum transmission unit (MTU) and so on. The interface state has two states: up and down. It should be noted that, the interface configuration of the logical interface may be configured after the logical interface is created, or may be configured after the member interface is added, which is not limited in this application.

本申请为了在逻辑接口上也能利用Linux协议栈来实现逻辑接口的自身通信,采用将逻辑接口的接口配置映射给一个成员接口对应的内核网卡接口来实现。In order to realize the self-communication of the logical interface by using the Linux protocol stack on the logical interface, the present application implements by mapping the interface configuration of the logical interface to the kernel network card interface corresponding to a member interface.

在一个具体的示例中,将逻辑接口的接口配置映射给一个成员接口对应的内核网卡接口,包括:在逻辑接口下无成员接口,开始加入成员接口时,将逻辑接口的接口配置映射给第一个成员接口对应的内核网卡接口;在逻辑接口下移除成员接口时,判断所移除的成员接口是否是第一个成员接口,如果是第一个成员接口,则删除所移除的成员接口对应的内核网卡接口的接口配置,将逻辑接口的接口配置映射给新的第一个成员接口对应的内核网卡接口。In a specific example, mapping the interface configuration of the logical interface to the kernel network card interface corresponding to a member interface includes: when there is no member interface under the logical interface, when the member interface starts to be added, the interface configuration of the logical interface is mapped to the first member interface. The kernel NIC corresponding to each member interface; when removing a member interface from a logical interface, determine whether the removed member interface is the first member interface, and if it is the first member interface, delete the removed member interface The interface configuration of the corresponding kernel NIC interface maps the interface configuration of the logical interface to the kernel NIC interface corresponding to the new first member interface.

具体的,逻辑接口创建后,就配置了逻辑接口的接口配置,此时逻辑接口下还没有成员接口,逻辑接口的接口配置在本地保存。然后为逻辑接口配置成员接口,在第一个成员接口加入时,就将逻辑接口的接口配置映射给第一个成员接口对应的内核网卡接口。也就是说,在第一成员接口加入后,就能够实现将访问逻辑接口自身的自身通信数据报文通过第一个成员接口对应的内核网卡接口转入Linux协议栈去处理。后续成员接口再加入时,无需额外的配置。Specifically, after the logical interface is created, the interface configuration of the logical interface is configured. At this time, there is no member interface under the logical interface, and the interface configuration of the logical interface is saved locally. Then configure the member interface for the logical interface, and map the interface configuration of the logical interface to the kernel NIC interface corresponding to the first member interface when the first member interface is added. That is to say, after the first member interface is added, the communication data packets of the access logical interface itself can be transferred to the Linux protocol stack for processing through the kernel network card interface corresponding to the first member interface. When subsequent member interfaces are rejoined, no additional configuration is required.

同样的,在逻辑接口下移除成员接口时,如果移除的是第一成员接口,由于第一成员接口被移除,其对应的内核网卡接口将无法再提供服务,此时需要删除第一个成员接口对应的内核网卡接口的接口配置。重新寻找该逻辑接口下的第一个成员接口,找到新的第一成员接口后,将逻辑接口的接口配置映射给新的第一个成员接口对应的内核网卡接口。为了便于判断谁是新的第一个成员接口,可以对加入逻辑接口的成员接口顺序编号,根据编号来确定新的第一个成员接口,这里不再赘述。Similarly, when a member interface is removed from a logical interface, if the first member interface is removed, since the first member interface is removed, the corresponding kernel NIC interface will no longer be able to provide services. In this case, the first member interface needs to be deleted. Interface configuration of the kernel NIC interface corresponding to each member interface. The first member interface under the logical interface is searched again, and after the new first member interface is found, the interface configuration of the logical interface is mapped to the kernel network card interface corresponding to the new first member interface. To facilitate judging who is the new first member interface, you can sequentially number the member interfaces added to the logical interface, and determine the new first member interface according to the number, which is not repeated here.

在本实施例中,在删除逻辑接口的接口配置时,删除映射的内核网卡接口的接口配置;在删除逻辑接口时,删除映射的内核网卡接口的接口配置。In this embodiment, when the interface configuration of the logical interface is deleted, the interface configuration of the mapped kernel network card interface is deleted; when the logical interface is deleted, the interface configuration of the mapped kernel network card interface is deleted.

具体地,如果删除逻辑接口的接口配置,相应的也删除第一成员接口映射的内核网卡接口的接口配置。如果删除逻辑接口,也相应的删除第一成员接口映射的内核网卡接口的接口配置。Specifically, if the interface configuration of the logical interface is deleted, the interface configuration of the kernel network card interface mapped to the first member interface is correspondingly deleted. If the logical interface is deleted, the interface configuration of the kernel network card interface mapped by the first member interface is also deleted correspondingly.

在另一个具体的示例中,将逻辑接口的接口配置映射给一个成员接口对应的内核网卡接口,包括:在逻辑接口下已有成员接口时,将逻辑接口的接口配置映射给其中一个成员接口对应的内核网卡接口;在逻辑接口下移除成员接口时,判断所移除的成员接口的内核网卡接口是否映射了接口配置,如果是,则删除该成员接口对应的内核网卡接口的接口配置,将逻辑接口的接口配置映射给另一个成员接口对应的内核网卡接口。In another specific example, mapping the interface configuration of the logical interface to the kernel network card interface corresponding to a member interface includes: when there are member interfaces under the logical interface, mapping the interface configuration of the logical interface to the corresponding one of the member interfaces When a member interface is removed from a logical interface, determine whether the kernel NIC interface of the removed member interface is mapped with an interface configuration, if so, delete the interface configuration of the kernel NIC interface corresponding to the member interface, and set the The interface configuration of a logical interface is mapped to the corresponding kernel NIC interface of another member interface.

具体的,逻辑接口创建后,就配置了逻辑接口下的成员接口,此后为该逻辑接口配置对应的接口配置,发现已经有成员接口,则需要将接口配置映射给一个成员接口对应的内核网卡接口。此时,选择用来映射的成员接口,可以根据成员加入的顺序编号选择第一个成员接口,也可以任意选择一个成员接口,或者根据成员接口的优先级来选择。成员接口的优先级可以根据成员接口的可用资源来确定,例如根据其剩余带宽来确定,剩余带宽越高其优先级越高。或者根据成员接口上已有的用户数来确定优先级,用户数越少的优先级越高。本示例对如何选择成员接口不做限制。Specifically, after the logical interface is created, the member interface under the logical interface is configured, and then the corresponding interface configuration is configured for the logical interface. If it is found that there is already a member interface, the interface configuration needs to be mapped to the kernel NIC interface corresponding to a member interface. . At this time, to select the member interface for mapping, you can select the first member interface according to the order number of the member joining, or you can select a member interface arbitrarily, or select the member interface according to the priority of the member interface. The priority of the member interface may be determined according to the available resources of the member interface, for example, according to its remaining bandwidth. The higher the remaining bandwidth, the higher the priority. Or determine the priority according to the number of existing users on the member interface. The lower the number of users, the higher the priority. This example does not restrict how to select member interfaces.

相应的,在移除成员接口时,判断所移除的成员接口的内核网卡接口是否映射了接口配置,如果是,则删除该成员接口对应的内核网卡接口的接口配置,将逻辑接口的接口配置映射给新选择的一个成员接口对应的内核网卡接口。Correspondingly, when removing a member interface, it is judged whether the kernel network card interface of the removed member interface is mapped with the interface configuration, if so, delete the interface configuration of the kernel network card interface corresponding to the member interface, and configure the interface configuration of the logical interface. Map to the kernel NIC interface corresponding to a newly selected member interface.

在本实施例中,在删除逻辑接口的接口配置时,删除映射的内核网卡接口的接口配置;在删除逻辑接口时,删除映射的内核网卡接口的接口配置。In this embodiment, when the interface configuration of the logical interface is deleted, the interface configuration of the mapped kernel network card interface is deleted; when the logical interface is deleted, the interface configuration of the mapped kernel network card interface is deleted.

具体地,如果删除逻辑接口的接口配置,相应的也删除成员接口映射的内核网卡接口的接口配置。如果删除逻辑接口,也相应的删除成员接口映射的内核网卡接口的接口配置,这里不再赘述。Specifically, if the interface configuration of the logical interface is deleted, the interface configuration of the kernel network card interface mapped by the member interface is correspondingly deleted. If the logical interface is deleted, the interface configuration of the kernel NIC interface mapped by the member interface is correspondingly deleted, and details are not repeated here.

步骤S120、接收访问所述逻辑接口自身的数据报文,将接收的数据报文发送给映射的内核网卡接口。Step S120: Receive a data packet accessing the logical interface itself, and send the received data packet to the mapped kernel network card interface.

在前面的步骤中,已经将逻辑接口的接口配置映射给一个成员接口对应的内核网卡接口,因此当逻辑接口接收到访问自身的数据报文时,此数据报文的目的地址是逻辑接口的地址,内核网卡接口就会将数据报文转发到Linux协议栈进行处理。In the previous steps, the interface configuration of the logical interface has been mapped to the kernel NIC interface corresponding to a member interface. Therefore, when the logical interface receives a data packet that accesses itself, the destination address of the data packet is the address of the logical interface. , the kernel NIC interface will forward the data packet to the Linux protocol stack for processing.

步骤S130、接收所述内核网卡接口的回应报文,通过所述逻辑接口发送。Step S130: Receive a response message from the kernel network card interface, and send it through the logical interface.

网络设备的Linux协议栈对接收的数据报文进行处理后,进行回应,回应报文经过内核网卡接口重新送入逻辑接口,匹配已经建立的转发表项,通过逻辑接口发送出去,回应报文的目的地址是原访问自身的数据报文的源地址。The Linux protocol stack of the network device processes the received data packet, and then responds. The response packet is re-sent to the logical interface through the kernel network card interface, matches the established forwarding entry, and is sent out through the logical interface. The destination address is the source address of the data packet that originally accessed itself.

本申请的另一个实施例,本实施例可以与上述一个或者多个实施例中各个可选方案结合,以链路聚合接口为例详细阐述本申请的一种逻辑接口数据通信方法,如图2所示,包括:In another embodiment of the present application, this embodiment can be combined with each optional solution in one or more of the above embodiments, and a link aggregation interface is used as an example to describe a logical interface data communication method of the present application in detail, as shown in FIG. 2 . shown, including:

步骤S201、创建链路聚合接口,配置链路聚合的IP地址。Step S201 , creating a link aggregation interface, and configuring an IP address of the link aggregation.

本实施例链路聚合接口的接口配置以IP地址为例进行说明,例如在网络设备A上创建链路聚合接口aggregateport1,然后将网络设备A的物理接口Ethernet1、物理接口Ethernet2加入到aggregateport1。为链路聚合接口aggregateport1配置IP地址,例如配置的IP地址为192.168.1.110。The interface configuration of the link aggregation interface in this embodiment is described by taking an IP address as an example. For example, create a link aggregation interface aggregateport1 on network device A, and then add the physical interface Ethernet1 and physical interface Ethernet2 of network device A to aggregateport1. Configure an IP address for the link aggregation interface aggregateport1. For example, the configured IP address is 192.168.1.110.

步骤S202、判断链路聚合接口下是否有成员接口,如果没有成员接口,则将链路聚合接口的IP地址保存在本地,如果有成员接口,则将链路聚合接口的IP地址映射给第一成员接口对应的内核网卡接口。Step S202, judging whether there is a member interface under the link aggregation interface, if there is no member interface, then save the IP address of the link aggregation interface locally, and if there is a member interface, map the IP address of the link aggregation interface to the first link aggregation interface. The kernel NIC interface corresponding to the member interface.

具体地,本实施例先判断链路聚合接口下是否有成员接口,如果没有成员接口,则将链路聚合接口的IP地址保存在本地。后续发现开始有成员接口加入到链路聚合接口,则将链路聚合接口的IP地址映射给第一成员接口对应的内核网卡接口。例如,Ethernet1是第一个加入的成员接口,则将IP地址192.168.1.110映射给Ethernet1对应的内核网卡接口。Specifically, this embodiment first determines whether there is a member interface under the link aggregation interface, and if there is no member interface, the IP address of the link aggregation interface is stored locally. If it is found subsequently that a member interface is added to the link aggregation interface, the IP address of the link aggregation interface is mapped to the kernel network card interface corresponding to the first member interface. For example, if Ethernet1 is the first member interface added, the IP address 192.168.1.110 is mapped to the corresponding kernel NIC interface of Ethernet1.

如果链路聚合接口下有成员接口,则根据成员接口的加入顺序编号,将链路聚合接口的IP地址映射给第一成员接口对应的内核网卡接口。例如,Ethernet1是第一个加入的成员接口,则将IP地址192.168.1.110映射给Ethernet1对应的内核网卡接口。If there are member interfaces under the link aggregation interface, the IP address of the link aggregation interface is mapped to the kernel network card interface corresponding to the first member interface according to the order number of the member interfaces. For example, if Ethernet1 is the first member interface added, the IP address 192.168.1.110 is mapped to the corresponding kernel NIC interface of Ethernet1.

步骤S203、在链路聚合接口下移除成员接口时,判断移除的是否是第一成员接口,如果是第一成员接口,则删除所移除的成员接口对应的内核网卡接口的接口配置,将逻辑接口的接口配置映射给新的第一个成员接口对应的内核网卡接口。Step S203, when removing the member interface under the link aggregation interface, determine whether the removed member interface is the first member interface, and if it is the first member interface, then delete the interface configuration of the kernel network card interface corresponding to the removed member interface, Map the interface configuration of the logical interface to the kernel NIC interface corresponding to the new first member interface.

如果从链路聚合接口下移除成员接口,例如从链路聚合接口aggregateport1中移除成员接口Ethernet1,由于成员接口Ethernet1是第一成员接口,其对应的内核网卡接口映射了链路聚合接口的IP地址192.168.1.110,此时需要删除成员接口Ethernet1对应的内核网卡接口的接口配置。重新在链路聚合接口下的成员接口中查找到新的第一成员接口,假设此时成员接口Ethernet2是第一成员接口,则将链路聚合接口aggregateport1的IP地址192.168.1.110映射给Ethernet2对应的内核网卡接口。此时始终保持了链路聚合接口的IP地址映射给了一个成员接口对应的内核网卡接口,能够实现链路聚合接口自身通信。If the member interface is removed from the link aggregation interface, for example, the member interface Ethernet1 is removed from the link aggregation interface aggregateport1, since the member interface Ethernet1 is the first member interface, the corresponding kernel NIC interface maps the IP of the link aggregation interface. The address is 192.168.1.110. In this case, you need to delete the interface configuration of the kernel NIC interface corresponding to the member interface Ethernet1. Find the new first member interface in the member interfaces under the link aggregation interface again. Assuming that member interface Ethernet2 is the first member interface, map the IP address 192.168.1.110 of the link aggregation interface aggregateport1 to the corresponding one of Ethernet2. Kernel NIC interface. At this time, the IP address of the link aggregation interface is always mapped to the kernel NIC interface corresponding to a member interface, which can realize the communication of the link aggregation interface itself.

容易理解的是,如果移除的成员接口不是第一成员接口,或者说移除的成员接口对应的内核网卡接口未被映射链路聚合接口的IP地址,则不用做任何处理。It is easy to understand that, if the removed member interface is not the first member interface, or the kernel NIC interface corresponding to the removed member interface is not mapped to the IP address of the link aggregation interface, no processing is required.

特殊地,如果移除成员接口后,链路聚合接口下没有任何成员接口时,则链路聚合接口配置的IP地址保存在本地,此时没有映射的内核网卡接口,不能实现链路聚合接口的自身通信。In particular, if there is no member interface under the link aggregation interface after the member interface is removed, the IP address configured on the link aggregation interface is saved locally. At this time, there is no mapped kernel NIC interface, and the link aggregation interface cannot be implemented. self-communication.

而在删除链路接口的IP地址,或者删除链路聚合接口时,相应的也删除第一成员接口映射的内核网卡接口的IP地址。When the IP address of the link interface is deleted, or the link aggregation interface is deleted, the IP address of the kernel network card interface mapped by the first member interface is correspondingly deleted.

步骤S204、接收访问所述链路聚合接口自身的数据报文,将接收的数据报文发送给映射的第一个成员接口对应的内核网卡接口。Step S204: Receive a data packet accessing the link aggregation interface itself, and send the received data packet to the kernel network card interface corresponding to the first mapped member interface.

本实施例中,第一成员接口Ethernet1对应的内核网卡接口映射了链路聚合接口的IP地址192.168.1.110,因此当链路聚合接口接收的数据报文的目的IP地址为192.168.1.110时,是对链路聚合接口的自身通信数据报文。由于,第一成员接口Ethernet1对应的内核网卡接口映射了链路聚合接口的IP地址192.168.1.110,数据报文被发往第一成员接口Ethernet1对应的内核网卡接口,从而数据报文被转发到Linux协议栈进行处理,Linux协议栈对数据报文进行处理后,返回回应报文。In this embodiment, the kernel network card interface corresponding to the first member interface Ethernet1 maps the IP address of the link aggregation interface 192.168.1.110. Therefore, when the destination IP address of the data packet received by the link aggregation interface is 192.168.1.110, it is Self-communication data packets to the link aggregation interface. Since the kernel network card interface corresponding to the first member interface Ethernet1 maps the IP address 192.168.1.110 of the link aggregation interface, the data packet is sent to the kernel network card interface corresponding to the first member interface Ethernet1, so the data packet is forwarded to Linux The protocol stack processes the data packets, and the Linux protocol stack returns a response packet after processing the data packets.

步骤S205、接收第一个成员接口对应的内核网卡接口返回的回应报文,通过链路聚合接口发送。Step S205: Receive a response packet returned by the kernel network card interface corresponding to the first member interface, and send it through the link aggregation interface.

Linux协议栈对数据报文进行处理后,返回回应报文,该回应报文被链路聚合接口转发,转发的目的地址是原数据报文(访问所述链路聚合接口自身的数据报文)的源IP地址。After the Linux protocol stack processes the data packet, it returns a response packet. The response packet is forwarded by the link aggregation interface, and the forwarded destination address is the original data packet (the data packet accessing the link aggregation interface itself) source IP address.

例如,访问所述链路聚合接口自身的数据报文的目的地址是192.168.1.110,源IP地址是192.168.220。则回应报文的目的地址是192.168.220,从而成功对访问自身的自身通信进行了响应处理。For example, the destination address of the data packet accessing the link aggregation interface itself is 192.168.1.110, and the source IP address is 192.168.220. Then the destination address of the response message is 192.168.220, thus successfully responding to the self-communication accessing itself.

容易理解的是,图2实施例是以链路聚合接口为例进行的说明,对于其他逻辑接口,例如VLAN接口也同样适用,这里不再赘述。It is easy to understand that the embodiment in FIG. 2 is described by taking a link aggregation interface as an example, and the same applies to other logical interfaces, such as VLAN interfaces, and will not be repeated here.

本申请一种逻辑接口数据通信方法,通过映射逻辑接口的IP地址给成员接口对应的内核网卡接口,从而采用内核协议栈来处理和响应到自身报文,提高了设备转发性能。同时减少自身通信协议栈代码适配和开发的工作量,提升产品化开发效率和产品稳定性。减少了链路聚合接口、VLAN接口等三层逻辑接口动态路由表项等开发的巨大投入。The present application provides a logical interface data communication method. By mapping the IP address of the logical interface to the kernel network card interface corresponding to the member interface, the kernel protocol stack is used to process and respond to its own message, thereby improving the forwarding performance of the device. At the same time, it reduces the workload of its own communication protocol stack code adaptation and development, and improves product development efficiency and product stability. It reduces the huge investment in the development of dynamic routing entries for Layer 3 logical interfaces such as link aggregation interfaces and VLAN interfaces.

图3是链路聚合接口自身通信的一个实施例,在该实施例中,应用了DPDK的安全准入控制网关FW2和FW3的三个物理接口以成员接口的方式加入到一个链路聚合接口,并分别给FW2、FW3的链路聚合接口配置各自的IP地址,由于FW2和FW3本身没有集成协议栈,网络流量到自身的通信承载在自带的Linux系统上,配置的链路聚合接口的IP地址也同步映射到3个物理接口其中一个对应的内核网卡接口上,一般是链路聚合接口的第一个成员接口对应的内核网卡接口。Fig. 3 is an embodiment of the communication of the link aggregation interface itself. In this embodiment, the three physical interfaces of the security admission control gateways FW2 and FW3 applying DPDK are added to a link aggregation interface in the form of member interfaces, And configure their own IP addresses for the link aggregation interfaces of FW2 and FW3 respectively. Since FW2 and FW3 do not have an integrated protocol stack, the communication from network traffic to themselves is carried on the built-in Linux system. The IP address of the configured link aggregation interface is The address is also synchronously mapped to the kernel NIC interface corresponding to one of the three physical interfaces, which is generally the kernel NIC interface corresponding to the first member interface of the link aggregation interface.

以FW2为例,三个物理接口Ethernet1、Ethernet2、Ethernet3以成员接口的方式加入到链路聚合接口中,假设FW2链路聚合接口的IP地址为IP1,映射的内核网卡接口为物理接口Ethernet1对应的内核网卡接口KNI1。Taking FW2 as an example, the three physical interfaces Ethernet1, Ethernet2, and Ethernet3 are added to the link aggregation interface as member interfaces. Assume that the IP address of the link aggregation interface of FW2 is IP1, and the mapped kernel NIC interface is the one corresponding to the physical interface Ethernet1. Kernel NIC interface KNI1.

在移除成员接口时,如果移除的是物理接口Ethernet1,则要删除KNI1映射的IP地址,重新映射内核网卡接口,例如映射给物理接口Ethernet2对应的内核网卡接口KNI2。When removing a member interface, if the physical interface Ethernet1 is removed, delete the IP address mapped by KNI1, and remap the kernel NIC interface, for example, map it to the kernel NIC interface KNI2 corresponding to the physical interface Ethernet2.

在删除链路聚合接口的IP地址时,或删除链路聚合接口时,要删除KNI1映射的IP地址。When deleting the IP address of the link aggregation interface, or when deleting the link aggregation interface, delete the IP address mapped by KNI1.

PC和FW2链路聚合接口通信的数据报文全部送往KNI1接口,由Linux协议栈来回应报文交互。而其他经过链路聚合接口转发的数据报文,则由链路聚合接口正常转发。All data packets communicated between the PC and the FW2 link aggregation interface are sent to the KNI1 interface, and the Linux protocol stack responds to the packet exchange. Other data packets forwarded through the link aggregation interface are normally forwarded by the link aggregation interface.

图4是VLAN接口自身通信的一个实施例,在该实施例中,应用了DPDK的安全准入控制网关FW1上创建VLAN接口,FW1选择物理接口Ethernet4、Ethernet5、Ethernet6加入VLAN,分别连接PC1、PC2、PC3。VLAN接口配置IP地址时,IP地址同步映射给一个物理接口对应的内核网卡接口,可以选择映射给物理接口Ethernet4、Ethernet5、Ethernet6口中第一个加入VLAN的物理接口对应的内核网卡接口。假设FW1上VLAN接口的IP地址为IP10,映射的内核网卡接口为物理接口Ethernet4对应的内核网卡接口KNI4。Figure 4 is an embodiment of VLAN interface self-communication. In this embodiment, a VLAN interface is created on the security admission control gateway FW1 that applies DPDK, and FW1 selects physical interfaces Ethernet4, Ethernet5, and Ethernet6 to join the VLAN, and connects PC1 and PC2 respectively. , PC3. When an IP address is configured on a VLAN interface, the IP address is synchronously mapped to the kernel NIC interface corresponding to a physical interface. You can choose to map it to the kernel NIC interface corresponding to the first physical interface added to the VLAN among the physical interfaces Ethernet4, Ethernet5, and Ethernet6. Assume that the IP address of the VLAN interface on FW1 is IP10, and the mapped kernel NIC interface is the kernel NIC interface KNI4 corresponding to the physical interface Ethernet4.

物理接口Ethernet4、Ethernet5、Ethernet6其中一个移除或者工作状态变为down,需要检测判断是否重新映射内核网卡接口。例如移除Ethernet4,则要删除KNI4映射的IP地址,重新映射内核网卡接口,例如映射给物理接口Ethernet5对应的内核网卡接口KNI5。If one of the physical interfaces Ethernet4, Ethernet5, and Ethernet6 is removed or the working status becomes down, it is necessary to detect and determine whether to remap the kernel NIC interface. For example, if Ethernet4 is removed, the IP address mapped by KNI4 should be deleted, and the interface of the kernel network card should be remapped, such as mapping to the interface KNI5 of the kernel network card corresponding to the physical interface Ethernet5.

VLAN接口IP地址修改或者删除时,需要删除映射的内核网卡接口的IP地址,例如要删除KNI4映射的IP地址。When the IP address of the VLAN interface is modified or deleted, the IP address of the mapped kernel NIC interface needs to be deleted, for example, the IP address mapped by KNI4 needs to be deleted.

PC1、PC2、PC3配置和VLAN接口同网段的IP地址,PC1、PC2、PC3和VLAN接口通信时,全部送往KNI4接口,由Linux协议栈来回应报文交互。而其他经过VLAN接口转发的数据报文,则由VLAN接口正常转发。PC1, PC2, PC3 are configured with the IP address of the VLAN interface on the same network segment. When PC1, PC2, PC3 communicates with the VLAN interface, they are all sent to the KNI4 interface, and the Linux protocol stack responds to the message exchange. Other data packets forwarded by the VLAN interface are normally forwarded by the VLAN interface.

本申请的另一个实施例,如图5所示,还提供了一种逻辑接口数据通信装置,应用于基于数据平面开发套件DPDK的网络设备,所述逻辑接口数据通信装置,包括:Another embodiment of the present application, as shown in FIG. 5 , further provides a logical interface data communication device, which is applied to a network device based on the data plane development kit DPDK, and the logical interface data communication device includes:

配置模块,用于创建逻辑接口,将逻辑接口的接口配置映射给一个成员接口对应的内核网卡接口;The configuration module is used to create a logical interface and map the interface configuration of the logical interface to the kernel network card interface corresponding to a member interface;

自身通信模块,用于接收访问所述逻辑接口自身的数据报文,将接收的数据报文发送给映射的内核网卡接口;接收所述内核网卡接口的回应报文,通过所述逻辑接口发送。The self-communication module is used for receiving the data message accessing the logical interface itself, and sending the received data message to the mapped kernel network card interface; receiving the response message of the kernel network card interface, and sending it through the logical interface.

关于逻辑接口数据通信装置的具体限定可以参见上文中对于逻辑接口数据通信方法的限定,在此不再赘述。上述逻辑接口数据通信装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific limitation of the logical interface data communication apparatus, reference may be made to the above limitation on the logical interface data communication method, which will not be repeated here. Each module in the above-mentioned logical interface data communication device may be implemented in whole or in part by software, hardware and combinations thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

与上述逻辑接口数据通信方法对应的,可选的,所述配置模块将逻辑接口的接口配置映射给一个成员接口对应的内核网卡接口,执行如下操作:Corresponding to the above logical interface data communication method, optionally, the configuration module maps the interface configuration of the logical interface to a kernel network card interface corresponding to a member interface, and performs the following operations:

在逻辑接口下无成员接口,开始加入成员接口时,将逻辑接口的接口配置映射给第一个成员接口对应的内核网卡接口;When there is no member interface under the logical interface, when the member interface is added, the interface configuration of the logical interface is mapped to the kernel NIC interface corresponding to the first member interface;

在逻辑接口下移除成员接口时,判断所移除的成员接口是否是第一个成员接口,如果是第一个成员接口,则删除所移除的成员接口对应的内核网卡接口的接口配置,将逻辑接口的接口配置映射给新的第一个成员接口对应的内核网卡接口。When removing a member interface from a logical interface, determine whether the removed member interface is the first member interface. If it is the first member interface, delete the interface configuration of the kernel NIC interface corresponding to the removed member interface. Map the interface configuration of the logical interface to the kernel NIC interface corresponding to the new first member interface.

可选的,所述配置模块将逻辑接口的接口配置映射给一个成员接口对应的内核网卡接口,执行如下操作:Optionally, the configuration module maps the interface configuration of the logical interface to a kernel network card interface corresponding to a member interface, and performs the following operations:

在逻辑接口下已有成员接口时,将逻辑接口的接口配置映射给其中一个成员接口对应的内核网卡接口;When there are member interfaces under the logical interface, map the interface configuration of the logical interface to the kernel NIC interface corresponding to one of the member interfaces;

在逻辑接口下移除成员接口时,判断所移除的成员接口的内核网卡接口是否映射了接口配置,如果是,则删除该成员接口对应的内核网卡接口的接口配置,将逻辑接口的接口配置映射给另一个成员接口对应的内核网卡接口。When removing a member interface from a logical interface, determine whether the kernel NIC interface of the removed member interface is mapped with the interface configuration. If so, delete the interface configuration of the kernel NIC interface corresponding to the member interface, and configure the interface configuration of the logical interface. Map to the corresponding kernel NIC interface of another member interface.

与上述逻辑接口数据通信方法对应的,本申请所述配置模块,还用于:Corresponding to the above-mentioned logical interface data communication method, the configuration module described in this application is also used for:

在删除逻辑接口的接口配置时,删除映射的内核网卡接口的接口配置。When deleting the interface configuration of a logical interface, delete the interface configuration of the mapped kernel NIC interface.

与上述逻辑接口数据通信方法对应的,本申请所述配置模块,还用于:Corresponding to the above-mentioned logical interface data communication method, the configuration module described in this application is also used for:

在删除逻辑接口时,删除映射的内核网卡接口的接口配置。When deleting a logical interface, delete the interface configuration of the mapped kernel NIC interface.

以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only represent several embodiments of the present application, and the descriptions thereof are specific and detailed, but should not be construed as a limitation on the scope of the invention patent. It should be pointed out that for those skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the scope of protection of the patent of the present application shall be subject to the appended claims.

Claims (10)

1. A logic interface data communication method is applied to network equipment based on a data plane development kit DPDK, and is characterized in that the logic interface data communication method comprises the following steps:
creating a logic interface, and mapping the interface configuration of the logic interface to a kernel network card interface corresponding to a member interface;
receiving a data message for accessing the logic interface, and sending the received data message to a mapped kernel network card interface;
and receiving a response message of the kernel network card interface, and sending the response message through the logic interface.
2. The logical interface data communication method according to claim 1, wherein mapping the interface configuration of the logical interface to a kernel network card interface corresponding to a member interface comprises:
no member interface exists under the logic interface, and when the member interface is added, the interface configuration of the logic interface is mapped to the kernel network card interface corresponding to the first member interface;
and when the member interface is removed under the logic interface, judging whether the removed member interface is the first member interface, if so, deleting the interface configuration of the kernel network card interface corresponding to the removed member interface, and mapping the interface configuration of the logic interface to the new kernel network card interface corresponding to the first member interface.
3. The logical interface data communication method according to claim 1, wherein mapping the interface configuration of the logical interface to a kernel network card interface corresponding to a member interface comprises:
when a member interface exists under the logical interface, mapping the interface configuration of the logical interface to a kernel network card interface corresponding to one member interface;
when the member interface is removed under the logic interface, judging whether the kernel network card interface of the removed member interface maps the interface configuration, if so, deleting the interface configuration of the kernel network card interface corresponding to the member interface, and mapping the interface configuration of the logic interface to the kernel network card interface corresponding to another member interface.
4. The logical interface data communication method of claim 1, further comprising:
and when the interface configuration of the logical interface is deleted, deleting the interface configuration of the mapped kernel network card interface.
5. The logical interface data communication method of claim 1, further comprising:
and when the logical interface is deleted, deleting the interface configuration of the mapped kernel network card interface.
6. A logic interface data communication device is applied to network equipment based on a data plane development kit DPDK, and is characterized by comprising:
the configuration module is used for creating a logic interface and mapping the interface configuration of the logic interface to a kernel network card interface corresponding to a member interface;
the self communication module is used for receiving a data message for accessing the logic interface and sending the received data message to the mapped kernel network card interface; and receiving a response message of the kernel network card interface, and sending the response message through the logic interface.
7. The logical interface data communication apparatus according to claim 6, wherein the configuration module maps the interface configuration of the logical interface to a kernel network card interface corresponding to one member interface, and performs the following operations:
no member interface exists under the logic interface, and when the member interface is added, the interface configuration of the logic interface is mapped to the kernel network card interface corresponding to the first member interface;
and when the member interface is removed under the logic interface, judging whether the removed member interface is the first member interface, if so, deleting the interface configuration of the kernel network card interface corresponding to the removed member interface, and mapping the interface configuration of the logic interface to the new kernel network card interface corresponding to the first member interface.
8. The logical interface data communication apparatus according to claim 6, wherein the configuration module maps the interface configuration of the logical interface to a kernel network card interface corresponding to one member interface, and performs the following operations:
when the member interface exists under the logic interface, the interface configuration of the logic interface is mapped to the inner core network card interface corresponding to one member interface;
when the member interface is removed under the logic interface, judging whether the kernel network card interface of the removed member interface maps the interface configuration, if so, deleting the interface configuration of the kernel network card interface corresponding to the member interface, and mapping the interface configuration of the logic interface to the kernel network card interface corresponding to another member interface.
9. The logical interface data communication apparatus of claim 6, wherein the configuration module is further to:
and when the interface configuration of the logical interface is deleted, deleting the interface configuration of the mapped kernel network card interface.
10. The logical interface data communication apparatus of claim 6, wherein the configuration module is further to:
and when the logical interface is deleted, deleting the interface configuration of the mapped kernel network card interface.
CN202011448182.0A 2020-12-09 2020-12-09 Logic interface data communication method and device Active CN114615187B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011448182.0A CN114615187B (en) 2020-12-09 2020-12-09 Logic interface data communication method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011448182.0A CN114615187B (en) 2020-12-09 2020-12-09 Logic interface data communication method and device

Publications (2)

Publication Number Publication Date
CN114615187A true CN114615187A (en) 2022-06-10
CN114615187B CN114615187B (en) 2024-04-26

Family

ID=81856258

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011448182.0A Active CN114615187B (en) 2020-12-09 2020-12-09 Logic interface data communication method and device

Country Status (1)

Country Link
CN (1) CN114615187B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2025167102A1 (en) * 2024-02-08 2025-08-14 华为云计算技术有限公司 Data transmission method based on bus technology, and related apparatus

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110224929A (en) * 2019-04-17 2019-09-10 西安交大捷普网络科技有限公司 The data packet forwarding method of link aggregation interface based on DPDK
US20200186390A1 (en) * 2017-07-14 2020-06-11 Nicira, Inc. In-band management interface with user space datapath
CN111934894A (en) * 2019-05-13 2020-11-13 烽火通信科技股份有限公司 Method and system for managing wireless network interface based on DPDK

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200186390A1 (en) * 2017-07-14 2020-06-11 Nicira, Inc. In-band management interface with user space datapath
CN110224929A (en) * 2019-04-17 2019-09-10 西安交大捷普网络科技有限公司 The data packet forwarding method of link aggregation interface based on DPDK
CN111934894A (en) * 2019-05-13 2020-11-13 烽火通信科技股份有限公司 Method and system for managing wireless network interface based on DPDK

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2025167102A1 (en) * 2024-02-08 2025-08-14 华为云计算技术有限公司 Data transmission method based on bus technology, and related apparatus

Also Published As

Publication number Publication date
CN114615187B (en) 2024-04-26

Similar Documents

Publication Publication Date Title
CN111885075B (en) Container communication method, device, network equipment and storage medium
CN116057910B (en) Virtual private cloud communication and configuration method and related device
EP2206052B1 (en) Methods and apparatus for managing addresses related to virtual partitions of a session exchange device
CN107222353B (en) Support protocol-independent software-defined network virtualization management platform
CN106789526B (en) method and device for connecting multiple system networks
WO2020073685A1 (en) Forwarding path determining method, apparatus and system, computer device, and storage medium
US8984114B2 (en) Dynamic session migration between network security gateways
CN110505244B (en) Remote tunnel access technology gateway and server
CN111556110B (en) Automatic adaptation method for different physical service networks of private cloud system
WO2016184283A1 (en) Data stream management method and system for virtual machine
CN111010340B (en) Data message forwarding control method and device and computing device
WO2023123899A1 (en) Network slice access method, apparatus and system, and storage medium
WO2023165137A1 (en) Cross-cluster network communication system and method
CN115189920A (en) Cross-network domain communication method and related device
WO2022063249A1 (en) Address management method, apparatus and system
CN105554176A (en) Method and device for sending message and communication system
CN114389967A (en) Link detection method, device, equipment and storage medium
JP2001211190A (en) Communication management device and communication management method
CN114615187B (en) Logic interface data communication method and device
CN115361443A (en) Message processing method and system
CN111130978B (en) Network traffic forwarding method and device, electronic equipment and machine-readable storage medium
CN117499293B (en) Routing table maintenance method, path selection method, device, system and storage medium
CN113542108A (en) IPv 6-based distributed tunnel interconnection gateway
US12003417B2 (en) Communication method and apparatus
CN113765799A (en) Method for sending and receiving container messages, storage medium, and container communication system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant