Network communication method and device, equipment and storage medium

By creating and configuring the network parameters of logical switches and service nodes in the Kubernetes environment, direct network communication between service nodes and physical nodes is achieved, and security and performance problems when service pods in the Kubernetes environment are solved when providing services to external networks, optimizing network communication paths and improving efficiency.

CN119697136AActive Publication Date: 2025-03-25YUSUR TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411583822.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-03-25
Estimated Expiration
2044-11-07

AI Technical Summary

Technical Problem

In Kubernetes environment, when business pods need to provide services to external networks, directly exposed to public networks will bring security and performance problems, and traditional NAT increases network latency and reduces performance.

Method used

By creating a logical switch and configuring its network parameters, connecting the logical network and the physical network, creating a business node and configuring its network parameters to connect the logical switch, realizing direct network communication between the business node and the physical node, canceling NAT address conversion.

Benefits of technology

The network path is shortened, the network communication process is optimized, the network efficiency of service nodes to provide services to the physical network is improved, and network security and service quality are ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119697136A_ABST
    Figure CN119697136A_ABST
Patent Text Reader

Abstract

The invention relates to a network communication method and device, equipment and a storage medium. The network communication method comprises the following steps: creating a logic switch, and configuring a first network parameter of the logic switch, so that the logic switch is used for connecting a logic network and a physical network; a first service node is created, a second network parameter of the first service node is configured to connect communication between the first service node and the logic switch, and the first service node and the logic switch are located in the same logic network; network communication between the first service node and a first physical node is carried out through the logic switch, and the first physical node is located in a physical network. According to the method provided by the invention, network configuration is performed on the node and the logic switch, so that a network communication path is shortened, and the network efficiency of providing services for a physical network by the node is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network communication technology, and in particular to a network communication method, device, equipment and storage medium. Background Art

[0002] In modern cloud computing and microservices 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 is also increasing. However, directly exposing business pods to the public network will bring many security and performance issues. 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 to a public IP address in order to provide services to the outside world. However, NAT will increase network latency and reduce performance. Therefore, there is an urgent need to provide a network communication method that shortens the network path and optimizes the network communication process by configuring policies when business pods in a Kubernetes environment need to provide services to external networks. Summary of the invention

[0003] In order to solve the above technical problems, the embodiments of the present disclosure provide a network communication method, apparatus, device and storage medium.

[0004] In a first aspect, an embodiment of the present disclosure provides a network communication method, including:

[0005] Creating a logical switch, and configuring a first network parameter of the logical switch so that the logical switch is used to connect the logical network and the physical network;

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

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

[0008] Optionally, the configuring the first network parameter of the logical switch includes:

[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 service node in the at least one LSP port, where the first LSP port is used to connect to the first service node in the logical network;

[0010] An external bridge interface is configured for the logical switch, where the external bridge interface is used to connect to a first physical node in the physical network.

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

[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] An Underlay network IP address is set 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.

[0014] Optionally, the method further includes:

[0015] An internal bridge interface is determined in the at least one lsp port, 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.

[0016] Optionally, when the first physical node requests network communication from the first service node, performing network communication between the first service node and the first physical node through the logical switch includes:

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

[0018] The communication request is forwarded to the first service node through the first lsp port.

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

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

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

[0022] Optionally, the method further includes:

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

[0024] Network communication between the second service node and the first physical node is performed through the logical switch.

[0025] In a second aspect, an embodiment of the present disclosure provides a network communication device, including:

[0026] A first creating unit, 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 the logical network and the physical network;

[0027] A second creation unit, configured to create a first service node and configure 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;

[0028] A network communication unit is used 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, an embodiment of the present disclosure provides an electronic device, including:

[0030] Memory;

[0031] Processor; and

[0032] Computer programs;

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

[0034] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above-mentioned network communication method when executed by a processor.

[0035] The network communication method provided by the present application includes: creating a logical switch and configuring the first network parameter of the logical switch so that the logical switch is used to connect the logical network and the physical network; creating a first service node and configuring the 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; performing network communication between the first service node and the first physical node through the logical switch, wherein the first physical node is located in the physical network. The method provided by the present application configures the network policy between the logical switch and the node. When the service node provides services to the physical network, the network communication between the physical network and the node located in the logical network is directly realized through the logical switch, which not only realizes the egress isolation and ingress isolation of the node, but also shortens the path of network communication, for example, cancels the NAT address translation, and the service node can directly provide services to the outside through the logical switch, which optimizes the network communication process and further improves the network efficiency of the service node in providing services to the physical network. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0038] Figure 1 A flowchart of a network communication method provided by an embodiment of the present disclosure;

[0039] Figure 2 A logical network architecture diagram provided for an embodiment of the present disclosure;

[0040] Figure 3 A physical network architecture diagram provided for an embodiment of the present disclosure;

[0041] Figure 4 A schematic diagram of the structure of a network communication device provided in an embodiment of the present disclosure;

[0042] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0043] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme 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, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0045] Before describing the embodiments of the present disclosure in detail, the relevant terms are explained first, among which:

[0046] Kubernetes: Also known as K8s, it is a container orchestration and management system used to automatically deploy, scale, and manage containerized applications.

[0047] Pod: It is the smallest basic unit of deployment and management in a Kubernetes cluster.

[0048] DPU: Data Process Unit, is a data processing unit that integrates network card, central processing unit and hardware offload, and can perform various network traffic offloads.

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

[0050] OVS: Open virtual switch is 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 network environment. It provides the physical path and bandwidth for data transmission, is the basis for implementing the overlay network, and is responsible for direct connection and data transmission between physical devices.

[0052] In view of the above technical problems, the embodiments of the present disclosure provide a network communication method. In a K8s cluster, the network configuration is performed on the logical switch and the service node, and the DPU nodes are composed of 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 the network configuration, such as canceling NAT address translation, etc., thereby improving the network efficiency of the service pod in providing services to the public network / external network. This is described in detail through one or more of the following embodiments.

[0053] The network communication method provided by the embodiment of the present disclosure can be applied to the scenario where a pod in an intranet communicates with an external network. The method can be executed by a network communication device, which can be implemented by software and / or hardware, and the device can be integrated in an electronic device. Among them, the electronic device can include but is not limited to mobile terminals such as smart phones, laptops, digital broadcast receivers, personal digital assistants (PDA), tablet computers (Tablet Personal Computer, Tablet PC), PMP (portable multimedia player), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), wearable devices, etc., and fixed terminals such as digital televisions, desktop computers, smart home devices, etc.

[0054] Figure 1 A flow chart of a network communication method provided in an embodiment of the present disclosure is applied to a K8s cluster, which is deployed on a server cluster using a DPU node, specifically including the following: Figure 1 The following steps are shown:

[0055] S101. 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.

[0056] It is understandable that at least one logical switch is created, where the logical switch is a network virtualization technology used to achieve network connection in a virtualized 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 to a physical network environment. The logical switch is named "localnet.network_ovn_localnet_switch" and can be configured and managed through the OVN command line tool ovn-nbctl. After completing the creation of the logical switch, configure the first network parameters of the logical switch. The first network parameters refer to the network parameters related to the logical switch interface, so as to realize the connection between the logical switch and the logical network and the physical network through the first network parameters. 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 located in the intranet and the external network is realized through the logical switch.

[0057] Optionally, the first network parameter of the logical switch is configured as follows:

[0058] At least one LSP port of the localnet type is set for the logical switch, and a first LSP port corresponding to the first business node is determined among the at least one LSP port, wherein the first LSP port is used to connect to the first business node located in the logical network; an external bridge interface is configured for the logical switch, wherein the external bridge interface is used to connect to the first physical node located in the physical network.

[0059] It can be understood that the way to configure the first network parameter for the logical switch is as follows: set at least one LSP port of the localnet type for the logical switch, and the number of LSP ports is related to the external network to be connected and the service node to be connected, that is, the number of LSP ports can be determined according to the external network to be connected and the service node to be connected. After setting the LSP port, determine the first LSP port corresponding to the first service node in at least one LSP port, that is, determine the LSP port assigned to the first service node. The first service node can be a service pod, and the first LSP port is used to connect to 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 determining the first LSP port, you can also set a port name corresponding to the first service node for the first LSP port, such as "lsp-podname", so as to complete the configuration of the first network parameters and the second network parameters through the port name. Then, set the ovs parameters for the logical switch and determine the external bridge interface, which can be achieved by the following settings: ovn-bridge-mappings = "physnet:br-out", where the external bridge interface is recorded as br-out, and the external bridge interface is used to connect the first physical node in the physical network. The first physical node can be a physical switch. After the network configuration of the logical switch is performed, the logical switch can realize the connection between the service node in the intranet and the external network. The configuration of the first network parameter includes the configuration of the lsp port and the bridge interface.

[0060] S102: Create a first service node, and configure a second network parameter of the first service node to connect 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, based on the above S101, a first business node is created, such as a pod node, and a second network parameter of the first business node is configured, where the second network parameter refers to a network parameter of a port related to the pod node, so as to realize the connection between the first business node and the logical switch through the second network parameter, and set the first business node and the logical switch to be in the same logical network.

[0062] Optionally, the above configuration of the second network parameter of the first service node may be implemented through the following steps:

[0063] Configure the 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; set 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.

[0064] It can be understood that the method of configuring the second network parameters for the pod node is as follows: configure the first network interface of the localnet type for the first business node, which can be specifically implemented as follows: K8s.v1.cni.cncf.io / networks:localnet-network, that is, set a localnet type interface for the first lsp port and the first network interface, 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 business node through the first lsp port and the first network interface. Subsequently, an Underlay network IP address is set for the first service node. The first service node can be configured on the DPU node, that is, the IP address of the Underlay network is assigned to the pod on the DPU node, wherein the Underlay network IP address indicates that the first service node and the logical switch are located in the same network segment. It can be understood that the IP address consists of four bytes, wherein the first three bytes being the same 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 indicates that the two IP addresses are located in the same network segment, that is, the first three bytes of the IP address 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 / 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 also be directly assigned to the pod through ovn-Kubernetes cni, so that the pod and the K8s node (K8s node includes the DPU node and the logical switch) are in the same network plane. Among them, 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 configuring the first network parameter of the logical switch, the method further includes:

[0066] An internal bridge interface is determined 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.

[0067] It can be understood that while configuring the external bridge interface for the logical switch, the internal bridge interface is determined in 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, the virtual bridge interface pair is denoted as a patch pair, and the internal bridge interface is denoted 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 includes:

[0069] Create a second business node and configure the third network parameters of the second business node to connect the communication between the second business node and the logical switch, and the first business node, the second business node and the logical switch are located in the same logical network; perform network communication between the second business node and the first physical node through the logical switch.

[0070] It is understandable that when creating a second service node, 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 between the same logical switch and multiple pod nodes can be established, and the number of pod nodes that can be connected to the same logical switch is not limited, and can be determined according to user needs. Multiple pod nodes can also communicate with the physical network based on the same virtual bridge interface pair. Subsequently, the third network parameter is configured for the second service node, for example, the second LSP port corresponding to the second service node is determined in at least one LSP port, and the port name corresponding to the second service node is set for the second LSP port, 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 set to be located in the same network plane, that is, all pods connected to the logical switch are in the same network plane, which can ensure network communication efficiency and network security. The specific configuration method of the third network parameter refers to the configuration method of the second network parameter in the above embodiment, which will not be repeated here.

[0071] For example, see Figure 2 , Figure 2The logical network architecture diagram provided for the embodiment of the present disclosure includes a logical switch (ls:localnet.network_ovn_localnet_switch), a virtual bridge interface pair (patch pair) configured for the logical switch, multiple lsp ports set for the logical switch, and multiple 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), and br-int refers to Figure 2 In the lsp-localnet, multiple node nodes include node1 and node2, where node1 and node2 each include multiple pod nodes, node1 includes pod1, node2 includes pod2, multiple lsp ports include lsp-localnet and lsp-podname corresponding to multiple pod nodes, the port name of the lsp-podname corresponding to each pod node is different, and the pod node and the corresponding lsp-podname have the same MAC address, such as Figure 2 As shown in the figure, 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 rest of the bytes are the same. In addition, each pod node and the logical switch are in the same network segment, that is, the last byte of the IP address of the pod node and the logical switch is different, and the rest of the bytes are the same. For example, the IP address of pod1 is "ip:192.168.100.4", and the IP address of the logical switch is "ip:192.168.100.101".

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

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

[0074] It can be understood that, based on the above S102, after completing the network configuration of the logical switch and the first business node, the network communication between the first business 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 method between the logical network and the physical network is described in detail through the following embodiments.

[0075] Optionally, when the first physical node requests network communication from the first service node, performing network communication between the first service node and the first physical node through the logical switch may be specifically implemented 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 business node is as follows: after the first physical node receives the communication request sent by the third business node to communicate with the first business node, it sends the communication request to the external bridge interface. The communication request refers to the third business node requesting to communicate with the first business node. After the external bridge interface receives the communication request, it sends the communication request to the first lsp port through the internal bridge interface, and the first lsp port sends the communication request to the first business node through the first network interface. Among them, the third business node can be a pod node that has been configured with network parameters like the first business node and can communicate in the physical network through a logical switch, or it can be a node in the K8s cluster.

[0078] Optionally, in a case where the first service node requests network communication from the first physical node, performing network communication between the first service node and the first physical node through the logical switch may be specifically 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 business node requesting network communication from the first physical node is as follows: the first business node sends a communication request to the first LSP port through the first network interface. The communication request refers to the first business node requesting to communicate with the third business node. The first LSP port sends the communication request to the external bridge interface through the internal bridge interface. After the external bridge interface receives the communication request, it sends the communication request to the first physical node. The first physical node sends the communication request to the third business node. For example, the first physical node sends the communication request to the external bridge interface of the logical switch corresponding to the third business node. The communication process between the third business node and the corresponding logical switch refers to the above-mentioned communication process between the first business node and the corresponding logical switch, which will not be repeated here.

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

[0082] Configure OVN parameters for the logical switch, where the OVN parameters are used to define a mapping relationship between a second physical node located in the physical network and the logical switch; and perform network communication between the logical switch and other switches through the second physical node according to the mapping relationship.

[0083] It is understandable that after creating a virtual switch, you can also configure OVN parameters for the logical switch. The OVN parameters are used to define the mapping relationship between the second physical node located in the physical network and the logical switch. In other words, in addition to realizing network communication with a physical switch through the virtual bridge interface pair configured by the logical switch, the pod node can also realize network communication with another physical switch through the OVN parameters configured by the logical switch. For example, the first business node and the third business node have the same network configuration, are in different network segments, and have corresponding logical switches. In one possible situation, the first business node and the third business node realize network communication with the first physical node based on the virtual bridge interface pair of their respective logical switches. In another possible situation, the first business node and the third business node realize network communication with the second physical node based on the OVN interface of their respective logical switches.

[0084] For example, see Figure 3 , Figure 3A physical network architecture diagram is provided for an embodiment of the present disclosure, and the physical network architecture diagram includes multiple node nodes and multiple physical switches. The multiple node nodes include node1 and node2, and node1 includes pod1 and a logical switch (Is-1), wherein pod1 and Is-1 constitute a working node (work001), and correspondingly, node2 includes pod2 and a logical switch (Is-2), wherein pod2 and Is-2 constitute a working node (work002). The following embodiment is described in detail using work001 as an example, pod1 is provided with a network port (eth1), and Is-1 is provided with an Isp port (Isp-pod1), a virtual bridge interface pair (patch) and an OVN interface (ovn-xx-0), and patch refers to a bridge interface pair composed of br-int and br-out. Multiple physical switches include a first physical switch and a second physical switch. A network communication mode: pod1 communicates with the first physical switch through eth1, Isp-pod1, patch of pod1 and ens3f1 port of node1, and the first physical switch communicates with pod2 through ens3f1 port, patch, Isp-pod2 and eth1 of node2, thereby realizing network communication between pod1 and pod2, wherein ens3f1 port of pod1 and ens3f1 port of pod2 are located in the same network plane. Another network communication mode: pod1 communicates with the second physical switch through ens3f0 port, ovn, eth1 of pod1 and Isp-pod1 of node1, and the second physical switch communicates with pod2 through ens3f0 port, ovn, eth1 of pod2 and Isp-pod2 of node2. Other possible processes for pod nodes to communicate through logical switches and physical switches in the physical network are not described here.

[0085] A network communication method provided by an embodiment of the present disclosure uses DPU nodes as the Underlay network that constitutes the business Pod in the K8s cluster, that is, the DPU node can be used as part of the Underlay network to provide a low-latency, high-throughput network connection, which can further significantly improve the network efficiency and performance of the business Pod in providing services to the external network. At the same time, by configuring the network of the logical switch and canceling the NAT address translation, the business Pod can directly use the external bridge interface of the logical switch to provide services to the outside world, thereby shortening the network path and improving network efficiency, using network policies to control the network traffic between business Pods, and ensuring network security and service quality. In addition, using DPU nodes as the Underlay network and canceling NAT address translation can not only improve the network efficiency of a single Pod, but also achieve high availability and scalability of the entire K8s cluster.

[0086] Figure 4 The network communication device provided in the embodiment of the present disclosure can execute the processing flow provided in the network communication method embodiment, such as Figure 4 As shown, the network communication device 400 includes a first creation unit 401, a second creation unit 402 and a network communication unit 403, wherein:

[0087] A first creating 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] A second creation unit 402 is used to create a first service node and configure 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;

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

[0090] Optionally, the first creating unit 401 is used to:

[0091] Setting at least one LSP port of the localnet type for the logical switch, and determining a first LSP port corresponding to the first service node in the at least one LSP port, where the first LSP port is used to connect to the first service node in the logical network;

[0092] An external bridge interface is configured for the logical switch, where the external bridge interface is used to connect to a first physical node in the physical network.

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

[0094] 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;

[0095] An Underlay network IP address is set 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.

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

[0097] An internal bridge interface is determined 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 used to:

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

[0100] The communication request is forwarded to the first service node through the first lsp port.

[0101] Optionally, the network communication device 400 is further used for:

[0102] Configuring an OVN parameter for the logical switch, where 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] The second physical node performs network communication between the logical switch and other switches according to the mapping relationship.

[0104] Optionally, the network communication device 400 is further used for:

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

[0106] Network communication between the second service node and the first physical node is performed through the logical switch.

[0107] Figure 4 The network communication device of the illustrated embodiment can be used to execute the technical solution of the above-mentioned method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0108] Figure 5 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 5 , which shows a schematic diagram of the structure of an electronic device 500 suitable for implementing the embodiment of the present disclosure. The electronic device 500 in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), wearable electronic devices, etc., and fixed terminals such as digital TVs, desktop computers, smart home devices, etc. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

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

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

[0111] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart, thereby implementing the network communication method as described above. In such an embodiment, the computer program can be downloaded and installed from the network through 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 method of the embodiment of the present disclosure are executed.

[0112] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0113] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may 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"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0114] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0115] Optionally, when the above one or more programs are executed by the electronic device, the electronic device may also execute other steps described in the above embodiments.

[0116] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may 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 may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0117] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0118] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.

[0119] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0120] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0121] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or gateway that includes a series of elements includes not only those elements, but also other elements that are not explicitly listed, or also includes elements inherent to such process, method, article or gateway. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or gateway that includes the elements.

[0122] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be 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 the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A network communication method, characterized in that: include: Creating a logical switch, and configuring a first network parameter of the logical switch so that the logical switch is used to connect the logical network and the physical network; Creating a first service node, and configuring a second network parameter of the first service node to connect the first service node to the communication between the logical switch, wherein the first service node and the logical switch are located in the same logical network; Network communication between the first service node and a first physical node is performed through the logical switch, wherein the first physical node is located in the physical network.

2. The method according to claim 1, characterized in that The configuring the first network parameter of the logical switch includes: Setting at least one LSP port of the localnet type for the logical switch, and determining a first LSP port corresponding to the first service node in the at least one LSP port, where the first LSP port is used to connect to the first service node in the logical network; An external bridge interface is configured for the logical switch, where the external bridge interface is used to connect to a first physical node in the physical network.

3. The method according to claim 2, characterized in that The configuring the second network parameter of the first service node includes: 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; An Underlay network IP address is set 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.

4. The method according to claim 2, characterized in that: The method further comprises: An internal bridge interface is determined 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.

5. The method according to claim 4, characterized in that In a case where the first physical node requests network communication from the first service node, performing network communication between the first service node and the first physical node through the logical switch includes: After the external bridge interface receives the communication request of the first physical node, forwarding the communication request 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.

6. The method according to claim 1, characterized in that After creating the logical switch, the method further includes: Configuring an OVN parameter for the logical switch, where the OVN parameter is used to define a mapping relationship between a second physical node located in the physical network and the logical switch; The second physical node performs network communication between the logical switch and other switches according to the mapping relationship.

7. The method according to claim 1, characterized in that The method further comprises: Creating a second service node, and configuring a third network parameter of the second service node to connect the second service node to the communication between the logical switch, wherein the first service node, the second service node, and the logical switch are located in the same logical network; Network communication between the second service node and the first physical node is performed through the logical switch.

8. A network communication device, characterized in that: include: A first creating unit, 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 the logical network and the physical network; A second creation unit, configured to create a first service node and configure 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; A network communication unit is used 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.

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

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the network communication method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Method and system for realizing two-layer intercommunication between in-cloud network and out-cloud network

    CN113572634A

  • Security service system, access control method and computer readable storage medium

    CN114640514A

  • Logic flow table-based logic network equipment simulation device and method in network target range

    CN118524024A

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

    CN118714023A

  • Service insertion at logical network gateway

    US20200076684A1