CN102469175A - Network device and method for distributing Internet protocol address to client - Google Patents

Network device and method for distributing Internet protocol address to client Download PDF

Info

Publication number
CN102469175A
CN102469175A CN 201010547433 CN201010547433A CN102469175A CN 102469175 A CN102469175 A CN 102469175A CN 201010547433 CN201010547433 CN 201010547433 CN 201010547433 A CN201010547433 A CN 201010547433A CN 102469175 A CN102469175 A CN 102469175A
Authority
CN
Grant status
Application
Patent type
Prior art keywords
packet
client
server
internet protocol
host
Prior art date
Application number
CN 201010547433
Other languages
Chinese (zh)
Inventor
周庚涛
Original Assignee
国基电子(上海)有限公司
鸿海精密工业股份有限公司
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

Links

Abstract

The invention relates to a network device and a method for distributing an Internet protocol address to a client. The method comprises the following steps of: sending a request packet on acquiring the Internet protocol address to the network device by the client; transmitting the request packet to a wide area network after receiving the request packet by the network device; if a reply packet corresponding to the request packet is received from the wide area network by the network device within pre-set time, transmitting the reply packet to the client of a local area network; and if no reply packet corresponding to the request packet from the wide area network is received after the pre-set time, starting an Internet connection protocol server service by the network device, and distributing a dynamic private Internet protocol address to the client of the local area network by the server. With the adoption of the network device and the method for distributing the Internet protocol address to the client, provided by the invention, the client can select the public Internet protocol address or the private Internet protocol address according to a real network environment.

Description

网络装置及其对客户端分配因特网协议地址的方法 Network device and assign an Internet Protocol address of the client's method

技术领域 FIELD

[0001] 本发明涉分配因特网协议地址的技术,尤其涉及一种网络装置对局域网之客户端分配因特网协议地址的方法。 [0001] The present invention relates to an internet protocol address assignment technique, particularly to a network device assigned Internet protocol address of the LAN to the client process.

背景技术 Background technique

[0002] 由于一般企业、机构或个人向因特网服务提供商anternet Service Provider) 购买取得的公用因特网协议地址(Public Internet Protocol Address,简称为公用IP地址)数量有限,于架设局域网(Local Area Network,简称为LAN)时,并不足以分配给所有的客户端使用,因此目前局域网内的客户端所分配到的IP地址都是属于私有IP地址(Private IP Address)。 [0002] Due to general business, institution or individual purchase made in a public internet protocol address (Public Internet Protocol Address to an Internet service provider anternet Service Provider), referred to as the public IP address) a limited number, to set up a LAN (Local Area Network, referred to as when LAN), insufficient distributed to all clients use, so the client is currently assigned to the LAN IP address belong to the private IP address (private IP address). 私有IP地址可让企业、机构或家庭内部自行运用,使得架设局域网时有较大的弹性,但缺点是使用私有IP地址的客户端无法直接连上因特网,因特网上的使用者也无法直接存取局域网内的客户端,必须经由网关或路由器等装置中的网络地址转换(Network Address Translation,简称NAT)机制,进行私有/公用IP地址的转换,方才能连接广域网(Wide Area Network,如因特网,简称为WAN),或对广域网中的使用者提供服务。 Private IP address that allows businesses, institutions or self-use within the family, so that there is greater flexibility when set up local area network, but the drawback is the use of private IP addresses of clients can not connect directly to the Internet, users on the Internet can not directly access clients within a local area network, must be converted via a device such as a gateway or router in the network address (network address Translation, referred to as NAT) mechanism to convert the private / public IP address, the party in order to connect the WAN (Wide Area network, such as the Internet, referred to as WAN), or the provision of services to a wide area network users.

[0003] 然而NAT在使用上还是有所限制,例如NAT无法让广域网中的用户与局域网内的客户端真正建立点对点的联机,除此之外,客户端的服务质量(QoQ及安全性等设定也会因而失效。 [0003] However, NAT or restrictions on use, such as NAT can not allow wide-area network users and clients on the LAN to establish a true point to point connection, in addition, the quality of service the client (QoQ and security settings, etc. It will therefore fail.

发明内容 SUMMARY

[0004] 有鉴于此,需提供一种对局域网之客户端分配IP地址的方法及使用该方法的网络装置,使得客户端可以根据实际的网络环境需求选择使用公用IP地址或者私有IP地址。 [0004] In view of this, the need to provide a method for a local area network IP address assigned to the client and the network device using the same, such that the client can choose to use the public IP address or a private IP address of the network environment according to the actual needs.

[0005] 一种网络装置,用于连接一局域网的客户端主机与一广域网的服务器,其中该网络装置包括局域网接口、广域网接口、封包收送模块及动态地址分配模块。 [0005] A network device for connecting a local area network with a client host WAN server, wherein the network device includes a local area network interface, wide area network interfaces, send and receive module and a dynamic packet address assignment module. 局域网接口连接该客户端主机,广域网接口连接该服务器。 LAN interface connected to the client host, WAN interface to connect to the server. 当封包收发模块从局域网接口接收客户端主机所传送的获取因特网协议地址的请求封包,转发该请求封包至广域网接口给服务器,并等待一预定时间。 When obtaining an internet protocol address packet request packet from the local area network interface transceiver module receives the transmitted client host, forwards the request packet to the WAN interface to the server and wait for a predetermined time. 若预定时间范围内,从广域网接口接收到对应于该请求封包的回复封包时, 将该回复封包转发至局域网接口给客户端主机。 If within a predetermined time range, the interface is received from the WAN to the packet corresponding to the request when the response packet, the response packet is forwarded to the local area network interface to the client host. 若预定时间已过,未从广域网接口接收到任何对应于该请求封包的回复封包时,则动态地址分配模块启动一因特网连接协议服务器服务,分配一动态私有因特网协议地址给客户端主机。 If the predetermined time has elapsed, not from the WAN interface receives any packet corresponding to the request when the response packet, the module initiates a dynamic address assignment protocol server connected to an Internet service, a dynamic allocation of a private Internet protocol address to the client host.

[0006] 优选地,该请求封包包括动态主机配置协议请求封包及以太网点对点协议请求封包。 [0006] Preferably, the request packet includes a dynamic host configuration protocol request packet and the request packet Point Protocol over Ethernet.

[0007] 优选地,该回复封包包括动态主机配置协议回复封包及以太网点对点协议回复封包。 [0007] Preferably, the response packet includes a Dynamic Host Configuration Protocol response packet and the response packet Point Protocol over Ethernet.

[0008] 优选地,若该客户端主机接收到由该网络装置所转发的该回复封包,则该客户端主机分配到一公用因特网协议地址。 [0008] Preferably, if the client host receives the response packet forwarded by the network device, then the client host is assigned to a public Internet Protocol address. [0009] 优选地,该因特网连接协议服务器服务包括动态主机配置协议服务器服务及以太网点对点协议服务器服务。 [0009] Preferably, the Internet connection protocol servers include a dynamic host configuration protocol server and the service server Point Protocol over Ethernet services.

[0010] 一种具有连接局域网的客户端主机与广域网的服务器之能力的网络装置对客户端主机配置因特网协议地址的方法,该方法包括以下步骤:接收来自客户端主机关于获取因特网协议地址的请求封包并转发至服务器;等待一预定时间,若于该预定时间内接收来自服务器对应于该请求封包的回复封包,转发该回复封包至该客户端主机;及若该预定时间已过而未接收来自服务器对应于该请求封包的回复封包,则启动一因特网连接协议服务器服务,分配一动态私有因特网协议地址给客户端主机。 [0010] A method of a network apparatus capable client host and WAN server that it has connected to LAN configuration Internet protocol address of the client host, the method comprising the steps of: receiving a request for access to an Internet protocol address from a client host and forwards the packet to the server; waiting a predetermined time, if the server receives a request corresponding to the packet within the predetermined time response packet, forwards the reply packet to the client host; and if the predetermined time has elapsed without receiving from server corresponding to the request packet of the response packet, an Internet connection is initiated service protocol server, the dynamic allocation of a private Internet protocol address to the client host.

[0011] 优选地,该请求封包包括动态主机配置协议请求封包及以太网点对点协议请求封包。 [0011] Preferably, the request packet includes a dynamic host configuration protocol request packet and the request packet Point Protocol over Ethernet.

[0012] 优选地,该回复封包包括动态主机配置协议回复封包及以太网点对点协议回复封包。 [0012] Preferably, the response packet includes a Dynamic Host Configuration Protocol response packet and the response packet Point Protocol over Ethernet.

[0013] 优选地,若该客户端主机接收到来自该服务器的该回复封包,则该客户端主机分配到一公用因特网协议地址。 [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] 优选地,该因特网连接协议服务器服务包括动态主机配置协议服务器服务及以太网点对点协议服务器服务。 [0014] Preferably, the Internet connection protocol servers include a dynamic host configuration protocol server and the service server Point Protocol over Ethernet services.

[0015] 上述网络装置及其对局域网之客户端分配因特网协议地址的方法使得客户端可以根据实际的网络环境需求选择使用公用因特网协议地址或者私有因特网协议地址。 [0015] The network device and a method of allocating an Internet protocol address of the LAN to the client so that the client can choose to use the public Internet Protocol address or a private Internet protocol address according to the network environment requirements.

[0016] 藉由以下对具体实施方式详细的描述并结合附图,将可轻易的了解上述内容及此项发明之技术效果。 [0016] conjunction with the accompanying drawings and described in detail by the following specific embodiments, will readily understand the technical effect of this invention and the foregoing.

附图说明 BRIEF DESCRIPTION

[0017] 图1所示为可在其中实现本发明的网络环境的一个实施例。 [0017] FIG. 1 shows a network environment in which to implement the present invention according to one embodiment.

[0018] 图2所示为本发明之网络装置一种实施方式的模块图。 [0018] The network device of the present invention shown in a modular embodiment of FIG 2 FIG.

[0019] 图3所示为本发明之网络装置对客户端主机分配IP地址方法一种实施方式的流程图。 The network device of the present invention shown in [0019] FIG. 3 is assigned an IP address of the client host one kind of a method flowchart of an embodiment.

[0020] 图4所示为本发明之网络装置对支持DHCP之客户端主机分配IP地址方法一种实施方式的流程图。 [0020] FIG. 4 is a flowchart of a network device of the invention support the DHCP client hosts IP address allocation method of an embodiment.

[0021] 图5所示为本发明之网络装置对支持PPPoE之客户端主机分配IP地址方法一种实施方式的流程图。 [0021] FIG. 5 is a flowchart of a network device of the invention support the PPPoE client hosts IP address allocation method of an embodiment.

[0022] 主要元件符号说明 [0022] Main reference numerals DESCRIPTION

[0023] 网络装置 10,100 [0023] Network device 10, 100

[0024] 广域网 20 [0024] WAN 20

[0025] 服务器 21 [0025] Server 21

[0026] 局域网 30 [0026] LAN 30

[0027] 客户端主机 31,32,33 [0027] client host 31, 32

[0028] 处理器 110 [0028] Processor 110

[0029] 内存 120 [0029] Memory 120

[0030] 定时器模块 130[0031] LAN 接口 140 [0030] The timer module 130 [0031] LAN interface 140

[0032] WAN 接口 150 [0032] WAN Interface 150

[0033] 封包收送模块 160 [0033] module 160 to send and receive packets

[0034] 动态地址分配模块 170 [0034] Dynamic address assignment module 170

[0035] 地址转换模块 180 [0035] The address translation module 180

[0036] DHCP 服务器 211 [0036] DHCP server 211

[0037] PPPoE 服务器 212 [0037] PPPoE server 212

[0038] PPTP 服务器 213 [0038] PPTP server 213

具体实施方式 detailed description

[0039] 本发明所揭示对局域网之客户端分配IP地址的方法可实施在各种不同的网络装置中,诸如路由器、网关等任何具有连接局域网与广域网功能的网络装置。 [0039] The present invention disclosed assigned IP address of the LAN to the client process may be implemented in various network devices, such as any network device having a function of connecting LAN and WAN routers, gateways and the like. 请参阅图1,所示为可在其中实现本发明的网络环境的一个实施例的组成组件,包括具有连接局域网30与广域网20功能的网络装置10,位于局域网30中的客户端主机31到客户端主机33可经由网络装置10存取位于广域网20 —端的服务器21。 Please refer to FIG. 1, shown to be implemented within a network environment according to the present invention is a composition component embodiment comprising a network device having connect the LAN 30 to the WAN 20 functions embodiment 10, located on the client host 30 in the LAN 31 to the client end 33 may be located in a wide area network host via a network access device 10 20-- 21 end server.

[0040] 请参阅图2,所示为本发明之网络装置一种实施方式的模块图,为了便于说明,仅图示与本发明实施方式相关的部分。 [0040] Referring to FIG. 2, the network device of the present invention shown in FIG embodiment of a modular embodiment, for convenience of explanation, only the illustrated embodiment of the present invention related to the part. 网络装置100为图1中所示的网络装置10的一种实施方式,该网络装置100包含至少一个处理器110、内存120、定时器模块130、用来连接局域网30的LAN接口140、用来连接广域网20的WAN接口150、封包收送模块160、动态地址分配模块170以及地址转换模块180。 The network device 100 is an embodiment of the network device 10 shown in FIG. 1, the network apparatus 100 includes at least one processor 110, memory 120, timer module 130, the LAN interface 140 is connected to LAN 30, for a WAN interface 150 is connected 20, the packet send and receive module 160, the dynamic address assignment module 170, and address translation module 180. 所述模块是可被该处理器110所执行的具有特定功能的软件程序,该等软件程序储存于内存120、计算机可读储存介质或其他储存设备。 The module may be a software program having a specific function executed by the processor 110, such software program stored in memory 120, computer-readable storage medium or other storage devices. 处理器110用来执行封包收送模块160、动态地址分配模块170以及地址转换模块180以及其它未于图2示出的应用程序等。 The processor 110 to perform packet to send and receive module 160, the dynamic address assignment module 170, and address translation module 180, and other applications not shown in FIG. 2 and the like. 内存120用来储存封包收送模块160、动态地址分配模块170、 地址转换模块180以及其他未于图2示出的应用程序程序代码、执行应用程序产生的暂时性数据以及其他任何数据等。 Memory 120 is used to send and receive packet storage module 160, the dynamic address assignment module 170, the address translation module 180, and other application program code is not shown in FIG. 2, the temporary data generated in execution of the application, and any other data. 定时器模块130经由计时控制如封包收送模块160、动态地址分配模块170等应用程序执行时序。 Timer module 130 via the timing control module 160 as to send and receive packets, the dynamic address assignment module 170 and other application execution timing. LAN接口140包含复数支持以太网络封包传输的实体端口,WAN接口150包含至少一个支持以太网络封包传输的实体端口。 LAN interface 140 includes a plurality of physical ports to support Ethernet packet transmission, WAN interface 150 comprises at least one physical port supports Ethernet packet transmission. WAN接口150需取得公用IP地址,以使得网络装置100成为局域网30中的客户端主机(例如图1中所示的客户端主机31到客户端主机33的其中一个或复数个)连结广域网20的设备。 WAN interface 150 is required to obtain a public IP address, so that the network device 100 becomes the client host in the LAN 30 (e.g., client host shown in FIG. 1 31 to client host 33, wherein one or a plurality of) connecting the WAN 20 equipment. 在本实施方法中,WAN接口150可藉由动态主机配置协议(Dynamic Host Configuration Protocol,简称为DHCP)、以太网点对点协议(Point-to-Point Protocol over Ethernet,简称为PPPoE) 或点对点隧道协议(Point to Point Tunneling Protocol,简称为PPTP)与DHCP服务器211、PPPoE服务器212或PPTP服务器213连接,实现动态主机配置协议服务、以太网点对点协议服务或点对点隧道协议服务以取得动态公用IP地址,或是经由处理器110所执行的程序代码自行设定静态公用IP地址。 In the method of the present embodiment, WAN interface 150 may be by Dynamic Host Configuration Protocol (Dynamic Host Configuration Protocol, referred to as DHCP), Point Protocol over Ethernet (Point-to-Point Protocol over Ethernet, abbreviated as PPPoE) or Point to Point Tunneling Protocol ( Point to Point tunneling protocol, referred to as the PPTP) and DHCP server 211, PPPoE server 212 or 213 PPTP server connection, dynamic host configuration protocol service, Point protocol over Ethernet Point to Point tunneling protocol service or service in order to obtain a dynamic public IP address, or a static public IP address is set via the program codes themselves executed by the processor 110. 其中DHCP服务器211、PPPoE服务器212以及PPTP 服务器为服务器21的不同实施例。 Wherein the DHCP server 211, PPPoE server 212 and the server is a PPTP server 21 of the various embodiments.

[0041] 封包收送模块160用于接收来自LAN接口140与WAN接口150的封包,还用于传送封包至LAN接口140与WAN接口150,若封包收送模块160接收到来自LAN接口且来源IP 地址为私有IP地址的IP封包或是来自WAN接口且目的IP地址为公用IP地址的IP封包,则将该IP封包传送至地址转换模块180进行私有IP地址与公用IP地址的转换;动态地址分配模块170根据上述客户端主机所支持的因特网连接协议,提供相对应的DHCP或PPPoE 服务器服务,以便分配动态私有IP地址给局域网30的上述客户端主机;地址转换模块180 用来将封包中所带局域网30内上述客户端主机的私有IP地址或WAN接口150的公用IP 地址进行私有/公用IP地址转换,使得上述客户端主机可以连接到WAN端的服务器并使用其提供的服务。 [0041] module 160 to send and receive packets for the packet interface 140 receives from the LAN to the WAN interface 150, further for transmitting packets to the LAN interface 140 and the WAN interface 150, if the packet send and receive module 160 receives from the LAN interface and the source IP address is an IP packet or a private IP address and destination IP address from the interface is a WAN public IP address an IP packet, the IP packet to the address translation module 180 converts the private IP address and the public IP addresses; dynamic address allocation according to the client module 170 supported by the host Internet connection protocol, provide a corresponding PPPoE or DHCP server service, in order to assign the dynamic IP address to a private local area network of said client host 30; the address translation module 180 is used in the packet carried private IP address or public IP address of the WAN interface client host in LAN 30 150 is the private / public IP address translation, so that said client can connect to the host server and the WAN side using its services.

[0042] 请参阅图3,所示为本发明之网络装置对上述客户端主机分配IP地址方法一种实施方式的流程图,该方法用于图2所示的网络装置100中,当局域网30内的上述客户端主机开机后,使用该方法来确定分配给上述客户端主机的IP地址。 [0042] Referring to FIG. 3, the network device of the present invention shown on said client host to assign IP addresses flowchart of a method embodiment, the method is used in the network device 100 shown in FIG. 2, when the LAN 30 after said client host in the boot, the method used to determine the IP address assigned to said client host.

[0043] 局域网30的上述客户端主机开机(或是网络联机服务启动)后,依据其因特网连接协议的设定,发出相对应的获取IP地址请求的封包,于步骤S310,当网络装置100之封包收送模块160从LAN接口140接收到该封包,并解析得知该请求封包内容为获取IP地址请求,在步骤320中,经由WAN接口150转发该获取IP地址请求封包至WAN端的服务器,同时间,定时器模块130根据客户端所支持的因特网连接协议,启动一定时器计时预定收到WAN 端服务器回复封包的时间范围。 After the [0043] LAN said client host 30 boot (boot service or network connection), according to the setting of its Internet connection protocol, issuing the corresponding IP address acquisition request packet, in step S310, the network device 100 when the packet to send and receive module 160 receives from the LAN interface 140 to the packet, and resolves that the request packet content for the IP address acquisition request, in step 320., WAN interface 150 forwards the acquired IP address via a request packet to the WAN side server, with time, the timer module 130 with the client's supported protocol Internet connection, starts a timer counting a predetermined WAN side server replies received packet time. 在步骤S330中,若封包收送模块160在前述设定的时间范围内,收到来自于WAN端对应于该获取IP地址请求封包的回复封包,则于步骤S340中转发该回复封包至LAN端给上述客户端主机。 In step S330, if the received packet transmission module 160 within the time set in the received from the WAN side response packet corresponding to the acquired IP address request packet is forwarded in step S340 the response packet to the LAN terminal to said client host. 若设定时间范围已过,未收到任何来自于WAN端对应于该获取IP地址请求的回复封包,则如步骤S350所示,经由动态地址分配模块170中相应于上述客户端主机所支持的因特网连接协议的服务器服务,分配一动态私有IP地址给上述客户端主机。 If the set time has elapsed, it has not received any from the WAN side corresponding to the acquired IP address request response packet, as shown in the step S350, the allocation module 170 via corresponding dynamic address to the client host supports Internet connection protocol server services, a dynamic private IP address assigned to said client host. 亦即网络装置100会先尝试让上述客户端主机经由因特网连接协议取得公用IP地址,除非WAN端服务器无响应,方才经由动态地址分配模块内建的服务器服务分配动态私有IP地址给LAN端上述客户端主机。 I.e., the network device 100 will first try to get said client host to obtain the public IP address via an Internet connection protocol, server does not respond unless the WAN side, just to the client via the LAN side dynamic address assignment server service module is built with a private IP address assigned dynamically end host.

[0044] 上述客户端主机获得公用IP地址的方式可以是基于DHCP或PPPoE,请参阅图4, 所示为本发明之网络装置对支持DHCP之上述客户端主机分配IP地址方法一种实施方式的流程图,该方法用于图2所示的网络装置100中,当局域网30内支持DHCP的上述客户端主机开机后或启动DHCP服务后,使用该方法来确定分配给上述客户端主机的IP地址。 Embodiment [0044] The client host to obtain a public IP address may be based on DHCP or PPPoE, see Figure 4, the IP address of the method shown in the present invention the network device assigned to said client host supports one embodiment of the DHCP flow chart, the method is used in the network device 100 shown in FIG. 2, when the support DHCP in the LAN 30, or said client host power after starting the DHCP service, the method is used to determine the distribution of said client IP address of the host .

[0045] 在步骤410中,当网络装置100之封包收送模块160从LAN接口140接收封包,并解析得知该封包为一DHCP DISCOVER封包时,于步骤420中,将该DHCP DISCOVER封包经由WAN接口150转发至WAN端的服务器,同时间,定时器模块130启动一预定时间的计时,该计时的目的用来设定于一定时间范围内,等待来自WAN端服务器对于该DHCP DISCOVER封包的回复,在其它的实施例中,前述时间范围可以设计成不同的数值。 When [0045] In step 410, the network device 100. When a packet to send and receive module 160 receives a packet from the LAN interface 140, and that parse the packet is a DHCP DISCOVER packet, in step 420, the DHCP DISCOVER packet via the WAN WAN interface 150 is forwarded to the server side, the same time, the timer module 130 to start counting a predetermined time, for the purpose of the timer is set to a range of time, waiting for a reply to the DHCP DISCOVER packet from the WAN side server, in other embodiments, the time frame may be designed to different values. 在步骤S430中,若封包收送模块160在前述设定的时间范围内,在本实施方式中该时间范围为四秒钟,收到来自WAN接口150对应于该DHCP DISCOVER封包的DHCP OFFER封包,则于步骤S440中转发该DHCP OFFER封包至LAN接口140给上述客户端主机。 In step S430, if the received packet transmission module 160 within the time set in the foregoing, in the present embodiment, the time range of four seconds, DHCP OFFER packet received from the WAN interface 150 corresponding to the DHCP DISCOVER packet, forwarding the DHCP OFFER packet to the LAN interface 140 to the client host in the above-described step S440. 关于DHCP请求封包与回复封包的对应,可由DHCP请求封包的来源MAC地址与DHCP回复封包的目的MAC地址作一对应。 About DHCP request packet and the corresponding reply packet, the DHCP request by the source MAC address of the packet destination MAC address with DHCP reply packet to make a correspondence. 若设定时间范围已过,例如四秒钟逾时未收到任何来自WAN接口150对应于该DHCPDISC0VER 封包的DHCP OFFER封包,则如步骤S490所示,经由动态地址分配模块170启动DHCP服务器服务,分配一动态私有IP地址给上述客户端主机。 If the set time has elapsed, for example when more than four seconds has not received any DHCP OFFER packet from the WAN interface 150 DHCPDISC0VER corresponding to the packet, as shown in step S490, the service via the dynamic address assignment module 170 starts the DHCP server, a dynamic private IP address assigned to said client host. 在其它实施例中,网络装置100可以容许LAN端上述客户端主机DHCPDISC0VER封包的重送,亦即在预定时间范围逾时后,重复步骤S410与S420,并再次等待预定时间范围,避免因网络拥塞等因素而未收到来自WAN接口150的响应。 In other embodiments, network device 100 may allow the ends of the double feed LAN client host DHCPDISC0VER packet, i.e. the timeout after a predetermined time, repeating steps S410 and S420, and again waits a predetermined time range, to avoid network congestion and other factors not received a response from the WAN interface 150. 当网络装置100如步骤440转发来自WAN接口150的DHCP OFFER封包至LAN接口140后,如步骤S450所示,封包收送模块160将接收到来自LAN接口140的DHCP REQUEST封包,为完成上述客户端主机公用IP地址的配置,在步骤S460中,封包收送模块160转发该DHCP REQUEST封包至WAN接口150,同时定时器模块130启动一预定时间范围的计时。 When the network device 100 as in step 440 forwards the DHCP OFFER packet from the WAN interface 150 to the LAN interface 140, as shown in step S450, the packet send and receive module 160 receives the DHCP REQUEST packet from the LAN interface 140, to accomplish the above client configure the host public IP addresses, in step S460, the packet send and receive module 160 forwards the DHCP REQUEST packet to the WAN interface 150, and the timer module 130 to start counting a predetermined time range. 在本实施方式中,该时间范围为六十秒钟,在其它的实施例中,该时间范围可以设定成不同的数值。 In the present embodiment, the time range of sixty seconds, in other embodiments, the time range may be set to different values. 步骤S470中,若于六十秒钟内收到来自WAN接口150对应于该DHCPREQUEST 封包的DHCP ACK封包,则如步骤S480所示,LAN端的上述客户端主机成功配置一公用IP 地址。 In step S470, if the received DHCP ACK packet from the WAN interface 150 corresponding to the DHCPREQUEST packet within sixty seconds, as shown in step S480 the client host on the LAN side to successfully configure a public IP address. 步骤S470中,若设定时间范围已过,如逾时六十秒钟,未收到来自WAN接口150对应于该DHCP REQUEST封包的DHCPACK封包,则如步骤S490所示,动态地址分配模块170启动DHCP服务器服务,分配一动态私有IP地址给该上述客户端主机。 In step S470, if the set time has elapsed, such as when more than sixty seconds, DHCPACK packet is not received from the WAN interface 150 corresponding to the DHCP REQUEST packet, then as shown in step S490, the dynamic address assignment module 170 to start DHCP server service, a dynamic private IP address assigned to the above-mentioned client host.

[0046] 请参阅图5,所示为本发明之网络装置对支持PPPoE之上述客户端主机分配IP地址方法一种实施方式的流程图,该方法用于图2所示的网络装置100中,当局域网30内支持PPPoE的上述客户端主机开机后或使用PPPoE进行拨接服务后,使用该方法来确定分配给上述客户端主机的IP地址。 [0046] Referring to FIG. 5, a flowchart of a network device to support the above-described invention of the PPPoE client hosts IP address allocation method of an embodiment of the present embodiment, the method for the network device 100 shown in FIG. 2, when the LAN 30 within the support PPPoE said client host using PPPoE dial-up or a power service, using the method described above to determine the assigned IP address of the client host.

[0047] 在步骤510中,当网络装置100之封包收送模块160从LAN接口140接收封包,并解析得知该封包为一PPPoE Active Discovery Initiation (PADI)封包时,于步骤520中, 将该PADI封包经由WAN接口150转发至WAN端的服务器,同时间,定时器模块130启动一预定时间的计时,该计时的目的用来设定于一定时间范围内,等待来自WAN端服务器对于该PADI封包的回复,在其它的实施例中,前述时间范围可以设计成不同的数值。 When [0047] In step 510, the network device 100. When a packet to send and receive module 160 receives a packet from the LAN interface 140, and that parse the packet is a PPPoE Active Discovery Initiation (PADI) packet, in step 520, the PADI packet forwarding WAN via the WAN interface 150 to the server side, the same time, the timer module 130 to start counting a predetermined time, for the purpose of the timer is set to a range of time, waiting for the server from the WAN side of the PADI packet responses, in other embodiments, the time frame may be designed to different values. 在步骤S530 中,若封包收送模块160在前述设定的时间范围内,在本实施方式中该时间范围为四秒钟, 收到来自WAN接口150 对应于该PADI 封包的PPPoE Active Discovery Offer (PADO)封包, 则于步骤S540中转发该PADO封包至LAN接口140给上述客户端主机。 In step S530, the received packet if the transmitting module 160 within the time set in the foregoing, in the present embodiment, the time range of four seconds, PPPoE Active Discovery Offer received from the WAN interface 150 corresponding to the PADI packet ( PADO) packet is forwarded to the PADO packet to the LAN interface 140 to the host to said client in step S540. 关于PPPoE请求封包与回复封包的对应,可由PPPoE请求封包的来源MAC地址与PPPoE回复封包的目的MAC地址作一对应。 About PPPoE request packet corresponding to the response packet, the source MAC address may be PPPoE PPPoE request packet reply packet as the destination MAC address corresponding to a. 若设定时间范围已过,例如四秒钟逾时未收到任何来自WAN接口150对应于该PADI封包的PADO封包,则如步骤S590所示,经由动态地址分配模块170启动PPPoE服务器服务,分配一动态私有IP地址给上述客户端主机。 If the set time has elapsed, for example, four seconds over any PADO packet is not received from the WAN interface 150 corresponding to the PADI packet, as shown in step S590, the dynamic address assignment module 170 via the PPPoE server service, assigned a dynamic private IP address to said client host. 在其它实施例中,网络装置100可以容许LAN端上述客户端主机PADI封包的重送,亦即在预定时间范围逾时后,重复步骤S510 与S520,并再次等待预定时间范围,避免因网络壅塞等因素而未收到来自WAN接口150服务器的响应。 In other embodiments, network device 100 may permit re-sending said client host LAN terminal PADI packet, i.e. the timeout after a predetermined time, repeating steps S510 and S520, and again waits a predetermined time range, to avoid network congestion and other factors not received a response from the WAN interface 150 of the server. 当网络装置100如步骤540转发来自WAN接口150的PADO封包至LAN接口140 后,如步骤S550所示,封包收送模块160将接收到来自LAN接口140的PADR封包,为完成上述客户端主机公用IP地址的配置,在步骤S560中,封包收送模块160转发该PADR封包至WAN接口150,同时定时器模块130启动一预定时间范围的计时。 When the network device 100 as in step 540 forwards the PADO packet from the WAN interface 150 to the LAN interface 140, as shown in step S550, the packet send and receive module 160 receives the PADR packet from the LAN interface 140, the client host to the above common IP address configuration, at step S560, the packet forwarding module 160 to send and receive the PADR packet to the WAN interface 150, and the timer module 130 to start counting a predetermined time range. 在本实施方式中,该时间范围为六十秒钟,在其它的实施例中,该时间范围可以设定成不同的数值。 In the present embodiment, the time range of sixty seconds, in other embodiments, the time range may be set to different values. 步骤S570中, 若于预定时间,例如六十秒钟内收到来自WAN接口150对应于该PADR封包的PADS封包,则如步骤S480所示,LAN端的上述客户端主机成功配置一公用IP地址,与WAN端服务器间建立一般的PPP会话。 In step S570, if, e.g. PADS packets received from the WAN interface 150 corresponding to the PADR packet within sixty seconds at a predetermined time, as shown in step S480 the client host on the LAN side to successfully configure a public IP address, establish general PPP session with WAN-end server. 步骤S570中,若设定时间范围已过,如逾时六十秒钟,未收到来自WAN 接口150 对应于该PADR 封包的PPPoE Active Discovery Session-confirmation (PADS) 封包,则如步骤S590所示,动态地址分配模块170启动PPPoE服务器服务,分配一动态私有IP地址给该上述客户端主机。 In step S570, if the set time has elapsed, such as when more than sixty seconds, is not received PPPoE Active Discovery Session-confirmation (PADS) from the WAN interface 150 PADR packet corresponding to the packet, then as shown in step S590 , dynamic address assignment module 170 to start the PPPoE server services, a dynamic private IP address assigned to the above-mentioned client host.

[0048] 如前所述,动态地址分配模块170可包含不同的服务器服务,具体采用何种服务器服务,视局域网30内的上述客户端主机采用何种因特网联机设定而定。 [0048] As described above, the dynamic address assignment module 170 may comprise a different server services, which use the specific service server, said client host depending on a local area network within the Internet connection 30 which may be employed is set. 针对采用DHCP方式的上述客户端主机,动态地址分配模块170可以启动DHCP服务器服务;针对采用PPPoE 方式的上述客户端主机,动态分配模块可以启动PPPoE服务器服务。 For said client host using DHCP mode, dynamic address assignment module 170 may start the DHCP server service; for said client host using the PPPoE embodiment, dynamic allocation server module may initiate PPPoE service. 总结来说,本发明所提出的上述客户端主机IP分配方法适用于各种具连接局域网端的上述客户端主机与广域网端的服务器之能力的网络装置,包含但不限于路由器与网关。 In summary, it said client host IP allocation method proposed in the present invention is applicable to various devices having a network capability of said client host server and the WAN side of the LAN connection terminal, including but not limited to routers and gateways.

Claims (10)

  1. 1. 一种网络装置,用于连接一局域网的客户端主机与一广域网的服务器,其特征在于, 该网络装置包括:局域网接口,用于连接该客户端主机;广域网接口,用于连接该服务器;封包收送模块,用于从该局域网接口接收该客户端主机所传送之获取因特网协议地址的请求封包,将该请求封包转发至该服务器,并当从广域网接口接收来自该服务器所传送对应于该请求封包的回复封包时,将该回复封包转发至该客户端主机;及动态地址分配模块,用于在等待一预定时间后该封包收送模块未从该广域网接口接收到该回复封包时,启动一因特网连接协议服务器服务,以分配动态私有因特网协议地址给该客户端主机。 1. A network device for connecting a local area network with a client host WAN server, wherein, the network device comprising: a LAN interface for connecting the client host; WAN interface for connecting the server ; packet to send and receive means for the transmission of the local area network interface receives the client host from the Internet protocol address acquisition request packet, forwards the request packet to the server, and when receiving from the WAN interface transmitted from the server corresponding to the request packet response packet, the response packet is forwarded to the client host; dynamic address allocation module and, after waiting for a predetermined time to send the packet receiving module does not receive the response packet from the WAN interface, start a Internet connection protocol server service to assign dynamic private Internet protocol address to the client host.
  2. 2.如权利要求1所述之网络装置,其特征在于,该请求封包包括动态主机配置协议请求封包及以太网点对点协议请求封包。 2. The network device of claim 1, wherein the request packet includes a dynamic host configuration protocol request packet and the request packet Point Protocol over Ethernet.
  3. 3.如权利要求1所述之网络装置,其特征在于,该回复封包包括动态主机配置协议回复封包及以太网点对点协议回复封包。 The network apparatus of claim 1, wherein the response packet includes a Dynamic Host Configuration Protocol response packet and the response packet Point Protocol over Ethernet.
  4. 4.如权利要求1所述之网络装置,其特征在于,若该客户端主机接收到由该网络装置所转发的该回复封包,则该客户端主机分配到一公用因特网协议地址。 4. The network device of claim 1, wherein, if the client received by the network host device forwards the reply packet, the client host is assigned to a public Internet Protocol address.
  5. 5.如权利要求1所述之网络装置,其特征在于,该因特网连接协议服务器服务包括动态主机配置协议服务器服务及以太网点对点协议服务器服务。 5. The network device according to the claim 1, characterized in that the Internet connection service protocol server comprises a dynamic host configuration protocol server and the service server Point Protocol over Ethernet services.
  6. 6. 一种对客户端分配因特网协议地址的方法,该客户端主机位于局域网中,该方法执行于一具有连接该客户端主机与广域网的服务器之能力的网络装置中,其特征在于,该方法包括以下步骤:接收来自该客户端主机关于获取因特网协议地址的请求封包,转发该请求封包至该服务器;等待一预定时间,若于该预定时间内接收来自该服务器对应于该请求封包的回复封包,转发该回复封包至该客户端主机;及若该预定时间已过且未接收来自该服务器对应于该请求封包的回复封包,则启动一因特网连接协议服务器服务,以分配一动态私有因特网协议地址给该客户端主机。 A method of allocating an Internet protocol address of the client, the client host in the LAN, the method is performed in an apparatus having a network connection capability of the server and the client host in the WAN, characterized in that the method comprising the steps of: receiving from the client host request packet for access to an Internet protocol address, forward the request packet to the server; waits for a predetermined time, when receiving from the server at the predetermined time corresponding to the request packet of the response packet , forwards the reply packet to the client host; packet and the response packet if the predetermined time has elapsed is not received from the server corresponding to the request, the server starts a protocol Internet connection service, to dynamically assign a private Internet protocol address to the client host.
  7. 7.如权利要求6所述之对客户端分配因特网协议地址的方法,其特征在于,该请求封包包括动态主机配置协议请求封包及以太网点对点协议请求封包。 7. The method of allocating an Internet protocol address of the client as claimed in claim 6, wherein the request packet includes a dynamic host configuration protocol request packet and the request packet Point Protocol over Ethernet.
  8. 8.如权利要求6所述之对客户端分配因特网协议地址的方法,其特征在于,该回复封包包括动态主机配置协议回复封包及以太网点对点协议回复封包。 8. The method of allocating an Internet protocol address of the client as claimed in claim 6, wherein the response packet includes a Dynamic Host Configuration Protocol response packet and the response packet Point Protocol over Ethernet.
  9. 9.如权利要求6所述之对客户端分配因特网协议地址的方法,其特征在于,若该客户端主机接收到来自该服务器的该回复封包,则该客户端主机分配到一公用因特网协议地址。 9. The method of allocating an Internet protocol address of the client as claimed in claim 6, wherein, if the client host receives the reply packet from the server, the client host is assigned to a public internet protocol address .
  10. 10.如权利要求6所述之对客户端分配因特网协议地址的方法,其特征在于,该因特网连接协议服务器服务包括动态主机配置协议服务器服务及以太网点对点协议服务器服务。 10. The method of allocating an Internet protocol address of the client as claimed in claim 6, wherein the Internet connection service protocol server comprises a dynamic host configuration protocol server and the service server Point Protocol over Ethernet services.
CN 201010547433 2010-11-16 2010-11-16 Network device and method for distributing Internet protocol address to client CN102469175A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201010547433 CN102469175A (en) 2010-11-16 2010-11-16 Network device and method for distributing Internet protocol address to client

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201010547433 CN102469175A (en) 2010-11-16 2010-11-16 Network device and method for distributing Internet protocol address to client

Publications (1)

Publication Number Publication Date
CN102469175A true true CN102469175A (en) 2012-05-23

Family

ID=46072326

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201010547433 CN102469175A (en) 2010-11-16 2010-11-16 Network device and method for distributing Internet protocol address to client

Country Status (1)

Country Link
CN (1) CN102469175A (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001097483A2 (en) * 2000-06-12 2001-12-20 Telefonaktiebolaget Lm Ericsson (Publ) Dynamic ip address allocation system and method
WO2003075517A2 (en) * 2002-03-01 2003-09-12 Globespan Virata Incorporated Setup for customer premise equipment (cpe) with ppp bridge using the same public ip address at the wan side and the lan side
JP2004282689A (en) * 2003-02-03 2004-10-07 Digital Group:Kk Vpn server
CN1744612A (en) * 2005-08-19 2006-03-08 杭州华为三康技术有限公司 DHCP address allocation method
CN1808998A (en) * 2006-01-20 2006-07-26 北京朗通环球科技有限公司 Method of detection and maintenance of PPP link
US20070058538A1 (en) * 2005-09-15 2007-03-15 Wei Chiang Method of setting up a wireless router
US20070217413A1 (en) * 2002-12-13 2007-09-20 Aladdin Knowledge Systems Ltd. Method For Assigning An IP Address To A Network Connectable Device, And A Device Configured Thereby
CN101355593A (en) * 2008-09-23 2009-01-28 中国电信股份有限公司 Method for distributing IP address in wireless LAN and access equipment thereof
EP2071810A1 (en) * 2007-12-11 2009-06-17 Alcatel Lucent Method to obtain an Internet protocol address
WO2009098530A1 (en) * 2008-02-05 2009-08-13 Telefonaktiebolaget Lm Ericsson (Publ) Combining locally addressed devices and wide area network (wan) addressed devices on a single network
EP2166726A1 (en) * 2008-09-18 2010-03-24 Thomson Telecom Belgium A method and a gateway for providing multiple internet access

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001097483A2 (en) * 2000-06-12 2001-12-20 Telefonaktiebolaget Lm Ericsson (Publ) Dynamic ip address allocation system and method
WO2003075517A2 (en) * 2002-03-01 2003-09-12 Globespan Virata Incorporated Setup for customer premise equipment (cpe) with ppp bridge using the same public ip address at the wan side and the lan side
US20070217413A1 (en) * 2002-12-13 2007-09-20 Aladdin Knowledge Systems Ltd. Method For Assigning An IP Address To A Network Connectable Device, And A Device Configured Thereby
JP2004282689A (en) * 2003-02-03 2004-10-07 Digital Group:Kk Vpn server
CN1744612A (en) * 2005-08-19 2006-03-08 杭州华为三康技术有限公司 DHCP address allocation method
US20070058538A1 (en) * 2005-09-15 2007-03-15 Wei Chiang Method of setting up a wireless router
CN1808998A (en) * 2006-01-20 2006-07-26 北京朗通环球科技有限公司 Method of detection and maintenance of PPP link
EP2071810A1 (en) * 2007-12-11 2009-06-17 Alcatel Lucent Method to obtain an Internet protocol address
WO2009098530A1 (en) * 2008-02-05 2009-08-13 Telefonaktiebolaget Lm Ericsson (Publ) Combining locally addressed devices and wide area network (wan) addressed devices on a single network
EP2166726A1 (en) * 2008-09-18 2010-03-24 Thomson Telecom Belgium A method and a gateway for providing multiple internet access
CN101355593A (en) * 2008-09-23 2009-01-28 中国电信股份有限公司 Method for distributing IP address in wireless LAN and access equipment thereof

Similar Documents

Publication Publication Date Title
US6070246A (en) Method and system for secure cable modem initialization
US6952428B1 (en) System and method for a specialized dynamic host configuration protocol proxy in a data-over-cable network
US6490289B1 (en) Multiple network connections from a single PPP link with network address translation
US6822955B1 (en) Proxy server for TCP/IP network address portability
US6370147B1 (en) Method for addressing of passive network hosts in a data-over-cable system
US6560203B1 (en) Method for changing type-of-service in a data-over-cable system
US7069344B2 (en) Method and apparatus for coordinating a change in service provider between a client and a server
US7072337B1 (en) System and method for resolving network addresses for network devices on distributed network subnets
US6189102B1 (en) Method for authentication of network devices in a data-over cable system
US20070203999A1 (en) Techniques for replacing point to point protocol with dynamic host configuration protocol
US6996621B1 (en) Method for supporting secondary address delivery on remote access servers
US6049826A (en) Method and system for cable modem initialization using dynamic servers
US20010036192A1 (en) Home-networking
US6065049A (en) Method and system for resolving addresses for network host interfaces from a cable modem
US6018767A (en) Method and system for managing subscription services with a cable modem
US20030214955A1 (en) Apparatus and method for offering connections between network devices located in different home networks
US6185624B1 (en) Method and system for cable modem management of a data-over-cable system
US6775276B1 (en) Method and system for seamless address allocation in a data-over-cable system
US20040122974A1 (en) Method, apparatus, and system for assigning an IP address on a network
US6697862B1 (en) System and method for network address maintenance using dynamic host configuration protocol messages in a data-over-cable system
US20070237159A1 (en) Communication equipment
US6240464B1 (en) Method and system for managing addresses for network host interfaces in a data-over-cable system
US6058421A (en) Method and system for addressing network host interfaces from a cable modem using DHCP
Cheshire et al. Nat port mapping protocol (nat-pmp)
US7295543B2 (en) Network interconnection apparatus, network interconnection method, name resolution apparatus and computer program

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
C05 Deemed withdrawal (patent law before 1993)