TWI600298B - Methods for nat (network address translation) traversal and systems using the same - Google Patents
Methods for nat (network address translation) traversal and systems using the same Download PDFInfo
- Publication number
- TWI600298B TWI600298B TW105108222A TW105108222A TWI600298B TW I600298 B TWI600298 B TW I600298B TW 105108222 A TW105108222 A TW 105108222A TW 105108222 A TW105108222 A TW 105108222A TW I600298 B TWI600298 B TW I600298B
- Authority
- TW
- Taiwan
- Prior art keywords
- node
- network address
- router
- address translation
- packet
- Prior art date
Links
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Description
本發明關連於一種網路位址轉換技術,特別是一種網路位址轉換穿透方法以及使用該方法的系統。 The present invention relates to a network address translation technique, and more particularly to a network address translation penetration method and a system using the same.
網路位址轉換穿透技術(NAT,Network Address Transition traversal),亦稱為穿洞技術(hole punching),是一種用以建立二個裝置間連線的電腦網路方法,這二個裝置因為NAT技術而彼此不知道對方的位址。為實現NAT穿透技術,系統需要中間伺服器來交換位於NAT之後的裝置的外部位址,例如網路位址轉換穿透之工作階段穿透(STUN,Session Traversal Utilities for NAT)伺服器、互動式連線建立(ICE,Interactive Connectivity Establishment)伺服器等。中間伺服器的工作流程精簡,用以於二者間的連線建立時紀錄客戶端的外部位址。一旦另一個客戶端(稱為B)希望與NAT之後的客戶端A建立連線,客戶端B向中間伺服器發出穿孔請求(punch request)。然後,中間伺服器將協助客戶端A及客戶端B間的外部地址交換,使得客戶端A及客戶端B可啟動NAT程序。NAT方法的效能關連於現行的NAT運作機制,可能有以下缺點。首先,為了讓NAT工作階段表中客戶端與中間伺服器間的連線紀 錄持續活著,客戶端必須週期性地送封包至中間伺服器,造成中間伺服器承受大量的負擔。其二,因為叢集中之中間伺服器間的資訊交換困難,使得叢集不能隨意地增加新的中間伺服器或移出原有的中間伺服器。因此,需要一種網路位址轉換穿透方法以及使用該方法的系統,解決以上所述的缺陷。 Network Address Transition traversal (NAT), also known as hole punching, is a computer network method used to establish a connection between two devices. NAT technology does not know each other's address. In order to implement the NAT penetration technology, the system needs an intermediate server to exchange the external address of the device behind the NAT, such as the STARAN (Session Traversal Utilities for NAT) server, interaction ICE (Interactive Connectivity Establishment) server, etc. The workflow of the intermediate server is streamlined to record the external address of the client when the connection between the two is established. Once another client (referred to as B) wishes to establish a connection with client A after NAT, client B issues a punch request to the intermediate server. Then, the intermediate server will assist in the exchange of external addresses between client A and client B, so that client A and client B can start the NAT program. The performance of the NAT method is related to the current NAT operating mechanism and may have the following disadvantages. First, in order to make the connection between the client and the intermediate server in the NAT work phase table The recording continues to live, and the client must periodically send the packet to the intermediate server, causing the intermediate server to bear a lot of burden. Second, because the information exchange between the intermediate servers in the cluster is difficult, the cluster cannot randomly add new intermediate servers or remove the original intermediate servers. Therefore, there is a need for a network address translation penetration method and a system using the same that solve the above-described drawbacks.
本發明的實施例提出一種網路位址轉換穿透方法,由一個節點中的處理單元執行,包含以下步驟。處理單元經由路由器發送初始封包給中間伺服器,其中包含節點的識別資訊。處理單元週期性經由路由器發送封包給黑洞,使得路由器能維護節點及黑洞間的工作階段資訊。 Embodiments of the present invention propose a network address translation penetration method, which is executed by a processing unit in a node, and includes the following steps. The processing unit sends the initial packet to the intermediate server via the router, which contains the identification information of the node. The processing unit periodically sends the packet to the black hole via the router, so that the router can maintain the working phase information between the node and the black hole.
本發明的實施例提出一種網路位址轉換穿透方法,由一個中間伺服器中的處理單元執行,包含以下步驟。從第一節點接收到穿孔請求,其中包含第二節點的識別資訊。偽造黑洞與第二節點間的錯誤封包,並傳送錯誤封包給第二節點,並且錯誤封包的資料段包含第一節點的外部位址。 Embodiments of the present invention propose a network address translation penetration method, which is executed by a processing unit in an intermediate server, and includes the following steps. A puncturing request is received from the first node, which includes identification information of the second node. The error packet between the black hole and the second node is forged, and the error packet is transmitted to the second node, and the data segment of the error packet includes the external address of the first node.
本發明的實施例提出一種網路位址轉換穿透系統包含一個節點。節點經由路由器發送初始封包給中間伺服器,其中包含節點的識別資訊。節點更判斷路由器的網路位址轉換類型;以及,如果網路位址轉換類型不是對稱網路位址轉換,週期性經由路由器發送封包給黑洞,使得路由器能維護節點及黑洞間的工作階段資訊。 Embodiments of the present invention provide a network address translation penetration system that includes a node. The node sends the initial packet to the intermediate server via the router, which contains the identification information of the node. The node further determines the type of network address translation of the router; and if the network address translation type is not a symmetric network address translation, periodically sends a packet to the black hole via the router, so that the router can maintain the working phase information between the node and the black hole. .
100‧‧‧網路 100‧‧‧Network
110‧‧‧路由器 110‧‧‧ router
111‧‧‧網路附加儲存系統 111‧‧‧Network Attached Storage System
130‧‧‧路由器 130‧‧‧ router
131‧‧‧手機 131‧‧‧Mobile phones
133‧‧‧平板電腦 133‧‧‧ Tablet PC
135‧‧‧個人電腦 135‧‧‧ PC
150_1、...、150_n‧‧‧中間伺服器 150_1,...,150_n‧‧‧Intermediate server
210‧‧‧處理單元 210‧‧‧Processing unit
220‧‧‧顯示裝置 220‧‧‧ display device
230‧‧‧輸入裝置 230‧‧‧ Input device
240‧‧‧儲存單元 240‧‧‧ storage unit
250‧‧‧記憶體 250‧‧‧ memory
260‧‧‧網路介面卡 260‧‧‧Network Interface Card
261‧‧‧輸出入埠 261‧‧‧Import and export
263_1、...、263_n‧‧‧傳送/接收佇列 263_1,...,263_n‧‧‧Transmission/receive queue
310‧‧‧處理單元 310‧‧‧Processing unit
340‧‧‧儲存裝置 340‧‧‧Storage device
350‧‧‧記憶體 350‧‧‧ memory
360‧‧‧通訊介面 360‧‧‧Communication interface
410‧‧‧處理單元 410‧‧‧Processing unit
420‧‧‧顯示單元 420‧‧‧ display unit
430‧‧‧輸入裝置 430‧‧‧ input device
440‧‧‧儲存單元 440‧‧‧ storage unit
450‧‧‧記憶體 450‧‧‧ memory
460‧‧‧通訊介面 460‧‧‧Communication interface
(1)、...、(6)‧‧‧步驟 (1),...,(6)‧‧‧ steps
500‧‧‧黑洞 500‧‧‧Black Hole
S710~S770‧‧‧方法步驟 S710~S770‧‧‧ method steps
第1圖係依據本發明實施例之網路位址轉換穿透系統的網路架構圖。 1 is a network architecture diagram of a network address translation penetration system in accordance with an embodiment of the present invention.
第2圖係依據本發明實施例的路由器的系統架構圖。 2 is a system architecture diagram of a router according to an embodiment of the present invention.
第3圖係依據本發明實施例的網路附加儲存的系統架構圖。 Figure 3 is a system architecture diagram of network attached storage in accordance with an embodiment of the present invention.
第4圖係依據本發明實施例的客戶端的系統架構圖。 Figure 4 is a system architecture diagram of a client in accordance with an embodiment of the present invention.
第5A至5C圖係依據本發明實施例之網路位址轉換穿透示意圖。 5A-5C are schematic diagrams of network address translation penetration in accordance with an embodiment of the present invention.
第6圖係依據本發明實施例之網路位址轉換穿透的訊息流程圖。 Figure 6 is a message flow diagram of network address translation penetration in accordance with an embodiment of the present invention.
第7圖係依據本發明實施例的週期性向外傳送封包的方法流程圖。 FIG. 7 is a flow chart of a method for periodically transmitting a packet outward according to an embodiment of the present invention.
以下說明係為完成發明的較佳實現方式,其目的在於描述本發明的基本精神,但並不用以限定本發明。實際的發明內容必須參考之後的權利要求範圍。 The following description is a preferred embodiment of the invention, which is intended to describe the basic spirit of the invention, but is not intended to limit the invention. The actual inventive content must be referenced to the scope of the following claims.
必須了解的是,使用於本說明書中的”包含”、”包括”等詞,係用以表示存在特定的技術特徵、數值、方法步驟、作業處理、元件以及/或組件,但並不排除可加上更多的技術特徵、數值、方法步驟、作業處理、元件、組件,或以上的任意組合。 It must be understood that the terms "comprising", "comprising" and "the" are used in the <RTI ID=0.0> </RTI> <RTIgt; </ RTI> to indicate the existence of specific technical features, numerical values, method steps, work processes, components and/or components, but do not exclude Add more technical features, values, method steps, job processing, components, components, or any combination of the above.
於權利要求中使用如”第一”、"第二"、"第三"等詞係用來修飾權利要求中的元件,並非用來表示之間具有優先權順序,先行關係,或者是一個元件先於另一個元件,或者是執 行方法步驟時的時間先後順序,僅用來區別具有相同名字的元件。 The words "first", "second", and "third" are used in the claims to modify the elements in the claims, and are not used to indicate a priority order, an advance relationship, or a component. Before another component, or The chronological order of the method steps is only used to distinguish components with the same name.
第1圖係依據本發明實施例之網路位址轉換穿透系統的網路架構圖,包含二個路由器(routers)110及130。路由器110及130中之每一者於電腦網路間傳遞網路封包。網路封包通常經由網路100從一個路由器傳遞至另一個路由器,直到目的地節點為止,進而形成一個互聯網路。路由器以二個資料線連接上不同的網路。當封包從一個資料線傳遞至路由器,路由器讀取封包中的位址資訊並決定最後的目的地。接著使用內存的路由表(routing table)或路由政策(routing policy)的資訊,將網路封包傳遞至下一個網路。路由器110及130中之任一者可為家用或小型辦公室路由器,用以於連接裝置及網路100間傳遞資料,例如,網頁、電子郵件、即時訊息、聲音串流、視訊串流等。路由器110及130中之每一者實施網路位址轉換技術,用以將多個內部裝置對應至一個公開的網際網路協議(IP,Internet Protocol)位址。於常見設置中,區域網路(LAN,Local Area Network)使用多個指定內部IP位址子網域中之一者。於區域網路上的路由器擁有於上述位址空間中的一個內部位址(internal address)以及一個由ISP供應商給予用以連接至網路100的外部位址(external address)。當網路封包從區域網路傳遞至網路100時,每一封包的來源位址快速的從內部位址更改為外部位址。路由器追蹤每一個有效連線(特別是目的地位址及埠號)的基本資料。當一個回覆傳遞回路由器,路由器使用於轉出階段(outbound phase)儲存的連線追蹤資料決定欲傳遞此 回覆至哪一個區域網路的內部位址。 1 is a network architecture diagram of a network address translation penetration system according to an embodiment of the present invention, including two routers 110 and 130. Each of routers 110 and 130 communicates a network packet between computer networks. Network packets are typically passed from one router to another via network 100 until the destination node, thereby forming an Internet path. The router connects to different networks with two data lines. When a packet is passed from a data line to a router, the router reads the address information in the packet and determines the final destination. The network packet is then passed to the next network using the information of the routing table or routing policy of the memory. Any of the routers 110 and 130 can be a home or small office router for transferring data between the connection device and the network 100, such as web pages, emails, instant messages, voice streams, video streams, and the like. Each of routers 110 and 130 implements a network address translation technique for mapping a plurality of internal devices to a public Internet Protocol (IP) address. In a common setting, a local area network (LAN) uses one of a plurality of designated internal IP address subdomains. The router on the local area network has an internal address in the above address space and an external address given by the ISP provider to connect to the network 100. When a network packet is passed from the local area network to the network 100, the source address of each packet is quickly changed from the internal address to the external address. The router keeps track of the basics of each active connection (especially the destination address and nickname). When a reply is passed back to the router, the router uses the connection tracking data stored in the outbound phase to decide to pass this The internal address of the reply to which local area network.
網路附加儲存(NAS,Network-Attached Storage)系統111透過區域網路連接至路由器110,並且提供資料存取服務給異質的客戶端,例如,手機131、平板電腦133、個人電腦135等。NAS系統111包含一或多個儲存裝置,通常組織為獨立磁碟冗餘陣列(RAID,Redundant Array of Independent Disks)。手機131、平板電腦133及個人電腦135透過區域網路連接至路由器130。雖然本發明實施例描述了網路附加儲存系統111作為範例,但本發明亦可實現於其他的客戶端,例如,智慧型電視、視訊監控系統、視訊播放器等。中間伺服器150_1至150_n形成一個叢集(cluster),用以儲存客戶端的識別資訊及外部位址,例如,手機131、平板電腦133、個人電腦135、NAS系統111等。客戶端可請求中間伺服器150_1至150_n中之任一者,用以取得其他客戶端的外部位址。 The Network-Attached Storage (NAS) system 111 is connected to the router 110 through a local area network, and provides data access services to heterogeneous clients, such as the mobile phone 131, the tablet 133, the personal computer 135, and the like. The NAS system 111 includes one or more storage devices, usually organized as Redundant Array of Independent Disks (RAID). The mobile phone 131, the tablet 133, and the personal computer 135 are connected to the router 130 via a local area network. Although the embodiment of the present invention describes the network attached storage system 111 as an example, the present invention can also be implemented in other clients, such as a smart TV, a video monitoring system, a video player, and the like. The intermediate servers 150_1 to 150_n form a cluster for storing the identification information of the client and the external address, for example, the mobile phone 131, the tablet 133, the personal computer 135, the NAS system 111, and the like. The client may request any of the intermediate servers 150_1 through 150_n to obtain external addresses of other clients.
第2圖係依據本發明實施例的路由器的系統架構圖。此系統架構可實施於路由器110及130中之任一者。路由器組態來接收網路封包,以及決定最終的輸出節點,用以將網路封包傳出路由器。處理單元210可使用多種方式實施,例如以專用硬體電路或通用硬體(例如,單一處理器、具平行處理能力的多處理器、圖形處理器或其他具運算能力的處理器),並且在執行程式碼或軟體時,提供之後所描述的功能。系統架構另包含記憶體250用以儲存執行過程中需要的資料,例如,變數、資料表(data tables)、資料結構等,以及儲存單元240,用以儲存資料。輸入裝置230可包含按鈕、鍵盤、滑鼠、觸控面 板等。使用者可按壓按鈕來產生控制訊號,按壓鍵盤上的硬鍵來輸入字元,藉由操作滑鼠來控制鼠標,或者是在觸控面板製造手勢來控制執行中的應用程式。手勢可包含單擊、雙擊、單指拖曳、多指拖曳等,但不限定於此。顯示單元220可包含顯示面板(例如,薄膜液晶顯示面板、有機發光二極體面板或其他具顯示能力的面板),用以顯示輸入的字元、數字、符號、拖曳鼠標的移動軌跡、繪製的圖案或應用程式所提供的畫面,提供給使用者觀看。網路介面卡(Network adapter)260可組態來使用乙太網路(Ethernet)通訊,具有使用傳輸控制協議/網際網路協議(TCP/IP,Transmission Control Protocol/Internet Protocol)、用戶包協議(UDP,User Datagram Protocol),以及/或其他協議的能力。網路介面卡260包含多個埠(ports)261,每一個埠組態為對內埠(internal port)或對外埠(external port)。網路介面卡260可包含多個傳送/接收(Tx/Rx,transmit and/or receive)佇列263_1至263_n,用以暫存即將傳送以及/或已接收的網路資料。 2 is a system architecture diagram of a router according to an embodiment of the present invention. This system architecture can be implemented in any of routers 110 and 130. The router is configured to receive network packets and determine the final output node to pass the network packets out of the router. The processing unit 210 can be implemented in a variety of manners, such as a dedicated hardware circuit or a general purpose hardware (eg, a single processor, a multiprocessor with parallel processing capabilities, a graphics processor, or other computing capable processor), and When the code or software is executed, the functions described later are provided. The system architecture further includes a memory 250 for storing data required for execution, such as variables, data tables, data structures, and the like, and a storage unit 240 for storing data. The input device 230 can include a button, a keyboard, a mouse, and a touch surface. Board and so on. The user can press a button to generate a control signal, press a hard key on the keyboard to input a character, control the mouse by operating a mouse, or create a gesture on the touch panel to control an executing application. The gesture may include, but is not limited to, a click, a double click, a single-finger drag, a multi-finger drag, and the like. The display unit 220 can include a display panel (eg, a thin film liquid crystal display panel, an organic light emitting diode panel, or other display capable panel) for displaying input characters, numbers, symbols, dragging the mouse's movement track, and drawing The picture provided by the pattern or application is provided for viewing by the user. The Network adapter 260 can be configured to use Ethernet communication with the Transmission Control Protocol/Internet Protocol (TCP/IP), User Packet Protocol ( UDP, User Datagram Protocol, and/or other protocol capabilities. The network interface card 260 includes a plurality of ports 261, each of which is configured as an internal port or an external port. The network interface card 260 can include a plurality of transmit/receive (Tx/Rx, transmit and/or receive) queues 263_1 through 263_n for temporarily storing network data to be transmitted and/or received.
第3圖係依據本發明實施例的網路附加儲存的系統架構圖。處理單元310可使用多種方式實施,例如以專用硬體電路或通用硬體(例如,單一處理器、具平行處理能力的多處理器、圖形處理器或其他具運算能力的處理器),並且在執行程式碼或軟體時,提供之後所描述的功能。系統架構另包含記憶體350用以儲存執行過程中需要的資料,例如,變數、資料表等。儲存裝置340可組織為獨立磁碟冗餘陣列,用以儲存各式各樣的電子檔案,例如,網頁、文件、音訊檔、視訊檔等。 系統架構另包含通訊介面360,讓處理單元310可藉以跟其他電子裝置進行溝通。通訊介面360可以是區域網路通訊模組或無線區域網路通訊模組。 Figure 3 is a system architecture diagram of network attached storage in accordance with an embodiment of the present invention. Processing unit 310 can be implemented in a variety of manners, such as with dedicated hardware circuitry or general purpose hardware (eg, a single processor, multiple processors with parallel processing capabilities, graphics processors, or other computing capable processors), and When the code or software is executed, the functions described later are provided. The system architecture further includes a memory 350 for storing data required for execution, such as variables, data sheets, and the like. The storage device 340 can be organized as a redundant array of independent disks for storing a variety of electronic files, such as web pages, files, audio files, video files, and the like. The system architecture further includes a communication interface 360 for the processing unit 310 to communicate with other electronic devices. The communication interface 360 can be a regional network communication module or a wireless local area network communication module.
第4圖係依據本發明實施例的客戶端的系統架構圖。此系統架構可實施於手機131、平板電腦133、個人電腦135、中間伺服器150_1至150_n中之任一者,或其他具備運算能力的電子裝置。處理單元410可使用多種方式實施,例如以專用硬體電路或通用硬體(例如,單一處理器、具平行處理能力的多處理器、圖形處理器或其他具運算能力的處理器),並且在執行程式碼或軟體時,提供之後所描述的功能。系統架構另包含記憶體450用以儲存執行過程中需要的資料,例如,變數、資料表等,以及儲存裝置440,用以儲存各式各樣的電子檔案,例如,網頁、文件、音訊檔、視訊檔等。系統架構另包含通訊介面460,讓處理單元410可藉以跟其他電子裝置進行溝通。通訊介面460可以是區域網路通訊模組或無線區域網路通訊模組。輸入裝置430可包含鍵盤、滑鼠、觸控面板等。使用者可按壓鍵盤上的硬鍵來輸入字元,藉由操作滑鼠來控制鼠標,或者是在觸控面板製造手勢來控制執行中的應用程式。手勢可包含單擊、雙擊、單指拖曳、多指拖曳等,但不限定於此。顯示單元420可包含顯示面板(例如,薄膜液晶顯示面板、有機發光二極體面板或其他具顯示能力的面板),用以顯示輸入的字元、數字、符號、拖曳鼠標的移動軌跡、繪製的圖案或應用程式所提供的畫面,提供給使用者觀看。 Figure 4 is a system architecture diagram of a client in accordance with an embodiment of the present invention. The system architecture can be implemented in any of the mobile phone 131, the tablet 133, the personal computer 135, the intermediate servers 150_1 to 150_n, or other electronic devices having computing capabilities. Processing unit 410 can be implemented in a variety of manners, such as with dedicated hardware circuitry or general purpose hardware (eg, a single processor, multiprocessor with parallel processing capabilities, a graphics processor, or other computing capable processor), and When the code or software is executed, the functions described later are provided. The system architecture further includes a memory 450 for storing data required for execution, such as variables, data sheets, etc., and a storage device 440 for storing various electronic files, such as web pages, files, audio files, Video files, etc. The system architecture further includes a communication interface 460 for the processing unit 410 to communicate with other electronic devices. The communication interface 460 can be a regional network communication module or a wireless area network communication module. The input device 430 can include a keyboard, a mouse, a touch panel, and the like. The user can press a hard key on the keyboard to enter a character, control the mouse by operating the mouse, or create a gesture on the touch panel to control the executing application. The gesture may include, but is not limited to, a click, a double click, a single-finger drag, a multi-finger drag, and the like. The display unit 420 can include a display panel (eg, a thin film liquid crystal display panel, an organic light emitting diode panel, or other display capable panel) for displaying input characters, numbers, symbols, dragging the mouse's movement track, and drawing The picture provided by the pattern or application is provided for viewing by the user.
以下舉出一個情境,描述於路由器130之後的手機 131、平板電腦133及個人電腦135中之一者(以下稱節點B)試圖與路由器110之後NAS系統111(以下稱節點A)建立連線的過程。第5A至5C圖係依據本發明實施例之網路位址轉換穿透示意圖。第6圖係依據本發明實施例之網路位址轉換穿透的訊息流程圖。節點A的內部位址為192.168.1.2:3456。於開機就緒後,節點A經由路由器110發送初始封包(initial packet)給中間伺服器150_1,其中包含節點A的識別資訊(步驟1)。於此須注意的是,由於初始封包需符合傳輸控制協議/網際網路協議,此初始封包之標頭(header)即包含有節點A之外部位址,因此中間伺服器150_1可藉由初始封包得知節點A之外部位址60.251.87.147:6543。 The following is a scenario, the mobile phone described after the router 130 131. One of the tablet computer 133 and the personal computer 135 (hereinafter referred to as Node B) attempts to establish a connection with the NAS system 111 (hereinafter referred to as node A) after the router 110. 5A-5C are schematic diagrams of network address translation penetration in accordance with an embodiment of the present invention. Figure 6 is a message flow diagram of network address translation penetration in accordance with an embodiment of the present invention. The internal address of node A is 192.168.1.2:3456. After the power-on is ready, the node A sends an initial packet to the intermediate server 150_1 via the router 110, which contains the identification information of the node A (step 1). It should be noted that since the initial packet needs to comply with the Transmission Control Protocol/Internet Protocol, the header of the initial packet contains the location other than the node A, so the intermediate server 150_1 can be initially encapsulated. Know the location outside the node A 60.251.87.147:6543.
路由器110執行NAT功能,用以指派節點A的內部位址及外部位址。中間伺服器150_1接收節點A發送的初始封包,以及紀錄節點A的識別資訊、外部位址至本地資料庫。於此須注意的是,中間伺服器150_1的資料庫紀錄可即時地同步至叢集中其他中間伺服器150_2至150_n,n為大於或等於2的整數,使得中間伺服器150_2至150_n也具有服務節點B的穿孔請求的能力。接著,由於無法預測節點B建立連線的時間點,節點A週期性地傳送封包給黑洞(black hole)500,用以讓路由器110維護關連於節點A與黑洞的工作階段資訊(session information)(步驟2)。範例的工作階段資訊紀錄如下所示:
其中,黑洞500可為不會回覆訊息的裝置,或者是沒有綁定任何裝置的網路位址。此外,黑洞的網路位址與埠可為一預設之網路位址與埠,該預設之網路位址與埠可於節點A向中間伺服器150_1註冊其識別資訊時,由中間伺服器150_1指派給節點A。於其他實施例中,上述之初始封包可另包含黑洞的網路位址與埠,並且中間伺服器150_1可紀錄節點A的識別資訊、外部位址及黑洞的網路位址與埠至本地資料庫。於此須注意的是,路由器110轉遞初始封包給中間伺服器150_1時亦會記錄關連於節點A及中間伺服器150_1間的工作階段資訊。此外,一旦路由器110於指定時間區間沒有接收到由節點A傳送的任何封包,關連於節點A的工作階段資訊會被刪除,並且節點B無法透過路由器110與節點A建立連線。於其他的一些實施方式,節點A可週期性地傳送封包給中間伺服器150_1。然而,以上所述的實施方式會造成中間伺服器150_1耗費不必要的運算資源處理節點A傳送的封包。 The black hole 500 can be a device that does not reply to the message, or a network address that is not bound to any device. In addition, the network address and location of the black hole may be a preset network address and port, and the preset network address and the network address may be registered by the node A to the intermediate server 150_1. The server 150_1 is assigned to the node A. In other embodiments, the initial packet may further include a black hole network address and port, and the intermediate server 150_1 may record the identification information of the node A, the external address, and the network address of the black hole and the local data. Library. It should be noted that the router 110 records the work phase information between the node A and the intermediate server 150_1 when the initial packet is forwarded to the intermediate server 150_1. In addition, once the router 110 does not receive any packets transmitted by the node A within the specified time interval, the session information associated with the node A is deleted, and the node B cannot establish a connection with the node A through the router 110. In some other implementations, node A may periodically transmit packets to intermediate server 150_1. However, the above-described embodiments may cause the intermediate server 150_1 to consume unnecessary computing resources to process the packets transmitted by the node A.
參考第5B圖。節點B的內部位址為192.168.6.5:4321。由於節點B不知道節點A的外部位址,節點B可經由路由器130傳送穿孔請求(punching request)給中間伺服器150_n,其中包含節點A的識別資訊(步驟3)。其中,中間伺服器150_n可藉由穿孔請求之封包的標頭得知節點B的外部位址60.251.87.148:1234。路由器130執行NAT功能,用以指派節點B的內部位址及外部位址。中間伺服器150_n偽造黑洞與節點A間的ICMP(Internet Control Message Protocol)TTL(Time To Live)封包(亦即是錯誤封包)並經由路由器110傳送給節點A,其 中ICMP TTL封包之資料段(payload)包含節點B的外部位址60.251.87.148:1234(步驟4)。於此須注意的是,由於路由器110存在關連於節點A及黑洞500間的工作階段資訊,範例如表1所示,ICMP TTL封包可成功轉遞給節點A。反之,如果中間伺服器150_n試圖經由路由器110傳送由節點B起始的ICMP TTL封包(亦即是ICMP錯誤封包)給節點A,路由器110可能因為不存在節點A及節點B間的工作階段資訊而阻擋ICMP TTL封包。節點B的內部位址及外部位址由路由器130指派。此外,中間伺服器150_n根據節點A的識別資訊搜尋本地資料庫以取得節點A的外部位址60.251.87.147:6543,並且回覆節點A的外部位址給節點B(步驟5)。 Refer to Figure 5B. The internal address of Node B is 192.168.6.5:4321. Since the Node B does not know the external address of the node A, the Node B can transmit a punching request to the intermediate server 150_n via the router 130, which contains the identification information of the node A (step 3). The intermediate server 150_n can know the external address of the Node B by the address of the packet of the puncturing request 60.251.87.148:1234. Router 130 performs a NAT function to assign the internal address and external address of Node B. The intermediate server 150_n forges an ICMP (Internet Control Message Protocol) TTL (Time To Live) packet (that is, an error packet) between the black hole and the node A, and transmits it to the node A via the router 110, The data payload of the ICMP TTL packet contains the external address of Node B 60.251.87.148:1234 (step 4). It should be noted that, because the router 110 has information about the working phase between the node A and the black hole 500, as shown in Table 1, the ICMP TTL packet can be successfully transferred to the node A. Conversely, if the intermediate server 150_n attempts to transmit the ICMP TTL packet (ie, an ICMP error packet) initiated by the Node B to the node A via the router 110, the router 110 may have no session information between the node A and the node B. Block ICMP TTL packets. The internal and external addresses of Node B are assigned by router 130. In addition, the intermediate server 150_n searches the local database according to the identification information of the node A to obtain the external address 60.251.87.147:6543 of the node A, and replies to the external address of the node A to the node B (step 5).
參考第5C圖。節點B從中間伺服器150_n取得節點A的外部位址60.251.87.147:6543,節點A從ICMP TTL封包的資料段得到節點B的外部位址60.251.87.148:1234。於是,節點A及節點B皆有對方的外部位址資訊,因此節點A與節點B間可進行穿洞程序(hole punching process)(步驟6)。換言之,節點A可依據節點B之外部位址60.251.87.148:1234傳送連線請求給節點B,此時路由器110會記錄關連於節點A與節點B間的工作階段資訊。因此,當節點B傳送連線請求給節點A時,此連線請求可經由路由器110轉送給節點A。反之,當節點B依據節點A之外部位址60.251.87.147:6543傳送連線請求給節點A時,路由器130會記錄關連於節點A與節點B間的工作階段資訊。因此,由節點A所回傳之資訊可經由路由器130轉送給節點B。由於此穿洞程序為該領域中具通常知識者所熟知,本發明於此不再贅 述。當穿洞程序完成後,節點B即可請求節點A的服務,例如NAS資料存取。 Refer to Figure 5C. Node B obtains the external address 60.251.87.147:6543 of node A from intermediate server 150_n, and node A obtains the external address of node B from the data segment of ICMP TTL packet 60.251.87.148:1234. Therefore, both node A and node B have external address information of the other party, so a hole punching process can be performed between node A and node B (step 6). In other words, the node A can transmit a connection request to the node B according to the location address 60.251.87.148:1234 outside the node B. At this time, the router 110 records the work phase information related between the node A and the node B. Therefore, when the Node B transmits a connection request to the node A, the connection request can be forwarded to the node A via the router 110. On the other hand, when the node B transmits a connection request to the node A according to the location address 60.251.87.147:6543 of the node A, the router 130 records the work phase information related between the node A and the node B. Therefore, the information returned by node A can be forwarded to node B via router 130. Since this hole punching procedure is well known to those of ordinary skill in the art, the present invention is no longer Said. When the hole punching process is completed, Node B can request the service of Node A, such as NAS data access.
然而,於對稱NAT之後的節點,無法藉傳送封包給黑洞來達成維持工作階段資訊的目的。例如,節點A傳送初始封包給中間伺服器150_1時,路由器110係以埠A1傳送初始封包給中間伺服器150_1。然而,節點A週期性傳送封包給黑洞500時,路由器110係以埠A2(不同於埠A1)週期性傳送封包給黑洞500。因此,中間伺服器150_n無法偽造黑洞500與節點A間的ICMP TTL封包,並經由路由器110傳送給節點A。第7圖係依據本發明實施例的週期性向外傳送封包的方法流程圖。此流程由節點A中的處理單元410於載入並執行特定程式碼時實施。首先,節點A偵測路由器110中的NAT類型(步驟S710),並且判斷NAT類型是否為對稱(symmetric)NAT(步驟S730)。於步驟S710,可透過通訊介面460向路由器110傳送請求詢問NAT類型並接收回覆的結果。若是,週期性傳送封包給中間伺服器150_1,使得路由器110維護關連於節點A及中間伺服器150_1間的工作階段資訊(步驟S770);否則,週期性傳送封包給黑洞500(步驟S750),使得路由器110維護關連於節點A及黑洞500間的工作階段資訊。 However, a node after a symmetric NAT cannot transfer a packet to a black hole to achieve the purpose of maintaining the information of the work phase. For example, when node A transmits the initial packet to intermediate server 150_1, router 110 transmits the initial packet to intermediate server 150_1 with 埠A1. However, when node A periodically transmits a packet to black hole 500, router 110 periodically transmits the packet to black hole 500 with 埠A2 (different from 埠A1). Therefore, the intermediate server 150_n cannot forge the ICMP TTL packet between the black hole 500 and the node A, and transmits it to the node A via the router 110. FIG. 7 is a flow chart of a method for periodically transmitting a packet outward according to an embodiment of the present invention. This flow is implemented by the processing unit 410 in node A when loading and executing a particular code. First, the node A detects the NAT type in the router 110 (step S710), and judges whether the NAT type is a symmetric NAT (step S730). In step S710, the result of requesting the NAT type and receiving the reply can be transmitted to the router 110 via the communication interface 460. If so, the packet is periodically transmitted to the intermediate server 150_1, so that the router 110 maintains the work phase information between the node A and the intermediate server 150_1 (step S770); otherwise, the packet is periodically transmitted to the black hole 500 (step S750), so that The router 110 maintains information on the work phase related to the relationship between the node A and the black hole 500.
雖然第2至4圖中包含了以上描述的元件,但不排除在不違反發明的精神下,使用更多其他的附加元件,已達成更佳的技術效果。此外,雖然第7圖的方法流程圖採用特定的順序來執行,但是在不違法發明精神的情況下,熟習此技藝人士可以在達到相同效果的前提下,修改這些步驟間的順序,所 以,本發明並不侷限於僅使用如上所述的順序。 Although the above-described elements are included in FIGS. 2 to 4, it is not excluded that more other additional elements are used without departing from the spirit of the invention, and a better technical effect has been achieved. In addition, although the method flowchart of FIG. 7 is executed in a specific order, without knowing the spirit of the invention, those skilled in the art can modify the order among the steps while achieving the same effect. Therefore, the present invention is not limited to the use of only the order as described above.
雖然本發明使用以上實施例進行說明,但需要注意的是,這些描述並非用以限縮本發明。相反地,此發明涵蓋了熟習此技藝人士顯而易見的修改與相似設置。所以,申請權利要求範圍須以最寬廣的方式解釋來包含所有顯而易見的修改與相似設置。 Although the present invention has been described using the above embodiments, it should be noted that these descriptions are not intended to limit the invention. On the contrary, this invention covers modifications and similar arrangements that are apparent to those skilled in the art. Therefore, the scope of the claims should be interpreted in the broadest form to include all obvious modifications and similar arrangements.
110‧‧‧路由器 110‧‧‧ router
111‧‧‧節點A 111‧‧‧Node A
130‧‧‧路由器 130‧‧‧ router
131、133、135‧‧‧節點B 131, 133, 135‧‧‧ Node B
150_1、150_n‧‧‧中間伺服器 150_1, 150_n‧‧‧ intermediate server
500‧‧‧黑洞 500‧‧‧Black Hole
Claims (11)
Priority Applications (3)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610239862.9A CN106550058A (en) | 2015-09-17 | 2016-04-18 | Network address translation penetration method and system using same |
| US15/240,376 US10313302B2 (en) | 2015-09-17 | 2016-08-18 | Methods for NAT (network address translation) traversal and systems using the same |
| EP16189250.0A EP3145163A1 (en) | 2015-09-17 | 2016-09-16 | Methods for nat (network address translation) traversal and systems using the same |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US201562219786P | 2015-09-17 | 2015-09-17 |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| TW201713087A TW201713087A (en) | 2017-04-01 |
| TWI600298B true TWI600298B (en) | 2017-09-21 |
Family
ID=59256675
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW105108222A TWI600298B (en) | 2015-09-17 | 2016-03-17 | Methods for nat (network address translation) traversal and systems using the same |
Country Status (1)
| Country | Link |
|---|---|
| TW (1) | TWI600298B (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113452805B (en) * | 2019-09-19 | 2022-06-07 | 华为技术有限公司 | NAT traversal method, equipment and system |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060215684A1 (en) * | 2005-03-08 | 2006-09-28 | Capone Jeffrey M | Protocol and system for firewall and NAT traversal for TCP connections |
| US20120131663A1 (en) * | 2010-11-18 | 2012-05-24 | Kirankumar Anchan | Transmitting keep-alive packets on behalf of a mobile communications device within a wireless communications system |
| US20130145044A1 (en) * | 2006-10-13 | 2013-06-06 | Cisco Technology, Inc. | Discovering Security Devices Located on a Call Path and Extending Bindings at those Discovered Security Devices |
| US8520687B2 (en) * | 2007-07-06 | 2013-08-27 | Alcatel Lucent | Method and apparatus for internet protocol multimedia bearer path optimization through a succession of border gateways |
| US8683019B1 (en) * | 2011-01-25 | 2014-03-25 | Sprint Communications Company L.P. | Enabling external access to a private-network host |
-
2016
- 2016-03-17 TW TW105108222A patent/TWI600298B/en not_active IP Right Cessation
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060215684A1 (en) * | 2005-03-08 | 2006-09-28 | Capone Jeffrey M | Protocol and system for firewall and NAT traversal for TCP connections |
| US20130145044A1 (en) * | 2006-10-13 | 2013-06-06 | Cisco Technology, Inc. | Discovering Security Devices Located on a Call Path and Extending Bindings at those Discovered Security Devices |
| US8520687B2 (en) * | 2007-07-06 | 2013-08-27 | Alcatel Lucent | Method and apparatus for internet protocol multimedia bearer path optimization through a succession of border gateways |
| US20120131663A1 (en) * | 2010-11-18 | 2012-05-24 | Kirankumar Anchan | Transmitting keep-alive packets on behalf of a mobile communications device within a wireless communications system |
| US8683019B1 (en) * | 2011-01-25 | 2014-03-25 | Sprint Communications Company L.P. | Enabling external access to a private-network host |
Non-Patent Citations (1)
| Title |
|---|
| M. Perumal, et al., "STUN Usage for Consent Freshness", draft-ietf-rtcweb-stun-consent-freshness-05, July 4, 2014. J. Rosenberg, et al., "Session Traversal Utilities for NAT (STUN)", Request for Comments: 5389, October 2008. * |
Also Published As
| Publication number | Publication date |
|---|---|
| TW201713087A (en) | 2017-04-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN102984289B (en) | Promote the method that penetrates of NAT and mobile device | |
| JP4083737B2 (en) | Peer-to-peer network communication by network address translation (NAT) | |
| US9143421B2 (en) | Network system capable of implementing stun with the assistance of two network devices and method thereof | |
| US10313302B2 (en) | Methods for NAT (network address translation) traversal and systems using the same | |
| CN102420774B (en) | Method for realizing intranet penetration by using Internet group management protocol (IGMP) and intranet penetration system | |
| CN109729187B (en) | Proxy communication method, system, device and storage medium | |
| CN108632221B (en) | Method, equipment and system for positioning controlled host in intranet | |
| CN104506802A (en) | Video monitoring system, and method for monitoring video data through traversing NAT (Network Address Translation) | |
| CN114500527A (en) | Out-of-band management system and method for edge device | |
| CN114598532B (en) | Connection establishment method, device, electronic device and storage medium | |
| CN108173928A (en) | Method, device, storage medium and terminal equipment for UDP data transmission | |
| US20200127963A1 (en) | Establishing connection between different overlay networks using edge application gateway | |
| CN105979405A (en) | Method and device for accessing video device | |
| CN108833469A (en) | A terminal-to-terminal resource transmission method, device and terminal equipment | |
| CN114301872B (en) | Domain name based access method and device, electronic equipment and storage medium | |
| TWI600298B (en) | Methods for nat (network address translation) traversal and systems using the same | |
| CN101146130A (en) | A method and system for transmitting data between clients | |
| CN111711705A (en) | Method and device for realizing network connection based on proxy node for bidirectional NAT | |
| KR100597405B1 (en) | Data relay system and data relay method using socket application program | |
| US11716222B2 (en) | Communications bridge | |
| US20120047271A1 (en) | Network address translation device and method of passing data packets through the network address translation device | |
| CN108242982A (en) | A kind of server dual-locomotive heat switching processing system | |
| US20140219280A1 (en) | Systems and Methods for Dual Network Address Translation | |
| EP3494672B1 (en) | Techniques for interconnection of controller-and protocol-based virtual networks | |
| JP2013126219A (en) | Transfer server and transfer program |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| MM4A | Annulment or lapse of patent due to non-payment of fees |