CLAIM OF PRIORITYThis application is a continuation reissue of and U.S. Pat. No. 8,565,190, which claims priority to U.S. patent application Ser. No. 11/829,831 filed Jul. 27, 2007, now U.S. Pat. No. 7,933,273, the entire contents of which are incorporated herein by reference.
FIELD OF THE INVENTIONThe present invention relates to computer network communication, and more specifically to prioritizing network traffic among distinct channels of communication within a single application.
BACKGROUND OF THE INVENTIONComputing systems are becoming increasing interconnected through network environments. Such network environments may be centralized or decentralized. A decentralized computing environment may be defined by a number of computing systems interconnected to communicate with one another, wherein each computing system can perform both client and server functions. A peer-to-peer (P2P) network represents an example of a decentralized computing environment in which each computing system within the P2P network is defined as a peer of every other computing system within the network. For discussion purposes, each peer computing system within the P2P network is referred to as a node. Additionally, each node within the P2P network may be configured to execute software having substantially equivalent functionality. Therefore, each node may act as both a provider and a user of data and services across the P2P network. Peer to peer networks are distributed data networks without any centralized hierarchy or organization. Peer to peer data networks provide a robust and flexible means of communicating information between large numbers of computers or other information devices, referred to in general as nodes.
A P2P network relies primarily on the computing power and bandwidth of the participants in the network rather than concentrating it in a relatively low number of servers. P2P networks are typically used for connecting nodes via largely ad hoc connections. Such networks are useful for many purposes. P2P networks may be used, e.g., for sharing content files containing audio, video, data or anything in digital format is very common, and real-time data, such as telephony traffic, may also be transmitted using P2P technology. P2P applications often involve the use of a network address translator (NAT) to facilitate direct communication between peers. The NAT allows a user typically to have multiple networked computers share a single (global or routable) IP address for to access the Internet. The NAT intervenes in direct communication, so in many cases, P2P applications have to deal with the connectivity issues due to the NAT. Techniques used to overcome the connectivity issues are often called “NAT Traversal”. The process of Network Address Translation (NAT, also known as Network Masquerading, Native Address Translation or IP Masquerading) generally involves re-writing the source and/or destination addresses of Internet Protocol (IP) packets as they pass through a Router or firewall. Most systems using a NAT do so in order to enable multiple hosts on a private network to access a wide area network, such as the Internet using a single public IP address.
In addition to the convenience and low cost of NAT, the lack of full bidirectional connectivity can be regarded in some situations as a feature rather than a limitation. To the extent that NAT depends on a machine on the local network to initiate any connection to hosts on the other side of the router, it prevents malicious activity initiated by outside hosts from reaching those local hosts. This can enhance the reliability of local systems by stopping worms and enhance privacy by discouraging scans. Many NAT-enabled firewalls use this as the core of the protection they provide. Many network administrators find NAT a convenient technique and use it widely. Nonetheless, NAT can introduce complications in communication between hosts and may have a performance impact.
In a typical configuration, a local network may use one of the designated “private” IP address subnets and a router on that network has a private address in that address space. The router may be connected to the Internet with a single “public” address (known as “overloaded” NAT) or multiple “public” addresses assigned by an Internet Service Provider (ISP). As traffic passes from the local network to the Internet, the source address in each packet is translated on the fly from the private addresses to the public address(es). The router tracks basic data about each active connection (particularly the destination address and port). This internal “tracking” data is sometimes referred to as “NAT binding”. When a reply returns to the router, it uses the connection tracking data it stored during the outbound phase to determine where on the internal network to forward the reply; the TCP or UDP client port numbers are used to demultiplex the packets in the case of overloaded NAT, or IP address and port number when multiple public addresses are available, on packet return. To a system on the Internet, the router itself appears to be the source/destination for this traffic. Nodes behind NAT-enabled routers do not have true end-to-end connectivity (i.e., cannot send packets to all other nodes of the network, without requiring intermediate network elements to further interpret them) and cannot participate in some Internet protocols. Services that require the initiation of TCP connections from the outside network, or stateless protocols such as those using UDP, may be disrupted for such nodes unless the NAT router makes a specific effort to support such protocols, incoming packets cannot reach their destination. Some protocols can accommodate one instance of NAT between participating hosts (“passive mode” FTP, for example), sometimes with the assistance of an Application Layer Gateway, but fail when both systems are separated from the Internet by NAT. Use of a NAT may also complicate tunneling protocols such as Ipsec, e.g., if the NAT modifies values in the headers in a way that interferes with the integrity checks done such tunneling protocols.
Any IP enabled application that wants to connect to a network potentially faces problems associated with NAT. Most network applications and devices running dedicated network application software, especially peer-to-peer style applications, may be configured to independently determine the physical network topology they are on in order to best establish direct communications with other applications. This is commonly known as “NAT behavior discovery” or “NAT behavior determination”. This operation is well known in the industry, although some varying approaches exist. Existing approaches may often take a significant amount of time to determine NAT behavior. Existing NAT discovery techniques may also be problematic if multiple applications must do NAT discovery.
It is within this context that embodiments of the present invention arise.
BRIEF DESCRIPTION OF THE DRAWINGSEmbodiments of the present invention may be readily understood by considering the following detailed description in conjunction with the accompanying drawings, in which
FIG. 1 is a block diagram of a network configured to implement NAT behavior discovery according to an embodiment of the present invention.
FIG. 2A is a flow diagram illustrating a prior art method of determining NAT behavior.
FIGS. 2B-2D are flow diagrams illustrating methods of determining NAT behavior according to embodiments of the present invention.
FIG. 3A is a block diagram of a network configured to implement NAT behavior discovery using NAT proxies according to an alternative embodiment of the present invention.
FIG. 3B is a flow diagram illustrating a method of NAT behavior discovery using NAT proxies according to an alternative embodiment of the present invention.
FIG. 4 is a block diagram illustrating NAT behavior discovery according to an embodiment of the present invention involving a node behind multiple NATs.
FIG. 5 is a block diagram illustrating a NAT behavior discovery according to an embodiment of the present invention involving a wireless node.
FIG. 6 is a block diagram of a node configured to implement NAT behavior discovery according to an embodiment of the present invention.
DESCRIPTION OF THE SPECIFIC EMBODIMENTSAlthough the following detailed description contains many specific details for the purposes of illustration, anyone of ordinary skill in the art will appreciate that many variations and alterations to the following details are within the scope of the invention. Accordingly, the exemplary embodiments of the invention described below are set forth without any loss of generality to, and without imposing limitations upon, the claimed invention.
TECHNICAL BACKGROUNDIn applications that deal with NAT it is sometimes useful to characterize the NAT by the type of behavior that it exhibits. The STUN protocol may be used to characterize Network address translation as Full cone NAT, restricted cone NAT, port restricted cone NAT or symmetric NAT. With a full cone NAT, also known as one-to-one NAT, all requests from the same internal IP address and port are mapped to the same external IP address and port. An external host can send a packet to the internal host, by sending a packet to the mapped external address. With a restricted cone NAT, all requests from the same internal IP address and port are mapped to the same external IP address and port. Unlike a full cone NAT, an external host can send a packet to the internal host only if the internal host had previously sent a packet to it. A port restricted cone NAT or symmetric NAT is like a restricted cone NAT, but the restriction includes port numbers. Specifically, an external host may send a packet to a particular port on the internal host only if the internal host had previously sent a packet from that port to the external host. With a symmetric NAT all requests from the same internal IP address and port to a specific destination IP address and port are mapped to a unique external source IP address and port. If the same internal host sends a packet with the same source address and port to a different destination, a different mapping is used. Only an external host that receives a packet can send a Universal Datagram Protocol (UDP) packet back to the internal host.
The above-described classifications have become somewhat less useful, because in many NAT implementations the behavior of the NAT may oscillate between the various types. For example, many NAT implementations may follow a port preservation design. For most communications, such a NAT implementation uses the same values as internal and external port numbers. However, if two internal hosts attempt to communicate with the same external host using the same port number, the external port number used by the second host may be chosen at random. Such a NAT may be sometimes perceived as a restricted cone NAT and may be perceived at other times as a symmetric NAT.
NAT discovery and NAT behavior determination are sometimes referred to as NAT traversal. Examples of NAT traversal are described e.g., in U.S. Published Patent Application 20070076729, which is incorporated herein by reference. NAT behavior discovery may be a time-consuming operation. For example, NAT discovery may be implemented using a protocol referred to as STUN. Details of the STUN protocol are described, e.g., in IETF RFC 3489, which is incorporated herein by reference. In the STUN protocol, multiple messages are sent are sent to a central NAT discovery server (referred to as a STUN server) and received to establish NAT behavior type. Some message transactions may have to wait for timeout (typically about 10 seconds for each transaction) due to filtering behavior of NAT. Messages are also possibly resent in the presence of unreliable communication channels. Applications that can avoid all or some of this operation may start faster.
Cooperative NAT Behavior Discovery
In embodiments of the present invention nodes on a local network may share information about discovered NAT behavior and other aspects of the local physical network topology. Additionally, these nodes may actively cooperate to further determine NAT behavior rather than passively sharing NAT behavior discovered independently. This is important since NAT discovery can be time-consuming, as discussed above. Furthermore, there are non-trivial issues that occur when trying to use NAT devices that have varying behavior when used by more than one application. This may occur, for example, when static port mapping is configured for a particular local port.
According to embodiments of the present invention, multiple nodes may be behind the same NAT. One of the nodes may discover the properties of the NAT through conventional NAT discovery and/or NAT traversal. This node may share the NAT traversal information with the others that are behind the same NAT. This may allow the other nodes behind the NAT to avoid having to spend time performing NAT discovery. The NAT information may be stored in a central location that all the nodes behind the NAT may access before they would normally attempt NAT discovery.
By way of example,FIG. 1 depicts a network topology illustrating cooperative NAT behavior discovery according to an embodiment of the present invention. Generally, a local area network (LAN)101 may include two or more nodes, e.g.,Node A102 andNode B104, may be connected to arouter108. Therouter108 connects to a wide area network (WAN)106 such as the Internet. Therouter108 may have a network address translator (NAT) associated with it. There are many possible configurations for thenodes102,104 that are within the scope of embodiments of the invention. In general, a node may be configured to implement communication over a network using internet protocol (IP).Node A102 andNode B104 may be IP-enabled devices or IP-enabled applications running on different devices or the same device. As used herein, the term IP-enabled, means that a devices makes use of IP to communicate with other hosts or devices. By way of example, and with out limitation, an IP-enabled device or application may include an internet protocol stack or similar network protocol stack to make use of IP to communicate with other hosts or devices. Although two nodes are shown inFIG. 1 for the sake of example, those of skill in the art will recognize that embodiments of the invention may also be implemented with more than two nodes.
It is noted that embodiments of the invention may incorporate any number of nodes. By way of example,Node A102 andNode B104 may be any network capable device or network capable applications running on such devices. Such nodes include, but are not limited to computers, hand held internet browsers and/or email devices, Voice over Internet Protocol (VoIP) phones, video game consoles, hand held video game devices, and the like. Messages may travel from one node to another over via therouter108. The NAT may be implemented on therouter108 in hardware, software, firmware or some combination of two or more of these.
Node A102,Node B104 and therouter108 may be configured to communicate with each other according to a network protocol. By way of example,Node A102, andNode B104 may be configured (either in software or hardware or some combination of both) with anetwork protocol stack103 having five layers: an Application layer APP, a Transport layer TRANS, a Network layer NET (sometimes referred to as the IP layer), a Data Link Layer DLL and a Physical layer PHYS. These layers are well-known to those of skill in the art. Thenodes102,104 typically implement all five layers. Therouter108 may include aprotocol stack105 that implements only the Network layer NET, Data Link layer DLL and Physical layer PHYS. In some embodiments, one or more routers may include all five protocol stack layers. One example of such routers is firewalls that support “application layer gateway” which inspects application layer data. The illustrated configuration of theprotocol stack105 in therouter108 is relatively more common, however.
The Application layer APP represents the level at which applications access network services. This layer represents the services that directly support applications such as software for file transfers, database access, and electronic mail. Examples of application layer software include HL7, Mod-bus, Session Initiation Protocol (SIP), and Simple Sensor Interface Protocol (SSI). In the particular case of the TCP/IP suite, the Application layer APP may be implemented with software protocols such as Hypertext Transfer Protocol (HTTP), Session Initiation Protocol (SIP), Simple Mail Transfer Protocol (SMTP), Short Message Peer-to-Peer Protocol (SMPP), Simple Network Management Protocol (SNMP), File Transfer Protocol (FTP), Teletype Network (TELNET), Network File System (NFS), Network Time Protocol (NTP), Real-time Transport Protocol (RTP), Dynamic Host Configuration Protocol (DHCP), and Domain Name System (DNS). The Application layer APP may sometimes be divided further into a Presentation layer and a Session layer, e.g., in the Open Systems Interface (OSI) protocol. The Presentation layer translates data from the Application layer into an intermediary format. The Presentation layer may also manages security issues by providing services such as data encryption, and compresses data so that fewer bits need to be transferred on the network. The Session layer allows two applications on different computers to establish, use, and end a session. The Session layer may establish dialog control between the two computers in a session, regulating which side transmits, plus when and how long it transmits.
The transport layer TRANS services requests from the Application layer APP and issues service requests to the Network layer NET. In some protocols the Transport layer TRANS may also handle error recognition and recovery. For a transmitting host, the Transport layer may also repackage long messages when necessary into small packets for transmission. For a receiving host the Transport layer rebuilds packets into the original message. The Transport layer for a receiving host may also send receipt acknowledgments. Examples of particular Transport layer protocols include Transmission Control Protocol (TCP), User Datagram Protocol (UDP) and Stream Control Transmission Protocol (SCTP), all of which, and equivalents thereof, are well-known to those of skill in the art. The Transport layer TRANS is the layer that typically supports packet fragmentation. It is noted that fragmentation may take place in the Transport layer of the host originating a message or at the Transport layer of any of the routers along the path between that host and the message's intended recipient. Not all transport layer implementations necessarily handle error recognition and recovery. TCP, for example, does handle error recognition and recovery, but UDP does not.
The Network layer NET addresses messages and translates logical addresses and names into physical addresses. It also determines the route from the source to the destination computer. The Network layer may also manages traffic problems, such as switching, routing, and controlling the congestion of data packets. Examples of particular Network layer protocols include, but are not limited to, Internet Protocol (IP), Internet Control Message Protocol (ICMP), IP Security (Ipsec), Address Resolution Protocol (ARP), Routing Information Protocol (RIP) and Open Shortest Path First (OSPF) all of which, and equivalents thereof, are well-known to those of skill in the art
The Data Link layer DLL packages raw bits from the Physical layer PHYS into frames (logical, structured packets for data). The Data Link layer may also be responsible for transferring frames from one computer to another, without errors. After sending a frame, the Data Link layer DLL waits for an acknowledgment from the receiving computer. Examples of particular Data Link layer protocols include, but are not limited to, Point-to-Point Protocol (PPP), Serial Line Internet Protocol (SLIP) and Media Access Control (MAC) all of which, and equivalents thereof, are well-known to those of skill in the art. The Data Link layer DLL typically limits the MTU size.
The Physical layer PHYS transmits bits from one computer to another and regulates the transmission of a stream of bits over a physical medium. This layer defines how the cable is attached to the network adapter and what transmission technique is used to send data over the cable. Examples of particular Physical layer protocols and standards include, but are not limited to, RS-232, V.35, V.34, I.430, I.431, T1, E1, 10BASE-T, 100BASE-TX, POTS, SONET, DSL, 802.11a, 802.11b, 802.11g, 802.11n all of which, and equivalents thereof, are well-known to those of skill in the art
A message originating atNode A102 starts at the Application layer APP and works its way down the protocol stack to the Physical layer PHYS. When the message arrives atNode B104, it is received at the Physical layer PHYS and works its way up the stack to the Application layer APP. In the path between the twonodes102,104, the message may be received at the Physical layer PHYS ofrouter108 and work its way up to the Transport layer TRANS and then back down the stack to the Physical layer PHYS for transmission torouter108. The process may be repeated for any additional routers (not shown) along the path betweenNode A102 andNode B104. In peer-to-peer situations, once a connection has been established between theNode A102 andNode B104 they may communicate directly by peer-to-peer connections, e.g., at the Application layer APP or at the Transport layer TRANS.
As discussed above, therouter108 may include a network address translator. However, this is not necessary for all embodiments of the invention. If therouter108 includes a NAT,Node A102 andNode B104 may have to traverse the NAT in order to establish peer-to-peer connections with each other, with other node connected in theLAN101 or with other nodes connected to theWAN106. To facilitate NAT traversal,Node A102 andNode B104 may obtain and shareinformation110 regarding the NAT. There are a number of ways in which theinformation110 may be obtained and shared. By way of example, and without loss of generality,Node A102 andNode B104 may obtain theinformation110 through individual attempts at NAT traversal. Such attempts at NAT traversal may involve the use of aSTUN server112. Alternatively,Node A102 andNode B104 may obtain theinformation110 from other Nodes connected to theLAN101.
Theinformation110 may be shared in any of a number of different ways. For example,Node A102 andNode B104 may store the information locally, e.g., in a cache or other memory location. WhereNode A102 andNode104 are separate devices or applications on separate devices, storing information locally may include, among other things, storing the information in particular memory locations at each corresponding device. If Node A and Node B are different applications on the same device, storing the information locally may include, among other things, storing the information in particular memory locations associated with the device. If theinformation110 is stored locally, Node A and Node B may query each other directly prior to their respective attempts at NAT traversal to obtain theinformation110. In alternative embodiments, theinformation110 may be stored in a memory location that is commonly accessible to bothNode A102 andNode B104. Such a commonly accessible memory location may be on another node or device connected to theLAN101 or theWAN106. By way of example, the commonly accessible memory location may be acommon database server114 connected to theWAN106. In some embodiments, theinformation110 may be obtained by and stored at therouter108. This may require special implementation at therouter108.
By way of example, theinformation110 may include a unique address for the router, e.g., a globally unique address such as a Media Access Control (MAC) address or internal IP address. As used herein, a MAC address, also known as a hardware address or adapter address is a quasi-unique identifier attached to most network adapters. A MAC address is typically a number that acts like a name for a particular network adapter. Thus, for example, network cards (or built-in network adapters) in two different computers could have different names, or MAC addresses, as could an Ethernet adapter and a wireless adapter in the same computer, and as could multiple network cards in a router. The MAC address may be assigned according to a suitable protocol such as MAC-48, EUI-48, and EUI-64, which are designed to be globally unique.
In addition, theinformation110 may include information regarding the type of NAT behavior, if any, exhibited by therouter108, and/or whether any ports on the router are being used by devices connected to theLAN101.
Examples of other NAT behavior information that may be shared includes, but is not limited to (i) the number of active sessions via the NAT; or (ii) the collective traffic load on the NAT. Furthermore theinformation110 may include a value of a flag realizing atomicity of port prediction against symmetric NAT. The flag may indicate whether a particular atomic for port prediction is locked or unlocked. An atomic lock is sometimes used for port prediction in symmetric NAT traversal. The locking is useful since port prediction may fail if other nodes under the same NAT create another NAT binding during the prediction phase.
According to embodiments of theinvention Node A102 andNode B104 may implement NAT discovery by any conventional technique, which may be implemented in hardware, software, firmware or some combination of two or more of these. By way of example,FIG. 2A depicts one type of NAT discovery. As shown inFIG. 2A,Node A102 may, at astartup202, send arequest204 for NAT information to theSTUN server112, which may send back aresponse206. Theresponse206 may include information regarding the type of NAT thatNode A102 is behind. At a later time,Node B104, at astartup208, may similarly send arequest210 and receiveresponse212. It is noted that theresponses206,212 may each include the same or similar information regarding the NAT behavior, particularly if bothNode A102 andNode B104 are behind the same NAT. However, depending on the nature of the NAT in therouter108, the NAT behavior may change over time. Embodiments of the invention allow sharing of NAT behavior information which can facilitate NAT traversal.
By way of example, as shown inFIG. 2B,Node A102 andNode B104 may shareNAT information110 as follows. As inFIG. 2A,Node A102 may, at astartup202, send arequest204 for NAT information to theSTUN server112, which may send back aresponse206. Theresponse206 may includeinformation110 regarding the type of NAT thatNode A102 is behind. Theinformation110 may be stored locally atNode A102. At a later time,Node B104, at astartup208, may send arequest209 to one or more other nodes behind therouter108. For example, as shown inFIG. 2B,Node B104 may send therequest209 toNode A102. It is noted that therequest209 may be broadcast to all other nodes behind therouter108 sinceNode B104 may not know which of them may have information regarding the NAT behavior of the router. Any of the nodes that receive therequest209 may respond with NAT behavior information. In this example,Node A102 had previously obtainedinformation110. Therefore,Node A102 may send aresponse211 toNode B104 containing theinformation110 or some useful subset of that information. If none of the other nodes responds to therequest209,Node B104 may fall back to conventional NAT discovery, e.g., by sending arequest210 to theSTUN server212 and receiving aresponse212. Information obtained from the response may be stored locally and made available to other nodes upon request.
It is further noted that two or more nodes may cooperate to determine behavior of therouter108. For example, as shown inFIG.2C Node A102 may, at astartup202, send the STUN server112 arequest204 for NAT information. TheSTUN server112 may send back aresponse206 containingNAT behavior information110, which may then be stored locally atNode A102. TheNAT behavior information110 may be incomplete, e.g., it may narrow the NAT behavior to being of more than one possible type. At a later time,Node B104, at astartup208, may send arequest209 to one or more other nodes behind therouter108 includingNode A102. In reply to therequest209Node A102 may send apartial response213. Thepartial response213 may include theinformation Node A102 was able to obtain. Thepartial response213 may also indicate what additional information is needed to characterized the NAT behavior of therouter108.Node B104 may then send arequest210 to theSTUN server112 and receive aresponse212 in return. Theresponse212 may provide the missing information needed to characterize the NAT behavior of therouter108.Node B104 may then share this information, e.g., by sending anupdate response214 toNode A102 and/or any other nodes behind therouter108.
Note that in the example depicted inFIG. 2C, the process of partial response and update response pairs may continue until details of NAT behavior are fully determined. This may be particularly useful in cases where therouter108 allocates external bindings for multiple requests with non-deterministic behavior.
The effect of sharing theinformation110 on improving NAT behavior determination is not insignificant. Typically, requests to and responses from theSTUN server112 may be subject to latencies associated with both theLAN101 and theWAN106. Requests from one node to another on theLAN101 are typically subject only to latencies associated with theLAN101. WAN latencies are generally much larger than LAN latencies. For example, with a theoretical WAN latencies of about 100 milliseconds and LAN latencies of less than about 1 millisecond, sharingNAT behavior information110 among the nodes on theLAN101 could improve the NAT behavior determination phase by a factor of over 100.
In addition the nodes on theLAN101 may cooperatively share NAT information after each node has independently determined NAT behavior type on its own. In this case, gossip between nodes about determined behavior could identify a router that has bad local port preservation behavior, which could effectively turn therouter108 from port-restricted to symmetric behavior. Sharing of theinformation110 may be used to diagnose changes to the behavior of therouter108. Sharing of theinformation110 may also be used to a priori workaround NAT issues associated with bad local port preservation. For instance, multiple nodes behind therouter108 could broadcast to each other which local ports on therouter108 they want to use. A given node (e.g., Node A102) could change the selected port if another node (e.g., Node B104) is already using the selected port. Additionally, nodes may gossip about other unanticipated behavior changes of the local network environment of theLAN101. For example, a residential NAT typically has one global IP address that is dynamically assigned by ISP (Internet Service Provider such as Comcast) using a protocol called DHCP. The assigned dynamic IP for NAT may expire and the ISP could assign another IP address. If that happens, it may take some time for a local node to detect such event. If one node detects the event, it may notify other nodes, using broadcast, of the event.
In the embodiments depicted inFIGS. 2B-2C the NAT-relatedinformation110 was stored locally at each node behind therouter108. In other embodiments, theinformation110 may be stored at some common location that is accessible to all the nodes behind therouter108. As discussed above, such a common location may be acommon database server114 or similar node connected to theWAN106. Thecommon database server114 may be accessed using a suitable protocol, such as hypertext transfer protocol (HTTP).
Alternatively, the common location may be a node that is part of theLAN101. For example, as shown inFIG. 2D, theinformation110 may be stored at therouter108. In this example, a node, e.g.,Node A102 may send aNAT information request205 to therouter108, e.g., atstartup202. Therouter108 may be configured, e.g., through appropriate programming, to send arequest204 to theSTUN server112 and receive aresponse206 in return. Therouter108 may then forward areply215 based on theresponse206 toNode A102. Therouter108 may optionally determine theNAT behavior information110 from theresponse206 and store the information, e.g., in a memory locally accessible by therouter108. Thereply215 may includeNAT behavior information110 obtained from theresponse206. Alternatively, thereply215 may involve forwarding theresponse206 toNode A102. When a different node subsequently requests NAT behavior information, therouter108 may respond directly using the storedinformation110. For example, atstartup208,Node B104 may send a NATbehavior information request216 to therouter108. In response, therouter108 may send areply218 based on the storedNAT behavior information110.
In the example depicted inFIG. 2D, it has been assumed that the address of therouter108 is well-known to all nodes behind it. In such a case, therequests205,216 and replies215,218 do not need to be broadcast. Furthermore, in the example depicted inFIG. 2D, only one round trip message is sent between each node and therouter108. In conventional situations, by contrast, each node talks to the NAT STUN Server, which often requires multiple round-trip messages. In addition, therouter108 may optionally perform behavior determination with theNAT STUN Server112 in a lazy fashion, i.e., only when a request is made to it from a client. If the NAT behavior of the router is deterministic, this may also occur at initialization of therouter108. In the case of completely deterministic behavior of a NAT device, communication with theNAT STUN Server112, may be omitted since the router behavior is well-known and may be communicated directly to the nodes behind therouter108.
The approach described above may appear more than superficially similar to Universal Plug and Play (UPnP) Gateway protocols. Embodiments of the present invention are different from UPnP in a number of ways. Most significantly, when a UPnP device is added to a LAN the UPnP device advertises its services to control points on the LAN. In embodiments of the present invention, by contrast, nodes on the LAN find out information about the control points (NATs on Routers) and make that information available to other devices.
Furthermore, the lack of true standardization of NAT behavior makes the existing UPnP mechanism less-than completely viable. In particular, UPnP is mainly supported only by residential routers, but not by other larger scale routers. For example, the routers in a hotel that provides Internet access services from rooms typically do not support UPnP. Another case in which UPnP does not work is that some ISP may provide private addresses for routers that provide certain services, e.g., HOT SPOT service. In such cases, the external address a node obtains is a private address of the nearest UPnP NAT. The node still needs to use a STUN server to obtain an actual global address that is routable over the Internet. In addition, there many existing routers do not support UPnP, or UPnP may not be turned on for many routers that do support UPnP.
In alternative embodiments of the invention, a single application running on a device on thelocal network101 could perform many, but not all of these operations on behalf of other applications. The device running this application is referred to herein as a NAT proxy. If a NAT proxy is only running on one device, it may not be able to determine certain NAT issues associated with bindings to different internal IP addresses. This may be overcome by running at least two instances of this application on two devices, although much of the ease of use may be lost by doing this.
Embodiments that utilize NAT proxies may be understood with respect toFIG. 3A andFIG. 3B. As shown inFIG. 3A thelocal network101 may include afirst NAT proxy116 associated withNode A102 and asecond NAT proxy118 associated withNode B104. TheNAT proxies116,118 may be coupled to therouter108. The NAT proxies may query thestun server112 from time to time in order to obtainNAT behavior information110 and share it withNode A102,Node B104 and any other nodes behind therouter108. By way of example, as shown inFIG. 3B, thefirst NAT proxy116 may send arequest204 to theSTUN server112 and receive aresponse206 in reply. Similarly, thesecond NAT proxy118 may send arequest224 to theSTUN server112 and receive aresponse226 in reply. TheNAT proxies116,118 may derive theNAT behavior information110 in whole or in part from theresponses206,226. After theinformation110 has been derived, one of the nodes connected to therouter108 may query theNAT proxies116,118 for theNAT behavior information110. For example,Node A102 may broadcast arequest228 to theNAT proxies116,118, which may respectively sendresponses230,232 in reply.
A NAT proxy application may be co-located on the same physical device node as the requesting application. A node only needs to receive one response from any NAT proxy. It is possible that the NAT proxies could run in a hierarchical fashion where only one proxy has the responsibility for sending responses in the local network. This has the unfortunate side-effect of creating a single point of failure within an otherwise redundant network configuration. In addition, The NAT proxy technique described with respect toFIG. 3A andFIG. 3B may be combined with the partial response/update response technique described above with respect toFIG. 2C to arrive at a cooperative global understanding of NAT behavior type between proxy nodes.
In the foregoing discussion, it has been assumed that each node is behind a single NAT. It is possible, in some network configurations for a node to be located behind more than one NAT. Embodiments of the present invention may be modified to address situations where a given Node lies behind more than one NAT. For example, as shown inFIG. 4 bothNode A102 andNode B104 are behindNAT1. However,Node B102 is also behindNAT2 though NAT N. In this example,NAT1 may be part of a gateway router between thelocal area network101 and thewide area network106. Information about the presence and behavior ofNAT1 may be useful to bothNode A102 andNode B104 for communication with theWAN106. In addition, information aboutNAT1 andNAT2 through NAT N will be useful for situations whereNode A102 andNode B104 communicate with each other.
By way of example, thenodes102,104,120 may determine how many NATs they are behind though the use of a field within the header of a datagram having a value that is reduced at each NAT device encountered en route to the datagram's destination. By way of example, field may be a time to live (TTL) field. Within the context of Ipv4 TTL refers to an 8-bit field in the Internet Protocol (IP) header. It is the 9th octet of 20. The time to live value may be thought of as an upper bound on the time that an IP datagram can exist in an internet system. The TTL field may be set by the sender of the datagram, and reduced by every host on the route to its destination. If the TTL field reaches zero before the datagram arrives at its destination, then the datagram is discarded and an Internet Control Message Protocol (ICMP) error datagram (11—Time Exceeded) is sent back to the sender. The TTL field is conventionally used to avoid a situation in which an undeliverable datagram keeps circulating on an internet system, and such a system eventually becoming overwhelmed by large numbers of such “immortal” datagrams. In theory, time to live may be measured in seconds, although every host that passes the datagram must reduce the TTL by at least one unit. In practice, the TTL field is reduced by one on every hop. To reflect this practice, the field is named hop limit in IPv6. The ICMP error datagram identifies the last host the datagram arrived at before timing out. A tool called traceroute uses ICMP error messages to detect a path to a remote end node. TTL or hop limit fields may be used to determine the addresses of the NATs betweenNode A102 andNode B104 in a manner similar to that used in a traceroute command.
In embodiments of the invention,Node A102 andNode B104 andother nodes120 may shareinformation110 relating to the behavior ofNAT1 andNAT2 through NAT N. Thenodes102,104,120 may obtain theNAT information110, e.g., as discussed above with respect toFIGS. 2A-2D and store the information in a manner accessible by all of the nodes on theLAN101. By way of example, theinformation110 may be cached on aserver112 such as a common database server or STUN server. By way of example, theserver112 may reside between theLAN101 between theWAN106. It is further noted thatdevices hosting NAT1 andNAT2 through NAT N may also gather information about themselves and share it with thenodes102,104,120.
Embodiments of the invention may be used to implement NAT behavior discovery with wireless nodes. For example, as shown inFIG. 5, awireless network501 may include first, second and third, wireless access points WAP1, WAP2, and WAP3, which may be at geographically distributed locations. The wireless access points WAP1, WAP2, and WAP3 may be implemented, e.g., by wireless routers, which may include network address translators NAT1, NAT2 and NAT3 respectively. The wireless access points WAP1, WAP2, and WAP3 may be characterized by correspondingcoverage areas502,504,505. Awireless node507 may access thenetwork501 if it is within one of the coverage areas. By way of example, thewireless node507 may be any device configured for wireless network communication. Examples of such devices include, but are not limited to laptop computers, portable video game devices, portable music download devices, portable Voice over Internet protocol (VoIP) devices, and portable Internet browser or email devices, such as the Blackberry®. Blackberry® is a registered trademark of Research in Motion LTD of Waterloo, Ontario Canada. In addition, such devices include wireless devices that incorporate two or more functions, such as VoIP, internet, email and music downloads. An example of such a device is the iPhone from Apple Inc. of Cupertino, Calif.
The wireless access points WAP1, WAP2, WAP3 may be connected to awide area network506 via arouter508. In addition there may be other nodes A, B, C connected between therouter508 and the wireless access points WAP1, WAP2 and WAP3 respectively.Information510 regarding the network address translators NAT1, NAT2, NAT3 may be stored at a centrallyaccessible cache512 that is coupled to therouter508. There are a number of different ways of obtaining and caching theinformation510. For example, thewireless node507 may gather part of theinformation510 through conventional NAT traversal and share it with other nodes as shown inFIG. 2B orFIG. 2C. In addition, therouter508 or wireless access points WAP1, WAP2, WAP3 may obtain theinformation510 as described above with respect toFIG. 2D. Furthermore, the other nodes A, B, C may obtain all or part of the information by acting as proxy nodes as described above with respect toFIG. 3A andFIG. 3B. Furthermore, although the information is shown as being stored in asingle location512, theinformation510 may alternatively be distributed among the nodes connected to thenetwork501. In some embodiments, information relating to the wireless network address translators NAT1, NAT2, NAT3 may be stored locally at the corresponding wireless access points WAP1, WAP2, WAP3. It is noted that theinformation510 may include a geographic location for each NAT or wireless access point. Theinformation510 may also include other general information related to the NAT or wireless access point. Such information may include, but is not limited to information relating to local restaurants, weather, identity of other devices connected to thenetwork501 number of times a particular wireless access point has been visited and other general information. A wireless device may access this information when accessing thenetwork510 through any of the wireless access points WAP1, WAP2, WAP3.
Through sharing of theinformation510 the quality of service over thewireless network501 may be enhanced. For example, thewireless node507 may move from one coverage area to another, e.g., from thecoverage area502 for the first wireless access point WAP1 to thecoverage area504 for the second wireless access point WAP2. Theinformation510 may be organized such that thewireless device507 can request NAT information for a neighboring wireless access point, such as the second wireless access point WAP2. In some embodiments, thedevice507 may be programmed to determine, e.g., from GPS data or wireless signal strength a general direction of travel of the wireless device and use this direction to estimate which wireless access points the device is likely to encounter.
Embodiments of the present invention may also apply to situations in which a NAT moves. For example, the wireless access points WAP1, WAP2, WAP3 may be mounted on vehicles. Thewireless node507 may determine whether a NAT is mobile e.g., from geographical information. For example, thewireless node507 may include a geographical location system, such as a global positioning satellite system (GPSS) receiver. Using such a system, thenode507 may its own location when it encounters the NAT. If thenode507 encounters the same NAT when the node is in two different locations that are sufficiently far apart the node may infer that the NAT has moved.
As mentioned above, there are a number of different configurations for a node that may be used in conjunction with embodiments of the present invention. By way of example, and without loss of generality,FIG. 6 is a block diagram illustrating the components of anode600 suitable for implementing NAT behavior discovery according to an embodiment of the present invention. By way of example, and without loss of generality, thenode600 may be implemented as a computer system, such as a personal computer, video game console, personal digital assistant, wireless device, or other digital device, suitable for practicing an embodiment of the invention. In some embodiments, thenode600 may be a router. Thenode600 may include a central processing unit (CPU)601 configured to run software applications and optionally an operating system. TheCPU601 may include one or more processing cores. By way of example and without limitation, theCPU601 may be a parallel processor module, such as a Cell Processor. An example of a Cell Processor architecture is described in detail, e.g., in Cell Broadband Engine Architecture, copyright International Business Machines Corporation, Sony Computer Entertainment Incorporated, Toshiba Corporation Aug. 8, 2005 a copy of which may be downloaded at http://cell.scei.co.jp/, the entire contents of which are incorporated herein by reference.
In the node600 amemory602 may be coupled to theCPU601. Thememory602 may store applications and data for use by theCPU601. Thememory602 may be in the form of an integrated circuit, e.g., RAM, DRAM, ROM, and the like). Acomputer program603 may be stored in thememory602 in the form of instructions that can be executed on theprocessor601. The instructions of theprogram603 may be configured to implement, amongst other things, NAT behavior discovery, e.g., as described above. In particular, theprogram603 may be instructions that, when executed, cause thenode600 to determine information regarding the behavior of one or more NATs and store the information in such a way that the information is retrievable bynode600 or one or more other nodes. Furthermore, theprogram603 may be configured to retrieve information regarding behavior of one or more NATs obtained by one or more other nodes and use the information to traverse one or more of the NATs.
Thememory602 may contain data that is generated by or usable by theprogram603. In particular thememory602 may containinformation610 relating to one or more NATs. Specifically, theinformation610 may include, but is not limited to (i) NAT behavior information (e.g., whether the NAT is full cone, restricted cone, port restricted, symmetric) including whether the NAT behavior includes port preservation or not; (ii) available STUN server addresses; and (iii) common database addresses. Theinformation610 may be stored in a section of thememory602 that can be accessed by other nodes.
Thenode600 may further include astorage device615 that provides non-volatile storage for applications and data. By way of example, thestorage device615 may be a fixed disk drive, removable disk drive, flash memory device, tape drive, CD-ROM, DVD-ROM, Blu-ray, HD-DVD, UMD, or other optical storage devices. Thenode600 may also include well-known support functions620 commonly used in computing systems. Such support functions may include such features as input/output (I/O)elements621, power supplies (P/S)622, a clock (CLK)623 andcache624.
One or more user input devices625 may be used to communicate user inputs from one or more users to thenode600. By way of example, one or more of the user input devices625 may be coupled to thenode600 via the I/O elements621. Examples of suitable input devices625 include keyboards, mice, joysticks, touch pads, touch screens, light pens, still or video cameras, and/or microphones. In the particular case of A/V chat, it is desirable for the user input devices625 to include both a camera and a microphone.
Anetwork interface626 allows thenode600 to communicate with other computer systems via anelectronic communications network627. By way of example, thenetwork627 may be a wide area network and thenode600 may be on a local area network. The node may interface with thenetwork627 via arouter608, which may include a network address translator NAT. In some embodiments thenode600 itself may be a router, e.g., as described above with respect toFIG. 2D. Thenetwork interface626 may include wired or wireless communication over local area networks and wide area networks such as the Internet. Thenode600 may send and receive data and/or requests for files via one ormore message packets628 over thenetwork627. By way of example, thenetwork interface626 may include or be part of a network card, network adapter or network interface card (NIC), such as an Ethernet card. Thenetwork interface626 may include computer hardware designed to allow thenode600 to communicate over thenetwork627. Thenetwork interface626 may provides physical access to a networking medium and provide a low-level addressing system, e.g., through the use of MAC addresses. Consequently, with respect to the Internet Protocol stack, thenetwork interface626 may be regarded as both a physical layer device and a data link layer device.
Thenode600 may further comprise a graphics subsystem630, which may include a graphics processing unit (GPU)635 andgraphics memory640. Thegraphics memory640 may include a display memory (e.g., a frame buffer) used for storing pixel data for each pixel of an output image. Thegraphics memory640 may be integrated in the same device as theGPU635, connected as a separate device withGPU635, and/or implemented within thememory602. Pixel data may be provided to thegraphics memory640 directly from theCPU601. Alternatively, theCPU601 may provide theGPU635 with data and/or instructions defining the desired output images, from which theGPU635 may generate the pixel data of one or more output images. The data and/or instructions defining the desired output images may be stored inmemory602 and/orgraphics memory640. In an embodiment, theGPU635 may be configured (e.g., by suitable programming or hardware configuration) with 3D rendering capabilities for generating pixel data for output images from instructions and data defining the geometry, lighting, shading, texturing, motion, and/or camera parameters for a scene. TheGPU635 may further include one or more programmable execution units capable of executing shader programs.
The graphics subsystem630 may periodically output pixel data for an image fromgraphics memory640 to be displayed on adisplay device650. Thedisplay device650 may be any device capable of displaying visual information in response to a signal from thecomputer system600, including CRT, LCD, plasma, and OLED displays. Thenode600 may provide thedisplay device650 with an analog or digital signal. By way of example, thedisplay650 may include a cathode ray tube (CRT) or flat panel screen that displays text, numerals, graphical symbols, or images. In addition, thenode600 may include one or moreaudio speakers652 that produce audible or otherwise detectable sounds. To facilitate generation of such sounds, thenode600 may further include anaudio processor655 adapted to generate analog or digital audio output from instructions and/or data provided by theCPU601,memory602, and/orstorage615. In the particular case of applications such as A/V chat or Voice over Internet Protocol (VoIP), it is sometimes desirable for thenode600 to include agraphical display device650 and anaudio speaker652.
The components of thenode600, including theCPU601,memory602, support functions620,data storage615, user input devices625,network interface626, graphics subsystem630speaker652 andaudio processor655 may be operably connected to each other via one ormore data buses660. These components may be implemented in hardware, software, firmware or some combination of two or more of these.
Embodiments of the present invention may solve a key issue in networking deployments related to NAT devices [routers that perform network address translation]. It is possible that a router with a fully specified behavior may be used to implement NAT behavior information discovery and distribution in a centralized way. It is possible that some of the functionality may be lost if the state of individual applications cannot be fully gleaned at such a router. However, additions to this mechanism may account for this deficiency, though perhaps with some associated overhead.
In embodiments of the present invention otherwise distinct, peer network nodes that are behind a common NAT may cooperate to cooperate to better solve the NAT traversal problem in a decentralized way. There are no existing solutions to the full range of issues that can occur with varying NAT device behavior that involve cooperation of multiple nodes on a local network.
While the above is a complete description of the preferred embodiment of the present invention, it is possible to use various alternatives, modifications, and equivalents. Therefore, the scope of the present invention should be determined not with reference to the above description but should, instead, be determined with reference to the appended claims, along with their full scope of equivalents. Any feature described herein, whether preferred or not, may be combined with any other feature described herein, whether preferred or not. In the claims that follow, the indefinite article “A”, or “An” refers to a quantity of one or more of the item following the article, except where expressly stated otherwise. In the claims that follow, the expressions first and second are used to distinguish between different elements and do not imply any particular order or sequence. The appended claims are not to be interpreted as including means-plus-function limitations, unless such a limitation is explicitly recited in a given claim using the phrase “means for.”