HK40035471A - Data transmission method and device - Google Patents
Data transmission method and device Download PDFInfo
- Publication number
- HK40035471A HK40035471A HK42021025534.5A HK42021025534A HK40035471A HK 40035471 A HK40035471 A HK 40035471A HK 42021025534 A HK42021025534 A HK 42021025534A HK 40035471 A HK40035471 A HK 40035471A
- Authority
- HK
- Hong Kong
- Prior art keywords
- port
- node
- fog
- active
- fog node
- Prior art date
Links
Description
Technical Field
The present application relates to the field of communications technologies, and in particular, to a data transmission method and apparatus.
Background
In the cloud computing era, as more and more access devices are used, bandwidth is easy to find when data are transmitted and information are acquired, and meanwhile, as the data volume is greatly increased, the computing load of a data center becomes a bottleneck. Fog calculation is carried out as soon as possible. The cloud computing is used as an extended concept of cloud computing, and computing tasks such as transmission, computing and processing are carried by using equipment with low performance and large quantity in the network edge, such as a router and a mobile phone, as a cloud node, so that data transmission among network layers is effectively reduced, and computing load of a data center is also reduced.
Network Address Translation (NAT) realizes that a fog node in an NAT gateway transmits data with other fog nodes outside the NAT gateway, and simultaneously protects the fog node in the NAT gateway from being attacked by an external network, but only allows the fog node in the NAT gateway to actively initiate connection to the fog node outside an intranet.
Disclosure of Invention
The present application aims to provide a data transmission method and apparatus, which can improve the efficiency of data transmission at least to some extent.
According to an aspect of an embodiment of the present application, there is provided a data transmission method, including: acquiring network address conversion types of two fog nodes to be connected, wherein the network address conversion type of one of the two fog nodes is an active symmetric type; determining whether the two fog nodes can establish a connection based on a network address translation type of the other of the two fog nodes; if the two fog nodes can establish connection, determining the fog node with the network address conversion type being an active symmetric type as an active connecting party or a passive connecting party based on the network address conversion type of the other fog node, wherein the active connecting party firstly sends a connection request to the passive connecting party so as to establish connection between the two fog nodes, and when the fog node with the network address conversion type being the active symmetric type is used as the active connecting party, the active symmetric fog node is shown to be capable of communicating with a port in the other fog node which receives the connection request only through a port which sends the connection request; when the mist node with the network address conversion type of active symmetry type is used as the passive connecting party, the mist node of active symmetry type is shown to use another port except the port for receiving the connection request to communicate with the port for sending the connection request in the other mist node, and the mist node of active symmetry type can establish connection with the other mist node only after receiving the connection request sent by the other mist node; and carrying out data transmission between the two connected fog nodes.
According to an aspect of an embodiment of the present application, there is provided a data transmission apparatus, including: the system comprises an acquisition module, a processing module and a control module, wherein the acquisition module is configured to acquire network address conversion types of two fog nodes to be connected, and the network address conversion type of one of the two fog nodes is an active symmetric type; a determining module configured to determine whether the two fog nodes are capable of establishing a connection based on a network address translation type of the other of the two fog nodes; a connection module, configured to determine, based on a network address conversion type of another fog node, a fog node whose network address conversion type is an active symmetric type to serve as an active connecting party or a passive connecting party if the two fog nodes can establish a connection, where the active connecting party first sends a connection request to the passive connecting party to establish a connection between the two fog nodes, where, when the fog node whose network address conversion type is the active symmetric type serves as the active connecting party, the connection module appears to be able to communicate with a port of the another fog node that receives the connection request only through a port that sends the connection request; when the mist node with the network address conversion type of active symmetry type is used as the passive connecting party, the other port except the port for receiving the connection request is used for communicating with the port for sending the connection request in the other mist node, and the mist node of active symmetry type can establish connection with the other mist node only after receiving the connection request sent by the other mist node; and the transmission module is configured to transmit data between the two connected fog nodes.
In some embodiments of the present application, based on the foregoing solution, the obtaining module is configured to: acquiring a network address conversion type of the fog node, which is detected by an active detection server through a first port of the fog node, wherein if the network address conversion type detected by the active detection server is an active symmetric type, the fog node is an active symmetric type node capable of being used as an active connecting party; and acquiring a network address conversion type of the fog node detected by a passive detection server through a second port corresponding to the first port in the fog node, wherein if the network address conversion type detected by the passive detection server is an active symmetric type, the fog node is an active symmetric type node capable of being used as the passive connecting party.
In some embodiments of the present application, based on the foregoing solution, the obtaining module is configured to: the number of the first ports is multiple, the number of the second ports corresponding to the first ports is multiple, and the first ports and the second ports are in one-to-one correspondence to form a plurality of port pairs; storing the plurality of port pairs to the active probe server and the passive probe server.
In some embodiments of the present application, based on the foregoing solution, the obtaining module is configured to: receiving a first connection request sent by the first port of the first address of the active detection server through the first port of the first address of the active detection server, and responding to the first connection request and sending a first response packet back to the fog node through the first port of the first address of the active detection server; if the fog node can receive the first response packet and the address information carried in the first response packet is not consistent with the fog node address, receiving a second connection request which is sent by the first port of the first address of the active detection server and is provided with a conversion address and conversion port attributes, responding to the second connection request, and returning a second response packet to the fog node through a second port of the second address of the active detection server, and if the fog node can receive the second response packet, determining that the fog node is a full cone node; if the fog node cannot receive the second response packet, receiving a third connection request sent by the first port of the fog node through a second port at a second address of the active probe server, responding to the third connection request, and returning a third response packet to the fog node through the second port at the second address of the active probe server, and if port information in the third response packet is inconsistent with port information in the first response packet, determining that the fog node is a symmetric node; if the port information in the third response packet is consistent with the port information in the first response packet, receiving a fourth connection request which is sent by the first port of the first address of the active detection server and is provided with a conversion address and a conversion port attribute, responding to the fourth connection request, and returning a fourth response packet to the fog node through the second port of the first address of the active detection server, wherein if the fog node can receive the fourth response packet, the fog node is an address-limited node; and if the fog node cannot receive the fourth response packet, the fog node is an active symmetrical node capable of being used as the active connecting party.
In some embodiments of the present application, based on the foregoing solution, the obtaining module is configured to: receiving a fifth connection request sent by the second port of the fog node through the first port of the first address of the passive probe server, and responding to the fifth connection request and sending a fifth response packet back to the fog node through the first port of the first address of the passive probe server; if the fog node can receive the fifth response packet and the address information carried in the fifth response packet is not consistent with the fog node address, receiving a sixth connection request which is sent by a second port of the fog node and is provided with a conversion address and conversion port attributes through a first port of a first address of the passive detection server, responding to the sixth connection request, and returning a sixth response packet to the fog node through a second port of a second address of the passive detection server, and if the fog node can receive the sixth response packet, determining that the fog node is a full cone node; if the fog node cannot receive the sixth response packet, receiving a seventh connection request sent by the second port of the second address of the passive probe server through the second port of the second address of the passive probe server, responding to the seventh connection request, and returning a seventh response packet to the fog node through the second port of the second address of the passive probe server, and if the port information in the seventh response packet is inconsistent with the port information in the fifth response packet, determining that the fog node is a symmetric node; if the port information in the seventh response packet is consistent with the port information in the fifth response packet, receiving an eighth connection request which is sent by a second port of the fog node and is provided with a conversion address and a conversion port attribute through a first port of a first address of the passive detection server, responding to the eighth connection request, and returning an eighth response packet to the fog node through a second port of the first address of the passive detection server, wherein if the fog node can receive the eighth response packet, the fog node is an address-limited node; and if the fog node cannot receive the eighth response packet, the fog node is an active symmetrical node capable of being used as the passive connection party.
In some embodiments of the present application, based on the foregoing solution, the obtaining module is configured to: if the fog node cannot receive the first response packet, the active detection server sends the first response packet to the fog node for multiple times; if the fog node cannot receive the second response packet, the active detection server sends the second response packet to the fog node for multiple times; if the fog node cannot receive the third response packet, the active detection server sends the third response packet to the fog node for multiple times; if the fourth response packet cannot be received by the fog node.
In some embodiments of the present application, based on the foregoing, the determining module is configured to: if the network address conversion type of the other fog node is a full cone type, the two fog nodes can establish connection; if the network address conversion type of the other fog node is the address-limited type, the two fog nodes can establish connection; and if the network address conversion type of the other fog node is the port-limited type, the two fog nodes can establish connection.
In some embodiments of the present application, based on the foregoing solution, the connection module is configured to: if the network address conversion type of the other fog node is full cone, the fog node with the network address conversion type of active symmetry can be used as the active connecting party and the passive connecting party; if the network address conversion type of the other fog node is the address-limited type, the fog node with the network address conversion type of the active symmetric type is used as the passive connecting party; and if the network address conversion type of the other fog node is port-limited, the fog node with the network address conversion type of active symmetry is used as the active connecting party.
In some embodiments of the present application, based on the foregoing solution, the connection module is configured to: the port of the active symmetric node receiving the connection request does not receive the connection request sent by the other unconnected fog node, and records that the port receiving the connection request is not communicated with the other fog node in a link tracking rule; the active symmetrical node acquires a connection instruction generated by the signal server based on the auxiliary connection request sent by the other fog node; the active symmetric node connects with the other fog node through the other port except the port receiving the connection request based on the connection instruction.
According to an aspect of embodiments of the present application, there is provided a computer-readable program medium storing computer program instructions which, when executed by a computer, cause the computer to perform the method of any one of the above.
According to an aspect of an embodiment of the present application, there is provided an electronic apparatus including: a processor; a memory having computer readable instructions stored thereon which, when executed by the processor, implement the method of any of the above.
The technical scheme provided by the embodiment of the application can have the following beneficial effects:
in the technical solutions provided in some embodiments of the present application, by obtaining network address translation types of two fog nodes to be connected, where a network address translation type of one of the two fog nodes is an active symmetric type, determining whether the two fog nodes can establish a connection based on a network address translation type of the other of the two fog nodes, and if the two fog nodes can establish a connection, determining a fog node whose network address translation type is an active symmetric type based on a network address translation type of the other fog node as an active connecting party or a passive connecting party, where the active connecting party first sends a connection request to the passive connecting party to establish a connection between the two fog nodes, compared with a case where only a fog node located in an NAT gateway is allowed to actively initiate a connection to a fog node located outside the NAT gateway, a node that cannot actively initiate a connection to an NAT connection with a fog node located outside the NAT gateway can also establish a connection with the fog node located outside the NAT gateway, the number of the fog nodes for data transmission is increased, so that the data transmission efficiency of fog calculation is improved, wherein when the fog node with the network address conversion type of active symmetry is used as an active connecting party, the active symmetry type fog node is shown to be capable of communicating with a port for receiving a connection request in another fog node only through a port for sending the connection request; when the network address conversion type is the active symmetric fog node, the active symmetric fog node is used as a passive connecting party, the other port except for the port for receiving the connection request is used for communicating with the port for sending the connection request in the other fog node, the active symmetric fog node can be connected with the other fog node only after receiving the connection request sent by the other fog node, data transmission is carried out between the two connected fog nodes, the active symmetric fog node is different in performance when being used as the active connecting party and the passive connecting party, the possibility that the active symmetric fog node is connected with the other fog node can be improved, the number of the fog nodes for carrying out data transmission is further increased, and the data transmission efficiency of the fog calculation is further improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
Fig. 1A shows a schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of the present application can be applied.
Fig. 1B is a schematic diagram of a data sharing system to which the technical solution of one embodiment of the present application can be applied.
Fig. 2 schematically shows a flow chart of a data transmission method according to an embodiment of the application.
Fig. 3 schematically shows a schematic diagram of a process of probing a client type by an active probing server according to the present application.
Fig. 4 schematically shows a block diagram of a data transmission device according to an embodiment of the present application.
FIG. 5 is a hardware diagram illustrating an electronic device according to an example embodiment.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the subject matter of the present application can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the application.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
Cloud technology refers to a hosting technology for unifying serial resources such as hardware, software, network and the like in a wide area network or a local area network to realize calculation, storage, processing and sharing of data.
Cloud technology (Cloud technology) is based on a general term of network technology, information technology, integration technology, management platform technology, application technology and the like applied in a Cloud computing business model, can form a resource pool, is used as required, and is flexible and convenient. Cloud computing technology will become an important support. Background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture-like websites and more web portals. With the high development and application of the internet industry, each article may have its own identification mark and needs to be transmitted to a background system for logic processing, data in different levels are processed separately, and various industrial data need strong system background support and can only be realized through cloud computing.
Cloud computing (cloud computing) refers to a delivery and use mode of an IT infrastructure, and refers to obtaining required resources in an on-demand and easily-extensible manner through a network; the generalized cloud computing refers to a delivery and use mode of a service, and refers to obtaining a required service in an on-demand and easily-extensible manner through a network. Such services may be IT and software, internet related, or other services. Cloud Computing is a product of development and fusion of traditional computers and Network technologies, such as Grid Computing (Grid Computing), distributed Computing (distributed Computing), Parallel Computing (Parallel Computing), Utility Computing (Utility Computing), Network storage (Network storage technologies), Virtualization (Virtualization), Load balancing (Load Balance), and the like.
With the development of diversification of internet, real-time data stream and connecting equipment and the promotion of demands of search service, social network, mobile commerce, open collaboration and the like, cloud computing is rapidly developed. Different from the prior parallel distributed computing, the generation of cloud computing can promote the revolutionary change of the whole internet mode and the enterprise management mode in concept.
By 3 months in 2020, the domestic netizen scale is 9.04 hundred million, which is increased by 7508 ten thousand in 2019, the internet popularity reaches 64.5%, and is increased by 4.9% in 2019. More and more network devices require more network addresses and bandwidth.
The large demand for network addresses further exacerbates the exhaustion of the Internet Protocol version four (IPv 4) address pool. In 31/1/2011, IPv4 addresses managed by The Internet Assigned Numbers Authority (IANA) are all exhausted. 11/25/2019, the european network coordination center announces that the last IPv4 address space reserve pool is completely exhausted, and all 43 hundred million IPv4 addresses are allocated.
The basic solution to the problem of IPv4 address pool shortage is Internet Protocol version six (IPv 6). The development of IPv6 is always highly valued in China, and as long as 7 months in 2020, the number of IPv6 active users in China reaches 3.178 hundred million, and the percentage of IPv6 active users in China already exceeds 30%. Compared with the international leading country, the data has a small gap, meanwhile, the application supporting IPv6 access is less, the degree of supporting IPv6 is mostly limited to be reached only by IPv6 home pages, the deeper link does not support IPv6 access, streaming media, pictures and the like which really generate flow are still connected by IPv4, and the improvement strength and the depth support degree on IPv6 are far from insufficient. In addition, the bad situation that the home wireless router supports the IPv6 is also an important reason for influencing the scale deployment of the IPv6 at present.
The appearance of Network Address Translation (NAT) lets people almost forget the fact that the Address space of IPv4 will be exhausted, greatly alleviates the influence caused by insufficient IPv4 addresses, and brings a profound influence on an Internet Protocol (IP) Network model, the figure of the user is spread over each corner of the Network, and according to statistics, 70% of peer-to-peer (P2P) users are located within the NAT gateway, and if the proportion of users in the NAT gateway of users of a mobile communication Network is added, the number is far beyond the number. For a long time in the future, the NAT and IPv6 will together build a safe driving and protecting navigation for the internet.
Fog computing is used as an extended concept of cloud computing, and computing tasks such as transmission, computing and processing are carried by devices with low performance and large quantity in the network edge, such as routers, mobile phones and PCs, so that data transmission among network layers is effectively reduced, and computing load of a data center is also reduced.
NAT in combination with fog computing is a future development direction, but due to the existence of NAT gateways, the problem of connection between fog nodes located within NAT gateways is an inevitable problem.
Different from personal to personal (C2C) services such as Voice Over Internet Protocol (VOIP) based on IP, most of the services for the fog calculation do not need to ensure that the connection power between every two nodes is 100%, and only equipment which can be successfully connected in principle needs to be successfully connected as far as possible, and meanwhile, the relay server (TURN) causes the increase of the overall cost, and the value of the TURN to the fog calculation is relatively insignificant.
Transmission Control Protocol (TCP) has become increasingly unable to meet future large bandwidth requirements, and has prompted the study of a number of User Datagram Protocol (UDP) -based reliable Transmission protocols, such as fast UDP Internet Connection (QUIC) and fast reliable Transmission Protocol (KCP). The UDP-based NAT connection protocol is defined in the NAT session Traversal application (Simple Traversal of UDP Through NATs, STUN), but the influence of the firewall rule chain of the NAT itself on the connection is not considered in the documents of multiple files (RFC) scheduled by numbers.
At present, a few application researches mention that the mapping rule is prevented from being damaged by using a lifetime value (Time To Live, TTL) of domain name resolution, but the inventor researches find that the method cannot be guaranteed in the existing IPv4 network based on the objective fact that the routing rule on each router in the packet network is constantly changing.
RFC3489 specifies that NAT types can be classified as public networks (Open Internet), Firewall Symmetric (Symmetric UDP Firewall), UDP blocked (UDP Blcoked), Full Cone (Full Cone), Address-Restricted (Address-Restricted Cone), Port-Restricted (Port-Restricted Cone), and Symmetric (Symmetric). According to statistics of the inventor, the port-limited user equipment accounts for 60%, the symmetric user equipment accounts for 30%, the port-limited user equipment can be successfully connected with the port-limited fog node by 100% in theory, but the actual measurement result is the connection success rate which is less than 60%.
The inventor finds that a firewall rule chain, such as a firewall link tracking rule (ip _ conntrack), causes a port mapped by the NAT to change.
Specifically, connection is being attempted at two ends of a (source address a, source port a, post-mapping address X, port X) and B (address B, port B, post-mapping address Y, port Y), the NAT types of the a and B are set as port-restricted types, and the gateway firewall of the B opens the ip _ conntrack rule. When a first sends a connection request to a second, the NAT rule will cause the gateway of the second to deny forwarding requests while leaving unreachable records on the ip _ track table. The first will send an auxiliary connection request, forwarded to b via a Signal server (Signal server), which will cause b to actively send a connection request to a, at which point it will Signal a reply connection response to b if the connection has succeeded for a. At this point, the mapped port of B will change (y- > y1), and the NAT rule will cause the gateway of B to reject the forwarding request, leaving an unreachable record on the ip _ track table.
In summary, during the connection process, the NAT mapping port may be changed by the party performing the passive connection action, and the possibility of successful connection may be affected. Considering that the existing network has a large amount of port-limited users/devices, the invention improves the NAT detection mode and the STUN server deployment mode aiming at the firewall rule chain based on RFC3489, improves the connection success rate of the system through intelligent node scheduling, and effectively improves the service capability of the fog computing node.
The invention can be mainly applied to a fog computing P2P Content Distribution Network (PCDN) at present. The PCDN is widely applied, is applied to a plurality of Internet projects and products at present, and obviously improves the service capability of the whole system.
Fig. 1A shows a schematic diagram of an exemplary system architecture 100A to which the technical solutions of the embodiments of the present application may be applied.
As shown in fig. 1A, the system architecture 100A may include a fog node 101 (which may be one or more of a smartphone, tablet, laptop, desktop computer), a network 102, a dispatch server 103, and a signal server 104. The network 102 serves as a medium to provide communication links between the fog node 101, the dispatch server 103, and the signal server 104. Network 102 may include various connection types, such as wired communication links, wireless communication links, and so forth.
In an embodiment of the application, the scheduling server 103 obtains the network address translation types of two fog nodes 101 to establish a connection, where the network address translation type of one of the two fog nodes 101 is an active symmetric type, determines whether the two fog nodes 101 can establish the connection based on the network address translation type of the other of the two fog nodes 101, and if the two fog nodes 101 can establish the connection, determines that the fog node whose network address translation type is the active symmetric type based on the network address translation type of the other fog node as an active connecting party or a passive connecting party, and the active connecting party first sends a connection request to the passive connecting party to establish the connection between the two fog nodes 101, so that a fog node which cannot actively initiate the connection can also establish a connection with a fog node located outside the NAT gateway compared with a fog node which only allows the fog node located in the NAT gateway to actively initiate the connection with a fog node located outside the NAT gateway, the number of the fog nodes for data transmission is increased, so that the data transmission efficiency of fog calculation is improved, wherein when the fog node with the network address conversion type of active symmetry is used as an active connecting party, the active symmetry type fog node is shown to be capable of communicating with a port for receiving a connection request in another fog node only through a port for sending the connection request; when the network address conversion type is the active symmetric type, the active symmetric type fog node is used as a passive connecting party, the other port except for the port for receiving the connection request is used for communicating with the port for sending the connection request in the other fog node, the active symmetric type fog node can be connected with the other fog node only after receiving the connection request sent by the other fog node, data transmission is carried out between the two connected fog nodes 101, the active symmetric type fog node is different in performance when being used as the active connecting party and the passive connecting party, the possibility that the active symmetric type fog node is connected with the other fog node can be improved, the number of the fog nodes for carrying out data transmission is further increased, and the data transmission efficiency of the fog calculation is further improved.
Fig. 1B shows a schematic diagram of an exemplary system architecture 100B to which the technical solutions of the embodiments of the present application can be applied.
As shown in fig. 1B, the system architecture 100B may include a fog node 101, a network 102, a dispatch server 103, a signal server 104, an active probe server 105, and a passive probe server 106. The network 102 serves as a medium to provide communication links between the fog nodes 101, the dispatch server 103, the signal server 104, the active probe server 105, and the passive probe server 106.
In one embodiment of the present application, the active detection server 105 and the passive detection server 106 detect network address conversion types of two fog nodes 101 to establish a connection, the scheduling server 103 obtains the network address conversion types of the two fog nodes 101 detected by the active detection server 105 and the passive detection server 106, the network address conversion type of one of the two fog nodes 101 is an active symmetric type, it is determined whether the two fog nodes 101 can establish a connection based on the network address conversion type of the other of the two fog nodes 101, if the two fog nodes 101 can establish a connection, the fog node whose network address conversion type is an active symmetric type is determined based on the network address conversion type of the other fog node as an active connecting party or a passive connecting party, the active connecting party first sends a connection request to the passive connecting party to establish a connection between the two fog nodes 101, compared with the method that only a fog node in the NAT gateway is allowed to actively initiate connection to a fog node outside the NAT gateway, the method can enable the fog node which cannot actively initiate connection to be connected with the fog node outside the NAT gateway, and increases the number of the fog nodes for data transmission, so that the data transmission efficiency of fog calculation is improved; when the network address conversion type is the active symmetric type, the active symmetric type fog node is used as a passive connecting party, the other port except for the port for receiving the connection request is used for communicating with the port for sending the connection request in the other fog node, the active symmetric type fog node can be connected with the other fog node only after receiving the connection request sent by the other fog node, data transmission is carried out between the two connected fog nodes 101, the active symmetric type fog node is different in performance when being used as the active connecting party and the passive connecting party, the possibility that the active symmetric type fog node is connected with the other fog node can be improved, the number of the fog nodes for carrying out data transmission is further increased, and the data transmission efficiency of the fog calculation is further improved.
It should be understood that the numbers of the fog nodes 101, the network 102, the dispatch server 103, the signal server 104, the active probe server 105, and the passive probe server 106 in fig. 1A and 1B are merely illustrative. There may be any number of fog nodes 101, networks 102, dispatch servers 103, signal servers 104, active probe servers 105, and passive probe servers 106, as desired for an implementation. For example, the scheduling server 103, the signal server 104, the active detection server 105, and the passive detection server 106 may be independent physical servers, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDNs, and big data and artificial intelligence platforms.
It should be noted that the data transmission method provided in the embodiment of the present application is generally executed by the scheduling server 103, and accordingly, the data transmission apparatus is generally disposed in the scheduling server 103. However, in other embodiments of the present application, the fog node 101, the signal server 104, the active probe server 105, or the passive probe server 106 may also have similar functions as the dispatch server 103, so as to perform the data transmission method provided by the embodiments of the present application.
The implementation details of the technical solution of the embodiment of the present application are set forth in detail below:
fig. 2 schematically shows a flowchart of a data transmission method according to an embodiment of the present application, where an execution subject of the data transmission method may be a server, such as the scheduling server 103 shown in fig. 1A.
Referring to fig. 2, the data transmission method at least includes steps S210 to S240, which are described in detail as follows:
in step S210, the network address translation types of two fog nodes to be connected are obtained, and the network address translation type of one of the two fog nodes is an active symmetric type.
In an embodiment of the application, a network address translation type of a fog node detected by an active detection server (First-order NAT, FNAT) through a First port of the fog node may be obtained, and if the network address translation type detected by the active detection server is an active symmetric type, the fog node is an active symmetric type node capable of serving as an active connecting party.
In one embodiment of the present application, the process of the active probing server probing the network address translation type of the fog node through the first port of the fog node may include: receiving a first connection request sent by a first port of a first address of an active detection server through the first port of the first address of the active detection server, and responding to the first connection request and sending a first response packet back to the fog node through the first port of the first address of the active detection server; if the fog node can receive the first response packet and the address information carried in the first response packet is inconsistent with the fog node address, receiving a second connection request which is sent by a first port of the first address of the active detection server and is provided with a conversion address and conversion port attributes through the first port of the first address of the active detection server, responding to the second connection request, and returning a second response packet to the fog node through a second port of a second address of the active detection server; if the fog node cannot receive the second response packet, receiving a third connection request sent by the first port of the fog node through a second port at a second address of the active detection server, responding to the third connection request, and returning a third response packet to the fog node through the second port at the second address of the active detection server, and if port information in the third response packet is inconsistent with port information in the first response packet, determining that the fog node is a symmetric node; if the port information in the third response packet is consistent with the port information in the first response packet, receiving a fourth connection request which is sent by the first port of the first address of the active detection server and is provided with a conversion address and a conversion port attribute through the first port of the first address of the active detection server, responding to the fourth connection request, and returning a fourth response packet to the fog node through the second port of the first address of the active detection server, wherein if the fog node can receive the fourth response packet, the fog node is an address-limited node; if the fog node cannot receive the fourth response packet, the fog node is an active symmetric node capable of being an active connecting party.
In an embodiment of the application, if the fog node cannot receive the first response packet, the active detection server sends the first response packet to the fog node for multiple times or the fog node receives the first response packet for multiple times; if the fog node can not receive the second response packet, the active detection server sends the second response packet to the fog node for multiple times or the fog node receives the second response packet for multiple times; if the fog node can not receive the third response packet, the active detection server sends the third response packet to the fog node for multiple times or the fog node receives the third response packet for multiple times; and if the fog node cannot receive the fourth response packet, the active detection server sends the fourth response packet to the fog node for multiple times or the fog node receives the fourth response packet for multiple times so as to eliminate packet loss interference.
In one embodiment of the present application, the first response packet, the second response packet, the third response packet, and the fourth response packet may be transmitted multiple times within a set time period.
In one embodiment of the present application, the first response packet, the second response packet, the third response packet, and the fourth response packet may be transmitted a set number of times.
In one embodiment of the present application, a process of receiving a first connection request sent by a first port of a fog node through a first port of a first address of an active probe server and sending a first response packet back to the fog node through the first port of the first address of the active probe server in response to the first connection request may be denoted as a first type Test (Test 1).
In one embodiment of the present application, a process of receiving a second connection request with a translation address and translation port attributes set by the first port of the first address of the active probe server through the first port of the first address of the active probe server, and sending a second response packet back to the fog node through the second port of the second address of the active probe server in response to the second connection request may be referred to as a second type Test (Test 2).
In one embodiment of the present application, a process of receiving a third connection request sent by the first port of the foggy node through the second port of the second address of the active probing server and sending a third response packet back to the foggy node through the second port of the second address of the active probing server in response to the third connection request may be referred to as a second type of the first type Test (Test 1# 2).
In one embodiment of the present application, a process of receiving a fourth connection request with a translation address and translation port attributes set by the first port of the first address of the active probe server, sent by the first port of the fog node, and sending a fourth response packet back to the fog node through the second port of the first address of the active probe server in response to the fourth connection request may be denoted as a third type Test (Test 3).
In an embodiment of the present application, reference may be made to fig. 3 for a process in which the active probing server probes a network address translation type of the fog node through the first port of the fog node, where the fog node in fig. 3 is a client, and fig. 3 schematically illustrates a schematic diagram of a process in which the active probing server probes a client type according to the present application, and as shown in fig. 3, after performing Test1, if the client cannot receive a response, the client is UDP disabled; if the client can receive the response, judging whether the address in the response packet is consistent with the address scanned by the client, if so, performing Test2, and if so, determining that the client is a public network; if the client can not receive the response, the client type is a firewall symmetric type, if the address in the response packet is not consistent with the address scanned by the client, Test2 is carried out, and if the client can receive the response, the client type is a full cone type; if the client cannot receive the response, performing Test1#2, judging whether the address carried in the response packet is consistent with the address in the Test1, and if the address carried in the response packet is not consistent with the address in the Test1, the client is of a symmetrical type; if the address carried in the response packet is consistent with the address in Test1, performing Test3, and if the client cannot receive the response, the client is in an active symmetric type; if the client is able to receive the response, the client is address-limited.
In an embodiment of the present application, when a client is used as a Fog node, a toolkit (SDK) needs to be embedded in the client, and when a server is used as a Fog node, a Fog Computing service node (FCE) needs to be deployed in the server.
In an embodiment of the application, a network address translation type of a fog node detected by a passive detection server (Second-order NAT, SNAT) through a Second port corresponding to a first port in the fog node may be obtained, and if the network address translation type detected by the passive detection server is an active symmetric type, the fog node is an active symmetric type node capable of serving as a passive connection party.
In an embodiment of the present application, the process of the passive probe server probing the network address translation type of the fog node through the second port corresponding to the first port in the fog node may include: receiving a fifth connection request sent by a second port of the fog node through a first port of a first address of the passive detection server, and responding to the fifth connection request and returning a fifth response packet to the fog node through the first port of the first address of the passive detection server; if the fog node can receive the fifth response packet and the address information carried in the fifth response packet is not consistent with the fog node address, receiving a sixth connection request which is sent by a second port of the fog node and is provided with a conversion address and conversion port attributes through a first port of a first address of the passive detection server, responding to the sixth connection request, and returning a sixth response packet to the fog node through the second port of the second address of the passive detection server, and if the fog node can receive the sixth response packet, determining that the fog node is a full cone type node; if the fog node cannot receive the sixth response packet, receiving a seventh connection request sent by the second port of the fog node through the second port of the second address of the passive detection server, responding to the seventh connection request, and returning a seventh response packet to the fog node through the second port of the second address of the passive detection server, wherein if the port information in the seventh response packet is inconsistent with the port information in the fifth response packet, the fog node is determined to be a symmetric node; if the port information in the seventh response packet is consistent with the port information in the fifth response packet, receiving an eighth connection request which is sent by the second port of the fog node and is provided with a conversion address and a conversion port attribute through the first port of the first address of the passive detection server, responding to the eighth connection request, and returning an eighth response packet to the fog node through the second port of the first address of the passive detection server, wherein if the fog node can receive the eighth response packet, the fog node is an address-limited node; if the fog node cannot receive the eighth response packet, the fog node is an active symmetric node capable of being a passive connection party.
In an embodiment of the application, if the fog node cannot receive the fifth response packet, the active detection server sends the fifth response packet to the fog node multiple times or the fog node receives the fifth response packet multiple times; if the fog node can not receive the sixth response packet, the active detection server sends the sixth response packet to the fog node for multiple times or the fog node receives the sixth response packet for multiple times; if the fog node can not receive the seventh response packet, the active detection server sends the seventh response packet to the fog node for multiple times or the fog node receives the seventh response packet for multiple times; and if the fog node cannot receive the eighth response packet, the active detection server sends the eighth response packet to the fog node for multiple times or the fog node receives the eighth response packet for multiple times so as to eliminate packet loss interference.
In an embodiment of the present application, the fifth response packet, the sixth response packet, the seventh response packet, and the eighth response packet may be transmitted multiple times within a set time period.
In one embodiment of the present application, the fifth response packet, the sixth response packet, the seventh response packet, and the eighth response packet may be transmitted a set number of times.
In one embodiment of the present application, a process of receiving a fifth connection request sent by the second port of the fog node through the first port of the first address of the passive probe server, and sending a fifth response packet back to the fog node through the first port of the first address of the passive probe server in response to the fifth connection request may be denoted as a fourth Test (Test 4).
In one embodiment of the present application, the process of receiving the fifth connection request sent by the second port of the fog node through the first port of the first address of the passive probe server, and sending back the fifth response packet to the fog node through the first port of the first address of the passive probe server in response to the fifth connection request may be regarded as Test1 for the second port of the fog node.
In one embodiment of the present application, a process of receiving, through the first port of the first address of the passive probe server, the sixth connection request sent by the second port of the fog node, where the translation address and the translation port attribute are set, and returning, in response to the sixth connection request, the sixth response packet to the fog node through the second port of the second address of the passive probe server may be denoted as a fifth Test (Test 5).
In one embodiment of the present application, the process of receiving the sixth connection request with the translation address and the translation port attribute set, sent by the second port of the fog node, through the first port of the first address of the passive probe server, and sending back the sixth response packet to the fog node through the second port of the second address of the passive probe server in response to the sixth connection request may be regarded as Test2 performed on the second port of the fog node.
In an embodiment of the present application, a process of receiving a seventh connection request sent by the second port of the fog node through the second port of the second address of the passive probe server and sending a seventh response packet back to the fog node through the second port of the second address of the passive probe server in response to the seventh connection request may be denoted as a second type of a fourth Test (Test 4# 2), and the probe behavior is regarded as a connection process between the client and the passive probe server to be probed, so as to simulate a party actively initiating the connection behavior, thereby providing information support for subsequent scheduling.
In one embodiment of the present application, the process of receiving the seventh connection request sent by the second port of the fog node through the second port of the second address of the passive probe server and sending back the seventh response packet to the fog node through the second port of the second address of the passive probe server in response to the seventh connection request may be denoted as Test1#2 performed on the second port of the fog node.
In one embodiment of the present application, a process of receiving an eighth connection request with a translation address and translation port attributes set, sent by the second port of the fog node through the first port of the first address of the passive probe server, and sending an eighth response packet back to the fog node through the second port of the first address of the passive probe server in response to the eighth connection request may be denoted as a sixth Test (Test 6).
In one embodiment of the present application, the process of receiving, through the first port of the first address of the passive probe server, the eighth connection request with the translation address and the translation port attribute set, sent by the second port of the fog node, and sending back the eighth response packet to the fog node through the second port of the first address of the passive probe server in response to the eighth connection request may be regarded as Test3 performed on the second port of the fog node.
In an embodiment of the present application, a process of the passive probing server probing the network address translation type of the client through the second port of the client may be as shown in fig. 3, including: after Test1, if the client cannot receive the response, the type of the client is UDP disable; if the client can receive the response, judging whether the address in the response packet is consistent with the address scanned by the client, if so, performing Test2, and if so, determining that the client is a public network; if the client can not receive the response, the client type is a firewall symmetric type, if the address in the response packet is not consistent with the address scanned by the client, Test2 is carried out, and if the client can receive the response, the client type is a full cone type; if the client cannot receive the response, performing Test1#2, judging whether the address carried in the response packet is consistent with the address in the Test1, and if the address carried in the response packet is not consistent with the address in the Test1, the client is of a symmetrical type; if the address carried in the response packet is consistent with the address in Test1, performing Test3, and if the client can receive the response, the client is in an active symmetric type; if the client cannot receive the response, the client is address-limited.
In an embodiment of the present application, there are a plurality of first ports, a plurality of second ports corresponding to the first ports, a plurality of port pairs are formed by one-to-one correspondence between the plurality of first ports and the plurality of second ports, the plurality of port pairs are stored in the active probe server and the passive probe server, and the active probe server and the passive probe server can perform multiple probing to improve the success rate of probing when a certain first port of the plurality of first ports or a certain second port of the plurality of second ports is prohibited from communicating.
In this embodiment, the inventor finds, through a plurality of experiments, that, in consideration of operation, security, and other factors, both the operator network and the intranet entry router prohibit a batch of UDP ports from communicating to some extent, and in business practice, the inventor also really finds that standard STUN (Session transport utility for NAT) ports UDP:3478, UDP: 3479 communication is prohibited, so in this application, the active probe server and the passive probe server are both bound to a set of port pairs, and when a single client finds that the network is not connected, it will retry for many times.
In one embodiment of the present application, both the active probe server and the passive probe server require a stand-alone dual IPv4 address.
In an embodiment of the application, after the fog node sends the detection instruction to the active detection server and the passive detection server, the active detection server and the passive detection server detect the network address conversion type of the fog node, and then send the detection result to the fog node, and the scheduling server obtains the network address conversion type of the fog node from the fog node.
In one embodiment of the present application, it may be a type in which a signal server (SINGAL server) acquires network address translations of two fog nodes.
With continued reference to fig. 2, in step S220, it is determined whether the two fog nodes are capable of establishing a connection based on the network address translation type of the other of the two fog nodes.
In one embodiment of the present application, if the network address translation type of another fog node is a full cone type, then the two fog nodes can establish a connection; if the network address conversion type of the other fog node is the address-limited type, the two fog nodes can establish connection; if the network address conversion type of the other fog node is the port-limited type, the two fog nodes can establish connection.
In step S230, if the two fog nodes can establish a connection, determining a fog node with an active symmetric network address conversion type as an active connecting party or a passive connecting party based on the network address conversion type of the other fog node, where the active connecting party first sends a connection request to the passive connecting party to establish a connection between the two fog nodes, and when the fog node with the active symmetric network address conversion type is the active connecting party, the active symmetric fog node appears to communicate with a port of the other fog node that receives the connection request only through a port that sends the connection request; when the mist node with the network address conversion type of the active symmetry type is used as a passive connecting party, the mist node of the active symmetry type is shown to use another port except the port for receiving the connection request to communicate with the port for sending the connection request in another mist node, and the mist node of the active symmetry type can establish connection with another mist node only after receiving the connection request sent by another mist node.
In an embodiment of the application, the signal server may assist the two fog nodes to establish a connection, and when the passive connecting party cannot receive the connection request sent by the active connecting party, the signal server may receive the auxiliary connection request sent by the active connecting party to generate a connection instruction, and the signal server may send the connection instruction to the passive connecting party, so that the passive connecting party actively sends the instruction to the active connecting party.
In one embodiment of the application, a port of the active symmetric node receiving a connection request does not receive a connection request sent by another unconnected fog node, and records that the port receiving the connection request is not communicated with the other fog node in a link tracking rule; the active symmetrical node acquires a connection instruction generated by the signal server based on an auxiliary connection request sent by another fog node; the active symmetrical node is connected with another fog node through another port except the port for receiving the connection request based on the connection instruction, so that when the fog node with the network address conversion type of active symmetrical type is used as a passive connecting party, the active symmetrical fog node is shown to communicate with the port for sending the connection request in another fog node by using another port except the port for receiving the connection request.
In one embodiment of the present application, the signaling server may also be used for NAT mapping keep-alive.
In an embodiment of the present application, if the network address translation type of another fog node is a full cone type, the fog node whose network address translation type is an active symmetric type may serve as both an active connection party and a passive connection party; if the network address conversion type of the other fog node is the address-limited type, the fog node with the network address conversion type of the active symmetric type is used as a passive connecting party; and if the network address conversion type of the other fog node is the port-limited type, the fog node with the network address conversion type of the active symmetrical type is used as an active connecting party.
In step S240, data transmission is performed between the two connected fog nodes.
In one embodiment of the present application, it may be that the scheduling server handles a data transmission process between two connected fog nodes, and the scheduling server is used for coordinating resource allocation. Unlike conventional P2P, the fog calculation is actively initiated by the user for resource requests and then responded to. The scheduling service needs to ensure the possibility of connection between nodes as much as possible, and the application focuses on handling NAT matching relationship and connection order assignment besides the factors of operators, regions, loads and the like. Because of the introduction of the active symmetric type, different from the conventional NAT matching rule, the communication possibility between the port-restricted device and the active symmetric device is detailed in table 1.
Table 1 refinement of communication possibilities between port-restricted devices and active symmetric devices
| Possibility of&Measures taken | Port-limited type fog computing service node | Active symmetric fog calculation service node |
| Port-restricted user | Is consistent with the original matching rule and can be connected | Connectable, requiring active initiation by fog computing nodes |
| Active symmetric user | Connectable, requiring active user initiation | Is not connectable |
In summary, the scheduling service needs to collect two NAT types of the fog computing service node, and allocate nodes meeting the matching rules as much as possible by combining the reachable relationships in table 1, and meanwhile, the scheduling service needs to assign a party with active connection.
In the embodiment shown in fig. 2, by obtaining the network address translation types of two fog nodes to establish a connection, the network address translation type of one of the two fog nodes is an active symmetric type, determining whether the two fog nodes can establish a connection based on the network address translation type of the other of the two fog nodes, and if the two fog nodes can establish a connection, determining the fog node whose network address translation type is the active symmetric type based on the network address translation type of the other fog node as an active connecting party or a passive connecting party, the active connecting party first sends a connection request to the passive connecting party to establish a connection between the two fog nodes, compared with the case that only the fog node located in the NAT gateway is allowed to actively initiate a connection to the fog node located outside the NAT gateway, the fog node which cannot actively initiate a connection can also establish a connection with the fog node located outside the NAT gateway, the number of the fog nodes for data transmission is increased, so that the data transmission efficiency of fog calculation is improved, wherein when the fog node with the network address conversion type of active symmetry is used as an active connecting party, the active symmetry type fog node is shown to be capable of communicating with a port for receiving a connection request in another fog node only through a port for sending the connection request; when the network address conversion type is the active symmetric fog node, the active symmetric fog node is used as a passive connecting party, the other port except for the port for receiving the connection request is used for communicating with the port for sending the connection request in the other fog node, the active symmetric fog node can be connected with the other fog node only after receiving the connection request sent by the other fog node, data transmission is carried out between the two connected fog nodes, the active symmetric fog node is different in performance when being used as the active connecting party and the passive connecting party, the possibility that the active symmetric fog node is connected with the other fog node can be improved, the number of the fog nodes for carrying out data transmission is further increased, and the data transmission efficiency of the fog calculation is further improved.
Aiming at the complex current network condition, the method improves the deployment mode of the NAT detection module, and relieves the influence caused by the forbidding of UDP ports to a certain extent by binding a plurality of port pairs; meanwhile, the client side actively retries to overcome the interference caused by packet loss to a certain extent; aiming at a firewall rule chain, two NAT types of an active symmetric type which can be used as an active connecting party and an active symmetric type which can be used as a passive connecting party are detected, the connection possibility is improved through the thinned NAT matching rule and the connection sequence assignment, and the service capability of the fog node is effectively improved.
Aiming at NAT detection and fog node scheduling, the overall connection success rate is still improved by combining other modes, for example, non-full-cone type NAT nodes are converted into full-cone type NAT nodes by using isolation zones (DMZ), Universal Plug and Play (UPnP) and other modes, the connection success rate of symmetrical fog service nodes is improved by using port prediction and other modes, the connection power of port-limited users is improved by 10% -15%, and the data sharing rate is improved by 5%.
The following describes embodiments of an apparatus of the present application, which may be used to perform the data transmission method in the above embodiments of the present application. For details that are not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the data transmission method described above in the present application.
Fig. 4 schematically shows a block diagram of a data transmission device according to an embodiment of the present application.
Referring to fig. 4, a data transmission apparatus 400 according to an embodiment of the present application includes: an obtaining module 401, a determining module 402, a connecting module 403 and a transmitting module 404.
In some embodiments of the present application, based on the foregoing scheme, the obtaining module 401 is configured to obtain network address conversion types of two fog nodes to be connected, where a network address conversion type of one of the two fog nodes is an active symmetric type; the determining module 402 is configured to determine whether the two fog nodes are capable of establishing a connection based on a network address translation type of the other of the two fog nodes; the connection module 403 is configured to determine, based on a network address conversion type of another fog node, a fog node whose network address conversion type is an active symmetric type to serve as an active connecting party or a passive connecting party if the two fog nodes can establish a connection, where the active connecting party first sends a connection request to the passive connecting party to establish a connection between the two fog nodes, where, when the fog node whose network address conversion type is the active symmetric type serves as the active connecting party, the connection module appears to be able to communicate with a port in another fog node that receives the connection request only through a port that sends the connection request; when the mist node with the network address conversion type of the active symmetry type is used as a passive connecting party, the other port except the port for receiving the connection request is used for communicating with the port for sending the connection request in the other mist node, and the active symmetry type mist node can be connected with the other mist node only after receiving the connection request sent by the other mist node; the transmission module 404 is configured to transmit data between the two connected fog nodes.
In some embodiments of the present application, based on the foregoing solution, the obtaining module 401 is configured to: acquiring a network address conversion type of a fog node detected by an active detection server through a first port of the fog node, wherein if the network address conversion type detected by the active detection server is an active symmetric type, the fog node is an active symmetric type node capable of being used as an active connecting party; and acquiring a network address conversion type of the fog node detected by the passive detection server through a second port corresponding to the first port in the fog node, wherein if the network address conversion type detected by the passive detection server is an active symmetric type, the fog node is an active symmetric type node capable of being used as a passive connecting party.
In some embodiments of the present application, based on the foregoing solution, the obtaining module 401 is configured to: the first ports are multiple, the second ports corresponding to the first ports are multiple, and the multiple first ports and the multiple second ports are in one-to-one correspondence to form multiple port pairs; a plurality of port pairs are stored to an active probe server and a passive probe server.
In some embodiments of the present application, based on the foregoing solution, the obtaining module 401 is configured to: receiving a first connection request sent by a first port of a first address of an active detection server through the first port of the first address of the active detection server, and responding to the first connection request and sending a first response packet back to the fog node through the first port of the first address of the active detection server; if the fog node can receive the first response packet and the address information carried in the first response packet is inconsistent with the fog node address, receiving a second connection request which is sent by a first port of the first address of the active detection server and is provided with a conversion address and conversion port attributes through the first port of the first address of the active detection server, responding to the second connection request, and returning a second response packet to the fog node through a second port of a second address of the active detection server; if the fog node cannot receive the second response packet, receiving a third connection request sent by the first port of the fog node through a second port at a second address of the active detection server, responding to the third connection request, and returning a third response packet to the fog node through the second port at the second address of the active detection server, and if port information in the third response packet is inconsistent with port information in the first response packet, determining that the fog node is a symmetric node; if the port information in the third response packet is consistent with the port information in the first response packet, receiving a fourth connection request which is sent by the first port of the first address of the active detection server and is provided with a conversion address and a conversion port attribute through the first port of the first address of the active detection server, responding to the fourth connection request, and returning a fourth response packet to the fog node through the second port of the first address of the active detection server, wherein if the fog node can receive the fourth response packet, the fog node is an address-limited node; if the fog node cannot receive the fourth response packet, the fog node is an active symmetric node capable of being an active connecting party.
In some embodiments of the present application, based on the foregoing solution, the obtaining module 401 is configured to: receiving a fifth connection request sent by a second port of the fog node through a first port of a first address of the passive detection server, and responding to the fifth connection request and returning a fifth response packet to the fog node through the first port of the first address of the passive detection server; if the fog node can receive the fifth response packet and the address information carried in the fifth response packet is not consistent with the fog node address, receiving a sixth connection request which is sent by a second port of the fog node and is provided with a conversion address and conversion port attributes through a first port of a first address of the passive detection server, responding to the sixth connection request, and returning a sixth response packet to the fog node through the second port of the second address of the passive detection server, and if the fog node can receive the sixth response packet, determining that the fog node is a full cone type node; if the fog node cannot receive the sixth response packet, receiving a seventh connection request sent by the second port of the fog node through the second port of the second address of the passive detection server, responding to the seventh connection request, and returning a seventh response packet to the fog node through the second port of the second address of the passive detection server, wherein if the port information in the seventh response packet is inconsistent with the port information in the fifth response packet, the fog node is determined to be a symmetric node; if the port information in the seventh response packet is consistent with the port information in the fifth response packet, receiving an eighth connection request which is sent by the second port of the fog node and is provided with a conversion address and a conversion port attribute through the first port of the first address of the passive detection server, responding to the eighth connection request, and returning an eighth response packet to the fog node through the second port of the first address of the passive detection server, wherein if the fog node can receive the eighth response packet, the fog node is an address-limited node; if the fog node cannot receive the eighth response packet, the fog node is an active symmetric node capable of being a passive connection party.
In some embodiments of the present application, based on the foregoing solution, the obtaining module 401 is configured to: if the fog node can not receive the first response packet, the active detection server sends the first response packet to the fog node for multiple times; if the fog node can not receive the second response packet, the active detection server sends the second response packet to the fog node for multiple times; if the fog node can not receive the third response packet, the active detection server sends the third response packet to the fog node for multiple times; if the fog node can not receive the fourth response packet, the active detection server sends the fourth response packet to the fog node for multiple times; if the fog node cannot receive the fifth response packet, the active detection server sends the fifth response packet to the fog node for multiple times; if the fog node cannot receive the sixth response packet, the active detection server sends the sixth response packet to the fog node for multiple times; if the fog node cannot receive the seventh response packet, the active detection server sends the seventh response packet to the fog node for multiple times; and if the fog node cannot receive the eighth response packet, the active detection server sends the eighth response packet to the fog node for multiple times.
In some embodiments of the present application, based on the foregoing scheme, the determining module 402 is configured to: if the network address conversion type of the other fog node is a full cone type, the two fog nodes can establish connection; if the network address conversion type of the other fog node is the address-limited type, the two fog nodes can establish connection; if the network address conversion type of the other fog node is the port-limited type, the two fog nodes can establish connection.
In some embodiments of the present application, based on the foregoing solution, the connection module 403 is configured to: if the network address conversion type of the other fog node is full cone type, the fog node with the network address conversion type of active symmetry type can be used as an active connecting party and a passive connecting party; if the network address conversion type of the other fog node is the address-limited type, the fog node with the network address conversion type of the active symmetric type is used as a passive connecting party; and if the network address conversion type of the other fog node is the port-limited type, the fog node with the network address conversion type of the active symmetrical type is used as an active connecting party.
In some embodiments of the present application, based on the foregoing solution, the connection module 403 is configured to: a port which receives a connection request in the active symmetrical node does not receive a connection request sent by another unconnected fog node, and records that the port which receives the connection request is not communicated with the other fog node in a link tracking rule; the active symmetrical node acquires a connection instruction generated by the signal server based on an auxiliary connection request sent by another fog node; the active symmetric node is connected with another fog node through another port other than the port receiving the connection request based on the connection instruction.
As will be appreciated by one skilled in the art, aspects of the present application may be embodied as a system, method or program product. Accordingly, various aspects of the present application may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 50 according to this embodiment of the present application is described below with reference to fig. 5. The electronic device 50 shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 5, electronic device 50 is embodied in the form of a general purpose computing device. The components of the electronic device 50 may include, but are not limited to: the at least one processing unit 51, the at least one memory unit 52, a bus 53 connecting different system components (including the memory unit 52 and the processing unit 51), and a display unit 54.
Wherein the storage unit stores program code executable by the processing unit 51 to cause the processing unit 51 to perform the steps according to various exemplary embodiments of the present application described in the section "example methods" above in this specification.
The storage unit 52 may include readable media in the form of volatile storage units, such as a random access memory unit (RAM) 521 and/or a cache memory unit 522, and may further include a read only memory unit (ROM) 523.
The storage unit 52 may also include a program/utility 524 having a set (at least one) of program modules 525, such program modules 525 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 53 may be one or more of any of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 50 may also communicate with one or more external devices (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 50, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 50 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 55. Also, the electronic device 50 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 56. As shown, the network adapter 56 communicates with other modules of the electronic device 50 over the bus 53. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 50, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to make a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) execute the method according to the embodiments of the present application.
There is also provided, in accordance with an embodiment of the present application, a computer program product or computer program including computer instructions stored in a computer-readable storage medium. The computer instructions are read by a processor of a computer device from a computer-readable storage medium, and the computer instructions are executed by the processor to cause the computer device to perform the steps according to various exemplary embodiments of the present application described in the above section "exemplary method" of this specification.
According to an embodiment of the present application, a program product for implementing the above method according to an embodiment of the present application may employ a portable compact disc read only memory (CD-ROM) and include program codes, and may be run on a terminal device, such as a personal computer. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the present application, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.
Claims (10)
1. A method of data transmission, comprising:
acquiring network address conversion types of two fog nodes to be connected, wherein the network address conversion type of one of the two fog nodes is an active symmetric type;
determining whether the two fog nodes can establish a connection based on a network address translation type of the other of the two fog nodes;
if the two fog nodes can establish connection, determining the fog node with the network address conversion type being an active symmetric type as an active connecting party or a passive connecting party based on the network address conversion type of the other fog node, wherein the active connecting party firstly sends a connection request to the passive connecting party to establish connection between the two fog nodes,
when the network address conversion type is the active symmetric fog node, the active symmetric fog node is shown to be capable of communicating with a port which receives the connection request in another fog node only through a port which sends the connection request;
when the mist node with the network address conversion type of active symmetry type is used as the passive connecting party, the mist node of active symmetry type is shown to use another port except the port for receiving the connection request to communicate with the port for sending the connection request in the other mist node, and the mist node of active symmetry type can establish connection with the other mist node only after receiving the connection request sent by the other mist node;
and carrying out data transmission between the two connected fog nodes.
2. The data transmission method according to claim 1, wherein the obtaining of the network address translation types of the two fog nodes to establish the connection comprises:
acquiring a network address conversion type of the fog node, which is detected by an active detection server through a first port of the fog node, wherein if the network address conversion type detected by the active detection server is an active symmetric type, the fog node is an active symmetric type node capable of being used as an active connecting party;
and acquiring a network address conversion type of the fog node detected by a passive detection server through a second port corresponding to the first port in the fog node, wherein if the network address conversion type detected by the passive detection server is an active symmetric type, the fog node is an active symmetric type node capable of being used as the passive connecting party.
3. The data transmission method according to claim 2,
the number of the first ports is multiple, the number of the second ports corresponding to the first ports is multiple, and the first ports and the second ports are in one-to-one correspondence to form a plurality of port pairs;
storing the plurality of port pairs to the active probe server and the passive probe server.
4. The data transmission method according to claim 2, wherein the active probing server probes the type of network address translation of the fog node through the first port of the fog node, including:
receiving a first connection request sent by the first port of the first address of the active detection server through the first port of the first address of the active detection server, and responding to the first connection request and sending a first response packet back to the fog node through the first port of the first address of the active detection server;
if the fog node can receive the first response packet and the address information carried in the first response packet is not consistent with the fog node address, receiving a second connection request which is sent by the first port of the first address of the active detection server and is provided with a conversion address and conversion port attributes, responding to the second connection request, and returning a second response packet to the fog node through a second port of the second address of the active detection server, and if the fog node can receive the second response packet, determining that the fog node is a full cone node;
if the fog node cannot receive the second response packet, receiving a third connection request sent by the first port of the fog node through a second port at a second address of the active probe server, responding to the third connection request, and returning a third response packet to the fog node through the second port at the second address of the active probe server, and if port information in the third response packet is inconsistent with port information in the first response packet, determining that the fog node is a symmetric node;
if the port information in the third response packet is consistent with the port information in the first response packet, receiving a fourth connection request which is sent by the first port of the first address of the active detection server and is provided with a conversion address and a conversion port attribute, responding to the fourth connection request, and returning a fourth response packet to the fog node through the second port of the first address of the active detection server, wherein if the fog node can receive the fourth response packet, the fog node is an address-limited node;
and if the fog node cannot receive the fourth response packet, the fog node is an active symmetrical node capable of being used as the active connecting party.
5. The data transmission method according to claim 2, wherein the passive detection server detects the network address translation type of the fog node through a second port corresponding to the first port in the fog node, and includes:
receiving a fifth connection request sent by the second port of the fog node through the first port of the first address of the passive probe server, and responding to the fifth connection request and sending a fifth response packet back to the fog node through the first port of the first address of the passive probe server;
if the fog node can receive the fifth response packet and the address information carried in the fifth response packet is not consistent with the fog node address, receiving a sixth connection request which is sent by a second port of the fog node and is provided with a conversion address and conversion port attributes through a first port of a first address of the passive detection server, responding to the sixth connection request, and returning a sixth response packet to the fog node through a second port of a second address of the passive detection server, and if the fog node can receive the sixth response packet, determining that the fog node is a full cone node;
if the fog node cannot receive the sixth response packet, receiving a seventh connection request sent by the second port of the second address of the passive probe server through the second port of the second address of the passive probe server, responding to the seventh connection request, and returning a seventh response packet to the fog node through the second port of the second address of the passive probe server, and if the port information in the seventh response packet is inconsistent with the port information in the fifth response packet, determining that the fog node is a symmetric node;
if the port information in the seventh response packet is consistent with the port information in the fifth response packet, receiving an eighth connection request which is sent by a second port of the fog node and is provided with a conversion address and a conversion port attribute through a first port of a first address of the passive detection server, responding to the eighth connection request, and returning an eighth response packet to the fog node through a second port of the first address of the passive detection server, wherein if the fog node can receive the eighth response packet, the fog node is an address-limited node;
and if the fog node cannot receive the eighth response packet, the fog node is an active symmetrical node capable of being used as the passive connection party.
6. The data transmission method according to claim 4,
if the fog node cannot receive the first response packet, the active detection server sends the first response packet to the fog node for multiple times;
if the fog node cannot receive the second response packet, the active detection server sends the second response packet to the fog node for multiple times;
if the fog node cannot receive the third response packet, the active detection server sends the third response packet to the fog node for multiple times;
and if the fog node cannot receive the fourth response packet, the active detection server sends the fourth response packet to the fog node for multiple times.
7. The data transmission method according to claim 1, wherein the determining whether the two fog nodes can establish the connection based on the network address conversion type of the other of the two fog nodes comprises:
if the network address conversion type of the other fog node is a full cone type, the two fog nodes can establish connection;
if the network address conversion type of the other fog node is the address-limited type, the two fog nodes can establish connection;
and if the network address conversion type of the other fog node is the port-limited type, the two fog nodes can establish connection.
8. The data transmission method according to claim 7, wherein the determining, as an active connecting party or a passive connecting party, the fog node whose network address conversion type is an active symmetric type based on the network address conversion type of the other fog node comprises:
if the network address conversion type of the other fog node is full cone, the fog node with the network address conversion type of active symmetry can be used as the active connecting party and the passive connecting party;
if the network address conversion type of the other fog node is the address-limited type, the fog node with the network address conversion type of the active symmetric type is used as the passive connecting party;
and if the network address conversion type of the other fog node is port-limited, the fog node with the network address conversion type of active symmetry is used as the active connecting party.
9. The data transmission method according to claim 1, wherein when the foggy node whose network address conversion type is active symmetry type is used as the passive connecting party, it appears that another port other than the port receiving the connection request is used for communication with the port sending the connection request in the other foggy node, and the active symmetry type foggy node can establish connection with the other foggy node only after receiving the connection request sent by the other foggy node, and the method includes:
the port receiving the connection request in the active symmetric type fog node does not receive the connection request sent by the other unconnected fog node, and records that the port receiving the connection request is not communicated with the other fog node in a link tracking rule;
the active symmetrical type fog node acquires a connection instruction generated by the signal server based on the auxiliary connection request sent by the other fog node;
the active symmetrical type fog node connects with the other fog node through the other port except the port receiving the connection request based on the connection instruction.
10. A data transmission apparatus, comprising:
the system comprises an acquisition module, a processing module and a control module, wherein the acquisition module is configured to acquire network address conversion types of two fog nodes to be connected, and the network address conversion type of one of the two fog nodes is an active symmetric type;
a determining module configured to determine whether the two fog nodes are capable of establishing a connection based on a network address translation type of the other of the two fog nodes;
a connection module, configured to determine, based on a network address conversion type of another fog node, a fog node whose network address conversion type is an active symmetric type to serve as an active connecting party or a passive connecting party if the two fog nodes can establish a connection, where the active connecting party first sends a connection request to the passive connecting party to establish a connection between the two fog nodes, where, when the fog node whose network address conversion type is the active symmetric type serves as the active connecting party, the connection module appears to be able to communicate with a port of the another fog node that receives the connection request only through a port that sends the connection request; when the mist node with the network address conversion type of active symmetry type is used as the passive connecting party, the other port except the port for receiving the connection request is used for communicating with the port for sending the connection request in the other mist node, and the mist node of active symmetry type can establish connection with the other mist node only after receiving the connection request sent by the other mist node;
and the transmission module is configured to transmit data between the two connected fog nodes.
Publications (2)
| Publication Number | Publication Date |
|---|---|
| HK40035471A true HK40035471A (en) | 2021-05-14 |
| HK40035471B HK40035471B (en) | 2021-08-27 |
Family
ID=
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8457014B2 (en) | Method for configuring control tunnel and direct tunnel in IPv4 network-based IPv6 service providing system | |
| US8656017B2 (en) | Peer-to-peer collaboration system with edge routing | |
| CN112637364B (en) | Method, client and system for establishing P2P connection | |
| CN111294399B (en) | A data transmission method and device | |
| EP3219087B1 (en) | Methods, systems, and computer readable media for facilitating the resolving of endpoint hostnames in test environments with firewalls, network address translators(nats), or clouds | |
| CN103108089A (en) | Connection establishment management method of network system and related system thereof | |
| CN109951493B (en) | Network intercommunication method, device, equipment and storage medium | |
| WO2005109785A1 (en) | Information processing device, and bubble packet transmission method and program | |
| CN100454905C (en) | Method of Traversing Network Address Translation | |
| CN101931658A (en) | Method and device for communicating with IPv6 host with IPv4 application | |
| CN114598532B (en) | Connection establishment method, device, electronic device and storage medium | |
| CN115766654A (en) | Network address translation type detection method, system and electronic device | |
| CN101478505A (en) | Network system and network connection method established among network devices of different private networks | |
| US20160380964A1 (en) | Network transmission method and network transmission system for a multi-layer network address translator structure | |
| CN111800341B (en) | Cross-router terminal communication method and device | |
| US9413590B2 (en) | Method for management of a secured transfer session through an address translation device, corresponding server and computer program | |
| CN111629059B (en) | A cluster communication method, system, device and computer-readable storage medium | |
| CN112019641B (en) | Data transmission method and device | |
| Tseng et al. | Can: A context-aware NAT traversal scheme | |
| HK40035471B (en) | Data transmission method and device | |
| HK40035471A (en) | Data transmission method and device | |
| CN111405560A (en) | Communication method, device, equipment and storage medium | |
| CN101557336B (en) | Method for establishing network tunnel, data processing method and related equipment | |
| Lai et al. | A novel NAT-based approach for resource load balancing in fog computing architecture | |
| CN108769293B (en) | IP address resolution method and related device |