A network communication method, apparatus, device, and storage medium

By creating logical switches and configuring the Underlay network of DPU nodes in the Kubernetes environment, NAT address translation is eliminated, which solves the security and performance issues of business pods providing services to the outside world in Kubernetes, and achieves efficient network communication and cluster availability.

CN119697136BActive Publication Date: 2026-03-27YUSUR TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In a Kubernetes environment, directly exposing business pods to the public network can lead to security and performance issues. Traditional NAT address translation increases network latency and reduces performance.

Method used

By creating logical switches and configuring their network parameters, logical and physical networks are connected. DPU nodes are used to form an Underlay network, eliminating NAT address translation and enabling service nodes to directly provide services to the outside world through logical switches, thus shortening the network path.

Benefits of technology

The network communication process has been optimized, improving the network efficiency of business nodes in providing services to the outside world, ensuring network security and service quality, and achieving high availability and scalability of the K8s cluster.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119697136B_ABST
    Figure CN119697136B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of network communication method, device, equipment and storage medium.The network communication method includes: creating logical switch, and the first network parameter of logical switch is configured, to make logical switch be used to connect logical network and physical network;First service node is created, and the second network parameter of first service node is configured, to connect the communication between first service node and logical switch, and first service node and logical switch are located in same logical network;The network communication of first service node and first physical node is carried out through logical switch, wherein, first physical node is located in physical network.The method provided in the application, by network configuration to node and logical switch, shorten network communication path, improve the network efficiency that node provides service to physical network.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of network communication, and in particular to a network communication method, device, equipment and storage medium. BACKGROUND

[0002] In modern cloud computing and micro-service architecture, Kubernetes (K8s for short) has become a standard tool for container orchestration and management. As the complexity and scale of business continue to expand, the demand for business pods to provide services to external networks also increases. However, directly exposing business pods to the public network will bring many security and performance problems. In order to ensure the secure transmission of data and optimize network traffic, traditional K8s clusters usually use NAT (Network Address Translation) to convert the private IP address of the pod into a public IP address in order to provide services externally. However, NAT increases network latency and reduces performance. Therefore, there is an urgent need to provide a network communication method for shortening the network path and optimizing the network communication process when a business pod needs to provide services to an external network in a Kubernetes environment. SUMMARY

[0003] In order to solve the above technical problems, the present application provides a network communication method, device, equipment and storage medium.

[0004] In a first aspect, the present application provides a network communication method, comprising:

[0005] creating a logical switch and configuring a first network parameter of the logical switch to make the logical switch used to connect a logical network and a physical network;

[0006] creating a first business node and configuring a second network parameter of the first business node to connect the communication between the first business node and the logical switch, and the first business node and the logical switch are located in the same logical network;

[0007] performing network communication between the first business node and a first physical node through the logical switch, wherein the first physical node is located in the physical network.

[0008] Optionally, the configuration of the first network parameter of the logical switch comprises:

[0009] setting at least one lsp port of the localnet type for the logical switch, and determining a first lsp port corresponding to the first business node in the at least one lsp port, and the first lsp port is used to connect the first business node located in the logical network;

[0010] configuring an external bridge interface for the logical switch, the external bridge interface being used to connect a first physical node located in a physical network.

[0011] Optionally, the configuring the second network parameter of the first service node comprises:

[0012] configuring a first network interface of the localnet type for the first service node, wherein the first lsp port and the first network interface have the same MAC address.

[0013] setting an Underlay network IP address for the first service node, wherein the Underlay network IP address represents that the first service node and the logical switch are located in the same network segment.

[0014] Optionally, the method further comprises:

[0015] determining an internal bridge interface in the at least one lsp port, the internal bridge interface and the external bridge interface constituting a virtual bridge interface pair of the logical switch, the internal bridge interface being used to connect the external bridge interface and the first lsp port.

[0016] Optionally, in a case where the first physical node requests network communication from the first service node, the performing network communication between the first service node and the first physical node through the logical switch comprises:

[0017] after the external bridge interface receives a communication request of the first physical node, forwarding the communication request to the first lsp port through the internal bridge interface;

[0018] forwarding the communication request to the first service node through the first lsp port.

[0019] Optionally, after the creating the logical switch, the method further comprises:

[0020] configuring an OVN parameter for the logical switch, the OVN parameter being used to define a mapping relationship between a second physical node located in the physical network and the logical switch;

[0021] performing network communication between the logical switch and other switches through the second physical node according to the mapping relationship.

[0022] Optionally, the method further comprises:

[0023] create a second service node and configure a third network parameter of the second service node to connect communication between the second service node and the logical switch, and the first service node, the second service node and the logical switch are located in a same logical network;

[0024] perform network communication between the second service node and the first physical node through the logical switch.

[0025] In a second aspect, the embodiments of the present disclosure provide a network communication device, comprising:

[0026] a first creating unit configured to create a logical switch and configure a first network parameter of the logical switch to connect a logical network and a physical network through the logical switch;

[0027] a second creating unit configured to create a first service node and configure a second network parameter of the first service node to connect communication between the first service node and the logical switch, and the first service node and the logical switch are located in a same logical network;

[0028] a network communication unit configured to perform network communication between the first service node and a first physical node through the logical switch, wherein the first physical node is located in the physical network.

[0029] In a third aspect, the embodiments of the present disclosure provide an electronic device, comprising:

[0030] a memory;

[0031] a processor; and

[0032] a computer program;

[0033] wherein the computer program is stored in the memory and configured to be executed by the processor to implement the network communication method as described above.

[0034] In a fourth aspect, the embodiments of the present disclosure provide a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the network communication method as described above.

[0035] The network communication method provided by the present disclosure comprises: creating a logical switch and configuring a first network parameter of the logical switch to make the logical switch used to connect a logical network and a physical network; creating a first service node and configuring a second network parameter of the first service node to connect communication between the first service node and the logical switch, and the first service node and the logical switch are located in the same logical network; and performing network communication of the first service node and a first physical node through the logical switch, wherein the first physical node is located in the physical network. The method provided by the present disclosure configures a network policy between the logical switch and the node, when the service node provides a service for the physical network, directly realizes network communication between the physical network and the node located in the logical network through the logical switch, not only realizes egress isolation and ingress isolation of the node, but also shortens the path of network communication, for example, cancels NAT address conversion, the service node can directly provide a service through the logical switch, optimizes the network communication process, and further improves the network efficiency of the service node for providing the service for the physical network. BRIEF DESCRIPTION OF DRAWINGS

[0036] The accompanying drawings, which are incorporated herein and form part of the specification, illustrate embodiments consistent with the present disclosure and, together with the description, further serve to explain the principles of the present disclosure.

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the accompanying drawings required to be used in the embodiments or prior art description will be briefly introduced. Obviously, those skilled in the art can obtain other drawings according to these drawings without any creative effort.

[0038] Figure 1 A flowchart of the network communication method provided by the present disclosure is shown in the figure;

[0039] Figure 2 A logical network architecture provided by the present disclosure is shown in the figure;

[0040] Figure 3 A physical network architecture provided by the present disclosure is shown in the figure;

[0041] Figure 4 A structure diagram of the network communication device provided by the present disclosure is shown in the figure;

[0042] Figure 5 A structure diagram of the electronic device provided by the present disclosure is shown in the figure. DETAILED DESCRIPTION

[0043] In order to enable a more clear understanding of the above-mentioned purposes, features and advantages of the present disclosure, the schemes of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0044] In the following description, a large number of specific details are set forth in order to facilitate a thorough understanding of the present disclosure, but the present disclosure can also be implemented in other manners different from those described herein; obviously, the embodiments described in the specification are only a part of the embodiments of the present disclosure, and not all the embodiments.

[0045] Before the embodiments of the present disclosure are described in detail, the proper nouns involved are explained and described first, including:

[0046] Kubernetes: also known as K8s, is a container orchestration and management system for automatically deploying, scaling and managing containerized applications.

[0047] pod: is the smallest deployment and management basic unit in the Kubernetes cluster.

[0048] DPU: Data Process Unit, is a data processing unit integrated with network card, central processor and hardware offload, which can perform various network traffic offload.

[0049] OVN: Open Virtual Network, which is an open virtual network, a system for supporting virtual network abstraction.

[0050] OVS: Open virtual switch, an open source multi-layer virtual switch.

[0051] Underlay network: refers to the underlying network that provides the actual physical transmission basis in the network virtualization and overlay (Overlay) network environment, provides the physical path and bandwidth of data transmission, is the basis of implementing Overlay network, and is responsible for the direct connection between physical devices and data transmission.

[0052] In view of the above technical problems, the embodiments of the present disclosure provide a network communication method, in the K8s cluster, the logical switch and the service node are network configured, and the DPU nodes are composed into the Underlay network of the pod, when the service node provides services to the external network / physical network, the network path of the service traffic is shortened through network configuration, such as canceling NAT address translation, and the network efficiency of the service pod providing services to the public network / external network is improved. The above one or more embodiments are described in detail.

[0053] The network communication method provided by the embodiments of the present disclosure can be applied to the scenario of network communication between a pod in an internal network and an external network. The method can be executed by a network communication device, which can be implemented in software and / or hardware, and can be integrated into an electronic device. The electronic device can include, but is not limited to, a mobile terminal such as a smartphone, a notebook computer, a digital broadcast receiver, a personal digital assistant (PDA), a tablet personal computer (Tablet PC), a PMP (portable multimedia player), a vehicle terminal (for example, a vehicle navigation terminal), a wearable device, and the like, and a fixed terminal such as a digital television, a desktop computer, a smart home device, and the like.

[0054] Figure 1 The flowchart of the network communication method provided by the embodiments of the present disclosure is applied to a K8s cluster deployed on a server cluster using a DPU node, and specifically includes the following steps as shown in Figure 1

[0055] S101, creating a logical switch and configuring a first network parameter of the logical switch, so that the logical switch is used to connect a logical network and a physical network.

[0056] It can be understood that at least one logical switch is created, wherein the logical switch is a network virtualization technology used to realize network connection in a virtualization environment. The specific setting method is ls:localnet.network_ovn_localnet_switch. This method refers to a logical switch created in OVN, which is used to simulate or connect a physical network environment, and the logical switch is named "localnet.network_ovn_localnet_switch". The logical switch can be configured and managed through the command line tool ovn-nbctl of OVN. After the creation of the logical switch is completed, the first network parameter of the logical switch is configured. The first network parameter refers to the network parameter related to the interface of the logical switch, so as to realize the connection between the logical switch, the logical network and the physical network through the first network parameter. The logical network can be understood as a virtual network, and the physical network can be understood as a real network, that is, the network communication between the pod in the internal network and the external network is realized through the logical switch.

[0057] Optionally, the configuration of the first network parameter of the logical switch includes:

[0058] ​S101, setting at least one lsp port of a localnet type for the logical switch, and determining a first lsp port corresponding to a first service node in the at least one lsp port, the first lsp port being used to connect the first service node located in the logical network; and configuring an external bridge interface for the logical switch, the external bridge interface being used to connect a first physical node located in the physical network.

[0059] It can be understood that the first network parameter is configured for the logical switch in the following manner: at least one lsp port of a localnet type is set for the logical switch, and the number of the lsp ports is related to the external network to be connected and the service node to be connected, that is, the number of the lsp ports can be determined according to the external network to be connected and the service node to be connected. After the lsp ports are set, a first lsp port corresponding to a first service node is determined in the at least one lsp port, that is, the lsp port allocated to the first service node is determined, and the first service node can be a service pod. The first lsp port is used to connect the first service node located in the logical network, wherein the first service node and the logical switch are located in the same logical network. After the first lsp port is determined, a port name corresponding to the first service node can also be set for the first lsp port, for example, “lsp-podname”, so as to complete the configuration of the first network parameter and the second network parameter through the port name. Subsequently, the ovs parameter is set for the logical switch, and the external bridge interface is determined, which can be achieved by the following setting manner: ovs-bridge-mappings="physnet:br-out", wherein the external bridge interface is denoted as br-out, and the external bridge interface is used to connect the first physical node in the physical network, and the first physical node can be a physical switch. After the network configuration of the logical switch is completed, the logical switch can realize the connection between the service node and the external network in the internal network. The configuration of the first network parameter includes the configuration of the lsp port and the bridge interface.

[0060] S102, creating a first service node, and configuring a second network parameter of the first service node to connect the communication between the first service node and the logical switch, and the first service node and the logical switch are located in the same logical network.

[0061] It can be understood that on the basis of the above S101, the first service node is created, for example, a pod node is created, and the second network parameter of the first service node is configured, the second network parameter being the network parameter of the pod node related port, so as to realize the connection between the first service node and the logical switch through the second network parameter, and the first service node and the logical switch are located in the same logical network.

[0062] Optionally, the first service node is configured with the second network parameter, and the configuration can be implemented through the following steps:

[0063] The first service node is configured with the first network interface of the localnet type, and the first lsp port and the first network interface have the same MAC address. The first service node is set with the Underlay network IP address, and the Underlay network IP address represents that the first service node and the logical switch are located in the same network segment.

[0064] It can be understood that the second network parameter of the pod node is configured in the following manner: the first service node is configured with the first network interface of the localnet type, and the configuration can be implemented through the following manner: K8s.v1.cni.cncf.io / networks:localnet-network, that is, the first lsp port and the first network interface are both set with the interface of the localnet type, and the first lsp port and the first network interface have the same MAC address, so as to realize the connection between the logical switch and the first service node through the first lsp port and the first network interface. Then, the first service node is set with the Underlay network IP address, and the first service node can be configured on the DPU node, that is, the IP address of the Underlay network is allocated to the pod on the DPU node, and the Underlay network IP address represents that the first service node and the logical switch are located in the same network segment. It can be understood that the IP address is composed of four bytes, and the first three bytes are the same, which means that the network part of the two IP addresses has the same value, that is, when the first three bytes of the two IP addresses are the same, it means that the two IP addresses are located in the same network segment, that is, the first three bytes of the IP addresses of the first service node and the logical switch are set to be the same, so as to ensure that the first service node and the logical switch are in the same network segment / the same network plane, that is, to ensure that the first service node and the logical switch are in the same logical network. Specifically, the Underlay network can be directly allocated to the pod through the ovn-Kubernetes cni, so that the pod and the K8s node (the K8s node includes the DPU node and the logical switch) are in the same network plane. The configuration of the second network parameter refers to the configuration of the first network interface and the configuration of the Underlay network IP address.

[0065] Optionally, when the first network parameter of the logical switch is configured, the method further comprises:

[0066] determining an internal bridge interface in the at least one lsp port, wherein the internal bridge interface and the external bridge interface form a virtual bridge interface pair of the logical switch, and the internal bridge interface is used to connect the external bridge interface and the first lsp port.

[0067] It can be understood that, while configuring the external bridge interface for the logical switch, the internal bridge interface is determined in the at least one lsp port, that is, the internal bridge interface is configured for the logical switch, wherein the external bridge interface and the internal bridge interface can form a virtual bridge interface pair of the logical switch, and the virtual bridge interface pair is referred to as a patch pair, and the internal bridge interface is referred to as br-int, that is, the patch pair includes br-int and br-out, and the internal bridge interface is specifically used to connect the external bridge interface.

[0068] Optionally, the method further comprises:

[0069] creating a second service node, and configuring a third network parameter of the second service node to connect the communication between the second service node and the logical switch, and the first service node, the second service node and the logical switch are located in the same logical network; and the network communication between the second service node and the first physical node is performed through the logical switch.

[0070] It can be understood that, the second service node is created, and the first service node and the second service node are different pod nodes, and the first service node, the second service node and the logical switch are located in the same logical network, that is, the connection of the same logical switch to multiple pod nodes can be established, and the number of pod nodes connected by the same logical switch is not limited, and can be determined by the user as required, and the multiple pod nodes can also communicate based on the same virtual bridge interface pair and the physical network. Subsequently, the third network parameter is configured for the second service node, for example, a second lsp port corresponding to the second service node is determined in the at least one lsp port, and the second lsp port is set with a port name corresponding to the second service node, and the first three bytes of the Underlay network ip address of the second service node are set to be the same as the logical switch, that is, the second service node and the logical switch are located in the same network plane, that is, all the pods connected with the logical switch are in the same network plane, which can ensure the network communication efficiency and the network security, and the specific configuration method of the third network parameter is referred to the configuration method of the second network parameter in the above embodiment, which is not described herein.

[0071] Exemplarily, referring to Figure 2 , Figure 2A logical network architecture provided by an embodiment of the present disclosure includes a logical switch (ls: local network), a virtual patch pair configured for the logical switch, a plurality of lsp ports configured for the logical switch, and a plurality of node nodes in the same logical network as the logical switch, wherein the patch pair includes an external bridge interface (br-out) and an internal bridge interface (br-int), the br-int refers to Figure 2 lsp-localnet in the above formula, the plurality of node nodes include node1 and node2, wherein the node1 and node2 each include a plurality of pod nodes, the node1 includes pod1, the node2 includes pod2, the plurality of lsp ports include lsp-localnet and a plurality of lsp-podname corresponding to the plurality of pod nodes, the port name of each lsp-podname corresponding to the pod node is different, and the pod node and the corresponding lsp-podname have the same MAC address, as shown in Figure 2 the MAC address of the pod1 node and the corresponding lsp-podname is "mac:0a:58:c0:a8:64:04", the last byte of the MAC address of different pod nodes is different, and the remaining bytes are the same. In addition, each pod node is in the same network segment as the logical switch, that is, the last byte of the IP address of the pod node and the logical switch is different, and the remaining bytes are the same, for example, the IP address of the pod1 is "ip:192.168.100.4", and the IP address of the logical switch is "ip:192.168.100.101".

[0072] S103, performing network communication between the first service node and the first physical node through the logical switch.

[0073] Wherein, the first physical node is located in the physical network.

[0074] It can be understood that, on the basis of the above S102, after completing the network configuration of the logical switch and the first service node, the network communication between the first service node located in the logical network and the first physical node located in the physical network is realized through the logical switch, and the specific network communication mode of the logical network and the physical network is described in detail through the following embodiments.

[0075] Optionally, in the case that the first physical node requests network communication to the first service node, the network communication between the first service node and the first physical node through the logical switch can be realized through the following steps:

[0076] After the external bridge interface receives the communication request of the first physical node, the communication request is forwarded to the first LSP port through the internal bridge interface; and the communication request is forwarded to the first service node through the first LSP port.

[0077] It can be understood that the process of the first physical node requesting network communication from the first service node is as follows: after the first physical node receives the communication request sent by the third service node for requesting network communication from the first service node, the first physical node sends the communication request to the external bridge interface, the communication request is for the third service node to request communication with the first service node, after the external bridge interface receives the communication request, the communication request is sent to the first LSP port through the internal bridge interface, and the first LSP port sends the communication request to the first service node through the first network interface. The third service node can be a pod node which has been configured with network parameters and can perform physical network communication through a certain logical switch, or can be a certain node in the K8s cluster.

[0078] Optionally, in the case that the first service node requests network communication from the first physical node, the network communication between the first service node and the first physical node through the logical switch can be implemented through the following steps:

[0079] After the first LSP port receives the communication request of the first service node, the communication request is forwarded to the external bridge interface through the internal bridge interface; and the communication request is forwarded to the first physical node through the external bridge interface.

[0080] It can be understood that the process of the first service node requesting network communication from the first physical node is as follows: the first service node sends the communication request to the first LSP port through the first network interface, the communication request is for the first service node to request communication with the third service node, the first LSP port sends the communication request to the external bridge interface through the internal bridge interface, the external bridge interface receives the communication request and sends the communication request to the first physical node, and the first physical node sends the communication request to the third service node, for example, the first physical node sends the communication request to the external bridge interface of the logical switch corresponding to the third service node, and the communication process between the third service node and the corresponding logical switch is the same as the communication process between the first service node and the corresponding logical switch, which will not be described here.

[0081] Optionally, after the logical switch is created, the method further includes:

[0082] configuring OVN parameters for the logical switch, the OVN parameters being used to define a mapping relationship between a second physical node of the physical network and the logical switch; and performing, by the second physical node, network communication between the logical switch and other switches according to the mapping relationship.

[0083] It can be understood that after the virtual switch is created, the OVN parameters can also be configured for the logical switch, and the OVN parameters are used to define a mapping relationship between a second physical node of the physical network and the logical switch, that is, in addition to achieving network communication with a certain physical switch through the virtual bridge interface pair configured by the logical switch, the pod node can also achieve network communication with another physical switch through the OVN parameters configured by the logical switch. For example, the first service node and the third service node are configured with the same network, are in different network segments, and both exist corresponding logical switches. In one possible case, the first service node and the third service node achieve network communication with the first physical node based on the virtual bridge interface pair of the corresponding logical switch of each of the first service node and the third service node. In another possible case, the first service node and the third service node achieve network communication with the second physical node based on the OVN interface of the corresponding logical switch of each of the first service node and the third service node.

[0084] For example, referring to Figure 3 , Figure 3A physical network architecture diagram provided by the embodiments of the present disclosure includes a plurality of node and a plurality of physical switches, the plurality of node includes node1 and node2, the node1 includes pod1 and logical switch (Is-1), wherein the pod1 and the Is-1 constitute a work node (work001), correspondingly, the node2 includes pod2 and logical switch (Is-2), wherein the pod2 and the Is-2 constitute a work node (work002), the following embodiments take the work001 as an example for detailed description, the pod1 is provided with a network port (eth1), the Is-1 is provided with an Isp port (Isp-pod1), a virtual network bridge interface pair (patch) and an OVN interface (ovn-xx-0), the patch refers to a network bridge interface pair composed of br-int and br-out. The plurality of physical switches includes a first physical switch and a second physical switch. A network communication mode: the pod1 performs network communication with the first physical switch through the eth1 of the pod1, the Isp-pod1, the patch and the ens3f1 port of the node1, the first physical switch performs network communication with the pod2 through the ens3f1 port of the node2, the patch, the Isp-pod2 and the eth1 of the pod2, thereby realizing network communication between the pod1 and the pod2, wherein the ens3f1 port of the pod1 and the ens3f1 port of the pod2 are located in the same network plane. Another network communication mode: the pod1 performs network communication with the second physical switch through the ens3f0 port of the node1, the OVN, the eth1 of the pod1 and the Isp-pod1, the second physical switch performs network communication with the pod2 through the ens3f0 port of the node2, the OVN, the eth1 of the pod2 and the Isp-pod2. The flow of communication of other possible pod nodes through the logical switch and the physical switch in the physical network is not described herein.

[0085] The network communication method provided by the embodiment of the present disclosure is used in a K8s cluster, and a DPU node is used as an Underlay network of a service Pod, that is, the DPU node can be used as a part of the Underlay network to provide a network connection with low delay and high throughput, and further can significantly improve the network efficiency and performance of the service Pod in providing services to an external network. Meanwhile, by performing network configuration on a logical switch and canceling address conversion of NAT, the service Pod can directly use an external network bridge interface of the logical switch to provide services to the outside, so as to shorten a network path and improve network efficiency, and network policies are used to control network traffic between service Pods, and further ensure network security and service quality. In addition, by using the DPU node as the Underlay network and canceling the address conversion of NAT, not only the network efficiency of a single Pod can be improved, but also high availability and scalability of the entire K8s cluster can be realized.

[0086] Figure 4 A structural schematic diagram of the network communication device provided by the embodiment of the present disclosure is shown in the figure. The network communication device provided by the embodiment of the present disclosure can execute the processing flow provided by the network communication method embodiment, as shown in the figure. Figure 4 The network communication device 400 includes a first creation unit 401, a second creation unit 402 and a network communication unit 403, wherein:

[0087] The first creation unit 401 is configured to create a logical switch and configure a first network parameter of the logical switch, so that the logical switch is used to connect a logical network and a physical network.

[0088] The second creation unit 402 is configured to create a first service node and configure a second network parameter of the first service node, so as to connect communication between the first service node and the logical switch, and the first service node and the logical switch are located in the same logical network.

[0089] The network communication unit 403 is configured to perform network communication between the first service node and a first physical node through the logical switch, wherein the first physical node is located in the physical network.

[0090] Optionally, the first creation unit 401 is configured to:

[0091] Set at least one lsp port of a localnet type for the logical switch, and determine a first lsp port corresponding to the first service node in the at least one lsp port, and the first lsp port is used to connect the first service node located in the logical network.

[0092] Configure an external network bridge interface for the logical switch, and the external network bridge interface is used to connect the first physical node located in the physical network.

[0093] Optionally, the second creating unit 402 is configured to:

[0094] configure a first network interface of the localnet type for the first service node, wherein the first lsp port and the first network interface have the same MAC address;

[0095] set an Underlay network IP address for the first service node, wherein the Underlay network IP address represents that the first service node and the logical switch are located in the same network segment.

[0096] Optionally, the first creating unit 401 is further configured to:

[0097] determine an internal bridge interface in the at least one lsp port, wherein the internal bridge interface and the external bridge interface constitute a virtual bridge interface pair of the logical switch, and the internal bridge interface is used to connect the external bridge interface and the first lsp port.

[0098] Optionally, the network communication unit 403 is configured to:

[0099] after receiving a communication request of a first physical node at the external bridge interface, forward the communication request to the first lsp port through the internal bridge interface;

[0100] forward the communication request to the first service node through the first lsp port.

[0101] Optionally, the network communication apparatus 400 is further configured to:

[0102] configure an OVN parameter for the logical switch, wherein the OVN parameter is used to define a mapping relationship between a second physical node located in the physical network and the logical switch;

[0103] perform network communication between the logical switch and other switches through the second physical node according to the mapping relationship.

[0104] Optionally, the network communication apparatus 400 is further configured to:

[0105] create a second service node, and configure a third network parameter of the second service node to connect communication between the second service node and the logical switch, and the first service node, the second service node and the logical switch are located in the same logical network;

[0106] perform network communication between the second service node and the first physical node through the logical switch.

[0107] Figure 4 The network communication apparatus of the illustrated embodiment can be used to implement the technical solutions of the method embodiments described above, and has similar principles and technical effects, which will not be described here.

[0108] Figure 5 A structural schematic diagram of an electronic device is provided for the embodiments of the present disclosure. The following specifically refers to Figure 5 which shows a structural schematic diagram of an electronic device 500 suitable for implementing the embodiments of the present disclosure. The electronic device 500 in the embodiments of the present disclosure can include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet PCs), PMPs (Portable Multimedia Players), vehicle terminals (such as vehicle navigation terminals), wearable electronic devices, and the like, as well as fixed terminals such as digital TVs, desktop computers, smart home devices, and the like. Figure 5 The electronic device shown is merely an example and should not impose any limitation on the functions and use range of the embodiments of the present disclosure.

[0109] As shown in Figure 5 , the electronic device 500 can include a processing apparatus 501 (such as a central processor, a graphics processor, etc.) that can perform various appropriate actions and processes to implement the network communication method of the embodiments as described in the present disclosure according to programs stored in a read-only memory (ROM) 502 or programs loaded from a storage apparatus 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the electronic device 500 are also stored in the RAM 503. The processing apparatus 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0110] Generally, the following apparatuses can be connected to the I / O interface 505: input apparatuses 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, and the like; output apparatuses 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, and the like; storage apparatuses 508 including, for example, a magnetic tape, a hard disk, and the like; and a communication apparatus 509. The communication apparatus 509 can allow the electronic device 500 to communicate wirelessly or by wire with other devices to exchange data. Although Figure 5 The electronic device 500 with various apparatuses is shown, but it should be understood that it is not required to implement or have all the apparatuses shown. More or fewer apparatuses can be implemented or provided instead.

[0111] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for executing the methods illustrated by the flowcharts, thereby implementing the network communication method as described above. In such embodiments, the computer program can be downloaded and installed from a network by the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the methods of embodiments of the present disclosure are performed.

[0112] It should be noted that the computer-readable medium described above in the present disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium, for example, can be, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any suitable combination thereof. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program used or used in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take many forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained in the computer-readable medium can be transmitted by any suitable medium, including but not limited to a wire, an optical fiber, an RF (radio frequency) or the like, or any suitable combination thereof.

[0113] In some embodiments, the client, server, or other computing machines can communicate using any known or later developed form of computer-readable media, including but not limited to wireless media, wire-based media, optical-based media, and the like. In some embodiments, the client, server, or other computing machines can communicate using any current or later developed network protocol, such as the HyperText Transfer Protocol (HTTP), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet, and the like, as well as any current or later developed network.

[0114] The computer-readable medium described above can be included within the electronic device described above; or can exist separately from the electronic device, and not be assembled into the electronic device.

[0115] Optionally, when the one or more programs described above are executed by the electronic device, the electronic device can further perform other steps described in the embodiments above.

[0116] Computer program code for carrying out operations of the present disclosure can be written in any one or more of a number of programming languages or combinations of languages including an object-oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network ("LAN") or a wide area network ("WAN"), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0117] The computer program product of the first aspect can include one or more non-transitory computer-readable media storing instructions that, when executed, cause one or more processors to perform the operations of the first aspect. The computer program product of the first aspect can include a non-transitory computer-readable medium storing code that, when executed, causes a computer to perform operations for the first aspect.

[0118] The units described in the embodiments of the present disclosure can be implemented by software, or by hardware, or by a combination of software and hardware. In some cases, the names of the units do not constitute a limitation on the units themselves.

[0119] The functions described in this document can be implemented in part or in whole using one or more hardware logic components. For example, and without limitation, illustrative types of hardware logic components that can be used include Field-programmable Gate Arrays (FPGAs), Program-specific Integrated Circuits (ASICs), Program-specific Standard Products (ASSPs), System-on-a-chip systems (SOCs), Complex Programmable Logic Devices (CPLDs), etc.

[0120] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0121] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or gateway that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or gateway. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or gateway that includes said element.

[0122] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A network communication method, characterized in that, include: Create a logical switch and configure the first network parameters of the logical switch, including: setting at least one LSP port of type localnet for the logical switch, and determining a first LSP port corresponding to a first service node among the at least one LSP port, the first LSP port being used to connect the first service node located within the logical network; configuring an external bridge interface for the logical switch, the external bridge interface being used to connect the first physical node located in the physical network, so that the logical switch can be used to connect the logical network and the physical network; Creating a first service node and configuring second network parameters for the first service node includes: configuring a first network interface of type localnet for the first service node, wherein the first LSP port and the first network interface have the same MAC address; setting an Underlay network IP address for the first service node, wherein the Underlay network IP address indicates that the first service node and the logical switch are located in the same network segment to connect communication between the first service node and the logical switch, and the first service node and the logical switch are located in the same logical network; The first service node and the first physical node communicate directly through the logical switch, and the network communication does not require Network Address Translation (NAT). The first physical node is located in the physical network.

2. The method according to claim 1, characterized in that, The method further includes: An internal bridge interface is determined in the at least one LSP port, wherein the internal bridge interface and the external bridge interface form a virtual bridge interface pair of the logical switch, and the internal bridge interface is used to connect the external bridge interface and the first LSP port.

3. The method according to claim 2, characterized in that, When the first physical node requests network communication from the first service node, the step of conducting network communication between the first service node and the first physical node through the logical switch includes: After receiving a communication request from the first physical node through the external bridge interface, the communication request is forwarded to the first LSP port through the internal bridge interface. The communication request is forwarded to the first service node through the first LSP port.

4. The method according to claim 1, characterized in that, After creating the logical switch, the method further includes: Configure OVN parameters for the logical switch, the OVN parameters being used to define the mapping relationship between the second physical node located in the physical network and the logical switch; The second physical node enables network communication between the logical switch and other switches based on the mapping relationship.

5. The method according to claim 1, characterized in that, The method further includes: A second service node is created, and a third network parameter is configured for the second service node to connect the communication between the second service node and the logical switch, wherein the first service node, the second service node, and the logical switch are located in the same logical network; The second service node and the first physical node communicate via the logical switch.

6. A network communication device, characterized in that, include: The first creation unit is used to create a logical switch and configure the first network parameters of the logical switch, including: setting at least one LSP port of type localnet for the logical switch, and determining a first LSP port corresponding to a first service node among the at least one LSP port, the first LSP port being used to connect to the first service node located within the logical network; configuring an external bridge interface for the logical switch, the external bridge interface being used to connect to a first physical node located in the physical network, so that the logical switch can be used to connect the logical network and the physical network; The second creation unit is used to create a first service node and configure the second network parameters of the first service node, including: configuring a first network interface of type localnet for the first service node, wherein the first LSP port and the first network interface have the same MAC address; setting an Underlay network IP address for the first service node, wherein the Underlay network IP address indicates that the first service node and the logical switch are located in the same network segment to connect the communication between the first service node and the logical switch, and the first service node and the logical switch are located in the same logical network; A network communication unit is used to directly conduct network communication between the first service node and the first physical node through the logical switch, and the network communication does not require Network Address Translation (NAT), wherein the first physical node is located in the physical network.

7. An electronic device, characterized in that, include: Memory; processor; as well as Computer programs; The computer program is stored in the memory and configured to be executed by the processor to implement the network communication method as described in any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the network communication method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Virtual-real combined network target range platform construction method and controller

    CN118714023A