CN115996185A - Data transmitting method, data receiving method, switch and gateway server - Google Patents

Data transmitting method, data receiving method, switch and gateway server Download PDF

Info

Publication number
CN115996185A
CN115996185A CN202111208819.3A CN202111208819A CN115996185A CN 115996185 A CN115996185 A CN 115996185A CN 202111208819 A CN202111208819 A CN 202111208819A CN 115996185 A CN115996185 A CN 115996185A
Authority
CN
China
Prior art keywords
data packet
service data
service
switch
gateway server
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.)
Pending
Application number
CN202111208819.3A
Other languages
Chinese (zh)
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202111208819.3A priority Critical patent/CN115996185A/en
Publication of CN115996185A publication Critical patent/CN115996185A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application discloses a data sending method, a data receiving method, a switch and a gateway server, and relates to the field of edge computing. Comprising the following steps: receiving a service data packet sent by a first service server in a first edge node; determining a next-hop device of the service data packet based on the service type of the service data packet, wherein the next-hop device comprises a first gateway server in a first edge node or a second switch in a second edge node; transmitting a service data packet to the next hop device; receiving a processed service data packet sent by a first gateway server under the condition that the next hop device is the first gateway server; and sending the processed service data packet to the second switch. By adopting the scheme of the embodiment of the application, the requirements of large-flow bandwidth and safety can be met, the number of gateway servers in the gateway server cluster can be reduced, and the utilization rate of the gateway servers can be improved.

Description

Data transmitting method, data receiving method, switch and gateway server
Technical Field
The embodiment of the application relates to the field of edge computing, in particular to a data sending method, a data receiving method, a switch and a gateway server.
Background
Edge computing refers to providing near-end services in the vicinity of the data source, using an open platform with network, computing, storage, and application core capabilities as a whole. Common edge computing scenarios include online education, live broadcast, and the like.
In order to meet the requirements of high traffic and high security between edge nodes in an edge computing scene, a gateway server scheme is generally adopted in the related art to realize data transmission between the edge nodes. In some implementations, a gateway server cluster is disposed in each edge node, so that processing and transmission of service data are performed by using the gateway server cluster. For example, in an online education scene, the gateway server cluster encrypts the service data, and sends the encrypted service data to the gateway server clusters of other edge nodes through the public network, so that the transmission safety of the service data in the public network is improved. Also, because of the limited bandwidth of the gateway servers, the gateway server cluster set in the edge node typically needs to contain a large number of gateway servers to meet the high traffic transmission needs (such as live scenarios).
However, in the non-large-traffic transmission scenario, only a small number of gateway servers in the gateway server cluster are in a working state, so that the utilization rate of the gateway servers is low, and the resource waste of the edge node is caused.
Disclosure of Invention
The embodiment of the application provides a data sending method, a data receiving method, a switch and a gateway server, which can be used for processing and forwarding service data by corresponding equipment based on service types and improving the resource utilization rate of edge nodes. The technical scheme is as follows:
in one aspect, an embodiment of the present application provides a data sending method, where the method is used for a first switch in a first edge node, and the method includes:
receiving a service data packet sent by a first service server in the first edge node;
determining next-hop equipment of the service data packet based on the service type of the service data packet, wherein the next-hop equipment comprises a first gateway server in the first edge node or a second switch in a second edge node, and the first gateway server is used for carrying out service processing on the service data packet;
transmitting the service data packet to the next hop device;
receiving the processed service data packet sent by the first gateway server under the condition that the next-hop device is the first gateway server;
and sending the processed service data packet to the second switch.
In another aspect, an embodiment of the present application provides a data sending method, where the method is used for a first gateway server in a first edge node, and the method includes:
receiving a service data packet sent by a first switch in the first edge node, wherein the service data packet is sent by the first switch when determining that the next-hop equipment of the service data packet is the first gateway server based on the service type of the service data packet;
carrying out service processing on the service data packet;
and sending the processed service data packet to the first switch, so that the first switch sends the processed service data packet to a second switch in a second edge node.
In another aspect, an embodiment of the present application provides a data receiving method, where the method is used for a second switch in a second edge node, and the method includes:
receiving a service data packet sent by a first switch in a first edge node;
determining a next-hop device of the service data packet, wherein the next-hop device comprises a second service server or a second gateway server in the second edge node, and the second gateway server is used for performing service processing on the service data packet and sending the processed service data packet to the second service server;
And sending the service data packet to the next hop device.
Optionally, the determining the next hop device of the service data packet includes:
decapsulating a second quintuple of the service data packet, and determining a first quintuple in the service data packet, wherein the second quintuple is added when the first switch encapsulates the service data packet;
and determining the next hop device based on the first five-tuple.
Optionally, the determining the next hop device based on the first five-tuple includes:
inquiring a next hop address in a routing table based on the first five-tuple;
when a next-hop address is queried, determining that the next-hop device is the second service server;
and when the next hop address is not queried, determining the next hop equipment as the second gateway server.
In another aspect, an embodiment of the present application provides a data receiving method, where the method is used for a second gateway server in a second edge node, and the method includes:
receiving a service data packet sent by a second switch in the second edge node, wherein the service data packet is sent when the second switch determines that next-hop equipment is the second gateway server;
Carrying out service processing on the service data packet to obtain the processed service data packet;
and sending the processed service data packet to a second service server in the second edge node.
Optionally, the performing service processing on the service data packet to obtain a processed service data packet includes:
determining the service type of the service data packet;
when the service type of the service data packet is a safety communication service, decrypting the service data packet to obtain the decrypted service data packet;
and when the service type of the service data packet is address conversion service, performing address conversion processing on the service data packet to obtain the service data packet after address conversion.
Optionally, the address conversion processing is performed on the service data packet to obtain the service data packet after address conversion, including:
acquiring a first five-tuple of the service data packet;
converting the destination public network address in the first five-tuple into a destination intranet address based on an address conversion relationship to obtain the service data packet after address conversion;
the sending the processed service data packet to a second service server in the second edge node includes:
And sending the service data packet after address conversion to the second service server based on the destination intranet address.
In another aspect, an embodiment of the present application provides a data transmitting apparatus, including:
the receiving module is used for receiving the service data packet sent by the first service server in the first edge node;
a determining module, configured to determine a next-hop device of the service data packet based on a service type of the service data packet, where the next-hop device includes a first gateway server in the first edge node or a second switch in a second edge node, and the first gateway server is configured to perform service processing on the service data packet;
a sending module, configured to send the service data packet to the next hop device;
the receiving module is further configured to receive the service data packet after processing sent by the first gateway server when the next hop device is the first gateway server;
the sending module is further configured to send the processed service data packet to the second switch.
Optionally, the determining module is configured to:
when the service type of the service data packet belongs to a flow forwarding service, determining that the next-hop equipment of the service data packet is the second switch;
And when the service type of the service data packet does not belong to the traffic forwarding service, determining the next-hop equipment of the service data packet as the first gateway server.
Optionally, in the case that the next hop device is the second switch, the sending module is configured to:
acquiring a first five-tuple of the service data packet;
inquiring a next hop address from a routing table based on the first five-tuple;
generating a second five-tuple based on the queried next hop address and the switch address of the first switch;
encapsulating the service data packet through the second five-tuple;
and sending the encapsulated service data packet to the second switch.
Optionally, in the case that the next hop device is the first gateway server, the sending module is further configured to:
determining a target port of the first gateway server based on the service type of the service data packet, wherein different service types correspond to different ports;
and sending the service data packet to the target port of the first gateway server so that the first gateway server determines the service type of the service data packet based on the target port.
Optionally, when determining the destination port of the first gateway server based on the service type of the service data packet, the sending module is further configured to:
when the service type of the service data packet is a secure communication service, determining a first port as the target port, wherein the first gateway server is used for encrypting the service data packet received through the first port;
and when the service type of the service data packet is address conversion service, determining a second port as the target port, wherein the first gateway server is used for performing address conversion processing on the service data packet received through the second port.
Optionally, in the case that the next hop device is the first gateway server, the sending module is further configured to:
inquiring a next hop address from a routing table based on the five-tuple of the processed service data packet;
generating a second five-tuple based on the next hop address and a switch address of the first switch;
the service data packet after being packaged and processed by the second five-tuple;
and sending the encapsulated service data packet to the second switch.
In another aspect, an embodiment of the present application provides a data transmitting apparatus, including:
the receiving module is used for receiving a service data packet sent by a first switch in a first edge node, and the service data packet is sent by the first switch when determining that the next-hop equipment of the service data packet is a first gateway server based on the service type of the service data packet;
the processing module is used for carrying out service processing on the service data packet;
and the sending module is used for sending the processed service data packet to the first switch so that the first switch sends the processed service data packet to a second switch in the second edge node.
Optionally, the processing module is configured to:
determining a service type of the service data packet based on a target port for receiving the service data packet;
and carrying out service processing on the service data packet based on the service type of the service data packet.
Optionally, the processing module is configured to:
when the target port is a first port, determining that the service type of the service data packet is a safety communication service;
when the service type of the service data packet is a safety communication service, encrypting the service data packet;
When the target port is a second port, determining that the service type of the service data packet is address conversion service;
and when the service type of the service data packet is address conversion service, performing address conversion processing on the service data packet.
In another aspect, an embodiment of the present application provides a data receiving apparatus, including:
the receiving module is used for receiving the service data packet sent by the first switch in the first edge node;
the determining module is used for determining next-hop equipment of the service data packet, the next-hop equipment comprises a second service server or a second gateway server in a second edge node, and the second gateway server is used for carrying out service processing on the service data packet and sending the processed service data packet to the second service server;
and the sending module is used for sending the service data packet to the next hop equipment.
Optionally, the determining module is configured to:
decapsulating a second quintuple of the service data packet, and determining a first quintuple in the service data packet, wherein the second quintuple is added when the first switch encapsulates the service data packet, and the second quintuple is positioned on the outer layer of the first quintuple;
And determining the next hop device based on the first five-tuple.
Optionally, when the next hop device is determined based on the first five-tuple, a determining module is configured to:
inquiring a next hop address in a routing table based on the first five-tuple;
when a next-hop address is queried, determining that the next-hop device is the second service server;
and when the next hop address is not queried, determining the next hop equipment as the second gateway server.
In another aspect, an embodiment of the present application provides a data receiving apparatus, including:
the receiving module is used for receiving a service data packet sent by a second switch in a second edge node, wherein the service data packet is sent when the second switch determines that next-hop equipment is a second gateway server;
the processing module is used for carrying out service processing on the service data packet to obtain the processed service data packet;
and the sending module is used for sending the processed service data packet to a second service server in the second edge node.
Optionally, the processing module is configured to:
determining the service type of the service data packet;
when the service type of the service data packet is a safety communication service, decrypting the service data packet to obtain the decrypted service data packet;
And when the service type of the service data packet is address conversion service, performing address conversion processing on the service data packet to obtain the service data packet after address conversion.
Optionally, when the address conversion processing is performed on the service data packet to obtain the service data packet after address conversion, the processing module is configured to:
acquiring a first five-tuple of the service data packet;
converting the destination public network address in the first five-tuple into a destination intranet address based on an address conversion relationship to obtain the service data packet after address conversion;
the sending module is used for:
and sending the service data packet after address conversion to the second service server based on the destination intranet address.
On the other hand, the embodiment of the application provides a communication system, which comprises a first edge node and a second edge node, wherein a first service server cluster, a first gateway server cluster and a first switch cluster are arranged in the first edge node, and a second service server cluster, a second gateway server cluster and a second switch cluster are arranged in the second edge node;
The first switch in the first switch cluster is used for implementing the data transmission method in the aspect;
the first gateway server in the first gateway server cluster is used for implementing the data sending method described in the above aspect;
the second switch in the second switch cluster is used for implementing the data receiving method in the aspect;
the second gateway server in the second gateway server cluster is configured to implement the data receiving method described in the above aspect.
In another aspect, an embodiment of the present application provides a switch, where the switch includes a processor and a memory, where at least one instruction is stored in the memory, where the at least one instruction is loaded and executed by the processor to implement a data sending method or a data receiving method according to the above aspect.
In another aspect, an embodiment of the present application provides a gateway server, where the gateway server includes a processor and a memory, where the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement a data sending method or a data receiving method according to the foregoing aspect.
In another aspect, embodiments of the present application provide a computer readable storage medium having at least one instruction stored therein, the at least one instruction being loaded and executed by a processor to implement a data transmission method or a data reception method as described in the above aspect.
In another aspect, embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the data transmission method or the data reception method provided in the above aspect.
In the embodiment of the application, after the switch in the edge node receives the service data packet sent by the service server, the service data packet is sent to the next-hop device based on the service type of the service data packet, and when the next-hop device is a gateway server in the edge node, the gateway server processes the service data packet and further transmits the processed service data packet through the switch, so that the requirement of large-flow bandwidth in the data transmission process can be met, and the safety requirement can be met; in addition, the switch is utilized to realize large-flow data transmission, so that the number of gateway servers in the gateway server cluster can be reduced, the utilization rate of the gateway servers is improved, and the resource waste of the edge nodes is avoided.
Drawings
FIG. 1 illustrates a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application;
FIG. 2 illustrates a flow chart of a data transmission method provided by an exemplary embodiment of the present application;
fig. 3 shows a flowchart of a data transmission method according to another exemplary embodiment of the present application;
fig. 4 is a flowchart of a data transmission method according to another exemplary embodiment of the present application;
FIG. 5 is a schematic diagram illustrating an implementation of a data transmission process according to an exemplary embodiment of the present application;
FIG. 6 illustrates a flow chart of a data receiving method provided by an exemplary embodiment of the present application;
fig. 7 is a flowchart of a data receiving method according to another exemplary embodiment of the present application;
FIG. 8 is a schematic diagram illustrating an implementation of a data reception process according to an exemplary embodiment of the present application;
fig. 9 is a block diagram of a data transmission apparatus according to an exemplary embodiment of the present application;
fig. 10 is a block diagram of a data transmission apparatus according to another exemplary embodiment of the present application;
fig. 11 is a block diagram of a data receiving apparatus according to an exemplary embodiment of the present application;
fig. 12 is a block diagram of a data receiving apparatus according to another exemplary embodiment of the present application;
FIG. 13 is a schematic diagram of a switch provided in an exemplary embodiment of the present application;
fig. 14 is a schematic structural diagram of a gateway server according to an exemplary embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
In the related art, when a gateway server scheme is adopted to realize data transmission between edge nodes, a gateway server cluster needs to be set in each edge node. When the security requirement of the service is high, the gateway servers in the gateway server cluster firstly encrypt the service data packet, and then transmit the encrypted service data packet, so that information leakage caused by interception of the service data packet in the public network transmission process is avoided. Because the bandwidth capability of the gateway server is limited, and traffic disaster tolerance and active-standby reliability characteristics need to be considered, a large number of gateway servers need to be included in the gateway server cluster.
For example, when the transmission bandwidth of a single gateway server is 100Gbps, 4 gateway servers are required to actually provide a transmission capability of 100Gbps in consideration of 50% of traffic disaster and host-backup setting. For a high-traffic scene, such as a live video scene, the required transmission capacity can reach 10Tbps, and 400 gateway servers are needed to meet the requirement.
Obviously, in order to adapt to different service scenarios, a gateway server cluster formed by a large number of gateway servers (and executing a single function) needs to be deployed at each edge node under the gateway server scheme, so that the deployment cost is high. In addition, in a non-large-flow scene, only a small number of gateway servers in the gateway server cluster are in a working state, so that the utilization rate of the gateway servers is low, and the resource waste of the edge node is caused.
In order to be suitable for different service scenes and the resource utilization rate of the edge nodes, the embodiment of the application provides a scheme for realizing communication between the edge nodes by combining soft and hard. Under the scheme, the edge node is provided with a switch cluster in addition to a gateway server cluster, wherein the gateway server cluster is used for realizing a software scheme, and the switch cluster is used for realizing a hardware scheme; the switch has stronger bandwidth capability compared with the gateway server, can meet the requirement of large flow, and the gateway server has stronger chip processing capability compared with the switch, can meet the requirements of encryption, decryption, address conversion and the like, and can be suitable for various service scenes by mutually matching the two.
In the data transmission process, a service server firstly transmits a service data packet to a switch, and under a high-flow scene, the service data packet can be directly transmitted to switches of other edge nodes through the switch by virtue of the high throughput characteristic of the switch; in the safety communication scene, the exchanger forwards the business data packet to the gateway server, the gateway server further processes the business data packet, the processed business data packet is sent to the exchanger, and finally the exchanger sends the processed business data packet to the exchanger of other edge nodes.
By using the switch and the gateway server, the service requirement of large bandwidth can be met, the service requirement of high security can be met, and after the switch cluster is arranged in the edge node, the number of gateway servers in the gateway server cluster can be reduced, thereby being beneficial to improving the utilization rate of the gateway servers and reducing the deployment cost of the edge node.
FIG. 1 illustrates a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application. The implementation environment includes a first edge node 110 and a second edge node 120, where a first service server cluster 111, a first gateway server cluster 112, and a first switch cluster 113 are disposed in the first edge node 110, and a second service server cluster 121, a second gateway server cluster 122, and a second switch cluster 123 are disposed in the second edge node 120. The device in the edge node performs data communication through a communication network, and optionally, the communication network can be a wired network or a wireless network, and the communication network can be at least one of a local area network, a metropolitan area network and a wide area network; the edge nodes communicate data through the switches, and the switches communicate data through the public network.
The first edge node 110 and the second edge node 120 may be edge computing sites located in different geographic locations, and the edge nodes serve devices within the vicinity. For example, the first edge node 110 is an edge computing site located in the open sea, the second edge node 120 is an edge computing site located in Beijing, the first edge node 110 serves devices in the Huadong area, and the second edge node 120 serves devices in the North China area.
The first service server cluster 111 and the second service server cluster 121 are each a cluster formed by a plurality of service servers for providing corresponding services for the accessed devices. For example, the service provided by the service server may include live video broadcast, online education, and the like, and the service provided by the service server is not limited in the embodiment of the present application.
In some scenarios, the service data between different edge nodes needs to be interacted to ensure consistency of the service data between different edge nodes. For example, in a live video scene, video interaction data (such as barrage data) received by service servers in different edge nodes need to be interacted, so that consistency of video interaction data seen by live broadcast audiences in different areas is ensured.
The first gateway server cluster 112 and the second gateway server cluster 122 are each a cluster of several gateway servers. In some embodiments, the gateway server is configured to process the traffic data based on traffic demand. For example, when the service has security requirement, the gateway server encrypts and decrypts the service data; when the service needs to realize network address translation (Network Address Translation, NAT) access, the gateway server performs address translation processing on the service data. Of course, the gateway server may have other functions according to the service requirements in addition to the above functions, which is not limited in this embodiment.
The first switch cluster 113 and the second switch cluster 123 are each a cluster of switches, which are used for data communication between edge nodes. Optionally, the switch is a programmable switch, and different routes are configured on the programmable switch according to different services. Further, when data is sent, the switch can directly transmit the service data packet to other switches based on the service type of the service data packet, or forward the service data packet to the gateway server for processing, so that the processed service data packet is transmitted to other switches.
In one possible application scenario, as shown in fig. 1, when a first service server cluster 111 needs to transmit service data to a second service server cluster 121, a first service server in the first service server cluster 111 first sends a service data packet to a first switch in the first switch cluster 113. The first switch determines a next hop device based on the traffic type of the traffic data packet and based on the traffic type. When the next-hop device is a second switch in the second edge node 120, the first switch tunnels the service data packet, and then transmits the service data packet to the second switch; when the next hop device is a first gateway server in the first gateway server cluster 112, the first switch forwards the service data packet to the first gateway server for processing, and sends the processed service data packet to the second switch.
After receiving the service data packet from the first edge node 110, the second switch in the second switch cluster 123 sends the service data packet to the second service server cluster 121 based on the next hop address if the next hop address is matched; if the next hop address is not matched, forwarding the service data packet to a second gateway server in the second gateway server cluster 122, processing the service data packet by the second gateway server, and finally sending the processed service data packet to the second service server cluster 121.
It should be noted that, in the above embodiment, only the first edge node 110 transmits the service data to the second edge node 120, and in practical application, when the second edge node 120 needs to transmit the service data to the first edge node 110, the second switch cluster 123 and the second gateway server cluster 122 in the second edge node 120 cooperate to implement data transmission, and the first switch cluster 113 and the first gateway server cluster 112 in the first edge node 110 cooperate to implement data reception, which is not described herein in detail.
Fig. 2 shows a flowchart of a data transmission method according to an exemplary embodiment of the present application. This embodiment is described by taking the method as an example for the first switch and the first gateway server in the implementation environment shown in fig. 1, where the method may include:
the first switch receives a service data packet sent by a first service server in a first edge node 201.
Because the switch has stronger data forwarding capability and larger bandwidth compared with the gateway server, when the first edge node needs to transmit service data to the second edge node, the first service server in the first edge node sends the service data packet to the first switch, and the first switch realizes external access of various types of services, so that unnecessary transmission consumption caused by the fact that the gateway server needs to forward the service data packet to the switch after the service server directly sends the service data packet to the gateway server in a large-flow scene is avoided.
Optionally, the service data packet is formed by service data and an internet protocol (Internet Protocol, IP) header, where the IP header is used to characterize the source, destination and protocol used for the service data packet. In some embodiments, the above information is indicated in the IP header by a five-tuple.
202, the first switch determines a next-hop device of the service data packet based on the service type of the service data packet, where the next-hop device includes a first gateway server in the first edge node or a second switch in the second edge node, and the first gateway server is used for performing service processing on the service data packet.
In one possible implementation, different routes are configured on the switch in advance for different types of traffic. After receiving the service data packet, the first switch first determines the service type of the service data packet and determines the next hop device of the service data packet.
In this embodiment, the next-hop device of the service data packet may be a second switch in the second edge node, or may be a first gateway server in the first edge node. Optionally, when the service data packet does not need to be further processed by the gateway server, the first switch determines the second switch as a next-hop device; and when the service data needs to be further processed by the gateway server, the first switch determines the first gateway server as the next-hop device so as to process the service data packet to be transmitted through the first gateway server.
The first switch sends 203 the traffic data packet to the next hop device.
In one possible implementation, the first switch sends the service data packet to the second switch through the public network, or the first switch sends the service data packet to the first gateway server through the edge site internal network.
The first gateway server receives 204 the traffic data packet sent by the first switch in the first edge node.
When the service type of the service data packet is the service type which needs to be processed by the gateway server, the first gateway server can receive the service data packet sent by the first switch.
The first gateway server performs service processing on the service data packet 205.
Further, the first gateway server performs service processing on the service data packet based on the service processing requirement of the service data packet. Optionally, the first gateway server performs service processing on the service data packet based on the service type of the service data.
In some embodiments, when the service to which the service data packet belongs has an encryption requirement, the first gateway server performs encryption processing on the service data packet, for example, performs internet protocol security (Internet Protocol Security, IPSec) encryption processing on the service data packet; when the service to which the service data packet belongs has NAT access requirement, the first gateway server performs address conversion processing on the service data packet. The embodiment of the application does not limit the service processing manner of the first gateway server.
206, the first gateway server sends the processed service data packet to the first switch.
The edge node realizes the external access of the service through the switch, so after the service processing is finished, the first gateway server feeds back the processed service data packet to the first switch, and the first switch further transmits the service data packet to the second edge node.
207, in case the next hop device is the first gateway server, the first switch receives the processed service data packet sent by the first gateway server.
When the next hop device is the first gateway server, after the first switch sends the service data packet, waiting for the service data packet after the feedback processing of the first gateway server. The actual content of the service data in the service data packet before and after the processing is not changed.
In one possible implementation manner, if the service data packet fed back by the first gateway server is not received within a preset time period after the service data is sent, the first switch may instruct the gateway server cluster to switch the primary gateway server and the secondary gateway server, so that the other gateway servers perform service processing on the service data packet again.
208, the first switch sends the processed service data packet to the second switch.
Further, the first switch sends the processed service data packet to the second switch, so as to realize the sending of the current service data packet, and continue to execute the sending of the next service data packet.
In summary, in the embodiment of the present application, after receiving a service data packet sent by a service server, an switch in an edge node sends the service data packet to a next-hop device based on a service type of the service data packet, and when the next-hop device is a switch in another edge node, large-flow service data transmission is directly performed through the switch, and when the next-hop device is a gateway server in the edge node, the service data packet is processed through the gateway server, and further, the processed service data packet is transmitted through the switch, so that not only can a large-flow bandwidth requirement in a data transmission process be satisfied, but also a security requirement can be satisfied; in addition, the switch is utilized to realize large-flow data transmission, so that the number of gateway servers in the gateway server cluster can be reduced, the utilization rate of the gateway servers is improved, and the resource waste of the edge nodes is avoided.
In a possible service scenario, when a large flow of service data needs to be forwarded between edge nodes, for example, in a live video scenario, the edge nodes need to transmit live broadcast data of a host to other edge nodes, and because the security requirement on the service data is low in such a service scenario, transmission encryption (that is, a gateway server does not need to perform service processing) is not needed, the switch can directly package and forward the service data packet from the service server. As shown in fig. 3, the transmission flow of the service data packet may include:
And 301, receiving a service data packet sent by a first service server in the first edge node.
302, when the service type of the service data packet belongs to the traffic forwarding service, determining that the next-hop device of the service data packet is the second switch.
When the service type of the service to which the service data packet belongs is identified as the traffic forwarding service, the first switch determines that the first switch has the capability of independently carrying out service data transmission without carrying out service processing through the first gateway server, and determines the second switch as the next-hop equipment.
The traffic forwarding service refers to a service with a large traffic data forwarding requirement, or a service with a traffic peak value greater than a threshold value (for example, 10 Tbps), such as a live video service, a barrage synchronization service, and the like, and the traffic forwarding service may be configured in advance, which is not limited in this embodiment.
Optionally, the first switch determines a service type of the service data packet based on the service identifier, or determines a service type of the service data packet based on a server identifier of the service server.
303, a first five-tuple of the service data packet is obtained.
In this embodiment, the service data packet includes a first five-tuple including a source address (asrc_addr), a source port (asrc_port) of the service server, a destination address (adst_addr) of the destination service server (i.e. the second service server), a destination port (adst_port), and a protocol (protocol). When data is transmitted, the first switch determines the second switch based on the first five-tuple.
304, the next hop address is queried from the routing table based on the first five tuples.
In one possible implementation, a routing table is preconfigured at the switch, where the routing table includes a correspondence between a five-tuple and a next-hop address. After the first five-tuple is obtained by the first switch, the corresponding next-hop address is queried in the routing table according to the first five-tuple. Wherein, the next hop address includes a next hop IP address and a next hop port. In one illustrative example, the routing table is shown in Table one.
List one
Figure BDA0003308035920000141
For example, when the obtained first five-tuple is (asrc_addr, asrc_port, adst_addr, adst_port, and protocol 1), the first switch determines that the next-hop address is next_addr1 (next-hop IP address), next_port1 (next-hop port).
And 305, generating a second five-tuple based on the queried next hop address and the switch address of the first switch.
Because the service data packet needs to be tunnel encapsulated before being sent, the first switch generates a second five-tuple for encapsulating the service data packet based on its own switch address (including the switch IP address and the switch port) and the queried next hop address.
Optionally, the protocol in the second five-tuple is consistent with the protocol in the first five-tuple.
In an illustrative example, the IP address of the first switch is ssrc_addr, the port of the switch is ssrc_port, and when the next hop IP address is next_addr and the next hop port is next_port, the generated second five-tuple is ssrc_addr, ssrc_port, next_addr, next_port, and protocol.
306, encapsulating the service data packet by the second quintuple, where the second quintuple is located on the outer layer of the first quintuple in the encapsulated service data packet.
Further, the first switch encapsulates the second quintuple on the outer layer of the first quintuple to obtain a service data packet including two continuous packet headers. In connection with the above example, the packet header of the encapsulated service packet is (ssrc_addr, ssrc_port, next_addr, next_port, and aprotocol) + (asrc_addr, asrc_port, adst_addr, adst_port, and aprotocol).
And 307, sending the encapsulated service data packet to the second switch.
After the tunnel encapsulation is completed, the first switch sends the encapsulated service data packet to the second switch based on the next hop address, and the current service data packet is sent.
In another possible service scenario, when secure data transmission between edge nodes is required or NAT access is required, for example, when edge node a needs to transmit video data of pay video to edge node B, or NAT access is required between edge node a and edge node, because the processing capability of the switch chip is limited, the switch needs to process the service data packet by means of the gateway server first, and then the processed service data packet can be further encapsulated and forwarded. As shown in fig. 4, the transmission flow of the service data packet may include:
the first switch receives 401 a service data packet sent by the first service server.
402, when the service type of the service data packet does not belong to the traffic forwarding service, the first switch determines that the next hop device of the service data packet is the first gateway server.
In one possible implementation, since the traffic data that needs to be encrypted, decrypted, address converted, and other traffic processing does not generally need to be forwarded in a large amount, when the first switch identifies that the traffic type of the traffic data packet does not belong to the traffic forwarding traffic, the first switch determines that the first gateway server located at the same edge node is the next hop device.
Optionally, the next-hop route of the traffic other than the traffic forwarded by the large-traffic forwarding is configured as a gateway server, and the first switch sends the traffic data packet to the first gateway server according to the route information corresponding to the first gateway server.
403, the first switch determines a destination port of the first gateway server based on the traffic type of the traffic data packet.
Because the service processing manners required by the service data packets of different service types are different, in one possible implementation manner, the first gateway server is provided with a plurality of ports, and different ports are used for receiving the service data packets of different service types (i.e. different service types correspond to different ports), so that the first gateway server determines the service type based on the receiving ports of the service data packets, and further determines the service processing manner of the service data packets. Before sending the service data packet to the first gateway server, the first switch determines a destination port through which the service data packet is sent based on the service type. In one illustrative example, the correspondence between ports and traffic types is shown in Table two.
Watch II
Port (port) Service type
50 Address translation service
80 Secure communication service
Optionally, in response to the service type of the service data packet being a secure communication service, the first switch determines the first port as a target port, and correspondingly, when the first gateway server receives the service data packet sent by the first switch through the first port, it can be determined that the service data packet needs to be encrypted;
and responding to the service type of the service data packet as address conversion service, determining the second port as a target port by the first switch, and correspondingly, determining that the service data packet needs address conversion processing when the first gateway server receives the service data packet sent by the first switch through the second port.
It should be noted that, in the embodiment of the present application, only the two service types and the ports are described as examples, and in other possible implementation manners, the first gateway server may also be provided with other ports for receiving service data packets of other service types, which is not limited to this embodiment.
The first switch sends a traffic packet to the destination port of the first gateway server 404.
Optionally, when the service type is a secure communication service, the first switch sends a service data packet to the first gateway server based on the server address and the first port of the first gateway server; when the service type is address conversion service, the first switch sends a service data packet to the first gateway server based on the server address of the first gateway server and the second port.
The first gateway server receives 405 the service data packet sent by the first switch.
Correspondingly, the first gateway server receives the service data packet sent by the first switch through the target port.
The first gateway server determines 406 a traffic type of the traffic data packet based on the destination port on which the traffic data packet was received.
Because the service data packets of different service types are received through different ports, the first gateway server can determine the service type of the service data packet according to the destination port through which the service data packet is received, and further determine the service processing mode of the service data packet.
Optionally, in response to the target port being the first port, the first gateway server determines that the service type of the service data packet is a secure communication service; and in response to the target port being the second port, the first gateway server determines that the service type of the service data packet is address translation service.
407, the first gateway server performs service processing on the service data packet based on the service type of the service data packet.
Further, the first gateway server processes the service data packet by adopting a service processing mode corresponding to the service type based on the service type.
Optionally, in response to the service type of the service data packet being a secure communication service, the first gateway server encrypts the service data packet.
In some embodiments, the first gateway server performs IPSec encryption on the service data packet to obtain an encrypted service data packet, where the encrypted service data packet includes an IPSec packet header in addition to the original packet header. Of course, in other possible embodiments, the first gateway server may also encrypt the service data packet in other manners, which is not limited in this embodiment.
Optionally, in response to the service type of the service data packet being an address translation service, the first gateway server performs address translation processing on the service data packet.
In the NAT access scene, in the original quintuple of the service data packet, the source address is the intranet address of the service server, and the switch cannot find the next hop address from the routing table based on the original quintuple. In order to ensure the correct transmission of the service data packet, the first gateway server needs to convert the source address from the intranet address to the public network address. In one possible implementation manner, a mapping relationship between an intranet address and a public network address is set in the first gateway server, and when a service data packet of an address conversion service is received, the first gateway server performs public network address conversion on a source intranet address in the service data packet based on the mapping relationship to obtain the source public network address.
In an exemplary example, the first gateway server obtains that an original five-tuple in the service data packet is (asrc_addr, asrc_port, adst_port, and aprotocol), performs address conversion on the original five-tuple based on a mapping relationship between an intranet IP address and a public network IP address, and the converted five-tuple is (gwsrc_addr, asrc_port, adst_addr, adst_port, and aprotocol), where gwsrc_addr is the converted public network IP address.
The first gateway server sends 408 the processed traffic data packet to the first switch.
After the service processing is completed, the first gateway server retransmits the first switch to the first switch, and the first switch is used for transmitting the service data packet.
409, the first switch receives the processed service data packet sent by the first gateway server.
The first switch sends the processed traffic data packet to the second switch 410.
Before transmitting the processed service data packet to the second switch, the first switch needs to perform tunnel encapsulation processing on the processed service data packet, so as to transmit the encapsulated service data packet. In one possible implementation, the first switch queries a next hop address from the routing table based on the five-tuple of the processed service data packet, and generates a second five-tuple based on the next hop address and the switch address of the first switch, so that the processed service data packet is encapsulated by the second five-tuple, and the encapsulated service data packet is sent to the second switch.
The first switch queries the next hop address based on the outermost five-tuple of the processed service data packet. For example, when the processed service data packet is an IPSec encrypted service data packet, the first switch queries a next hop address based on the five-tuple in the IPSec packet header; when the processed service data packet is the service data packet subjected to address conversion, the first switch inquires the next hop address based on the five-tuple after the public network address conversion.
The process of generating the second five-tuple by the first switch and performing tunnel encapsulation based on the second five-tuple can refer to the above embodiment, and this embodiment is not described herein again.
In an illustrative example, the process of implementing the transmission of the service data packet by the switch and the gateway server in cooperation under different service scenarios is shown in fig. 5. After receiving the service data packet, the switches in the first switch cluster 51 determine the service type of the service data packet. When the service type is the traffic forwarding service, the switch directly performs tunnel encapsulation on the service data packet and sends the service data packet to the opposite-end switch; when the service type is a secure communication service, the switch sends the service data packet to a gateway server in the first gateway server cluster 52, the gateway server encrypts the service data packet, and the encrypted service data packet is fed back to the switch, and the switch further performs tunnel encapsulation and then sends the service data packet; when the service type is address conversion service, the switch sends the service data packet to the gateway server, the gateway server performs address conversion on the service data packet based on the mapping relation of the internal network public network address, and the service data packet after address conversion is fed back to the switch, and the switch further performs tunnel encapsulation and then sends the service data packet.
In this embodiment, in a large-traffic service scenario, the switch directly tunnels the service data packet sent by the service server, and sends the encapsulated service data packet to the opposite-end switch, which is conducive to reducing deployment cost as compared with the implementation of large-traffic service data transmission by means of a large number of gateway servers in the related art; under the non-large-flow service scene, the switch forwards the service data packet to the gateway server for service processing, and further transmits the service data packet processed by the gateway server, so that the switch is suitable for the service scenes such as safe communication, NAT access and the like, and is beneficial to improving the utilization rate of the gateway server.
The above-described embodiments describe a process of implementing data transmission by cooperation of the switch and the gateway server, and the following describes a process of implementing data reception by cooperation of the switch and the gateway server by using an exemplary embodiment.
Fig. 6 shows a flowchart of a data receiving method according to an exemplary embodiment of the present application. This embodiment is described by taking the method for the second switch and the second gateway server in the implementation environment shown in fig. 1 as an example, where the method may include:
the second switch receives 601 a service data packet sent by the first switch in the first edge node.
In one possible implementation, the second switch at the second edge node receives the service data packet sent by the first switch through the public network.
The second switch determines 602 a next hop device for the traffic data packet, the next hop device comprising a second traffic server or a second gateway server in the second edge node.
For the service data packet which is not processed by the first gateway server, the second switch processes the service data packet and then forwards the service data packet to the second service server; for the service data packet processed by the second gateway server, the second switch may not be able to forward the service data packet to the second service server further after processing the service data packet. In this case, the second switch needs to send the service data packet to a second gateway server located in the same edge node, and the second gateway server further processes the service data packet and sends the processed service data packet to the second service server.
Therefore, after the second switch device receives the service data packet, it needs to determine the next hop device of the service data packet first.
603, the second switch sends the service data packet to the next hop device.
In some embodiments, when the received service data packet is tunnel-encapsulated, the second switch first needs to tunnel-decapsulate the service data packet, and then sends the decapsulated service data packet to the next hop device.
And 604, receiving a service data packet sent by a second switch in the second edge node by the second gateway server when the next-hop device is the second gateway server, and sending the service data packet when the second switch determines that the next-hop device is the second gateway server.
And 605, the second gateway server performs service processing on the service data packet to obtain a processed service data packet.
In one possible implementation manner, when the second gateway server receives the service data packet sent by the second switch and is in the data packet receiving state, the second gateway server determines a service processing mode of the service data packet, so as to process the service data packet and obtain a processed service data packet. The mode of processing the service data packet by the second gateway server corresponds to the mode of processing the service data packet by the first gateway server.
For example, if the first gateway server encrypts the service data packet to be sent, the second gateway server needs to decrypt the received service data packet; if the first gateway server performs address conversion processing (internal network address conversion to public network address) on the service data packet to be sent, the second gateway server needs to perform reverse address conversion processing (external network address conversion to internal network address) on the received service data packet.
In some embodiments, the second gateway server determines a service handling manner of the service data packet by identifying a service type of the service data packet.
The second gateway server sends 606 the processed traffic data packets to a second traffic server in the second edge node.
Further, the second gateway server sends the processed service data packet to the second service server, so as to receive the current service data packet and continue to receive the next service data packet.
In summary, in the embodiment of the present application, after receiving a service data packet sent by a service server, an switch in an edge node sends the service data packet to a next-hop device based on a service type of the service data packet, and when the next-hop device is a switch in another edge node, large-flow service data transmission is directly performed through the switch, and when the next-hop device is a gateway server in the edge node, the service data packet is processed through the gateway server, and further, the processed service data packet is transmitted through the switch, so that not only can a large-flow bandwidth requirement in a data transmission process be satisfied, but also a security requirement can be satisfied; in addition, the switch is utilized to realize large-flow data transmission, so that the number of gateway servers in the gateway server cluster can be reduced, the utilization rate of the gateway servers is improved, and the resource waste of the edge nodes is avoided.
Fig. 7 shows a flowchart of a data receiving method according to another exemplary embodiment of the present application. The method may include:
701, the second switch receives the service data packet sent by the first switch.
The second switch decapsulates the second five tuples of the service data packet 702, determining the first five tuples in the service data packet.
In one possible implementation, the first switch performs tunnel encapsulation on the service data packet before sending the service data packet to the second switch, and in the tunnel encapsulation process, the five-tuple is added on the outer layer of the original service data packet (that is, the received service data packet includes the second five-tuple on the outer layer and the first five-tuple on the inner layer), so that in the receiving process, the second switch needs to decapsulate the five-tuple on the outer layer of the service data packet.
In an exemplary example, if the packet header of the received service packet includes (ssrc_addr, ssrc_port, next_addr, next_port, and protocol) + (asrc_addr, asrc_port, adst_addr, adst_port, and protocol), the second switch decapsulates the packet header (ssrc_addr, ssrc_port, next_addr, next_port, and protocol), and the decapsulated service packet includes the packet header (asrc_addr, asrc_port, adst_addr, adst_port, and protocol).
The second switch determines 703 a next hop device based on the first five tuples.
In a possible implementation manner, the second switch is preconfigured with a routing table (corresponding to the routing table configured in the first switch), and after the service data packet is decapsulated, the second switch further determines the next hop address of the next hop device based on the first five-tuple of the decapsulated service data packet. Alternatively, the process of determining the next hop device may include:
1. the next hop address is queried in the routing table based on the first five-tuple.
Optionally, the routing table includes a correspondence between the five-tuple and a next address, and the second switch device performs route matching based on performing the first five-tuple in the routing table, and queries whether a next-hop address corresponding to the first five-tuple exists.
2. And in response to the inquiry of the next hop address, determining the next hop device as a second service server.
Optionally, a next hop address corresponding to the traffic forwarding service is configured in the routing table of the second switch, and correspondingly, when the next hop address is queried based on the first five-tuple, the second switch determines the traffic forwarding service of the service type of the service data packet, and further determines the next hop device as the second service server. In the process of sending the traffic forwarding service, only the first switch performs tunnel encapsulation processing on the service data packet, so that the second switch performs decapsulation processing on the service data packet, the service data packet can be ready to be forwarded to the second service server based on the first five-tuple, and the second service server can correctly identify the service data packet.
3. And in response to not querying the next hop address, determining that the next hop device is the second gateway server.
If the next hop address is not queried in the routing table based on the first five-tuple, it indicates that when the service data packet sent by the first switch is processed by the first gateway server, correspondingly, before the service data packet is sent to the second service server, the second gateway server needs to perform service processing, so that the second switch determines the next hop device as the second gateway server.
The second switch sends 704 the traffic data packet to the next hop device.
In one possible implementation, when the next-hop device is the second service server, the first switch sends the service data packet to the second service server based on the queried next-hop address; when the next hop device is a second gateway server, the first switch sends a service data packet to the second gateway server based on a pre-configured server address of the second gateway server.
And 705, receiving the service data packet sent by the second switch by the second gateway server under the condition that the next hop device is the second gateway server.
The second gateway server determines 706 the traffic type of the traffic data packet.
Because the first gateway server adopts different service processing modes to process the service data packets with different service types, the second gateway server also needs to process the service data packets by adopting different service processing modes based on the service types of the service data packets.
In one possible implementation, when the gateway server supports the service processing of the secure communication service and the address translation service, the second gateway server determines the secure communication service of the service type if the service data packet is detected to have a decryption protocol, and determines the service type as the address translation service if the service data packet is detected to not include the decryption protocol. The present embodiment will be described by taking the above-described service type and service type detection method as examples, but this configuration is not limited thereto.
707, when the service type of the service data packet is a secure communication service, the second gateway server decrypts the service data packet to obtain a decrypted service data packet.
When the service type of the service data packet is a secure communication service, the second gateway server adopts a decryption mode corresponding to the decryption mode in the first gateway server to decrypt the service data packet to obtain a decrypted service data packet, so that the subsequent second service server can identify the service data in the service data packet.
In some embodiments, when the first gateway server IPSec encrypts the traffic data packet, the second gateway server IPSec decrypts the traffic data packet.
708, when the service type of the service data packet is address conversion service, the second gateway server performs address conversion processing on the service data packet to obtain the service data packet after address conversion.
Because the destination address in the service data packet is a public network address, the second gateway server needs to convert the destination public network address in the service data packet into a destination intranet address based on the mapping relationship between the public network address and the intranet address, and then accurately sends the service data packet to the second service server based on the destination intranet address. In one possible implementation manner, the second gateway server obtains a first five-tuple of the service data packet, so that a destination public network address in the first five-tuple is converted into a target intranet address based on an address conversion relationship, and the service data packet after address conversion is obtained.
709, the second gateway server sends the processed service data packet to a second service server in the second edge node.
In one possible implementation manner, when the service data packet is an address translation service, the second gateway server sends the service data packet after address translation to the second service server based on the destination intranet address obtained by translation.
In an illustrative example, the process of implementing the transmission of the service data packet by the switch and the gateway server in cooperation under different service scenarios is shown in fig. 8. After receiving the service data packet, the second switch in the second switch cluster 81 first performs tunnel decapsulation on the service data packet, and then performs route matching based on the inner five-tuple of the decapsulated service data packet. If the next hop address is matched, the service data packet is sent to a second service server in a second service server cluster; if the next hop address is not matched, the second switch sends the service data packet to a second gateway server in the second gateway server cluster 82. After receiving the service data packet, the second gateway server detects whether a decryption protocol exists in the service data packet, if so, decrypts the service data packet, and sends the decrypted service data packet to the second service server; if not, address conversion processing is carried out on the service data packet, and the service data packet is sent to the second service server based on the converted intranet address.
Fig. 9 is a block diagram 900 of a data transmission apparatus according to an exemplary embodiment of the present application, where the apparatus includes:
A receiving module 901, configured to receive a service data packet sent by a first service server in a first edge node;
a determining module 902, configured to determine, based on a service type of the service data packet, a next-hop device of the service data packet, where the next-hop device includes a first gateway server in the first edge node or a second switch in a second edge node, where the first gateway server is configured to perform service processing on the service data packet;
a sending module 903, configured to send the service data packet to the next hop device;
the receiving module 901 is further configured to receive the service data packet after processing sent by the first gateway server, where the next hop device is the first gateway server;
the sending module 903 is further configured to send the processed service data packet to the second switch.
Optionally, the determining module 902 is configured to:
when the service type of the service data packet belongs to a flow forwarding service, determining that the next-hop equipment of the service data packet is the second switch;
and when the service type of the service data packet does not belong to the traffic forwarding service, determining the next-hop equipment of the service data packet as the first gateway server.
Optionally, in a case where the next hop device is the second switch, the sending module 903 is configured to:
acquiring a first five-tuple of the service data packet;
inquiring a next hop address from a routing table based on the first five-tuple;
generating a second five-tuple based on the queried next hop address and the switch address of the first switch;
encapsulating the service data packet through the second five-tuple;
and sending the encapsulated service data packet to the second switch.
Optionally, in the case where the next hop device is the first gateway server, the sending module 903 is further configured to:
determining a target port of the first gateway server based on the service type of the service data packet, wherein different service types correspond to different ports;
and sending the service data packet to the target port of the first gateway server so that the first gateway server determines the service type of the service data packet based on the target port.
Optionally, when determining the destination port of the first gateway server based on the service type of the service data packet, the sending module 903 is further configured to:
When the service type of the service data packet is a secure communication service, determining a first port as the target port, wherein the first gateway server is used for encrypting the service data packet received through the first port;
and when the service type of the service data packet is address conversion service, determining a second port as the target port, wherein the first gateway server is used for performing address conversion processing on the service data packet received through the second port.
Optionally, in the case where the next hop device is the first gateway server, the sending module 903 is further configured to:
inquiring a next hop address from a routing table based on the five-tuple of the processed service data packet;
generating a second five-tuple based on the next hop address and a switch address of the first switch;
the service data packet after being packaged and processed by the second five-tuple;
and sending the encapsulated service data packet to the second switch.
Fig. 10 is a block diagram 1000 of a data transmission apparatus according to another exemplary embodiment of the present application, the apparatus including:
a receiving module 1001, configured to receive a service data packet sent by a first switch in a first edge node, where the service data packet is sent by the first switch when determining, based on a service type of the service data packet, that a next hop device of the service data packet is a first gateway server;
A processing module 1002, configured to perform service processing on the service data packet;
and a sending module 1003, configured to send the processed service data packet to the first switch, so that the first switch sends the processed service data packet to a second switch in a second edge node.
Optionally, the processing module 1002 is configured to:
determining a service type of the service data packet based on a target port for receiving the service data packet;
and carrying out service processing on the service data packet based on the service type of the service data packet.
Optionally, the processing module 1002 is configured to:
when the target port is a first port, determining that the service type of the service data packet is a safety communication service;
and when the service type of the service data packet is a safety communication service, encrypting the service data packet.
When the target port is a second port, determining that the service type of the service data packet is address conversion service;
and when the service type of the service data packet is address conversion service, performing address conversion processing on the service data packet.
Fig. 11 is a block diagram 1100 of a data receiving apparatus according to an exemplary embodiment of the present application, the apparatus includes:
A receiving module 1101, configured to receive a service data packet sent by a first switch in a first edge node;
a determining module 1102, configured to determine a next-hop device of the service data packet, where the next-hop device includes a second service server or a second gateway server in a second edge node, where the second gateway server is configured to perform service processing on the service data packet, and send the processed service data packet to the second service server;
a sending module 1103, configured to send the service data packet to the next hop device.
Optionally, the determining module 1102 is configured to:
decapsulating a second quintuple of the service data packet, and determining a first quintuple in the service data packet, wherein the second quintuple is added when the first switch encapsulates the service data packet, and the second quintuple is positioned on the outer layer of the first quintuple;
and determining the next hop device based on the first five-tuple.
Optionally, when determining the next hop device based on the first five-tuple, the determining module 1102 is configured to:
inquiring a next hop address in a routing table based on the first five-tuple;
When a next-hop address is queried, determining that the next-hop device is the second service server;
and when the next hop address is not queried, determining the next hop equipment as the second gateway server.
Fig. 12 is a block diagram 1200 of a data receiving apparatus according to an exemplary embodiment of the present application, the apparatus including:
a receiving module 1201, configured to receive a service data packet sent by a second switch in a second edge node, where the service data packet is sent when the second switch determines that a next hop device is a second gateway server;
a processing module 1202, configured to perform service processing on the service data packet based on a service type of the service data packet, to obtain the processed service data packet;
and the sending module 1203 is configured to send the processed service data packet to a second service server in the second edge node.
Optionally, the processing module 1202 is configured to:
determining the service type of the service data packet;
when the service type of the service data packet is a safety communication service, decrypting the service data packet to obtain the decrypted service data packet;
and when the service type of the service data packet is address conversion service, performing address conversion processing on the service data packet to obtain the service data packet after address conversion.
Optionally, when the address conversion processing is performed on the service data packet to obtain the service data packet after address conversion, the processing module 1202 is configured to:
acquiring a first five-tuple of the service data packet;
converting the destination public network address in the first five-tuple into a destination intranet address based on an address conversion relationship to obtain the service data packet after address conversion;
the sending module 1203 is configured to:
and sending the service data packet after address conversion to the second service server based on the destination intranet address.
It should be noted that: the apparatus provided in the above embodiment is only exemplified by the division of the above functional modules, and in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the apparatus is divided into different functional modules, so as to perform all or part of the functions described above. In addition, the apparatus and the method embodiments provided in the foregoing embodiments belong to the same concept, and detailed implementation processes of the method embodiments are described in the method embodiments, which are not repeated herein.
Fig. 13 is a schematic diagram of a switch according to an exemplary embodiment of the present application. The switch includes a memory 1301, a processor 1302, a switching chip 1303, and other components, such as a power supply, and the like. In some embodiments, a controller may be deployed on the operating system of the switch and run by the processor 1302, which may control the switching chip 1303 through a high-speed serial computer expansion bus standard (Peripheral Component Interconnect express, PCIe) interface.
The memory 1301 stores therein at least one instruction that is loaded and executed by the processor 1302 to implement the data transmission method or the data reception method of the exchange side in the above-described embodiment.
In some embodiments, when the switch is a programmable switch, the switch chip 1303 is a programmable switch chip. Unlike fixed network processing functions in conventional switches, programmable switches can be programmed to customize various network processing functions.
The switching chip 1303 may be implemented in a variety of ways including, but not limited to, a field programmable gate array (Field Programmable Gate Array, FPGA), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a network processor (Networking Processor, NP), and combinations thereof. It should be appreciated that fig. 13 illustrates only one example structure of a switch, and that any other switch, either existing or developed in the future, may be used in conjunction with embodiments of the present disclosure.
Referring to fig. 14, a block diagram of a gateway server according to an exemplary embodiment of the present application is shown. Specifically, the present invention relates to a method for manufacturing a semiconductor device.
The gateway server 1400 includes a central processing unit (Central Processing Unit, CPU) 1401, a system Memory 1404 including a random access Memory (Random Access Memory, RAM) 1402 and a Read-Only Memory (ROM) 1403, and a system bus 1405 connecting the system Memory 1404 and the central processing unit 1401. The gateway server 1400 also includes a basic Input/Output system (I/O system) 1406 that facilitates the transfer of information between the various devices within the server, and a mass storage device 1407 for storing an operating system 1413, application programs 1414, and other program modules 1415.
The basic input/output system 1406 includes a display 1408 for displaying information and an input device 1409, such as a mouse, keyboard, etc., for a user to input information. Wherein the display 1408 and the input device 1409 are connected to the central processing unit 1401 via an input output controller 1410 connected to the system bus 1405. The basic input/output system 1406 may also include an input/output controller 1410 for receiving and processing input from a number of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, the input output controller 1410 also provides output to a display screen, a printer, or other type of output device.
The mass storage device 1407 is connected to the central processing unit 1401 through a mass storage controller (not shown) connected to the system bus 1405. The mass storage device 1407 and its associated computer-readable storage media provide non-volatile storage for the gateway server 1400. That is, the mass storage device 1407 may include a computer readable storage medium (not shown) such as a hard disk or a compact disk-Only (CD-ROM) drive.
The computer-readable storage medium may include computer storage media and communication media without loss of generality. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable storage instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, erasable programmable read-Only register (Erasable Programmable Read Only Memory, EPROM), electrically erasable programmable read-Only Memory (EEPROM), flash Memory or other solid state Memory technology, CD-ROM, digital versatile disks (Digital Versatile Disc, DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will recognize that the computer storage medium is not limited to the one described above. The system memory 1404 and mass storage device 1407 described above may be collectively referred to as memory.
The memory stores one or more programs configured to be executed by the one or more central processing units 1401, the one or more programs containing instructions for implementing the above-described method embodiments, and the central processing unit 1401 executes the one or more programs to implement the gateway server-side data transmission method or the data reception method provided by the above-described respective method embodiments.
According to various embodiments of the present application, the gateway server 1400 may also operate through a network, such as the internet, to a remote server on the network. I.e. the gateway server 1400 may be connected to the network 1412 via a network interface unit 1411 connected to the system bus 1405, or alternatively, the network interface unit 1411 may be used to connect to other types of networks or remote server systems (not shown).
The memory also includes one or more programs stored in the memory, the one or more programs including steps performed by the gateway server for performing the methods provided by embodiments of the present application.
The embodiment of the application further provides a computer readable storage medium, where at least one instruction is stored, where at least one instruction is loaded and executed by a processor to implement the data sending method or the data receiving method according to any one of the embodiments.
Alternatively, the computer-readable storage medium may include: ROM, RAM, solid state disk (SSD, solid State Drives), or optical disk, etc. The RAM may include, among other things, resistive random access memory (ReRAM, resistance Random Access Memory) and dynamic random access memory (DRAM, dynamic Random Access Memory).
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the data transmission method or the data reception method described in the above embodiment.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.

Claims (19)

1. A method of data transmission for a first switch in a first edge node, the method comprising:
receiving a service data packet sent by a first service server in the first edge node;
determining next-hop equipment of the service data packet based on the service type of the service data packet, wherein the next-hop equipment comprises a first gateway server in the first edge node or a second switch in a second edge node, and the first gateway server is used for carrying out service processing on the service data packet;
Transmitting the service data packet to the next hop device;
receiving the processed service data packet sent by the first gateway server under the condition that the next-hop device is the first gateway server;
and sending the processed service data packet to the second switch.
2. The method of claim 1, wherein the determining the next hop device for the service data packet based on the service type of the service data packet comprises:
when the service type of the service data packet belongs to a flow forwarding service, determining that the next-hop equipment of the service data packet is the second switch;
and when the service type of the service data packet does not belong to the traffic forwarding service, determining the next-hop equipment of the service data packet as the first gateway server.
3. The method according to claim 2, wherein, in the case where the next-hop device is the second switch, the sending the service data packet to the next-hop device includes:
acquiring a first five-tuple of the service data packet;
inquiring a next hop address from a routing table based on the first five-tuple;
Generating a second five-tuple based on the queried next hop address and the switch address of the first switch;
encapsulating the service data packet through the second five-tuple;
and sending the encapsulated service data packet to the second switch.
4. The method according to claim 2, wherein, in case the next hop device is the first gateway server, the sending the service data packet to the next hop device comprises:
determining a target port of the first gateway server based on the service type of the service data packet, wherein different service types correspond to different ports;
and sending the service data packet to the target port of the first gateway server so that the first gateway server determines the service type of the service data packet based on the target port.
5. The method of claim 4, wherein the determining the destination port of the first gateway server based on the traffic type of the traffic data packet comprises:
when the service type of the service data packet is a secure communication service, determining a first port as the target port, wherein the first gateway server is used for encrypting the service data packet received through the first port;
And when the service type of the service data packet is address conversion service, determining a second port as the target port, wherein the first gateway server is used for performing address conversion processing on the service data packet received through the second port.
6. The method according to any one of claims 1 to 5, wherein, in the case where the next-hop device is the first gateway server, the sending the processed service data packet to the second switch includes:
inquiring a next hop address from a routing table based on the five-tuple of the processed service data packet;
generating a second five-tuple based on the next hop address and a switch address of the first switch;
the service data packet after being packaged and processed by the second five-tuple;
and sending the encapsulated service data packet to the second switch.
7. A method of data transmission for a first gateway server in a first edge node, the method comprising:
receiving a service data packet sent by a first switch in the first edge node, wherein the service data packet is sent by the first switch when determining that the next-hop equipment of the service data packet is the first gateway server based on the service type of the service data packet;
Carrying out service processing on the service data packet;
and sending the processed service data packet to the first switch, so that the first switch sends the processed service data packet to a second switch in a second edge node.
8. The method of claim 7, wherein said performing traffic processing on said traffic data packet comprises:
determining a service type of the service data packet based on a target port for receiving the service data packet;
and carrying out service processing on the service data packet based on the service type of the service data packet.
9. The method of claim 8, wherein the determining the traffic type of the traffic data packet based on the destination port receiving the traffic data packet comprises:
when the target port is a first port, determining that the service type of the service data packet is a safety communication service;
when the target port is a second port, determining that the service type of the service data packet is address conversion service;
the service processing for the service data packet based on the service type of the service data packet comprises the following steps:
when the service type of the service data packet is a safety communication service, encrypting the service data packet;
And when the service type of the service data packet is address conversion service, performing address conversion processing on the service data packet.
10. A method of data reception for a second switch in a second edge node, the method comprising:
receiving a service data packet sent by a first switch in a first edge node;
determining a next-hop device of the service data packet, wherein the next-hop device comprises a second service server or a second gateway server in the second edge node, and the second gateway server is used for performing service processing on the service data packet and sending the processed service data packet to the second service server;
and sending the service data packet to the next hop device.
11. A method of data reception for a second gateway server in a second edge node, the method comprising:
receiving a service data packet sent by a second switch in the second edge node, wherein the service data packet is sent when the second switch determines that next-hop equipment is the second gateway server;
carrying out service processing on the service data packet to obtain the processed service data packet;
And sending the processed service data packet to a second service server in the second edge node.
12. A data transmission apparatus, the apparatus comprising:
the receiving module is used for receiving the service data packet sent by the first service server in the first edge node;
a determining module, configured to determine a next-hop device of the service data packet based on a service type of the service data packet, where the next-hop device includes a first gateway server in the first edge node or a second switch in a second edge node, and the first gateway server is configured to perform service processing on the service data packet;
a sending module, configured to send the service data packet to the next hop device;
the receiving module is further configured to receive the service data packet after processing sent by the first gateway server when the next hop device is the first gateway server;
the sending module is further configured to send the processed service data packet to the second switch.
13. A data transmission apparatus, the apparatus comprising:
the receiving module is used for receiving a service data packet sent by a first switch in a first edge node, and the service data packet is sent by the first switch when determining that the next-hop equipment of the service data packet is a first gateway server based on the service type of the service data packet;
The processing module is used for carrying out service processing on the service data packet;
and the sending module is used for sending the processed service data packet to the first switch so that the first switch sends the processed service data packet to a second switch in the second edge node.
14. A data receiving apparatus, the apparatus comprising:
the receiving module is used for receiving the service data packet sent by the first switch in the first edge node;
the determining module is used for determining next-hop equipment of the service data packet, the next-hop equipment comprises a second service server or a second gateway server in a second edge node, and the second gateway server is used for carrying out service processing on the service data packet and sending the processed service data packet to the second service server;
and the sending module is used for sending the service data packet to the next hop equipment.
15. A data receiving apparatus, the apparatus comprising:
the receiving module is used for receiving a service data packet sent by a second switch in a second edge node, wherein the service data packet is sent when the second switch determines that next-hop equipment is a second gateway server;
The processing module is used for carrying out service processing on the service data packet based on the service type of the service data packet to obtain the processed service data packet;
and the sending module is used for sending the processed service data packet to a second service server in the second edge node.
16. A switch comprising a processor and a memory, the memory having stored therein at least one instruction that is loaded and executed by the processor to implement the data transmission method of any one of claims 1 to 6 or to implement the data reception method of claim 10.
17. A gateway server comprising a processor and a memory, wherein the memory has stored therein at least one instruction that is loaded and executed by the processor to implement the data transmission method according to any one of claims 7 to 9 or to implement the data reception method according to claim 11.
18. A computer readable storage medium having stored therein at least one instruction loaded and executed by a processor to implement the data transmission method of any one of claims 1 to 6, or to implement the data transmission method of any one of claims 7 to 9, or to implement the data reception method of claim 10, or to implement the data reception method of claim 11.
19. A computer program product, the computer program product comprising computer instructions stored in a computer readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, the processor executing the computer instructions, causing the computer device to perform the data transmission method according to any one of claims 1 to 6, or to perform the data transmission method according to any one of claims 7 to 9, or to perform the data reception method according to claim 10, or to perform the data reception method according to claim 11.
CN202111208819.3A 2021-10-18 2021-10-18 Data transmitting method, data receiving method, switch and gateway server Pending CN115996185A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111208819.3A CN115996185A (en) 2021-10-18 2021-10-18 Data transmitting method, data receiving method, switch and gateway server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111208819.3A CN115996185A (en) 2021-10-18 2021-10-18 Data transmitting method, data receiving method, switch and gateway server

Publications (1)

Publication Number Publication Date
CN115996185A true CN115996185A (en) 2023-04-21

Family

ID=85993971

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111208819.3A Pending CN115996185A (en) 2021-10-18 2021-10-18 Data transmitting method, data receiving method, switch and gateway server

Country Status (1)

Country Link
CN (1) CN115996185A (en)

Similar Documents

Publication Publication Date Title
US10263916B2 (en) System and method for message handling in a network device
EP3070887B1 (en) Communication method, device and system for virtual extensible local area network
JP3667586B2 (en) Multicast packet transfer device, multicast packet transfer system, and storage medium
EP3605972B1 (en) Packet transmission method, edge device, and machine readable storage medium
CN107317752B (en) Method and device for forwarding data message
CN110505244B (en) Remote tunnel access technology gateway and server
US9036633B2 (en) Multicast support for internet protocol version four residual deployment via encapsulation or translation
CN108600074B (en) Method and device for forwarding multicast data message
CN103888386A (en) Extensible virtual local area network message transmission method, device and system
WO2016177145A1 (en) Packet transmission method and device
CN107645433B (en) Message forwarding method and device
EP3566407A1 (en) Cross-device segmentation offload
CN111526223B (en) Management method of edge service server, service data processing method and device
CN112134776B (en) Method for generating multicast forwarding table item and access gateway
EP4044533A1 (en) Method, device, and equipment for load sharing in bit index explicit replication network
KR20180025944A (en) Method and apparatus for implementing SDN-based ARP
CN107733930B (en) Method and system for forwarding Internet Protocol (IP) packets at multiple WAN network gateways
CN102546308B (en) The method and system of neighbor uni-cast agency is realized based on duplicate address detection
EP3032801B1 (en) Method and device for generating forwarding information
CN102201996A (en) Method and equipment for forwarding message in network address translation (NAT) environment
CN112968965B (en) Metadata service method, server and storage medium for NFV network node
CN108667735B (en) Method and device for forwarding multicast data
CN112702338B (en) IKE message acquisition method and device
US10291750B1 (en) Aggregating data sessions between autonomous systems
WO2017036384A1 (en) Provider edge device and data forwarding method

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40084263

Country of ref document: HK