Application-agnostic puncturing of network address translation (NAT) services
Two electronic devices attempt to communicate and exchange Internet Protocol (IP) packets over a cellular communication network, and at least one of the two devices is behind a symmetric Network Address Translation (NAT) service. At least one of the two devices executes a Session Traversal Utilities for NAT (STUN) protocol, which provides to that device a pair of external IP address and port of that device; which that device then informs to a Message Broker Unit that is accessible to both devices via the public Internet. The Message Broker Unit provides the external IP address and port of that device, to the other device; which then connects to a Virtual Private Network (VPN) server and sends to the first device one or more User Datagram Protocol (UDP) packets that penetrate or puncture the NAT service in an application-agnostic manner.
1 . A system comprising:
a first electronic device;
a second electronic device; and
a Message Broker that is accessible via the public Internet to both the first electronic device and the second electronic device;
wherein the first electronic device runs a first application that is configured to send a first set of Internet Protocol (IP) packets to a second application running on a second electronic device and to receive a second set of IP packets from said second application;
wherein the second electronic device runs the second application that is configured to receive the first set of IP packets from the first application and to send the second set of IP packets to the first application;
wherein the second set of IP packets is routed, from the second electronic device to the first electronic device, via a first Network Address Translation (NAT) service;
wherein at least one of the first application and the second application requires puncturing of said first NAT service in order to establish or maintain communication with the other of the first application and the second application;
wherein the first electronic device is configured to execute Session Traversal Utilities for NAT (STUN) protocol to obtain a first pair of external IP address and port of the first electronic device;
wherein the second electronic device is configured to execute the STUN protocol to obtain a second pair of external IP address and port of the second electronic device;
wherein the first electronic device is configured to send a first informing message to said Message Broker, wherein the first informing message indicates the first pair of external IP address and port of the first electronic device;
wherein the Message Broker provides the first informing message to the second electronic device;
wherein the second electronic device is configured to send a second informing message to said Message Broker, wherein the second informing message indicates the second pair of external IP address and port of the second electronic device;
wherein the Message Broker provides the second informing message to the first electronic device;
wherein the first electronic device utilizes a Virtual Private Network (VPN) function to communicate with the second electronic device by sending, via a first VPN server, packets for NAT puncturing addressed to the second pair of external IP address and port of the second electronic device that were indicated to the first electronic device by the second informing message via the Message Broker;
wherein the second electronic device communicates with the first electronic device by sending packets for NAT puncturing addressed to the first pair of external IP address and port of the first electronic device that were indicated to the second electronic device by the first informing message via the Message Broker;
wherein, after communications using addresses and ports received from the Message Broker, the second electronic device sends a subset of said second set of IP packets of said second application to said first application by setting their destination IP address to one of: (a) the external IP address of said first electronic device as received from said Message Broker, or (b) a source IP address as obtained from incoming puncturing packets that were received at the second electronic device from said first electronic device, or (c) a source IP address as obtained from packets of said first application that were received at the second electronic device from the first electronic device;
wherein the first electronic device sends a subset of said first set of IP packets to said second application running on said second electronic device by setting their destination IP address to a source IP address as obtained from the subset of said second set of IP packets that were received at the first electronic device from said second application of the second electronic device.
2 . The system of claim 1 ,
wherein utilization of the VPN function by the first electronic device penetrates the first NAT service, and enables communication between the first application and the second application based on the first pair of external IP address and port and the second pair of external IP address and port, without utilization of and without reliance on Traversal Using Relays around NAT (TURN) protocols.
3 . The system of claim 2 ,
wherein the second electronic device is configured to send a User Datagram Protocol (UDP) packet directly to the first pair of external IP address and port of the first electronic device;
wherein the first electronic device and the second electronic device exchange IP packets utilizing said VPN function for the puncturing of said first NAT service in a communication process that is application-agnostic and does not require any modifications to the first application or to the second application.
4 . The system of claim 3 ,
wherein the second electronic device communicates via a connected first cellular transceiver with the first electronic device;
wherein the second electronic device communicates using the first pair of external IP address and port of the first electronic device as the destination address in the IP packets it sends to said first electronic device.
5 . The system of claim 3 ,
wherein the said second application communicates via two or more cellular transceivers connected to said second electronic device with the first application;
wherein one or more VPN functions are utilized by the first electronic device to puncture NAT services for each cellular transceiver separately.
6 . The system of claim 1 ,
wherein the second set of IP packets are sent from the second application to the first application by distributing the second set of IP packets for transmission in concert by two or more cellular transceivers used by the second electronic device upon puncturing of one or more NAT services that are between the first electronic device and the second electronic device.
7 . The system of claim 1 ,
wherein said second electronic device is using the Internet via a second NAT service;
wherein utilization of the VPN function penetrates both: (a) the second NAT service, which is of any type of NAT service, and (b) said first NAT service, which is a symmetric NAT service.
8 . The system of claim 1 ,
wherein said second electronic device is using the Internet via a second NAT service;
wherein utilization of the VPN function penetrates both: (a) the first NAT service, which is a symmetric NAT service, and (b) the second NAT service, which is a non-symmetric NAT service.
9 . The system of claim 1 ,
wherein said second electronic device is using the Internet via a second NAT service;
wherein utilization of the VPN function penetrates any combination of: (a) the first NAT service being one of a symmetric NAT service, a non-symmetric NAT service, and absent, and (b) the second NAT service being one of a symmetric NAT service, a non-symmetric NAT service, and absent.
10 . The system of claim 9 ,
wherein penetration of the first NAT service and the second NAT service enables communication between said first application running on said first electronic device, which utilizes a first cellular transceiver, and said second application running on said second electronic device, which utilizes a second cellular transceiver, wherein the first cellular transceiver and the second cellular transceiver may be using the same cellular network or different cellular networks.
11 . The system of claim 9 ,
wherein penetration of the second NAT service enables communication between said first application running on said first electronic device, which utilizes a first Wi-Fi transceiver, and said second application running on said second electronic device, which utilizes a second Wi-Fi transceiver.
12 . The system of claim 9 ,
wherein penetration of the second NAT service enables communication between said second application running on said second electronic device, which utilizes a cellular transceiver, and said first application running on said first electronic device, which utilizes a non-cellular transceiver.
13 . The system of claim 9 ,
wherein penetration of the second NAT service enables communication between: (a) said first electronic device, which utilizes two cellular transceivers in parallel for simultaneous transmission of said first set of IP packets, and (b) said second electronic device, which utilizes two cellular transceivers in parallel for simultaneous transmission of said second set of IP packets;
wherein each of said cellular transceivers uses the same or a different cellular network as the other cellular transceivers;
wherein each of said cellular transceivers has an IP address within the cellular network that is different than their external IP addresses;
wherein IP address translation or mapping between internal and external IP addresses is performed by one or more NAT services;
wherein each of the one or more NAT services, used by each of the cellular transceivers, is the same or different than the other NAT services used by the other cellular transceivers;
wherein each of the one or more NAT services is of a type selected from the group consisting of: (i) a symmetric NAT service, (ii) a non-symmetric NAT service, (iii) an absent, non-existent or deactivated NAT service.
14 . The system of claim 13 ,
wherein the VPN function that is utilized to penetrate both the first NAT service and the second NAT service is selected from the group that includes at least:
Point-to-Point Tunneling Protocol (PPTP),
Open VPN,
remote access VPN protocol,
peer-to-peer VPN protocol,
site-to-site VPN protocols,
L2TP,
WireGuard.
15 . The system of claim 13 ,
wherein the first electronic device is configured to automatically switch, from utilizing the first VPN server for penetrating the first or second NAT services, to utilizing a second, different, VPN server for penetrating the first or second NAT services in response to a detection that one or more of the NAT services was modified or replaced or IP packet routing by the first VPN server has degraded below a threshold.
16 . The system of claim 1 ,
wherein said second application that runs on the second electronic device is a client-side application;
wherein said first application that runs on the first electronic device is a server-side application that is configured to serve at least two client-side applications residing on at least two different electronic devices in parallel.
17 . The system of claim 1 ,
wherein the first electronic device is configured to dynamically switch, from utilizing the first VPN server for penetrating the first or second NAT services, to utilizing a second, different, VPN server for penetrating the first or second NAT services in response to a detection that a performance characteristic of the first VPN server has decreased to below a pre-defined threshold value.
18 . A method for puncturing one or more Network Address Translation (NAT) services that are located between a first electronic device and a second electronic device,
wherein the first electronic device runs a first application that is configured to send a first set of Internet Protocol (IP) packets to a second application running on a second electronic device and to receive a second set of IP packets from said second application,
wherein the second electronic device runs the second application that is configured to receive the first set of IP packets from the first application and to send the second set of IP packets to the first application,
wherein the second set of IP packets is routed, from the second electronic device to the first electronic device, via a first Network Address Translation (NAT) service,
wherein at least one of the first application and the second application requires puncturing of said first NAT service in order to establish or maintain communication with the other of the first application and the second application, and
wherein a Message Broker is accessible via the public Internet to both the first electronic device and the second electronic device,
the method comprising:
at the first electronic device, executing Session Traversal Utilities for NAT (STUN) protocol to obtain a first pair of external IP address and port of the first electronic device;
at the second electronic device, executing the STUN protocol to obtain a second pair of external IP address and port of the second electronic device;
at the first electronic device, sending a first informing message to said Message Broker, wherein the first informing message indicates the first pair of external IP address and port of the first electronic device;
providing, by the Message Broker, the first informing message to the second electronic device;
at the second electronic device, sending a second informing message to said Message Broker, wherein the second informing message indicates the second pair of external IP address and port of the second electronic device;
providing, by the Message Broker, the second informing message to the first electronic device;
at the first electronic device, utilizing a Virtual Private Network (VPN) function to communicate with the second electronic device by sending, via a first VPN server, packets for NAT puncturing addressed to the second pair of external IP address and port of the second electronic device that were indicated to the first electronic device by the second informing message via the Message Broker;
at the second electronic device, communicating with the first electronic device by sending packets for NAT puncturing addressed to the first pair of external IP address and port of the first electronic device that were indicated to the second electronic device by the first informing message via the Message Broker;
at the second electronic device, after communications using addresses and ports received from the Message Broker, sending a subset of said second set of IP packets of said second application to said first application by setting their destination IP address to one of: (a) the external IP address of said first electronic device as received from said Message Broker, or (b) a source IP address as obtained from incoming puncturing packets that were received at the second electronic device from said first electronic device, or (c) a source IP address as obtained from packets of said first application that were received at the second electronic device from the first electronic device;
at the first electronic device, sending a subset of said first set of IP packets to said second application running on said second electronic device by setting their destination IP address to a source IP address as obtained from the subset of said second set of IP packets that were received at the first electronic device from said second application of the second electronic device.
19 . A non-transitory storage medium having instructions stored thereon that, when executed by a machine, cause the machine to perform the method of claim 18 .