1. Field of the Invention
The instant disclosure relates to a network system and a method of establishing network connection; in particular, to a system establishing peer to peer connection between a first network device and a second network device and the method of establishing the connection.
2. Description of Related Art
The development of Internet and the application thereof have increased. The reliance on Internet grows considerably. Therefore the number of computers that needs to connect to the Internet increases dramatically. However, the number of public IP address is limited, and the available public IP address is seriously lower than the demand.
To allow more computer devices to connect to the Internet, the network address translation (NAT) technique is developed. NAT translates a private IP to a public IP. More specifically, in the private domain, if a computer is going to link to the Internet, NAT server translates the sending address to the only IP address (i.e., public IP address), such that the computer device in a private domain can load the data on the Internet. In this way, NAT partially relieves the burden of insufficient IP address. Although NAT allows computer devices in private domain to load data from the Internet, the computer device excluded from the private domain cannot actively exchange data with the computer device in private domain. Specifically, computer device in private domain uses NAT to translate the sending IP address to a public IP address and send to the Internet, while if another external computer device is going to send package to a computer device in private domain (without actual public IP), it requires manual port mapping to achieve the goal. Otherwise, the package sent by the external computer device will be discarded and fail the transmission. However, port matting requires manually configuring several parameters. If NAT server has many computer devices, it takes a great amount of time to complete all the port mapping configuration, which is time consuming and inconvenient.
Furthermore, conventional point-to-point connection is established by logging in to a server to verify its identity. Computer device passing the verification can share private data to the server. Therefore the server has to store all the membership information and information table of each computer device, such that when a data loading request prompts out, the server can signal the location of the data in which computer device, and the requesting end can establish peer-to-peer connection to the destination end. However, the server has to store all the membership information and data table, such that when too many computer devices are present, the server is overloaded. Therefore, the hardware of the server has to be expanded and the cost increases as well.
The instant disclosure provides a method of establishing network connection for establishing peer-to-peer connection among a plurality of network devices, and the plurality of network devices includes at least a first network device and a second network device. The method includes a first server receiving a connection request package. The first network device sends the connection request package according to a first match table sending a request for establishing connection with the second network device. Then the first server confirms the second network device being connected to the first server. Following that, the first server confirms the type of network address of the first and second network devices and sends a connection signaling package to the second network device. Next, the first server receives a connection response package. The connection response package is sent by the second network device according to a second match table. Finally, the first network device establishing connection with the second network device after the first server confirming connection request package and the connection response package. The first match table is stored in the first network device, the second match table is stored in the second network device, the second match table includes a first identifier in response to the first network device, and the first match table includes a second identifier in response to the second network device.
According to one embodiment of the instant disclosure, the connection request package and the connection response package include the first identifier and the second identifier.
In another embodiment of the instant disclosure, before the step of the first server receiving the connection request package further includes: the first and second network devices executing a matching process by connecting to the first server and the first and second network device respectively establishing the first and second match tables.
In another embodiment of the instant disclosure the matching process includes: the first network device transmitting a matching request package to the first server. The first network device includes the second identifier in response to the second network device, and the matching request package includes the second identifier. The first server transmits a matching signaling package to the second network device according to the matching request package. Then the second network device responds with a matching response package to the first server according to the matching signaling package, and the second network device receives the first identifier in response to the first device through the first server. Finally, the first server transmits a first confirming package to the first and second network devices respectively to signal the first and second network devices of matching completion. After the first and second network devices are matched, the first and second network devices establish the first match table and the second match table respectively.
In another embodiment of the instant disclosure, the first and second match tables are established in the first and second network devices in advance.
In another embodiment of the instant disclosure, the step of the second network device establishing connection with the first network device further includes: if the address type of the first and second network devices being a public address or if the address type of the first network device being a private address and the second network device being a public address, the first server transmitting a second confirmation package to the first and second network devices respectively, such that the first and second network devices establish connection.
In another embodiment of the instant disclosure, the step of the second network device establishing connection with the first network device further includes: if the address type of the first network device being a public address and the address type of the second network device being a private address, the first server transmitting a second confirmation package to the first and second network devices respectively to facilitate the second network device transmitting a connection confirmation package to the first server, such that the second network device establishes connection with the first network device.
In another embodiment of the instant disclosure, the step of the second network device establishing connection with the first network device further includes: if the address type of the first and second network devices being private address, the first server transmitting a second confirmation package to the first and second network devices respectively. Then, the first and second network devices respectively transmit a hole punching request package to the first server. After that, the first server transmits a first hole punching confirmation package and a second hole punching confirmation package to the second and first network devices respectively. The first hole punching confirmation package includes a public address and a public port number of the first network device, and the second hole punching confirmation package includes a public address and a public port number of the second network device. Finally, the first and second network devices inter-transmit a first user data protocol package and a second user data protocol package, and the first network device and the second network device establish connection.
In another embodiment of the instant disclosure, before the step of the first server receiving the connection request package further includes: the first and second network devices establishing connection to a control server. Then, the control server receives the public address of the first and second network devices. Next, the control server obtains the location of the first and second network devices according to the public addresses of the first and second network devices. Finally, the control server selects the first server from a plurality of servers according to the location of the first and second network devices so as to allow the first and second network devices to establish connection.
In another embodiment of the instant disclosure, when the first server is malfunctioned, the control server selects a second server from the plurality of servers to replace the first server, such that the first and second network devices establish connection with the second server.
According to one embodiment, the instant disclosure also provides a network system. The network system includes a server and a plurality of network devices. The plurality of network devices includes at least a first network device and a second network device, the first network device and the second network device are respectively connected to the server. The first network device transmits a connection request package to the server according to a first match table, the server confirms the address type of the first and second network devices and transmits a connection signaling package to the second network device, the second network device transmits a connection response package according to a second match table, the server confirms the connection request package and the connection response package are matched, and the first network device establishes connection with the second network device.
In summary, the instant disclosure provides the network system and the method of establishing connection thereof. The first and second match tables are built in the first and second network devices in advance. If the first and second network devices are going to be connected, after the first server compares the connection request package sent by the first network device and the connection response package sent by the second network device, the first and second network devices automatically proceed with associated connection process, such that the first and second network devices establish connection. In this way, users do not need to configure each network parameters of the first and second network devices manually, and the first server does not need to store a data table for the first and second network device to share the information. In the instant disclosure, after verifying the identity information of the first and second network devices and found matched, the first and second network devices execute specific connection action in response to the address type, such that peer-to-peer connection can be established and the loading of the first server is reduced.
In order to further understand the instant disclosure, the following embodiments are provided along with illustrations to facilitate the appreciation of the instant disclosure; however, the appended drawings are merely provided for reference and illustration, without any intention to be used for limiting the scope of the instant disclosure.
The aforementioned illustrations and following detailed descriptions are exemplary for the purpose of further explaining the scope of the instant disclosure. Other objectives and advantages related to the instant disclosure will be illustrated in the subsequent descriptions and appended drawings.
It should be understood that the usage of “first”, “second” and “third” intends to distinguish one element from another, and the element should not be limited by the term. Therefore, hereinafter a first element is interchangeable with a second element. The term “and/or” includes one and one or more of the combination in the group as described.
Please refer to
In the instant embodiment, the first network device 12 and the second network device 13 are connected to the first server 11 through the Internet 14. Also, according to the first and second match table, the first network device 12 and the second network device 13 undergo comparison through the first server 11, such that the two network devices can establish peer-to-peer Internet connection.
The first and second match tables are built before the first network device 12 and the second network device 13 are dispatched. The manufacturer builds the first match table in the memory of the first network device 12, and the manufacturer builds the second match table in the memory of the second network device 13. The second match table includes a first identifier of the first network device 12, and the first match table includes a second identifier of the second network device 13. The first and second match tables may also have the first identifier of the first network device and the second identifier of the second network device at the same time, and the instant disclosure is not limited thereto. In the instant embodiment, the first and second identifiers may includes user identifier (UID) and password of the first and second network devices 12, 13. However, the instant disclosure is not limited thereto. The first and second identifier may also by other types of verification code. The first and second identifiers may not include any password but only include user identifier (UID), and it is subject to user requirement, and the instant disclosure is not limited thereto.
The number of network device in the network system 10 is not limited in the instant disclosure. In the instant embodiment the first network device 12 and the second network device 13 are used for exemplary purpose, and the network devices can be more than two according to the practical requirement.
It should be noted that in another embodiment, through a matching process, the user can also manually establish the first and second match tables or add new content to the first and second match tables. More specifically, please refer to
Subsequently, the first server 11 transmits a matching signaling package to the second network device 13 (S202). The matching signaling package is used to inform the second network device 13 that the first network device 12 attempts to undergo matching. The matching signaling package includes the first identifier of the first network device 12 and the second identifier of the second network device 13. The second network device 13 obtains the first identifier of the first network device 12 through the matching signaling package and verifies whether the second identifier in the matching signaling package is correct or not. If the result is correct, the second network device 13 responds with a matching response package to the first server 11 to inform the matching result is matched (S203). The first server 11 transmits a first confirmation package to the first network device 12 and the second network device 13 respectively so as to signal the first network device 12 and the second network device 13 of matching completion (S204). After the matching, the first network device 12 and the second network device 13 establish the first match table and the second match table respectively. Alternatively, the content of the first and second match tables are renewed.
The working theory of the network system and the method of establishing network connection is described hereinafter.
Please refer to
Step S310: the first server 11 receiving a connection request package. More specifically, the first network device 12 is connection to the first server 11 (i.e., the first network device 12 is at online status), and the first network device 12 sends connection request package to the first server 11. The connection request package includes the first identifier of the first network device 12 and the second identifier in response to the second network device 13.
Step S320: the first server 11 confirming the second network device 13 being connected thereto. More specifically, according to the received connection request package, the first server 11 detects whether the second network device 13 is connected to the first server 11 or not (i.e., detect whether the second network device 13 is at online status or not). If the second network device 13 is not connected, the first server 11 holds until the second network device 13 establishes connection with the first server 11.
Step S330: the first server 11 confirming the address type of the first network device 12 and the second network device 13 and transmitting connection signaling package to the second network device 13. Specifically, after the first network device 12 and the second network device 13 are connected to the first server 11, the first server further confirms the address type of the first network device 12 and the second network device 13 (i.e., whether the address type is public IP or private IP) according to the connection request package. Furthermore, the first server 11 sends connection signaling package to the second network device 13 to inform the second network device 13 that the first network device 12 is going to establish connection thereto. The connection signaling package includes the first identifier of the first network device 12.
Step S340: the first server 11 receiving connection response package. Specifically, after the second network device 13 receives connection signaling package, the first server 11 receives the connection response package from the second network device 13. The connection response package includes the second identifier in response to the second network device 13 and the first identifier in response to the first network device 12. The first identifier of the network device 12 is sent by the second network device 13 according to the second match table.
Step S350: the first server 11 comparing the connection request package and the connection response package. More specifically, when the first server 11 receives the connection response package, the first server 11 compares the connection request package and the connection response package and confirms whether the content of the connection request package and the connection response package match or not (i.e., whether the first and second identifiers of the connection request package and the connection response package match). If the content matches, the process enters step S360. If the content does not match, the first network device 12 and the second network device 13 cannot establish peer-to-peer connection.
Step S360: the second network device 13 establishing connection with the first network device 12. More specifically, when the first server 11 compares the connection request package and the connection response package and they match, the first network device 12 and the second network device 13 execute a connection mode to establish connection. According to the address type of the first network device 12 and the second network device 13, the connection mode can be divided into a first, a second and a third connection modes which will be further discussed hereinafter.
The working theory of the network system and method of establishing network connection in accordance with another embodiment of the instant disclosure is elaborated hereinafter.
Please refer to
Another embodiment is further described hereinafter.
Please refer to
Another embodiment is further described hereinafter.
Please refer to
In
Another embodiment of the instant disclosure is elaborated hereinafter.
Please refer to
Specifically, under the network system 70, the first server 11, second server 73 and third server 74 are connected to the control server 71, and the first network device 12, second network device 13 and third network device 72 are connected to the control server 71. After the first network device 12, second network device 13 and third network device 72 are connected to the control server 71, the control server 71 obtains the public IP address and UID code of the first network device 12, second network device 13 and third network device 72. According to the public IP address and the code content, the control server 71 determines the location (e.g., Taiwan or the States) where the first network device 12, second network device 13 and third network device 72 are.
Next, according to the country where the first network device 12, second network device 13 and third network device 72 are, the control server 71 selects a suitable server from the first server 11, second server 73 and third server 74 to assign to the first network device 12, second network device 13 and third network device 72. For example, if the location of the first network device 12 is in the U.S., the control server 71 selects the suitable server (from the first server 11, second server 73 and third server 74) in the same location as the first network device 12 for connection. Similarly, according to the UID code of the first network device 12, second network device 13 and third network device 72, the control server 71 selects at least one suitable server from the first server 11, second server 73 and third server 74 to interconnect with the first network device 12, second network device 13 and third network device 72.
For example, if the first network device 12 is a mobile device (e.g., tablet or smart phone), and the second network device 13 and third network device 72 are IP cameras, as shown in
In addition, please refer to
In summary, in the method of establishing network connection of the instant disclosure, the first and second match tables are built in advance in the first and second network device. If the first network device is going to establish connection with the second network device, the first server compares the connection request package sent by the first network device and the connection response package sent by the second network device. Then the first and second network devices automatically undergo relevant connection procedure (the first, second or third connection mode), such that the first and second network devices can establish connection. In this way, the user does not need to reconfigure each network parameter settings, and the first server does not need to store the data table including the first and second network devices. After the first server verifies the identity of the first and second network devices and finds them match, the first and second network devices can execute specific connection mode for peer-to-peer connection according to their address type.
The descriptions illustrated supra set forth simply the preferred embodiments of the instant disclosure; however, the characteristics of the instant disclosure are by no means restricted thereto. All changes, alternations, or modifications conveniently considered by those skilled in the art are deemed to be encompassed within the scope of the instant disclosure delineated by the following claims.
Number | Date | Country | Kind |
---|---|---|---|
102141007 | Nov 2013 | TW | national |