CN114979076A - Flat communication network oriented to cross-host container - Google Patents

Flat communication network oriented to cross-host container Download PDF

Info

Publication number
CN114979076A
CN114979076A CN202210566831.XA CN202210566831A CN114979076A CN 114979076 A CN114979076 A CN 114979076A CN 202210566831 A CN202210566831 A CN 202210566831A CN 114979076 A CN114979076 A CN 114979076A
Authority
CN
China
Prior art keywords
iptables
container
network
default
checking whether
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210566831.XA
Other languages
Chinese (zh)
Other versions
CN114979076B (en
Inventor
庄道明
沈雪良
宓建栋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Wangzhu Information Technology Service Co ltd
Original Assignee
Hangzhou Qianjinding Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Qianjinding Information Technology Co ltd filed Critical Hangzhou Qianjinding Information Technology Co ltd
Priority to CN202210566831.XA priority Critical patent/CN114979076B/en
Publication of CN114979076A publication Critical patent/CN114979076A/en
Application granted granted Critical
Publication of CN114979076B publication Critical patent/CN114979076B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing

Landscapes

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

Abstract

The invention discloses a flat communication network facing a cross-host container, which comprises the following steps: s1: checking whether the IP address field of the network bridge is configured correctly, if so, carrying out the next step, and if not, allocating a sub-network segment; s2: checking whether the iptables forwarding rule is started, if so, clearing the default iptables chain rule, and if not, starting the iptables default forwarding rule first and then clearing the default iptables chain rule; s3: and checking whether the router routing table reaches the routing information of the container address field distributed by the S1, if not, injecting the router into the static routing table, and if so, ending the operation. By providing a flat network environment, the three-layer routing protocol does not need to be repackaged, the unpacking operation in the transmission process is reduced, the resource utilization rate is improved to a great extent, the compatibility of network equipment can be supported, the method is directly realized on the three-layer routing structure, no controller is needed to maintain the node information, and the maintenance is convenient.

Description

Flat communication network oriented to cross-host container
Technical Field
The invention relates to the field of container flattening networks, in particular to a flattening communication network for a cross-host container.
Background
The existing internet technology service architecture design is basically designed in a distributed micro-service architecture, and the design brings obvious advantages in stability, fault tolerance rate, high performance, cooperation and the like. However, in the case of single host deployment, hardware resources are wasted to some extent, so a container technology appears, but in the existing container technology, for example, a do cker can implement interconnection and intercommunication for each container in a single host environment, but interconnection and intercommunication are difficult to implement between containers in each host under the condition of multiple hosts, which brings technical difficulty to the implementation of projects. The necessary breakpoints and direct connection services in the research and development project process of research and development and testing personnel bring great inconvenience. The technical architecture under the registration mechanism is also difficult to implement.
Some existing solutions, such as some OVS network plug-in technologies used after unpacking, can solve a part of problems, the architecture of the existing solutions is also quite complex, a packet forwarding controller center is generally needed, the control center records node information that each destination address of the control center needs to reach, the data packet needs to be encapsulated by an OVS layer protocol before transmitting a three-layer data packet, unpacking operation needs to be performed after the data packet reaches a destination node, and certain consumption is caused to hardware performance consumption. The logic behind such tools is also not very transparent to maintenance personnel, and there is also a certain blind area of knowledge in problem troubleshooting at later maintenance stages. It is also a point that IDC network devices, such as switches and routers, cannot support such plug-ins, and therefore interconnection of containers can only be achieved between the host operating system level.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide a flat communication network oriented to a cross-host container.
The purpose of the invention is realized by the following technical scheme: a flat communication network oriented to a cross-host container comprises the following steps:
s1: checking whether the IP address field of the network bridge is configured correctly, if so, carrying out the next step, and if not, allocating a sub-network segment;
s2: checking whether the iptables forwarding rule is started, if so, clearing the default iptables chain rule, and if not, starting the iptables default forwarding rule first and then clearing the default iptables chain rule;
s3: and checking whether the router routing table reaches the routing information of the container address field distributed by the S1, if not, injecting the router into the static routing table, and if so, ending the operation.
Preferably, the step of allocating the subnet segment in S1 is as follows:
a1: comparing the database, distributing a subnet address field of the impractical 24-bit mask and recording;
a2: setting the first host bit IP of the subnet address field as a bridge gateway;
a3: and writing the IP network segment into the container to automatically allocate the DHCP for use when the container is subsequently created.
The invention has the following advantages: the invention provides a flat network environment, does not need to repackage the three-layer routing protocol, reduces the unpacking operation in the transmission process, greatly improves the resource utilization rate, can support the compatibility of network equipment, is directly realized on the three-layer routing structure, does not need any controller to maintain the node information and is convenient to maintain.
Drawings
FIG. 1 is a schematic diagram of a flat communication network state flow;
FIG. 2 is a schematic structural diagram of a basic architecture of a flat communication network;
FIG. 3 is a diagram illustrating the structure of a packet call;
FIG. 4 is a schematic diagram illustrating a micro-service registration mechanism;
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings of the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
In addition, the embodiments of the present invention and the features of the embodiments may be combined with each other without conflict.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, or orientations or positional relationships that the products of the present invention conventionally lay out when in use, or orientations or positional relationships that are conventionally understood by those skilled in the art, which are merely for convenience of describing the present invention and simplifying the description, but do not indicate or imply that the device or element referred to must have a specific orientation, be constructed in a specific orientation, and be operated, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and the like are used merely to distinguish one description from another, and are not to be construed as indicating or implying relative importance.
In the description of the present invention, it should also be noted that, unless otherwise explicitly specified or limited, the terms "disposed," "mounted," "connected," and "connected" are to be construed broadly and may, for example, be fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
In this embodiment, as shown in fig. 1, a flat communication network oriented to a cross-host container includes the following steps:
s1: checking whether the IP address field of the network bridge is configured correctly, if so, carrying out the next step, and if not, allocating a sub-network segment; further, the step of allocating the subnet segment in S1 is as follows:
a1: comparing the database, distributing a subnet address field of the impractical 24-bit mask and recording;
a2: setting the first host bit IP of the subnet address field as a bridge gateway;
a3: and writing the IP network segment into the container to automatically allocate the DHCP for use when the container is subsequently created.
S2: checking whether the iptables forwarding rule is started or not, if so, clearing the default iptables chain rule, and if not, firstly starting the iptables default forwarding rule and then clearing the default iptables chain rule, wherein the main purpose of the step is to realize the function of the router.
S3: and checking whether the router routing table reaches the routing information of the container address field distributed by the S1, if not, injecting the router into a static routing table, and if so, ending the operation. Specifically, as shown in fig. 2, it is necessary to allocate a large segment on a network segment that does not conflict with the address segment of the existing network environment, such as: 10.1.0.0/16, and divide the subnet section to distribute to each host machine to use in this large section, this network segment is the address field in the name space of the network of the docker bridge in each server, wherein each server is equivalent to a router function, its bridge side docks the docker network, eth0 physical network card side docks the outside and builds up, the route of calling the data packet can refer to fig. 3, through offering a flat network environment, do not need to repackage the operation to the protocol of three-layer routing, have reduced the packet and unpack the operation in the transmission process, has promoted the utilization factor of resources, and can support the compatibility of the network equipment, and is equivalent to realizing on the structure of three-layer routing directly, does not need any controller to maintain the node information, easy to maintain; as shown in fig. 4, the service consumer and the service provider of the micro service under the micro service registration mechanism implement the service invocation mechanism by registering themselves to the registration center, and then the registration center informs the service consumer of the information of the service provider to be invoked, and the implementation is performed on the premise that a flat network environment is necessary, otherwise, only a single server system level can be used to deploy the application, which is very resource consuming.
Although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that various changes in the embodiments and/or modifications of the invention can be made, and equivalents and modifications of some features of the invention can be made without departing from the spirit and scope of the invention.

Claims (2)

1. A flat communication network oriented to a cross-host container is characterized in that: the method comprises the following steps:
s1: checking whether the IP address field of the network bridge is configured correctly, if so, carrying out the next step, and if not, allocating a sub-network segment;
s2: checking whether the iptables forwarding rule is started, if so, clearing the default iptables chain rule, and if not, starting the iptables default forwarding rule first and then clearing the default iptables chain rule;
s3: and checking whether the router routing table reaches the routing information of the container address field distributed by the S1, if not, injecting the router into the static routing table, and if so, ending the operation.
2. The cross-host container oriented flat communication network of claim 1, wherein: the step of allocating the subnet segment in S1 is as follows:
a1: comparing the database, distributing a subnet address field of the impractical 24-bit mask and recording;
a2: setting the first host bit IP of the subnet address field as a bridge gateway;
a3: and writing the IP network segment into the container to automatically allocate the DHCP for use when the container is subsequently created.
CN202210566831.XA 2022-05-23 2022-05-23 Flattened communication method oriented to cross-host container Active CN114979076B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210566831.XA CN114979076B (en) 2022-05-23 2022-05-23 Flattened communication method oriented to cross-host container

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210566831.XA CN114979076B (en) 2022-05-23 2022-05-23 Flattened communication method oriented to cross-host container

Publications (2)

Publication Number Publication Date
CN114979076A true CN114979076A (en) 2022-08-30
CN114979076B CN114979076B (en) 2024-03-29

Family

ID=82985454

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210566831.XA Active CN114979076B (en) 2022-05-23 2022-05-23 Flattened communication method oriented to cross-host container

Country Status (1)

Country Link
CN (1) CN114979076B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106411748A (en) * 2016-10-08 2017-02-15 电子科技大学 Cross-network dynamic topology maintenance method
CN107070717A (en) * 2017-04-17 2017-08-18 成都精灵云科技有限公司 A kind of method that Docker containers across main frame are communicated
CN107332775A (en) * 2017-08-14 2017-11-07 上海新炬网络信息技术股份有限公司 Across host exchanging visit system and its control method based on docker containers
US10944691B1 (en) * 2020-01-15 2021-03-09 Vmware, Inc. Container-based network policy configuration in software-defined networking (SDN) environments
CN113259503A (en) * 2021-06-24 2021-08-13 浩鲸云计算科技股份有限公司 Method and system for realizing cross-network communication among different containers based on Infiniband
CN114363170A (en) * 2021-12-29 2022-04-15 中国电信股份有限公司 Container service network configuration method and related product

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106411748A (en) * 2016-10-08 2017-02-15 电子科技大学 Cross-network dynamic topology maintenance method
CN107070717A (en) * 2017-04-17 2017-08-18 成都精灵云科技有限公司 A kind of method that Docker containers across main frame are communicated
CN107332775A (en) * 2017-08-14 2017-11-07 上海新炬网络信息技术股份有限公司 Across host exchanging visit system and its control method based on docker containers
US10944691B1 (en) * 2020-01-15 2021-03-09 Vmware, Inc. Container-based network policy configuration in software-defined networking (SDN) environments
CN113259503A (en) * 2021-06-24 2021-08-13 浩鲸云计算科技股份有限公司 Method and system for realizing cross-network communication among different containers based on Infiniband
CN114363170A (en) * 2021-12-29 2022-04-15 中国电信股份有限公司 Container service network configuration method and related product

Also Published As

Publication number Publication date
CN114979076B (en) 2024-03-29

Similar Documents

Publication Publication Date Title
EP2936787B1 (en) Method and system for the creation, modification and removal of a distributed virtual cpe
US20040085944A1 (en) Portable wireless internet gateway
EP1478129B1 (en) Using network transport tunnels to provide service-based data transport
US8443065B1 (en) System and method for locating, identifying and provisioning newly deployed network devices
US8543706B2 (en) Communication module for connecting application program to virtual private network
CN101399742B (en) Data service network system and access method of data service
CN102148766B (en) Method for service interworking in PON (passive optical network) under three-layer function networking
CN110266833B (en) IP address management method and edge cluster
CN102792651B (en) At the device of MAC layer application service path Route Selection
EP1701516B1 (en) Method for facilitating application server functionality and access node comprising the same
CN101242370B (en) Method for realizing Ethernet and frame-relay Internet and protocol conversion device
CN105635335B (en) Social resources cut-in method, apparatus and system
EP3583751B1 (en) Method for an improved deployment and use of network nodes of a switching fabric of a data center or within a central office point of delivery of a broadband access network of a telecommunications network
CN112751947B (en) Communication system and method
CN112162828B (en) Container network cooperation system and method based on cloud side scene
EP1598982B1 (en) Architecture for configuration and management of cross-domain services
CN113938353A (en) Multi-PDN implementation method between indoor unit and outdoor unit and storage medium
CN110445708B (en) Communication method and system in convergence gateway
CN114979076A (en) Flat communication network oriented to cross-host container
CN113472753B (en) Multi-tenant network isolation method, data center and communication system
US20050044271A1 (en) Method for allocating a non-data device to a voice vlan object of the invention
US20240007328A1 (en) Operating a broadband access network of a telecommunications network with a customer premises equipment
CN111147345B (en) Cloud environment network isolation device and method and cloud system
EP4270878A1 (en) Method for operating a broadband access network of a telecommunications network with a customer premises equipment, broadband access network or telecommunications network, system, customer determination entity or functionality, program and computer-readable medium
EP3413697B1 (en) Configuration of a stackable access point device (stap)

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: 310000 Room 518, floor 5, block a, No. 756 Bin'an Road, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Zhejiang Wangzhu Information Technology Service Co.,Ltd.

Country or region after: China

Address before: 310000 Room 518, floor 5, block a, No. 756 Bin'an Road, Binjiang District, Hangzhou City, Zhejiang Province

Patentee before: HANGZHOU QIANJINDING INFORMATION TECHNOLOGY CO.,LTD.

Country or region before: China