Movatterモバイル変換


[0]ホーム

URL:


CN1553350A - Dynamic Host Configuration Method - Google Patents

Dynamic Host Configuration Method
Download PDF

Info

Publication number
CN1553350A
CN1553350ACNA031268218ACN03126821ACN1553350ACN 1553350 ACN1553350 ACN 1553350ACN A031268218 ACNA031268218 ACN A031268218ACN 03126821 ACN03126821 ACN 03126821ACN 1553350 ACN1553350 ACN 1553350A
Authority
CN
China
Prior art keywords
address
dhcp
dynamic host
lease
host configuration
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CNA031268218A
Other languages
Chinese (zh)
Inventor
王功乾
何唐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hongfujin Precision Industry Shenzhen Co Ltd
Hon Hai Precision Industry Co Ltd
Original Assignee
Hongfujin Precision Industry Shenzhen Co Ltd
Hon Hai Precision Industry 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 Hongfujin Precision Industry Shenzhen Co Ltd, Hon Hai Precision Industry Co LtdfiledCriticalHongfujin Precision Industry Shenzhen Co Ltd
Priority to CNA031268218ApriorityCriticalpatent/CN1553350A/en
Publication of CN1553350ApublicationCriticalpatent/CN1553350A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Landscapes

Abstract

The method is as the follows: hardware address is obtained and to confirm whether DHCP client end is on the same network with DHCP server or not, DHCP packet with IP address is sent to client end if it is, otherwise, whether lease between client end and server for IP address is existed or not is confirmed and DHCP packet with IP address is sent to clent end if it is; otherwise whether an idle IP address can be found or not is confirmed and DHCP packet with idle IP address is sent to client end if it is; or otherwise, whether IP address that lease is expired is existed or not is confirmed and DHCP packet with IP address that lease is expired is sent to client end if it is.

Description

Translated fromChinese
动态主机配置方法Dynamic Host Configuration Method

【技术领域】【Technical field】

本发明涉及一种计算机网络,尤指一种为连接在网络上的主机动态分配IP地址的系统及方法。The invention relates to a computer network, in particular to a system and method for dynamically assigning IP addresses to hosts connected to the network.

【背景技术】【Background technique】

在TCP/IP网络上,每台工作站若要能存取网络上的资源,必须进行基本的网络配置,一些主要参数诸如IP地址(IP Address)、子网掩码(Subnet Mask)、缺省网关(Default Gateway)、域名服务器(DNS)等必不可少,还可能需要一些附加的信息如IP管理策略之类。对于一个稍微大点的网络而言,网络的管理和维护的任务是相当繁重的。一台电脑从一个子网转移到另一个子网,就要重新对系统进行配置。对于普通水平的工作站用户是不能赋予他们配置自己的工作站网络的权限,而且也没有这个必要。如果一个没有相应技术水平的用户出于好奇或想学习一下的目的错误地更改了工作站的网络配置,造成网络故障,后果不言而喻。因此,需要有一种机制来让TCP/IP的配置和管理从容户端转移到网络管理端,实现IP的集中式管理。解决方案就是用DHCP。On the TCP/IP network, if each workstation wants to be able to access resources on the network, basic network configuration must be performed, some main parameters such as IP address (IP Address), subnet mask (Subnet Mask), default gateway (Default Gateway), domain name server (DNS), etc. are essential, and some additional information such as IP management policies may be required. For a slightly larger network, the tasks of network management and maintenance are quite heavy. When a computer is transferred from one subnet to another, the system must be reconfigured. For ordinary workstation users, they cannot be given the authority to configure their own workstation network, and there is no need for this. If a user without the corresponding technical level changes the network configuration of the workstation by mistake for the purpose of curiosity or learning, causing network failure, the consequences are self-evident. Therefore, a mechanism is needed to transfer the configuration and management of TCP/IP from the client side to the network management side, so as to realize the centralized management of IP. The solution is to use DHCP.

DHCP即动态主机配置协议(Dynamic Host ConfigurationProtocol,DHCP),其是一种动态主机组合协议,它起源于BOOTP(BOOT Protocol)。BOOTP原本用于无磁盘主机连接的网络上:网络主机使用BOOT ROM而不是磁盘起动并连接上网络,BOOTP可以自动地为那些主机设定TCP/IP环境。DHCP是BOOTP的增强版本,其分为两个部份:一个是服务器端(DHCP Server),另一个是客户端(DHCP Client)。所有的IP网络设定资料都由DHCP服务器集中管理,并负责处理客户端的DHCP要求  而客户端则会使用从服务器分配下来的IP环境资料。DHCP is the Dynamic Host Configuration Protocol (Dynamic Host Configuration Protocol, DHCP), which is a dynamic host combination protocol, which originated from BOOTP (BOOT Protocol). BOOTP was originally used on a network without disk host connections: network hosts use BOOT ROM instead of disks to start and connect to the network, BOOTP can automatically set the TCP/IP environment for those hosts. DHCP is an enhanced version of BOOTP, which is divided into two parts: one is the server (DHCP Server), and the other is the client (DHCP Client). All IP network setting data are centrally managed by the DHCP server, which is responsible for processing the client's DHCP request, and the client will use the IP environment data assigned from the server.

DHCP支持三种不同的机制用于配置IP主机地址:自动配置、动态配置以及人工配置。其中在自动配置机制下,一旦DHCP客户端第一次成功的从DHCP服务器端租用到IP地址之后,就永远使用这个地址。在动态配置机制下,当DHCP客户端第一次从HDCP服务器端租用到IP地址之后,并非永久的使用该地址,只要租约到期,DHCP客户端就得释放(Release)这个IP地址,以给其它工作站使用。DHCP客户端可以比其它主机更优先的延续(Renew)租约,或是租用其它的IP地址。在人工配置机制下,客户端的IP地址由网络管理员进行分配。DHCP supports three different mechanisms for configuring IP host addresses: automatic configuration, dynamic configuration, and manual configuration. Among them, under the automatic configuration mechanism, once the DHCP client successfully leases the IP address from the DHCP server for the first time, this address will be used forever. Under the dynamic configuration mechanism, after the DHCP client leases the IP address from the HDCP server for the first time, it does not use the address permanently. As long as the lease expires, the DHCP client must release (Release) the IP address to used by other workstations. The DHCP client can renew (Renew) the lease more preferentially than other hosts, or lease other IP addresses. Under the manual configuration mechanism, the IP address of the client is assigned by the network administrator.

DHCP的工作原理如下:(1)当DHCP客户端起动时,它会向DHCP服务器广播请求租用IP地址,称为DHCPDISCOVER;(2)所有的DHCP服务器收到租用请求后,就会响应客户端可租用的IP地址,称为DHCPOFFER;(3)当DHCP客户端确认所欲选择的DHCP服务器后,会将所租用的IP地址再广播出去,称为DHCPREQUEST;(4)而被选择的DHCP服务器可送回DHCPACK确认完成IP地址租用,或DHCPNAK拒绝IP地址租用,以更新DHCP服务器的数据库;(5)一般通常只要完成上述(1)-(4)项步骤即可。而如果DHCP客户端取得租用IP地址(收到DHCPACK)后却发现IP地址已经有人使用,此时DHCP客户端会送出DHCPDECLINE讯息,然后再经前述(1)-(4)的步骤以取得新租用的IP地址;(6)DHCP客户端不想租用IP地址时,则其将送出DHCPRELEASE讯息;(7)DHCP客户端取得由DHCP服务器所提供的参数,若欲更改某项参数设定,则送出DHCPINFORM讯息,再经前述(1)-(4)的步骤即可更改设定。The working principle of DHCP is as follows: (1) When the DHCP client starts, it will broadcast a request to the DHCP server to lease an IP address, which is called DHCP DISCOVER; (2) After all DHCP servers receive the lease request, they will respond to the client's available The leased IP address is called DHCPOFFER; (3) When the DHCP client confirms the DHCP server to be selected, it will broadcast the leased IP address again, which is called DHCPREQUEST; (4) The selected DHCP server can be Send back DHCPACK to confirm the completion of IP address lease, or DHCPNAK rejects IP address lease to update the database of the DHCP server; (5) usually only need to complete the above (1)-(4) steps. And if the DHCP client obtains the leased IP address (receives DHCPACK) but finds that the IP address has already been used, the DHCP client will send a DHCPDECLINE message, and then go through the steps (1)-(4) above to obtain a new lease (6) When the DHCP client does not want to lease an IP address, it will send a DHCPRELEASE message; (7) The DHCP client obtains the parameters provided by the DHCP server, and if it wants to change a certain parameter setting, it sends a DHCPINFORM message, and then go through the above steps (1)-(4) to change the settings.

虽然DHCP在管理一个较大的网络时能够提供极大的方便,但是其仍然有一些缺陷。如当一DHCP服务器在向较多的DHCP客户端分配IP地址时,很容易产生所分配的IP地址发生冲突的问题。因此需要一种方法来有效解决所分配的IP地址冲突问题。Although DHCP can provide great convenience in managing a large network, it still has some drawbacks. For example, when a DHCP server allocates IP addresses to many DHCP clients, it is easy to cause the problem of conflicts among the allocated IP addresses. Therefore, a method is needed to effectively solve the problem of conflict of allocated IP addresses.

【发明内容】【Content of invention】

本发明的主要目的在于提供一种动态主机配置方法,其利用DHCP服务器向DHCP客户端分配IP地址。The main purpose of the present invention is to provide a dynamic host configuration method, which utilizes a DHCP server to assign IP addresses to DHCP clients.

本发明的另一目的在于提供一种动态主机配置方法,其在分配IP地址时检测分配给DHCP客户端的IP地址以避免发生地址冲突。Another object of the present invention is to provide a dynamic host configuration method, which detects the IP address assigned to the DHCP client to avoid address conflict when assigning the IP address.

为达成上述的发明目的,本发明提供的动态主机配置方法包括有如下步骤:(i)初始化一含有IP地址的DHCP封包;(ii)获得一DHCP客户端的硬件地址;(iii)确定DHCP客户端是否与DHCP服务器在同一网络上,如果在同一网络上,则该DHCP服务器直接向该DHCP客户端发送一含有IP地址的DHCP封包;(iv)如果该DHCP客户端与该DHCP服务器不在同一网络上,确定其与该DHCP服务器间是否已有IP地址租约,如果已有IP地址租约,该DHCP服务器直接向该DHCP客户端发送一含有IP地址的DHCP封包;(v)如果该DHCP客户端与DHCP服务器间没有IP地址租约,确定DHCP封包中的IP地址是否为该DHCP客户端所需求的IP地址,如果该IP地址是该DHCP客户端所需求的IP地址,则将含有该DHCP封包发送给该DHCP客户端;(vi)如果该IP地址不是该DHCP客户端所需求的IP地址,确定在IP地址池(Address Pool)中是否可找到一闲置的IP地址以满足该DHCP客户端的需求,如果有闲置IP地址能满足需求,则向DHCP客户端发送含有闲置IP地址的DHCP封包;(vii)如果没有闲置的IP地址,确定是否有租约已到期的IP地址;(viii)如果有租约已到期的IP地址,则向DHCP客户端发送含有该租约已到期的IP地址的DHCP封包。In order to achieve the above-mentioned purpose of the invention, the dynamic host configuration method provided by the present invention includes the following steps: (i) initializing a DHCP packet containing an IP address; (ii) obtaining the hardware address of a DHCP client; (iii) determining the DHCP client Whether it is on the same network as the DHCP server, if it is on the same network, then the DHCP server directly sends a DHCP packet containing an IP address to the DHCP client; (iv) if the DHCP client and the DHCP server are not on the same network , determine whether there is an existing IP address lease between it and the DHCP server, if there is an existing IP address lease, the DHCP server directly sends a DHCP packet containing the IP address to the DHCP client; (v) if the DHCP client and DHCP There is no IP address lease between the servers. Determine whether the IP address in the DHCP packet is the IP address required by the DHCP client. If the IP address is the IP address required by the DHCP client, send the DHCP packet containing it to the server. DHCP client; (vi) if the IP address is not the required IP address of the DHCP client, determine whether an idle IP address can be found in the IP address pool (Address Pool) to satisfy the requirements of the DHCP client, if any Idle IP address can satisfy demand, then send the DHCP packet that contains idle IP address to DHCP client; (vii) if there is no unused IP address, determine whether there is the IP address that the lease has expired; (viii) if any lease has arrived If the IP address of the lease is expired, a DHCP packet containing the expired IP address of the lease is sent to the DHCP client.

采用本发明的动态主机配置方法,在分配IP地址时可重复多次检查所分配的IP地址,从而有效避免IP地址冲突的问题。By adopting the dynamic host configuration method of the present invention, the assigned IP addresses can be repeatedly checked when assigning IP addresses, thereby effectively avoiding the problem of IP address conflicts.

【附图说明】【Description of drawings】

图1是本发明所应用的一动态主机配置系统的架构图。FIG. 1 is an architecture diagram of a dynamic host configuration system applied in the present invention.

图2是本发明具体实施方式中所应用的DHCP讯息封包的格式。FIG. 2 is the format of the DHCP message packet used in the embodiment of the present invention.

图3是本发明动态主机配置方法中DHCP服务器接收和发送讯息封包的流程图。FIG. 3 is a flow chart of the DHCP server receiving and sending message packets in the dynamic host configuration method of the present invention.

图4是本发明动态主机配置方法中DHCP服务器向DHCP客户端分配IP地址的流程图。Fig. 4 is a flow chart of the DHCP server assigning an IP address to the DHCP client in the dynamic host configuration method of the present invention.

图5是本发明动态主机配置方法中DHCP中继代理判断所接收的讯息类型以确定发送对象的流程图。5 is a flow chart of the DHCP relay agent judging the type of the received message to determine the sending object in the dynamic host configuration method of the present invention.

【具体实施方式】【Detailed ways】

参阅图1,是本发明动态主机配置系统100的架构图。本发明动态主机配置系统100包括有多个DHCP服务器110、一DHCP中继代理120、多个DHCP客户端130以及将上述设备连接起来的网络140。DHCP服务器110是提供网络设置参数给DHCP客户端130的Internet主机。DHCP客户端130是通过DHCP来获得网络配置参数的Internet主机,通常即为普通用户的工作站。DHCP中继代理120是一在DHCP客户端和DHCP服务器间转发DHCP讯息封包的主机或路由器,DHCP客户端与DHCP服务器通过该DHCP中继代理120进行通讯。在本发明的具体实施方式中,该网络140是指以太网络。Referring to FIG. 1 , it is a structure diagram of a dynamic host configuration system 100 of the present invention. The dynamic host configuration system 100 of the present invention includes multiple DHCP servers 110, a DHCP relay agent 120, multiple DHCP clients 130 and a network 140 connecting the above devices. The DHCP server 110 is an Internet host that provides network setting parameters to the DHCP client 130 . The DHCP client 130 is an Internet host that obtains network configuration parameters through DHCP, and is usually a workstation of a common user. The DHCP relay agent 120 is a host or router that forwards the DHCP message packet between the DHCP client and the DHCP server. The DHCP client and the DHCP server communicate through the DHCP relay agent 120 . In a specific embodiment of the present invention, the network 140 refers to an Ethernet network.

DHCP客户端130与DHCP服务器110间通过DHCP讯息封包进行通讯。图2所示为本发明具体实施方式中所应用的DHCP讯息封包200的格式。从结构方面看,一DHCP讯息封包200包括有一op字段202、一chaddr字段204以及一options字段206。为简便起见,DHCP讯息封包200中的其它字段在此不多作叙述。每一DHCP讯息都属于一特定的类型,如DHCPDISCOVER、DHCPOFFER、DHCPREQUEST或DHCPACK等。每一DHCP讯息的类型均会写入options字段206。每一DHCP讯息亦会被标志以确定其是被DHCP服务器110所发出还是被DHCP客户端130所发出,其通过设定op字段202来实现。如果op字段202被设定为BOOTREQUEST,说明该DHCP讯息是由DHCP客户端130所发出。如果op字段202被设定为BOOTREPLY,说明该DHCP讯息是由DHCP服务器110所发出。chaddr字段204用于记录DHCP客户端130的硬件地址。The DHCP client 130 communicates with the DHCP server 110 through DHCP message packets. FIG. 2 shows the format of a DHCP message packet 200 used in an embodiment of the present invention. In terms of structure, a DHCP packet 200 includes an op field 202 , a chaddr field 204 and an options field 206 . For the sake of brevity, other fields in the DHCP message packet 200 will not be described here. Each DHCP message belongs to a specific type, such as DHCPDISCOVER, DHCPOFFER, DHCPREQUEST, or DHCPACK. The type of each DHCP message will be written into the options field 206 . Each DHCP message is also flagged to determine whether it is sent by the DHCP server 110 or the DHCP client 130 by setting the op field 202 . If the op field 202 is set to BOOTREQUEST, it means that the DHCP message is sent by the DHCP client 130 . If the op field 202 is set to BOOTREPLY, it means that the DHCP message is sent by the DHCP server 110 . The chaddr field 204 is used to record the hardware address of the DHCP client 130 .

图3所示为本发明动态主机配置系统及方法的DHCP服务器110接收和发送讯息封包的流程图。在步骤S301,DHCP服务器110从DHCP中继代理120处获得一讯息封包。在步骤S303,DHCP服务器110从所获得的讯息封包中获得该讯息的类型。在步骤S305,DHCP服务器110判断该讯息的类型是否为DHCPDISCOVER。如果该讯息为DHCPDISCOVER,在步骤S307,DHCP服务器110透过DHCP中继代理120向DHCP客户端130发送一DHCPOFFER讯息。该DHCPOFFER讯息包含有有效的网络IP地址。如果该讯息的类型不是DHCPDISCOVER,在步骤S309,DHCP服务器110判断该讯息的类型是否为DHCPREQUEST。如果所接收到的讯息类型为DHCPREQUEST,在步骤S311,该DHCP服务器110向发出DHCPREQUEST讯息的DHCP客户端送回一DHCPACK讯息以确认完成IP地址的租用。在该步骤中,如果DHCP服务器110无法分配一可用IP地址给发送该DHCPREQUEST讯息的DHCP客户端,则其发送一DHCPNAK讯息以拒绝IP地址租用,并更新DHCP服务器的数据库。如果该讯息的类型不是DHCPREQUEST,在步骤S313,DHCP服务器110判断该讯息是否为一DHCPDECLINE讯息。如果该讯息为一DHCPDECLINE讯息,说明发送给该DHCP客户端的IP地址已为其它的DHCP客户端所使用。则在步骤S315,DHCP服务器110更新租约,即将租约中的DHCP客户端设定为已使用该IP地址的DHCP客户端。如果该讯息的类型不是DHCPDECLINE,在步骤S317,DHCP服务器110判断该讯息是否为一DHCPRELEASE讯息。如果所获得的讯息为一DHCPRELEASE讯息,在步骤S319,DHCP服务器110清理发送该DHCPRELEASE讯息的DHCP客户端的租约。如果所获得的讯息不是DHCPRELEASE讯息,在步骤S321,DHCP服务器110判断所获取的讯息是否为DHCPINFORM讯息。如果该讯息是DHCPINFORM讯息,在步骤S323,DHCP服务器110查询地址池,并变更DHCP客户端130所要更改的参数。在步骤S325,DHCP服务器110将已变更的参数发送给DHCP客户端130。FIG. 3 is a flowchart of receiving and sending message packets of the DHCP server 110 of the dynamic host configuration system and method of the present invention. In step S301 , the DHCP server 110 obtains a message packet from the DHCP relay agent 120 . In step S303, the DHCP server 110 obtains the type of the message from the obtained message packet. In step S305, the DHCP server 110 determines whether the type of the message is DHCPDISCOVER. If the message is DHCPDISCOVER, in step S307 , the DHCP server 110 sends a DHCPOFFER message to the DHCP client 130 through the DHCP relay agent 120 . The DHCPOFFER message contains a valid network IP address. If the type of the message is not DHCPDISCOVER, in step S309, the DHCP server 110 determines whether the type of the message is DHCPREQUEST. If the type of the received message is DHCPREQUEST, in step S311, the DHCP server 110 sends back a DHCPACK message to the DHCP client that sent the DHCPREQUEST message to confirm that the lease of the IP address is completed. In this step, if the DHCP server 110 cannot allocate an available IP address to the DHCP client sending the DHCPREQUEST message, it sends a DHCPNAK message to reject the lease of the IP address, and updates the database of the DHCP server. If the type of the message is not DHCPREQUEST, in step S313, the DHCP server 110 determines whether the message is a DHCPDECLINE message. If the message is a DHCPDECLINE message, it means that the IP address sent to the DHCP client has been used by other DHCP clients. Then in step S315, the DHCP server 110 renews the lease, that is, sets the DHCP client in the lease as the DHCP client that has used the IP address. If the type of the message is not DHCPDECLINE, in step S317, the DHCP server 110 determines whether the message is a DHCPRELEASE message. If the obtained message is a DHCPRELEASE message, in step S319, the DHCP server 110 clears the lease of the DHCP client sending the DHCPRELEASE message. If the obtained message is not a DHCPRELEASE message, in step S321, the DHCP server 110 determines whether the obtained message is a DHCPINFORM message. If the message is a DHCPINFORM message, in step S323, the DHCP server 110 queries the address pool, and changes the parameters to be changed by the DHCP client 130. In step S325 , the DHCP server 110 sends the changed parameters to the DHCP client 130 .

图4所示为本发明动态主机配置系统及方法的DHCP服务器110向DHCP客户端130分配IP地址时,检查有无地址冲突的流程图。当一DHCP服务器110欲向DHCP客户端130发送DHCPOFFER讯息封包时,在步骤S401,DHCP服务器110先初始化该DHCPOFFER讯息封包。在步骤S403,DHCP服务器110获取DHCP客户端130的硬件地址。该硬件地址从DHCP讯息封包的chaddr字段204中获得。在步骤S405,DHCP服务器110根据DHCP客户端130的硬件地址确定该DHCP客户端是否属于主机池(Host Pool)中的主机。所述主机池中的主机是指与该DHCP服务器110在同一网络内的DHCP客户端130。如果是,则在步骤S421,DHCP服务器110直接将含有IP地址的DHCP讯息封包传送给DHCP客户端130。如果该DHCP客户端不是属于主机池中的主机,在步骤S407,DHCP服务器110确定该DHCP客户端130是否有IP地址租约。如果有,则在步骤S421,DHCP服务器110亦直接将该含有IP地址的DHCP讯息封包传送给DHCP客户端130。如果该DHCP客户端130与该DHCP服务器110间没有IP地址租约,在步骤S409,DHCP服务器110确定DHCP讯息封包中所包含的IP地址是否为该DHCP客户端130所需求的IP地址。如果是,在步骤S411,DHCP服务器110确定该IP地址是否为其租约范围内的IP地址。如果是,在步骤S421,DHCP服务器110亦直接将该含有IP地址的DHCP讯息封包传送给DHCP客户端130。如果在步骤S409以及步骤S411的判断结果均为否,在步骤S413,DHCP服务器110确定是否可在地址池中找到一闲置的IP地址。如果可找到一闲置的IP地址,在步骤S415,DHCP服务器110确认该闲置IP地址是否未提供给其它DHCP客户端使用。如果该IP地址确未提供给其它DHCP客户端使用,在步骤S421,DHCP服务器110将含有该闲置IP地址的DHCP讯息封包发送给DHCP客户端130。如果在步骤S413以及步骤S415的判断结果均为否,在步骤S417,DHCP服务器110确定是否可在地址池中找到一租约已到期的IP地址。如果可找到一租约已到期的IP地址,在步骤S415,DHCP服务器110确认该IP地址的租约是否真的已到期。如果为是,则在步骤S421,DHCP服务器110将含有该租约已到期的IP地址的DHCP讯息封包发送给DHCP客户端130。如果在步骤S417以及步骤S419的判断结果均为否,DHCP服务器110停止发送DHCP讯息封包给DHCP客户端130。整个流程结束。FIG. 4 is a flow chart of checking whether there is an address conflict when the DHCP server 110 allocates an IP address to the DHCP client 130 in the dynamic host configuration system and method of the present invention. When a DHCP server 110 intends to send a DHCPOFFER message packet to the DHCP client 130, in step S401, the DHCP server 110 first initializes the DHCPOFFER message packet. In step S403 , the DHCP server 110 acquires the hardware address of the DHCP client 130 . The hardware address is obtained from the chaddr field 204 of the DHCP message packet. In step S405, the DHCP server 110 determines whether the DHCP client belongs to a host in the host pool (Host Pool) according to the hardware address of the DHCP client 130. The hosts in the host pool refer to the DHCP clients 130 in the same network as the DHCP server 110 . If yes, then in step S421 , the DHCP server 110 directly transmits the DHCP message packet containing the IP address to the DHCP client 130 . If the DHCP client is not a host in the host pool, in step S407, the DHCP server 110 determines whether the DHCP client 130 has an IP address lease. If yes, then in step S421 , the DHCP server 110 also directly transmits the DHCP message packet containing the IP address to the DHCP client 130 . If there is no IP address lease between the DHCP client 130 and the DHCP server 110 , in step S409 , the DHCP server 110 determines whether the IP address included in the DHCP message packet is the IP address required by the DHCP client 130 . If yes, in step S411, the DHCP server 110 determines whether the IP address is an IP address within its lease range. If yes, in step S421 , the DHCP server 110 also directly transmits the DHCP message packet containing the IP address to the DHCP client 130 . If the judgment results in step S409 and step S411 are both negative, in step S413, the DHCP server 110 determines whether an idle IP address can be found in the address pool. If an idle IP address can be found, in step S415, the DHCP server 110 confirms whether the idle IP address is not provided for other DHCP clients. If the IP address is indeed not provided for other DHCP clients, in step S421 , the DHCP server 110 sends a DHCP message packet containing the idle IP address to the DHCP client 130 . If the judgment results in step S413 and step S415 are both negative, in step S417, the DHCP server 110 determines whether an IP address whose lease has expired can be found in the address pool. If an IP address whose lease has expired can be found, in step S415, the DHCP server 110 confirms whether the lease of the IP address has really expired. If yes, then in step S421 , the DHCP server 110 sends the DHCP message packet containing the IP address whose lease has expired to the DHCP client 130 . If the judgment results in step S417 and step S419 are both negative, the DHCP server 110 stops sending the DHCP message packet to the DHCP client 130 . The whole process is over.

图5所示为本发明动态主机配置系统及方法的DHCP中继代理判断所接收的讯息类型以确定发送对象的流程图。在步骤S501,DHCP中继代理120检查其接口是否功能完善。该等接口包括与DHCP服务器110相互通讯的接口以及与DHCP客户端130相通讯的接口。在步骤S503,DHCP中继代理120激活一组任务来监听所述接口。当DHCP服务器110或DHCP客户端130向对方发送一DHCP封包时,该DHCP封包会首先为DHCP中继代理120所接收。在步骤S505,DHCP中继代理120接收到一DHCP封包。在步骤S507,DHCP中继代理120确定该DHCP封包的讯息操作代码是否为BOOTREPLY。如果该DHCP封包的讯息操作代码为BOOTREPLY,说明该DHCP封包是由DHCP服务器110传送过来,需要传送给DHCP客户端130。在步骤S509,DHCP中继代理120将该DHCP封包传送至DHCP客户端130。如果该DHCP封包的op字段202不是BOOTREPLY,在步骤S511,DHCP中继代理120确定该DHCP封包的op字段202是否为BOOTREQUEST。如果该DHCP封包的op字段202为BOOTREQUEST,说明该DHCP封包是由DHCP客户端130传送过来,需要传送给DHCP服务器110。在步骤S513,DHCP中继代理120将该DHCP封包传送至DHCP服务器110。如果该DHCP封包的op字段202既不是BOOTREPLY,也不是BOOTREQUEST,DHCP中继代理120则不作任何处理,整个流程结束。FIG. 5 is a flow chart showing the DHCP relay agent of the dynamic host configuration system and method of the present invention judging the type of the received message to determine the sending object. In step S501, the DHCP relay agent 120 checks whether its interface is fully functional. The interfaces include an interface for communicating with the DHCP server 110 and an interface for communicating with the DHCP client 130 . In step S503, the DHCP relay agent 120 activates a set of tasks to monitor the interface. When the DHCP server 110 or the DHCP client 130 sends a DHCP packet to the other party, the DHCP packet will be received by the DHCP relay agent 120 first. In step S505, the DHCP relay agent 120 receives a DHCP packet. In step S507, the DHCP relay agent 120 determines whether the message operation code of the DHCP packet is BOOTREPLY. If the message operation code of the DHCP packet is BOOTREPLY, it means that the DHCP packet is sent by the DHCP server 110 and needs to be sent to the DHCP client 130 . In step S509 , the DHCP relay agent 120 transmits the DHCP packet to the DHCP client 130 . If the op field 202 of the DHCP packet is not BOOTREPLY, in step S511, the DHCP relay agent 120 determines whether the op field 202 of the DHCP packet is BOOTREQUEST. If the op field 202 of the DHCP packet is BOOTREQUEST, it means that the DHCP packet is sent by the DHCP client 130 and needs to be sent to the DHCP server 110 . In step S513 , the DHCP relay agent 120 transmits the DHCP packet to the DHCP server 110 . If the op field 202 of the DHCP packet is neither BOOTREPLY nor BOOTREQUEST, the DHCP relay agent 120 does not perform any processing, and the whole process ends.

Claims (7)

CNA031268218A2003-06-062003-06-06 Dynamic Host Configuration MethodPendingCN1553350A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CNA031268218ACN1553350A (en)2003-06-062003-06-06 Dynamic Host Configuration Method

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CNA031268218ACN1553350A (en)2003-06-062003-06-06 Dynamic Host Configuration Method

Publications (1)

Publication NumberPublication Date
CN1553350Atrue CN1553350A (en)2004-12-08

Family

ID=34322020

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CNA031268218APendingCN1553350A (en)2003-06-062003-06-06 Dynamic Host Configuration Method

Country Status (1)

CountryLink
CN (1)CN1553350A (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN100405765C (en)*2006-07-112008-07-23杭州华三通信技术有限公司 IP address allocation method and device
CN101355594A (en)*2008-09-092009-01-28中兴通讯股份有限公司Method for detecting address conflict when distributing IP address
CN100463411C (en)*2005-01-272009-02-18国际商业机器公司Controlling service failover in clustered storage apparatus networks and opration method thereof
CN1845554B (en)*2005-12-062010-05-05华为技术有限公司Control method for dynamically distributing IP address in 3G network
CN101312415B (en)*2007-05-222011-01-26晶睿通讯股份有限公司 A Method for Analyzing Network Environment
CN101312416B (en)*2007-05-222011-05-11晶睿通讯股份有限公司 Method and system for connecting wireless network devices
CN101035012B (en)*2006-03-092011-06-22上海博达数据通信有限公司Ethernet multi-layer switcher secure protection method based on DHCP and IP
CN102340421A (en)*2007-11-222012-02-01华为技术有限公司 Gateway management method, address assignment method, device, and system
CN102571996A (en)*2010-12-132012-07-11联想(北京)有限公司IP (Internet Protocol) address assignment method, IP address assignment device and network system
CN102685037A (en)*2012-06-082012-09-19汕头市易普联科技有限公司Gateway equipment
CN103618634A (en)*2013-12-112014-03-05上海爱数软件有限公司Method for automatically finding nodes in cluster
CN104410727A (en)*2014-11-202015-03-11中国联合网络通信集团有限公司Address distributing method, client terminal, server and address distributing system
CN105959315A (en)*2016-07-062016-09-21锐捷网络股份有限公司IP (Internet Protocol) keep-alive method and client applied to user migration

Cited By (18)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN100463411C (en)*2005-01-272009-02-18国际商业机器公司Controlling service failover in clustered storage apparatus networks and opration method thereof
CN1845554B (en)*2005-12-062010-05-05华为技术有限公司Control method for dynamically distributing IP address in 3G network
CN101035012B (en)*2006-03-092011-06-22上海博达数据通信有限公司Ethernet multi-layer switcher secure protection method based on DHCP and IP
CN100405765C (en)*2006-07-112008-07-23杭州华三通信技术有限公司 IP address allocation method and device
CN101312415B (en)*2007-05-222011-01-26晶睿通讯股份有限公司 A Method for Analyzing Network Environment
CN101312416B (en)*2007-05-222011-05-11晶睿通讯股份有限公司 Method and system for connecting wireless network devices
CN102340421B (en)*2007-11-222015-01-21华为技术有限公司Gateway management method, address allocation method, device and system
CN102340421A (en)*2007-11-222012-02-01华为技术有限公司 Gateway management method, address assignment method, device, and system
CN101355594A (en)*2008-09-092009-01-28中兴通讯股份有限公司Method for detecting address conflict when distributing IP address
CN102571996A (en)*2010-12-132012-07-11联想(北京)有限公司IP (Internet Protocol) address assignment method, IP address assignment device and network system
CN102571996B (en)*2010-12-132014-11-05联想(北京)有限公司IP (Internet Protocol) address assignment method, IP address assignment device and network system
CN102685037A (en)*2012-06-082012-09-19汕头市易普联科技有限公司Gateway equipment
CN102685037B (en)*2012-06-082015-12-02汕头市易普联科技有限公司Gateway device
CN103618634A (en)*2013-12-112014-03-05上海爱数软件有限公司Method for automatically finding nodes in cluster
CN104410727A (en)*2014-11-202015-03-11中国联合网络通信集团有限公司Address distributing method, client terminal, server and address distributing system
CN104410727B (en)*2014-11-202018-03-23中国联合网络通信集团有限公司Address distribution method, client, server and address allocation system
CN105959315A (en)*2016-07-062016-09-21锐捷网络股份有限公司IP (Internet Protocol) keep-alive method and client applied to user migration
CN105959315B (en)*2016-07-062019-08-20锐捷网络股份有限公司A kind of IP keepalive method and client for user's migration

Similar Documents

PublicationPublication DateTitle
EP1540885B1 (en)Dynamic port configuration of network equipment
EP1042877B1 (en)Method and system for automatic allocation of resources in a network
US6587455B1 (en)Automatic discovery of nodes associated with a virtual subnet
TWI227614B (en)Method for dynamically allocating IP addresses for hosts on a network
US6061739A (en)Network address assignment using physical address resolution protocols
CN101075944B (en)Method and system for allocating IP address
CN102148879A (en)Port mapping method and device and communication system
KR101352852B1 (en)Method for allocating IP address using DHCP in an image forming apparatus, Image forming apparatus thereof, and System for allocating IP address using DHCP
EP2048858A1 (en)Configuration of routers for DHCP service requests
CN1553350A (en) Dynamic Host Configuration Method
US8255498B2 (en)Router and method for avoiding IP address conflicts
US7512138B2 (en)Device. system, and method for automatically determining an appropriate LAN IP address range in a multi-router network environment
EP3048756B1 (en)Management method and apparatus for dynamic host configuration protocol server and relay
CN101588357A (en)Router and method for indentifying user identity applying same
US8217984B2 (en)Videoconferencing network adapter detection using STUN protocol
KR100355288B1 (en)Apparatus and method for providing service server functionality to the hosts of a private network
CN107295113B (en)Network configuration method, switch and server
KR20020036346A (en)a system for supporting movement of host computer and method therefor
Carpenter et al.Problem Statement for Renumbering IPv6 Hosts with Static Addresses in Enterprise Networks
Cui et al.Dynamic Allocation of Shared IPv4 Addresses
KR100377628B1 (en)Implementation method of simultaneously working DHCP server and BOOTP relay agent
BrzozowskiDHCPv6
KR20030020125A (en)Apparatus and method for managing internet protocol address
AG et al.Dynamic Allocation of Shared IPv4 Addresses
TW544580B (en)Method using wireless-LAN NIC to establish virtual access point architecture

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
C02Deemed withdrawal of patent application after publication (patent law 2001)
WD01Invention patent application deemed withdrawn after publication

[8]ページ先頭

©2009-2025 Movatter.jp