Accessing an entity inside a private network

A system is disclosed that allows an entity outside of a private network to initiate communication with an entity inside the private network. The entity inside of the private network maintains a persistent connection with an agent. In one embodiment, communications that are intended for the entity inside the private network are sent to the agent. The agent then forwards the communications to the entity inside the private via the persistent connection.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is related to the following Patents/Applications:

COMMUNICATING WITH AN ENTITY INSIDE A PRIVATE NETWORK USING AN EXISTING CONNECTION TO INITIATE COMMUNICATION, Hasan S. Alkhatib, Fouad A. Tobagi, Farid F. Elwailly and Bruce C. Wootton. filed on the same day as the present application, Aug. 30, 2002, now Ser. No. 10/233,288.

Each of the related Patents/Applications are incorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention is directed to system for accessing an entity inside a private network.

2. Description of the Related Art

Most machines on the Internet use the TCP/IP (Transmission Control Protocol/Internet Protocol) reference model to send data to other machines on the Internet. The TCP/IP reference model includes four layers: the physical and data link layer, the network layer, the transport layer, and the application layer. The physical layer portion of the physical and data link layer is concerned with transmitting raw bits over a communication channel. The data link portion of the Physical and Data Link layer takes the raw transmission facility and transforms it into a line that appears to be relatively free of transmission errors. It accomplishes this task by having the sender break the input data up into frames, transmit the frames and process the acknowledgment frames sent back by the receiver.

The network layer permits a host to inject packets into a network and have them travel independently to the destination. On the Internet, the protocol used for the network layer is the Internet Protocol (IP).

The transport layer is designed to allow peer entities on the source and destination to carry on a “conversation.” On the Internet, two protocols are used. The first one, the Transmission Control Protocol (TCP), is a reliable connection-oriented protocol that allows a byte stream originating on one machine to be delivered without error to another machine on the Internet. It fragments the incoming byte stream into discrete segments and passes each one to the network layer. At the destination, the receiving TCP process reassembles the received segments into the output stream. TCP also handles flow control to make sure a fast sender cannot swamp a slow receiver with more segments than it can handle. The second protocol used in the transport layer on the Internet is the User Datagram Protocol (UDP), which does not provide the TCP sequencing or flow control. UDP is typically used for one-shot, client server type requests-reply queries for applications in which prompt delivery is more important than accurate delivery.

The transport layer is typically thought of as being above the network layer to indicate that the network layer provides a service to the transport layer. Similarly, the transport layer is typically thought of as being below the application layer to indicate that the transport layer provides a service to the application layer.

The application layer contains the high level protocols, for example, Telnet, File Transfer Protocol (FTP), Electronic Mail—Simple Mail Transfer Protocol (SMTP), and Hypertext Transfer Protocol (HTTP).

To transmit data from a source to a destination, the Internet Protocol uses an IP address. An IP address is four bytes long, and consists of a network number and a host number. When written out, IP addresses are specified as four numbers separated by dots (e.g. 198.68.70.1). Users and software applications do not always refer to hosts or other resources by their numerical IP address. Instead of using numbers, they use ASCII strings called domain names. The Internet uses a Domain Name System (DNS) to convert a domain name to an IP address.

The Internet Protocol has been in use for over two decades. It has worked extremely well, as demonstrated by the exponential growth of the Internet. Unfortunately, the Internet is rapidly becoming a victim of its own popularity: it is running out of addresses.

One proposed solution to the depleting address problem is Network Address Translation (NAT). This concept includes predefining a number of network addresses to be private addresses. The remainder of the addresses are considered global or public addresses. Public addresses are unique addresses that should only be used by one entity having access to the Internet. That is, no two entities on the Internet should have the same public address. Private addresses are not unique and are typically used for entities not having direct access to the Internet. Private addresses can be used by more than one organization or network. NAT assumes that all of the machines on a network will not need to access the Internet at all times. Therefore, there is no need for each machine to have a public address. A local network can function with a small number of one or more public addresses assigned to one or more gateway computers. The remainder of the machines on the network will be assigned private addresses. Since entities on the network have private addresses, the network is considered to be a private network.

When a particular machine having a private address on the private network attempts to initiate a communication to a machine outside of the private network (e.g. via the Internet), the gateway machine will intercept the communication, change the source machine's private address to a public address and set up a table for translation between public addresses and private addresses. The table can contain the destination address, port numbers, sequencing information, byte counts and internal flags for each connection associated with a host address. Inbound packets are compared against entries in the table and permitted through the gateway only if an appropriate connection exists to validate their passage. One problem with the NAT approach is that it only works for communication initiated by a host within the private network to a host on the Internet that has a public IP address. The NAT approach specifically will not work if the communication is initiated by a host outside of the private network and is directed to a host with a private address in the private network.

Another problem is that mobile computing devices can be moved to new and different networks, including private networks. These mobile computing devices may need to be reachable so that a host outside of the private network can initiate communication with the mobile computing device. However, in this case the problem is two-fold. First, there is no means for allowing the host outside of the private network to initiate communication with the mobile computing device. Second, the host outside the private network does not know the address for the mobile computing device or the network that the mobile computing device is currently connected to.

SUMMARY OF THE INVENTION

The present invention, roughly described, pertains to a system for accessing an entity inside a private network. The system disclosed allows an entity outside of a private network to initiate communication with an entity inside the private network. A first entity inside of the private network establishes a persistent connection with a second entity. A third entity outside of the private network can establish communication with the first entity using an identification associated with the persistent connection. Subsequent to the establishment of communication, the first and third entities can communicate.

One embodiment of the present invention includes maintaining a persistent connection between the first entity in the private network and the second entity. The third entity sends a communication, intended for the first entity, to the second entity. The second entity receives the communication and forwards the communication to the first entity using the persistent connection. In one implementation, the persistent connection is a UDP connection. Data sent from the third entity to the second entity is transmitted from the second entity to the first entity via UDP segments. The persistent connection is maintained by repeatedly sending UDP segments prior to a connection time out. In some embodiments, the second entity store state information about the persistent connection and routing, while in other embodiments, the first and third entities store the state information. In various alternatives, the persistent connection can be established using a protocol other than UDP.

The first, second and third entities can be any device that can communicate on a network, including mobile and non-mobile computing devices such as desktop computers, laptop computers, telephones, handheld computing devices, network appliances, servers, routers, gateways, etc. The entities can also be a process, thread, etc.

The present invention can be accomplished using hardware, software, or a combination of both hardware and software. The software used for the present invention is stored on one or more processor readable storage media including hard disk drives, CD-ROMs, DVDs, optical disks, floppy disks, tape drives, RAM, ROM or other suitable storage devices. In alternative embodiments, some or all of the software can be replaced by dedicated hardware including custom integrated circuits, gate arrays, FPGAs, PLDs, and special purpose computers.

These and other objects and advantages of the present invention will appear more clearly from the following description in which the preferred embodiment of the invention has been set forth in conjunction with the drawings.

DETAILED DESCRIPTION

FIG. 1is a block diagram of one embodiment of the components of the present invention.FIG. 1shows a private network10. The components connected to private network10include a NAT device12, and entities14,16, and18. The entities can be any device that can communicate on a network, including mobile and non-mobile computing devices such as desktop computers, laptop computers, telephones, handheld computing devices, network appliances, servers, routers, gateways, etc. In one embodiment, each (or some) of the entities have a communication device (e.g. network interface), a storage device, I/O devices and one or more processors programmed to implement the present invention. All or part of the invention can include software stored on one or more storage devices to program one or more processors. The entities can also be a process, thread, etc. In one embodiment, NAT device12is a computing device that is running Network Address Translation (NAT). NAT device12is one example of a stateful edge switch that allows communication to be initiated in one direction. Other stateful edge switches can also be used with the present invention.FIG. 1shows NAT device12connected to the Internet so that the entities on private network10can communicate with other entities on the Internet using NAT. Note that it is not necessary for NAT device12to be a physical gateway on the edge of the network between private network10and Internet. It is also possible that NAT device12can be inside the private network.

FIG. 1shows entity18labeled as host A. Thus, host A is an entity in a private network. In one embodiment, host A is a mobile computing device that is connected to private network10. When host A connects to private network10, it is assigned a private address. When host A wants to communicate outside of private network10, NAT device12allows host A to communicate using a public address assigned to NAT device12. In some embodiments, host A is a computing device that is not mobile. In other embodiments, there may be multiple subnets for NAT12and host A can be on any of those subnets.

FIG. 1also shows Agent30, host B34, and server38connected to Internet. According to one embodiment of the present invention, host A registers with Agent30and sets up a persistent communication with Agent30so that host A can be accessible by entities outside of private network10.

In one example, host B is a computer with a public IP address. Host B knows the domain name for host A; however, host B does not know an address for host A. According to the present invention, host B requests server38to resolve a domain name for host A. Server38responds to host B's request by returning the IP address for Agent30. Host B creates a communication for host A and sends that communication to Agent30. Agent30then forwards the communication to host A via the persistent connection between Agent30and host A. Host A can reply back to host B via the persistent connection or host A can send its reply outside of the persistent connection. Sending the reply without using the persistent connection alleviates the load on the second entity.

FIG. 2describes one embodiment of the steps taken to make host A accessible to entities outside of private network10. In step102, host A physically connects to private network10. In step104, host A receives a private address for communication on private network10. In step106, host A registers with Agent30. In step108, a persistent connection is maintained between host A and Agent30. One example of a suitable persistent connection is a UDP (User Data Protocol) connection as described below. Other types of persistent connections can be used such as TCP connections, other protocols, etc. In one embodiment, host A maintains the persistent connection. In other embodiments, the persistent connection is maintained by Agent30, a combination of Agent30and host A, or another entity. A UDP connection will normally have a timeout interval. In one embodiment, maintaining the connection includes repeatedly sending UDP segments so that a new UDP segment is sent prior to the timeout interval completing.

UDP is a protocol that operates at the transport layer of the TCP/IP stack. UDP is described in RFC768, which is incorporated herein by reference.FIG. 3depicts UDP segment120, which includes a header122and a data portion124.

FIG. 4depicts the details of header122. Header122is 8 bytes and includes source port130, destination port132, UDP length134, and checksum136. Source port130and destination port132identify the end points within the source and destination entities. UDP length134indicates the length of header122and data portion124. UDP checksum136is provided for reliability purposes.

FIG. 5is a flow chart describing the process of host A registering with Agent30(step106ofFIG. 2). In step150, host A creates a UDP segment with one or more codes in the data portion. In one embodiment of the present invention, a protocol can be designed which includes a set of codes to be stored in the data portion of UDP segments, These codes can indicate that a new connection is requested, an existing connection should be terminated, move the connection to port #, the domain name of the sender is <domain name>, the time out interval for the UDP connection is X, and other messages. In one embodiment, the UDP segment created in step150includes codes that indicate that a new connection is requested and identifies the domain name for host A. In one embodiment, the codes are sent in the data portion of the UDP segment.

In step152, the UDP segment created in step150is sent to the NAT device12. For example, the UDP segment is created listing a port on host A as its source port and a well known port for UDP on Agent30as the destination port. The UDP segment is placed within one or more IP packets. The source address of the IP packets is the private address of host A. The destination address of the IP packets is the public IP address of Agent30. The IP packets are first sent to NAT device12. In step154, NAT device12receives the UDP segment and changes the source port to a port on NAT device12, in accordance with standard NAT operation. The changed UDP segment is placed within one or more IP packets. The source address of the IP packets is a public address associated with NAT device12. The destination address of the IP packets is the public IP address of Agent30. In step156, the UDP segment is received by Agent30.

In step158, Agent30accesses the codes in the data portion of the UDP segment and determines based on the codes that host A is requesting that a connection be set up between host A and Agent30. In step160, Agent30selects a port on Agent30for servicing the new connection with host A.

Agent30maintains a look up table for all of its connections with entities inside private networks. Data structures other than a table can also be used. Each connection has an entry in the table. Each entry stores the domain name of the entity in the private network, the public IP address used for the entity (e.g. the address provided by the NAT device), the port for the NAT device (or other stateful edge device or other device), and the port used for the connection on Agent30. In one embodiment, other data can be stored in a table entry, such as the time out interval for the connection. In step162, Agent30creates an entry in the table for the new connection.

In step164, Agent30creates a UDP segment and sends it to host A. The UDP segment may include codes in the data portion indicating that the connection has been created and the time out interval for the connection. The segment sent in step164is received by NAT device12in step166, which forwards the segment to host A in step168. In step170, host A stores the port number for Agent30(selected in step160) and the time out interval.

FIG. 6is a flowchart which describes a process that is performed when host B initiates communication with host A. Host B knows the domain name for host A, but does not know an address for host A and does not know what network host A is connected to. In step302, host B requests resolution of host A's domain name. In one embodiment, step302includes a standard request for domain name resolution. The request to resolve host A's domain name is received by server38. In one embodiment, server38is the authoritative domain name server for host A. In step304, server38responds to the request for the domain name resolution by finding the appropriate DNS record that corresponds to the domain name provided. In one embodiment, the DNS record that corresponds to the domain name for host A identifies the IP address of Agent30as the IP address associated with the domain name for host A. In step306, server38sends the IP address for Agent30to host B. In the discussion above, host B is requesting resolution of the domain name. In other embodiments, other types of names can be resolved. That is, the present invention works in any other spaces. For example, the present invention can be used with LDAP names.

In one embodiment, server38responds with a standard DNS record. In other embodiments, server38responds with a different set of information. For example, server38can respond with an identification code for communicating with host A, in addition to the IP address for Agent30. Server38can also provide the private IP address or port for host A, as well as the IP address for NAT device12.

In step308, host B creates an IP packet to send to Agent30. In one implementation, step308includes inserting data from a transport layer protocol process into the IP packet. In another implementation, step308includes encapsulating a first IP packet (or other data quantity) into a second IP packet. For example, if host B was using IPsec (e.g. for implementing a Virtual Private Network or other purpose), then step308could include encapsulating the IPsec packet into another IP packet.

In one embodiment in which host B is using IPsec (end-to-end) to communicate with host A, the IPsec packet will utilize pseudo addresses to identify host A and host B. For example, host A can use a unique (or unique locally in a VPN) four byte index to identify host B. Similarly, host B can use a unique (or unique locally in a VPN) four byte index to identify host A. Thus, the source address of the IPsec packet from host B to host A will be the pseudo address which host A uses to represent host B. The destination address will be the pseudo address that host B uses to represent host A.

In step310, host B adds the domain name for host A to the IP packet created in step308. The domain name can be added in the options field of the header for IP packet, the data portion of the IP packet, a new field added to the header of the IP packet, to a different field in the header of the IP packet, to another packet encapsulating or encapsulated within the IP packet created in step308, in a transport layer segment within the IP packet or another location in the IP packet. The exact placement of the domain name is unimportant as long as host B and second entity30know where the domain name is.

Some embodiments use identifiers other than a domain name to distinguish host A from other hosts that have a private address. In those embodiments, the identifier being used is placed in the packet in step310. Example of other identifiers include the private address, private address in combination with the public address for the NAT, a port number, a port number in combination with the public address for the NAT, a socket number, or another identifier that can be used to identify host A.

An additional alternative to using the domain name in the packets is assigning a specific address IPa to host A. The specific address IPa is routable to the second entity, uniquely identifying host A, and published in the server for the duration of Host A's registration with the server. In one alternative, address IPa may not have to be routable; rather, it can be used as the destination address in a datagram that gets encapsulated within another datagram destined to the second entity (destination address IPg). In yet another alternative, host B establishes a persistent connection with the second entity (similar to host A's persistent connection with the second entity) and uses a specific port number uniquely identifying host A. In this case, the second entity acts as a switch among persistent connection. Note that the persistent connections can be thought of as tunnels.

In step312, the IP packet created in step308is sent to Agent30. In step314, Agent30forwards the IP packet to host A via the persistent connection established between host A and Agent30. In step316, host A and host B communicate, including sending IP packets between host A and host B using the persistent connection between host A and Agent30.

FIG. 7illustrates the process ofFIGS. 6 and 8. For example,FIG. 7shows host B accessing data360to be inserted in the IP packet in step308ofFIG. 6. The IP packet created in step308is depicted as IP packet362having a source IP address as the IP address for host B and a destination IP address as the IP address for Agent30. Data360is placed in the data portion of the IP packet to362. IP packet362is sent to Agent30in step312ofFIG. 6. In step314ofFIG. 6, Agent30creates IP packet364and forwards IP packet364toward host A.

FIG. 8is a flowchart which describes the process performed by Agent30, NAT device12and host A in step314ofFIG. 6. The discussion ofFIG. 8makes reference toFIG. 7. In step400, Agent30receives IP packet362. In step402, Agent30determines whether IP packet362includes a domain name. In embodiments that use an identifier other than a domain name, step402looks for that other identifier. If the domain name is not found, and Agent30treats the received IP packet as an IP packet destined for itself. If the domain name was found in IP packet362, then Agent30uses the domain name to access the look up table stored on Agent30. If the domain name does not correspond to any entries in the table (step408), then an error message is sent to host B in step410. If the domain name does correspond to an entry in the table, then that entry is read by Agent30and used to create UDP segment366and new IP packet364. The source and destination ports for UDP segment366correspond to those stored in the lookup table. IP packet362received from host B is encapsulated inside the data portion of UDP segment366in step412. All or a portion of UDP segment366is placed inside the data portion of IP packet364. The source address for IP packet364is the IP address for Agent30. The destination address for IP packet364is the IP address for NAT device12, which was stored in the entry in the look up table. In step414, UDP segment is sent to NAT device12. In step416, NAT device12forwards the UDP segment to host A.FIG. 7shows NAT device12forwarding IP packet368to host A. IP packet368includes all or part of UDP segment366. The source address for IP packet368is the IP address for Agent30. The destination address for IP packet368is the private IP address for host A. In step418, host A removes the original IP packet362from UDP segment366. In the embodiment where host B encapsulated an IPsec packet within IP packet362, host A removes the IPsec packet from IP packet362.

FIG. 9is a flowchart describing a process performed when host A responds to a communication from host B.FIG. 10further illustrates the process ofFIG. 9. In step450, host A creates an IP packet to be sent to host B.FIG. 10shows data502. In one implementation, data502is inserted into the IP packet created in step450. In one embodiment, the IP packet created in step450may be an IPsec packet. In another embodiment, data502is an IPsec packet and this IPsec packet is encapsulated into an IP packet in step450. In step452, the IP packet created in step450is encapsulated within a UDP segment. That UDP segment is inserted into one more IP packets which is sent to NAT device12in step454.FIG. 10shows the IP packet504created in step450. IP packet504is encapsulated within UDP segment506. All of part of UDP segment506is within IP packet508. IP packet508is sent from host A to NAT device12in step454. The source address for IP packet508is the private IP address for host A. The destination address for IP packet508is the IP address for Agent30.

In step456ofFIG. 9, NAT device12changes the source address for the IP packet received and changes the source port for the UDP segment. The edited IP packet510has a source address corresponding to the IP address for NAT device12. The destination address for IP packet510is the IP address for Agent30. Edited IP packet510contains all or part of edited UDP segment506. IP packet510and UDP segment506are sent to Agent30in step458ofFIG. 9. IP packet504and UDP segment506are, thus, sent to Agent30via the persistent connection between host A and Agent30. In step460ofFIG. 9, Agent30accesses the look up table based on the data in UDP segment506. If there is no entry in the lookup table that correspond to the data in UDP segment506(step463), then an error message is sent back to host A in step464. If there is entry in the table that corresponds to the data in UDP segment506, then Agent30removes IP packet504from UDP segment506in step466. Agent30sends IP packet504to host B in step468. When host B receives IP packet504it accesses the data portion of the IP packet. In one embodiment, the data portion of IP packet504includes an IPsec packet which is accessed by host B.

Step316ofFIG. 6includes host A communicating with host B. This step includes host A sending communications to host B, and host B sending communications to host A. Host A sends communications to host B using the process ofFIG. 9, or a process similar to that aFIG. 9. Host B send communications to host A using steps308–314ofFIG. 6, or a process similar to those steps.

Although the above discussion contemplates that host A responds to host B by sending packets through Agent30and host B continues to send packets through Agent30, other embodiments include subsequent communication that does not go through Agent30. For example, once the first communication from host B arrives at host A via the Agent, host A can send its response directly to host B (without going through the Agent) by creating an IP packet with the IP address of host B as the destination address. Subsequently, host B can send IP packets to host A without going through the Agent by creating IP packets with the IP address of NAT device12as the destination address. NAT device12will forward the packets, with address translation according to standard NAT, to host A.

FIG. 11depicts another embodiment of the present invention. One difference between the embodiments ofFIG. 11andFIG. 1is that the entity initiating communication with host A is behind a NAT device. For example,FIG. 11shows private network540. Connected to private network540are NAT device542, entity544, entity546and entity548. Entity544is labeled as host C. Host C is an entity that is provided with a private address, but not a public IP address. Communications initiated by host C are provided with a public IP address by NAT device542in accordance with standard NAT.FIG. 11depicts NAT device542at the edge of private network540; however, NAT device542need not be at the edge of the network.

In the embodiment ofFIG. 11, host C initiates communication with host A according to the present invention. That is, host C will perform the steps ofFIG. 6that were described above with respect host B. NAT device542will edit communications to and from host C so that host A can use a public IP address associated with NAT device542. This processes is illustrated inFIG. 12, which shows host C sending a communication to host A. Host C creates IP packet602based on data600. IP packet602has a source address corresponding to the private IP address for host C. The destination address for IP packet602corresponds to the IP address for Agent30. IP packet602is sent to NAT device542and edited so that the edited IP packet604includes a source address corresponding to the IP address for NAT device542. Agent30acts as described inFIG. 8, encapsulating IP packet604in UDP segment608and adding UDP segment608to IP packet606. Agent30sends IP packet606to NAT device12. IP packet606has a source address corresponding to the IP address for Agent30. The destination address for IP packet606corresponds to the IP address for NAT device12. As described inFIG. 8, NAT device12changes IP packet606(to create IP packet610) so that the destination address becomes the private IP address for host A. Host A removes IP packet604from UDP segment608.

FIG. 13illustrates a process for host A sending data back to host C. Using data640(which can be an IPsec packet), host A creates IP packet642. The source address for IP packet642is the IP address associated with Agent30. The destination IP address for IP packet642is the IP address for NAT542. IP packet642is encapsulated within UDP segment646. All or part of UDP segment646is within the data portion of IP packet648. The source address for IP packet648is the private IP address for host A. The destination address for IP packet648is the IP address for Agent30. IP packet648is sent to NAT device12which edits the IP packet to create IP packet644. IP packet644has a source address identifying NAT device12. The destination address for IP packet644is the IP address for Agent30. IP packet644contains all or part of UDP segment646. Agent30accesses the look up table as described inFIG. 9, removes IP packet642from UDP segment646, and sends IP packet642to NAT device542. NAT device542edits IP packet642to create IP packet646. The source address for IP packet646corresponds to the IP address for Agent30. The destination address for IP packet646is the private address for host C.

Although the above discussion contemplates that host A responds to host C by sending packets through Agent30and host C continues to send packets through Agent30, other embodiments include subsequent communication that does not go through Agent30. For example, once the first communication from host C arrives at host A via the Agent, host A can send its response directly to host C (without going through the Agent) by creating an IP packet with the IP address of NAT542as the destination address. NAT device542will forward the packets, with address translation according to standard NAT, to host C. Subsequently, host C can send IP packets to host A without going through the Agent by creating IP packets with the IP address of NAT device12as the destination address. NAT device12will forward the packets, with address translation according to standard NAT, to host A.

FIG. 11also illustrates another embodiment of the present invention. This other embodiments include a second Agent550. Agent30participates in a persistent connection between Agent30and host A. Agent550participates in a persistent connection between second entity550and host C. When host A initiates communication with host C, the data is first transmitted via the first persistent connection to second entity30. From Agent30, the data is sent to Agent550. From Agent550, the data is sent via the second persistent connection to host C. In another embodiment, a persistent connection can be set up between Agent30and Agent550so that communications between host A and host C are transmitted via the three persistent connections. In another embodiment, there can be multiple second entities. An entity in a private network registers with any of the second entities. In one alternative, the second entities can set up dedicated connections (made up of sets of one or more persistent connections, or other types of connections) between the different entities communicating. In another embodiment, the function performed by server38and the function performed by one or more second entities can be combined to be performed by a single device.

In many of the embodiments described above, Agent30is a stateful second entity. A stateful second entity maintains information regarding the private host (e.g. host A) and the routing information necessary to send communications to the private host. In other embodiments, the second entity can be a stateless second entity. In the case of the stateless second entity, the routing information is provided to the end hosts. The end hosts include the information in the packets. The stateless second entity will interpret the information included in the packets and make use of it when forwarding the packets.

FIG. 14is a flow chart describing a process for making a host available for communication in an embodiment that uses a stateless second entity. Looking atFIG. 1, assume that Agent30does not store state information about host A and the persistent connection. Thus, the table created by Agent30, described above, will not be created. For purposes of the explanation below, assume that the communication between host A and host B is being established so that an application on host B can communicate with an application on host A. Also assume that the applications form virtual IP packets (VIP) to send to each other. A VIP is a packet created by an application to be sent to another application. The VIP is only used at the application layer, and is not used at the network or transport layer. The VIP will, in many cases, be encapsulated in a UDP or TCP segment. The VIP may have a virtual address, which is an address used by an application to refer to different application or different instance of the same application running on the same or a different machine.

In step700ofFIG. 14, host A contacts server38. In one embodiment, server38recognizes that host A is behind a NAT and, therefore, an entity outside of host A's private network cannot initiate communication with host A. After making such a recognition, server38directs host A to Agent30in step702. For example, server30will provide host A with the IP address for Agent30. In some embodiments, steps700and702can be omitted. In step704, host A contacts second entity30and establishes a persistent connection with Agent30. In some embodiments, the persistent connection is a UDP connection that is referred to as a UDP tunnel. Step704includes host A sending a message to second entity30, via NAT12, requesting the establishment of a UDP connection. In one embodiment, the UDP segment created and transmitted by host A will have both the source and destination port numbers set to a well known port G. In step706, Agent30sends a message to host A using the persistent connection to inform host A of the IP address that NAT12assigned to host A and the port number that NAT12is using for the persistent connection between Agent30and host A. Agent30knows this information from the packets and segments that it received from host A. In step708, host A registers with server38, informing server38of the IP address for NAT12, the port number NAT12assigned for the persistent connection between host A and Agent30, and the domain name (or other identifier) for host A. Alternatively, the agent registers the information with server38. In step710, host A maintains the persistent connection with Agent30by continuing to send UDP segments to Agent30(in some embodiments, referred to as Keep Alive Messages).

FIG. 15is a flow chart describing a process for sending a communication to an entity in a private network in the embodiment where second entity30is a stateless switch. In order to initiate communication with host A, host B attempts to resolve the domain name (or other identifier) for host A with server38in step750. Sever38responds to host B in step752by providing the IP address for NAT12, the port number on NAT12that NAT12uses for the persistent connection between host A and Agent30and the IP address for Agent30. In step754, host B encapsulates the VIP packet into one or more UDP segments having the source and destination port numbers set to the well known port G. The UDP segment is placed in one or more IP packets to be sent to Agent30. The IP packets have the IP address for host B as the source address and the IP address for Agent30as the destination address. If host B is behind a NAT device, referred to as NAT-B, then the source address field will be translated by NAT-B to its own public IP address and the UDP,source port number G is replaced by a port number selected by NAT-B (e.g. Port-B). In addition, host B will add a shim to the IP packet(s). The shim will include information that Agent30needs to forward the packet(s) to host A. A shim is an additional layer of information between the layers of the communication protocol; for example, a shim can be layer of data between the TCP data and the IP data. In one embodiment of the present invention, the shim created by host B stores the IP address of NAT12and the port on NAT12(e.g. port A) that is used for the persistent connection between host A and Agent30. In step756, the packet(s) with the shim, UDP segment and VIP are sent to Agent30.

In step760, Agent30receives packet and accesses the shim to determine where to forward the packet. Based on the information in the shim, Agent30changes the destination IP address of the packet(s) to the IP address for NAT12(found in the shim) in step762. The source address is changed to the IP address for Agent30. Based on the information in the shim, Agent30changes the destination port number in the segment to the port number on NAT12(port A—found in the shim) that is used for the persistent connection between host A and Agent30in step764. In step766, Agent30creates a new shim and replaces the contents of the original shim with the contents of the new shim. The new shim will include the IP address for host B (or the NAT for host B) and the source port number on host B (or the source port on the NAT for host B). The amended packet(s) is sent to NAT12in step768via the persistent connection. The amended packet(s) is translated by NAT12in step770, including changing the destination IP address to the private address for host A and changing the port number. The translated packet(s), is sent to host A in step772. Host A receives the packet(s) and stores the shim in step774. The information from the shim is stored because it will be needed to reply to host B. In step776, host A accesses the VIP from host B.

When host A replies to host B, it can do so directly without going through Agent30. From the information in the shim, host A knows the IP address for host B and the port number for host B to send a UDP segment in one or more IP packets. Alternatively, host A can reply by sending the packet(s) to Agent30via the persistent connection, and have Agent30edit the packet(s) in a reverse manner from that described above. Agent30will then forward the packet(s) to host B.

To further the understanding of the embodiments using the stateless second entity, below is an example of how a packet changes during the steps described above. The description below uses the following notation for a packet:[DA, AS](DP, SP)<A, P>{VIP}
[DA, AS] represents the destination and source IP addresses in the IP packet header, (DP, SP) represents the destination and source port numbers in the UDP segment header, <A, P> represents an IP address and a port number stored in the shim, {VIP} represents the VIP packet, and {Open tunnel}/{Tunnel open}/{Keep Alive} represents codes or messages within a UDP segment or elsewhere.

The first case contemplates that both host A and host B use a well known port G, and that host B is behind a NAT device, designated as NAT-B. In one embodiment, the IP addresses for host A and host B are private addresses, while the IP addresses for Agent30and the NAT devices are public addresses.

Host A Creating a Tunnel with Agent30:

Packet sent from host A to NAT12:

Packet sent from NAT12to Agent30:

Packet from NAT12to host A:

Packet sent from host A to NAT12:

Packet sent from NAT12to Agent30:

Communication from Host B to Host A:

Packet sent from host B to NAT-B:

Packet sent from NAT-B to Agent30:

Packet from NAT12to host A:

Communication from Host A to Host B:

Packet sent from host A to NAT12:

Packet sent from NAT12to Agent30:

Packet from NAT-B to host B:

The second case, below, contemplates that host A uses port A, host B uses port B, Agent30uses port G in both directions, host B is behind a NAT device, NAT12uses Port A′ for the persistent connection, and NAT-B uses Port.-B′.

Host A Creating a Tunnel with Agent30:

Packet sent from host A to NAT12:

Packet sent from NAT12to Agent30:

Packet from NAT12to host A:

Packet sent from host A to NAT12:

Packet sent from NAT12to Agent30:

Communication from Host B to Host A:

Packet sent from host B to NAT-B:

Packet sent from NAT-B to Agent30:

Packet from NAT12to host A:

Communication from Host A to Host B:

Packet sent from host A to NAT12:

Packet sent from NAT12to Agent30:

Packet from NAT-B to host B:

As discussed above, it is possible for the persistent connection to be a TCP connection. The connection is uniquely identified by the IP address of the NAT and the port number that the NAT has selected for that connection. For a stateful second entity, this information is to be associated in the second entity with the private host A; that is, with any identification we use for host A; e.g., domain name. All traffic destined to host A will be forwarded by the second entity on that tunnel. In one embodiment of a TCP persistent connection, the connection state information is maintained at each end of the connection. Data packets belonging to different connections established with host A (including TCP connections) get multiplexed on the same tunnel by considering each such packet as a separate TCP segment on the tunnel. Furthermore, its operation should be such that it does not raise any problem at the firewall. For example, sequence numbers should be properly advanced, and possibly acknowledgments should be appropriately generated. On the other hand, it is not necessary to guarantee reliability (and thus undertake retransmissions), nor exercise congestion control, as these functions would be provided at the individual connections level.

The destination port number to be used by host A in order to establish the tunnel may be restricted by the firewall. For example, it is possible that the firewall allows only port80(HTTP) to be the destination port of any connection established by a host within a private domain to an entity outside of the private. In that case, it is not possible to assign a different port number at the second entity for the different private hosts that establish tunnels with it.

The above embodiments all contemplate that messages to host A are, at least initially, sent to host A via the persistent connection. An alternative is a system that uses a persistent connection to initiate communication with host A, but does not send the messages via the persistent connection. Such a system can use the second entity for the persistent connection or can eliminate the second entity by using the server for the persistent connection. For example, when host B seeks to resolve the domain name for host A, it will received the IP address for NAT12(seeFIG. 1) and the port on NAT12that is used for the persistent connection with the server or the second entity. Host B can then send a message to host A using the IP address for NAT12(seeFIG. 1) and the port on NAT12that is used for the persistent connection with Agent30. NAT12will receive the message from host B, translate it and forward it to host A. If host B is behind a NAT device (e.g. host C is behind NAT542), then the replies form host A to host B are addressed to the IP address and port of the NAT device for host B.

If NAT12checks the source IP address in incoming packets, rejecting those in which the source IP address is different than the destination IP address for which the connection was established in the first place, a paging solution can be used. In the paging solution, host A establishes a persistent connection with the server (or second entity), which gets used by the latter to communicate signaling information to host A. Host B, interested in establishing a connection with host A, sends a page for host A to the server requesting host A to establish a connection with host B. The server forwards the page to host A on the UDP connection maintained by Host A with the server. Host A establishes a connection with Host B as requested.

Now consider a paging solution where both hosts (e.g. host A and host C) are private entities behind NAT devices, other types of stateful switches, or other devices that provide for communication with private entities. In this case, the persistent connection established by host A with the second entity or server is used for signaling purposes between the server and host A. When host C decides to communicate with host A, then host C sends a first UDP packet addressed to NAT12(published in the server). This causes NAT542to assign a port for a connection to NAT12. In order for the port number selected by NAT542to become known to host A, this first UDP packet is source routed through the server. The server intercepts the packet and extracts the port number. The first UDP packet should also contain information that indicates that host C is trying to reach host A. The server then communicates the IP address of NAT542and the port number chosen by NAT542to Host A over the persistent connection that host A is maintaining with the server. This process constitutes a page to host A prompting it to respond to host C using the IP address of NAT542and the port number in question. This step completes the establishment of a connection between host A and host C. NAT12selects a port number for the traffic from host A to host C (NAT542). From this point on, data can flow between hosts A and C in both directions through NAT12and NAT542and the ports selected therein. Note that this solution is based on the fact that NAT542maintains the allocation of the port number to Host C's connection to NAT12for a certain period of time awaiting a response from the destination. It thus requires that host A responds within that timeout period. It is also based on the assumption that each NAT possesses a single IP address.

More information about systems that use a persistent connection to initiate communication with host A, but do not send the messages via the persistent connection can be found in co-pending application COMMUNICATING WITH AN ENTITY INSIDE A PRIVATE NETWORK USING AN EXISTING CONNECTION TO INITIATE COMMUNICATION, Hasan S. Alkhatib, Fouad A. Tobagi, Farid F. Elwailly and Bruce C. Wootton, filed on the same day as the present application with attorney docket number TTCC-01016US0, incorporated herein by reference.