TW201223221A - Network apparatus and method for assigning internet protocol addresses for clients - Google Patents

Network apparatus and method for assigning internet protocol addresses for clients Download PDF

Info

Publication number
TW201223221A
TW201223221A TW99140287A TW99140287A TW201223221A TW 201223221 A TW201223221 A TW 201223221A TW 99140287 A TW99140287 A TW 99140287A TW 99140287 A TW99140287 A TW 99140287A TW 201223221 A TW201223221 A TW 201223221A
Authority
TW
Taiwan
Prior art keywords
packet
client
address
server
host
Prior art date
Application number
TW99140287A
Other languages
Chinese (zh)
Inventor
Geng-Tao Zhou
Original Assignee
Hon Hai Prec Ind Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hon Hai Prec Ind Co Ltd filed Critical Hon Hai Prec Ind Co Ltd
Priority to TW99140287A priority Critical patent/TW201223221A/en
Publication of TW201223221A publication Critical patent/TW201223221A/en

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

A method for assigning internet protocol (IP) addresses for clients in local area network (LAN) and a network apparatus utilizing the same. The method comprises receiving request packets for acquiring IP address sent from the clients and forwarding the IP packets to wide area network (WAN). If corresponding response packets for the request packets are received from the WAN in a predetermining time, the response packets are forwarded to the clients in the LAN for assigning public IP addresses. If the predetermining time is timeout, the clients would be assigned dynamic private IP addresses by an internet protocol server service running in the network apparatus.

Description

201223221 六、發明說明: 【發明所屬之技術領域】 [0001]本發明涉分配網際網路協定位址的技術’尤其涉及—種 網路裝置對區域網路之用戶端分配網際網路協定位址的 方法。 [先前技術】 [0002]由於一般企業、機構或個人向網際網路服務提供者 (Internet ServiCe Pr〇vider)購買取得的公用網際 網路協定位址(Public intei_net pFQtQeQl Address ,簡稱為公用IP位址)數量有限,於架設區城網路 (Local Area Network,簡稱為LAN)時,並不足以分g 給所有的用戶端使用,因此目前區域網路内的用戶端所 分配到的IP位址都是屬於私有Ip位址(private IP Ad一 dress)。私有IP位址可讓企業、機構或家庭内部自行遘 用,使得架言史區域網路時有較大的彈性,但缺點是使用 私有IP位址的用戶端無法直接連上網漆網路,網際網路 上的使用者也無法直接存取區域網路_用戶端,必須 經由閘道器或路由器等裝置中的網路位址轉換(Netw〇r*k201223221 VI. Description of the Invention: [Technical Field of the Invention] [0001] The present invention relates to a technique for allocating Internet Protocol Addresses, particularly to a network device that allocates an Internet Protocol address to a client of a regional network. Methods. [Prior Art] [0002] Public Intei_net pFQtQeQl Address (referred to as public IP address) obtained by a general enterprise, institution, or individual from an Internet service provider (Internet ServiCe Pr〇vider) The number is limited. When the Local Area Network (LAN) is set up, it is not enough for all users to use. Therefore, the IP addresses allocated by the clients in the local area network are currently allocated. It belongs to the private IP address (private IP Ad-dress). The private IP address can be used internally by enterprises, institutions or homes, which makes the local network of the history more flexible. However, the disadvantage is that the user using the private IP address cannot directly connect to the Internet. Users on the network cannot directly access the local area network_user terminal, and must be converted by network address in a device such as a gateway or router (Netw〇r*k

Address Translation,簡稱NAT)機制,進行私有/么 用1 P位址的轉換,方才能連接廣域網路(Wide Area Network,如網際網路,簡稱為WAN),或對廣威網絡中 的使用者提供服務。 然而NAT在使用上還是有所限制,例如NAT無法讓廣威網 路中的使用者與區域網路内的用戶端真正建立點對,點的 連線,除此之外,用戶端的服務品質(Q〇s)及安食性等& 099140287 表單編號A0]01 第4頁/共23頁 0992070184^ [0003] 201223221 [0004] [0005] ❹ ❹ [0006] 定也會因而失效。 【發明内容】 有鐘於此,% 竓提供一種對區域網路之用戶端分配IP位址 方去及使用該方法的網路裝置,使得用戶端可以根據 實際的难I ’’境需求選擇使用公用IP位址或者私有Ip 址。 裝置,用於連結一區域網路的用戶端主機與_ 伺服n ’其中該網路裝置包括區域網路端介 面、廣域網路端介面、封包收送模組及動態位址分配模 組。區域網路端介面連結該用戶端主機,廣域網路端介 面連、"°5亥伺服器。當封包收發模組從區域網路端介面接 收用戶端主機所傳送的獲取網際網路協定位址的請求封 包’轉發該請求封包至廣域網路端介面給伺服器,並等 待預疋時間。若預定時間範圍内,從廣域網路端介面 接收到對應於該請求封包的 回覆封包時’ f該回覆封包 轉發至區域網路端介面給用戶端主機。若預定時間已過 未從廣域網路端介面接收到任何對應於該請求封包的 回覆封包時’則動態位址分配模組啟動一網際網路連線 協定伺服器服務,分配—動態私有網際網路協定位址給 用戶端主機。 優選地’該請求封包包括動態主機配置協定請求封包及 乙太網點對點協定請求封包。 優選地,該回復封包包括動態主機配置協定回覆封包及 乙太網點對點協定回覆封包。 099140287 表單編號Α0ΗΗ 第5頁/共23頁 0992070184-0 [0007] 201223221 [0008] 優選地,若該用戶端主機接收到由該網路裝置所轉發的 該回覆封包,則該用戶端主機分配到一公用網際網路協 定位址。 [0009] 優選地,該網際網路連線協定伺服器服務包括動態主機 配置協定伺服器服務及乙太網點對點協定伺服器服務。 [0010] 一種具有連結區域網路的用戶端主機與廣域網路的伺服 器之能力的網路裝置對用戶端主機配置網際網路協定位 址的方法,該方法包括以下步驟:接收來自用戶端主機 關於獲取網際網路協定位址的請求封包並轉發至伺服器 ;等待一預定時間,若於該預定時間内接收來自伺服器 對應於該請求封包的回覆封包,轉發該回覆封包至該用 戶端主機;及若該預定時間已過而未接收來自伺服器對 應於該請求封包的回覆封包,則啟動一網際網路連線協 定伺服器服務,分配一動態私有網際網路協定位址給用 戶端主機。 [0011] 優選地,該請求封包包括動態主機配置協定請求封包及 乙太網點對點協定請求封包。 [0012] 優選地,該回覆封包包括動態主機配置協定回覆封包及 乙太網點對點協定回覆封包。 [0013] 優選地,若該用戶端主機接收到來自該伺服器的該回覆 封包,則該用戶端主機分配到一公用網際網路協定位址 〇 [0014] 優選地,該網際網路連線協定伺服器服務包括動態主機 配置協定伺服器服務及乙太網點對點協定伺服器服務。 099140287 表單編號A0101 第6頁/共23頁 0992070184-0 201223221 [0015] 藉由以下對具體實施方式詳細的描述並結合附圖,將可 輕易的瞭解上述内容及此項發明之技術致果。 【實施方式】 [0016] 本發明所揭露對區域網路之用戶端分配丨p位址的方法可 實施在各種不同的網路裝置中,諸如路由器、間道器等 任何具有連結區域網路與廣域網路功能的網路裝置。請 參閱圖1,所示為可在其中實現本發明的網路環境的一個 實施例的組成元件,包括具有連結區域網路30與廣域網 0 路20功能的網路裝置1〇,位於區域網路3〇中的用戶端主 機31到用戶端主機33可經古網路裝置1〇存取位於廣域網 路2〇一端的伺服器21。 ' -, 剛tt參閱圖2 ’所示為本發明之網路袭置一種實施方式的模 •组圖’為了便於說明,僅圖示與本發明實施方式相關的 部分。網路裝置100為圖i中所示的網路裝置1〇的一種實 施方式’該網路裝置100包含至少一個處理器11〇、記憶 體12〇、計時器模組130、用來連結區域網路3〇的LAN端 ❹ 介面1、用來連結廣域網路2〇的wan端介面15〇、封包 收送模組m、動態位址分賴組17()以錄址轉換模組 =〇。所述模組是可被該處理器11Q所執行的具有特定功 月*"的軟體程式’該等軟體程式儲存於記憶體120、電腦可 讀儲存介質或其他儲存設備。處理器用來執行封包收 '。G動態位址分配模組以及位址轉換模組 18、及,、匕未於圖2不出的應用程式等。記憶體no用來 儲存封包收送模組16〇、動態位址分配模組17〇 、位址轉 換模組180以及其他未於圖2示出的應用程式程式碼、執 099140287 表單編號A0101 第7頁/共23頁 0992070184-0 201223221 士 n式產生的暫時性資料以及其他任何數據等。計 時器模組130經由計時控制如封包收送模組160 、動態位 人配板、.且17〇等應用程式執行時序。l端介面14〇包 3複數支板乙太網路封包傳輪的實體連接埠,讀端介面 3至夕一個支援乙太網路封包傳輸的實體連接埠。 面i5Q需取得公用位址以使得網路裝置⑽ Μ _網_中的用戶端主機(例如則中所示的用戶 端主機33的其中一個或複數個)連結廣域 網路20的設備。在本實施方法中,議端介面15()可藉由 動態主機配置協定(J)ynainic Hc)st C〇nf i gurat i onAddress Translation (NAT) mechanism, which can be used to connect to a wide area network (such as the Internet), or to users in the Guangwei network. service. However, there are still restrictions on the use of NAT. For example, NAT cannot allow users in the Granville network to establish a point-to-point connection with the users in the local area network. In addition, the quality of service on the client side ( Q〇s) and food safety etc. & 099140287 Form No. A0] 01 Page 4 / Total 23 Page 0992070184 ^ [0003] 201223221 [0004] [0005] ❹ ❹ [0006] will also fail. SUMMARY OF THE INVENTION In this case, % 竓 provides a network device for assigning an IP address to a client of a regional network and using the method, so that the user can select and use according to actual difficult requirements. Public IP address or private IP address. The device is used for connecting a local area network host server and a server n. The network device includes a local area network interface, a wide area network interface, a packet delivery module, and a dynamic address allocation module. The local area network interface connects the client host, the WAN interface, and the "°5H server. When the packet transceiver module receives the request packet for obtaining the Internet Protocol address transmitted by the client host from the local area network interface, the request packet is forwarded to the WAN interface to the server, and waits for the preview time. If the reply packet corresponding to the request packet is received from the WAN interface within the predetermined time range, the packet is forwarded to the local area network interface to the client host. If the scheduled time has not received any reply packet corresponding to the request packet from the WAN interface, then the dynamic address allocation module initiates an Internet connection protocol server service, distribution - dynamic private internet The protocol address is given to the client host. Preferably, the request packet includes a dynamic host configuration protocol request packet and an Ethernet peer-to-peer protocol request packet. Preferably, the reply packet includes a dynamic host configuration agreement reply packet and an Ethernet peer-to-peer protocol reply packet. 099140287 Form No. ΗΗ0ΗΗ Page 5/Total 23 Page 0992070184-0 [0007] 201223221 [0008] Preferably, if the client host receives the reply packet forwarded by the network device, the client host is assigned A public internet protocol address. [0009] Preferably, the internet connection agreement server service comprises a dynamic host configuration agreement server service and an Ethernet peer-to-peer protocol server service. [0010] A method for configuring a network protocol address for a client host by a network device having a capability of a client host and a wide area network server connecting the local area network, the method comprising the steps of: receiving a host from the client Retrieving the request packet of the Internet Protocol address and forwarding it to the server; waiting for a predetermined time, if receiving the reply packet corresponding to the request packet from the server within the predetermined time, forwarding the reply packet to the client host And if the predetermined time has elapsed without receiving a reply packet from the server corresponding to the request packet, launching an internet connection protocol server service, assigning a dynamic private internet protocol address to the client host . [0011] Preferably, the request packet includes a dynamic host configuration agreement request packet and an Ethernet peer-to-peer protocol request packet. [0012] Preferably, the reply packet includes a dynamic host configuration agreement reply packet and an Ethernet peer-to-peer protocol reply packet. [0013] Preferably, if the client host receives the reply packet from the server, the client host is assigned to a public internet protocol address [0014], preferably, the internet connection The protocol server service includes the dynamic host configuration protocol server service and the Ethernet peer-to-peer protocol server service. 099140287 Form No. A0101 Page 6 of 23 0992070184-0 201223221 [0015] The above and the technical results of the invention will be readily apparent from the following detailed description of the embodiments of the invention. [Embodiment] The method for allocating a 丨p address to a client of a local area network can be implemented in various network devices, such as a router, an inter-channel, etc., with any connected area network and A network device with a wide area network function. Referring to FIG. 1, there is shown a constituent element of an embodiment of a network environment in which the present invention can be implemented, including a network device having a function of connecting a local area network 30 and a wide area network 0, and is located in a regional network. The client host 31 to the client host 33 in the third port can access the server 21 located at one end of the wide area network 2 via the ancient network device. '-, just as shown in Fig. 2' shows a network diagram of an embodiment of the present invention. For the convenience of description, only parts related to the embodiment of the present invention are illustrated. The network device 100 is an implementation of the network device 1 shown in FIG. 1. The network device 100 includes at least one processor 11 , a memory 12 , a timer module 130 , and a connection area network. The LAN port 路 interface of the channel 3 is used to connect the WAN interface 15 of the WAN 2, the packet delivery module m, and the dynamic address allocation group 17 () to address the conversion module = 〇. The module is a software program having a specific power *" executed by the processor 11Q. The software programs are stored in the memory 120, a computer readable storage medium or other storage device. The processor is used to perform packet reception. The G dynamic address allocation module and the address conversion module 18, and the application programs not shown in FIG. The memory no is used to store the packet delivery module 16〇, the dynamic address allocation module 17〇, the address conversion module 180, and other application code not shown in FIG. 2, and the 099140287 form number A0101 is 7 Page / Total 23 pages 0992070184-0 201223221 Temporary information generated by the n-type and any other data. The timer module 130 executes timings via an application such as a timing control module such as a packet delivery module 160, a dynamic personalization board, and a 17-inch application. L-end interface 14 〇 3 3 复 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 乙 埠The face i5Q needs to obtain a public address such that the client hosts (e.g., one or more of the client hosts 33 shown in the network device) in the network device (10) are connected to the devices of the wide area network 20. In this implementation method, the session interface 15() can be configured by a dynamic host configuration protocol (J) ynainic Hc) st C〇nf i gurat i on

Protocol ’簡稱為DHCP)、乙太網點對點協定( Point-to-Point Protocol over Ethernet,簡稱為 PPPoE)或點對點随道協定(p〇int to Point Tun-neling Protocol,簡稱為 PPTP)與 DHCP 伺服器 211、 PPPoE伺服器212或PPTP伺服器213連結,實現動態主機 配置協定服務、乙太網點對點協定服務或黠對點隧道協 定服務以取得動態公用IP位址,烕是經由處理器110所執 行的程式碼自行設定靜態公用IP杈址。其中DHCP伺服器 211、PPPoE伺服器212以及PPTP伺服器為伺服器21的不 同實施例。 [0018] 封包收送模組160用於接收來自LAN端介面140與WAN端介 面150的封包’還用於傳送封包至LAN端介面140與WAN端 介面150,若封包收送模組丨60接收到來自LAN端介面且 來源IP位址為私有1P位址的IP封包或是來自WAN端介面 且目的IP位址為公用1p位址的IP封包’則將該IP封包傳 099140287 表單煸號A0101 第8頁/共23頁 0992070184-0 201223221 送至位址轉換模組180進行私有ιρ位址與公用汗位址的轉 換;動態位址分配模組17〇根據上述用戶端主機所支援的 網際網路連線協定’提供相對應的DHCp或ppp〇E伺服器 服務’以便分配動態私有邝位址給區域網路3〇的上述用 戶端主機;位址轉換模組18〇用來將封包中所帶區域網路 30内上述用戶端主機的私有Ip位址或ΜΝ端介面15〇的公 用IP位址進行私有/公用邝位址轉換,使得上述用戶端主 機可以連結到WAN端的伺服器並使用其提供的服務。 〇 [_ *參關3,所不為本發明之網路裝置{上述用戶端主機 分配IP位址方法-種料方式拿_,該方法用於圖2 所不的網路裝置1GG中’當區域網路獅的上述用戶端主 機開機後,使用該方法來確定分配給上述用戶端主機的 IP位址。 闕㈣網路30的上述用戶端主機於開機(或是網路連線服務 啟動)後,依據其網際網路連線協定的敦定:,發出相對應 的獲取IP位址睛求的封包,於步驟S31〇,當網路裝置 ί 100之封包收送模組160從LAN端介面14〇接收到該封包, 並解析得知該請求封包内容為獲取1?位址請求,在步驟 320中,經由WAN端介面15〇轉發該獲取ιρ位址請求封包 至WAN端的伺服器,同時間,計時器模組13〇根據用戶端 所支援的網際網路連線協定,啟動一計時器計時預定收 到WAN端伺服器回覆封包的時間範圍。在步驟以加中若 封包收送模組160在前述設定的時間範圍内,收到來自於 WAN端對應於該獲取抒位址請求封包的回覆封包,則於步 驟S340中轉發該回覆封包至LAN端給上述用戶端主機。若 099140287 表單煸號A0101 第9頁/共23頁 、 〇992〇7〇184-〇 201223221 設定時間範圍已過,未收到任何來自於WAN端對應於該獲 取IP位址请求的回覆封包,則如步驟S 3 5 0所不,經由動 態位址分配模組丨7 〇中相應於上述用戶端主機所支援的網 際網路連線協定的伺服器服務,分配一動態私有Ip位址 給上述用戶端主機。亦即網路裝置100會先嘗試讓上述用 戶端主機經由網際網路連線協定取得公用IP位址,除非 W AN端词服器無回應’方才經由動態位址分配模組内建的 伺服器服務分配動態私有丨p位址給LAN端上述用戶端主機 〇Protocol 'abbreviated as DHCP', Point-to-Point Protocol over Ethernet (PPPoE) or peer-to-peer protocol (PPTP) and DHCP server 211. The PPPoE server 212 or the PPTP server 213 is connected to implement a dynamic host configuration protocol service, an Ethernet peer-to-peer protocol service, or a peer-to-peer tunneling protocol service to obtain a dynamic public IP address, which is performed by the processor 110. The code sets the static public IP address by itself. The DHCP server 211, the PPPoE server 212, and the PPTP server are different embodiments of the server 21. [0018] The packet delivery module 160 is configured to receive the packet from the LAN interface 140 and the WAN interface 150, and is also used to transmit the packet to the LAN interface 140 and the WAN interface 150, and if the packet receiving module 丨 60 receives To the IP packet from the LAN interface and the source IP address is the private 1P address or the IP packet from the WAN interface with the destination IP address being the public 1p address, then the IP packet is transmitted to the 099140287 form nickname A0101. 8 pages / 23 pages 0992070184-0 201223221 sent to the address conversion module 180 for the conversion of the private ιρ address and the common Khan address; the dynamic address allocation module 17 〇 according to the Internet supported by the client host The connection agreement 'provides the corresponding DHCp or ppp〇E server service' to allocate the dynamic private address to the above-mentioned client host of the local area network 3; the address conversion module 18 is used to carry the packet The private IP address of the client host in the local area network 30 or the public IP address of the terminal interface 15 is private/public address translation, so that the client host can be connected to the server on the WAN side and used to provide the same. Service. 〇[_ * 参3, not the network device of the present invention {the above-mentioned client host assigns an IP address method - the seeding method takes _, the method is used in the network device 1GG of FIG. 2' After the above-mentioned client host of the regional network lion is powered on, the method is used to determine the IP address assigned to the client host.四 (4) The above-mentioned client host of the network 30, after booting (or the network connection service is started), according to the Internet connection agreement Dunting:, sends a corresponding packet for obtaining the IP address. In step S31, when the packet receiving module 160 of the network device ί 100 receives the packet from the LAN interface 14 and parses the content of the request packet to obtain an address request, in step 320, The server that obtains the address request packet to the WAN end is forwarded through the WAN interface 15 , and at the same time, the timer module 13 starts a timer to receive the scheduled time according to the Internet connection protocol supported by the client. The time range in which the WAN server responds to the packet. In step S340, if the packet receiving module 160 receives the reply packet corresponding to the obtained address request packet from the WAN end within the set time range, the packet is forwarded to the LAN in step S340. The terminal is given to the above host host. If 099140287 Form nickname A0101 Page 9 of 23, 〇992〇7〇184-〇201223221 The set time range has passed, and no reply packet from the WAN end corresponding to the request for obtaining the IP address is received. If the step S 3 50 does not, a dynamic private IP address is allocated to the user via the server service corresponding to the Internet connection protocol supported by the client host in the dynamic address allocation module 丨7 〇 End host. That is, the network device 100 first attempts to obtain the public IP address of the client host through the Internet connection protocol, unless the W AN terminal server does not respond to the server built in the dynamic address allocation module. The service allocates the dynamic private 丨p address to the above-mentioned client host on the LAN side〇

[0021] 上述用戶端主機獲得公用IP位址的方式可以是基於DHCP 或PPPoE ’請參閱圖4,所示為本發明之網路裝置對支援 DHCP之上述用戶端主機分配〗p位址方法一種實施方式的 流程囷’該方法用於圖2所示的網路裝置1〇〇中,當區域 網路30内支援DHCP的上述用戶端主機開機後或啟動DHCP[0021] The manner in which the user host obtains the public IP address may be based on DHCP or PPPoE. Please refer to FIG. 4, which illustrates a method for the network device of the present invention to allocate the address address to the client host supporting DHCP. The flow of the embodiment 囷 'This method is used in the network device 1 shown in FIG. 2, when the client host supporting DHCP in the area network 30 is powered on or starts DHCP.

服務後’使用該方法來確定分配給上述用戶端主機的IP 位址。 [0022] 在步驟41〇中’當網路裝置1〇〇之封包收送模組160從LAN 端介面140接收封包’並解析得知該封包為一 DHCP DISCOVER封包時,於步驟42〇中,將該DHCP DISCOVER 封包經由WAN端介面15〇轉發至WAN端的伺服器,同時間 ,計時器模組13 0啟動一預定時間的計時,該計時的目的 用來設定於一定時間範圍内,等待來自WAN端伺服器對於 該DHCP DISCOVER封包的回覆,在其它的實施例中’前 述時間範圍可以設計成不同的數值。在步驟S430中,若 封包收送模組160在前述設定的時間範圍内,在本實施方 099140287 表單編號A0101 第丨〇頁/共23頁 0992070184-0 201223221 式卡該時間範圍為四秒鐘,收到來自WAN端介面1 50對應 於該DHCP DISCOVER封包的DHCP OFFER封包,則於步驟 S440中轉發該DHCP OFFER封包至LAN端介面140給上述 用戶端主機。關於DHCP請求封包與回覆封包的對應,可 由DHCP請求封包的來源MAC位址與DHCP回覆封包的目的 MAC位址作一對應。若設定時間範圍已過,例如四秒鐘逾 時未收到任何來自WAN端介面150對應於該DHCP DISCOVER封包的DHCP OFFER封包,則如步驟S490所示 ’經由動態位址分配模組170啟動DHCP伺服器服務,分配 一動態私有IP位址給上述用戶端主機。在其它實施例中 ,網路裝置100可以容許LAN端上述用戶端主機DHCP DISCOVER封包的重送,亦即在預定時間範圍逾時後,重 複步驟S410與S420,並再次等待預定時間範圍,避免因 網路壅塞等因素而未收到來自WAN端介面150伺服器的回 應。當網路裝置100如步驟440轉發來自WAN端介面150的 DHCP OFFER封包至LAN端介面140後,如奋驟S450所示 ,封包收送模組160將接收到來自LAN端介面140的DHCP REQUEST封包,為完成上述用户端主機公用IP位址的配 置,在步驟S460中,封包收送模組160轉發該DHCP REQUEST封包至WAN端介面150,同時計時器模組130啟 動一預定時間範圍的計時。在本實施方式中,該時間範 圍為六十秒鐘,在其它的實施例中,該時間範圍可以設 定成不同的數值。步驟S470中,若於六十秒鐘内收到來 自WAN端介面150對應於該DHCP REQUEST封包的DHCP ACK封包,則如步驟S480所示,LAN端的上述用戶端主機 成功配置一公用IP位址。步驟S470中,若設定時間範圍 099140287 表單編號A0101 第11頁/共23頁 0992070184-0 201223221 已過,如逾時六十秒鐘,未收到來自WAN端介面1 50對應 於該DHCP REQUEST封包的DHCP ACK封包,則如步驟 S490所示,動態位址分配模組170啟動DHCP伺服器服務 ,分配一動態私有IP位址給該上述用戶端主機。 [0023] 請參閱圖5,所示為本發明之網路裝置對支援PPPoE之上 述用戶端主機分配IP位址方法一種實施方式的流程圖, 該方法用於圖2所示的網路裝置1〇〇中,當區域網路30内 支援PPPoE的上述用戶端主機開機後或使用PPPoE進行撥 接服務後,使用該方法來確定分配給上述用戶端主機的 IP位址。After the service, use this method to determine the IP address assigned to the above-mentioned client host. [0022] In step 41, when the packet receiving module 160 of the network device 1 receives the packet from the LAN interface 140 and parses that the packet is a DHCP DISCOVER packet, in step 42, The DHCP DISCOVER packet is forwarded to the server on the WAN side via the WAN interface 15 while the timer module 130 starts a predetermined time period. The purpose of the timing is set within a certain time range, waiting for the WAN. The reply of the DHCP server to the DHCP DISCOVER packet, in other embodiments, the aforementioned time range can be designed to different values. In step S430, if the packet delivery module 160 is within the set time range, the time range is four seconds in the embodiment 099140287 Form No. A0101/Page 23/9292070184-0201223221 card. Receiving the DHCP OFFER packet corresponding to the DHCP DISCOVER packet from the WAN interface 150, forwarding the DHCP OFFER packet to the LAN interface 140 to the client host in step S440. Regarding the correspondence between the DHCP request packet and the reply packet, the source MAC address of the DHCP request packet may correspond to the destination MAC address of the DHCP reply packet. If the set time range has elapsed, for example, four seconds have not received any DHCP OFFER packet corresponding to the DHCP DISCOVER packet from the WAN interface 150, then DHCP is started via the dynamic address allocation module 170 as shown in step S490. The server service allocates a dynamic private IP address to the above-mentioned client host. In other embodiments, the network device 100 may allow the retransmission of the DHCP DISCOVER packet of the client host on the LAN end, that is, after the predetermined time range expires, repeat steps S410 and S420, and wait for a predetermined time range again to avoid the cause. The network congestion and other factors did not receive a response from the WAN end interface 150 server. After the network device 100 forwards the DHCP OFFER packet from the WAN interface 150 to the LAN interface 140, as shown in step S450, the packet delivery module 160 receives the DHCP REQUEST packet from the LAN interface 140. In order to complete the configuration of the public host IP address of the client host, in step S460, the packet delivery module 160 forwards the DHCP REQUEST packet to the WAN interface 150, and the timer module 130 starts timing for a predetermined time range. In the present embodiment, the time range is sixty seconds, and in other embodiments, the time range can be set to a different value. In step S470, if the DHCP ACK packet corresponding to the DHCP REQUEST packet from the WAN interface 150 is received within sixty seconds, the client host on the LAN side successfully configures a public IP address as shown in step S480. In step S470, if the set time range is 099140287, the form number A0101, page 11 / 23 pages 0992070184-0 201223221 has passed, if the timeout is sixty seconds, the WAN interface 1 50 is not received corresponding to the DHCP REQUEST packet. The DHCP ACK packet is as shown in step S490. The dynamic address allocation module 170 starts the DHCP server service and allocates a dynamic private IP address to the client host. [0023] Please refer to FIG. 5, which is a flowchart of an embodiment of a method for allocating an IP address to a client host supporting PPPoE according to the network device of the present invention. The method is used in the network device 1 shown in FIG. In the meantime, after the above-mentioned client host supporting PPPoE in the local area network 30 is powered on or after dialing service using PPPoE, the method is used to determine the IP address assigned to the client host.

[0024] 在步驟510中,當網路裝置100之封包收送模組160從LAN 端介面140接收封包,並解析得知該封包為一PPPoE[0024] In step 510, when the packet delivery module 160 of the network device 100 receives the packet from the LAN interface 140, and parses that the packet is a PPPoE.

Active Discovery Initiation (PADI)封包時,於 步驟520中,將該PADI封包經由WAN端介面150轉發至 WAN端的伺服器,同時間’計時器模組1叫_動一預定時 間的計時,該計時的目的用來設定於一定時間範圍内, 等待來自WAN端伺服器對於該PAM封包的回覆,在其它的 實施例中,前述時間範圍可以設計成不同的數值。在步 驟S530中,若封包收送模組16〇在前述設定的時間範圍内 ,在本實施方式中該時間範圍為四秒鐘,收到來自WAN端 介面150對應於該PADI封包的PPPoE Active Discovery Offer (PAD0) 封包’則於步驟 S540 中轉發該PAD0 封包至LAN端介面140給上述用戶端主機。關於PPPoE請 求封包與回覆封包的對應,可由PPPoE請求封包的來源 MAC位址與PPPoE回覆封包的目的MAC位址作一對應。若 099140287 表單編號A0101 第12頁/共23頁 0992070184-0 201223221 设定時間範圍已過,例如四秒鐘逾時未收到任何來自WAN 端介面150對應於該PADI封包的PAD0封包,則如步驟 S590所示,經由動態位址分配模組17〇啟動ppp〇E伺服器 服務’分配一動態私有IP位址給上述用戶端主機。在其 它實施例中’網路裝置1〇〇可以容許LAN端上述用戶端主 機PADI封包的重送,亦即在預定時間範圍逾時後,重複 步驟S510與S520,並再次等待預定時間範圍,避免因網 路ί塞等因素而未收到來自WAN端介面150飼服器的回應 。當網路裝置100如步驟540轉發來自WAN端介面150的 PAD0封包至LAN端介面44〇後’如步驟S550所示,封包收 送模組160將接收到來自LAN端介面140的RADR封包,為 完成上述用戶端主機公用Ip位址的配置,在步驟S56〇中 ’封包收送模組160轉發該PADR封包至WAN端介面150, 同時計時器模組130啟動一預定時間範圍的計時。在本實 施方式中,該時間範圍為六十秒鐘,在其它的實施例中 ’該時間範圍可以設定成不同的數值。步驟S5 70中,若 於預定時間,例如六十秒鐘内收到來自WAN端介面150對 應於該PADR封包的PADS封包’則如步驟S480所示,LAN 端的上述用戶端主機成功配置一公用ip位址,與WAN端伺 服器間建立一般的PPP工作階段。步驟S570中,若設定時 間範圍已過,如逾時六十秒鐘’未收到來自ffAN端介面 150對應於該PADR封包的PPPoE Active Discovery Session-confirmation (PADS)封包,貝丨j 如步驟 S590 所示,動態位址分配模組170啟動PPP〇E伺服器服務,分 配一動態私有IP位址給該上述用戶端主機。 099140287 表單編號A0101 第13頁/共23頁 0992070184-0 201223221 [0025] [0026] [0027] [0028] [0029] [0030] [0031] 如刖所述’動態位址分配模組1 7 0可包含不同的词服器服 務,具體採用何種伺服器服務,視區域網路30内的上述 用戶端主機採用何種網際網路連線設定而定。針對採用 DHCP方式的上述用戶端主機’動態位址分配模組1 70可以 啟動DHCP伺服器服務;針對採用ppp〇E方式的上述用戶 〆 端主機’動態分配模組可以啟動PPPoE伺服器服務。總結 來說,本發明所提出的上述用戶端主機IP分配方法適用 於各種具連結區域網路端的上述用戶端主機與廣域網路 端的祠服器之能力的網路裝置,包含但不限於路由器、 閘道器與防火牆。 综上所述’本發明符合發明專利要件,爰依法提出專利 申請。惟’以上所述者僅為本發明之較佳實施例,舉凡 热悉本案技藝之人士,在爰依本案發明精神所作之等效 修飾或變化,皆應包含於以下之申請專利範圍内。 【圖式簡單說明】 : .. 圖1所示為可在其中實現本發明的網路環境的一個實施例 〇 圖2所示為本發明之網路裝置—種實施方式的模組圖。 圖3所示為本發明之網路裝置對用戶端主機分配^位址方 法—種實施方式的流程圖。 圖4所示為本發明之網路裝置對支援DHCP之用戶端主機分 配IP位址方法一種實施方式的流程圖。 圖b所示為本發明之網路裝置對支援ppp〇E之用戶端主機 分配IP位址方法一種實施方式的流程圖。 099140287 表單編號A0101 第14頁/共23頁 0992070184-0 201223221During the Active Discovery Initiation (PADI) packet, in step 520, the PADI packet is forwarded to the server on the WAN side via the WAN interface 150, and the timer module 1 is called a predetermined time. The purpose is to set a time range and wait for a reply from the WAN server to the PAM packet. In other embodiments, the foregoing time range can be designed to a different value. In step S530, if the packet delivery module 16 is within the set time range, in the present embodiment, the time range is four seconds, and the PPPoE Active Discovery corresponding to the PADI packet from the WAN interface 150 is received. The Offer (PAD0) packet forwards the PAD0 packet to the LAN interface 140 to the client host in step S540. Regarding the correspondence between the PPPoE request packet and the reply packet, the source MAC address of the PPPoE request packet may correspond to the destination MAC address of the PPPoE reply packet. If 099140287 Form No. A0101 Page 12 / Total 23 Page 0992070184-0 201223221 The set time range has elapsed. For example, if the four-second timeout has not received any PAD0 packet from the WAN interface 150 corresponding to the PADI packet, then the steps are as follows. As shown in S590, the Ppp〇E server service is started via the dynamic address allocation module 17 to assign a dynamic private IP address to the client host. In other embodiments, the network device 1 can allow the retransmission of the PADI packet of the client host on the LAN side, that is, after the predetermined time range expires, repeat steps S510 and S520, and wait for a predetermined time range again to avoid The response from the WAN end interface 150 feeder was not received due to factors such as network congestion. After the network device 100 forwards the PAD0 packet from the WAN interface 150 to the LAN interface 44 as shown in step 540, the packet delivery module 160 receives the RADR packet from the LAN interface 140 as shown in step S550. The configuration of the public IP address of the client host is completed. In step S56, the packet delivery module 160 forwards the PADR packet to the WAN interface 150, and the timer module 130 starts timing for a predetermined time range. In the present embodiment, the time range is sixty seconds, and in other embodiments, the time range can be set to a different value. In step S570, if the PADS packet corresponding to the PADR packet from the WAN end interface 150 is received within a predetermined time, for example, sixty seconds, the user host of the LAN end successfully configures a public IP as shown in step S480. The address establishes a general PPP session with the WAN server. In step S570, if the set time range has elapsed, such as the timeout of sixty seconds, the PPPoE Active Discovery Session-confirmation (PADS) packet corresponding to the PADR packet from the ffAN end interface 150 is not received, and the step j is as shown in step S590. As shown, the dynamic address allocation module 170 initiates a PPP〇E server service and assigns a dynamic private IP address to the client host. 099140287 Form No. A0101 Page 13 of 23 0992070184-0 201223221 [0025] [0030] [0019] [0031] As described in the 'Dynamic Address Allocation Module 1 7 0 Different word server services may be included, and which server service is used depends on which internet connection setting is used by the client host in the area network 30. The DHCP server service can be started for the above-mentioned client host 'dynamic address allocation module 1 70 adopting the DHCP method; and the PPPoE server service can be started for the above-mentioned user terminal host dynamic allocation module adopting the ppp〇E mode. In summary, the above-mentioned client host IP allocation method proposed by the present invention is applicable to various network devices having the capabilities of the client host and the wide area network server of the network in the connection area, including but not limited to routers and gates. Channels and firewalls. In summary, the invention conforms to the patent requirements of the invention, and the patent application is filed according to law. However, the above description is only the preferred embodiment of the present invention, and equivalent modifications or variations made by those skilled in the art will be included in the following claims. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 shows an embodiment of a network environment in which the present invention can be implemented. Fig. 2 is a block diagram showing an embodiment of a network device of the present invention. FIG. 3 is a flow chart showing an embodiment of the method for allocating an address method to a client host by the network device of the present invention. 4 is a flow chart showing an embodiment of a method for a network device supporting a DHCP client to allocate an IP address to a network device according to the present invention. Figure b is a flow chart showing an embodiment of a method for the network device of the present invention to allocate an IP address to a client host supporting ppp〇E. 099140287 Form No. A0101 Page 14 of 23 0992070184-0 201223221

[0032] [0033] [0034] [0035] [0036] [0037] [0038] [0039] [0040] [0041] [0042] [0043] [0044] 【主要元件符號說明】 網路裝置10,100 廣域網路20 伺服器21 區域網路3 0 用戶端主機31,32,33 處理器110 記憶體120 計時器模組130 LAN端介面140 WAN端介面150 封包收送模組160 動態位址分配模組170 位址轉換模組180[0034] [0035] [0037] [0038] [0038] [0044] [0044] [0044] [Main component symbol description] Network device 10, 100 WAN 20 Server 21 Area Network 3 0 Client Host 31, 32, 33 Processor 110 Memory 120 Timer Module 130 LAN Interface 140 WAN Interface 150 Packet Delivery Module 160 Dynamic Address Allocation Module Group 170 address translation module 180

[0045] DHCP伺服器 211 [0046] PPPoE伺服器 212 [0047] PPTP伺服器 213 099140287 表單編號A0101 第15頁/共23頁 0992070184-0[0045] DHCP Server 211 [0046] PPPoE Server 212 [0047] PPTP Server 213 099140287 Form Number A0101 Page 15 of 23 0992070184-0

Claims (1)

201223221 七、申請專利範圍: 機與一廣 種稱I置’用於連結—區域網路的用戶端主 域網路的伺服器,其中該網路裝置包括: 區域網路端介面,驗輕_戶端主機; 廣域網路端介面,用於連結該伺服器; 埤网峪端介面接收該用户端主 機所傳送之獲取網際網路協定位址的請求封包,將該巧 封包轉發至該伺服器,並當從廣域網路端介面接收來自^ 飼服益所傳送對應於該請求封包的回覆封包時將該回覆 封包轉發至該用戶端主機丨及 " 動態位址分配模組,用於在特—預㈣間後該封包收送 模組未從該廣域網路端介面接收到該回覆封包時,啟動一 網際網路連線協定他器服務,以分配動態私有網際網路 協定位址給該用戶端主機。 如申請專利範圍第1項所述之網路裝£,其 包括動態主機以蚊諳求w包及6太網_點;^^ 封包。 如申請專利範圍第1項所述之網路政置,其中該回覆封包 包括動態主機g己置協定回覆封包及乙太網點對點協定回覆 封包。 如申請專利範圍第1項所述之網路裝置,其中若該用戶端 主機接收到由該網路裝置所轉發的該回覆封包,則該用戶 端主機分配到一公用網際網路協定位址。 如申請專利範圍第1項所述之網路裝置,其中該網際網路 連線協定伺服器服務包括動態主機配置協定伺服器服務及 099140287 表單編號A0101 第16頁/共23頁 0992070184-0 201223221 乙太網點對點協定伺服器服務。 6 . —種對用戶端分配網際網路協定位址的方法,該用戶端主 機位於區域網路中,該方法執行於一具有連結該用戶端主 機與廣域網路的伺服器之能力的網路裝置中,該方法包括 以下步驟: 接收來自該用戶端主機關於獲取網際網路協定位址的請求 封包,轉發該請求封包至該伺服器; 等待一預定時間,若於該預定時間内接收來自該伺服器對 應於該請求封包的回覆封包,轉發該回覆封包至該用戶端 ® 主機;及 若該預定時間已過且未接收來自該伺服器對應於該請求封 包的回覆封包,則啟動一網際網路連線協定伺服器服務, 以分配一動態私有網際網路協定位址給該用戶端主機。 7 .如申請專利範圍第6項所述之對用戶端分配網際網路協定 位址的方法,其中該請求封包包括動態主機配置協定請求 封包及乙太網點對點協定請求封包。 8 .如申請專利範圍第6項所述之對用戶端分配網際網路協定 Q 位址的方法,其中該回覆封包包括動態主機配置協定回覆 封包及乙太網點對點協定回覆封包。 9 .如申請專利範圍第6項所述之對用戶端分配網際網路協定 位址的方法,其中若該用戶端主機接收到來自該伺服器的 該回覆封包,則該用戶端主機分配到一公用網際網路協定 位址。 10 .如申請專利範圍第6項所述之對用戶端分配網際網路協定 位址的方法,其中該網際網路連線協定伺服器服務包括動 態主機配置協定伺服器服務及乙太網點對點協定伺服器服 099140287 表單編號 A0101 第 17 頁/共 23 頁 0992070184-0 201223221 務0 099140287 表單編號A0101 第18頁/共23頁 0992070184-0201223221 VII. Patent application scope: The machine and a wide variety of servers are used to connect the user-side primary domain network of the local area network. The network device includes: the regional network interface, the light inspection _ a client host; a WAN interface for connecting to the server; a network client receiving a request packet obtained by the client host to obtain an internet protocol address, and forwarding the smart packet to the server And when receiving the reply packet corresponding to the request packet from the WAN service interface, the reply packet is forwarded to the client host and the dynamic address allocation module is used for After the (four) interval, the packet receiving module does not receive the reply packet from the WAN interface, and initiates an internet connection protocol service to allocate the dynamic private internet protocol address to the client. Host. For example, the network installation described in claim 1 of the patent scope includes a dynamic host for mosquitoes seeking w packets and 6 wifi dots; ^^ packets. For example, the network policy described in claim 1 of the patent scope, wherein the reply packet includes a dynamic host g-set agreement reply packet and an Ethernet peer-to-peer protocol reply packet. The network device of claim 1, wherein if the client host receives the reply packet forwarded by the network device, the user host is assigned to a public internet protocol address. The network device of claim 1, wherein the internet connection protocol server service comprises a dynamic host configuration protocol server service and 099140287 form number A0101 page 16 / 23 pages 0992070184-0 201223221 The peer-to-peer protocol server service. 6. A method of allocating an internet protocol address to a client, the client host being located in a local area network, the method being performed on a network device having the capability of connecting a server of the client host and a wide area network The method includes the steps of: receiving a request packet from the client host for obtaining an internet protocol address, forwarding the request packet to the server; waiting for a predetermined time, if receiving the servo from the server within the predetermined time Corresponding to the reply packet of the request packet, forwarding the reply packet to the client® host; and if the predetermined time has elapsed and not receiving the reply packet corresponding to the request packet from the server, starting an internet network The wire protocol server service allocates a dynamic private internet protocol address to the client host. 7. The method of allocating an internet protocol address to a client according to claim 6, wherein the request packet comprises a dynamic host configuration protocol request packet and an Ethernet peer-to-peer protocol request packet. 8. The method for allocating an internet protocol (Q) address to a client according to claim 6, wherein the reply packet comprises a dynamic host configuration agreement reply packet and an Ethernet peer-to-peer protocol reply packet. 9. The method for allocating an internet protocol address to a client according to claim 6, wherein if the client host receives the reply packet from the server, the client host allocates a Public internet protocol address. 10. The method for allocating an internet protocol address to a client according to claim 6, wherein the internet connection protocol server service comprises a dynamic host configuration protocol server service and an Ethernet peer-to-peer protocol. Server Service 099140287 Form No. A0101 Page 17 of 23 0992070184-0 201223221 Service 0 099140287 Form No. A0101 Page 18 of 23 0992070184-0
TW99140287A 2010-11-23 2010-11-23 Network apparatus and method for assigning internet protocol addresses for clients TW201223221A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW99140287A TW201223221A (en) 2010-11-23 2010-11-23 Network apparatus and method for assigning internet protocol addresses for clients

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW99140287A TW201223221A (en) 2010-11-23 2010-11-23 Network apparatus and method for assigning internet protocol addresses for clients

Publications (1)

Publication Number Publication Date
TW201223221A true TW201223221A (en) 2012-06-01

Family

ID=46725440

Family Applications (1)

Application Number Title Priority Date Filing Date
TW99140287A TW201223221A (en) 2010-11-23 2010-11-23 Network apparatus and method for assigning internet protocol addresses for clients

Country Status (1)

Country Link
TW (1) TW201223221A (en)

Similar Documents

Publication Publication Date Title
US7359973B2 (en) Home-networking
US8189567B2 (en) Method and nodes for registering a terminal
TWI243559B (en) Dynamic host configuration protocol spoofing in point-to-point protocol over ATM using ADSL modem
WO2012088911A1 (en) Method and device for ip terminal to access network
JP5816293B2 (en) Private device identification in the public network
WO2013123763A1 (en) Dynamic ipv6 configuration method for home gateway
WO2010069181A1 (en) Method and system for configuring ipv6 address
WO2018192179A1 (en) Ip address allocation method and device
CN108307694B (en) Network connection information acquisition method and router
KR20110060895A (en) A method and a gateway for providing multiple internet access
CN110995886A (en) Network address management method, device, electronic equipment and medium
WO2015018069A1 (en) Method, device and system for acquiring service by network terminal
WO2005083959A1 (en) Network access router, network access method, program, and recording medium
WO2008151548A1 (en) A method and apparatus for preventing the counterfeiting of the network-side media access control (mac) address
WO2016202059A1 (en) Ipv6 network access method and gateway
CN101904155A (en) Method of facilitating IP connections to hosts behind middleboxes
WO2015184853A1 (en) Authentication method and apparatus for ipv6 stateless auto-configuration
US10171418B2 (en) Method and apparatus for accessing demilitarized zone host on local area network
US20130086259A1 (en) Method for acquiring an ip address and network access device
WO2015123947A1 (en) Method and apparatus for delivering local area network information
WO2012109867A1 (en) Method, apparatus and system for routing protocol configuration
TW201223221A (en) Network apparatus and method for assigning internet protocol addresses for clients
WO2015139397A1 (en) Nat64 resource acquisition method and acquisition/distribution apparatus
KR20090058699A (en) A dynamic ip address allocation system and method enabling a host without ip to receive service requests
WO2013107055A1 (en) Method and apparatus for acquiring user information