DEVICE, SYSTEM AND METHOD FOR ESTABLISHING A CONNECTION BETWEEN DATA STORAGE DEVICES
The system enables reliable peer-to-peer connections by managing socket creation and packet transmission across symmetric and cone NATs, addressing the challenge of secure data transfer in data storage systems.
Patent Information
- Application Number
- DE112017001966
- Authority / Receiving Office
- DE · DE
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2016-04-11
- Filing Date
- 2017-02-28
- Publication Date
- 2025-08-28
- Estimated Expiration
- 2037-02-28
AI Technical Summary
Existing methods for establishing peer-to-peer connections between computing devices behind symmetric and cone network address translators (NATs) are ineffective, preventing secure and reliable data transfer.
A system and method for establishing connections between data processing devices using a controller to manage socket creation and packet transmission, determining network addresses and port numbers, and employing probability calculations to overcome symmetric NATs, enabling peer-to-peer communication.
Facilitates secure and reliable peer-to-peer connections between devices behind symmetric and cone NATs, enhancing data security and redundancy in data storage systems.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
REFERENCE TO RELATED APPLICATIONS
[0001] This application claims priority to U.S. Patent Application No. 15 / 096,102, issued April 11, 2016, entitled ESTABLISHING CONNECTIONS BETWEEN DATA STORAGE DEVICES. BACKGROUND
[0002] Distributing data storage across one or more data storage devices can provide increased data security through data redundancy. One type of data storage device can be a direct-attached storage device (DAS). DAS devices can enable one or more computing devices with direct access to data via a connecting cable (e.g., via a direct or physical connection). Another type of data storage device can be a network-attached storage device (NAS). NAS devices can enable access to data via computer networks (e.g., via a wired and / or wireless network). In this context, the disclosure of the following documents may be helpful for understanding the present invention: - Yuan Wei et al.: “A New Method for Symmetric NAT Traversal in UDP and TCP” - US 2009 / 0 006 648 A1 - US 2006 / 0 075 127 A1.
[0003] The article by Yuan Wei et al. proposes a new method for bypassing network address translation (NAT) in UDP. Several techniques for bypassing NAT or firewall boxes in UDP have been proposed. These techniques can establish UDP communication between hosts behind NATs. However, existing NAT bypassing schemes, including Universal Plug and Play (UPnP), Simple Traversal of UDP over NATs (STUN), and Teredo, cannot bypass symmetric NAT boxes. The disclosed scheme uses a new port prediction method. It steers the ports to bypass both symmetric NAT boxes and other types of NATs. Furthermore, the scheme can be extended for simple NAT bypassing in TCP.
[0004] US 2009 / 0 006 648 A1 discloses how, in a network environment, multiple end-user applications running on computer devices operate behind a respective NAT device. The transfer of information from one end-user application to another can occur by establishing a connection from a private network. The NAT device translates information related to an end-user application running on a private network into information understood by the public network environment. This translated information is forwarded to the associated NAT device of the intended recipient. The recipient's NAT device translates the information from the public environment into information for the end user on the private network.
[0005] US 2996 / 0 075 127 A1 relates to multiplayer peer-to-peer connections across firewalls and network address translators (NATs) using a single local port on the local host. In one embodiment, a system for providing peer-to-peer connections comprises a plurality of host devices located behind respective NATs and a plurality of STUN (Session Traversal Utilities for NAT) servers. Each host device includes a first socket bound to a first private port and a second socket bound to a second private port. Each host device sends a first STUN packet over the first socket to a first STUN server and a second group of STUN packets over the second socket to the STUN servers via public ports of the respective NAT. The STUN servers identify the public port numbers of the public ports.Each host device is configured to calculate a predicted public port number of the corresponding NAT for the second socket based on the public port numbers of the public ports for the first socket and the second socket, where the predicted public port number is to be used for a peer-to-peer connection between the second socket of the host device and other host devices. SUMMARY OF THE INVENTION
[0006] The present invention is based on the object of establishing a reliable and secure connection between data processing devices that communicate via NATs. In this sense, the present invention relates to devices according to claims 1 and 5, a system according to claim 10, and methods according to claims 14, 17, and 20. Advantageous embodiments may comprise features of dependent claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] Various embodiments are shown in the accompanying drawings for illustrative purposes and should not be construed in any way as limiting the scope of this disclosure. Furthermore, various features of various disclosed embodiments may be combined to form additional embodiments that are part of this disclosure. Fig. 1 is a diagram of a data storage system according to one embodiment. Fig. 2 is a diagram of a data storage system according to one embodiment. Fig. 3 is a diagram of a data storage system according to one embodiment. Fig. 4A is a diagram of a data storage system according to one embodiment. Fig. 4B is a flowchart illustrating example packets and / or messages according to one embodiment. Fig. 5 is a flowchart illustrating a process for establishing a connection between computing devices according to one embodiment. Fig. 6 is a flowchart illustrating a process for establishing a connection between computing devices according to one embodiment. DETAILED DESCRIPTION
[0008] Although specific embodiments are described, these embodiments are presented only by way of example and are not intended to limit the scope of protection. Indeed, the novel methods and systems described herein may be embodied in a variety of other forms. Furthermore, various omissions, substitutions, and changes in the form of the methods and systems described herein may be made without departing from the scope of protection.
[0009] The headings contained herein are for convenience only and do not necessarily affect the scope or meaning of the claimed invention. Disclosed herein are exemplary implementations, configurations, and / or embodiments related to establishing connections, such as peer-to-peer (P2P) connections, between computing devices that communicate data via network address translations (NATs). overview
[0010] Data storage devices / systems may provide one or more computing devices with file-level data storage. An example of a data storage device / system may be a DAS device. The DAS device may be coupled to a computing device (e.g., a laptop computer, a desktop computer, etc.) via an interconnect cable (e.g., a Thunderbolt cable, an eSATA (External Serial Advanced Technology Attachment) cable, a USB (Universal Serial Bus) cable, etc.) coupled to a DAS interface (e.g., a communications interface such as USB 2.X, USB 3.X, Thunderbolt, eSATA, etc.) of the DAS device. A DAS device may provide a convenient mechanism for data transfer between computing devices, increasing storage capacity (e.g.,Increasing the storage space) of a computing device and / or increasing data security through data redundancy. Another example of a data storage device / data storage system may be a NAS device. A NAS device may be coupled to a network via a NAS interface (e.g., a network interface or a communications interface such as Ethernet, 802.11 (Wi-Fi), etc.). A NAS device may provide file-level data storage over a network (e.g., a computer network), with access to the stored data being available to a group of clients. For example, a NAS device may include hardware, software, or a combination of such elements configured so that the NAS device operates as a file server.NAS devices / systems can provide a convenient mechanism for data exchange between multiple computers and / or remote access to data stored on the NAS devices / systems. Compared to traditional file servers, the advantages of NAS devices / systems can include the ability to access data from multiple locations (e.g., remote sites), faster data access, easier management, and / or simpler configuration.
[0011] Certain embodiments disclosed herein provide the ability to establish a connection between computing devices communicating via NATs. A first computing device may communicate data via a symmetric NAT, and a second computing device may communicate data via a cone NAT. The embodiments disclosed herein may enable the first computing device to establish a connection, such as a peer-to-peer (P2P) connection, between the first computing device and the second computing device via the symmetric NAT and the cone NAT. Data storage devices
[0012] Fig. 1 is a diagram of a data storage system 100 according to one embodiment. In data storage system 100, a data storage device 120 may be communicatively coupled to one or more client devices (e.g., computing devices) to provide file-based data storage services to the one or more client devices (e.g., one or more computing devices). Types of client devices (e.g., computing devices) that may have access to data storage device 120 may include, but are not limited to, phones 137 (e.g., smartphones, cellular phones, etc.), cable set-top boxes 136, smart televisions 135, video game consoles 134, laptop computers 133, tablet computers 132, desktop computers 131, portable computers, and / or other types of computing devices. In one embodiment, data storage device 120 may be an external, standalone data storage device.For example, data storage device 120 may be a data storage device that is not located within a computing device (e.g., not within an enclosure or housing of a computing device). In another example, data storage device 120 may be a data storage device that can provide access to data without being directly coupled to a computing device (e.g., it may be a NAS device). Client devices (e.g., computing devices) may also be referred to as host systems. In one embodiment, data storage device 120 may be a portable data storage device. The portable data storage device may not have a power source (e.g., a battery and / or an AC adapter) and may draw power from the client devices (e.g., host systems).
[0013] The data storage device 120 may enable various client devices (e.g., telephones 137, cable set-top boxes 136, smart televisions 135, video game consoles 134, laptop computers 133, tablet computers 132, desktop computers 131) to access various types of user data stored on the data storage device 120. The data storage device 120 may also enable users to store various types of user data on the data storage device 120. The data storage device 120 may include magnetic media, hard disk media, and / or solid-state media.While certain descriptions herein refer to solid-state memory in general, it is understood that solid-state memory may include one or more different types of non-volatile solid-state memory devices, such as flash integrated circuits, chalcogenide random access memory (C-RAM), phase-change memory (PC-RAM or PRAM), programmable metallization cell RAM (PMC-RAM or PMCm), ovonic unified memory (OUM), resistive random access memory (RRAM), NAND memory (e.g., single-level cell (SLC) memory, multi-level cell (MLC) memory, or any combination thereof), NOR memory, EEPROM, ferroelectric memory (FeRAM), magnetoresistive RAM (MRAM), other discrete NVM (non-volatile memory) chips, or any combination thereof.
[0014] With further reference to Fig. 1, the data storage device 120 (e.g., magnetic disk drive, hybrid hard disk, solid state drive, etc.) may include a controller (in Fig. 1 not shown) configured to receive data commands and execute such commands in one or more non-volatile memory components of the data storage device 120. Such commands may include data read / write commands and the like. The controller may be configured to receive data commands from a communications interface (e.g., a NAS interface and / or a DAS interface) located on a data processing device (e.g., a host system). Data commands may specify a block address in the data storage device 120, and data may be accessed / transferred based on these commands. The data commands may also be referred to as data access requests.
[0015] Data storage device 120 may be configured to store data in one or more magnetic recording disks and / or solid-state storage devices / arrays. In one embodiment, data storage device 120 may include a cable box, a backup disk drive, a media storage unit, a streaming media device, a digital camera, or other electronic device capable of storing data that may need to be accessed directly or wirelessly.
[0016] In certain embodiments, data storage device 120 may store data received from a client device such that data storage device 120 serves as data storage for the client device. To facilitate this function, data storage device 120 may implement a logical interface. The logical interface may be available to the client device's memory as a set of logical addresses (e.g., sequential / continuous addresses) in which data may be stored. Internally, the controller may map logical addresses to various physical memory addresses in the non-volatile memory of data storage device 120. Mapping data indicating the mapping of logical addresses to physical memory addresses may be maintained in data storage device 120.
[0017] In one embodiment, data storage device 120 may be a DAS device. The DAS device may be directly coupled to a client device (e.g., a desktop computer 131) via a connection cable 121. The connection cable 121 may be coupled to a communications interface (e.g., a USB 2.X interface, a USB 3.X interface, a Thunderbolt interface, etc.) of the DAS device (e.g., data storage device 120). In another embodiment, data storage device 120 may also be a NAS device. The NAS device may also be coupled to the client devices (e.g., computing devices) 131-137 via a network 105. The NAS device may be coupled to the network 105 via a network interface (e.g., an Ethernet interface, an 802.11 (Wi-Fi) interface, etc.).Each of the client devices 131-137 may also be coupled to the network 105 via a network interface. In one embodiment, the network 105 may include a public network (e.g., the Internet), a private network (e.g., a local area network (LAN)), a wide area network (WAN) such as the Internet, a wired network (e.g., an Ethernet network), a wireless network (e.g., an 802.11 network or a Wi-Fi network), a cellular network (e.g., a Long Term Evolution (LTE) network), routers, hubs, switches, server computers, other types of computer networks, and / or a combination thereof. Although . Fig. 1 illustrates the data storage device 120 coupled to the client device 131, the data storage device may be coupled to any number of the client devices 131-137 via one or more interconnect cables in other embodiments.
[0018] In one embodiment, data storage device 120 may receive data access requests from client devices 131-137 via the communications interface (e.g., a DAS interface such as USB 2.X, USB 3.X, Thunderbolt) and / or via the network interface (e.g., Ethernet, 802.11, etc.). The data access requests may be messages, commands, and / or requests to access data on the data storage device. For example, a data access request may indicate that a computing device wishes to read data from data storage device 120. In another example, a data access request may indicate that a computing device wishes to write data to data storage device 120.
[0019] Many computing devices can communicate with other computing devices and / or networks via a NAT. For example, the data storage device 120 (e.g., a computing device) can communicate with other computing devices and / or networks via a NAT. The types of NATs can include, but are not limited to, cone NATs and symmetric NATs. When two computing devices transfer data via two cone NATs, a UDP (User Datagram Protocol) hole-punching technique can be used, allowing the two computing devices to establish a connection with each other (e.g., a P2P connection). However, when two computing devices transfer data via a cone NAT and a symmetric NAT, the UDP hole-punching technique may not work. This may prevent the two computing devices from establishing a connection (e.g.,Since both cone NATs and symmetric NATs can be used frequently, it may be desirable for two computing devices communicating via a cone NAT and a symmetric NAT to be able to establish a connection with each other (e.g., establish a P2P connection with each other).
[0020] Fig. 2 is a diagram of a data storage system 200 according to one embodiment. The data storage system 200 includes a data processing device 211, a data processing device 213, a connection cable, and a data storage device 220. Each of the data processing devices 211 and 213 may be a laptop computer, a desktop computer, a server computer, a tablet computer, a smartphone, a set-top box, a smart TV, a video game console, etc. The data processing devices 211 and 213 may also be referred to as host systems. The data storage device 220 may include a controller 230, a direct access interface 241 (e.g., USB 2.X, USB 3.X, Thunderbolt, eSATA, etc.), a network access interface 243 (e.g., Ethernet, Wi-Fi, etc.), and non-volatile memory components 245.In one embodiment, non-volatile storage components 245 may include non-volatile magnetic media and / or solid-state memory, such as NAND flash. Controller 230 may provide overall control for data storage device 220. In one embodiment, data storage device 220 may be a portable data storage device. The portable data storage device may not have a power source (e.g., a battery and / or an AC adapter) and may draw power from data processing devices 211 (e.g., host systems).
[0021] In certain embodiments, the data storage device 220 may be a hard disk drive. The non-volatile storage components 245 may include one or more platters, and the data storage device 220 may further include one or more heads (not shown) actuated radially across the platter(s) and a spindle motor for rotating the platter(s). Alternatively to or in addition to magnetic rotational media, solid-state memory and / or other non-volatile memories such as MRAM and / or phase-change memory may be used. For example, in certain embodiments, the data storage device 220 may be a hybrid hard disk drive that includes both magnetic media and solid-state media (e.g., the non-volatile storage components 245 may include both magnetic disks and solid-state media / memory).In one embodiment, the non-volatile memory components 245 may be coupled to the controller via one or more serial bus ports. Examples of serial bus ports include, but are not limited to, Serial ATA (SATA) ports, Peripheral Component Interconnect Express (PCI) ports, and SATA Express ports. In one embodiment, the data storage device 220 may be external standalone data storage devices (e.g., NAS devices / drives, portable external hard drives, etc.). In another embodiment, the data storage device 220 may be a portable data storage device. For example, the data storage device 220 may be a portable external hard drive. In another embodiment, the data storage device 220 may receive power from the computing device 211 via an interconnect cable and the direct access interfaces 212 and 241.For example, the data storage device 220 may not include a power source (e.g., a battery, a power supply, etc.) and may operate with power (e.g., voltage, current, etc.) obtained from the data processing device 211 (e.g., a host system).
[0022] The controller 230 may receive data access requests (e.g., data and storage access commands) from a DAS interface 212 (e.g., a USB interface, a Thunderbolt interface) of the computing device 211. Data access requests communicated by the DAS interface 212 may include write and read commands issued by the computing device 211. The data access requests may specify an LBA or a range of LBAs in the data storage device 220, and the controller 230 may execute the received data access requests in the non-volatile memory components 245. The controller 230 may also receive a data access request from a NAS interface 214 (e.g., a communications interface such as an Ethernet interface, a Wi-Fi interface, etc.) of the computing device 213.Controller 230 may determine an LBA and / or a range of LBAs in data storage device 220 based on the data access requests and may execute the received data access requests in non-volatile memory components 245. In a hybrid hard drive, data may be stored in a magnetic media storage component as well as in non-volatile solid-state memory.
[0023] Data storage device 220 may store data received from data processing devices 211 and 213, such that data storage device 220 functions as memory for data processing devices 211 and 213. To facilitate this storage function, controller 230 may implement a logical interface. The logical interface may make the memory of data storage device 220 available to data processing devices 211 and 213 as a set of logical addresses (e.g., contiguous addresses) in which data may be stored. Controller 230 may map logical addresses to various physical memory addresses in non-volatile memory components 245 and / or another memory module or modules.
[0024] The data storage device 220 can be configured to implement data redundancy, wherein user data stored in the non-volatile memory components 245 is maintained in one or more internal and / or external drives. For example, the controller 230 can include a data redundancy management module (in Fig. 2 not shown) configured to implement redundancy functions. For example, the data redundancy management module may implement a redundant array of independent disks (RAID technology), wherein the non-volatile memory components 245 include a plurality of internal drives, disks, or other data storage partitions combined into a logical unit for the purpose of data redundancy and performance improvement. Additionally or alternatively, the data redundancy management module may be configured to implement RAID using one or more internal memory modules in combination with one or more external memory devices, as further explained below.
[0025] For RAID purposes, the non-volatile memory components 245 may include an array of one or more storage devices, such as hard drives or other memory modules configured to store user data. In certain embodiments, such internal memory modules / disks may each be directly coupled to the controller 230 to provide a high-bandwidth interface for reading and writing user data. The non-volatile memory components 245 may include one or more additional memory modules configured to store parity information.
[0026] Controller 230 may be configured to share and replicate user data among the physical RAID storage modules, providing storage virtualization. The array may be accessed by data processing devices 211 and 213 as a single drive. Data may be distributed among the RAID storage modules / drives according to any desired or practical RAID level, depending on the desired redundancy and / or performance level. For example, data storage device 220 may be configured to implement RAID 0, RAID 1, RAID 5, RAID 6, RAID 10, other RAID technology, or other erasure coding technology, depending on data reliability, availability, performance, and / or capacity considerations or requirements.
[0027] Computing device 211 may be coupled to data storage device 220 via a connecting cable. The connecting cable may directly connect computing device 211 and data storage device 220. The connecting cable may use one or more communication interfaces (such as a bus interface) and / or protocols that enable computing device 211 to communicate with data storage device 220. Direct access interfaces 212 and 241 may be USB interfaces, Thunderbolt interfaces, serial attached SCSI (SAS), eSATA interfaces, etc.
[0028] In one embodiment, the interconnect cable may include one or more data lines (e.g., one or more wires, pins, etc.) that enable the data processing device 211 to communicate data with the data storage device 220. For example, the interconnect cable may include data lines (in Fig. 2 not shown) that can be used by the data processing device 211 to read and / or write data from the data storage device 220. The data processing device 211 can communicate data to and from the data storage device using the DAS interface 212 (e.g., via the DAS interface 212). In another embodiment, the data processing device 211 can provide an input voltage to the data storage device 220, and the data storage device 220 can use the input voltage to operate one or more components of the data storage device 220 (e.g., the controller 230, the non-volatile memory components 245, a motor, etc.). The interconnect cable can include one or more voltage lines (e.g., wires, pins, etc.) that can receive the input voltage from the data processing device 211 via the DAS interface 212.The one or more voltage lines may supply the input voltage (obtained from the data processing device 211) to the data storage device 220 via the direct access interface 241. In another embodiment, the data storage device 220 may be coupled to a separate power source (e.g., it may be coupled to a battery, to an AC adapter, to a wall outlet, etc.).
[0029] In one embodiment, the connecting cable may comprise a bridge unit (in Fig. 2 not shown). For example, the connecting cable may include a USB bridge, a Thunderbolt bridge, or another type of bridge. The bridge unit can translate between two different types of communication interfaces and / or protocols. For example, if a connected storage device communicates in a first protocol but not a second protocol, the bridge unit can translate the second protocol to the first protocol, or vice versa.
[0030] Computing device 213 may be communicatively coupled to data storage device 220 via a network 205 (e.g., one or more of a Wi-Fi network, a LAN, a cellular network, etc.). Computing device 213 may send data (e.g., files, images, movies, etc.) and / or data access requests to data storage device 220 via NAS interface 214 (e.g., a communications interface, an Ethernet interface, a Wi-Fi interface, etc.) and network 205. Data storage device 220 may receive the data and / or data access requests from computing device 213 via network access interface 243.
[0031] In one embodiment, data storage device 220 may include an encryption module (e.g., software, hardware, firmware, or a combination thereof) that can encrypt / decrypt 245 data (e.g., files) stored on the non-volatile memory components. For example, the encryption module may use encryption keys and / or encryption functions / algorithms to encrypt and / or decrypt data. In another embodiment, data storage device 220 may include various sensors, such as a compass (e.g., a magnetometer), a gyroscope, an accelerometer, a Global Positioning System (GPS) sensor, a temperature sensor (e.g., a thermometer), etc.
[0032] As explained above, data processing devices (e.g., data processing device 213, data storage device 220) may communicate with each other via NATs. For example, data processing device 213 may communicate data with network 205 via a first NAT (in Fig. 2 not shown), and the data storage device 220 can communicate data with the network 205 via a second NAT (in Fig. 2 not shown). In one embodiment, the first NAT may be a symmetric NAT, and the second NAT may be a cone NAT.
[0033] In one embodiment, the controller 230 may create a set of sockets. The first NAT may associate each socket in the set of sockets with an external interface of the first NAT (e.g., associate each port with a port of the NAT). For example, the first NAT may associate the set of sockets with a set of ports of the first NAT. The controller 230 may create the set of sockets by binding the sockets to port 0, which may enable the first NAT to assign (e.g., randomize) the port numbers of the sockets (of the first NAT) associated with the data storage device 220. The controller 230 may also determine a network address associated with the computing device 213. For example, the controller 230 may determine the Internet Protocol (IP) address associated with the computing device 213.
[0034] In one embodiment, the controller 230 may transmit a set of packets to the computing device 213 via the set of sockets and / or the first NAT (e.g., via the ports of the first NAT associated with the set of sockets). For example, the controller 230 may transmit one (or more) packets to the computing device 213 via each socket in the set of sockets and / or the first NAT. The controller 230 may determine whether a packet is received from the computing device 213 via a first socket in the set of sockets (e.g., via the set of sockets with random port numbers). The packet (received by the computing device 213) may be one of a set of packets transmitted from the computing device 213 to the computing device 220.Computing device 213 may transmit the set of packets to a set of ports (of the first NAT) associated with data storage device 220. For example, computing device 213 may transmit one (or more) packets to each port in the set of ports. The set of ports may include random port numbers selected by computing device 213 (e.g., ports that have random numbers selected by computing device 213).
[0035] In one embodiment, the controller 230 may establish a connection with the computing device 213 via the first socket when a packet is received (from the computing device 213) via the set of sockets and / or the first NAT. For example, the controller 230 (and / or the data storage device 220) may establish a peer-to-peer (P2P) connection with the computing device 213 when a packet is received from the computing device 213 via a socket of the set of sockets and / or the first NAT.
[0036] In another embodiment, the controller 230 may create a second set of sockets if no packet is received from the computing device 213 via the set of sockets and / or the first NAT. The first NAT may map each socket in the second set of sockets to an external interface (e.g., a port) of the first NAT. The controller 230 may transmit another set of packets to the computing device 213 via the second set of sockets and / or the first NAT. The controller 230 may determine whether a packet is received from the computing device 213 via a socket of the second set of sockets and / or the first NAT. If the packet is received from the computing device 213 via a socket of the second set of sockets and / or the first NAT, the controller 230 may establish a connection with the computing device 213 via the socket.
[0037] In one embodiment, controller 230 may determine that the first NAT (used by data storage device 220) and the second NAT (used by computing device 213) are both symmetric NATs. Controller 230 may refrain from creating the set of sockets, transmitting the set of packets, determining whether the packet was received, and establishing the connection to the computing device if the first NAT and the second NAT are both symmetric NATs.
[0038] In one embodiment, controller 230 may determine the number of sockets in the set of sockets (and / or in the second set of sockets). For example, controller 230 may receive the number of sockets in the set of sockets from another computing device (e.g., a server). In another example, the number of sockets in the set of sockets may be stored in a configuration file and / or configuration data used by controller 230. In another example, controller 230 may calculate the number of sockets in the set of sockets. The number of sockets may be based on a threshold probability at which a first port number of the set of ports of the first NAT matches a second port number from the set of port numbers determined by computing device 213, as explained in more detail below.
[0039] As explained above, the data storage device 220 may transfer data over a first NAT (in Fig. 2 not shown), and the data processing device 213 can communicate via a second NAT (in Fig. 2 not shown). In one embodiment, the first NAT may be a cone NAT, and the second NAT may be a symmetric NAT.
[0040] In one embodiment, the controller 230 may determine a network address associated with the computing device 213. For example, the controller 230 may determine the Internet Protocol (IP) address associated with the computing device 213. The network address (e.g., IP address) associated with the computing device may be assigned and / or allocated by the second NAT. The controller 230 may determine a set of randomly selected port numbers. For example, the controller 230 may select and / or generate random port numbers included in the set of randomly selected port numbers (e.g., it may use a pseudorandom number generator (PRNG) to generate random port numbers). In another example, the controller 230 may receive the set of randomly selected numbers (e.g., the set of randomly selected numbers from another computing device).The controller 230 may also create a socket that can be used to transfer packets to the computing device 213.
[0041] In one embodiment, controller 230 may transmit a set of packets across the first NAT to a set of ports associated with computing device 213. For example, controller 230 may transmit one (or more) packets to each port in the set of ports associated with computing device 213. Each port in the set of ports may include a port number from the set of randomly selected port numbers.
[0042] In one embodiment, controller 230 may determine whether a first packet of a second set of packets was received from computing device 213 over a first port of the set of ports. The second set of packets may be transmitted from computing device 213 over another set of ports associated with computing device 213 (e.g., connected to a set of sockets created by computing device 213). The other set of ports may include port numbers randomly selected by the second NAT. For example, each port in the other set of ports (associated with computing device 213) may include a port number randomly selected by the second NAT.
[0043] In one embodiment, the controller 230 may establish a connection (e.g., a P2P connection) with the computing device 213 via the first socket when a packet is received from the computing device 213 via a first port in the set of ports. In another embodiment, the controller 230 may determine a second set of randomly selected port numbers when no packet is received from the computing device 213 via the set of sockets and / or the first NAT. The controller 230 may transmit a different set of packets to a second set of ports associated with the computing device 213 via the first NAT. Each port in the second set of ports may include a port number from the second set of randomly selected port numbers. The controller 230 may determine whether a packet is received from the computing device 213 via a port of the second set of ports.When a packet is received from the computing device 213 via a port of the second set of ports and / or the first NAT, the controller 230 may establish a connection with the computing device 213.
[0044] In one embodiment, controller 230 may determine that the first NAT (used by data storage device 220) and the second NAT (used by computing device 213) are both symmetric NATs. Controller 230 may refrain from determining the network address, determining the set of randomly selected port numbers, creating the socket, transmitting the set of packets, determining whether a first packet is received, and establishing the connection to computing device 213 if both the first NAT and the second NAT are symmetric NATs.
[0045] In one embodiment, controller 230 may determine the number of port numbers in the set of randomly selected port numbers (and / or in the second set of randomly selected port numbers). For example, controller 230 may receive the number of port numbers from another computing device (e.g., a server), or the number of port numbers may be stored in a configuration file and / or configuration data used by controller 230. In another example, controller 230 may calculate the number of port numbers. The number of port numbers may be based on a threshold probability of a first port number from the set of randomly selected port numbers corresponding to a second port number from a second set of ports associated with sockets created by data storage device 220, as explained in more detail below. Establishing a connection between data processing devices
[0046] Fig. 3 is a diagram of a data storage system 300 according to one embodiment. The data storage system 300 includes a network 305, a STUN (Session Traversal Utilities for NAT) server 321, a STUN server 322, a SIP (Session Initiation Protocol) server 325, a NAT 331, a NAT 332, a computing device 311, and a computing device 312. The STUN server 321 may provide information about the NAT 331 to the computing device 311. For example, the STUN server 321 may provide data indicating that the NAT 331 is a cone NAT (or a symmetric NAT) for the computing device 311. The STUN server 322 may provide information about the NAT 332 to the computing device 312. As explained above, data processing devices can communicate (e.g., transmit and / or receive) data with other data processing devices and / or networks via NATs. As described in Fig. 3, computing device 311 communicates data via NAT 331, and computing device 312 communicates data via NAT 332. As explained above, computing devices 311 and 312 may be computers, tablets, laptops, servers, data storage devices such as NAS drives, etc.
[0047] In one embodiment, computing device 311 may have data for communicating (e.g., transmitting / receiving) with computing device 312 or vice versa. A P2P connection (represented by the dashed line) may be established between computing device 311 and computing device 312 to enable computing device 311 and computing device 312 to communicate data directly with each other. SIP server 325 may assist computing device 311 and computing device 312 in establishing a connection with each other. For example, SIP server 325 may provide computing device 311 with a network address associated with computing device 312 (e.g., a network address assigned to computing device 312 by NAT 332) or vice versa.In another example, the SIP server 325 may provide the types of NAT 331 and NAT 332 to the computing device 311 and the computing device 312 (e.g., regardless of whether the NAT 331 is a cone NAT or a symmetric NAT).
[0048] The NAT 331 and the NAT 332 may perform firewall functions and / or act as a demilitarized zone (DMZ). For example, the NAT 331 may prevent the computing device 311 from receiving packets from the computing device 312 if the computing device 311 has not previously transmitted a packet to the computing device 312. In another example, the NAT 332 may prevent the computing device 312 from receiving packets from the computing device 311 if the computing device 312 has not previously transmitted a packet to the computing device 311. This may prevent the computing device 311 from establishing a connection (e.g., a P2P connection) with the computing device 312. If the NAT 331 and the NAT 332 are both cone NATs, a hole-punching technique (e.g.,A UDP (User Datagram Protocol) punch-through technique may be used to establish a P2P connection between the computing device 311 and the computing device 312. If the NAT 331 and the NAT 332 are both symmetric NATs, the computing device 311 and / or the computing device 312 may refrain from establishing the P2P connection between each other, as explained above.
[0049] In one embodiment, NAT 331 may be a symmetric NAT that randomly assigns port numbers, and NAT 332 may be a cone NAT. As explained above, computing device 311 may create a set of sockets (each socket assigned a random port number of NAT 331), transmit a set of packets over the set of sockets and NAT 331, determine whether a first packet was received from computing device 312 over the first set of sockets, and establish a P2P connection with computing device 312 when the first packet is received.In one embodiment, computing device 311 may determine the number of sockets in the set of sockets based on a threshold probability of a port number from the set of ports associated with the set of sockets matching a different port number from the set of random port numbers determined by computing device 312.
[0050] As already explained above, the computing device 312 may determine a network address (e.g., an IP address) associated with the computing device 311, determine a set of randomly selected port numbers, transmit a set of packets to a set of ports associated with the computing device 311, determine whether a first packet was received from the computing device 311 via a first port of the set of ports associated with the computing device 311, and establish a connection when the first packet was received.In one embodiment, computing device 312 may determine the number of port numbers in the set of randomly selected port numbers based on a threshold probability of a port number from the set of randomly selected port numbers matching another port number from a set of ports of NAT 331 associated with a set of sockets created by computing device 311.
[0051] In one embodiment, the threshold probability may be determined and / or calculated by first determining two parameters, Ω1 and Ω2, using equations (1) and (2) below. Ω1 may be a number of possible combinations of "n" different random port numbers within a set of "r" port numbers. For example, Ω1 may be the number of combinations of "n" different random port numbers within a set of "r" port numbers that may be selected by the NAT 331. Ω2 may be the number of possible combinations of "m" different random port numbers within a set of "r" port numbers. For example, Ω2 may be the number of combinations of "m" different random port numbers within a set of "r" port numbers that may be selected by the data processing device 312. Ω1=r!r−n !∗n! Ω2=r!r−m !∗m!
[0052] The total number of combinations Ω can be determined using equation (3) below: Ω=Ω1∗Ω2=r!r−n !∗n!∗r!r−m !∗m!
[0053] The number N1 may be the number of sets for which at least one of the "n" port numbers selected by NAT 331 matches at least one of the "m" port numbers selected by data processing device 312. The number of sets N2 may be the number of sets for which all of the "n" port numbers selected by NAT 331 differ from the "m" port numbers selected by data processing device 312. N2 may be determined using equation (4) below: N2=Ω1∗r−n!r−n −m!∗m!=r!r−n !∗n!∗(r−n)!r−n−m !∗m!
[0054] Thus, the probability “P” that at least one of the “n” port numbers selected by NAT 331 matches at least one of the “m” port numbers selected by data processing device 312 can be determined using equation (5) below: P=N1Ω=1−N2Ω=r!r−n!∗n!∗r−n!r−n−m!∗m!r!r−n!∗n!∗r!r−m!∗m!=1−r−n!∗r−m!(r−n−m!∗r!)
[0055] In one embodiment, the NAT 331 and the computing device 312 may select the same number of random numbers. Thus, if "n" is equal to "m," equation (5) may be rewritten as equation (6) below: P=1−(r−n!)zr−2n!∗r!
[0056] In one embodiment, the Stirling approximation may be used to calculate an approximation to "P" (e.g., to calculate an approximation of the probability of at least one port number of a first set of port numbers selected by data processing device 311 corresponding to at least one port number of a second set of port numbers selected by data processing device 312) based on equation (6). Using the Stirling approximation, equation (6) may be rewritten as equation (7) below: P=1−e2 r−n ln r−n−r ln r−r−2n ln r−2n
[0057] Consequently, equations (6) and / or equation (7) can be used to determine the probability that at least one port number of a first set of port numbers associated with a set of sockets created by the computing device 311 corresponds to at least one port number of a second set of port numbers randomly selected by the computing device 312, since each of the first port numbers and the second set of port numbers will have "n" port numbers and there are "r" total port numbers from which to select. In one embodiment, "r" can be set to the value 64511 if the computing device 311 and the computing device 312 use UDP to establish the P2P connection. This may be due to the number of available ports used by the UDP communication protocol (e.g.,65536 possible total port numbers minus 1025 reserved port numbers). If "r" is set to the value 64511, the probability "P" can be determined for different values of "n". Table 1 n 100 200 300 400 500 600 700 800 900 P 14,38 % 46,31 % 75,38 % 91,76 % 97,99 % 99,64 % 99,95 % 99,9975 % 99,9997 %
[0058] Table 1 above illustrates exemplary probabilities "P" for various values of "n." For example, if "n" is set to the value 100 and "r" to the value 64511, the probability "P" is 14.38%. In another example, if "n" is set to the value 600 and "r" to the value 64511, the probability "P" is 99.64%. Thus, the value of "n" can be chosen to obtain a threshold probability (e.g., a desired probability) of at least one matching port number between the first set of port numbers and the second set of port numbers.For example, if (referring to Table 1 above) a 99% probability (of at least one matching port number between the first set of port numbers and the second set of port numbers) is desired, the computing device 311 may generate 600 sockets, and the computing device 312 may select 600 random port numbers.
[0059] Although the above equations (1) through (7) illustrate exemplary formulas that can be used to determine the probability that at least one port number of a first set of port numbers selected by the computing device 311 corresponds to at least one port number of a second set of port numbers selected by the computing device 312 (e.g., the probability "P"), one of ordinary skill in the art will understand that other formulas, functions, and / or algorithms may be used in other embodiments. Furthermore, one of ordinary skill in the art will understand that different values of "P," "r," and "n" may be used in equations (1) through (7).
[0060] Fig. 4A is a diagram of a data storage system 400 according to one embodiment. The data storage system 400 includes a computing device 411, a computing device 412, a NAT 431, a NAT 432, and a network 405. As explained above, the computing device 411 can communicate data with the computing device 412 (and other computing devices and / or networks) via the NAT 431, and the computing device 412 can communicate data with the computing device 411 (and other computing devices and / or networks) via the NAT 432. The NAT 431 includes external interfaces 433, and the NAT 432 includes external interfaces 435. The external interfaces 433 and 435 may be referred to as ports, sockets, etc.
[0061] In one embodiment, NAT 431 is a symmetric NAT. A symmetric NAT may associate a different external interface 433 with each socket created by computing device 411. For example, computing device 411 may be associated with multiple external interfaces 433 if computing device 411 creates multiple sockets. The symmetric NAT may randomly assign port numbers for the external interfaces 433. For example, the symmetric NAT may randomly select a port number for an external interface 433 from a set of available port numbers. In another embodiment, NAT 432 is a cone NAT. For example, the cone NAT may be a full cone NAT, a restricted NAT (e.g., an address-restricted NAT), or a port-restricted NAT. A cone NAT may associate each socket created by computing device 412 with an external interface 435 (e.g.,with the same external interface). For example, the computing device 412 may map a single external interface 435 to multiple sockets created by the computing device 412.
[0062] As in Fig. 4A, computing device 411 may create a set of sockets and transmit a set of packets to computing device 412 over the set of sockets. Computing device 411 may also determine a network address associated with computing device 412. The network address associated with computing device 412 may be assigned and / or allocated by NAT 432. Computing device 411 may obtain the network address associated with computing device 412 from another computing device, such as a SIP server. Computing device 411 may transmit a set of packets to computing device 412 over the set of ports. Each of the sockets created by computing device 411 may point to an external interface 433 (e.g., a port, a socket, another communication interface, etc.).) of the NAT 431 and / or associated with it. For example, the NAT 431 may map the external interface 433 having the port number 1025 to a first socket of the set of sockets, map the external interface 433 having the port number 21335 to a second socket of the second set of sockets, map the external interface 433 having the port number 47799 to a third socket of the set of sockets, etc. The port numbers for the external interfaces 433 (e.g., ports) may be randomly selected by the NAT 431. Thus, the set of sockets is mapped to a set of external interfaces 433 having port numbers randomly selected by the NAT 431.
[0063] As in Fig. 4A, computing device 412 may also determine a network address associated with computing device 411 (e.g., it may receive an IP address associated with computing device 411 from a SIP server). The network address associated with computing device 411 may be assigned and / or assigned by NAT 431. Computing device 412 may determine a set of randomly selected port numbers (e.g., using a PRNG) and may create a socket. The socket may be associated with external interface 435, which has port number 47800. Computing device 412 may transmit a set of packets to a set of ports associated with computing device 411 via the socket and NAT 432 (e.g., via socket and external interface 435, which has port number 47800).For example, the computing device 412 may transmit a set of packets to a set of external interfaces of the NAT 431. Each external interface 433 in the set of external interfaces may have a port number from the set of randomly selected port numbers.
[0064] As explained above, NATs 431 and 432 may perform firewall functions or may act as DMZs. NAT 431 must not allow computing device 411 to receive packets transmitted from computing device 412 via an external interface 435 (of NAT 432) unless computing device 411 has previously transmitted a packet to computing device 412 via external interface 435 (of NAT 432). For example, NAT 431 must not allow computing device 411 to receive packets transmitted from computing device 412 via external interface 435 with port number 53222 unless computing device 411 has previously transmitted a packet to computing device 412 via external interface 435 with port number 53222.Furthermore, the NAT 432 must not allow the computing device 412 to receive packets transmitted from the computing device 411 via an external interface 433 (the NAT 431) if the computing device 412 has not previously transmitted a packet to the computing device 411 via the external interface 433 (the NAT 431). For example, the NAT 432 must not allow the computing device 412 to receive packets transmitted from the computing device 411 via the external interface 433 with port number 47800 if the computing device 412 has not previously transmitted a packet to the computing device 411 via the external interface 433 with port number 47800.
[0065] As explained above, the set of sockets created by the data processing device 411 is associated with a set of external interfaces 433, which in turn has a set of randomly selected port numbers. As explained above, the data processing device 412 determines a second set of randomly selected port numbers and transmits a set of packets to a second set of external interfaces 433 having port numbers from the second set of randomly selected port numbers. If at least one port number from the set of randomly selected port numbers (associated with the set of sockets created by the data processing device 411) matches at least one port number from the second set of randomly selected port numbers (determined by the data processing device 412), the data processing device 411 may be able to establish a connection (e.g.,a P2P connection) with the computing device 412 via the NAT 431 and the NAT 432. For example, if at least one port number from the first set of randomly selected port numbers matches at least one port number from the second set of randomly selected port numbers, then the computing device 411 may receive a packet from the computing device 412 via an external interface 433, from which the computing device 411 transmits a packet to the computing device 412. Because the NAT 431 has received a packet from the computing device 412 via an external interface 433, from which the computing device 411 has transmitted a packet to the computing device 412, the NAT 431 may allow the computing device 411 to receive packets from the computing device 412 and vice versa.
[0066] The number of sockets in the set of sockets created by computing device 411 and / or the number of port numbers selected by computing device 412 may be selected based on a threshold probability of at least one matching port number between the first set of randomly selected port numbers and the second set of randomly selected port numbers. For example, if (referring to Table 1 above) a 99% probability (of at least one matching port number between the first set of randomly selected port numbers and the second set of randomly selected port numbers) is desired (e.g., a threshold probability of 99% is desired), computing device 411 may create 600 sockets, and computing device 412 may select 600 random port numbers.Those of ordinary skill in the art will understand that other threshold probabilities (e.g., 75%, 90%, etc.) may be desired, and a different number of sockets and / or a different number of port numbers may be selected based on the other threshold probabilities. The threshold probability may be based on user input and / or may be based on configuration settings / parameters of computing device 411 and computing device 412.
[0067] Fig. 4B is a flowchart illustrating example packets and / or messages according to one embodiment. As explained above, a data storage system (e.g., the one described in Fig. 4A) includes a computing device 411, a computing device 412, a NAT 431, a NAT 432, and a network 405. As discussed above, computing device 411 may communicate data with computing device 412 via NAT 431, and computing device 412 may communicate data with computing device 411 via NAT 432. In one embodiment, NAT 431 is a symmetric NAT and NAT 432 is a cone NAT.
[0068] As in Fig. As illustrated in Figure 4B, the computing device 411 may create 600 sockets (e.g., a set of sockets) and may transmit 600 packets (e.g., a set of packets) across the 600 sockets and the NAT 431 (e.g., across a symmetric NAT). In one embodiment, the computing device 411 may pause for a period of time (e.g., sleep for a few milliseconds, one second, etc.) between transmitting each of the 600 packets. The set of packets includes the packets PACKET_A_1 through PACKET_A_600. The NAT 431 may map each socket to a port (e.g., an external interface) of the NAT 431. For example, NAT 431 may map the socket that transmitted PACKET_A_1 to port 10333 of NAT 431, and NAT 431 may forward PACKET_A_1 to NAT 432 and / or computing device 412 over port 10333 (as illustrated by source SRC: 10333 of PACKET_A_1).In another example, the NAT 431 may map the socket that transmitted PACKET_A_599 to port 54433 of the NAT 431, and the NAT 431 may forward PACKET_A_599 to the NAT 432 and / or the computing device 412 via port 54433 (as illustrated by the source SRC: 54433 of PACKET_A_599).
[0069] As in Fig. 4B, the computing device 412 may transmit 600 packets (e.g., a set of packets) over a socket (e.g., a single socket) and the NAT 432 (e.g., over a cone NAT) as explained above. In one embodiment, the computing device 412 may also pause a period of time (e.g., sleep for a few milliseconds, one second, etc.) between transmitting each of the 600 packets. The set of packets includes packets PACKET_B_1 through PACKET_B_600. The computing device 412 may transmit each packet to a randomly selected port of the NAT 431 as explained above. For example, PACKET_B_3 may be transmitted to port 3253 of the NAT 431 (as illustrated by destination DST: 3253 of PACKET_B_3). In another example, PACKET_B_600 can be transmitted to port 10333 of NAT 431 (as illustrated by destination DST: 10333 of PACKET_B_600).
[0070] As explained above, if at least one port number from the first set of randomly selected port numbers of the NAT 431 (associated with the 600 sockets created by the data processing device 411) matches at least one port number from the second set of randomly selected port numbers of the NAT 431 (determined by the data processing device 412), the data processing device 411 can establish a connection (e.g., a P2P connection) with the data processing device 412 via the NAT 431 and the NAT 432. As in Fig. As illustrated in Figure 4B, the socket that transmitted PACKET_A_2 is mapped to port 3253 of NAT 431, and PACKET_B_3 is transmitted from computing device 412 to port 3253 of NAT 431. Thus, the port number 3253 associated with the first set of sockets created by computing device 411 matches the port number 3253 selected by computing device 412. This may allow computing device 411 to connect to computing device 412 via NAT 431 and NAT 432.
[0071] Fig. 5 is a flowchart illustrating a process 500 for establishing a connection between computing devices, according to one embodiment. The process 500 may be performed by a controller, a processing device (e.g., a processor, a central processing unit (CPU)), and / or a computing device (e.g., a laptop, a NAS device, etc.). The controller, processing device, and / or computing device may be processing logic that includes hardware (e.g., circuitry, dedicated logic, programmable logic, microcode, etc.), software (e.g., instructions executed on a processor to perform hardware simulation), firmware, or a combination thereof.
[0072] The process 500 begins at block 505, where the process 500 determines the types of NATs used by the computing devices. For example, the process 500 may determine whether a first NAT used by a first computing device is a symmetric NAT or a cone NAT. The process 500 may also determine whether a second NAT used by a second computing device is a symmetric NAT or a cone NAT. At block 510, the process 500 determines whether to continue based on the types of NATs. If both the first NAT and the second NAT are symmetric NATs, the process 500 may end (e.g., the process 500 may refrain from determining a number of sockets, creating the set of sockets, transmitting a set of packets, etc.).If the first NAT is a symmetric NAT and the second NAT is a cone NAT, the process 500 proceeds to block 515, where the process 500 determines a number of sockets. The number of sockets may be determined based on a threshold probability (e.g., a desired probability), as discussed above. In one embodiment, the number of sockets may be received from another computing device or may be provided by a user, as discussed above.
[0073] At block 520, process 500 creates the set of sockets (e.g., it may create 600 sockets as in Fig. 4B). Each socket in the set of sockets may be associated with a port (e.g., an external interface) of the first NAT. The first NAT may select random port numbers for the set of ports associated with the set of sockets, as explained above. The process 500 may transmit a set of packets over the set of sockets and / or the first NAT (e.g., the set of ports of the first NAT associated with the set of sockets) at block 525. For example, the process 500 may transmit 600 packets over the 600 sockets, as in Fig. 4B illustrates.
[0074] At block 530, process 500 determines whether a packet has been received from a second computing device via at least one socket in the set of sockets, as discussed above. If a packet has been received via a socket of the set of sockets, the first computing device may establish a connection with the second computing device at block 535. For example, a P2P connection may be established between the first computing device and the second computing device. If no packet is received from the second computing device via the set of sockets, process 500 may determine whether to execute blocks 520, 525, and 530 again at block 540 (e.g., whether to create a second set of sockets, transmit a second set of packets, etc.).For example, process 500 may determine whether user input indicating that process 500 should re-execute blocks 520, 525, and 530 has been received. In another example, process 500 may analyze a configuration file or configuration setting to determine whether blocks 520, 525, and 530 should be re-executed (e.g., the configuration file may specify that process 500 should execute blocks 520, 525, and 530 a certain number of times). If blocks 520, 525, and 530 should be re-executed, process 500 may proceed to block 520. If blocks 520, 525, and 530 should not be re-executed, process 500 may end.
[0075] Fig. 6 is a flowchart illustrating a process 600 for establishing a connection between computing devices, according to one embodiment. Process 600 may be performed by a controller, a processing device (e.g., a processor, a central processing unit (CPU)), and / or a computing device (e.g., a laptop, a NAS device, etc.). The controller, processing device, and / or computing device may be processing logic that includes hardware (e.g., circuitry, dedicated logic, programmable logic, microcode, etc.), software (e.g., instructions executed on a processor to perform hardware simulation), firmware, or a combination thereof.
[0076] The process 600 begins at block 605, where the process 600 determines the types of NATs used by the computing devices. For example, the process 600 may determine whether a first NAT used by a first computing device is a symmetric NAT or a cone NAT. The process 600 may also determine whether a second NAT used by a second computing device is a symmetric NAT or a cone NAT. At block 610, the process 600 determines whether to continue based on the types of NATs. If both the first NAT and the second NAT are symmetric NATs, the process 600 may end (e.g., the process 600 may refrain from determining a network address, creating a socket, determining a set of port numbers, etc.).If the first NAT is a cone NAT and the second NAT is a symmetric NAT, the process 600 proceeds to block 615, where the process 600 determines a network address (e.g., an IP address) associated with the second computing device. At block 620, the process 600 creates a socket that can be used to transmit packets to the second computing device.
[0077] The process 600 may determine a set of randomly selected port numbers at block 625. The number of port numbers in the set of randomly selected port numbers may be determined based on a desired probability (e.g., a threshold probability), as explained above. In one embodiment, the number of port numbers may be received from another computing device or may be provided by a user, as explained above. In block 630, the process 600 transmits a set of packets to the second computing device. For example, the process 600 may transmit packets over the socket 600, as in Fig. 4B illustrates.
[0078] At block 635, process 600 determines whether a packet has been received from a second computing device from a port of the set of randomly selected port numbers, as discussed above. If a packet has been received via a port of the set of randomly selected port numbers, the first computing device may establish a connection with the second computing device at block 640. For example, a P2P connection may be established between the first computing device and the second computing device. If no packet is received via a port of the set of randomly selected port numbers, process 600 may determine whether to perform blocks 625, 630, and 635 again at block 645 (e.g., whether to determine a second set of port numbers, whether to transmit a second set of packets, etc.).For example, process 600 may determine whether user input has been received indicating that process 600 should re-execute blocks 625, 630, and 635. In another example, process 600 may analyze a configuration file or configuration setting to determine whether blocks 625, 630, and 635 should be re-executed (e.g., the configuration file may specify that process 600 should execute blocks 625, 630, and 635 a certain number of times). If blocks 625, 630, and 635 should be re-executed, process 600 may proceed to block 625. If blocks 625, 630, and 635 should not be re-executed, process 600 may end. Additional embodiments
[0079] Those skilled in the art will recognize that, in some embodiments, other types of distributed data storage systems may be implemented while maintaining the scope of the present disclosure. Furthermore, the actual steps performed in the processes discussed herein may differ from those described or shown in the figures. Depending on the embodiment, certain of the steps described above may be removed, and others may be added.
[0080] Although specific embodiments have been described, these embodiments have been presented only by way of example and are not intended to limit the scope of protection. Indeed, the novel methods and systems described herein may be embodied in a variety of other forms. Furthermore, various omissions, substitutions, and changes may be made in the form of the methods and systems described herein. The appended claims and their equivalents are intended to cover such forms or modifications that would fall within the scope and spirit of the protection. For example, the various components illustrated in the figures may be implemented as software and / or firmware on a processor, ASIC / FPGA, or dedicated hardware.Furthermore, the features and attributes of the specific embodiments disclosed above may be combined in various ways to form additional embodiments, all of which fall within the scope of the present disclosure. While the present disclosure provides certain preferred embodiments and applications, other embodiments that would be obvious to those skilled in the art, including embodiments that do not provide all of the features and advantages set forth herein, are also within the scope of this disclosure. Accordingly, the scope of the present disclosure is to be defined only by reference to the appended claims.
[0081] The words "example" or "exemplary" are used herein to mean that they serve as an example, instance, or illustration. Any aspect or embodiment described herein as an "example" or "exemplary" is not necessarily to be construed as preferred or advantageous over other aspects or embodiments. Rather, the use of the words "example" or "exemplary" is intended to specifically illustrate concepts. As used in this disclosure, the term "or" is intended to mean an inclusive "or" and not an exclusive "or." That is, unless otherwise stated or evident from context, "X includes A or B" is intended to mean one of the naturally inclusive permutations. That is, if XA includes; XB includes; or X includes both A and B, then "X includes A or B" is satisfied under one of the foregoing instances.Furthermore, as used in this disclosure and the appended claims, the articles "a" and "an" are generally to be interpreted to mean "one or more" unless otherwise specified or obvious from the context that they refer to a singular form. Furthermore, the use of the term "an embodiment" or "a (single) embodiment" or "an implementation" or "a (single) implementation" throughout is not intended to refer to the same embodiment or implementation unless described as such. Furthermore, the terms "first", "second", "third", "fourth", etc., as used herein are intended as labels to distinguish between different elements and do not necessarily have the ordinal meaning according to their numerical designation.
[0082] All of the processes described above may be embodied in, and fully automated via, software code modules executed by one or more general-purpose or special-purpose computers or processors. The code modules may be stored on any type of computer-readable medium or other computer storage device or collection of storage devices. Alternatively, some or all of the methods may be embodied in special-purpose computer hardware.
Claims
[1] Device (220) comprising: a network interface (243) configured to communicate data with a first network address translation (NAT); and a controller coupled to the network interface (243), the controller (230) configured to: Determining a number of ports required to achieve a desired probability that a first set of randomly selected port numbers has at least one matching port number with a second set of randomly selected port numbers, the desired probability being at least 90%; Creating a set of sockets, the set of sockets being associated with a first set of ports of the first NAT, the first set of ports corresponding to the determined number of ports, and the first set of ports comprising at least 100 port numbers randomly selected by the first NAT; transmitting a set of packets to a data processing device (213) via the set of sockets and the first set of ports; Waiting to receive a first packet from the computing device (213) on the set of sockets, the computing device (213) being configured to transmit to a second set of at least 100 randomly selected port numbers associated with the device (220); Determining whether the first packet was received by the data processing device (213) via a first socket of the set of sockets; and Establishing a connection to the data processing device (213) via the first socket when the first packet has been received. [2] The device according to claim 1, wherein the data processing device (213) communicates data via a second NAT, preferably the first NAT comprises a symmetric NAT and wherein the second NAT comprises a cone NAT or . wherein the controller (230) is further configured to: Determining that the first NAT comprises a first symmetric NAT; Determining that the second NAT comprises a second symmetric NAT; and Refraining from creating the set of sockets, transmitting the set of packets, determining whether the packet was received, and establishing the connection to the data processing device (213). [3] The apparatus of claim 1, wherein the controller (230) is further configured to: Creating a second set of sockets if no packets have been received from the computing device (213) via the set of sockets, the second set of sockets being associated with a third set of ports of the first NAT, and the third set of ports comprising port numbers randomly selected by the first NAT; transmitting a second set of packets to the data processing device (213) via the second set of sockets and the third set of ports; Determining whether a second packet was received from the data processing device (213) via a second socket in the second set of sockets; and Establishing the connection to the data processing device (213) via the second socket when the second packet has been received. [4] The apparatus of claim 1, wherein the controller (230) is further configured to determine a number of sockets in the set of sockets, preferably wherein the number of sockets is further selected based on a first number of ports used by the first NAT. [5] Device (220) comprising: a network interface (243) configured to communicate data with a first network address translation (NAT); and a controller (230) coupled to the network interface (243), the controller (230) configured to: Determining a network address associated with a data processing device (213); Determining a number of ports required to achieve a desired probability that a first set of randomly selected port numbers has at least one matching port number with a second set of randomly selected port numbers, the desired probability being at least 90%; Determining a first set of randomly selected port numbers based on the determined number of ports, wherein the first set of randomly selected port numbers comprises at least 100 port numbers; Transmitting a set of packets over a first socket and the first NAT to a set of ports that the data processing device (213), wherein each port in the set of ports comprises the network address and a port number from the first set of randomly selected port numbers; Waiting to receive a first packet from the computing device (213) on the set of ports, the computing device (213) being configured to transmit to a second set of at least 100 randomly selected port numbers selected by a second NAT; Determining whether the first packet was received by the data processing device (213) via a first port of the set of ports; and Establishing a connection to the data processing device (213) via the first socket when the first packet has been received. [6] The device (220) of claim 5, wherein the second set of at least 100 randomly selected port numbers is assigned to the data processing device (213) and wherein the data processing device (213) communicates data via the second NAT, preferably the first NAT comprises a cone NAT and the second NAT comprises a symmetric NAT, or the controller (230) is further configured to: Determining that the first NAT comprises a first symmetric NAT; Determining that the second NAT comprises a second symmetric NAT; and Disregarding determining the network address, determining the first set of randomly selected port numbers, transmitting the set of packets, determining whether a first packet has been received and establishing the connection to the data processing device (213). [7] The device (220) of claim 5, wherein the controller (230) is further configured to: Determining a third set of randomly selected port numbers; transmitting a second set of packets to a second set of ports associated with the computing device (213) via the first socket and the first NAT, each port in the second set of ports comprising the network address and a port number from the third set of randomly selected port numbers; Determining whether a second packet was received from a second port of the second set of ports; and Establishing a connection to the data processing device (213) via the first socket when the second packet has been received. [8] The device (220) of claim 5, wherein the controller (230) is further configured to: Creating the first socket. [9] The device (220) of any of claims 1-8, wherein the number of ports is determined using the following formula: P=1−e2(r−n)ln(r−n)−r ln(r)−(r−2n)ln(r−2n), where: P = the desired probability, n = the number of ports, and r = total number of selectable port numbers. [10] System (400), comprising: a first data processing device (411) and a second data processing device (412), wherein the first data processing device (411) comprises: a first controller configured to: Determining a number of ports required to achieve a desired probability that a first set of randomly selected port numbers has at least one matching port number with a second set of randomly selected port numbers, the desired probability being at least 90%; Transmitting a first set of packets to the second computing device (412) via a first set of sockets and a first network address translation (NAT) (431), wherein the first set of sockets is associated with a first set of ports of the first NAT (431), and wherein the first set of ports comprises port numbers randomly selected by the first NAT (431) based on the determined number of ports; Determining whether a first packet was received from the second computing device (412) via a first socket from the first set of sockets; and Establishing a connection to the second data processing device (412) via the first socket when the first packet has been received; and wherein the second data processing device (412) comprises: a second controller configured to: transmitting a second set of packets to a second set of ports associated with the first computing device (411) over a second NAT (432), each port in the second set of ports comprising a network address associated with the first computing device (411) and a port number from a set of randomly selected port numbers; Determining whether a second packet was received from a second port of the second set of ports; and Establishing a connection to the first data processing device (411) via the second port when the second packet has been received. [11] The system (400) of claim 10, wherein the first controller is further configured to: Determining a number of sockets in the first set of sockets. [12] The system (400) of claim 10, wherein the first NAT (431) comprises a symmetric NAT and wherein the second NAT (432) comprises a cone NAT. [13] System (400) according to any one of claims 10-12, wherein the number of ports is determined using the following formula: P=1−e2(r−n)ln(r−n)−r ln(r)−(r−2n)ln(r−2n), where: P = the desired probability, n = the number of ports, and r = total number of selectable port numbers. [14] A method for communicating a first device (411) behind a first network address translation (NAT) (431) with a second device (412), the method comprising: Determining a number of ports required to achieve a desired probability that a first set of randomly selected port numbers has at least one matching port number with a second set of randomly selected port numbers, the desired probability being at least 90%; Creating a first set of sockets associated with a first set of ports of the first NAT (431), the first set of ports corresponding to the determined number of ports, and the first set of ports comprising at least 100 port numbers randomly selected by the first NAT (342); transmitting a set of packets to the second device (412) over the first set of sockets; Waiting to receive on the first device (411) a first packet from the second device (412) on the first set of sockets, the second device (412) being configured to transmit using at least another 100 randomly selected port numbers; Determining whether the first packet was received by the second device (412) via a first socket of the first set of sockets; and Establishing a connection from the first device (411) to the second device (412) via the first socket when the first packet has been received. [15] The method of claim 14, wherein the second device (412) communicates data via a second NAT (432), preferably the method further comprises determining that the first NAT (431) and the second NAT (432) are each not a symmetric NAT, or the first NAT (431) comprises a symmetric NAT and the second NAT (432) comprises a cone NAT. [16] The method of claim 14, further comprising: Creating a second set of sockets if no packets were received from the second device (412) via the first set of sockets, the second set of sockets being associated with a third set of ports of the first NAT (431), and the third set of ports comprising port numbers randomly selected by the first NAT (431); transmitting a second set of packets to the second device (412) via the second set of sockets and the third set of ports; Determining whether a second packet was received from the second device (432) via a second socket in the second set of sockets; and Establishing the connection to the second device (432) via the second socket when the second packet has been received. [17] A method for communicating data through a first network address translation (NAT), the method comprising: Determining a network address associated with a data processing device (213); Determining a number of ports required to achieve a desired probability that a first set of randomly selected port numbers has at least one matching port number with a second set of randomly selected port numbers, the desired probability being at least 90%; Determining a first set of randomly selected port numbers based on the determined number of ports, wherein the first set of randomly selected port numbers comprises at least 100 port numbers; transmitting a set of packets over a first socket and the first NAT to a set of ports associated with the computing device (4213), each port in the set of ports comprising the network address and a port number from the first set of randomly selected port numbers; Waiting to receive a first packet from the computing device (213) on the set of ports, the computing device (213) being configured to transmit to a second set of at least 100 randomly selected port numbers selected by a second NAT; Determining whether the first packet was received by the computing device (213) via a first port of the set of ports; and establishing a connection to the computing device (213) via the first socket if the first packet was received. [18] The method of claim 17, wherein the second set of at least 100 randomly selected port numbers is assigned to the data processing device (213) and wherein the data processing device (213) communicates data via the second NAT, preferably the first NAT comprises a cone NAT and the second NAT comprises a symmetric NAT, or the method further comprises determining that the first NAT and the second NAT are each not a symmetric NAT. [19] The method of claim 17, further comprising: Determining a third set of randomly selected port numbers; transmitting a second set of packets to a second set of ports associated with the computing device (213) via the first socket and the first NAT, each port in the second set of ports comprising the network address and a port number from the third set of randomly selected port numbers; Determining whether a second packet has been received from a second port of the second set of ports; and Establishing a connection to the data processing device (213) via the first socket when the second packet has been received. [20] A method for communicating data through a first network address translation (NAT) (431) and a second NAT (432), the method comprising: Determining a number of ports required to achieve a desired probability that a first set of randomly selected port numbers has at least one matching port number with a second set of randomly selected port numbers, the desired probability being at least 90%; Transmitting a first set of packets from a first computing device (411) behind the first NAT (431) to a second computing device (412) behind the second NAT (432) via a first set of sockets, wherein the first set of sockets is associated with a first set of ports of the first NAT (431), and wherein the first set of ports comprises port numbers randomly selected by the first NAT (431) based on the determined number of ports; Determining whether a first packet was received from the second computing device (412) via a first socket from the first set of sockets; Establishing a connection to the second data processing device (412) via the first socket when the first packet has been received; and Transmitting, from the second computing device (432) behind the second NAT (432), a second set of packets to a second set of ports associated with the first computing device (411), each port in the second set of ports comprising a network address associated with the first computing device (411) and a port number from a set of randomly selected port numbers; Determining whether a second packet was received from a second port of the second set of ports; and Establishing a connection to the first data processing device (411) via the second port when the second packet has been received. [21] The method of claim 20, further comprising determining that the first NAT (341) and the second NAT (432) are each not a symmetric NAT. [22] A method according to any one of claims 14-21, wherein the number of ports is determined using the following formula: P=1−e2(r−n)ln(r−n)−r ln(r)−(r−2n)ln(r−2n), where: P = the desired probability, n = the number of ports, and r = total number of selectable port numbers.
Citation Information
Patent Citations
Multiplayer peer-to-peer connection across firewalls and network address translators using a single local port on the local host
US20060075127A1
Network Address Translation Traversals for Peer-to-Peer Networks
US20090006648A1