A network mode data processing method for container cloud scenarios
By using the network mode data processing method for container cloud scenarios in the container cloud environment, using technologies such as request headers, pseudo headers, and custom protocols, the repeated sending and verification of data packets is realized, and the problem of obtaining real addresses and data packets is solved. Conversion issues, improved packet quality and local proxy functionality.
Patent Information
- Application Number
- CN202210632451.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-06
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2042-06-06
AI Technical Summary
In the container cloud environment, the existing technology cannot obtain the real pod address, resulting in the inability to realize the conversion of network data packets and the UDP packet transmission function of the local agent, and the quality of data packets is difficult to guarantee.
Adopting a network mode data processing method oriented to container cloud scenarios, through the local proxy server, container cloud network processing server and receiving server, using components such as request header protocol, request pseudo-protocol, custom protocol and sending data packets, Implement repeated sending and error checking of data packets, obtain the real address and perform address translation.
Based on the UDP protocol, data packets are repeatedly sent and error checked to ensure the quality of the data packets, and the real address is obtained in the container cloud environment, solving the problem that traditional technology cannot achieve local proxy and data packet conversion.
Smart Images

Figure CN115037812B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of container cloud application technology, and in particular to a network mode data processing method for container cloud scenarios. Background Art
[0002] In the scenario of implementing proxy services in edge computing, a stateless network protocol is required to interface, process, and forward data packets to implement data proxy services.
[0003] In the container cloud environment, there are many network solutions that are not suitable for this proxy method. One of the basic mature network architectures is F l anne l. F l anne l uses the existing etcd cluster of the Kubernetes cluster. The etcd cluster stores F l anne l status information by using APIs, so no dedicated data storage is required.
[0004] F l anne l configures a Layer 3 IPv4 over l ay network, which creates a large internal network that spans every node in the cluster. In this over l ay network, each node has a subnet for assigning IP addresses internally. When you configure pods, the Docker bridge interface on each node assigns an address to each new container. Pods in the same host can communicate using Docker bridging, while pods on different hosts use fl anne ld to encapsulate their traffic in UDP packets so that they can be routed to the appropriate destination. Summary of the invention
[0005] 1. Technical issues to be resolved
[0006] In view of the shortcomings of the prior art, the present invention provides a network mode data processing method for a container cloud scenario. In a container cloud environment, the real address and virtual address of the pod are obtained, and based on the UDP protocol, repeated data packet sending and data packet error verification can be completed to ensure the quality of the data packet. This solves the problem that the current prior art is a two-layer network structure, from real IP->gateway->network service->virtual cluster IP->allocated virtual IP, and each pod will be allocated a virtual IP. In this way, the reverse proxy service at the transport layer always obtains the IP of each gateway, and cannot obtain the real address of the local machine to convert some network data packets, nor can it realize the UDP packet transmission function of the local agent.
[0007] (II) Technical solution
[0008] To achieve the above objectives, the present invention is implemented through the following technical solutions: a network mode data processing method for container cloud scenarios, including a local proxy server, a container cloud network processing server and a receiving server, wherein the local proxy server includes a request header protocol, a request pseudo protocol, a custom protocol and a sending data packet;
[0009] Request header protocol, the header includes 4 fields, each field occupies 2 bytes, that is, 16 binary bits. In IPv4, "source connection port" and "checksum" are optional fields. In IPv6, only the source connection port is an optional field. The 16-bit source port and destination port are used to mark the sending and receiving application processes. Because UDP does not require a response, the source port is optional. If the source port is not used, it is reset to zero. After the destination port is a fixed-length length field in bytes, which is used to specify the length of the datagram including the data part. The minimum length is 8 bytes. The remaining 16 bits of the header are used to check the header and data parts together. This part is optional, but this function is generally used in actual applications.
[0010] Request pseudo-protocol. When the proxy service runs on IPv4, in order to calculate the checksum, a "pseudo-header" needs to be added to the front of the data packet. The pseudo-header includes some information in the IPv4 header, but it is not the header of the IP data packet used when sending the IP data packet, but only a header used to calculate the checksum.
[0011] Custom protocol, used to store 5 fields, source address, destination address, port, mapping port, and gateway records. These fields are used to confirm whether the data is sent completely;
[0012] Send data packet, used to store the sent data;
[0013] The container cloud network processing service end includes a parsing header protocol, a verification pseudo-protocol, a custom protocol parsing transmission module and a content data packet;
[0014] Parsing header protocol, used to parse the local proxy parsing header protocol part;
[0015] Verify the pseudo-protocol, source address, destination address, message length, source port, destination port, and data information checksum of the pseudo-header;
[0016] The custom protocol parsing and transmission module forwards the custom protocol data of the proxy service to the pod for a second time, replaces the network card information of the pod node, ensures that the real address information can be obtained every time the service is received and output, converts the address of the received data when the data is connected and output, and records the network card information and pod information from a node container to prove the real allocation of the pod of the output node, and forwards the received data to the correct container according to the pod information after the next data entry;
[0017] Content data packet, used to store data packet content;
[0018] The receiving service end includes obtaining the request address of the proxy service, parsing the data protocol, sending the response service and the response data packet;
[0019] Get the request address of the proxy service from the custom protocol. In network card forwarding, the container cloud routing will build a virtual IP access for the entire network. After the data packet enters, it will pass through the virtual gateway. Then, the container of each pod node will be assigned an address based on the network of the virtual cluster.
[0020] Data protocol analysis, analyzing all protocols and content in the entire data packet;
[0021] Send response service, receive the entire data, and respond to the proxy service address;
[0022] Response data packet, used to store response data content information;
[0023] The data input and output of the local proxy server, container cloud network processing server and receiving server are all performed at the network layer;
[0024] The container cloud network processing server is connected to the container cluster virtual router by binding the data in and out network card, and the container cluster virtual router is connected to the receiving server by allocating container IP addresses and forwarding data packets to achieve proxy services such as obtaining the request address of the proxy service, performing data protocol analysis and sending response services.
[0025] Preferably, the local proxy server establishes a transmission connection with the original address gateway based on the UDP protocol transmission mode, and the original address gateway establishes a transmission connection with the target address gateway, and realizes service communication with the container cloud network processing server through the target address gateway, and collaboratively realizes the container cloud network processing service.
[0026] Preferably, after receiving the data, the receiving server sends the response data to the container cluster virtual router, and then transmits it to the container cloud network processing server for response processing.
[0027] Preferably, the container cloud network processing server can transmit the response data back to the target address gateway, and further transmit it to the original address gateway, and the original address gateway then transmits it to the local proxy server via the transport layer data.
[0028] Preferably, the custom protocol inside the local proxy server carries the local address, and the custom protocol parsing and transmission module inside the container cloud network processing server can parse the custom protocol and transmit it to the pod.
[0029] Preferably, a network mode data processing method for a container cloud scenario includes the following processing steps:
[0030] S1. The proxy server first generates a header through the request header protocol. The header includes 4 fields, each of which occupies 2 bytes.
[0031] S2. When the proxy service runs on IPv4, in order to calculate the checksum, a "pseudo-header" needs to be added to the front of the data packet. The pseudo-header includes some information in the IPv4 header, but it is not the header of the IP data packet used when sending the IP data packet, but only used to calculate the checksum;
[0032] S3. Use a custom protocol to store five fields, including source address, destination address, port, mapped port, and gateway records. These fields are used to confirm whether the data is sent completely, and the data packet is sent to the original address gateway based on the UDP protocol transmission method. The original address gateway and the target address gateway are connected for transmission. The target address gateway communicates with the container cloud network processing server to collaboratively implement the container cloud network processing service.
[0033] S4. The container cloud network processing server parses the local proxy parsing header protocol part by parsing the header protocol, and verifies the source address, destination address, message length, source port, destination port, and data information checksum of the pseudo header by verifying the pseudo protocol. Finally, the custom protocol parsing and transmission module forwards the custom protocol data of the proxy service to the pod for the second time, and replaces the network card information of the pod node to ensure that the real address information can be obtained every time the service is received and output. The address of the received data can be converted when the data is accessed and output, and the network card information and pod information from a node container are recorded to prove the real allocation of the output node pod. After the next data entry, the received data will be forwarded to the correct container according to the pod information.
[0034] S5. The container cloud network processing server is connected to the container cluster virtual router by binding the data in and out network card, and the container cluster virtual router is connected to the receiving server by allocating container IP addresses and forwarding data packets;
[0035] S6. The receiving server obtains the request address of the proxy service, and parses all the protocols and contents in the entire data packet through data protocol parsing, and then receives the entire data and sends a response to the proxy service address;
[0036] S7. After receiving the data, the receiving server sends the response data to the container cluster virtual router, and then transmits it to the container cloud network processing server for response processing;
[0037] S8. The container cloud network processing server sends the response data back to the target address gateway, and further transmits it to the original address gateway. The original address gateway then transmits it to the local proxy server through the transport layer data.
[0038] (III) Beneficial effects
[0039] The present invention provides a network mode data processing method for container cloud scenarios.
[0040] Beneficial effects:
[0041] 1. The present invention provides a network mode data processing method for container cloud scenarios. The method can complete the repeated sending of data packets and the verification of data packet data errors based on the UDP protocol, thereby ensuring the quality of the data packets.
[0042] 2. The present invention provides a network mode data processing method for container cloud scenarios. The method can obtain the real address and virtual address of the pod in the container cloud environment, effectively solving the problem that traditional technology cannot obtain the real address of the local machine to convert some network data packets, and cannot realize the UDP packet transmission function of the local agent. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 The figure is a complete flow chart of the application scenario of the present invention. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] Example:
[0046] like Figure 1As shown, an embodiment of the present invention provides a network mode data processing method for a container cloud scenario, including a local proxy server, a container cloud network processing server and a receiving server, wherein the local proxy server includes a request header protocol, a request pseudo protocol, a custom protocol and a sending data packet;
[0047] Request header protocol, the header includes 4 fields, each field occupies 2 bytes, that is, 16 binary bits. In IPv4, "source connection port" and "checksum" are optional fields. In IPv6, only the source connection port is an optional field. The 16-bit source port and destination port are used to mark the sending and receiving application processes. Because UDP does not require a response, the source port is optional. If the source port is not used, it is reset to zero. After the destination port is a fixed-length length field in bytes, which is used to specify the length of the datagram including the data part. The minimum length is 8 bytes. The remaining 16 bits of the header are used to check the header and data parts together. This part is optional, but this function is generally used in actual applications.
[0048] Request pseudo-protocol. When the proxy service runs on IPv4, in order to calculate the checksum, a "pseudo-header" needs to be added to the front of the data packet. The pseudo-header includes some information in the IPv4 header, but it is not the header of the IP data packet used when sending the IP data packet, but only a header used to calculate the checksum.
[0049] Custom protocol, used to store 5 fields, source address, destination address, port, mapping port, and gateway records. These fields are used to confirm whether the data is sent completely;
[0050] Send data packet, used to store the sent data;
[0051] The container cloud network processing server includes parsing header protocols, verifying pseudo protocols, customizing protocol parsing transmission modules, and content data packets;
[0052] Parsing header protocol, used to parse the local proxy parsing header protocol part;
[0053] Verify the pseudo-protocol, source address, destination address, message length, source port, destination port, and data information checksum of the pseudo-header;
[0054] The custom protocol parsing and transmission module forwards the custom protocol data of the proxy service to the pod for a second time, replaces the network card information of the pod node, ensures that the real address information can be obtained every time the service is received and output, converts the address of the received data when the data is connected and output, and records the network card information and pod information from a node container to prove the real allocation of the pod of the output node, and forwards the received data to the correct container according to the pod information after the next data entry;
[0055] Content data packet, used to store data packet content;
[0056] The receiving server includes obtaining the request address of the proxy service, parsing the data protocol, sending the response service and the response data packet;
[0057] Get the request address of the proxy service from the custom protocol. In network card forwarding, the container cloud routing will build a virtual IP access for the entire network. After the data packet enters, it will pass through the virtual gateway. Then, the container of each pod node will be assigned an address based on the network of the virtual cluster.
[0058] Data protocol analysis, analyzing all protocols and content in the entire data packet;
[0059] Send response service, receive the entire data, and respond to the proxy service address;
[0060] Response data packet, used to store response data content information.
[0061] The network mode data processing method for the container cloud scenario is characterized by comprising the following processing steps:
[0062] S1. The proxy server first generates a header through the request header protocol. The header includes 4 fields, each of which occupies 2 bytes.
[0063] S2. When the proxy service runs on IPv4, in order to calculate the checksum, a "pseudo-header" needs to be added to the front of the data packet. The pseudo-header includes some information in the IPv4 header, but it is not the header of the IP data packet used when sending the IP data packet, but only used to calculate the checksum;
[0064] S3. Use a custom protocol to store five fields, including source address, destination address, port, mapped port, and gateway records. These fields are used to confirm whether the data is sent completely, and the data packet is sent to the original address gateway based on the UDP protocol transmission method. The original address gateway and the target address gateway are connected for transmission. The target address gateway communicates with the container cloud network processing server to collaboratively implement the container cloud network processing service.
[0065] S4. The container cloud network processing server parses the local proxy parsing header protocol part by parsing the header protocol, and verifies the source address, destination address, message length, source port, destination port, and data information checksum of the pseudo header by verifying the pseudo protocol. Finally, the custom protocol parsing and transmission module forwards the custom protocol data of the proxy service to the pod for the second time, and replaces the network card information of the pod node to ensure that the real address information can be obtained every time the service is received and output. The address of the received data can be converted when the data is accessed and output, and the network card information and pod information from a node container are recorded to prove the real allocation of the output node pod. After the next data entry, the received data will be forwarded to the correct container according to the pod information.
[0066] S5. The container cloud network processing server is connected to the container cluster virtual router by binding the data in and out network card, and the container cluster virtual router is connected to the receiving server by allocating container IP addresses and forwarding data packets;
[0067] S6. The receiving server obtains the request address of the proxy service, and parses all the protocols and contents in the entire data packet through data protocol parsing, and then receives the entire data and sends a response to the proxy service address;
[0068] S7. After receiving the data, the receiving server sends the response data to the container cluster virtual router, and then transmits it to the container cloud network processing server for response processing;
[0069] S8. The container cloud network processing server sends the response data back to the target address gateway, and further transmits it to the original address gateway. The original address gateway then transmits it to the local proxy server through the transport layer data.
[0070] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A network mode data processing method for container cloud scenarios, It is characterized in that It includes a local proxy server, a container cloud network processing server and a receiving server. The local proxy server includes a request header protocol, a request pseudo protocol, a custom protocol and a sending data packet; Request header protocol, the header includes 4 fields, each field occupies 2 bytes, that is, 16 binary bits. In IPv4, "source connection port" and "checksum" are optional fields. In IPv6, only the source connection port is an optional field. The 16-bit source port and destination port are used to mark the sending and receiving application processes. Because UDP does not require a response, the source port is optional. If the source port is not used, it is reset to zero. After the destination port is a fixed-length length field in bytes, which is used to specify the length of the datagram including the data part. The minimum length is 8 bytes. The remaining 16 bits of the header are used to check the header and data parts together. This part is optional, but this function is generally used in actual applications; Request pseudo-protocol. When the proxy service runs on IPv4, in order to calculate the checksum, a "pseudo-header" needs to be added to the front of the data packet. The pseudo-header includes some information in the IPv4 header, but it is not the header of the IP data packet used when sending the IP data packet, but only a header used to calculate the checksum. The custom protocol is used to store five fields: source address, destination address, port, mapped port, and gateway records. These fields are used to confirm whether the data is sent completely. Send data packet, used to store the sent data; The container cloud network processing server includes a parsing header protocol, a pseudo-protocol verification module, a custom protocol parsing transmission module, and a content data packet; Parsing header protocol, used to parse the local proxy parsing header protocol part; Verify the pseudo-protocol, source address, destination address, message length, source port, destination port, and data information checksum of the pseudo-header; The custom protocol parsing and transmission module forwards the custom protocol data of the proxy service to the pod for a second time, replaces the network card information of the pod node, ensures that the real address information can be obtained every time the service is received and output, converts the address of the received data when the data is connected and output, and records the network card information and pod information from a node container to prove the real allocation of the pod of the output node, and forwards the received data to the correct container according to the pod information after the next data entry; Content data packet, used to store data packet content; The receiving service end includes obtaining the request address of the proxy service, parsing the data protocol, sending the response service and the response data packet; Get the request address of the proxy service from the custom protocol. In network card forwarding, the container cloud routing will build a virtual IP access for the entire network. After the data packet enters, it will pass through the virtual gateway. Then, the container of each pod node will be assigned an address based on the network of the virtual cluster. Data protocol analysis, analyzing all protocols and content in the entire data packet; Send response service, receive the entire data, and respond to the proxy service address; Response data packet, used to store response data content information; The data input and output of the local proxy server, container cloud network processing server and receiving server are all performed at the network layer; The container cloud network processing server is connected to the container cluster virtual router by binding the data in and out network card, and the container cluster virtual router is connected to the receiving server by allocating container IP addresses and forwarding data packets to achieve proxy services such as obtaining the request address of the proxy service, performing data protocol analysis and sending response services.
2. According to the network mode data processing method for container cloud scenarios according to claim 1, It is characterized in that The local proxy server establishes a transmission connection with the original address gateway based on the UDP protocol transmission mode, and the original address gateway establishes a transmission connection with the target address gateway, and realizes service communication with the container cloud network processing server through the target address gateway, and collaboratively realizes the container cloud network processing service.
3. According to the network mode data processing method for container cloud scenarios according to claim 1, It is characterized in that After receiving the data, the receiving server sends the response data to the container cluster virtual router, and then transmits it to the container cloud network processing server for response processing.
4. According to the network mode data processing method for container cloud scenarios according to claim 1, It is characterized in that The container cloud network processing server can transmit the response data back to the target address gateway, and further transmit it to the original address gateway, and the original address gateway then transmits it to the local proxy server via the transport layer data.
5. According to the network mode data processing method for container cloud scenarios according to claim 1, It is characterized in that The custom protocol inside the local proxy server carries the local address, and the custom protocol parsing and transmission module inside the container cloud network processing server can parse the custom protocol and transmit it to the pod.
6. According to the network mode data processing method for container cloud scenarios according to claim 1, It is characterized in that The following processing steps are included: S1. The proxy server first generates a header through the request header protocol. The header includes 4 fields, each of which occupies 2 bytes. S2. When the proxy service runs on IPv4, in order to calculate the checksum, a "pseudo-header" needs to be added to the front of the data packet. The pseudo-header includes some information in the IPv4 header, but it is not the header of the IP data packet used when sending the IP data packet, but only used to calculate the checksum; S3. Use a custom protocol to store five fields, including source address, destination address, port, mapped port, and gateway records. These fields are used to confirm whether the data is sent completely, and the data packet is sent to the original address gateway based on the UDP protocol transmission method. The original address gateway and the target address gateway are connected for transmission. The target address gateway communicates with the container cloud network processing server to collaboratively implement the container cloud network processing service. S4. The container cloud network processing server parses the local proxy parsing header protocol part by parsing the header protocol, and verifies the source address, destination address, message length, source port, destination port, and data information checksum of the pseudo header by verifying the pseudo protocol. Finally, the custom protocol parsing and transmission module forwards the custom protocol data of the proxy service to the pod for the second time, and replaces the network card information of the pod node to ensure that the real address information can be obtained every time the service is received and output. The address of the received data can be converted when the data is accessed and output, and the network card information and pod information from a node container are recorded to prove the real allocation of the output node pod. After the next data entry, the received data will be forwarded to the correct container according to the pod information. S5. The container cloud network processing server is connected to the container cluster virtual router by binding the data in and out network card, and the container cluster virtual router is connected to the receiving server by allocating container IP addresses and forwarding data packets; S6. The receiving server obtains the request address of the proxy service, and parses all the protocols and contents in the entire data packet through data protocol parsing, and then receives the entire data and sends a response to the proxy service address; S7. After receiving the data, the receiving server sends the response data to the container cluster virtual router, and then transmits it to the container cloud network processing server for response processing; S8. The container cloud network processing server sends the response data back to the target address gateway, and further transmits it to the original address gateway. The original address gateway then transmits it to the local proxy server through the transport layer data.
