The present invention relates to an Advanced Domain Name System for implementing method of data transfer between TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) in transport layer for IP protocols in application layer of the Communications Protocol, and more particularly to a bilateral firewall traversal method between a PC (personal computer) and a server for traversing NAT (Network Address Translator) firewall.
Domain Name System (DNS) is an existing system for converting a domain name into an IP address. As shown in
Dynamic Domain Name System (DDNS) is also an existing system for converting a domain name into a dynamic IP address. As shown in
DDNS server 14 will then acknowledge the newest IP address of server 2 (step 4). If PC 1 wants to connect with server 2, first inquires DDNS server 14 for the newest IP address of UB (step 5), DDNS server 14 will then respond the newest IP address of UB to PC 1 (step 6), thereafter PC 1 uses the newest IP address of UB for connecting with sever 2 (step 7).
But if both PC 1 and server 2 are installed with NAT (Network Address Translator) firewall, PC 1 cannot connect with server 2 even if PC 1 acquires the newest IP address of UB of server 2 from DDNS 14.
Communication Protocols have five layers, i.e. physical layer, data link layer, network layer, transport layer and application layer. The present invention relates to transport layer and application layer. In application layer there are HTTP (HyperText Transfer Protocol), RTSP (Real Time Streaming Protocol), SIP (Session Initiation Protocol), etc. In transport layer there are TCP (Transmission Control Protocol) and UDP (User Datagram Protocol), etc. TCP is a reliable channel transmission, while UDP is an unreliable channel transmission. IP protocols like HTTP and RTSP which need reliable channel transmission generally transmit data on TCP. If HTTP and RTSP wants to be transmitted on UDP, a reliable transmitting method must be implemented on UDP.
Referring to
Referring to
The object of the present invention is to provide an Advanced Domain Name System for processing data transfer between TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) in transport layer for IP protocols in application layer of the Communications Protocol, and and more particularly to a bilateral NAT firewall traversal method.
The system of the present invention comprises:
The method of the present invention comprises steps of:
The aforementioned step k and step n have to conduct a conversion as stated below:
Data transferred from TCP channel (such as IP GET packet, IP 200 OK packet) are sent to a first numbering header for assigning an identifying number header to the data, and then sent to a UDT Library, the UDT Library will add a UDT-dedicated header to the data transferred from TCP channel, and let the data transfer through UDP channel by a reliable mechanism of UDT;
The aforementioned-step m and step o have to conduct a conversion as stated below:
Data transferred from UDP channel (such as IP GET packet, IP 200 OK packet) are determined if it is a UDT packet, If the data has a UDT header, then it is a UDT packet, so the packet is sent to the UDT Library to delete the UDT header, and sent to the first numbering header to delete the identifying number header, then sent through a corresponding TCP channel according to the identifying number;
The aforementioned UDT Library can be downloaded from http://udt.sourceforge.net/software.html.
Referring to
In
Referring to
Concurrently, server 2 provides three communication service ports i, ii, iii, and sends a SetServicePort (i, ii, iii) message to ADNS module 7 to express a service can be provided. Server 2 will then sends a Setup message to ADNS module 7 to express beginning of traversing NAT firewall 4, thereafter ADNS module 7 sends a Register UB message to ADNS server 5 through NAT firewall 4, then ADNS server 5 returns a Register UB OK message to ADNS module 7 through NAT firewall 4. The registrations are conducted for several times so that ADNS module 7 detects the communication port allocating rule of NAT firewall 4 (called Rule-B).
Thereafter PC 1 sends a GetInfo (UB) message to ADNS module 6 to express the intention to get the IP address of UB of server 2.
First, both sides must acquire the communication ports and communication port allocating rules each other. ADNS module 6 sends a Sampling message to ADNS server 5 through NAT firewall 3, ADNS server 5 will then return a Sampling OK message to ADNS module 6 through NAT firewall 3 so that ADNS module 6 acquires communication port X of NAT firewall 3. Then ADNS module 6 sends Invite UB message including communication port X and Rule A to ADNS server 5 through NAT firewall 3. ADNS server 5 sends the Invite UB message including communication port X and Rule A to ADNS module 7 through NAT firewall 4.
ADNS module 7 also sends a Sampling message to ADNS server 5 through NAT firewall 4, ADNS server 5 returns a Sampling OK message to ADNS module 7 through NAT firewall 4 so that ADNS module 7 acquires communication port Y of NAT firewall 4. Then ADNS module 7 sends Invite OK message including communication port Y and Rule-B to ADNS server 5 through NAT firewall 4. ADNS server 5 sends the Invite OK message including communication port Y and Rule-B to ADNS server 6 through NAT firewall 3.
Both ADNS module 6 and ADNS module 7 acquire communication port and communication port allocating rule of the opposite side, and send Peer OK message to the opposite side according to the communication port allocating rule to achieve traversing firewalls.
Continuously referring to
At this time, the UDP channel between ADNS module 6 and ADNS module 7 has been getting through. The channel between PC 1 and ADNS module 6 as well as the channel between ADNS module 7 and server 2 are TCP channels.
PC 1 conducts three-way-handshaking with ADNS module 6 according to the pretended local IP address of UB of server 2. PC1 first sends SYN message to i port of ADNS module 6, then i port of ADNS module 6 returns SYN-ACK message to PC 1, finally PC 1 sends ACK message to i port of ADNS module 6 for achieving three-way-handshaking. Thereafter i port of ADNS module 6 sends Notify TCP connect message to ADNS module 7 to enable ADNS module 7 and i port of server 2 to perform three-way-handshaking.
ADNS module 7 first sends SYN message to i port of server 2, then i port of server 2 returns SYN-ACK message to ADNS module 7, finally ADNS module 7 sends ACK message to i port of server 2 for achieving three-way-handshaking.
PC 1 sends HTTP GET packet to i port of ADNS module 6 for being hold by i port of ADNS module 6.
After ADNS module 7 and server 2 finish three-way-handshaking, ADNS module 7 sends Notify FINE message to i port of ADNS module 6 to express that everything is ready for accepting packets.
Therefore i port of ADNS module 6 sends HTTP GET packet to ADNS module 7, and then ADNS module 7 sends HTTP GET packet to i port of server 2.
The i port Server 2 returns HTTP 200 OK packet to ADNS module 7, and then ADNS-module 7 sends HTTP 200 OK packet to i port of ADNS module 6, thereafter ADNS module 6 sends HTTP 200 OK packet to PC 1 to express that HTTP packet is delivered.
The three communication service ports i, ii, iii of server 2 is for example only, actually it is not limited to three ports. The aforementioned HTTP is also for example only, other IP protocols like RTSP, SIP can also be used, and HTTP GET changes into IP GET, HTTP 200 OK changes into IP 200 OK.
If the channel between PC 1 and ADNS module 6, the channel between ADNS module 6 and ADNS module 7, and the channel between ADNS module 7 and server 2 are all UDP channels (for example SIP protocol), then as shown in
HTTP GET packet from PC 1 to i port of ADNS module 6 is by way of TCP channel, but HTTP GET packet from ADNS module 6 to ADNS module 7 is by way of UDP channel, so a conversion has to be conducted in ADNS module 6. Similarly, HTTP 200 OK packet from i port of server 2 to ADNS module 7 is by way of TCP channel, but HTTP 200 OK packet from ADNS module 7 to ADNS module 6 is by way of UDP channel, so a conversion has to be conducted in ADNS module 7.
Referring to TCP converter 8 and UDP converter 9 in
Data transferred from TCP channel are sent to numbering header 10 for assigning an identifying number header to the data, and then sent to UDT Library 11. UDT means “UDP-based Data Transfer Protocol”, which is an algorithm for implementing reliable data transfer on UDP channel. UDT Library 11 will add UDT-dedicated header to the data transferred from TCP channel, and let the data transfer through UDP channel by the reliable mechanism of UDT, as shown by “UDP Send”. UDT Library 11 can be downloaded from http://udt.sourceforge.net/software.html.
Data transferred from UDP channel are sent to numbering header 12 for assigning an identifying number header to the data, and then sent to UDP channel directly, as shown by “UDP Send”.
The aforementioned HTTP GET packet from i port of ADNS module 6 to ADNS module 7 is by way of UDP channel, but HTTP GET packet from ADNS module 7 to i port of server 2 is by way of TCP channel, a conversion has to be conducted. Similarly, HTTP 200 OK packet from ADNS module 7 to i port of ADNS module 6 is by way of UDP channel, but HTTP 200 OK packet from ADNS module 6 to PC 1 is by way of TCP channel, a conversion has also to be conducted.
Referring to TCP converter 8 and UDP converter 9 in
The jobs in
The scope of the present invention depends upon the following claims, and is not limited by the above embodiments.
Number | Date | Country | Kind |
---|---|---|---|
103104646 | Feb 2014 | TW | national |