Sign In to Follow Application
View All Documents & Correspondence

Method Of Establishing Connection Between A Clinet Device And A Server Device For Communication Therebetween

Abstract: The present invention relates to a method of establishing connection between a client device and a server device for communication therebetween. In particular it relates to a method of communication between two devices, like two computers by fusion of connection reversal and port forwarding techniques. This invention provides a mechanism for establishing network connection between two devices.

Get Free WhatsApp Updates!
Notices, Deadlines & Correspondence

Patent Information

Application #
Filing Date
14 November 2008
Publication Number
21/2010
Publication Type
INA
Invention Field
COMPUTER SCIENCE
Status
Email
Parent Application

Applicants

SAMSUNG ELECTRONICS COMPANY LIMITED.
416, MAETAN-DONG, YEONGTONG-GU, SUWON-SI, GYEONGGI-DO

Inventors

1. JAISWAL, AMIT KUMAR
SAMSUNG INDIA ELECTRONICS PRIVATE LIMITED. GROUND AND FIRST FLOOR, D-5, SECTOR 59, NOIDA
2. BOTU, PRADEEP KUMAR
SAMSUNG INDIA ELECTRONICS PRIVATE LIMITED. GROUND AND FIRST FLOOR, D-5, SECTOR 59, NOIDA
3. MATHUR, SIDDHARTHA
SAMSUNG INDIA ELECTRONICS PRIVATE LIMITED. GROUND AND FIRST FLOOR, D-5, SECTOR 59, NOIDA

Specification

FIELD OF THE INVENTION
The present invention relates to a method of establishing connection between a client device and a server device for communication therebetween. In particular it relates to a method of communication between two devices, like two computers by fusion of connection reversal and port forwarding techniques.
This invention provides a mechanism for establishing network connection between two devices.
BACKGROUND OF INVENTION
In a known computer network peer to peer connectivity can be established over the network between a first node behind a first network address translator (NAT) and a second node behind a second NAT, irrespective of the first and second NATs intervening between the first and second nodes. This is disclosed in WO 2007/041417 document. The first NAT is a symmetric NAT. Port prediction is

performed by the first node by constructing a list of predicted transport, addresses on the first NAT. An 'invite' message is sent from the first node to the second node, containing the list of predicted transport addresses. Using the predicted transport addresses a connectivity check is performed with the second node.
The known system provides connectivity between two peers under different NATs. The first peer is under a symmetric NAT whereas the second peer can be under any NAT.
The second peer can connect to the first peer under symmetric NAT through port prediction method.
The known method does not take all connection scenarios into consideration. It restricts mainly to connecting to a peer, when it is under symmetric NAT. Here connection is always one sides INITIATOR tries to connect RESPONDER. If INITIATOR fails to establish a connection with RESPONDER, the connectivity process ends.

There was therefore a need for enabling connectivity between two peers under different NATs. If the 'Initiator' fails to connect the method should be able to shift the initiator to a responder (reverse connection). It would then be possible to quickly judge which one among the specified approaches can be tried for connectivity.
SUMMARY OF THE INVENTION
The present invention provides a novel approach where network connection is established between two devices / computers having network connection capability (henceforth referred to as "device") using a combination of port forwarding and connection reversal approaches. Henceforth for the purpose of the invention the device / computers which initiate the connection process to the other is referred to as client and the other is referred to as server. This approach uses a central database (placed on a public IP address) to exchange self-information between server and client.
The two main approaches used by the present invention are connection reversal and port forwarding as discussed below.

When a server is on a private IP, client cannot connect to this server whether the client IP is public or private. Technically, if a client has a public IP, connection is possible between the two if instead of client, server initiates connection.
However, the requirement here is that there should be a way for server application to know that client application could not connect and hence it should try to initiate connection. Also, there should be a way for server to know the IP information of the client for initiating connection. This is facilitated by a "reverse connection flag" on central database in this method.
Port forwarding (sometimes referred to as tunneling) is the act of forwarding a network port from one network node to another. This technique can allow an external user to reach a port on a private IP address (inside a LAN) from the outside via a network address translator (NAT) enabled router.
As already stated, the client router cannot make network connection with a private IP server. Client can however make a connection with the IP of the Server's router.
By port forwarding, an entry in the router network address translator (NAT) table can be created, so that any kind of request that comes to that particular port on

the router is forwarded directly to the port of the corresponding device (for example, any request that comes to the IP 210.118.108.254 router port 5000 is directly forwarded to the port 5000 of the IP 107.108.92.103 device.
Now, client device can make a network connection with the private IP server device by sending request to router IP address and forwarded port. Once connected, router acts like a relay whereas all traffic from server device is sent to client device and all traffic from client device is sent to server device.
This is single-level port forwarding but if required, multi level port forwarding can also be done in a similar fashion to accomplish the same result.
The present invention is a novel approach where connection between server and client is established using a combination of port forwarding and connection reversal approaches. This approach uses a central database (placed on a public: IP) to exchange self-information between server and client. This approach uses some data by server device and client device which is stored on central database. This central database is placed at any web server in public domain. This database would store data for each user (server or client) with a unique user ID as the primary field.

For example, for simple authentication usage, a table as shown below can be used:

In similar fashion, all the data like IP address, ports, forwarded ports, connection status, reverse connection flag, external IP address, session IP address etc. can be stored in this database. The format of storing all these data does not affect the method. Primarily, server and client should be able to add, modify and delete the data on this database.
One important data field that is established in this database is the "reverse connection flag" on central database for connection reversal purpose. It's a value which signifies whether reverse connection should take place when a client is trying to establish a network connection with a server. (For example- in this invention a value of '1' is used to signify that connection reversal is needed and '0' is used as default value). Any other way to signify the same will work as well.

There are four kinds of connection scenarios which are covered in this invention.
• Direct Connection: Server will listen on specified ports and client will connect to server.
• Reverse Connection: Client will listen on specified ports and server will connect to client.
• Direct Port Forward Connect: Server will be under a NAT, on which ports were forwarded. Client will connect to server device on these forwarded ports.
• Reverse Port Forward Connect: Client will be under a NAT, on which ports were forwarded. Server will connect to client on these forwarded ports.
In a preferred embodiment the present invention provides a method of establishing connection of a client device with a server device for communication therebetween, said method comprising the steps of: placing a central database with stored data for said server device and said client device in a web server in public domain; client and server updating this central database with self information during initialization or while in the process of establishing / breaking connection; and connecting the client device with the server device for communicating between said devices by adopting one of the four approaches of direct connection, reverse connection, direct port forwarding connection or reverse port forwarding connection.

BREIF DESCRIPTION OF THE ACCOMPANYING DRAWINGS
The invention can now be described in detail with the help of the figures of the accompanying drawings in which
Figure 1 illustrates in flow chart format the operations whenever a
connection needs to be established between two PCs / devices.
Figure 2 shows the flow of server operations whenever a connection needs to be established between 2 PCs / devices.
Figure 3 shows the flow of client operations whenever a connection needs to be established between 2 PCs / devices.
Figures
4 and 5 show examples of 1 level NAT port forwarding.

DETAILED DESCRIPTION
In the server connection process (Figure 1) while server is launching, it will try doing port forwarding (A1). Port forwarding will fail if server is public (A1'). If port forwarding is successful (A2), the external IP address of the NAT device to which port is forwarded (server external IP-SEIP) is put on the central database (A3) else it is set as NULL.
Server also sets up its information like IP address, ports, forwarded ports, client session IP (SSIP), external IP (SSIP) - > IP address of the NAT device which connects that network to the internet, level of port forwarding etc. on the central database.
If server is public, it will start listening (A2') and wait for a client to connect.
If server is private and port forward is successful it will set the port forward information on to the central database (A3).

Server monitors the reverse connection flag on central database continuously while connection has not been established. If client can connect directly (A4), the connection between two devices will be established.
However, if reverse connection flag becomes '1' (A5) on central database, server will get the port forward information of client device from central database (A6).
Server collects both session IP's and external IP's from central database.
If client is public, server will directly connect and the connection between two devices will be established.
If server session IP and client session IP are not same, it means client and server are connected to internet through different NAT's. If client external IP (CEIP) is equal to Client Session IP (CSIP), server initiates connection using port forwarded ports of client (All). Else, connection between server and client cannot be established (A12).
If server session IP and client session IP are same (A7), server and client are connected to internet through same NAT, and server external IP is equal to client external IP (A8) (both server and client are under same immediate NAT), then server can connect to client (A9)

If, server external IP is not equal to client external IP and client external IP is not NULL, server device will initiate connect to client device (All) using forwarded ports else through default ports.
If server session IP and client session IP are not same (server and client are connected to internet through different NAT), and Client external IP is equal to client Session IP, then server device will initiate connect to client device using forwarded ports.
Client external IP is not equal to client Session IP, then connection can't be made.
If server is unable to connect to client, it sets reverse connection flag as '0' on central database.
In the client connection process while client is launching it will try to do port forwarding (B1). Port forwarding will fail if client is public. If port forwarding is successful (B2), the external IP address of the NAT device to which port is forwarded (CEIP) is put on the central database (B3) else it is set as NULL (B6).

When client wants to connect to a server, it retrieves server information from central database and it will come to know that server is public or private through server data on the central database.
If server is public, client will directly connect (B7) to the server device (B8).
If server is private, client will retrieve server's port forward information from central database (B12).
If server session IP and client session IP are same (server and client are connected to internet through same NAT), and server external IP is equal to client external IP (both server and client are under same immediate NAT), then client will connect directly to server.
If server external IP is equal to client external IP, server device will initiate connect to client device using forwarded ports else client will set reverse connection flag as "1" after updating port forwarding details on to the central database.

If server session IP and client session IP are not same (server and client are connected to internet through different NAT), and server external IP is equal to server session IP (port forwarding successful upto n level), then client device will initiate connect to server device using forwarded ports.
If server external IP is not equal to client external IP, then client will set reverse connection flag as "1" after updating port forwarding details on to the central database.
Client will wait for server device to connect and monitors reverse connection flag. If reverse connection flag becomes '0' on central database, connection cannot be established.
The sequence of port forwarding and connection reversal can be interchanged in this method. The data name and type that is stored on the central database can be changed or differ as per implementation. The "central database" is just a publicly hosted data exchange mechanism for server and client. The "database" referred is just a cluster of data that is stored. Any other mechanism can be used for data exchange. All port forwarding descriptions is provided for 1-level NAT port forwarding only for simplicity purpose; however multilevel port

forwarding will also work as well for this method. The sequence of operations displayed in the flow chart (Figure 1) can be re-sequenced but still follow the primary method of combining port forwarding and connection reversal. Multiple subsets of this method can be created to do the same job by using this method partially. The various values used in method (like "0" or "1" for reverse connection flag) are indicative of states and other values can also be used instead.
The method of the present invention provides maximum chances of establishing connection between any two peers. It does not require any server or stun / turn method for establishing connection. The method of the invention also provides fallback connection method for each of the four connection scenarios.

WE CLAIM
1. A method of establishing connection of a client device with a server device
for communication therebetween, said method comprising the steps of:
- placing a central database with stored data for said server device and said client device in a web server in public domain;
- client and server updating this central database with self information during initialization or while in the process of establishing / breaking connection; and
- connecting the client device with the server device for communicating between said devices by adopting one of the four approaches of direct connection, reverse connection, direct port forwarding connection or reverse port forwarding connection.

2. The method as claimed in claim 1, wherein said central database stores data for each user (server and client) with a user ID as a primary field.
3. The method as claimed in claim 1, wherein all data like IP address, ports, forwarded ports, connection status, reverse connection flag, external IP address and session IP address can be stored in the central database.

4. The method as claimed in claim 1, wherein the name and type of data stored in said central database can be changed in accordance with implementation requirement.
5. The method as claimed in claim 1, wherein said direct connection approach comprises server listening on specified ports and client trying to connect to server.
6. The method as claimed in claim 1, wherein said reverse connection approach comprises client listening on specified ports and server trying to connect to client.
7. The method as claimed in claim 6, wherein said reverse connection approach of the server connecting to the client is adopted if server session IP and client session IP are same, server and client are connected to internet through same NAT and the server external IP is equal to client external IP.

8. The method as claimed in claim 1, wherein a reverse connection flag data field is established on the central database when reverse connection is required while trying to establish a network connection.
9. The method as claimed in claim 1, wherein said direct port forward connection approach comprises the server being under a NAT on which ports were forwarded and the client connecting to the server on the forwarded ports.
10. The method as claimed in claim 1, wherein said reverse port forward connection approach comprises the client being under a NAT on which ports were forwarded and the server connecting to the client on these forwarded ports.
11.The method as claimed in claim 10, wherein the server device will initiate connection to client device using forwarded ports or through default ports if server external IP is not equal to client external IP and when client external IP is not NULL.

12.The method as claimed in claim 7, wherein the reverse connection flag is set as '0' on the central database when the server device is unable to connect to the client device.
13.The method as claimed in claim 8, wherein the server device gets the port forwarded information of the client device from the central database, when reverse connection flag becomes '1'.
14.The method as claimed in claims 12 and 13, wherein the values '0' or '1' for reverse connection flag are indicative of states and other values can also be used instead of '0' or '1'.
15.The method as claimed in claim 1, wherein said port forwarded connection can be for 1-level NAT port forwarding, as well as for multilevel port forwarding.
16.The method as claimed in claim 1, wherein the sequence of port forwarding and connection reversal can be interchanged.

17.The method as claimed in claim 1, wherein multiple subsets of said method can be created to accomplish the task by implementing the method steps partially.
18. A method of establishing connection of a client device with a server device for communication therebetween, substantially as herein described and illustrated in the figures of the accompanying drawings.

The present invention relates to a method of establishing connection between a client device and a server device for communication therebetween. In particular it relates to a method of communication between two devices, like two computers by fusion of connection reversal and port forwarding techniques.
This invention provides a mechanism for establishing network connection between two devices.

Documents

Application Documents

# Name Date
1 2004-KOL-2008_EXAMREPORT.pdf 2016-06-30
1 abstract-2004-kol-2008.jpg 2011-10-07
2 2004-kol-2008-specification.pdf 2011-10-07
2 2004-kol-2008-abstract.pdf 2011-10-07
3 2004-kol-2008-gpa.pdf 2011-10-07
3 2004-kol-2008-claims.pdf 2011-10-07
4 2004-kol-2008-correspondence.pdf 2011-10-07
4 2004-kol-2008-form 3.pdf 2011-10-07
5 2004-kol-2008-form 2.pdf 2011-10-07
5 2004-kol-2008-description (complete).pdf 2011-10-07
6 2004-KOL-2008-FORM 18.pdf 2011-10-07
6 2004-kol-2008-drawings.pdf 2011-10-07
7 2004-kol-2008-form 1.pdf 2011-10-07
8 2004-KOL-2008-FORM 18.pdf 2011-10-07
8 2004-kol-2008-drawings.pdf 2011-10-07
9 2004-kol-2008-form 2.pdf 2011-10-07
9 2004-kol-2008-description (complete).pdf 2011-10-07
10 2004-kol-2008-correspondence.pdf 2011-10-07
10 2004-kol-2008-form 3.pdf 2011-10-07
11 2004-kol-2008-claims.pdf 2011-10-07
11 2004-kol-2008-gpa.pdf 2011-10-07
12 2004-kol-2008-specification.pdf 2011-10-07
12 2004-kol-2008-abstract.pdf 2011-10-07
13 abstract-2004-kol-2008.jpg 2011-10-07
13 2004-KOL-2008_EXAMREPORT.pdf 2016-06-30