WO2011029406A1 - Ip地址自动分配方法、设备和*** - Google Patents

Ip地址自动分配方法、设备和*** Download PDF

Info

Publication number
WO2011029406A1
WO2011029406A1 PCT/CN2010/076796 CN2010076796W WO2011029406A1 WO 2011029406 A1 WO2011029406 A1 WO 2011029406A1 CN 2010076796 W CN2010076796 W CN 2010076796W WO 2011029406 A1 WO2011029406 A1 WO 2011029406A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
client
dhcp
server
official
Prior art date
Application number
PCT/CN2010/076796
Other languages
English (en)
French (fr)
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
Priority claimed from CN 200910170885 external-priority patent/CN101656763B/zh
Priority claimed from CN200910215385.2A external-priority patent/CN102118453B/zh
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP10815008.7A priority Critical patent/EP2477361B1/en
Publication of WO2011029406A1 publication Critical patent/WO2011029406A1/zh
Priority to US13/416,661 priority patent/US9900183B2/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/54Store-and-forward switching systems 
    • H04L12/56Packet switching systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Definitions

  • IP address automatic allocation method device and system
  • the present invention relates to the field of network technologies, and in particular, to an automatic IP address allocation method, a client, and a server.
  • IP Internet Protocol
  • the IP address allocation method includes: Automatically obtaining an IP address.
  • the way to obtain the IP address automatically means: The client does not need manual intervention, and can automatically obtain the host's IP address, gateway IP address and network segment mask of the client.
  • the main technology for automatically obtaining an IP address is the Dynamic Hosting (DHCP: Dynamic Hos t Conf igurat Protocol).
  • DHCP Dynamic Hos t Conf igurat Protocol
  • the DHCP server centrally manages all IP network configuration data and handles the client's DHCP request; the client uses the IP configuration data allocated from the DHCP server.
  • a DHCP relay needs to be configured on the same network segment of the client (Relay ) host.
  • the DHCP Relay host receives the DHCP request from the client, and then sends the DHCP request to the DHCP server, and the DHCP server returns The recurrence is sent to the client.
  • the standard service of the IP network only provides the routing function and does not provide the automatic configuration of the IP address.
  • the DHCP relay host belongs to the automatic configuration of the IP address and is not a routing function. Therefore, the bearer network operator generally does not provide DHCP. Relay function. Since the carrier network operator does not provide the DHCP Relay function, it is difficult to implement automatic IP address configuration under the standard service of the IP network. Summary of the invention
  • the embodiments of the present invention provide an automatic IP address allocation method, a client, and a server, which can implement automatic IP address allocation efficiently and at low cost.
  • An embodiment of the present invention provides an automatic IP address allocation method, where the method includes: the client acquires a 1 "3 ⁇ 4 text" including an unassigned IP address; and the client detects the unassigned IP address in the obtained 1? If the unassigned IP address is not occupied, it is determined whether the unallocated IP address is obtained by the client, and if so, the unallocated IP address is obtained.
  • the embodiment of the present invention further provides an IP address client, where the client includes: an ip packet obtaining unit, configured to acquire an IP packet including an unassigned IP address, and an IP address detecting unit, configured to detect an IP packet. Whether the unassigned IP address in the IP packet obtained by the acquiring unit is occupied; the determining unit, configured to determine, when the IP address detecting unit detects that the unallocated IP address is not occupied, whether the obtained by the client is not obtained Assign an IP address.
  • the embodiment of the present invention further provides an automatic IP address allocation method, where the method includes: an IP address allocation server generates an IP packet including an unassigned IP address; and an IP address allocation server sends the IP packet to the The network segment where the unassigned IP address is located, where there is a client that is not assigned an IP address; the IP address allocation server receives an acknowledgement message that the unassigned IP address has been allocated.
  • the embodiment of the present invention further provides an IP address distribution server, where the server includes: an IP source generating unit, configured to generate an IP address including an unassigned IP address; and an IP file sending unit, And sending the IP address generated by the text generating unit to the network segment where the unallocated IP address is located, where the client having the unassigned IP address exists in the network segment; the acknowledgement message receiving unit is configured to receive The acknowledgment message that the unassigned IP address has been assigned.
  • the server includes: an IP source generating unit, configured to generate an IP address including an unassigned IP address; and an IP file sending unit, And sending the IP address generated by the text generating unit to the network segment where the unallocated IP address is located, where the client having the unassigned IP address exists in the network segment; the acknowledgement message receiving unit is configured to receive The acknowledgment message that the unassigned IP address has been assigned.
  • the embodiment of the present invention uses the IACP server to actively send an unassigned IP address and the client actively obtains an unassigned IP address, which overcomes the problem that the DHCP server and the client are not on the same network segment in the prior art.
  • the DHCP Relay host can assign IP addresses to clients, saving configuration costs and simplifying network configuration.
  • the embodiment of the present invention provides an IP address automatic configuration method, a server device, a client, and a communication system, which are used to solve the problem of high input and maintenance costs caused by the need to specifically set a DHCP relay device in the prior art. .
  • An embodiment of the present invention provides a method for automatically configuring an IP address, including: a server that determines a client having a formal IP address in a communication range to which a client to which a formal IP address is to be configured, the official IP address being configured IP address; the server device sends a relay configuration indication message to the client having the official IP address, where the relay configuration indication message carries the dynamic host configuration protocol DHCP configuration information; when the client with the official IP address is based After the DHCP configuration information configures the local device as a DHCP relay device, the server device allocates a formal IP address to the client to be configured with the official IP address through a client configured as a DHCP relay.
  • the embodiment of the present invention further provides a method for automatically configuring an IP address, including: a client having a formal IP address receiving a relay configuration indication message sent by a server device, where the relay configuration indication message carries a dynamic host configuration protocol DHCP Configuration information, the client with the official IP address is in the same communication range as the client to be configured with the official IP address;
  • the client of the IP address configures the local machine as a DHCP relay according to the DHCP configuration information; the client configured as a DHCP relay provides a DHCP relay function, and the server is configured as the client to be configured with the official IP address. Assign a formal IP address.
  • An embodiment of the present invention provides a server device, including: a client determining module, configured to: Determining, in the communication range to which the client to be configured the official TP address belongs, a client having a formal TP address, the official IP address being a configured IP address, and a sending module, configured to send to the client having the official IP address a relay configuration indication message, where the relay configuration indication message carries dynamic host configuration protocol DHCP configuration information; and an allocation module, configured to configure the local device as a DHCP relay device according to the DHCP configuration information when the client having the official IP address Then, a client configured as a DHCP relay is assigned a formal IP address to the client to which the official IP address is to be configured.
  • the embodiment of the present invention provides a client, including: a receiving module, configured to receive a relay configuration indication message sent by a server device, where the relay configuration indication message carries a dynamic host configuration protocol DHCP configuration information;
  • the device is configured as a DHCP relay according to the DHCP configuration information.
  • the relay module is configured to provide a DHCP relay function, and the server device is configured to allocate a formal IP address to a client to be configured with a formal IP address.
  • An embodiment of the present invention provides a communication system, including: the foregoing server device; and the foregoing client.
  • a client having a formal IP address is configured as a DHCP relay device, and when the IP address is configured by using DHCP, it is not necessary to set a dedicated DHCP relay device in the network system, thereby achieving network entry and maintenance costs. reduce. DRAWINGS
  • FIG. 1 is a flowchart of a method for automatically allocating an IP address according to an embodiment of the present invention.
  • FIG. 2 is a flowchart of an automatic IP address allocation method according to an embodiment of the present invention.
  • FIG. 3 is a signaling diagram of an automatic IP address allocation method according to an embodiment of the present invention.
  • FIG. 4 is a signaling diagram of an automatic IP address allocation method according to an embodiment of the present invention.
  • FIG. 5 is a block diagram of an IP address client 500 according to an embodiment of the present invention.
  • FIG. 6 is a block diagram of an IP address detecting unit 502 according to an embodiment of the present invention.
  • FIG. 7 is a block diagram of an IP address automatic allocation server 700 according to an embodiment of the present invention;
  • FIG. 1 is a schematic flowchart of a method according to an embodiment of the present invention.
  • FIG. 2a is a schematic flowchart of a method according to an embodiment of the present invention.
  • FIG. 3a is a schematic flowchart of a method according to an embodiment of the present invention.
  • FIG. 4a is a schematic structural diagram of a network system corresponding to an embodiment of the present invention.
  • FIG. 5a is a schematic flowchart of a method according to an embodiment of the present invention.
  • 6a is a schematic structural diagram of a network system corresponding to an embodiment of the present invention.
  • FIG. 7a is a schematic flowchart of a method according to an embodiment of the present invention.
  • FIG. 8a is a schematic structural diagram of a network system corresponding to an embodiment of the present invention.
  • 9a is a schematic flowchart of a method according to an embodiment of the present invention.
  • 10a is a schematic structural diagram of a network system corresponding to an embodiment of the present invention.
  • 11a is a schematic structural diagram of a server device according to an embodiment of the present invention.
  • FIG. 12a is a schematic structural diagram of a client according to an embodiment of the present invention.
  • FIG. 13a is a schematic structural diagram of a communication system according to an embodiment of the present invention. detailed description
  • the IP address auto-configuration technology introduced in the embodiment of the present invention may be named as IACP: IP Addres s Auto Conf iguration Protocol.
  • the ten-party protocol can be used for remote automatic IP address allocation, wherein the 7- carrier network can be a three-layer IP network, and the three-layer IP network only needs to configure simple routing information.
  • IACP Cl ient This is the IACP client. This node needs to be assigned an IP address. In other words, the client is the host waiting to assign an IP address, such as a computer.
  • IACP Server The IACP server (which can be called “IP address allocation server”), which provides IP address allocation services, including IP address pools, and IP address allocation policies.
  • the IACP address allocation solution is described below from the perspective of the method, the nodes involved (also referred to as “network elements,” or devices) and the system.
  • ARP addres s resolut ion protocol Address resolution protocol, which maps IP addresses to Ethernet MAC addresses.
  • ARP request In the ARP protocol, the local device knows the IP address of a node, but does not know the MAC address of the node. The local machine sends an ARP request on the Ethernet broadcast to query the MAC address of the IP address.
  • ARP response In the ARP protocol, the local device finds that the IP address in the ARP request is the local IP address, and the local device sends an ARP response to the peer host, and informs the MAC address corresponding to the IP address.
  • Free ARP request The host wants to use an IP address as the IP address of the local machine, but does not know whether an IP address conflict will occur. That is, the Ethernet broadcasts a free ARP request for the IP address. If a response is received, it indicates that a conflict occurs. Otherwise it means that no conflict has occurred;
  • Free ARP Response The host wants to use an IP address as the IP address of the machine, and the free ARP response to the Ethernet broadcasts the entire Ethernet, which is used by the local machine.
  • FIG. 1 is a flowchart of a method for automatically allocating an IP address according to an embodiment of the present invention. As shown in FIG. 1, the method includes:
  • the client obtains a message including an unassigned IP address.
  • the client that is not assigned an IP address obtains a TP packet, and the IP packet includes an unassigned IP address (one or more), and the IP packet may be an ARP (address) including an unassigned IP address.
  • the request packet, the ARP request packet can be sent by the IACP server or the access router of the local network segment.
  • the client and the IACP server are not on the same network segment, the client receives the network segment.
  • the client and the IACP server are on the same network segment, the client receives the ARP request packet sent by the IACP server.
  • the IACP server or the access router broadcasts an ARP request packet on the local network segment.
  • the ARP request packet can be used to obtain a MAC address corresponding to an unassigned IP address in the ARP request packet.
  • the client detects whether the unassigned IP address in the obtained IP packet is occupied.
  • the client may broadcast a free ARP request packet including an unassigned IP address to the local network segment, and detect whether the obtained unallocated IP address has been obtained according to the response message of the reply. Occupied.
  • the free ARP request may be broadcast to other nodes of the network segment (such as other clients, computers in the network segment, or access routers, or servers using IP addresses in the network segment). Packet, and then, according to the free ARP response message of other nodes, it is detected whether the IP address is already occupied.
  • the network segment refers to the network segment where the client is located.
  • the unassigned IP address is not occupied, determine whether the unassigned IP address is obtained by the client, and if yes, obtain the unassigned IP address.
  • the client if the client does not receive the response message replied by other nodes, it considers that the unassigned IP address is not occupied, and further determines whether the unassigned IP address is obtained by the client. Specifically, if there are multiple clients that are not assigned an IP address, all clients that are not assigned an IP address may select one client to obtain an unassigned IP address by election, which may be sent according to other received clients. The comparison information carried by the free ARP request packet determines whether the unassigned IP address is obtained by the client.
  • the elected client after the elected client obtains the unassigned IP address, it broadcasts a response message (for example, a free ARP response) that the IP address has been occupied to the local network segment.
  • a response message for example, a free ARP response
  • the client that obtains the unassigned IP address can also be considered to send a free ARP response to other clients in the network segment.
  • the client that obtains the unassigned IP address can also obtain the mask of the network segment, the IP address of the gateway, and the IP address of the IACP server. Finally, according to the obtained IACP server. The IP address sends an acknowledgment message to the IACP server that the unassigned IP address has been assigned.
  • the embodiment of the present invention uses an IACP server to actively send an unassigned IP address, and the client actively acquires an unassigned IP address, which overcomes the need to additionally add when the DHCP server and the client are not on the same network segment in the prior art.
  • the DHCP Relay host can assign IP addresses to clients, saving configuration costs and simplifying network configuration.
  • Embodiment 1 describes the IACP address allocation solution from the perspective of the client.
  • Embodiment 2 will be described from the perspective of the IACP server.
  • FIG. 2 is a flowchart of an automatic IP address allocation method according to an embodiment of the present invention. As shown in FIG. 2, the method includes:
  • the IACP server generates an IP packet according to the unassigned IP address, where the IP packet carries an unassigned IP address.
  • the IACP server generates an IP packet according to an unassigned IP address (which may be embodied in the form of an IP address list), and the IP packet includes an unassigned IP address (one or more).
  • the IP packet can be in different ways according to the application scenario. If the IACP server and the client are not in the same network segment, the IP packet can be a probe IP packet, including the network where the IP address is not assigned. The mask of the segment, the IP address of the gateway, and the IP address of the IACP server.
  • the client can be understood as a client that needs to be assigned an IP address, that is, a client that is not assigned an IP address.
  • the IP packet can be an ARP request packet, and the ARP request packet includes an unassigned IP address.
  • S202 Send the IP >3 ⁇ 4 text to the network segment where the unassigned IP address is located.
  • the IACP server sends the IP packet to the network segment where the unassigned IP address is located.
  • the "send" here can be either a periodic transmission method or an event-triggered transmission method. The following mainly uses the periodic transmission method as an example. Said.
  • the IACP server When the IP packet is a probe IP packet, the IACP server periodically sends the probe IP packet to the access router of the network segment where the unassigned IP address is located, and then the access router generates an ARP request packet according to the probe IP packet, and Send the ARP request packet to the client on the same network segment.
  • the client segment has an IP addressless client.
  • the IACP server When the IP packet is an ARP request packet, the IACP server periodically sends the ARP request packet to the client on the network segment where the IP address is not assigned.
  • the network segment has a client that is not assigned an IP address.
  • S203 Receive an acknowledgement message that the unassigned IP address sent by the client has been allocated.
  • the client may notify the IACP server that the IP address has been allocated through an acknowledgement message, that is, the IACP server receives the unassigned IP address sent by the client.
  • a confirmation message is assigned.
  • the method for automatically allocating an IP address may further include the step S204, refreshing the list of unallocated IP addresses according to the received confirmation message.
  • the IACP server stops sending according to the received confirmation message.
  • the IP address of the IP address is updated, and the list of unallocated IP addresses is refreshed, and step S201 is re-executed according to the list of the unallocated IP addresses after the refresh, and a new 1? message is generated.
  • the IACP server refreshes the list of unallocated IP addresses according to the received notification message, and according to the refresh The list of unallocated IP addresses is re-executed in step S201 to generate a new IP packet.
  • the embodiment of the present invention uses an IACP server to actively send an unassigned IP address, and the client actively acquires an unassigned IP address, which overcomes the need to additionally add when the DHCP server and the client are not on the same network segment in the prior art.
  • DHCP Relay host can be used as a client The problem of assigning IP addresses saves configuration costs and simplifies network configuration.
  • FIG. 3 is a signaling diagram of an automatic IP address allocation method according to an embodiment of the present invention.
  • a client needs to allocate an IP address, and an IACP server provides an IP address allocation service.
  • an IACP server is assumed.
  • the client is not on the same network segment.
  • the method includes:
  • the IACP server generates a probe IP packet according to the unassigned IP address, and detects that the IP packet carries an unassigned IP address and routing information.
  • the IACP server when the IACP server finds that the planned IP address has not been allocated, the IP address is assumed to be IP1, the IACP server uses IP1 as the destination IP address, and the IACP server IP address is used as the source IP address.
  • IP1 IP1
  • the IACP server IP address is used as the source IP address.
  • the IP packet can carry the mask length of the network segment where IP1 is located, the gateway IP address of the network segment where IP1 is located (assuming the gateway IP address is IP0), and other optional information.
  • the probe IP packet is identified as a probe IP packet (IP1).
  • IP1 probe IP 1
  • the client can use the aforementioned mask length and gateway IP address to generate routing information when sending an IP packet to the outside.
  • the IACP server sends a probe IP packet to the access router of the target client.
  • the target client is the client of the network segment where the IP address IP1 is not assigned.
  • the IACP server sends the probe IP packet to the network segment where the unassigned IP address is located.
  • the probe IP packet (IP1) is a unicast IP packet
  • the bearer network is a three-layer network
  • the probe IP packet (IP1) is sent to the access router of the network segment where the IP1 is located, and the access router It is also the access router of a client, and the router is Router l.
  • sending here can be either a periodic transmission or an event-triggered transmission.
  • the IACP server repeatedly sends the probe IP (IP1) packet in a certain period T1 until a client feedback IP1 allocation is completed before stopping transmission.
  • T1 is a configurable time parameter, here T1 Can be set to 5 seconds.
  • the access router of the target client broadcasts an ARP request packet of the target IP address to the entire target network segment.
  • IP1 is an unassigned IP address
  • the access router Routerl knows which network segment IP1 is on, but does not know the Ethernet MAC address corresponding to IP1. Therefore, Router1 broadcasts an ARP request packet on the network segment where IP1 is located.
  • the ARP request packet can be used to query the MAC address corresponding to IP1.
  • the ARP request packet is identified as an ARP request packet (IP 1), and any client of the network segment where the IP1 is located can receive the ARP request packet (IP1).
  • the client receives an ARP request packet for detecting an IP address that may be allocated.
  • clients 1 and 2 use the received ARP request packet in the network to detect possible IP addresses when they are not assigned an IP address.
  • the client only processes the ARP request packet, and does not process the free ARP request packet, the ARP response packet, and the free ARP response packet.
  • Clients 1 and 2 receive an ARP request packet, and detect that the ARP request packet is an Ethernet MAC address whose IP address is IP1.
  • the ARP request packet may be called an ARP request packet (IP1), and the client 1 And 2 think that IP1 may be the IP address assigned by the IACP server to the client, so they are all ready to preempt the IP address. It can be understood that if multiple clients in the network segment are not assigned an IP address and the ARP request packet is received, all clients in the network segment that are not assigned an IP address can prepare to preempt the client. IP address.
  • the client sends a probe message (such as a free ARP request packet) including an unassigned IP address.
  • a probe message such as a free ARP request packet
  • the client detects whether the target IP address is occupied by sending a free ARP request packet.
  • the clients 1 and 2 may send the IP1 in the local network segment after a random delay, for example, after a random delay between T2 and T2+T3.
  • the free ARP request packet which is identified as a free ARP request packet (IP1).
  • Free ARP The request packet (IP1) carries the special flag of the IACP protocol. There are many methods, which are not limited here. For example, in the MAC frame padding field of the free ARP request packet (IP1), 0x5 A is added as a special flag of the IACP protocol.
  • T2 and T3 are configurable time parameters, where both T2 and T3 can be supported for 100 milliseconds.
  • the effect of random delay is to prevent all clients with unassigned addresses in the network segment from sending free ARP request packets at the same time to generate an Ethernet broadcast storm.
  • the client determines whether the target IP address is occupied.
  • the client detects whether the target IP address is occupied according to the response message replied by other nodes of the network segment.
  • the response message can be an ARP response packet or a free ARP response packet.
  • the node in the network segment after receiving the ARP request packet, the node in the network segment sends an ARP response packet to the sender when the IP address in the ARP request packet is the local IP address.
  • the MAC address corresponding to the IP address.
  • the client 1 receives the ARP response packet sent by the client 2, indicating that the target IP address is already occupied.
  • the free ARP request packet broadcasts the free ARP request packet for the IP address because it does not know whether an IP address conflict will occur. A conflict occurs, otherwise it indicates no conflict.
  • the free ARP response packet is that the client wants to use an IP address as the IP address of the client, and the free ARP response packet on the Ethernet broadcasts the entire Ethernet. The IP address is used by the client.
  • the client when the client is in this stage, the client receives a free ARP request packet, a free ARP response packet, and an ARP response packet sent by other clients.
  • client 1 or 2 receives the free ARP response packet (IP1) or ARP response packet (IP1), it indicates that the IP1 is occupied and immediately returns to the state of S304.
  • T4 is a configurable time parameter, where T4 can be set to 1 second.
  • IP1 When IP1 has been assigned to a client, the client must immediately send back an ARP response packet (IP1) and any number of free ARP request packets (IP1) when it receives any free ARP request packet (IP1). How many ARP response packets (IP1) are sent back to notify IP1 that it has been assigned to the client.
  • IP1 ARP response packet
  • IP1 any number of free ARP request packets
  • IP1 How many ARP response packets (IP1) are sent back to notify IP1 that it has been assigned to the client.
  • clients 1 and 2 at this stage may not process ARP request packets.
  • the client that does not obtain the IP address re-enters the S304 and obtains
  • the IP1 client announces that IP1 has been assigned and proceeds to S308.
  • the comparison information of the election is carried by a free ARP request packet (IP1) carrying a special flag of the IACP protocol, for example, the comparison information may be a MAC address.
  • IP1 free ARP request packet
  • Election method 1 The client with the smallest Ethernet MAC value obtains IP1.
  • the client picks up the free ARP request packet (IP1) carrying the special flag of the IACP protocol from all the free ARP request packets (IP1) received, and extracts the source MAC address from these free ARP request packets (IP1).
  • IP1 free ARP request packet
  • IP1 free ARP request packet
  • IP1 free ARP request packet
  • IP1 source MAC address
  • the MAC address is exactly the MAC address of all other clients on the network segment that have not been assigned an IP address.
  • the client's MAC address is compared to these MAC addresses. If the client's MAC value is the smallest, the client obtains IP1, otherwise the client cannot obtain IP1, and the client returns to S304.
  • the client picks up the free ARP request packet (IP1) carrying the special flag of the IACP protocol from all the free ARP request packets (IP1) received, and extracts from these free ARP request packets (IP1).
  • IP1 free ARP request packet
  • IP1 free ARP request packet
  • Source MAC address these MAC addresses are exactly the MAC addresses of all other clients in this network segment that have not been assigned an IP address.
  • the client's MAC address is compared to these MAC addresses. If the MAC value of the client is the largest, the client obtains IP1, otherwise the client cannot obtain IP1, and the client returns to S304.
  • the above “election” is described from the perspective of multiple clients. If it is described from a client, it can be understood as: The client needs to determine whether the IP address is obtained by the client, and the specific judgment manner Therefore, according to the received comparison information carried by the free ARP request packet sent by other clients, it is determined whether the unassigned IP address is obtained by the client, and the comparison information may be a MAC address.
  • IP1 free ARP response packet
  • the client may notify the access router of the MAC address of the client through the ARP response message, and after receiving the ARP response message, the access router sends the probe IP packet stored before, and the client receives the probe to the probe. After the IP packet, you can get the information in it.
  • this step is used to receive a probe IP packet (IP1) stored in Router1.
  • the purpose of this step is to: first, by receiving the probe IP packet (IP1), confirm that IP1 is the IP address assigned by the IACP server; second, analyze the probe IP packet (IP1), and obtain routing information such as mask length and gateway IP address, and Other possible information, for example, when the network segment also includes the second gateway, the IP address of the second gateway can be obtained; third, by detecting the source IP address of the IP packet (IP1), the IP address of the IACP server is obtained for the client. Confirm to the IACP server that IP1 has been assigned.
  • IP1 ARP response packet
  • Router1 uses MAC1 as the destination address.
  • the client 2 After obtaining the probe IP packet (IP1), the client 2 analyzes the IP packet and obtains the mask of the network segment where the client 2 is located, the gateway IP address, the IP address of the IACP server, and other possible information, and then proceeds to S310.
  • IP1 probe IP packet
  • T5 is a configurable time parameter, which can be assumed here as T5 is 10 seconds.
  • T5 can be set to be greater than or equal to T1, because when the first probe IP packet (IP1) sent by the IACP server is discarded by Router1, the client can wait for enough time to receive and receive the second probe IP packet sent by the IACP server (IP1). ).
  • the client that obtains the IP address sends an acknowledgement message that the unassigned IP address has been allocated to the IP distribution server.
  • the client notifies the IACP server that the destination IP address IP1 has been assigned.
  • this stage is used to notify the IACP server that IP1 has been allocated, refresh the IP address allocation pool, and stop sending the probe IP packet (IP1).
  • IP2 client 2 uses the IP address of the IACP server as the destination IP address, and IP1 is the source IP address, and sends an IP1 acknowledgement message to the IACP server.
  • the IACP server refreshes the IP address allocation pool (IP address list) and stops sending the probe IP packet (IP1).
  • the probe IP packet contains only one unassigned IP address, that is, IP1.
  • IP1 When the probe IP packet includes multiple unassigned IP addresses, one of the unassigned IP addresses IP1 is allocated, and the IACP server receives The IP1 sent by the client has been assigned an acknowledgment message, refreshes the IP address allocation pool, and updates the probe IP packet.
  • the technical solution provided by the embodiment of the present invention can utilize only the most basic and indispensable functions of the IP network, and can complete automatic IP address allocation without the optional function of the IP network, and can implement the client and the IP address. Assign servers on different IP networks.
  • the technical solution provided by the embodiment of the present invention provides a complete IP address that does not require the special function of the Layer 3 IP network. Automatic configuration function.
  • the solution is compatible with the application network of Layer 2 Ethernet. It can achieve the following effects:
  • the compatible bearer network is an application scenario of Layer 2 Ethernet. It ensures that only one IP address automatic allocation technology is used in the Layer 3 IP network and the Layer 2 Ethernet network to reduce network deployment costs.
  • FIG. 4 is a signaling diagram of an automatic IP address allocation method according to an embodiment of the present invention.
  • the client needs to assign an IP address
  • the IACP server provides an IP address allocation service.
  • the client in this embodiment is in the IACP server.
  • the IP addresses under the same network segment are automatically assigned.
  • the method includes:
  • the IACP server generates a probe IP packet with an unassigned IP address, and carries an IP address and routing information.
  • this step is the same as S301 described in Embodiment 3, and therefore is not described herein again.
  • the IACP server sends an ARP request packet of the target IP address to the local network segment.
  • the IACP server if the IACP server wants to send the probe IP packet (IP1), it must know the MAC address corresponding to IP1. Since IP1 is an unassigned IP address, although the IACP server knows that IP1 is on the same network segment as itself, but does not know the Ethernet MAC address corresponding to IP1, the IACP server must broadcast an ARP request to the network segment where IP1 is located. Packet, the ARP request packet can be used to query the MAC address corresponding to IP1.
  • the ARP request packet may be referred to as an ARP request packet (IP1), and any client on the network segment where the IP1 is located may receive the ARP request packet (IP1).
  • the IACP server sends an ARP request packet (IP1) to the local network segment.
  • IP1 ARP request packet
  • the "send” here can be either a periodic transmission or a The method of sending after the event is triggered is as follows.
  • the IACP server In order to ensure that the ARP request packet (IP1) can be sent out, the IACP server repeatedly sends the ARP request packet (IP1) for a certain period of time T1 until a client feedback IP1 allocation has been completed before stopping the transmission.
  • T1 is a configurable time parameter, where T1 can be set to 5 seconds.
  • the client receives an ARP request packet for detecting an IP address that may be allocated.
  • this step is the same as S304 described in Embodiment 3, and therefore will not be further described herein.
  • the client After the client randomly delays, the client sends a free ARP request packet to detect whether the target IP address is used by other clients.
  • this step is the same as S305 described in Embodiment 3, and therefore is not described herein again.
  • the client detects whether an ARP response packet or a free ARP response packet is received, to determine whether the target IP address is occupied.
  • this step is the same as S306 described in Embodiment 3, and therefore will not be further described herein.
  • the client elects the only client to obtain IP1.
  • this step is the same as S307 described in Embodiment 3, and therefore will not be further described herein.
  • the client that obtains the IP address announces that IP1 is owned by it, and other clients may not preempt the IP address.
  • this step is the same as S308 described in Embodiment 3, and therefore is not described herein again.
  • the client may notify the server of the MAC address of the client by using the ARP response message, and after receiving the ARP response message, the server sends the previously generated probe IP packet, and after the client receives the probe IP packet, You can get the information in it.
  • This step is used to receive the probe IP packet (IP1) stored in the IACP server.
  • the purpose of this step is: First, by receiving the probe IP packet (IP1), confirming that IP1 is the IP address assigned by the IACP server; second, analyzing the probe IP packet (IP1) to obtain routing information such as mask length and gateway IP address, and Other possible information, for example, when the network segment also includes the second gateway, the IP address of the second gateway can be obtained; third, by detecting the source IP address of the IP packet (IP1), the IP address of the IACP server is obtained for the client. Confirm to the IACP server that IP1 has been assigned.
  • the client that obtains the IP1 sends back an ARP response packet (IP1) to the IACP server, and notifies the IACP server of the MAC address of the local device, assuming that the MAC address is MAC1.
  • IP1 ARP response packet
  • the IACP server sends a probe IP packet (IP1) to the client with MAC1 as the destination address.
  • the client After obtaining the probe IP packet (IP1), the client analyzes the IP packet and obtains the mask of the network segment where the client is located, the gateway IP address, the IP address of the IACP server, and other possible information, and then proceeds to step S409.
  • T5 is a configurable time parameter, where ⁇ 5 is 10 seconds. The other 5 is greater than or equal to T1, ensuring that the client has enough time to receive the second ARP request packet (IP1) sent by the IACP server, and the client can send back the ARP response packet (IP1) in time, and the IACP server sends the probe IP packet in time. (IPl) to the client.
  • the client notifies the IACP server that the destination IP address IP1 has been allocated.
  • this step is the same as S310 described in Embodiment 3, and therefore will not be further described herein.
  • the technical solution provided by the embodiment of the present invention can use only the most basic and indispensable functions of the IP network, and can complete the automatic IP address allocation without the optional function of the IP network, and It is possible to implement a client and an IP address distribution server on different IP networks.
  • the technical solution provided by the embodiment of the present invention provides a complete automatic IP address configuration function that does not require the special function of the Layer 3 IP network.
  • the solution is compatible with the application network of Layer 2 Ethernet. It can achieve the following effects:
  • the compatible bearer network is an application scenario of Layer 2 Ethernet. It ensures that only one IP address automatic allocation technology is used in the Layer 3 IP network and the Layer 2 Ethernet network to reduce network deployment costs.
  • FIG. 5 is a block diagram of an IP address client 500 according to an embodiment of the present invention.
  • the IP address client 500 includes: an IP address obtaining unit 501, an IP address detecting unit 502, and a determining unit 503.
  • the IP packet obtaining unit 501 is configured to obtain an IP packet including an unassigned IP address.
  • the IP packet obtaining unit 501 is configured to obtain an IP packet sent by the access router or the IACP server, where the IP packet may be an ARP request packet including an unassigned IP address.
  • the IP address detecting unit 502 is configured to detect whether an unassigned IP address in the IP packet obtained by the IP packet acquiring unit 501 is occupied.
  • FIG. 6 is a block diagram of an IP address detecting unit 502 according to an embodiment of the present invention.
  • the IP address detecting unit 502 may include: a probe message sending module 601 and a response message detecting module 602.
  • the probe message sending module 601 is configured to send a probe message including an unassigned IP address to other nodes of the network segment.
  • the probe message sending module 601 can be used to perform step S305 in FIG. 3 or step S404 in FIG.
  • the response message detecting module 602 is configured to detect, according to the response message replied by other nodes of the network segment, whether the unallocated IP address is occupied.
  • the response message detecting module 602 can be used to perform step S306 in FIG. 3 or step S405 in FIG.
  • the determining unit 503 is configured to determine, when the IP address detecting unit 502 detects that the unallocated IP address is not occupied, whether the unassigned IP address is obtained by the client.
  • the determining unit 503 can be used to perform step S307 in Fig. 3 or step S406 in Fig. 4.
  • the determining unit 503 may include: a first module, configured to receive a free ARP request packet sent by another client, and a second module, configured to perform, according to the comparison information carried by the free ARP request packet sent by the other client received by the first module, Determine whether the unallocated IP address is obtained by the client.
  • the IP address automatic allocation client 500 may further include: a response message sending unit 504, configured to broadcast, after the client obtains the IP address, a response that the unassigned IP address has been occupied on the local network segment. Message.
  • the network segment refers to the network segment where the client is located.
  • the response message transmitting unit 504 can be used to perform step S308 in FIG. 3 or step S407 in FIG.
  • the IP address automatic allocation client 500 may further include:
  • the IP information obtaining unit 505 is configured to obtain the mask of the network segment, the gateway IP address, and the IP address of the IP distribution server after the client obtains the IP address.
  • the IP information acquiring unit 505 can be used to perform step S309 in FIG. 3 or step S408 in FIG.
  • the IP address automatic allocation client 500 may further include: an acknowledgement message sending unit 506, configured to send, after the client obtains the IP address, the unassigned IP address to the IP distribution server that the unassigned IP address has been allocated. Confirmation message. Specifically, the unassigned IP address may be sent to the IP distribution server according to the obtained IP address of the IP distribution server. A confirmation message.
  • the acknowledgment message transmitting unit 506 can be used to perform step S310 in FIG. 3 or step S409 in FIG.
  • the embodiment of the present invention uses an IACP server to actively send an unassigned IP address, and the client actively acquires an unassigned IP address, which overcomes the need to additionally add when the DHCP server and the client are not on the same network segment in the prior art.
  • the DHCP Relay host can assign IP addresses to clients, saving configuration costs and simplifying network configuration.
  • FIG. 7 is a block diagram of an IP address automatic allocation server 700 according to an embodiment of the present invention.
  • the IP address automatic allocation server 700 includes: an IP packet generating unit 701, an IP packet sending unit 702, and an acknowledgement message.
  • the IP data generation unit 701 is configured to generate a 1?>3 ⁇ 4 text including an unassigned IP address.
  • the IP packet sending unit 702 is configured to periodically send the IP packet generated by the packet generating unit to the network segment where the unassigned IP address is located. It can be understood that there are clients in the network segment that are not assigned an IP address.
  • the acknowledgement message receiving unit 703 is configured to receive an acknowledgement message that the unassigned IP address has been allocated.
  • the acknowledgment message receiving unit 703 receives an acknowledgment message that the IP address sent by the client has been allocated.
  • the IP packet sending unit 702 can be used to periodically send.
  • the IP packet sending unit 702 may include: a probe IP packet sending module, configured to send the probe IP packet to the unassigned IP address when the client and the IP address allocation server are not in the same network segment The access router of the network segment; correspondingly, the IP packet sending unit is configured to send the probe IP packet generated by the probe IP packet generating module to the access router of the network segment where the unassigned IP address is located.
  • a probe IP packet sending module configured to send the probe IP packet to the unassigned IP address when the client and the IP address allocation server are not in the same network segment The access router of the network segment; correspondingly, the IP packet sending unit is configured to send the probe IP packet generated by the probe IP packet generating module to the access router of the network segment where the unassigned IP address is located.
  • the IP packet sending unit 702 may include: an ARP request packet generating module, configured to: When the client and the IP address distribution server are on the same network segment, generate an ARP request packet including an unassigned IP address; correspondingly, the IP packet sending unit is configured to send the ARP request packet generated by the ARP request packet generation module. The client to the network segment where the IP address is not assigned.
  • an ARP request packet generating module configured to: When the client and the IP address distribution server are on the same network segment, generate an ARP request packet including an unassigned IP address; correspondingly, the IP packet sending unit is configured to send the ARP request packet generated by the ARP request packet generation module. The client to the network segment where the IP address is not assigned.
  • the IP address automatic allocation server 700 may further include: an IP list refreshing unit 704, configured to refresh the list of unallocated IP addresses according to the received notification message.
  • the IP list refreshing unit 704 removes the already assigned IP address according to the received notification message from the list of unassigned IP addresses, and forms a new list of unallocated IP addresses.
  • the IP address auto-allocation server 700 may further include: a response message receiving unit 705, configured to receive a response message that the unassigned IP address sent by the client that obtains the IP address is already occupied.
  • the IP information sending unit 706 is configured to send, according to the received response message, a mask of the network segment where the unassigned IP address is located, a gateway IP address, and an IP address of the IP distribution server to the client that obtains the IP address. end.
  • the response message receiving unit 705 and the IP information transmitting unit 706 can be used to perform step S309 in FIG. 3 or step S408 in FIG.
  • the IACP server actively sends an unassigned IP address, and the client actively acquires an unassigned IP address, which overcomes the prior art when the DHCP server and the client are not on the same network segment, and must additionally add
  • the DHCP Relay host can assign IP addresses to clients, saving configuration costs and simplifying network configuration.
  • FIG. 1a is a schematic flowchart of a method according to an embodiment of the present invention, including:
  • Step 11a The server device determines the client with the official IP address in the communication range to which the client to be configured with the official IP address belongs, and the official IP address is the configured IP address.
  • the server device can include a DHCP unit, and the DHCP unit can provide a DHCP server function, that is, when the client requests an IP address by using a DHCP process, the DHCP unit can provide a corresponding official IP address for the client.
  • the server device may further include an Automatic Address Assignment Protocol (IACP) unit, and the IACP unit is configured to allocate a temporary IP address to the client.
  • IACP Automatic Address Assignment Protocol
  • the above-mentioned DHCP unit and IACP unit may be located in the same physical entity.
  • the server device may be a physical entity to which the DHCP unit and the IACP unit belong.
  • the DHCP unit and the IACP unit may also be located in different physical entities.
  • the monthly service device may specifically include a physical entity to which the DHCP unit belongs and a physical entity to which the IACP unit belongs.
  • the configured IP address is an IP address obtained by using DHCP, or an IP address obtained by manual configuration, or an IP address obtained by using other dynamic IP address allocation methods.
  • the configured IP address is The IP address in the usual sense in a communication system.
  • the temporary IP address is an IP address that is temporarily used to obtain a formal IP address.
  • the communication range is a certain network segment.
  • the communication range is a VLAN of a certain network segment.
  • Step 12a The server device sends a relay configuration indication message to the client with the official IP address, where the relay configuration indication message carries DHCP configuration information.
  • Step 13a After the client having the official IP address configures the client with the official IP address as a DHCP relay according to the DHCP configuration information, the server device is configured as a client of the DHCP relay device. The client to be configured with the official IP address is assigned the official IP address. address.
  • a client having a formal IP address is configured as a DHCP relay device, and when a DHCP IP address is configured, a dedicated DHCP relay device is not required to be set in the network system, thereby reducing network input and maintenance costs.
  • FIG. 2a is a schematic flowchart of a method according to an embodiment of the present invention, including:
  • Step 21a The client that has the official IP address receives the relay configuration indication message sent by the server device, where the relay configuration indication message carries DHCP configuration information, the client with the official IP address and the official IP address to be configured. Clients are in the same communication range;
  • Step 22a The client having the official IP address configures the local machine as a DHCP relay according to the DHCP configuration information
  • Step 23a The client configured as a DHCP relay agent provides a DHCP relay function, and the client device assigns a formal IP address to the client to be configured with the official IP address.
  • the embodiment may further include: the client having the official IP address further includes the step of obtaining the formal IP address before having the formal IP address; after obtaining the formal IP address, the server device sends the formal IP address.
  • the indication message after receiving the formal IP address indication message, the server device sends the relay configuration indication message.
  • the client obtains the official IP address including:
  • a probe packet sent by the server device where the probe packet carries a temporary IP address, an IP address of a gateway of the communication range, an IP address of the server device, and a network mask of the communication range;
  • the temporary IP address, the IP address of the gateway of the communication range, the IP address of the server device, and the network mask of the communication range send a unicast DHCP request to the server device, and receive the server device according to the unicast DHCP Request the official IP address assigned to this client.
  • a client having a formal IP address is configured as a DHCP repeater, and when a DHCP IP address is configured, it is not necessary to set a dedicated DHCP repeater in the network system, thereby reducing network input and maintenance costs.
  • the embodiment of the present invention is mainly based on the following ideas: When the DHCP client and the DHCP server are not on the same network segment, a DHCP relay is required in the system for the smooth distribution of the IP address. However, if the dedicated setting of the dedicated DHCP repeater increases the cost, in order to solve the problem, the embodiment of the present invention does not set a dedicated DHCP repeater, but configures the client with the official IP address as a DHCP repeater.
  • the existing DHCP process can be used to distribute the official IP address. Further, since a client having a formal IP address is required in the process of configuring the DHCP relay as described above, and the client may not initially have any official IP address in the communication range, in this case, the communication needs to be first. At least one client in the range is assigned a formal IP address so that the client to which the official IP address is assigned can be configured as a DHCP relay. In the embodiment of the present invention, at least one client in the communication range is assigned a formal IP address by using a temporary IP address, and the temporary IP address is implemented by using an IACP process.
  • the specific process of the IACP can be implemented as follows:
  • the client obtains an IP address that includes an unassigned IP address. For example, when the client and the IP address allocation server are not in the same network segment, the client receives the first address resolution protocol ARP request packet sent by the access router of the network segment where the client is located; or, when the client and the client When the IP address allocation server is on the same network segment, the client receives the second ARP request packet sent by the IP address allocation server.
  • the client detects whether the unassigned IP address in the obtained IP packet is occupied. For example, send a probe message including an unassigned IP address to other nodes of the network segment; and detect whether the unassigned IP address is occupied according to a response message replied by other nodes of the network segment.
  • the client determines whether the unassigned IP address is obtained by the client, and if so, the client that obtains the unassigned IP address obtains an IP packet including the unassigned IP address. For example, according to the received comparison information carried by the free ARP request packet sent by other clients, it is determined whether the unallocated IP address is obtained by the client.
  • the reason why the client with the official IP address is selected is that only after the client has the formal IP address, the server device can exchange information with the client according to the normal IP process. For example, a relay configuration indication message can be sent to the client.
  • the DHCP configuration information may be pre-stored in the server device, and a device may have the function of a DHCP relay device after being configured according to the DHCP configuration information. Therefore, when the server device sends the DHCP configuration information to the client, the client receiving the DHCP can configure itself as a DHCP server according to the DHCP configuration information.
  • the content of the specific DHCP configuration information can be obtained from the DHCP configuration information required by the existing DHCP relay, which is not within the scope of the embodiments of the present invention.
  • the client and the server respectively need to have both the IACP function and the DHCP function.
  • the client may be a client having IACP function and DHCP function.
  • the IACP-capable unit and the DHCP-capable unit can be set in the same physical entity.
  • the server device is a server with IACP function and DHCP function; or, the IACP function unit has The DHCP function unit can also be set in different physical entities.
  • the server device includes an IACP server with IACP function and a DHCP server with DHCP function.
  • IACP function and the DHCP function in the same physical entity, and the IACP function and the DHCP function setting in different physical entities.
  • the communication range refers to the network segment.
  • the VLAN can also be planned.
  • the communication range is the network segment and the VLAN under the network segment.
  • FIG. 3 is a schematic flowchart of a method according to an embodiment of the present invention.
  • the VLAN planning is not performed, and the IACP function and the DHCP function are set in the same physical entity as an example.
  • FIG. 4a is a schematic structural diagram of a network system corresponding to an embodiment of the present invention.
  • the client communicates with an IACP+DHCP server 44a via an Ethernet 42a and a router 43a.
  • IACP+DHCP server 44a may have IACP Features and DHCP capabilities.
  • a DHCP relay is configured in the network segment to which the client to which the official TP address belongs is located.
  • the network segment refers to the network segment to which the client to which the official IP address is to be assigned belongs.
  • this embodiment includes:
  • Step 301a After the IACP+DHCP server is started, determine whether the IACP+DHCP server and the client to be assigned the official IP address belong to the same network segment. If yes, go to step 311a. Otherwise, go to step 302a.
  • the IACP+DHCP server stores the information about the client, and the related information includes the network segment identifier of the network segment to which the client belongs. Therefore, the IACP+DHCP server can determine the IACP+DHCP server and the official IP address to be assigned. Whether the client is in the same network segment.
  • Step 302a The IACP+DHCP server determines whether there is an available DHCP relay in the network segment to which the client to which the official IP address is to be assigned. If yes, go to step 310a, otherwise, go to step 303a.
  • the client with the official IP address in the network system may send a relay capability indication message to the IACP+DHCP server, where the relay capability indication message carries the network segment identifier and the capability indication information.
  • the IACP+DHCP server can use the following method to determine whether there is an available DHCP relay in the network segment:
  • the relay capability indication message When the IACP+DHCP server receives the relay capability indication message sent by the client, the relay capability indication message carries the capability indication information and the network segment identifier, and when the capability indication information indicates that the client that sends the relay capability indication message has The DHCP relay capability (the trunking capability), and the network segment identifier indicates that the client that sent the official IP address indication message is on the same network segment as the client whose official IP address is to be configured, the IACP+DHCP server Obtaining a DHCP repeater available on the network segment; it can be understood that the "available DHCP relay" herein may be a DHCP relay configured by a client having a formal IP address, or it may be Now There is a dedicated DHCP repeater in the technology.
  • the IACP+DHCP server When the IACP+DHCP server does not receive the relay capability indication message, or receives the relay capability indication message but the capability indication information indicates that the client that sends the relay capability indication message does not have the relay capability, or Receiving the relay capability indication message, but the network segment identifier indicates that the client that sent the official IP address indication message is not on the same network segment as the client that is to be configured with the official IP address, the IACP+DHCP server obtains the network segment. There are no DHCP relays available.
  • Step 303a The IACP+DHCP server determines whether there is a client with a formal IP address in the network segment. If yes, go to step 307a. Otherwise, go to step 304a.
  • the client that has been configured with the official IP address (for example, using manual configuration or DHCP configuration mode) can send a formal IP address indication message to the IACP+DHCP server, the official IP.
  • the address indication message carries the network segment identifier.
  • the IACP+DHCP server can use the following method to determine whether the client has a formal IP address in the network segment:
  • the IACP+DHCP server When the IACP+DHCP server receives the official IP address indication message that is sent by the client and carries the network segment identifier, and the network segment identifier indicates that the client that sends the formal IP address indication message and the client that is to be configured with the official IP address are On the same network segment, the IACP+DHCP server obtains the client that has been configured with the official IP address in the network segment;
  • the IACP+DHCP server does not receive the official IP address indication message, or receives the official IP address indication message but the network segment identifier indicates that the official IP address indication message is sent by the client and the official IP address to be configured.
  • the IACP+DHCP server obtains the client that has not been configured with the official IP address in the network segment.
  • Step 304a The IACP+DHCP server uses the IACP to assign a temporary IP address to the temporary client in the network segment.
  • the IACP server assigns an IP address to the network segment. To distinguish it from the IP address assigned by the DHCP process, the IP address assigned by the IACP server is called a temporary IP address. The address, the client that receives the temporary TP address is called a temporary client.
  • the IACP is a protocol in which the IACP server actively configures an IP address to the client.
  • the probe packet is sent to the destination network segment periodically.
  • the destination address in the probe packet is the unassigned IP address selected by the IACP server.
  • the probe packet also carries the IP address of the gateway in the destination network segment.
  • the gateway in the destination network segment broadcasts a request packet to the destination network segment.
  • the client elects a client that has not yet assigned an IP address to receive the IP address selected by the IACP server. Then, the selected client receives the probe packet sent by the IACP server, and obtains the IP address assigned by the IACP server.
  • Step 305a The temporary client obtains the official IP address from the IACP+DHCP server by using the unicast DHCP process according to the temporary IP address in the probe packet, the IP address of the gateway, the network mask, and the IP address of the IACP+DHCP server.
  • the temporary search client may send a DHCP search packet to the IACP+DHCP server according to the IP address of the IACP+DHCP server, and the IACP+DHCP server receives the DHCP search packet.
  • the official IP address is assigned and the normal DHCP process is performed.
  • the temporary client learns that it is not in the same network segment as the IACP+DHCP server according to the network mask, it can pass the gateway to the IACP+DHCP server according to the IP address of the gateway and the IP address of the IACP+DHCP server.
  • the IACP+DHCP server assigns a formal IP address after receiving the DHCP search packet, and performs a normal DHCP process.
  • the temporary client After the temporary client obtains the official IP address, the temporary client can release the temporary IP address, and the IACP+DHCP server can reclaim the temporary IP address, so that the temporary IP address can still be used again.
  • Step 306a The client with the official IP address sends a formal IP address indication message to the IACP+DHCP server, where the official IP address indication message carries the network segment identifier.
  • step 303a may be repeatedly performed. It can be understood that when the temporary client obtains the official TP address, the temporary client becomes a client with a formal IP address.
  • Step 307a The IACP+DHCP server sends a relay configuration indication message to the client with the official IP address, where the relay configuration indication message carries the DHCP configuration information.
  • Step 308a The client with the official IP address configures itself as an available DHCP relay based on the DHCP configuration information.
  • step 302a may be repeated.
  • Step 309a The DHCP relay agent sends a relay capability indication message to the IACP+DHCP server, where the relay capability indication message carries the capability indication information and the network segment identifier.
  • a client with a formal IP address is configured to be a DHCP relay
  • the client with the official IP address is also an available DHCP relay.
  • Step 310a The IACP+DHCP server assigns a formal IP address to the client to which the official IP address is to be assigned through the available DHCP relay.
  • an IP address can be assigned according to a normal DHCP procedure.
  • Step 311a The IACP+DHCP server directly assigns a formal IP address to the client to be configured with the official IP address.
  • the IP address can be assigned according to the normal DHCP process.
  • the network segment identifier is used in the related judgment, which may be applicable to a scenario in which the network system does not perform VLAN planning.
  • FIG. 5 is a schematic flowchart of a method according to an embodiment of the present invention.
  • the VLAN planning is not performed, and the IACP function and the DHCP function are set in different physical entities as an example.
  • FIG. 6a is a schematic structural diagram of a network system corresponding to an embodiment of the present invention.
  • the client 61a communicates with an IACP server 64a and a DHCP server 65a via an Ethernet 62a and a router 63a.
  • Communication the IACP server 64a has an IACP function
  • the DHCP server 65a has a DHCP function.
  • a DHCP relay is configured in the network segment to which the client to which the official IP address is to be assigned belongs.
  • the network segment refers to the network segment to which the client to which the official IP address is to be assigned belongs.
  • this embodiment includes:
  • Step 501a The determining device determines whether the DHCP server and the client to be assigned the official IP address belong to the same network segment. If yes, go to step 511a. Otherwise, go to step 502a.
  • the determining device may be a function module in the server device, and the determining device may be located in the IACP server, or located in the DHCP server, or separately set on the IACP server and the DHCP server.
  • the judgment device is located in the IACP server as an example.
  • the determining device stores the related information of the client, where the related information includes the network segment identifier of the network segment to which the client belongs. Therefore, the determining device can determine whether the DHCP server and the client to be assigned the official IP address are in the same In the network segment.
  • Step 502a The determining device determines whether there is an available DHCP relay in the network segment to which the client to which the official IP address is to be assigned. If yes, go to step 510a. Otherwise, go to step 503a.
  • the client with the official IP address in the network system may send a relay capability indication message to the determining device, where the relay capability indication message carries the network segment identifier and the capability indication information.
  • the judging device can determine whether there is an available DHCP relay in the network segment as follows:
  • the relay capability indication message When the determining device receives the relay capability indication message sent by the client, the relay capability indication message carries the capability indication information and the network segment identifier, and when the capability indication information indicates that the relay is sent
  • the client of the capability indication message has a relay capability, and the network segment identifier indicates that the client that sent the official TP address indication message is on the same network segment as the client that is to be configured with the official IP address, and the determining device obtains the network.
  • a dedicated DHCP repeater There are available DHCP relays in the segment; it can be understood that the "available DHCP relay" here may be a DHCP relay configured by a client with a formal IP address, or may be a prior art.
  • the determining device When the determining device does not receive the relay capability indication message, or receives the relay capability indication message, but the capability indication information indicates that the client that sends the relay capability indication message does not have the relay capability, or receives the The relay capability indication message, but the network segment identifier indicates that the client that sent the official IP address indication message is not in the same network segment as the client that is to be configured with the official IP address, the determining device obtains that the network segment does not exist. DHCP relay.
  • Step 503a The determining device determines whether there is a client having a formal IP address in the network segment. If yes, step 507a is performed; otherwise, step 504a is performed.
  • the client that has been configured with the official IP address may send a formal IP address indication message to the determining device, and the official IP address indication The message carries the network segment identifier.
  • the judging device can perform the judgment of the client having the official IP address in the network segment as follows:
  • the determining device When the determining device receives the official IP address indication message that is sent by the client and carries the network segment identifier, and the network segment identifier indicates that the client that sends the formal IP address indication message is in the same client as the client that is to be configured with the official IP address. In the network segment, the determining device obtains a client in the network segment that has been configured with a formal IP address;
  • the determining device When the determining device does not receive the official IP address indication message, or receives the official IP address indication message but the network segment identifier indicates the client that sent the official IP address indication message and the client to be configured with the official IP address. When not in the same network segment, the determining device obtains a client that does not have a formal IP address configured in the network segment.
  • Step 504a After the device is triggered to start the IACP server, the IACP server adopts IACP. A temporary TP address is assigned to the temporary client in the network segment.
  • the address of the server in the probe packet in this embodiment is the IP address of the IACP server and the IP address of the DHCP server. For details, refer to step 304a.
  • Step 505a The temporary client obtains the official IP address from the DHCP server by using a unicast DHCP procedure according to the temporary IP address in the probe packet, the IP address of the gateway, the network mask, and the IP address of the DHCP server.
  • the DHCP server may send a DHCP search packet to the DHCP server according to the IP address of the DHCP server, and the DHCP server allocates the official IP address after receiving the DHCP search packet. , perform a normal DHCP process.
  • the temporary client learns that it is not on the same network segment as the DHCP server according to the network mask, it can send a DHCP search packet to the DHCP server through the gateway according to the IP address of the gateway and the IP address of the DHCP server, and the DHCP server receives the DHCP search packet. After the formal IP address is assigned, the normal DHCP process is performed.
  • the temporary client After the temporary client obtains the official IP address, the temporary client can release the temporary IP address, and the DHCP server can reclaim the temporary IP address, so that the subsequent temporary IP address can still be used again.
  • Step 506a The client with the official IP address sends a formal IP address indication message to the determining device, where the official IP address indication message carries the network segment identifier.
  • step 503a may be repeatedly performed.
  • the temporary client when the temporary client obtains the official IP address, the temporary client is also a client with a formal IP address.
  • Step 507a The determining device sends a relay configuration indication message to the client having the official IP address, where the relay configuration indication message carries the DHCP configuration information.
  • Step 508a The client with the official IP address configures itself as an available DHCP relay based on the DHCP configuration information. Thereafter, step 502a may be repeatedly performed.
  • Step 509a The DHCP relay agent sends a relay capability indication message to the IACP+DHCP server, where the relay capability indication message carries the capability indication information and the network segment identifier.
  • a client with a formal IP address is configured to be a DHCP relay
  • the client with the official IP address is also an available DHCP relay.
  • Step 510a After the device triggers the DHCP server to be started, the DHCP server allocates a formal IP address to the client to be assigned the official IP address through the available DHCP relay.
  • an IP address can be assigned according to a normal DHCP procedure.
  • Step 511a After the device is triggered to start the DHCP server, the DHCP server directly assigns a formal IP address to the client to be configured with the official IP address.
  • the IP address can be allocated according to a normal DHCP process.
  • the network segment identifier is used in performing related judgment, which may be applicable to a scenario in which the network system does not perform VLAN planning.
  • the address of the IACP server and the DHCP server in the probe packet in the IACP process can be applied to the scenario where the DHCP function and the IACP function are separately set to different physical entities.
  • FIG. 7a is a schematic flowchart of a method according to an embodiment of the present invention.
  • a VLAN planning is performed, and an IACP function and a DHCP function are set in the same physical entity as an example.
  • FIG. 8a is a schematic structural diagram of a network system corresponding to an embodiment of the present invention.
  • at least one client 81a is included.
  • the ports are divided into different VLANs.
  • the client 81a is connected to an Ethernet (Ethernet) 82a and a router 83a,
  • the TACP+DHCP server 84a communicates, and the TACP+DHCP server 84 can have a TACP function and a DHCP function.
  • a DHCP relay is configured in the VLAN to which the network segment to which the client to which the official IP address belongs is located.
  • a VLAN refers to a VLAN to which a network segment to which a client to which a formal IP address belongs is assigned.
  • this embodiment includes:
  • Step 701a After the IACP+DHCP server is started, determine whether the IACP+DHCP server and the client to be assigned the official IP address belong to the same network segment. If yes, go to step 711a. Otherwise, go to step 702a.
  • the IACP+DHCP server stores the information about the client, and the related information includes the network segment identifier of the network segment to which the client belongs. Therefore, the IACP+DHCP server can determine the IACP+DHCP server and the official IP address to be assigned. Whether the client is in the same network segment.
  • Step 702a The IACP+DHCP server determines whether there is an available DHCP relay in the VLAN of the network segment to which the client to which the official IP address is to be assigned. If yes, go to step 710a. Otherwise, go to step 703a.
  • the client with the official IP address in the network system may send a relay capability indication message to the IACP+DHCP server, where the relay capability indication message carries the network segment identifier and the VLAN identifier (the network segment identifier + the VLAN identifier) and Capability indication information.
  • the IACP+DHCP server can use the following method to determine whether there is an available DHCP relay in the VLAN:
  • the relay capability indication message When the IACP+DHCP server receives the relay capability indication message sent by the client, the relay capability indication message carries the capability indication information and the network segment identifier + the VLAN identifier, and the capability indication information indicates that the relay capability indication message is sent.
  • the client has a relay capability, and the network segment identifier + VLAN identifier indicates that the client that sends the official IP address indication message is in the same VLAN as the client that is to be configured with the official IP address, and the IACP+DHCP server obtains the VLAN.
  • the IACP+DHCP server When the IACP+DHCP server does not receive the relay capability indication message, or receives the relay capability indication message but the capability indication information indicates that the client that sends the relay capability indication message does not have the relay capability, or Receiving the relay capability indication message, but the network segment identifier + VLAN identifier indicates that the client that sends the formal IP address indication message is not in the same VLAN as the client that is to be configured with the official IP address, the IACP+DHCP server obtains the There are no DHCP relays available in the VLAN.
  • Step 703a The IACP+DHCP server determines whether there is a client with a formal IP address in the VLAN. If yes, go to step 707a. Otherwise, go to step 704a.
  • the client that has been configured with the official IP address (for example, using manual configuration or DHCP configuration mode) can send a formal IP address indication message to the IACP+DHCP server, the official IP.
  • the address indication message carries the network segment identifier + VLAN identifier.
  • the IACP+DHCP server can use the following method to determine whether the client has a formal IP address in the network segment:
  • the IACP+DHCP server When the IACP+DHCP server receives the official IP address indication message that is sent by the client and carries the network segment identifier + VLAN identifier, and the network segment identifier + VLAN identifier indicates that the client that sent the official IP address indication message is officially configured to be configured. When the client with the IP address is in the same VLAN, the IACP+DHCP server obtains the client that has been configured with the official IP address in the VLAN;
  • Step 704a The TACP+DHCP server uses the TACP to assign a temporary IP address to the temporary client in the VLAN.
  • Step 705a The temporary client obtains the official IP address from the IACP+DHCP server by using the unicast DHCP process according to the temporary IP address in the probe packet, the IP address of the gateway, the network mask, and the IP address of the IACP+DHCP server.
  • step 305a the implementation process similar to step 305a can be used, except that the network segment in step 305a needs to be replaced with the VLAN to which the client to which the official IP address is to be assigned belongs.
  • Step 706a The client with the official IP address sends a formal IP address indication message to the IACP+DHCP server, where the official IP address indication message carries the network segment identifier + VLAN identifier.
  • step 703a may be repeatedly performed.
  • the temporary client when the temporary client obtains the official IP address, the temporary client is also a client with a formal IP address.
  • Step 707a Same as step 307a.
  • Step 708a The client with the official IP address configures itself as an available DHCP relay based on the DHCP configuration information.
  • step 702a may be repeatedly performed.
  • Step 709a The DHCP relay agent sends a relay capability indication message to the IACP+DHCP server, where the relay capability indication message carries the capability indication information and the network segment identifier + VLAN identifier.
  • a client with a formal IP address is configured to be a DHCP relay
  • the client with the official IP address is also an available DHCP relay.
  • Step 710a Same as step 310a.
  • Step 71 la The IACP+DHCP server directly assigns a formal IP address to the client to be configured with the official IP address. Specifically, since the client to which the TP address is to be allocated is in the same VLAN as the TACP+DHCP server in the same network segment, the IP address can be allocated according to a normal DHCP process.
  • the address of the IACP+DHCP server is carried in the probe packet in the IACP process, which can be applied to the scenario where the DHCP function and the IACP function are combined in the same physical entity.
  • FIG. 9a is a schematic flowchart of a method according to an embodiment of the present invention. This embodiment is an example of performing VLAN planning, and the IACP function and the DHCP function are set in different physical entities.
  • FIG. 10a is a schematic structural diagram of a network system corresponding to an embodiment of the present invention.
  • the client 101a passes through an Ethernet (102), or further through a gateway 103a, and an IACP server 104a.
  • the DHCP server 105a communicates with the IACP server 104a having an IACP function, and the DHCP server 105a has a DHCP function.
  • a DHCP relay is configured in the network segment to which the client to which the official IP address is to be assigned belongs.
  • a VLAN refers to a VLAN to which a network segment to which a client to which a formal IP address belongs is assigned.
  • this embodiment includes:
  • Step 901a After the DHCP server is started, the determining device determines whether the DHCP server and the client to be assigned the official IP address belong to the same network segment. If yes, go to step 911a, and go to step 902a.
  • the determining device is a function module in the server device, and the determining device may be located in the IACP server, or located in the DHCP server, or separately disposed outside the IACP server and the DHCP server.
  • the determining device stores the related information of the client, where the related information includes the network segment identifier of the network segment to which the client belongs. Therefore, the determining device can determine whether the DHCP server and the client to be assigned the official IP address are in the same In the network segment.
  • Step 902a The determining device determines whether there is an available DHCP relay in the VLAN of the network segment to which the client to which the official IP address is to be assigned. If yes, go to step 910a, otherwise, go to step 903a.
  • the client with the official IP address in the network system may send a relay capability indication message to the determining device, where the relay capability indication message carries the network segment identifier + VLAN identifier and the capability indication information.
  • the judging device can determine whether there is an available DHCP relay in the network segment as follows:
  • the relay capability indication message When the determining device receives the relay capability indication message sent by the client, the relay capability indication message carries the capability indication information and the network segment identifier + VLAN identifier, and the capability indication information indicates the client that sends the relay capability indication message. Having a trunking capability, and the network segment identifier + VLAN identifier indicates that the client that sent the official IP address indication message is in the same VLAN as the client that is to be configured with the official IP address, and the determining device obtains the available DHCP in the VLAN. Repeater; It can be understood that the "available DHCP relay" here may be a DHCP relay configured by a client having a formal IP address, or may be a dedicated DHCP in the prior art. Relay.
  • the determining device does not receive the relay capability indication message, or receives the relay capability indication message, but the capability indication information indicates that the client that sends the relay capability indication message does not have the relay capability, or receives the The relay capability indication message, but the network segment identifier + VLAN identifier indicates that the client that sent the official IP address indication message is not in the same VLAN as the client that is to be configured with the official IP address, and the determining device does not exist in the VLAN.
  • a DHCP repeater is available.
  • Step 903a The determining device determines whether there is a client with a formal IP address in the VALN. If yes, go to step 907a, otherwise, go to step 904a.
  • the client that has been configured with the official IP address may send a formal IP address indication message to the determining device, and the official IP address indication The message carries the network segment identifier + VLAN identifier.
  • the judging device can judge the client having the official IP address in the network segment in the following manner:
  • the determining device When the determining device receives the official IP address indication message that is sent by the client and carries the network segment identifier + VLAN identifier, and the network segment identifier + VLAN identifier indicates the client that sent the official IP address indication message and the official IP address to be configured. When the client is in the same VLAN, the determining device obtains the client in the VLAN that has been configured with the official IP address;
  • the determining device When the determining device does not receive the official IP address indication message, or receives the official IP address indication message, but the network segment identifier + VLAN identifier indicates that the official IP address indication message is sent by the client and the official IP address to be configured.
  • the device determines that there is no client in the VLAN that has been configured with the official IP address.
  • Step 904a Determine the device trigger After the IACP server is started, the IACP server uses the IACP to allocate a temporary IP address to the temporary client in the VLAN.
  • step 504a the implementation process similar to step 504a may be adopted, except that the network segment in step 504a needs to be replaced with the VLAN to which the client to which the official IP address is to be assigned belongs.
  • Step 905a The temporary client obtains the official IP address from the DHCP server by using a unicast DHCP procedure according to the temporary IP address in the probe packet, the IP address of the gateway, the network mask, and the IP address of the DHCP server.
  • step 505a the implementation process similar to step 505a may be adopted, except that the network segment in step 505a needs to be replaced with the VLAN to which the client to which the official IP address is to be assigned belongs.
  • Step 906a The client with the official IP address sends a formal IP address indication message to the determining device, where the official IP address indication message carries the network segment identifier.
  • step 803a may be repeatedly performed. It can be understood that when the temporary client obtains the official TP address, the temporary client is also a client with a formal IP address.
  • Step 907a Same as step 507a.
  • Step 908a The client with the official IP address configures itself as an available DHCP relay based on the DHCP configuration information.
  • step 902a may be repeatedly performed.
  • Step 909a The DHCP relay agent sends a relay capability indication message to the IACP+DHCP server, where the relay capability indication message carries the capability indication information and the network segment identifier + VLAN identification.
  • a client with a formal IP address is configured to be a DHCP relay
  • the client with the official IP address is also an available DHCP relay.
  • Step 910a Same as step 510a.
  • Step 91 la The IACP+DHCP server directly assigns the official IP address to the client whose official IP address is to be configured.
  • the IP address can be assigned according to the normal DHCP process.
  • a client by configuring a client with a formal IP address as a DHCP relay device, when the IP address is configured by using DHCP, it is not necessary to set a dedicated DHCP relay device in the network system to implement network input and The maintenance cost is reduced; the scenario is applicable to the network system for VLAN planning;
  • the address of the IACP server and the DHCP server in the probe packet in the IACP process can be applied to the scenario where the DHCP function and the IACP function are separately set to different physical entities.
  • FIG. 11a is a schematic structural diagram of a server device according to an embodiment of the present invention, including a client determining module 111a, a sending module 112a, and an allocating module 113a.
  • the client determining module 1 1 1 a is configured to determine, in the communication range to which the client to be configured the official TP address belongs, a client having a formal IP address, the official IP address being a configured IP address; and a sending module 112a,
  • the client configured with the formal IP address determined by the client determining module 111a sends a relay configuration indication message, where the relay configuration indication message carries DHCP configuration information; the allocation module 113a is used for the client with the official IP address
  • the client is configured as a DHCP relay to assign a formal IP address to the client whose formal IP address is to be configured.
  • the embodiment may further include a first determining module 114a, where the first determining module 114a is configured to determine whether there is a client that has been configured with a formal IP address in the communication range;
  • the client determining module 111a may include a first unit 1111a and/or a second unit 1112a.
  • the first unit 1111a is configured to: when the first determining module 114a determines that the formal IP address has been configured in the communication range.
  • the client receives the official IP address indication message sent by the client configured with the official IP address, and determines the client that sent the official IP address indication message as the client with the official IP address; the second unit 1112a,
  • the temporary IP address is allocated, and the client assigned to the temporary IP address is configured to have the official IP address. The client of the address.
  • the second unit 1112a may include an IACP unit 1113a and a DHCP unit 1114a, where the IACP unit 1113a is configured to send a probe packet in the communication range, where the probe packet carries a temporary IP address, an IP address of the gateway of the communication range, and a month.
  • An IP address of the service end device and a network mask of the communication range the temporary IP address being configured to negotiate with the client within the communication range for the determined temporary client;
  • the DHCP unit 1114a is configured to receive the ticket sent by the temporary client Broadcasting a DHCP request, and assigning a formal IP address to the temporary client according to the unicast DHCP request, and the temporary client after the official IP address is assigned is determined to be a client having a formal IP address, and correspondingly, the foregoing unicast DHCP request Is the temporary client based on the temporary IP address, the communication standard
  • the TP address of the surrounding gateway, the TP address of the server device, and the network mask of the communication range are sent.
  • the IACP unit 1113a and the DHCP unit 1114a in this embodiment may be located in the same physical entity.
  • the IP address of the server device sent by the IACP unit 1113a is the IP address of the physical entity.
  • the IACP unit 1113a and the DHCP unit 1114a in this embodiment may also be located in different physical entities.
  • the IP address of the server device sent by the IACP unit 1113a includes the IP address of the physical entity to which the IACP unit 1113a belongs.
  • the IP address of the physical entity to which the DHCP unit 1114a belongs the IP address of the physical entity to which the DHCP unit 1114a belongs.
  • the embodiment may further include a second determining module 115a, where the second determining module 115a is configured to determine whether there is an available DHCP relay in the communication range; the first determining module 114a is specifically configured to use the second determining When the module 115a determines that there is no available DHCP relay within the communication range, it determines whether there is a client having the official IP address configured in the communication range.
  • the embodiment may further include a third determining module 116a, where the third determining module 116a is configured to determine whether the server device and the client to be configured with the official IP address are in the same network segment; the second determining module 115a is specifically configured to determine, when the third determining module 116a determines that the server device is not in the same network segment as the client to be configured with the IP address, whether there is an available DHCP relay in the communication range.
  • the third determining module 116a is configured to determine whether the server device and the client to be configured with the official IP address are in the same network segment
  • the second determining module 115a is specifically configured to determine, when the third determining module 116a determines that the server device is not in the same network segment as the client to be configured with the IP address, whether there is an available DHCP relay in the communication range.
  • the address of the IACP unit and the physical entity to which the DHCP unit belongs in the probe packet in the IACP process may be applicable to the scenario where the DHCP function and the IACP function are combined in the same physical entity or in different physical entities.
  • FIG. 12a is a schematic structural diagram of a client according to an embodiment of the present invention, including a receiving module 121a, a configuration module 122a, and a relay module 123a.
  • the receiving module 121a is configured to receive a relay configuration indication message sent by the server device, where the relay configuration indication message carries DHCP configuration information, and the configuration module 122a is configured to receive, according to the relay configuration indication message received by the receiving module 121a, The DHCP configuration information carried will be configured locally.
  • the DHCP relay is used to provide a DHCP relay function, and the server device is configured to allocate a formal IP address to a client to be configured with a formal IP address.
  • the embodiment may further include an address obtaining module 124a and an indication module 125a, the address obtaining module 124a is configured to obtain a formal IP address, and the indication module 125a is configured to: after the address obtaining module 124a obtains the official IP address, the server The device sends a formal IP address indication message.
  • the foregoing relay configuration indication message is sent by the service end device after receiving the formal IP address indication message.
  • the address obtaining module 124a may include a third unit 1241a and a fourth unit 1242a, where the third unit 1241a is configured to receive a probe packet sent by the server device, where the probe packet carries a temporary IP address and a gateway of the communication range.
  • the IP address, the IP address of the server device, and the network mask of the communication range send a unicast DHCP request to the server device, and receive an official IP address allocated by the server device according to the unicast DHCP request.
  • the client carries the network segment identifier, or the network segment identifier and the VLAN identifier, when the client sends the relevant judgment information to the server. That is, when the VLAN is not planned, it is determined whether: the client in the embodiment is in the same network segment as the client to be configured with the official IP address; For example, the client is in the same VLAN as the client to be configured with the official IP address.
  • the network segment identifier or the network segment identifier and the VLAN identifier are used in the related judgment, which may be applicable to a scenario in which the network system does not perform VLAN planning or VLAN planning.
  • FIG. 13a is a schematic structural diagram of a communication system according to an embodiment of the present invention, including a monthly server device 131a and a client 132a.
  • the server device 131a may be as shown in FIG. 11a, and the client 132a. This can be as shown in Figure 12a.
  • the server device and the client reference may be made to related device embodiments and/or method embodiments.
  • server device and the client embodiment, reference may also be made to the related method embodiment, that is, the device provided by the device embodiment may implement the process or function in the method embodiment.
  • the network segment identifier or the network segment identifier and the VLAN identifier are used in the related judgment, which may be applicable to a scenario in which the network system does not perform VLAN planning or VLAN planning.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Small-Scale Networks (AREA)

Description

IP地址自动分配方法、 设备和***
本申请要求于 2009 年 9 月 11 日提交中国专利局、 申请号为 200910170885.9、发明名称为"一种 IP地址自动分配方法、客户端及服务器" 的中国专利申请的优先权, 以及于 2009年 12月 31 日提交中国专利局、 申 请号为 200910215385.2、 发明名称为' ΊΡ地址自动配置方法、 服务端设备、 客户机和通信***"的中国专利申请的优先权, 其全部内容通过引用结合在 本申请中。 技术领域
本发明涉及网络技术领域,具体来说是关于一种 IP地址自动分配方法、 客户端及服务器。
背景技术
互联网协议 ( Internet Protocol , 简称 IP )地址是 IP网络中标识用 户设备和网络设备的一种标识 , 也是 I P网络用于 I P包转发的标识 , 因此, IP地址的分配是整个 IP网络的核心。
目前 IP地址的分配方式包括: 自动获得 IP地址方式。 自动获得 IP地 址的方式是指: 客户端不需要人工干预, 可自动获得该客户端的主机 IP地 址、 网关 IP地址和网段掩码。 目前, 自动获得 IP地址的主要技术是动态 主机酉己置十办议 ( DHCP: Dynamic Hos t Conf igurat ion Protocol )。 该技术 中, 由 DHCP服务器集中管理所有的 IP网路配置数据, 并负责处理客户端 的 DHCP请求; 而客户端则会使用从 DHCP服务器分配下来的 IP配置数据。
但发明人在实现本发明的过程中发现自动获得 IP地址的现有技术的缺 陷在于: 当 DHCP服务器与客户端不在同一个网段, 需要在客户端同一个网 段内配置一个 DHCP中继 (Relay )主机。 该 DHCP Relay主机接收客户端的 DHCP请求, 然后将该 DHCP请求发送给 DHCP服务器, 并将 DHCP服务器的回 复发送给客户端。 但一般情况下 IP网络的标准业务只提供路由功能, 不提 供 IP地址自动配置功能, 而该 DHCP Relay主机属于 IP地址自动配置的功 能, 不属于路由功能, 因此, 承载网运营商一般不提供 DHCP Relay功能。 由于^ ^载网运营商不提供 DHCP Relay功能, 因此, 在 IP网络的标准业务 下, 较难实现自动 IP地址配置。 发明内容
为克服现有技术中存在的问题, 本发明实施例提供一种 IP地址自动分 配方法、 客户端及服务器, 可以高效、 低成本的实现 IP地址自动分配。
本发明实施例提供一种 IP地址自动分配方法, 所述的方法包括: 客户 端获取包括未分配 IP地址的 1 "¾文; 客户端探测获取到的 1? "¾文中的未 分配 IP地址是否被占用; 如果未分配 IP地址没有被占用, 则判断是否由 该客户端获得所述的未分配 IP地址, 如果是, 则获得所述的未分配 IP地 址。
本发明实施例还提供一种 i p地址客户端, 所述的客户端包括: i p报文 获取单元, 用于获取包括未分配 IP地址的 IP报文; IP地址探测单元, 用 于探测 IP报文获取单元获取到的 IP报文中的未分配 IP地址是否被占用; 判断单元, 用于在 IP地址探测单元探测到未分配 IP地址没有被占用时, 判断是否由该客户端获得所述的未分配 IP地址。
本发明实施例还提供一种 IP地址自动分配方法, 所述的方法包括: IP 地址分配服务器生成包括未分配 IP地址的 IP报文; IP地址分配服务器将 所述 IP才艮文发送至所述的未分配 IP地址所在的网段, 该网段中存在未被 分配 IP地址的客户端; 该 IP地址分配服务器接收所述未分配 IP地址已被 分配的确认消息。
本发明实施例还提供一种 IP地址分配服务器, 所述的服务器包括: IP 才艮文生成单元, 用于生成包括未分配 IP地址的 IP ^艮文; IP 文发送单元, 用于将所述 文生成单元生成的 IP ^艮文发送至所述的未分配 IP地址所在 的网段, 该网段中存在未被分配 IP地址的客户端; 确认消息接收单元, 用 于接收所述未分配 IP地址已被分配的确认消息。
由于本发明实施例采用 IACP服务器主动发送未分配 IP地址、 客户端 主动获取未分配的 IP地址的技术手段, 克服了现有技术中当 DHCP服务器 与客户端不在同一网段上时, 必须额外添加的 DHCP Relay主机才可以为客 户端分配 IP地址的问题, 节省了配置成本且简化了网络配置。
另一方面:
本发明实施例提供了一种 IP地址自动配置方法、 服务端设备、 客户机 和通信***, 用以解决现有技术中存在的需要专用设置 DHCP中继器引起 的投入及维护成本较高的问题。
本发明实施例提供了一种 IP地址自动配置方法, 包括: 服务端设备在 待配置正式 IP地址的客户机所属的通信范围内 ,确定具有正式 IP地址的客 户机, 该正式 IP地址为已配置的 IP地址; 该服务端设备向该具有正式 IP 地址的客户机发送中继配置指示消息, 该中继配置指示消息中携带动态主 机配置协议 DHCP配置信息; 当该具有正式 IP地址的客户机根据该 DHCP 配置信息将本机配置成 DHCP中继器后, 该服务端设备通过配置成 DHCP 中继器的客户机, 为该待配置正式 IP地址的客户机分配正式 IP地址。
本发明实施例还提供了一种 IP地址自动配置方法, 包括: 已具有正式 IP地址的客户机接收服务端设备发送的中继配置指示消息, 该中继配置指 示消息中携带动态主机配置协议 DHCP配置信息, 该已具有正式 IP地址的 客户机与待配置正式 IP地址的客户机在同一个通信范围内; 该已具有正式
IP地址的客户机根据该 DHCP配置信息将本机配置成 DHCP中继器; 配置 成 DHCP中继器的客户机提供 DHCP中继功能, 实现该服务端设备为该待 配置正式 IP地址的客户机分配正式 IP地址。
本发明实施例提供了一种服务端设备, 包括: 客户机确定模块, 用于 在待配置正式 TP地址的客户机所属的通信范围内 ,确定具有正式 TP地址的 客户机, 该正式 IP地址为已配置的 IP地址; 发送模块, 用于向该具有正式 IP地址的客户机发送中继配置指示消息, 该中继配置指示消息中携带动态 主机配置协议 DHCP配置信息; 分配模块, 用于当该具有正式 IP地址的客 户机根据该 DHCP 配置信息将本机配置成 DHCP 中继器后, 通过配置成 DHCP中继器的客户机,为该待配置正式 IP地址的客户机分配正式 IP地址。
本发明实施例提供了一种客户机, 包括: 接收模块, 用于接收服务端 设备发送的中继配置指示消息, 该中继配置指示消息中携带动态主机配置 协议 DHCP配置信息; 配置模块, 用于根据该 DHCP配置信息将本机配置 成 DHCP中继器; 中继模块, 用于提供 DHCP中继功能, 实现该服务端设 备为待配置正式 IP地址的客户机分配正式 IP地址。
本发明实施例提供了一种通信***, 包括: 上述的服务端设备; 以及 上述的客户机。
本发明实施例通过具有正式 IP地址的客户机配置成 DHCP中继器, 可 以在采用 DHCP配置 IP地址时,无需在网络***中设置专用的 DHCP中继 器, 实现网 ^ 殳入及维护成本的降低。 附图说明
此处所说明的附图用来提供对本发明实施例的进一步理解, 构成本申 请的一部分, 并不构成对本发明实施例的限定。 在附图中:
图 1是本发明实施例提供的一种 IP地址自动分配方法的流程图。
图 2是本发明实施例提供的一种 IP地址自动分配方法流程图。
图 3是本发明实施例提供的一种 IP地址自动分配方法信令图。
图 4是本发明实施例提供的一种 IP地址自动分配方法信令图。
图 5是本发明实施例提供的一种 IP地址客户端 500的框图。
图 6是本发明实施例提供的 IP地址探测单元 502的框图。 图 7是本发明实施例提供的一种 IP地址自动分配服务器 700的框图; 图 la为本发明一实施例的方法流程示意图;
图 2a为本发明一实施例的方法流程示意图;
图 3a为本发明一实施例的方法流程示意图;
图 4a为本发明一实施例对应的网络***结构示意图;
图 5a为本发明一实施例的方法流程示意图;
图 6a为本发明一实施例对应的网络***结构示意图;
图 7a为本发明一实施例的方法流程示意图;
图 8a为本发明一实施例对应的网络***结构示意图;
图 9a为本发明一实施例的方法流程示意图;
图 10a为本发明一实施例对应的网络***结构示意图;
图 11a为本发明一实施例的服务端设备结构示意图;
图 12a为本发明一实施例的客户机结构示意图;
图 13a为本发明一实施例的通信***结构示意图。 具体实施方式
为使本发明实施例的目的、 技术方案和优点更加清楚明白, 下面结合 实施方式和附图, 对本发明实施例做进一步详细说明。 在此, 本发明实施 例的示意性实施方式及其说明用于解释本发明实施例, 但并不作为对本发 明实施例的限定。
本发明实施例所介绍的 IP地址自动配置技术可取名为 IACP: IP Addres s Auto Conf igurat ion Protocol (自动地址酉己置十办议 ) 。 该十办议可以用于远 程自动 IP地址分配, 其中的7 载网可以是三层 IP网络, 而该三层 IP网络只 需配置简单的路由信息。
本发明实施例的技术方案, 可能涉及三个功能节点:
1. IACP Cl ient: 即 IACP客户端, 该节点需要分配 IP地址(可简称 "客 户端" ) 。 换句话说, 客户端就是等待分配 IP地址的主机, 如计算机等。
2. IACP Server: 即 IACP服务器 (可筒称 " IP地址分配服务器" ) , 该节点提供 IP地址分配服务, 包括 IP地址池, 以及 IP地址分配策略。
以下分别从方法、 涉及的节点 (也可以称为 "网元,, 或装置) 以及系 统的角度, 对 IACP地址分配解决方案进行描述。
另外, 本发明实施例中涉及到的几个概念, 在此一并作出如下解释:
ARP: addres s resolut ion protocol 地址解析协议, 即将 IP地址映射 成以太网 MAC地址的互联网十办议。
ARP请求: ARP协议中, 本机知道某个节点的 IP地址, 但不知道该节点 的 MAC地址, 本机通过在以太网广播发送 ARP请求查询该 IP地址的 MAC地址;
ARP响应: ARP协议中, 本机发现 ARP请求中的 IP地址为本机 IP地址, 本 地向对端主机发送 ARP响应 , 告之该 IP地址对应的 MAC地址是什么;
免费 ARP请求: 主机想将某个 IP地址作为本机的 IP地址, 但不知道是否 会发生 IP地址冲突,即以太网广播该 IP地址的免费 ARP请求,如果收到响应, 则表示发生冲突, 否则表示未发生冲突;
免费 ARP响应: 主机想将某个 IP地址作为本机的 IP地址, 并且在以太网 广播免费 ARP响应告之整个以太网, 该 IP地址为本机所用。
实施例 1
图 1是本发明实施例提供的一种 IP地址自动分配方法的流程图, 如图 1所示, 所述的方法包括:
S101 , 客户端获取包括未分配 IP地址的 1? ^艮文。
在本发明实施例中 , 未分配 IP地址的客户端获取 TP报文, 该 IP报文 中包括未分配的 IP地址(一个或多个), IP 文可以是包括未分配 IP地址 的 ARP (地址解析协议, Addres s Resolut ion Protocol )请求包, 该 ARP 请求包可以由 IACP服务器或本网段的接入路由器发送, 当客户端和 IACP 服务器不在同一个网段时, 客户端接收所在网段的接入路由器发送的 ARP 请求包; 当客户端和 IACP服务器在同一个网段时, 客户端接收 IACP服务 器发送的 ARP请求包。 IACP服务器或接入路由器通过在本网段广播 ARP请 求包, 如前所述, 该 ARP请求包可以用来获取与 ARP请求包中的未分配 IP 地址对应的 MAC地址。
5102 , 客户端探测获取到的 IP报文中的未分配 IP地址是否已被占用。 在本发明实施例中, 客户端获取到的 IP报文后, 可以向本网段广播包 括未分配 IP地址的免费 ARP请求包, 根据回复的响应消息探测获取到的未 分配 IP地址是否已被占用。 具体的, 可以是向本网段的其他节点(比如其 他的客户端, 本网段内的计算机, 或者是接入路由器, 或者是本网段内使 用 IP地址的服务器等)广播该免费 ARP请求包, 而后, 根据其他节点的免 费 ARP响应消息 , 探测该 IP地址是否已经被占用。
可以理解的是, 本发明实施例中, 本网段指的是客户端所在的网段。
5103, 如果未分配 IP地址没有被占用, 则判断是否由本客户端获得所 述的未分配 IP地址, 如果是, 则获得所述的未分配 IP地址。
在本发明实施例中 , 如果客户端没有收到其他节点回复的响应消息, 便认为未分配 IP地址没有被占用,进而判断是否由本客户端获得未分配 IP 地址。 具体的, 如果有多个未分配 IP地址的客户端, 则所有未分配 IP地 址的客户端可以通过选举的方式选择一个客户端获得未分配 IP地址, 具体 可以是根据接收的其他客户端发送的免费 ARP请求包承载的比对信息, 判 断是否由本客户端获得未分配 IP地址。
在本发明另一实施例中, 选举出的客户端获得未分配 IP地址后, 向本 网段广播该 IP地址已经被占用的响应消息(比如, 免费 ARP响应)。 可以 理解的是, 就客户端之间的关系而言, 也可以认为该获得未分配 IP地址的 客户端向该网段中的其他客户端广播发送了免费 ARP响应。
另一方面, 获得未分配 IP地址的客户端, 还可以获取本网段的掩码、 网关 IP地址以及 IACP服务器的 IP地址, 最后根据获取到的 IACP服务器 的 IP地址向 IACP服务器发送该未分配 IP地址已被分配的确认消息。
本发明实施例采用 IACP服务器主动发送未分配 IP地址、 客户端主动 获取未分配的 IP地址的技术手段, 克服了现有技术中当 DHCP服务器与客 户端不在同一网段上时, 必须额外添加的 DHCP Re lay主机才可以为客户端 分配 IP地址的问题, 节省了配置成本且简化了网络配置。
实施例 1是从客户端的角度对 IACP地址分配解决方案进行描述, 以下 实施例 2将从 IACP服务器的角度进行描述。
实施例 2
图 2是本发明实施例提供的一种 IP地址自动分配方法流程图, 如图 2 所示, 所述的方法包括:
5201 , IACP服务器根据未分配 IP地址生成 IP报文, 该 IP报文中携带 未分配的 IP地址。
在本发明实施例中, IACP服务器根据未分配的 IP地址(可以体现为 IP地址列表的形式),生成 IP报文,该 IP报文中包括未分配的 IP地址(一 个或多个)。
可以理解的是, 根据应用场景的不同, IP报文可以采用不同的方式: 如果 IACP服务器和客户端不在同一个网段, 则 IP报文可以是探测 IP 包, 其中包括未分配 IP地址所在网段的掩码、 网关 IP地址以及 IACP服务 器的 IP地址。 该客户端可以理解为需要被分配 IP地址的客户端, 也即未 被分配 IP地址的客户端。
如果 IACP服务器和客户端在同一个网段, 则 IP才艮文可以是 ARP请求 包, 在该 ARP请求包中包括未分配的 IP地址。
5202 , 将所述的 IP >¾文发送至所述的未分配 IP地址所在的网段。 在本发明实施例中 , IACP服务器将 IP报文发送至未分配 IP地址所在 的网段。 可以理解的是, 这里的 "发送 ", 既可以采用周期发送的方式, 也 可以采用事件触发后发送的方式, 以下主要以周期发送的方式为例进行描 述。
当 IP报文是探测 IP包时, IACP服务器周期性的将探测 IP包发送至未 分配 IP地址所在的网段的接入路由器, 后续由该接入路由器根据探测 IP 包生成 ARP请求包, 并将 ARP请求包发送给同一网段的客户端, 该网段中 存在未被分配 IP地址的客户端;
当 IP报文是 ARP请求包时, IACP服务器周期性的将 ARP请求包发送至 未分配 IP地址所在的网段的客户端, 该网段中存在未被分配 IP地址的客 户端。
S203, 接收客户端发送的未分配 IP地址已被分配的确认消息。
在本发明实施例中 , 当未分配 IP地址已被分配给客户端后 , 客户端可 以通过确认消息通知 IACP服务器该 IP地址已被分配, 即, IACP服务器接 收客户端发送的未分配 IP地址已被分配的确认消息。
可选的, 在本发明实施例中, IP 地址自动分配方法还可以包括步骤 S204 , 根据接收到的确认消息, 刷新未分配 IP地址的列表。
具体的, 在本发明实施例中, 如果步骤 S201中 IACP服务器生成的 IP 报文中只包括一个 IP地址, 则当该 IP地址已被分配后, IACP服务器根据 接收到的确认消息, 停止发送包括该 IP地址的 IP ^艮文, 并刷新未分配 IP 地址的列表,根据刷新后的未分配 IP地址的列表重新执行步驟 S201 , 生成 新的 1? ^艮文。
如果步驟 S201中 IACP服务器生成的 IP报文中包括多个 IP地址, 则 当其中某个 IP地址被分配后, IACP服务器根据接收到的通知消息, 刷新未 分配 IP地址的列表, 并根据刷新后的未分配 IP地址的列表重新执行步骤 S201 , 生成新的 IP报文。
本发明实施例采用 IACP服务器主动发送未分配 IP地址、 客户端主动 获取未分配的 IP地址的技术手段, 克服了现有技术中当 DHCP服务器与客 户端不在同一网段上时, 必须额外添加的 DHCP Relay主机才可以为客户端 分配 IP地址的问题, 节省了配置成本且简化了网络配置。
实施例 3
图 3是本发明实施例提供的一种 IP地址自动分配方法信令图, 在图 3 中, 客户端需要分配 IP地址, IACP服务器提供 IP地址分配服务, 在本实 施例中, 假设 IACP服务器与客户端不在同一网段, 如图 3所示, 所述的方 法包括:
5301 , IACP服务器根据未分配 IP地址生成探测 IP包,探测 IP包中携 带未分配的 IP地址及路由信息。
在本发明实施例中, 当 IACP服务器发现已规划的 IP地址尚未分配出 去时,假设该 IP地址是 IPl , IACP服务器以 IP1为目的 IP地址,且以 IACP 月良务器 IP地址为源 IP地址, 生成探测 IP包。 该 IP包可以携带 IP1所在 网段的掩码长度、 IP1所在网段的网关 IP地址(假设网关 IP地址是 IP0 ), 以及其它可选信息。 该探测 IP包标识为探测 IP包(IP1 )。 当某个客户端 获得 IP1 ,该客户端对外发送 IP包时可以使用前述掩码长度和网关 IP地址 产生路由信息。
5302 , IACP服务器向目标客户端的接入路由器发送探测 IP包。
在本发明实施例中, 目标客户端即未分配的 IP地址 IP1所在网段的客 户端。
IACP服务器将探测 IP包发送至未分配 IP地址所在的网段。 在本发明 实施例中, 探测 IP包(IP1)是一个单播 IP包, 承载网是一个三层网络, 探 测 IP包(IPl)会发到 IP1所在网段的接入路由器, 该接入路由器也是某个 客户端的接入路由器, 個殳该路由器为 Router l。
可以理解的是, 这里的 "发送 ", 既可以采用周期发送的方式, 也可以 采用事件触发后发送的方式, 以下主要以周期发送的方式为例进行描述。
IACP服务器以一定的周期 T1重复发送该探测 IP (IPl)包, 直到某客户 端反馈 IP1分配已完成才停止发送。 T1是一个可配置的时间参数, 此处 T1 可支设为 5秒。
5303,目标客户端的接入路由器向整个目标网段广播目标 IP地址的 ARP 请求包。
由于 IP1是一个未分配的 IP地址, 接入路由器 Routerl虽然知道 IP1 在自己的哪个网段, 但不知道 IP1对应的以太网 MAC地址, 所以, Routerl 会在 IP1所在的网段广播 ARP请求包, 该 ARP请求包的可以用来查询 IP1 对应的 MAC地址。 此处将该 ARP请求包标识为 ARP请求包(IP 1) , IP1所在 网段的任何一个客户端都可以接收到该 ARP请求包(IP1) 。
5304 , 客户端接收 ARP请求包, 用于探测可能分配的 IP地址。
在本发明实施例中, 客户端 1和 2在未分配到 IP地址时, 利用接收到 的网络中 ARP请求包来探测可能分配的 IP地址。 为了提高***的稳定性, 本阶段客户端只处理 ARP请求包, 不处理免费 ARP请求包、 ARP响应包和免 费 ARP响应包。
殳客户端 1和 2收到某个 ARP请求包, 探测出该 ARP请求包是查询 IP地址为 IP1的以太网 MAC地址,该 ARP请求包可以称为 ARP请求包(IP1) , 则客户端 1和 2认为 IP1可能是 IACP服务器分配给本客户端的 IP地址, 所以均准备抢占该 IP地址。 可以理解的是, 如果该网段中有多个客户端均 未被分配 IP地址, 且收到了该 ARP请求包, 则该网段中的所有未分配 IP 地址的客户端, 均可以准备抢占该 I P地址。
S305 , 客户端发送包括未分配 IP地址的探测消息 (比如免费 ARP请求 包);
本步骤中, 客户端通过发送免费 ARP请求包, 探测目标 IP地址是否被 占用。
在本发明实施例中, 客户端 1和 2收到 ARP请求包(IP1)后, 可以在随 机延时后, 比如在 T2到 T2+T3之间随机延时之后, 在本网段内发送 IP1的 免费 ARP请求包,该免费 ARP请求包标识为免费 ARP请求包(IP1)。免费 ARP 请求包(IP1)携带 IACP协议的特殊标志, 方法有很多种, 此处不作限制, 例如在免费 ARP请求包(IP1)的 MAC帧填充字段加了 0x5 A作为 IACP协议的 特殊标志。 T2和 T3是一个可配置的时间参数, 此处可支设 T2和 T3均为 100毫秒。
随机延时的作用是: 防止网段内所有未分配地址的客户端在同一时刻 互发免费 ARP请求包而产生以太网广播风暴。
S306 , 客户端判断目标 IP地址是否被占用;
本步驟中, 客户端根据本网段的其他节点回复的响应消息探测该目标 IP地址是否被占用。 响应消息可以是 ARP响应包或免费 ARP响应包。
具体的, 在本发明实施例中, ARP响应包是在网段内的节点接收到 ARP 请求包后, 发现 ARP请求包中的 IP地址为本地 IP地址时, 向发送端发送 ARP响应包, 告之该 IP地址对应的 MAC地址。 假设本步驟中客户端 1收到 客户端 2发送的 ARP响应包, 则表明该目标 IP地址已经被占用。
免费 ARP请求包是客户端想将某个 IP地址作为本客户端的 IP地址时, 由于不知道是否会发生 IP地址冲突, 所以便广播该 IP地址的免费 ARP请 求包, 如果收到响应, 则表示发生冲突, 否则则表示没有冲突。 免费 ARP 响应包是客户端想将某个 IP地址作为本客户端的 IP地址, 便在以太网广 播免费 ARP响应包告之整个以太网该 IP地址为本客户端所用。
可以理解的是, 只有目标 IP地址没有被其它节点使用, 才能作为被抢 占的对象。
在本发明实施例中, 客户端在处于本阶段时, 接收其它客户端发来的 免费 ARP请求包、 免费 ARP响应包、 ARP响应包。 当客户端 1或 2收到免费 ARP响应包(IP1)或 ARP响应包(IP1)时,表明该 IP1被占用,立刻回到 S304 的状态。
客户端 1或 2在发送免费 ARP请求包(IP1)后, 在 T4时间内即没有收 到免费 ARP响应包(IP1)又没有收到 ARP响应包(IP1) , 则表明该 IP1没有 被占用, 客户端 1或 2进入 S307。 T4是一个可配置的时间参数, 此处可殳 设 T4为 1秒。
当 IP1 已经分配给某个客户端时, 该客户端收到任何一条免费 ARP请 求包(IP1)时, 必须立刻回送 ARP响应包(IP1) , 收到多少条免费 ARP请求 包(IP1) , 就回送多少条 ARP响应包(IP1) , 用于通知 IP1 已经分配给该客 户端。
为了提高***稳定性, 处于本阶段的客户端 1和 2可以不处理 ARP请 求包。
S307 , 选举唯一的客户端获得 IP1。
在本发明实施例中, 未获得 IP地址的客户端重新进入 S304 , 而获得
IP1的客户端则宣告 IP1已被分配, 从而进入 S308。
客户端选举的方式有很多种, 只需选举的结果唯一即可。 特点就是选 举的对比信息是由携带 IACP协议的特殊标志的免费 ARP请求包(IP1)承载 的, 比如, 该比对信息可以是 MAC地址。
选举方式一: 以太网 MAC值最小的客户端获得 IP1。
该方式中, 利用了每一个客户端的以太网 MAC值全球唯一的特点。 客 户端从接收到的所有免费 ARP请求包(IP1)中, 挑选出携带 IACP协议的特 殊标志的免费 ARP请求包(IP1) , 并从这些免费 ARP请求包(IP1)中提取源 MAC地址, 这些 MAC地址正好是本网段中尚未分配 I P地址的所有其它客户 端的 MAC地址。 本客户端的 MAC地址与这些 MAC地址比较。 如本客户端的 MAC值最小, 则本客户端获得 IP1 , 否则本客户端不能获得 IP1 , 而且, 本 客户端返回到 S304。
选举方式二: 以太网 MAC值最大的客户端获得 IP1。
该方式中, 同样是利用每一个客户端的以太网 MAC值全球唯一的特点。 客户端从接收到的所有免费 ARP请求包(IP1)中, 挑选出携带 IACP协议的 特殊标志的免费 ARP请求包(IP1) , 并从这些免费 ARP请求包(IP1)中提取 源 MAC地址, 这些 MAC地址正好是本网段中尚未分配 IP地址的所有其它客 户端的 MAC地址。 本客户端的 MAC地址与这些 MAC地址比较。 如果本客户 端的 MAC值最大, 则本客户端获得 IP1, 否则本客户端不能获得 IP1, 而且, 本客户端返回到 S304。
可以理解的是, 上述 "选举" 是从多个客户端的角度进行描述, 如果 从一个客户端进行描述, 则可以理解为: 该客户端要判断是否由本客户端 获得该 IP地址,具体的判断方式为:根据接收的其他客户端发送的免费 ARP 请求包承载的比对信息, 判断是否由本客户端获得该未分配 IP地址, 比对 信息可以是 MAC地址。
S308 , 获得 IP地址的客户端宣告 IP1为其所有。
在本发明实施例中,假设是客户端 2获得 IP1 ,客户端 1立刻向整个网 段广播免费 ARP响应包(IP1) , 宣告 IP1地址已被分配, 然后进入 S309。
为了提高***稳定性, 处于本阶段的客户端不处理 ARP请求包。
S309 , 通知客户端的接入路由器探测 IP包的目的 MAC地址, 并接收探 测 IP包, 获取 IACP服务器 IP地址和路由信息。
具体的, 本步驟中, 客户端可以通过 ARP响应消息通知接入路由器本 客户端的 MAC地址, 接入路由器接收到该 ARP响应消息后, 发送之前存放 的探测 IP包, 客户端接收端到该探测 IP包之后, 可以获取其中的信息。
在本发明实施例中, 本步驟用于接收存放在 Routerl 的探测 IP 包 (IP1)。本步驟的作用在于:一是通过接收探测 IP包(IP1) ,确认 IP1是 IACP 服务器分配的 IP地址; 二是分析探测 IP包(IP1 ), 得到掩码长度和网关 IP地址等路由信息, 以及其它可能的信息, 比如本网段还包括第二网关时, 可以得到第二网关的 IP地址; 三是通过探测 IP包( IP1 )的源 IP地址, 得出 IACP服务器 IP地址,用于客户端向 IACP服务器确认 IP1已分配完成。
获得 IP1的客户端 2向 Routerl回送 ARP响应包(IP1) , 向 Routerl通 知本机的 MAC地址, 假设该 MAC地址是 MAC1。 Routerl以 MAC1为目的地址 向客户端 2发送探测 IP包(IP1) 。
客户端 2获得探测 IP包( IP1 )后, 分析该 IP包并获得客户端 2所在 网段的掩码、 网关 IP地址、 IACP服务器 IP地址, 以及其它可能的信息, 然后进入 S 310。
当客户端 2进行 S309后, 如果在 T5时间没有收到探测 IP包( IP1 ), 该客户端 2返回 S304。 T5是一个可配置的时间参数, 此处可假设 T5为 10 秒。 另可以设置 T5大于等于 T1 , 因为当 IACP服务器发送的第一个探测 IP 包(IP1 )被 Routerl 丢弃后, 客户端可以用足够的时间等待并接收 IACP 服务器发送的第二个探测 IP包(IP1)。
S 310 , 获得 IP地址的客户端向 IP分配服务器发送未分配 IP地址已被 分配的确认消息。
本步驟中, 客户端通知 IACP服务器目的 IP地址 IP1已分配完成。 在本发明实施例中, 本阶段用于通知 IACP服务器 IP1已分配完成, 可 以刷新 IP地址分配池, 并停止发送探测 IP包( IP1 )。 获得 IP1的客户端 2 以 IACP服务器为目的 IP地址, 且 IP1为源 IP地址, 向 IACP服务器发送 IP1 已分配确认消息。 IACP 良务器收该 IP包后, 刷新 IP地址分配池(IP 地址列表), 并停止发送探测 IP包( IP1 )。
以上是以探测 IP包仅包含一个未分配 IP地址即 IP1的情况进行的说 明,当探测 IP包包括多个未分配 IP地址时,其中的一个未分配 IP地址 IP1 分配完成后, IACP服务器接收到客户端发送的 IP1 已分配确认消息, 刷新 IP地址分配池, 并更新探测 IP包。
至此, IP地址 IP1分配过程完成。
本发明实施例提供的技术方案, 可只利用 IP网络的最基本的、 必不可 少的功能, 不需要 IP网络的可选功能, 就可以完成自动 IP地址分配, 且 可以实现客户端与 IP地址分配服务器在不同的 IP网络。 本发明实施例提 供的技术方案, 提供了一个完整的不需要三层 IP网络特殊功能的 IP地址 自动配置功能。 同时该方案兼容^^载网是二层以太网的应用场景。 它可达 到以下效果:
1. 降低三层 IP 网络成本, 因为它只需要网络的最基本的、 必不可少 的功能;
2. 提高 IP地址自动配置的使用范围, 不会因为需要特殊的功能, 而 不能实现 IP地址自动配置, 从而降低 IP地址分配的难度和成本;
3. 兼容承载网是二层以太网的应用场景, 保证在三层 IP 网络与二层 以太网网络只需釆用一种 IP地址自动分配技术, 降低网络部署成本。
实施例 4
图 4是本发明实施例提供的一种 IP地址自动分配方法信令图, 在图 4 中 , 客户端需要分配 IP地址, IACP服务器提供 IP地址分配服务, 本实施 例的客户端与 IACP服务器在同一网段下的 IP地址自动分配。 如图 4所示, 所述的方法包括:
5401 , IACP服务器生成未分配 IP地址的探测 IP包,携带 IP地址及路 由信息。
在本发明实施例中 , 此步驟与实施例 3所述的 S301相同, 故在此不再 赘述。
5402 , IACP服务器向本地网段发送目标 IP地址的 ARP请求包。
在本发明实施例中, IACP服务器如果要发送探测 IP包(IP1 ), 必须知 道 IP1对应的 MAC地址。 由于 IP1是一个未分配的 IP地址, IACP月良务器虽 然知道 IP1与自己同处一个网段, 但不知道 IP1对应的以太网 MAC地址, IACP服务器必须向在 IP1所在的网段广播 ARP请求包, 该 ARP请求包可以 用来查询获取 IP1对应的 MAC地址。 此处该 ARP请求包可以称为 ARP请求 包(IP1) , IP1所在网段的任何一个客户端都可以接收到该 ARP请求包(IP1) 。
在本发明实施例中, IACP服务器将 ARP请求包(IP1)发送至本地网段。 可以理解的是, 这里的 "发送 ", 既可以采用周期发送的方式, 也可以采用 事件触发后发送的方式, 以下主要以周期发送的方式为例进行描述。
为了保证 ARP请求包( IP1 )可以被发送出去, IACP服务器以一定的周 期 T1重复发送 ARP请求包(IP1) , 直到某客户端反馈 IP1分配已完成才停 止发送。 T1是一个可配置的时间参数, 此处 T1可支设为 5秒。
5403, 客户端接收 ARP请求包用于探测可能分配的 IP地址。
在本发明实施例中 , 此步骤与实施例 3所述的 S304相同, 故在此不再 赘述。
5404 , 客户端随机延时后发送免费 ARP请求包, 探测目标 IP地址是否 被其它客户端使用。
在本发明实施例中, 此步驟与实施例 3所述的 S305相同, 故在此不再 赘述。
5405 , 客户端检测是否收到 ARP响应包、 免费 ARP响应包, 来判断目 标 IP地址是否被占用;
可以理解的是, 只有目标 IP地址没有被其它节点(比如客户端)使用, 才能将该目标 IP作为被抢占的对象。
在本发明实施例中 , 此步驟与实施例 3所述的 S306相同, 故在此不再 赘述。
5406 , 客户端选举出唯一的客户端获得 IP1。
在本发明实施例中 , 此步驟与实施例 3所述的 S307相同, 故在此不再 赘述。
5407 , 获得 IP地址的客户端宣告 IP1为其所有, 其它客户端不得再抢 占该 IP地址。
在本发明实施例中, 此步驟与实施例 3所述的 S308相同, 故在此不再 赘述。
5408 , 通知 IACP服务器本客户端的 MAC地址, 并接收探测 IP包, 获 取 IACP服务器 IP地址和路由信息。 具体的, 本步驟中, 客户端可以通过 ARP响应消息通知服务器本客户 端的 MAC地址, 服务器接收到该 ARP响应消息后, 发送之前生成的探测 IP 包, 客户端接收端到该探测 IP包之后, 可以获取其中的信息。
本步骤用于接收存放在 IACP服务器的探测 IP包(IP1)。 本步骤的作用 在于: 一是通过接收探测 IP包(IPl) , 确认 IP1是 IACP服务器分配的 IP 地址; 二是分析探测 IP包(IP1 ), 得到掩码长度和网关 IP地址等路由信 息, 以及其它可能的信息, 比如本网段还包括第二网关时, 可以得到第二 网关的 IP地址; 三是通过探测 IP包( IPl )的源 IP地址, 得出 IACP服务 器 IP地址, 用于客户端向 IACP服务器确认 IP1已分配完成。
获得 IP1的客户端向 IACP服务器回送 ARP响应包(IP1) , 向 IACP服务 器通知本机的 MAC地址, 假设该 MAC地址是 MAC1。 IACP服务器以 MAC1为 目的地址向该客户端发送探测 IP包(IPl) 。
客户端获得探测 IP包( IPl )后, 分析该 IP包并获得客户端所在网段 的掩码、 网关 IP地址、 IACP服务器 IP地址, 以及其它可能的信息, 然后 进入步骤 S409。
当客户端进行 S408后, 如果在 T5时间没有收到探测 IP包( IP1 ), 该 客户端返回 S403。 T5是一个可配置的时间参数, 此处可 ϋ殳 Τ5为 10秒。 另 Τ5大于等于 T1 , 保证客户端有足够的时间收到 IACP服务器发送的第二 个 ARP请求包(IP1 ),客户端可及时的回送 ARP响应包(IPl ), IACP服务 器及时地发送探测 IP包( IPl )给客户端。
S409 , 客户端通知 IACP月良务器该目的 IP地址 IP1已分配完成。
在本发明实施例中 , 此步骤与实施例 3所述的 S310相同, 故在此不再 赘述。
至此, IP地址 IP1分配过程完成。
本发明实施例提供的技术方案, 可只利用 IP网络的最基本的、 必不可 少的功能, 不需要 IP网络的可选功能, 就可以完成自动 IP地址分配, 且 可以实现客户端与 IP地址分配服务器在不同的 IP网络。 本发明实施例提 供的技术方案, 提供了一个完整的不需要三层 IP网络特殊功能的 IP地址 自动配置功能。 同时该方案兼容^^载网是二层以太网的应用场景。 它可达 到以下效果:
1. 降低三层 IP 网络成本, 因为它只需要网络的最基本的、 必不可少 的功能;
2. 提高 IP地址自动配置的使用范围, 不会因为需要特殊的功能, 而 不能实现 IP地址自动配置, 从而降低 IP地址分配的难度和成本;
3. 兼容承载网是二层以太网的应用场景, 保证在三层 IP 网络与二层 以太网网络只需釆用一种 IP地址自动分配技术, 降低网络部署成本。
实施例 5
图 5是本发明实施例提供的一种 IP地址客户端 500的框图, 如图 5所 示, IP地址客户端 500包括: IP 文获取单元 501、 IP地址探测单元 502 和判断单元 503。
IP报文获取单元 501 , 用于获取包括未分配 IP地址的 IP报文。
在本发明实施例中, IP报文获取单元 501用于获取接入路由器或 IACP 服务器发送的 IP报文, IP报文可以是包括未分配 IP地址的 ARP请求包。
IP地址探测单元 502 , 用于探测 IP报文获取单元 501获取到的 IP报 文中的未分配 IP地址是否被占用。
图 6是本发明实施例提供的 IP地址探测单元 502的框图 ,如图 6所示, IP地址探测单元 502可以包括: 探测消息发送模块 601和响应消息探测模 块 602。
探测消息发送模块 601 , 用于向本网段的其他节点发送包括未分配 IP 地址的探测消息。
在本发明实施例中, 探测消息发送模块 601可以用来执行图 3中的步 骤 S305或图 4中的步骤 S404。 响应消息探测模块 602 , 用于根据本网段其他节点回复的响应消息,探 测所述的未分配 IP地址是否被占用。
在本发明实施例中, 响应消息探测模块 602可以用来执行图 3中的步 骤 S306或图 4中的步骤 S405。
判断单元 503 ,用于在 IP地址探测单元 502探测到未分配 IP地址没有 被占用时, 判断是否由本客户端获得所述的未分配 IP地址。
在本发明实施例中, 判断单元 503可以用来执行图 3中的步驟 S307或 图 4中的步驟 S406。 判断单元 503可以包括: 第一模块, 用于接收其他客 户端发送的免费 ARP请求包; 第二模块, 用于根据第一模块接收的其他客 户端发送的免费 ARP请求包承载的比对信息, 判断是否由本客户端获得所 述的未分配 IP地址。
在本发明另一实施例中, IP地址自动分配客户端 500还可以包括: 响应消息发送单元 504 , 用于在客户端获得 IP地址后, 在本网段广播 未分配 IP地址已经被占用的响应消息。 本发明实施例中, 本网段指的是该 客户端所在的网段。
在本发明实施例中, 响应消息发送单元 504可以用来执行图 3中的步 骤 S308或图 4中的步骤 S407。
在本发明另一实施例中 , IP地址自动分配客户端 500还可以包括:
IP信息获取单元 505 , 用于在客户端获得 IP地址后获取所述网段的掩 码、 网关 IP地址以及 IP分配月良务器的 IP地址。
在本发明实施例中, IP信息获取单元 505可以用来执行图 3中的步驟 S309或图 4中的步骤 S408。
在本发明另一实施例中, IP地址自动分配客户端 500还可以包括: 确认消息发送单元 506 , 用于在客户端获得 IP地址后, 向 IP分配服务 器发送所述未分配 IP地址已被分配的确认消息。 具体的, 可以根据获取到 的 IP分配服务器的 IP地址, 向 IP分配服务器发送未分配 IP地址已被分 配的确认消息。
在本发明实施例中, 确认消息发送单元 506可以用来执行图 3中的步 驟 S310或图 4中的步驟 S409。
本发明实施例采用 IACP服务器主动发送未分配 IP地址、 客户端主动 获取未分配的 IP地址的技术手段, 克服了现有技术中当 DHCP服务器与客 户端不在同一网段上时, 必须额外添加的 DHCP Relay主机才可以为客户端 分配 IP地址的问题, 节省了配置成本且简化了网络配置。
实施例 6
图 7是本发明实施例提供的一种 IP地址自动分配服务器 700的框图 , 如图 7所示, IP地址自动分配服务器 700包括: IP报文生成单元 701、 IP 报文发送单元 702和确认消息接收单元 703。
IP才艮文生成单元 701 , 用于生成包括未分配 IP地址的 1? >¾文。
IP报文发送单元 702 , 用于周期性的将报文生成单元生成的 IP报文发 送至所述的未分配 IP地址所在的网段。 可以理解的是, 该网段中存在未被 分配 IP地址的客户端。
确认消息接收单元 703, 用于接收所述未分配 IP地址已被分配的确认 消息。
在本发明实施例中 , 确认消息接收单元 703接收客户端发送的 IP地址 已被分配的确认消息。
在本发明实施例中, IP报文发送单元 702可以用来周期性发送。
可选的, IP报文发送单元 702可以包括: 探测 IP包发送模块, 用于在 客户端和 IP地址分配服务器不在同一个网段时, 将探测 IP包发送至所述 的未分配 IP地址所在的网段的接入路由器; 相应的, IP报文发送单元, 用 于将该探测 IP包生成模块生成的探测 IP包, 发送至未分配 IP地址所在的 网段的接入路由器。
可选的, IP报文发送单元 702可以包括: ARP请求包生成模块, 用于 在客户端和 IP地址分配服务器在同一个网段时, 生成包括未分配 IP地址 的 ARP请求包; 相应的, IP报文发送单元, 用于将该 ARP请求包生成模块 生成的 ARP请求包发送至未分配 IP地址所在的网段的客户端。
在本发明另一实施例中 , IP地址自动分配服务器 700还可以包括: IP列表刷新单元 704 , 用于根据接收到的通知消息, 刷新未分配 IP地 址的列表。
在本发明实施例中, IP列表刷新单元 704根据接收到的通知消息从未 分配 IP地址的列表去掉已经分配的 IP地址, 形成新的未分配 IP地址的列 表。
在本发明另一实施例中, IP地址自动分配服务器 700还可以包括: 响应消息接收单元 705 , 用于接收获得 IP地址的客户端发送的所述未 分配 I P地址已经被占用的响应消息。
IP信息发送单元 706 , 用于根据接收到的响应消息, 将所述未分配 IP 地址所在的网段的掩码、 网关 IP地址以及 IP分配服务器的 IP地址发送至 所述的获得 IP地址的客户端。
在本发明实施例中 , 响应消息接收单元 705和 IP信息发送单元 706可 以用于执行图 3中的步骤 S309或图 4中的步骤 S408。
本发明实施例釆用 IACP服务器主动发送未分配 IP地址、 客户端主动 获取未分配的 IP地址的技术手段, 克服了现有技术中当 DHCP服务器与客 户端不在同一网段上时, 必须额外添加的 DHCP Relay主机才可以为客户端 分配 IP地址的问题, 节省了配置成本且简化了网络配置。
以上所述的具体实施方式, 对本发明的目的、 技术方案和有益效果进 行了进一步详细说明, 所应理解的是, 以上所述仅为本发明的具体实施方 式而已, 并不用于限定本发明的保护范围, 凡在本发明的精神和原则之内, 所做的任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。
另外一方面: 图 l a为本发明一实施例的方法流程示意图, 包括:
步骤 11a: 服务端设备在待配置正式 IP地址的客户机所属的通信范围 内 , 确定具有正式 IP地址的客户机, 该正式 IP地址为已配置的 IP地址。
其中,服务端设备可以包括 DHCP单元,该 DHCP单元能够提供 DHCP 服务器功能, 即当客户机采用 DHCP流程请求 IP地址时, 该 DHCP单元可 以为客户机提供对应的正式 IP地址。
为了使 DHCP过程顺利实施, 该服务端设备还可以包括自动地址分配 协议( IP Auto Configuration Protocol, IACP )单元, 该 IACP单元用于为客 户机分配临时 IP地址。
上述的 DHCP单元和 IACP单元可以位于同一个物理实体中, 此时, 服务端设备可以具体为该 DHCP单元和 IACP单元所属的物理实体; 上述 的 DHCP单元和 IACP单元也可以位于不同的物理实体中, 此时, 月良务端 设备可以具体包括 DHCP单元所属的物理实体及 IACP单元所属的物理实 体。 上述 DHCP单元和 IACP单元的具体功能及流程应用可以具体参见下 述实施例。
其中, 已配置的 IP地址是指采用 DHCP方式得到的 IP地址, 或者, 采用人工配置的方式得到的 IP地址,或者采用其他的动态 IP地址分配方式 得到的 IP地址, 该已配置的 IP地址为通信***中通常意义上的 IP地址。 而临时 IP地址是为了获取正式 IP地址而临时釆用的 IP地址。
其中, 当***不进行 VLAN规划时, 该通信范围为某一网段; 当*** 进行 VLAN规划时 , 该通信范围为某一网段的某一 VLAN。
步骤 12a: 该服务端设备向该具有正式 IP地址的客户机发送中继配置 指示消息 , 该中继配置指示消息中携带 DHCP配置信息。
步骤 13a: 当该具有正式 IP地址的客户机根据该 DHCP配置信息将该 具有正式 IP地址的客户机配置成 DHCP中继器后, 该服务端设备通过配置 成 DHCP中继器的客户机, 为该待配置正式 IP地址的客户机分配正式 IP 地址。
本实施例通过具有正式 IP地址的客户机配置成 DHCP中继器, 可以在 采用 DHCP配置 IP地址时, 无需在网络***中设置专用的 DHCP中继器, 实现网络投入及维护成本的降低。
图 2a为本发明一实施例的方法流程示意图, 包括:
步骤 21a: 已具有正式 IP地址的客户机接收服务端设备发送的中继配 置指示消息, 该中继配置指示消息中携带 DHCP配置信息, 该已具有正式 IP地址的客户机与待配置正式 IP地址的客户机在同一个通信范围内;
步驟 22a: 该已具有正式 IP地址的客户机根据该 DHCP配置信息将本 机配置成 DHCP中继器;
步骤 23a: 配置成 DHCP中继器的客户机提供 DHCP中继功能, 实现 该月良务端设备为该待配置正式 IP地址的客户机分配正式 IP地址。
进一步地, 本实施例还可以包括: 该已具有正式 IP地址的客户机在具 有正式 IP地址之前, 还包括获取正式 IP地址的步驟; 在获取正式 IP地址 后, 该服务端设备发送正式 IP地址指示消息, 该服务端设备在接收到该正 式 IP地址指示消息后 , 发送该中继配置指示消息。
其中, 该客户机获取正式 IP地址包括:
该客户机接收该服务端设备发送的探测包 , 该探测包中携带临时 IP地 址、该通信范围的网关的 IP地址、服务端设备的 IP地址和该通信范围的网 络掩码; 该客户机根据该临时 IP地址、 该通信范围的网关的 IP地址、服务 端设备的 IP 地址和该通信范围的网络掩码, 向该服务端设备发送单播 DHCP请求, 接收该服务端设备根据该单播 DHCP请求为该客户机分配的 正式 IP地址。
本实施例通过具有正式 IP地址的客户机配置成 DHCP中继器, 可以在 采用 DHCP配置 IP地址时, 无需在网络***中设置专用的 DHCP中继器, 实现网络投入及维护成本的降低。 本发明实施例主要基于如下思路: 当 DHCP客户机和 DHCP服务器不 在同一网段时, 为了 IP地址的顺利分配, ***中需要有 DHCP中继器。 而 如果专用设置专用的 DHCP中继器会增加成本, 为了解决该问题, 本发明 实施例没有设置专用的 DHCP中继器, 而是将具有正式 IP地址的客户机配 置成 DHCP中继器, 当存在 DHCP中继器后, 便可以采用现有 DHCP过程 进行正式 IP地址的分配。 进一步地, 由于在上述配置成 DHCP中继器的过 程中需要具有正式 IP地址的客户机, 而该通信范围内可能初始并没有任何 具有正式 IP地址的客户机, 此时, 需要首先为该通信范围内的至少一个客 户机分配正式 IP地址, 以便该分配了正式 IP地址的客户机可以被配置成 DHCP中继器。 本发明实施例是借助临时 IP地址实现为该通信范围内的至 少一个客户机分配正式 IP地址, 而临时 IP地址是采用 IACP过程实现的。
IACP的具体流程可以如下实现:
首先, 客户端获取包括未分配 IP地址的 IP ^艮文。 例如, 当该客户端和 IP地址分配服务器不在同一个网段时, 该客户端接收该客户端所在网段的 接入路由器发送的第一地址解析协议 ARP请求包; 或, 当该客户端和 IP 地址分配服务器在同一个网段时, 该客户端接收该 IP地址分配服务器发送 的第二 ARP请求包。
其次,客户端探测获取到的 IP报文中的未分配 IP地址是否被占用。例 如, 向本网段的其他节点发送包括未分配 IP地址的探测消息; 根据本网段 的其他节点回复的响应消息探测该的未分配 IP地址是否被占用。
再次, 如果未分配 IP地址没有被占用, 则判断是否由本客户端获得该 的未分配 IP地址,如果是, 则获得该的未分配 IP地址客户端获取包括未分 配 IP地址的 IP报文。 例如, 根据接收的其他客户端发送的免费 ARP请求 包承载的比对信息, 判断是否由本客户端获得该的未分配 IP地址。
其中, 之所以选择具有正式 IP地址的客户机, 是因为只有客户机在具 有正式 IP地址之后 ,服务端设备才能按照正常的 IP过程与客户机交互信息, 例如, 才可以将中继配置指示消息发送给客户机。
其中, 在服务端设备中可以预先保存 DHCP配置信息, 且某一设备按 照该 DHCP配置信息进行配置后可以具有 DHCP中继器的功能。 因此, 当 服务端设备将 DHCP配置信息发送给客户机时, 该接收到 DHCP的客户机 可以根据该 DHCP配置信息将自身配置成 DHCP服务器。 具体的 DHCP配 置信息的内容可以从现有 DHCP中继器所需要的 DHCP配置信息得到, 不 在本发明实施例的关注范围内。
从上述内容可知, 本发明实施例可能需要 IACP过程及 DHCP过程, 因此,在这种情况下,客户端和服务端分别需要同时具有 IACP功能和 DHCP 功能。 为此, 下述实施例中, 客户机可以为具有 IACP功能和 DHCP功能 的客户机。 而在服务端, 具有 IACP功能的单元和具有 DHCP功能的单元 可以设置在同一个物理实体中,此时,服务端设备为具有 IACP功能和 DHCP 功能的服务器; 或者, 具有 IACP功能的单元和具有 DHCP功能的单元也 可以设置在不同的物理实体中, 此时, 服务端设备包括具有 IACP 功能的 IACP服务器和具有 DHCP功能的 DHCP服务器。下述实施例将分别以 IACP 功能和 DHCP功能设置在同一个物理实体中、 IACP功能和 DHCP功能设置 在不同的物理实体中为例进行说明。
从上述内容还可以获知, 网络***可以不进行 VLAN规划, 此时, 通 信范围是指网段; 也可以进行 VLAN规划, 此时通信范围为网段及该网段 下的 VLAN。 下述实施例将分别以不进行 VLAN规划、 进行 VLAN规则为 例进行说明。
图 3a为本发明一实施例的方法流程示意图 , 本实施例以不进行 VLAN 规划, 且 IACP功能和 DHCP功能设置在同一个物理实体中为例。
图 4a为本发明一实施例对应的网络***结构示意图, 参见图 4a, 包括 至少一个的客户机 41a,该客户机通过以太网(Ethernet ) 42a及路由器 43a, 与 IACP+DHCP服务器 44a通信,该 IACP+DHCP服务器 44a可以具有 IACP 功能和 DHCP功能。 本实施例需要在待分配正式 TP地址的客户机所属的网 段内, 配置 DHCP中继器。
本实施例中如果不进行特别说明, 网段是指待分配正式 IP地址的客户 机所属的网段。
参见图 3a, 本实施例包括:
步骤 301a: IACP+DHCP服务器启动后, 判断 IACP+DHCP服务器与 待分配正式 IP地址的客户机是否属于同一个网段, 若是, 执行步驟 311a, 否则, 执行步驟 302a。
其中, IACP+DHCP服务器中保存有客户机的相关信息, 该相关信息包 含客户机所属网段的网段标识, 因此, 该 IACP+DHCP服务器可以判断出 IACP+DHCP服务器与待分配正式 IP地址的客户机是否在同一个网段中。
步骤 302a: IACP+DHCP服务器判断待分配正式 IP地址的客户机所属 的网段内是否存在可用的 DHCP中继器, 若是, 执行步骤 310a, 否则, 执 行步驟 303a。
具体地 , 网络***中的具有正式 IP地址的客户机可以向 IACP+DHCP 服务器发送中继能力指示消息, 该中继能力指示消息中携带网段标识和能 力指示信息。
因此 , IACP+DHCP服务器可以釆用如下方式进行该网段内是否存在可 用 DHCP中继器的判断:
当 IACP+DHCP服务器接收到客户机发送的中继能力指示消息, 该中 继能力指示消息中携带能力指示信息和网段标识, 当该能力指示信息表明 发送该中继能力指示消息的客户机具有 DHCP中继能力 (筒称中继能力), 且该网段标识表明发送该正式 IP地址指示消息的客户机与该待配置正式 IP 地址的客户机在同一个网段时, 该 IACP+DHCP服务器得到该网段存在可 用的 DHCP中继器; 可以理解的是, 这里的 "可用的 DHCP中继器" 可以 是具有正式 IP地址的客户机配置而成的 DHCP中继器, 或者, 也可能是现 有技术中专用的 DHCP中继器。
当该 IACP+DHCP服务器未接收到该中继能力指示消息, 或者, 接收 到该中继能力指示消息但该能力指示信息表明发送该中继能力指示消息的 客户机不具有中继能力, 或者, 接收到该中继能力指示消息但该网段标识 表明发送该正式 IP地址指示消息的客户机与该待配置正式 IP地址的客户机 不在同一个网段时, 该 IACP+DHCP 服务器得到该网段内不存在可用的 DHCP中继器。
步驟 303a: IACP+DHCP服务器判断该网段内是否存在具有正式 IP地 址的客户机, 若是, 执行步驟 307a, 否则, 执行步驟 304a。
具体地, 网络***中的客户机在启动后, 已被配置正式 IP地址(例如, 采用人工配置方式或者 DHCP配置方式) 的客户机可以向 IACP+DHCP服 务器发送正式 IP地址指示消息, 该正式 IP地址指示消息中携带网段标识。
因此 , IACP+DHCP服务器可以采用如下方式进行该网段内是否具有正 式 IP地址的客户机的判断:
当该 IACP+DHCP服务器接收到客户机发送的携带网段标识的正式 IP 地址指示消息, 且该网段标识表明发送该正式 IP地址指示消息的客户机与 该待配置正式 IP地址的客户机在同一个网段时, 该 IACP+DHCP服务器得 到该网段内存在已被配置正式 IP地址的客户机;
当该 IACP+DHCP服务器未接收到该正式 IP地址指示消息, 或者, 接 收到该正式 IP地址指示消息但该网段标识表明发送该正式 IP地址指示消息 的客户机与该待配置正式 IP 地址的客户机不在同一个网段时, 该 IACP+DHCP服务器得到该网段内不存在已被配置正式 IP地址的客户机。
步驟 304a: IACP+DHCP服务器采用 IACP为该网段内的临时客户机分 配临时 IP地址。
其中, IACP 过程中, IACP服务器会为该网段分配 IP地址, 为了与 DHCP过程分配的 IP地址区分,将 IACP月良务器分配的 IP地址称为临时 IP 地址, 接收该临时 TP地址的客户机称为临时客户机。
具体地, IACP是 IACP服务器主动向客户机配置 IP地址的协议。 IACP 服务器启动后, 周期性的向目的网段发送探测包, 其中, 探测包中的目的 地址为 IACP服务器选择的尚未分配的 IP地址 , 探测包中还携带目的网段 内的网关的 IP地址, 目的网段的网络掩码及 IACP服务器的 IP地址。 目的 网段内的网关接收到该探测包后, 向目的网段广播请求包, 客户机接收到 该请求包后 , 由尚未分配 IP地址的客户机选举一个客户机接收该 IACP服 务器选择的 IP地址, 之后由该被选举出的客户机接收 IACP服务器发送的 探测包, 获得 IACP服务器分配的 IP地址。
步驟 305a: 临时客户机根据探测包中的临时 IP地址、 网关的 IP地址、 网络掩码和 IACP+DHCP服务器的 IP地址, 采用单播 DHCP 过程, 从 IACP+DHCP服务器获取正式 IP地址。
具体地, 当临时客户机根据网络掩码获知自身和 IACP+DHCP服务器 在同一网段时, 可以根据 IACP+DHCP服务器的 IP地址, 向 IACP+DHCP 服务器发送 DHCP搜索包, IACP+DHCP服务器接收到 DHCP搜索包后分 配正式 IP地址, 进行正常的 DHCP流程。 当临时客户机根据网络掩码获知 自身与 IACP+DHCP服务器不在同一个网段时, 可以根据网关的 IP地址及 IACP+DHCP月良务器的 IP地址,通过网关向 IACP+DHCP月良务器发送 DHCP 搜索包, IACP+DHCP服务器接收到 DHCP搜索包后分配正式 IP地址, 进 行正常的 DHCP流程。
在临时客户机获取正式 IP地址之后 ,临时客户机可以释放临时 IP地址, IACP+DHCP 良务器可以回收临时 IP地址 , 这样的话 , 后续该临时 IP地址 依旧可以被再次使用。
步骤 306a: 具有正式 IP地址的客户机向 IACP+DHCP服务器发送正式 IP地址指示消息, 该正式 IP地址指示消息中携带网段标识。
之后, 可以重复执行步骤 303a。 可以理解的是, 当临时客户机获取正式 TP地址后 , 该临时客户机成为 具有正式 IP地址的客户机。
步驟 307a: IACP+DHCP服务器向具有正式 IP地址的客户机发送中继 配置指示消息, 该中继配置指示消息中携带 DHCP配置信息。
步驟 308a:具有正式 IP地址的客户机根据 DHCP配置信息将自身配置 成可用 DHCP中继器。
之后, 可以重复执行步驟 302a。
步骤 309a: 可用 DHCP中继器向 IACP+DHCP服务器发送中继能力指 示消息, 该中继能力指示消息中携带能力指示信息及网段标识。
可以理解的是, 当具有正式 IP地址的客户机被配置成可用 DHCP中继 器后, 该具有正式 IP地址的客户机也为可用 DHCP中继器。
步驟 310a: IACP+DHCP服务器通过可用的 DHCP中继器, 为待分配 正式 IP地址的客户机分配正式 IP地址。
具体地, 由于网络***中存在了 DHCP中继器, 因此, 可以按照正常 的 DHCP流程分配 IP地址。
步骤 311a: IACP+DHCP服务器直接为待配置正式 IP地址的客户机分 配正式 IP地址。
具体地, 由于待分配 IP地址的客户机与 IACP+DHCP月良务器在同一个 网段内, 因此, 可以按照正常的 DHCP流程分配 IP地址。
本实施例的技术方案, 通过将具有正式 IP地址的客户机配置成 DHCP 中继器, 可以在釆用 DHCP配置 IP地址时, 无需在网络***中设置专用的 DHCP中继器, 实现网络投入及维护成本的降低;
进一步的, 本实施例在进行相关判断时采用网段标识, 可以适用于网 络***不进行 VLAN规划的场景;
另夕卜,本实施例在 IACP过程中的探测包中携带 IACP+DHCP服务器的 地址, 可以适用于 DHCP功能和 IACP功能合成在同一个物理实体的场景。 图 5a为本发明一实施例的方法流程示意图, 本实施例以不进行 VLAN 规划 , 且 IACP功能和 DHCP功能设置在不同的物理实体中为例。
图 6a为本发明一实施例对应的网络***结构示意图, 参见图 6a, 包括 至少一个的客户机 61a, 该客户机 61a通过以太网( Ethernet ) 62a及路由器 63a, 与 IACP服务器 64a及 DHCP服务器 65a通信, 该 IACP服务器 64a 具有 IACP功能, 该 DHCP服务器 65a具有 DHCP功能。 本实施例需要在 待分配正式 IP地址的客户机所属的网段内, 配置 DHCP中继器。
本实施例中如果不进行特别说明 , 网段是指待分配正式 IP地址的客户 机所属的网段。
参见图 5a, 本实施例包括:
步驟 501a:判断设备判断 DHCP服务器与待分配正式 IP地址的客户机 是否属于同一个网段, 若是, 执行步驟 511a, 否则, 执行步驟 502a。
其中, 判断设备可以为服务端设备中的功能模块, 该判断设备可以位 于 IACP服务器中, 或者, 位于 DHCP服务器中, 或者, 独立设置在 IACP 服务器和 DHCP服务器之夕卜。图 5a中以判断设备位于 IACP服务器中为例。
其中, 判断设备中保存有客户机的相关信息, 该相关信息包含客户机 所属网段的网段标识, 因此, 该判断设备可以判断出 DHCP服务器与待分 配正式 IP地址的客户机是否在同一个网段中。
步驟 502a: 判断设备判断待分配正式 IP地址的客户机所属的网段内是 否存在可用的 DHCP中继器, 若是,执行步驟 510a, 否则, 执行步驟 503a。
具体地, 网络***中的具有正式 IP地址的客户机可以向判断设备发送 中继能力指示消息, 该中继能力指示消息中携带网段标识和能力指示信息。
因此, 判断设备可以采用如下方式进行该网段内是否存在可用 DHCP 中继器的判断:
当判断设备接收到客户机发送的中继能力指示消息, 该中继能力指示 消息中携带能力指示信息和网段标识, 当该能力指示信息表明发送该中继 能力指示消息的客户机具有中继能力, 且该网段标识表明发送该正式 TP地 址指示消息的客户机与该待配置正式 IP地址的客户机在同一个网段时, 该 判断设备得到该网段存在可用的 DHCP中继器;可以理解的是,这里的 "可 用的 DHCP中继器"可以是具有正式 IP地址的客户机配置而成的 DHCP中 继器, 或者, 也可能是现有技术中专用的 DHCP中继器。
当该判断设备未接收到该中继能力指示消息, 或者, 接收到该中继能 力指示消息但该能力指示信息表明发送该中继能力指示消息的客户机不具 有中继能力, 或者, 接收到该中继能力指示消息但该网段标识表明发送该 正式 IP地址指示消息的客户机与该待配置正式 IP地址的客户机不在同一个 网段时 , 该判断设备得到该网段内不存在可用的 DHCP中继器。
步骤 503a:判断设备判断该网段内是否存在具有正式 IP地址的客户机, 若是, 执行步驟 507a, 否则, 执行步驟 504a。
具体地, 网络***中的客户机在启动后 , 已被配置正式 IP地址(例如, 采用人工配置方式或者 DHCP配置方式) 的客户机可以向判断设备发送正 式 IP地址指示消息, 该正式 IP地址指示消息中携带网段标识。
因此 , 判断设备可以采用如下方式进行该网段内是否具有正式 IP地址 的客户机的判断:
当该判断设备接收到客户机发送的携带网段标识的正式 IP地址指示消 息, 且该网段标识表明发送该正式 IP地址指示消息的客户机与该待配置正 式 IP地址的客户机在同一个网段时, 该判断设备得到该网段内存在已被配 置正式 IP地址的客户机;
当该判断设备未接收到该正式 IP地址指示消息, 或者, 接收到该正式 IP地址指示消息但该网段标识表明发送该正式 IP地址指示消息的客户机与 该待配置正式 IP地址的客户机不在同一个网段时, 该判断设备得到该网段 内不存在已被配置正式 IP地址的客户机。
步骤 504a:判断设备触发 IACP服务器启动后, IACP服务器采用 IACP 为该网段内的临时客户机分配临时 TP地址。
由于本实施例 IACP服务器和 DHCP服务器是分开设置的, 因此, 本 实施例中的探测包中服务端的地址为 IACP服务器的 IP地址和 DHCP服务 器的 IP地址, 其余内容具体可参见步骤 304a。
步驟 505a: 临时客户机根据探测包中的临时 IP地址、 网关的 IP地址、 网络掩码和 DHCP服务器的 IP地址,采用单播 DHCP过程,从 DHCP服务 器获取正式 IP地址。
具体地, 当临时客户机根据网络掩码获知自身和 DHCP服务器在同一 网段时, 可以根据 DHCP服务器的 IP地址, 向 DHCP服务器发送 DHCP 搜索包, DHCP服务器接收到 DHCP搜索包后分配正式 IP地址, 进行正常 的 DHCP流程。 当临时客户机根据网络掩码获知自身与 DHCP服务器不在 同一个网段时, 可以根据网关的 IP地址及 DHCP服务器的 IP地址, 通过 网关向 DHCP服务器发送 DHCP搜索包, DHCP服务器接收到 DHCP搜索 包后分配正式 IP地址, 进行正常的 DHCP流程。
在临时客户机获取正式 IP地址之后 ,临时客户机可以释放临时 IP地址, DHCP服务器可以回收临时 IP地址 , 这样的话 , 后续该临时 IP地址依旧可 以被再次使用。
步驟 506a: 具有正式 IP地址的客户机向判断设备发送正式 IP地址指 示消息 , 该正式 IP地址指示消息中携带网段标识。
之后, 可以重复执行步驟 503a。
可以理解的是, 当临时客户机获取正式 IP地址后 , 该临时客户机也为 具有正式 IP地址的客户机。
步驟 507a: 判断设备向具有正式 IP地址的客户机发送中继配置指示消 息, 该中继配置指示消息中携带 DHCP配置信息。
步驟 508a:具有正式 IP地址的客户机根据 DHCP配置信息将自身配置 成可用 DHCP中继器。 之后, 可以重复执行步驟 502a。
步骤 509a: 可用 DHCP中继器向 IACP+DHCP服务器发送中继能力指 示消息, 该中继能力指示消息中携带能力指示信息及网段标识。
可以理解的是, 当具有正式 IP地址的客户机被配置成可用 DHCP中继 器后, 该具有正式 IP地址的客户机也为可用 DHCP中继器。
步骤 510a: 判断设备触发 DHCP服务器启动后, DHCP服务器通过可 用的 DHCP中继器, 为待分配正式 IP地址的客户机分配正式 IP地址。
具体地, 由于网络***中存在了 DHCP中继器, 因此, 可以按照正常 的 DHCP流程分配 IP地址。
步驟 511a: 判断设备触发 DHCP服务器启动后, DHCP服务器直接为 待配置正式 IP地址的客户机分配正式 IP地址。
具体地,由于待分配 IP地址的客户机与 DHCP服务器在同一个网段内 , 因此, 可以按照正常的 DHCP流程分配 IP地址。
本实施例的技术方案, 通过将具有正式 IP地址的客户机配置成 DHCP 中继器, 可以在采用 DHCP配置 IP地址时, 无需在网络***中设置专用的 DHCP中继器, 实现网络投入及维护成本的降低;
进一步地, 本实施例在进行相关判断时采用网段标识, 可以适用于网 络***不进行 VLAN规划的场景;
另外, 本实施例在 IACP过程中的探测包中携带 IACP服务器和 DHCP 服务器的地址, 可以适用于 DHCP功能和 IACP功能分开设置于不同物理 实体的场景。
图 7a为本发明一实施例的方法流程示意图 ,本实施例以进行 VLAN规 划 , 且 IACP功能和 DHCP功能设置在同一个物理实体中为例。
图 8a为本发明一实施例对应的网络***结构示意图, 参见图 8a, 包括 至少一个的客户机 81a, 存在多个客户机 81a的情况下, 殳被分在不同的 VLAN 内。 该客户机 81a通过以太网 (Ethernet ) 82a及路由器 83a, 与 TACP+DHCP服务器 84a通信, 该 TACP+DHCP服务器 84可以具有 TACP 功能和 DHCP功能。 本实施例需要在待分配正式 IP地址的客户机所属网段 的所属 VLAN内, 配置 DHCP中继器。
本实施例中如果不进行特别说明, VLAN是指待分配正式 IP地址的客 户机所属网段的所属 VLAN。
参见图 7a, 本实施例包括:
步驟 701a: IACP+DHCP服务器启动后, 判断 IACP+DHCP服务器与 待分配正式 IP地址的客户机是否属于同一个网段, 若是, 执行步驟 711a, 否则, 执行步驟 702a。
其中, IACP+DHCP服务器中保存有客户机的相关信息, 该相关信息包 含客户机所属网段的网段标识, 因此, 该 IACP+DHCP服务器可以判断出 IACP+DHCP服务器与待分配正式 IP地址的客户机是否在同一个网段中。
步骤 702a: IACP+DHCP服务器判断待分配正式 IP地址的客户机所属 网段的所属 VLAN内是否存在可用的 DHCP中继器,若是,执行步驟 710a, 否则, 执行步骤 703a。
具体地 , 网络***中的具有正式 IP地址的客户机可以向 IACP+DHCP 服务器发送中继能力指示消息, 该中继能力指示消息中携带网段标识及 VLAN标识(网段标识 +VLAN标识)和能力指示信息。
因此, IACP+DHCP服务器可以釆用如下方式进行该 VLAN内是否存 在可用 DHCP中继器的判断:
当 IACP+DHCP服务器接收到客户机发送的中继能力指示消息, 该中 继能力指示消息中携带能力指示信息和网段标识 +VLAN标识, 当该能力指 示信息表明发送该中继能力指示消息的客户机具有中继能力, 且该网段标 识 +VLAN标识表明发送该正式 IP地址指示消息的客户机与该待配置正式 IP地址的客户机在同一个 VLAN时, 该 IACP+DHCP服务器得到该 VLAN 存在可用的 DHCP中继器; 可以理解的是, 这里的 "可用的 DHCP中继器" 可以是具有正式 TP地址的客户机配置而成的 DHCP中继器, 或者, 也可能 是现有技术中专用的 DHCP中继器。
当该 IACP+DHCP服务器未接收到该中继能力指示消息, 或者, 接收 到该中继能力指示消息但该能力指示信息表明发送该中继能力指示消息的 客户机不具有中继能力, 或者, 接收到该中继能力指示消息但该网段标识 +VLAN标识表明发送该正式 IP地址指示消息的客户机与该待配置正式 IP 地址的客户机不在同一个 VLAN时 , 该 IACP+DHCP服务器得到该 VLAN 内不存在可用的 DHCP中继器。
步骤 703a: IACP+DHCP 良务器判断该 VLAN内是否存在具有正式 IP 地址的客户机, 若是, 执行步驟 707a, 否则, 执行步驟 704a。
具体地, 网络***中的客户机在启动后 , 已被配置正式 IP地址(例如, 采用人工配置方式或者 DHCP配置方式) 的客户机可以向 IACP+DHCP服 务器发送正式 IP地址指示消息, 该正式 IP地址指示消息中携带网段标识 +VLAN标识。
因此 , IACP+DHCP服务器可以采用如下方式进行该网段内是否具有正 式 IP地址的客户机的判断:
当该 IACP+DHCP服务器接收到客户机发送的携带网段标识 +VLAN标 识的正式 IP地址指示消息, 且该网段标识 +VLAN标识表明发送该正式 IP 地址指示消息的客户机与该待配置正式 IP地址的客户机在同一个 VLAN 时,该 IACP+DHCP服务器得到该 VLAN内存在已被配置正式 IP地址的客 户机;
当该 IACP+DHCP服务器未接收到该正式 IP地址指示消息, 或者, 接 收到该正式 IP地址指示消息但该网段标识 +VLAN标识表明发送该正式 IP 地址指示消息的客户机与该待配置正式 IP地址的客户机不在同一个 VLAN 时,该 IACP+DHCP服务器得到该 VLAN内不存在已被配置正式 IP地址的 客户机。 步驟 704a: TACP+DHCP服务器采用 TACP为该 VLAN内的临时客户 机分配临时 IP地址。
具体地可以采用类似步驟 304a的实现流程,只是需要将步驟 304a中的 网段替换为待分配正式 IP地址的客户机所属的 VLAN。 步骤 705a: 临时客 户机根据探测包中的临时 IP地址、网关的 IP地址、网络掩码和 IACP+DHCP 服务器的 IP地址, 采用单播 DHCP过程, 从 IACP+DHCP服务器获取正式 IP地址。
具体地可以釆用类似步驟 305a的实现流程,只是需要将步骤 305a中的 网段替换为待分配正式 IP地址的客户机所属的 VLAN。
步驟 706a: 具有正式 IP地址的客户机向 IACP+DHCP服务器发送正式 IP地址指示消息, 该正式 IP地址指示消息中携带网段标识 +VLAN标识。
之后, 可以重复执行步骤 703a。
可以理解的是, 当临时客户机获取正式 IP地址后 , 该临时客户机也为 具有正式 IP地址的客户机。
步骤 707a: 与步骤 307a相同。
步驟 708a:具有正式 IP地址的客户机根据 DHCP配置信息将自身配置 成可用 DHCP中继器。
之后, 可以重复执行步骤 702a。
步骤 709a: 可用 DHCP中继器向 IACP+DHCP服务器发送中继能力指 示消息, 该中继能力指示消息中携带能力指示信息及网段标识 +VLAN标 识。
可以理解的是, 当具有正式 IP地址的客户机被配置成可用 DHCP中继 器后, 该具有正式 IP地址的客户机也为可用 DHCP中继器。
步骤 710a: 与步骤 310a相同。
步驟 71 la: IACP+DHCP服务器直接为待配置正式 IP地址的客户机分 配正式 IP地址。 具体地, 由于待分配 TP地址的客户机与 TACP+DHCP服务器在同一个 网段的同一个 VLAN内, 因此, 可以按照正常的 DHCP流程分配 IP地址。
本实施例的技术方案, 通过将具有正式 IP地址的客户机配置成 DHCP 中继器, 可以在采用 DHCP配置 IP地址时, 无需在网络***中设置专用的 DHCP中继器, 实现网络投入及维护成本的降低; 以适用于网络***进行 VLAN规划的场景;
另夕卜,本实施例在 IACP过程中的探测包中携带 IACP+DHCP服务器的 地址, 可以适用于 DHCP功能和 IACP功能合成在同一个物理实体的场景。
图 9a为本发明一实施例的方法流程示意图,本实施例以进行 VLAN规 划 , 且 IACP功能和 DHCP功能设置在不同的物理实体中为例。
图 10a为本发明一实施例对应的网络***结构示意图, 参见图 10a, 包 括至少一个的客户机 101a, 该客户机 101a通过以太网 (Ethernet ) 102a, 或者, 进一步通过网关 103a, 与 IACP服务器 104a及 DHCP服务器 105a 通信, 该 IACP服务器 104a具有 IACP功能, 该 DHCP服务器 105a具有 DHCP功能。 本实施例需要在待分配正式 IP地址的客户机所属的网段内 , 配置 DHCP中继器。
本实施例中如果不进行特别说明, VLAN是指待分配正式 IP地址的客 户机所属网段的所属 VLAN。
参见图 9a, 本实施例包括:
步驟 901a: DHCP服务器启动后 , 判断设备判断 DHCP服务器与待分 配正式 IP地址的客户机是否属于同一个网段,若是,执行步骤 911a, 否贝' J , 执行步驟 902a。
其中, 判断设备为服务端设备中的功能模块, 该判断设备可以位于 IACP服务器中, 或者, 位于 DHCP服务器中, 或者, 独立设置在 IACP服 务器和 DHCP服务器之外。 其中, 判断设备中保存有客户机的相关信息, 该相关信息包含客户机 所属网段的网段标识, 因此, 该判断设备可以判断出 DHCP服务器与待分 配正式 IP地址的客户机是否在同一个网段中。
步骤 902a: 判断设备判断待分配正式 IP地址的客户机所属网段的所属 VLAN内是否存在可用的 DHCP中继器, 若是, 执行步驟 910a, 否则, 执 行步骤 903a。
具体地, 网络***中的具有正式 IP地址的客户机可以向判断设备发送 中继能力指示消息,该中继能力指示消息中携带网段标识 +VLAN标识和能 力指示信息。
因此, 判断设备可以釆用如下方式进行该网段内是否存在可用 DHCP 中继器的判断:
当判断设备接收到客户机发送的中继能力指示消息 , 该中继能力指示 消息中携带能力指示信息和网段标识 +VLAN标识, 当该能力指示信息表明 发送该中继能力指示消息的客户机具有中继能力, 且该网段标识 +VLAN标 识表明发送该正式 IP地址指示消息的客户机与该待配置正式 IP地址的客户 机在同一个 VLAN时 ,该判断设备得到该 VLAN存在可用的 DHCP中继器; 可以理解的是, 这里的 "可用的 DHCP中继器" 可以是具有正式 IP地址的 客户机配置而成的 DHCP中继器,或者,也可能是现有技术中专用的 DHCP 中继器。
当该判断设备未接收到该中继能力指示消息, 或者, 接收到该中继能 力指示消息但该能力指示信息表明发送该中继能力指示消息的客户机不具 有中继能力, 或者, 接收到该中继能力指示消息但该网段标识 +VLAN标识 表明发送该正式 IP地址指示消息的客户机与该待配置正式 IP地址的客户机 不在同一个 VLAN时,该判断设备得到该 VLAN内不存在可用的 DHCP中 继器。
步骤 903a:判断设备判断该 VALN内是否存在具有正式 IP地址的客户 机, 若是, 执行步驟 907a, 否则, 执行步驟 904a。
具体地, 网络***中的客户机在启动后 , 已被配置正式 IP地址(例如, 采用人工配置方式或者 DHCP配置方式) 的客户机可以向判断设备发送正 式 IP地址指示消息 ,该正式 IP地址指示消息中携带网段标识 +VLAN标识。
因此 , 判断设备可以釆用如下方式进行该网段内是否具有正式 IP地址 的客户机的判断:
当该判断设备接收到客户机发送的携带网段标识 +VLAN标识的正式 IP地址指示消息 , 且该网段标识 +VLAN标识表明发送该正式 IP地址指示 消息的客户机与该待配置正式 IP地址的客户机在同一个 VLAN时,该判断 设备得到该 VLAN内存在已被配置正式 IP地址的客户机;
当该判断设备未接收到该正式 IP地址指示消息, 或者, 接收到该正式 IP地址指示消息但该网段标识 +VLAN标识表明发送该正式 IP地址指示消 息的客户机与该待配置正式 IP地址的客户机不在同一个 VLAN时,该判断 设备得到该 VLAN内不存在已被配置正式 IP地址的客户机。
步骤 904a:判断设备触发 IACP服务器启动后, IACP服务器采用 IACP 为该 VLAN内的临时客户机分配临时 IP地址。
具体地可以采用类似步骤 504a的实现流程,只是需要将步骤 504a中的 网段替换为待分配正式 IP地址的客户机所属的 VLAN。
步驟 905a: 临时客户机根据探测包中的临时 IP地址、 网关的 IP地址、 网络掩码和 DHCP服务器的 IP地址,采用单播 DHCP过程,从 DHCP服务 器获取正式 IP地址.
具体地可以采用类似步骤 505a的实现流程,只是需要将步骤 505a中的 网段替换为待分配正式 IP地址的客户机所属的 VLAN。
步骤 906a: 具有正式 IP地址的客户机向判断设备发送正式 IP地址指 示消息, 该正式 IP地址指示消息中携带网段标识。
之后, 可以重复执行步骤 803a。 可以理解的是, 当临时客户机获取正式 TP地址后 , 该临时客户机也为 具有正式 IP地址的客户机。
步驟 907a: 与步驟 507a相同。
步骤 908a:具有正式 IP地址的客户机根据 DHCP配置信息将自身配置 成可用 DHCP中继器。
之后, 可以重复执行步骤 902a。
步驟 909a: 可用 DHCP中继器向 IACP+DHCP服务器发送中继能力指 示消息, 该中继能力指示消息中携带能力指示信息及网段标识 +VLAN标 识。
可以理解的是, 当具有正式 IP地址的客户机被配置成可用 DHCP中继 器后, 该具有正式 IP地址的客户机也为可用 DHCP中继器。
步驟 910a: 与步驟 510a相同。
步骤 91 la: IACP+DHCP服务器直接为待配置正式 IP地址的客户机分 配正式 IP地址。
具体地, 由于待分配 IP地址的客户机与 IACP+DHCP服务器在同一个 网段的同一个 VLAN内, 因此, 可以按照正常的 DHCP流程分配 IP地址。 本实施例的技术方案, 通过将具有正式 IP地址的客户机配置成 DHCP中继 器,可以在釆用 DHCP配置 IP地址时,无需在网络***中设置专用的 DHCP 中继器, 实现网络投入及维护成本的降低; 以适用于网络***进行 VLAN规划的场景;
另外, 本实施例在 IACP过程中的探测包中携带 IACP服务器和 DHCP 服务器的地址, 可以适用于 DHCP功能和 IACP功能分开设置于不同物理 实体的场景。
图 11a为本发明一实施例的服务端设备结构示意图, 包括客户机确定 模块 l l la、 发送模块 112a和分配模块 113a。 客户机确定模块 1 1 1 a, 用于在待配置正式 TP地址的客户机所属的通信 范围内, 确定具有正式 IP地址的客户机, 该正式 IP地址为已配置的 IP地 址; 发送模块 112a, 用于向该客户机确定模块 111a确定的具有正式 IP地 址的客户机发送中继配置指示消息, 该中继配置指示消息中携带 DHCP配 置信息; 分配模块 113a用于当该具有正式 IP地址的客户机根据该 DHCP 配置信息将该具有正式 IP地址的客户机配置成 DHCP中继器后, 通过配置 成 DHCP中继器的客户机, 为该待配置正式 IP地址的客户机分配正式 IP 地址。
进一步地,本实施例还可以包括第一判断模块 114a,第一判断模块 114a 用于判断该通信范围内是否存在已被配置正式 IP地址的客户机; 。
其中, 客户机确定模块 111a可以包括第一单元 1111a和 /或第二单元 1112a; 第一单元 1111a, 用于当该第一判断模块 114a的判断结果为该通信 范围内存在已被配置正式 IP地址的客户机时 ,接收该已被配置正式 IP地址 的客户机发送的正式 IP地址指示消息,将发送该正式 IP地址指示消息的客 户机确定为具有正式 IP地址的客户机; 第二单元 1112a, 用于当第一判断 模块 1111a的判断结果为该通信范围内不存在已被配置正式 IP地址的客户 机时, 分配临时 IP地址, 并将分配到该临时 IP地址的客户机配置成具有正 式 IP地址的客户机。
具体地, 第二单元 1112a可以包括 IACP单元 1113a和 DHCP单元 1114a, IACP单元 1113a用于向该通信范围内发送探测包, 该探测包中携 带临时 IP地址、 该通信范围的网关的 IP地址、 月良务端设备的 IP地址和该 通信范围的网络掩码, 该临时 IP地址被配置给该通信范围内的客户机协商 确定的临时客户机; DHCP单元 1114a用于接收该临时客户机发送的单播 DHCP请求 , 并根据该单播 DHCP请求为该临时客户机分配正式 IP地址 , 将分配正式 IP地址后的临时客户机被确定为具有正式 IP地址的客户机,相 应的, 前述单播 DHCP请求是该临时客户机根据该临时 IP地址、 该通信范 围的网关的 TP地址、服务端设备的 TP地址和该通信范围的网络掩码发送的。 其中 ,本实施例中的该 IACP单元 1113a和 DHCP单元 1114a可以位于 同一个物理实体中; 此时, 该 IACP单元 1113a发送的服务端设备的 IP地 址为该物理实体的 IP地址。或者,本实施例的该 IACP单元 1113a和 DHCP 单元 1114a也可以位于不同的物理实体中, 此时, 该 IACP单元 1113a发送 的服务端设备的 IP地址包括该 IACP单元 1113a所属的物理实体的 IP地址 和该 DHCP单元 1114a所属的物理实体的 IP地址。
进一步地,本实施例还可以包括第二判断模块 115a,第二判断模块 115a 用于判断该通信范围内是否存在可用的 DHCP 中继器; 该第一判断模块 114a具体用于当该第二判断模块 115a判断得到该通信范围内不存在可用的 DHCP中继器时, 判断该通信范围内是否存在已被配置正式 IP地址的客户 机。进一步地,本实施例还可以包括第三判断模块 116a,第三判断模块 116a 用于判断该服务端设备与该待配置正式 IP地址的客户机是否在同一个网段 中;该第二判断模块 115a具体用于当该第三判断模块 116a判断得到该服务 端设备与该待配置 IP地址的客户机不在同一个网段中时, 判断该通信范围 内是否存在可用的 DHCP中继器。
本实施例通过将具有正式 IP地址的客户机配置成 DHCP中继器, 可以 在釆用 DHCP配置 IP地址时 ,无需在网络***中设置专用的 DHCP中继器, 实现网络投入及维护成本的降低;本实施例在 IACP过程中的探测包中携带 IACP单元及 DHCP单元所属物理实体的地址, 可以适用于 DHCP功能和 IACP功能合成在同一个物理实体或者分开在不同物理实体的场景。
图 12a为本发明一实施例的客户机结构示意图, 包括接收模块 121a、 配置模块 122a和中继模块 123a。
接收模块 121a, 用于接收服务端设备发送的中继配置指示消息, 该中 继配置指示消息中携带 DHCP配置信息; 配置模块 122a, 用于根据该接收 模块 121a接收到的中继配置指示消息中携带的 DHCP配置信息将本机配置 成 DHCP中继器; 中继模块 123a用于提供 DHCP中继功能, 实现该服务端 设备为待配置正式 IP地址的客户机分配正式 IP地址。
进一步地, 本实施例还可以包括地址获取模块 124a和指示模块 125a, 地址获取模块 124a用于获取正式 IP地址; 指示模块 125a, 用于在地址获 取模块 124a获取正式 IP地址后 , 向该服务端设备发送正式 IP地址指示消 息, 相应的, 前述中继配置指示消息为该良务端设备在接收到该正式 IP地 址指示消息后发送的。
其中, 该地址获取模块 124a 可以包括第三单元 1241a 和第四单元 1242a, 第三单元 1241a用于接收该服务端设备发送的探测包, 该探测包中 携带临时 IP地址、 该通信范围的网关的 IP地址、 月良务端设备的 IP地址和 该通信范围的网络掩码; 第四单元 1242a, 用于根据该第三单元 1241a接收 的探测包中携带的临时 IP地址、该通信范围的网关的 IP地址、服务端设备 的 IP地址和该通信范围的网络掩码,向该服务端设备发送单播 DHCP请求, 接收该服务端设备根据该单播 DHCP请求分配的正式 IP地址。
其中, 客户机向服务器发送相关判断信息时携带网段标识, 或者, 网 段标识及 VLAN标识。 即, 当未规划 VLAN时, 需要判断的是: 本实施例 的该客户机与该待配置正式 IP地址的客户机是否在同一个网段内; 当规划 VLAN时, 需要判断的是: 本实施例的该客户机与该待配置正式 IP地址的 客户机在同一个网段的同一个 VLAN内。
本实施例通过将具有正式 IP地址的客户机配置成 DHCP中继器, 可以 在釆用 DHCP配置 IP地址时,无需在网络***中设置专用的 DHCP中继器, 实现网络投入及维护成本的降低; 本实施例在进行相关判断时采用网段标 识或者网段标识及 VLAN标识 , 可以适用于网络***不进行 VLAN规划或 者进行 VLAN规划的场景。
图 13a为本发明一实施例的通信***结构示意图,包括月良务端设备 131a 和客户机 132a, 其中, 服务端设备 131a可以如图 11a所示, 客户机 132a 可以如图 12a所示。 另外, 关于服务端设备和客户机的具体描述, 可参见 相关的设备实施例和 /或方法实施例。
另外, 关于服务端设备和客户机实施例, 也可参见相关方法实施例, 即, 设备实施例提供的设备可以实现方法实施例中的流程或功能。
本实施例通过将具有正式 IP地址的客户机配置成 DHCP中继器, 可以 在采用 DHCP配置 IP地址时 ,无需在网络***中设置专用的 DHCP中继器, 实现网络投入及维护成本的降低; 本实施例在进行相关判断时采用网段标 识或者网段标识及 VLAN标识 , 可以适用于网络***不进行 VLAN规划或 者进行 VLAN规划的场景。
本领域普通技术人员可以理解: 实现上述方法实施例的全部或部分步 驟可以通过程序指令相关的硬件来完成, 前述的程序可以存储于一计算机 可读取存储介质中, 该程序在执行时, 执行包括上述方法实施例的步驟; 而前述的存储介质包括: ROM、 RAM, 磁碟或者光盘等各种可以存储程序 代码的介质。
最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非对 其限制; 尽管参照前述实施例对本发明进行了详细的说明, 本领域的普通 技术人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修 改, 或者对其中部分技术特征进行等同替换; 而这些修改或者替换, 并不 使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。

Claims

权利要求
1. 一种 IP地址自动分配方法, 其特征在于, 所述的方法包括: 客户端获取包括未分配 IP地址的 IP 文;
所述客户端探测获取到的 ΙΡ ·¾文中的未分配 IP地址是否被占用; 如果未分配 IP地址没有被占用 , 则判断是否由所述客户端获得所述的 未分配 IP地址, 如果是, 则获得所述的未分配 IP地址。
2. 根据权利要求 1所述的 IP地址自动分配方法, 其特征在于, 当所述客户端和 IP地址分配服务器不在同一个网段时, 所述客户端获 取包括未分配 IP地址的 IP ^艮文包括: 所述客户端接收所述客户端所在网 段的接入路由器发送的第一地址解析协议 ARP请求包, 所述 ARP请求包包 括所述未分配 IP地址; 或
当所述客户端和 IP地址分配服务器在同一个网段时, 所述客户端获取 包括未分配 IP地址的 IP >¾文包括: 所述客户端接收所述 IP地址分配服务 器发送的第二 ARP请求包, 所述 ARP请求包包括所述未分配 IP地址。
3. 根据权利要求 1或 2所述的 IP地址自动分配方法, 其特征在于, 所述客户端探测获取到的 IP报文中的未分配 IP地址是否被占用包括: 向所述客户端所在网段的其他节点发送包括所述未分配 IP地址的探测 消息;
根据所述客户端所在网段的其他节点回复的响应消息探测所述的未分 配 IP地址是否被占用。
4. 根据权利要求 1至 3任一项所述的 IP地址自动分配方法, 其特征 在于, 所述判断是否由所述客户端获得所述的未分配 IP地址包括:
根据接收的其他客户端发送的免费 ARP请求包承载的比对信息, 判断 是否由所述客户端获得所述的未分配 IP地址。
5. 根据权利要求 1至 4任一项所述的 IP地址自动分配方法, 其特征 在于, 在获得所述的未分配 IP地址之后, 所述方法还包括: 所述客户端在所述客户端所在网段广播所述未分配 IP地址已经被占用 的响应消息; 和 /或,
所述客户端向 IP分配服务器发送所述未分配 IP地址已被分配的确认 消息。
6. 一种 I P地址客户端, 其特征在于, 所述的客户端包括:
IP报文获取单元, 用于获取包括未分配 IP地址的 IP报文;
IP地址探测单元, 用于探测所述 IP报文获取单元获取到的 IP报文中 的未分配 IP地址是否被占用;
判断单元, 用于在所述 IP地址探测单元探测到未分配 IP地址没有被 占用时, 判断是否由所述客户端获得所述的未分配 IP地址。
7. 才艮据权利要求 6所述的 IP地址客户端, 其特征在于, 所述 IP地址 探测单元包括:
探测消息发送模块, 用于向所述客户端所在网段的其他节点发送包括 未分配 IP地址的探测消息;
响应消息探测模块, 用于根据所述客户端所在网段的其他节点回复的 响应消息 , 探测所述的未分配 IP地址是否被占用。
8. 根据权利要求 6或 Ί所述的 IP地址客户端, 其特征在于, 所述判 断单元包括:
第一模块, 用于接收其他客户端发送的免费 ARP请求包;
第二模块, 用于根据第一模块接收的其他客户端发送的免费 ARP请求 包承载的比对信息, 判断是否由所述客户端获得所述的未分配 IP地址。
9. 根据权利要求 6至 8任一项所述的 IP地址客户端, 其特征在于, 所述客户端还包括:
响应消息发送单元, 用于在所述客户端获得 IP地址后, 在所述客户端 所在网段广播所述未分配 IP地址已经被占用的响应消息; 和 /或,
确认消息发送单元, 用于在所述客户端获得 IP地址后, 向 IP分配服 务器发送所述未分配 IP地址已被分配的确认消息。
10. —种 IP地址自动分配方法, 其特征在于, 所述的方法包括:
IP地址分配服务器生成包括未分配 IP地址的 IP报文;
所述 IP地址分配服务器将所述 IP报文发送至所述的未分配 IP地址所 在的网段, 所述网段中存在未被分配 IP地址的客户端;
所述 IP地址分配服务器接收所述未分配 IP地址已被分配的确认消息。
11. 根据权利要求 10所述的 IP地址自动分配方法, 其特征在于, 当 所述未被分配 IP地址的客户端和所述 IP地址分配服务器不在同一个网段 时, 所述生成包括未分配 IP地址的 IP ^艮文包括: 4艮据未分配 IP地址的列 表生成包括未分配 IP地址的探测 IP包;
所述将所述 IP "¾文发送至所述的未分配 IP地址所在的网段包括: 将 所述探测 IP包发送至所述的未分配 IP地址所在的网段的接入路由器。
12. 根据权利要求 10或 11所述的 IP地址自动分配方法,其特征在于, 当所述未被分配 IP地址的客户端和所述 IP地址分配服务器在同一个网段 时, 所述生成包括未分配 IP地址的 IP报文包括: 生成包括未分配 IP地址 的 ARP请求包;
所述将所述 IP ^艮文发送至所述的未分配 IP地址所在的网段包括: 将 所述 ARP请求包发送至所述的未分配 IP地址所在的网段的客户端。
13. 根据权利要求 10至 12任一项所述的 IP地址自动分配方法, 其特 征在于, 在所述接收所述未分配 IP地址已被分配的确认消息之前, 所述的 方法还包括:
接收获得 IP地址的客户端发送的所述未分配 IP地址已经被占用的响 应消息;
根据接收到的响应消息, 将所述未分配 IP地址所在的网段的掩码、 网 关 IP地址以及 IP分配服务器的 IP地址发送至所述的获得 IP地址的客户 端。
14. 根据权利要求 10至 13任一项所述的 IP地址自动分配方法, 其特 征在于, 在接收所述未分配 IP地址已被分配的确认消息之后, 所述的方法 还包括:
根据接收到的所述未分配 IP地址已被分配的确认消息,刷新未分配 IP 地址的列表。
15. —种 IP地址分配服务器, 其特征在于, 所述的服务器包括:
IP报文生成单元, 用于生成包括未分配 IP地址的 IP报文;
IP 文发送单元,用于将所述 文生成单元生成的 IP 文发送至所述 的未分配 IP地址所在的网段, 所述网段中存在未被分配 IP地址的客户端; 确认消息接收单元 ,用于接收所述未分配 IP地址已被分配的确认消息。
16. 根据权利要求 15所述的 IP地址分配服务器, 其特征在于, 所述 的 IP 文生成单元包括:
探测 IP包生成模块, 用于在所述未被分配 IP地址的客户端和所述 IP 地址分配服务器不在同一个网段时, 根据未分配 IP地址的列表生成包括未 分配 IP地址的探测 IP包;
所述 IP报文发送单元, 用于将所述探测 IP包生成模块生成的探测 IP 包, 发送至所述的未分配 IP地址所在的网段的接入路由器。
17. 根据权利要求 15或 16所述的 IP地址分配服务器, 其特征在于, 所述的 IP 文生成单元包括:
ARP请求包生成模块, 用于在所述未被分配 IP地址的客户端和所述 IP 地址分配服务器在同一个网段时, 生成包括未分配 IP地址的 ARP请求包; 所述 IP 文发送单元, 用于将所述 ARP请求包生成模块生成的 ARP请 求包发送至所述的未分配 IP地址所在的网段的客户端。
18. 根据权利要求 15至 17任一项所述的 IP地址分配服务器, 其特征 在于, 所述的服务器还包括:
响应消息接收单元, 用于接收获得 IP地址的客户端发送的所述未分配 IP地址已经被占用的响应消息;
IP信息发送单元,用于根据接收到的所述未分配 IP地址已经被占用的 响应消息,将所述未分配 IP地址所在的网段的掩码、 网关 IP地址以及 IP 分配服务器的 IP地址发送至所述的获得 IP地址的客户端。
19、 一种 IP地址自动配置方法, 其特征在于, 包括:
服务端设备在待配置正式 IP地址的客户机所属的通信范围内 , 确定具 有正式 IP地址的客户机, 所述正式 IP地址为已配置的 IP地址;
所述服务端设备向所述具有正式 IP地址的客户机发送中继配置指示消 息, 所述中继配置指示消息中携带动态主机配置协议 DHCP配置信息; 当所述具有正式 IP地址的客户机根据所述 DHCP配置信息将本机配置 成 DHCP中继器后, 所述服务端设备通过配置成 DHCP中继器的客户机, 为所述待配置正式 IP地址的客户机分配正式 IP地址。
20、 根据权利要求 19所述的方法, 其特征在于, 还包括:
所述服务端设备判断所述通信范围内是否存在已被配置正式 IP地址的 客户机;
当所述判断的结果为所述通信范围内存在已被配置正式 IP地址的客户 机时, 所述服务端设备确定具有正式 IP地址的客户机包括:
所述服务端设备接收所述已被配置正式 IP地址的客户机发送的正式 IP 地址指示消息, 将发送所述正式 IP地址指示消息的客户机确定为具有正式 IP地址的客户机;
和 /或,
当所述判断的结果为所述通信范围内不存在已被配置正式 IP地址的客 户机时, 所述服务端设备确定具有正式 IP地址的客户机包括:
所述良务端设备分配临时 IP地址,并将分配到所述临时 IP地址的客户 机配置成具有正式 IP地址的客户机。
21、 根据权利要求 20所述的方法, 其特征在于, 所述服务端设备判断 所述通信范围内是否存在已被配置正式 TP地址的客户机包括: 当所述服务端设备接收到客户机发送的携带通信范围信息的正式 IP地 址指示消息, 且所述通信范围信息表明发送所述正式 IP地址指示消息的客 户机与所述待配置正式 IP地址的客户机在同一个通信范围时, 所述服务端 设备判断得到所述通信范围内存在已被配置正式 IP地址的客户机;
和 /或,
当所述服务端设备未接收到所述正式 IP地址指示消息, 或者, 接收到 所述正式 IP地址指示消息但所述通信范围信息表明发送所述正式 IP地址指 示消息的客户机与所述待配置正式 IP 地址的客户机不在同一个通信范围 时, 所述服务端设备判断得到所述通信范围内不存在已被配置正式 IP地址 的客户机。
22、 根据权利要求 20所述的方法, 其特征在于, 所述服务端设备分配 临时 IP地址, 并将分配到所述临时 IP地址的客户机配置成具有正式 IP地 址的客户机包括:
所述服务端设备向所述通信范围内发送探测包 , 所述探测包中携带临 时 IP地址、 所述通信范围的网关的 IP地址、 服务端设备的 IP地址和所述 通信范围的网络掩码, 所述临时 IP地址被配置给所述通信范围内的客户机 协商确定的临时客户机;
所述服务端设备接收所述临时客户机发送的单播 DHCP请求, 并根据 所述单播 DHCP请求为所述临时客户机分配正式 IP地址, 将分配正式 IP 地址后的临时客户机确定为具有正式 IP地址的客户机, 所述单播 DHCP请 求是所述临时客户机根据所述临时 IP地址、所述通信范围的网关的 IP地址、 服务端设备的 IP地址和所述通信范围的网络掩码发送的。
23、 根据权利要求 22所述的方法, 其特征在于,
当所述服务端设备包括用于分配临时 IP 地址的自动地址分配协议 IACP单元和用于分配正式 IP地址的 DHCP单元,且所述 IACP单元和 DHCP 单元位于同一个物理实体中时, 所述服务端设备的 TP地址为所述物理实体 的 IP地址;
或者,
当所述服务端设备包括用于分配临时 IP地址的 IACP单元和用于分配 正式 IP地址的 DHCP单元, 且所述 IACP单元和 DHCP单元位于不同的物 理实体中时, 所述服务端设备的 IP地址包括所述 IACP单元所属的物理实 体的 IP地址和所述 DHCP单元所属的物理实体的 IP地址。
24、 根据权利要求 20所述的方法, 其特征在于, 还包括:
所述服务端设备判断所述通信范围内是否存在可用的 DHCP中继器; 当所述通信范围内不存在可用的 DHCP中继器时, 所述服务端设备执 行判断所述通信范围内是否存在已被配置正式 IP地址的客户机的操作。
25、 根据权利要求 24所述的方法, 其特征在于, 所述服务端设备判断 所述通信范围内是否存在可用的 DHCP中继器包括:
所述服务端设备接收到客户机发送的中继能力指示消息, 所述中继能 力指示消息中携带能力指示信息和通信范围信息, 当所述能力指示信息表 明发送所述中继能力指示消息的客户机具有 DHCP中继能力, 且所述通信 范围信息表明发送所述正式 IP地址指示消息的客户机与所述待配置正式 IP 地址的客户机在同一个通信范围时 , 所述服务端设备判断得到所述通信范 围内存在可用的 DHCP中继器;
和 /或,
当所述服务端设备未接收到所述中继能力指示消息, 或者, 接收到所 述中继能力指示消息但所述能力指示信息表明发送所述中继能力指示消息 的客户机不具有 DHCP中继能力, 或者, 接收到所述中继能力指示消息但 所述通信范围信息表明发送所述正式 IP地址指示消息的客户机与所述待配 置正式 IP地址的客户机不在同一个通信范围时, 所述服务端设备判断得到 所述通信范围内不存在可用的 DHCP中继器。
26、 根据权利要求 24所述的方法, 其特征在于, 还包括: 所述服务端设备判断所述服务端设备与所述待配置正式 IP地址的客户 机是否在同一个网段中;
当所述服务端设备与所述待配置 IP地址的客户机不在同一个网段中 时, 所述服务端设备执行判断所述通信范围内是否存在可用的 DHCP中继 器的操作。
27、 根据权利要求 19至 26任一项所述的方法, 其特征在于, 当未规划虚拟局域网 VLAN时, 所述通信范围信息为发送所述通信范 围信息的客户机所属的网段的网段标识; 和 /或,
当规划 VLAN时, 所述通信范围信息为发送所述通信范围信息的客户 机所属网段的网段标识及所属 VLAN的 VLAN标识。
28、 一种 IP地址自动配置方法, 其特征在于, 包括:
已具有正式 IP 地址的客户机接收服务端设备发送的中继配置指示消 息, 所述中继配置指示消息中携带动态主机配置协议 DHCP配置信息, 所 述已具有正式 IP地址的客户机与待配置正式 IP地址的客户机在同一个通信 范围内;
所述已具有正式 IP地址的客户机根据所述 DHCP配置信息将本机配置 成 DHCP中继
配置成 DHCP中继器的客户机提供 DHCP中继功能, 实现所述服务端 设备为所述待配置正式 IP地址的客户机分配正式 IP地址。
29、 根据权利要求 28所述的方法, 其特征在于, 还包括:
所述已具有正式 IP地址的客户机在具有正式 IP地址之前,还包括获取 正式 IP地址的步驟;
在获取正式 IP地址后, 向所述良务端设备发送正式 IP地址指示消息, 所述中继配置指示消息为所述服务端设备在接收到所述正式 IP地址指示消 息后发送。
30、根据权利要求 29所述的方法, 其特征在于, 所述获取正式 TP地址 的步骤包括:
所述客户机接收所述服务端设备发送的探测包 , 所述探测包中携带临 时 IP地址、 所述通信范围的网关的 IP地址、 月良务端设备的 IP地址和所述 通信范围的网络掩码;
所述客户机根据所述临时 IP地址、所述通信范围的网关的 IP地址、服 务端设备的 IP地址和所述通信范围的网络掩码, 向所述服务端设备发送单 播 DHCP请求 , 接收所述服务端设备根据所述单播 DHCP请求为所述客户 机分配的正式 IP地址。
31、 一种服务端设备, 其特征在于, 包括:
客户机确定模块, 用于在待配置正式 IP地址的客户机所属的通信范围 内, 确定具有正式 IP地址的客户机, 所述正式 IP地址为已配置的 IP地址; 发送模块, 用于向所述客户机确定模块确定的具有正式 IP地址的客户 机发送中继配置指示消息, 所述中继配置指示消息中携带动态主机配置协 议 DHCP配置信息;
分配模块, 用于当所述具有正式 IP地址的客户机根据所述 DHCP配置 信息将本机配置成 DHCP中继器后, 通过配置成 DHCP中继器的客户机, 为所述待配置正式 IP地址的客户机分配正式 IP地址。
32、 根据权利要求 31所述的设备, 其特征在于, 还包括:
第一判断模块, 用于判断所述通信范围内是否存在已被配置正式 IP地 址的客户机;
所述客户机确定模块包括: 第一单元和 /或第二单元;
所述第一单元用于当所述第一判断模块的判断结果为所述通信范围内 存在已被配置正式 IP地址的客户机时,接收所述已被配置正式 IP地址的客 户机发送的正式 IP地址指示消息,将发送所述正式 IP地址指示消息的客户 机确定为具有正式 IP地址的客户机; 所述第二单元用于当所述第一判断模块的判断结果为所述通信范围内 不存在已被配置正式 IP地址的客户机时, 分配临时 IP地址, 并将分配到所 述临时 IP地址的客户机配置成具有正式 IP地址的客户机。
33、 根据权利要求 32所述的设备, 其特征在于, 所述第二单元包括: 自动地址分配协议 IACP单元, 用于向所述通信范围内发送探测包, 所 述探测包中携带临时 IP地址、所述通信范围的网关的 IP地址、服务端设备 的 IP地址和所述通信范围的网络掩码,所述临时 IP地址被配置给所述通信 范围内的客户机协商确定的临时客户机;
DHCP单元, 用于接收所述临时客户机发送的单播 DHCP请求, 并根 据所述单播 DHCP请求为所述临时客户机分配正式 IP地址,将分配正式 IP 地址后的临时客户机确定为具有正式 IP地址的客户机, 所述单播 DHCP请 求是所述临时客户机根据所述临时 IP地址、所述通信范围的网关的 IP地址、 服务端设备的 IP地址和所述通信范围的网络掩码发送的。
34、 根据权利要求 33所述的设备, 其特征在于,
所述 IACP单元和 DHCP单元位于同一个物理实体中;所述 IACP单元 发送的服务端设备的 IP地址为所述物理实体的 IP地址;
或者,
所述 IACP单元和 DHCP单元位于不同的物理实体中;所述 IACP单元 发送的服务端设备的 IP地址包括所述 IACP单元所属的物理实体的 IP地址 和所述 DHCP单元所属的物理实体的 IP地址。
35、 根据权利要求 32所述的设备, 其特征在于, 还包括:
第二判断模块, 用于判断所述通信范围内是否存在可用的 DHCP中继 器;
所述第一判断模块具体用于当所述第二判断模块判断得到所述通信范 围内不存在可用的 DHCP中继器时, 判断所述通信范围内是否存在已被配 置正式 IP地址的客户机。
36、 根据权利要求 35所述的设备, 其特征在于, 还包括:
第三判断模块, 用于判断所述服务端设备与所述待配置正式 IP地址的 客户机是否在同一个网段中;
所述第二判断模块具体用于当所述第三判断模块判断得到所述服务端 设备与所述待配置 IP地址的客户机不在同一个网段中时, 判断所述通信范 围内是否存在可用的 DHCP中继器。
37、 一种客户机, 其特征在于, 包括:
接收模块, 用于接收服务端设备发送的中继配置指示消息, 所述中继 配置指示消息中携带动态主机配置协议 DHCP配置信息;
配置模块, 用于根据所述接收模块接收到的中继配置指示消息中携带 的所述 DHCP配置信息将本机配置成 DHCP中继器;
中继模块, 用于提供 DHCP中继功能, 实现所述服务端设备为待配置 正式 IP地址的客户机分配正式 IP地址。
38、 根据权利要求 37所述的客户机, 其特征在于, 还包括:
地址获取模块 , 用于获取正式 IP地址;
指示模块, 用于在所述地址获取模块获取正式 IP地址后, 向所述服务 端设备发送正式 IP地址指示消息, 所述中继配置指示消息为所述服务端设 备在接收到所述正式 IP地址指示消息后发送。
39、 根据权利要求 38所述的客户机, 其特征在于, 所述地址获取模块 包括:
第三单元, 用于接收所述服务端设备发送的探测包, 所述探测包中携 带临时 IP地址、 所述通信范围的网关的 IP地址、 服务端设备的 IP地址和 所述通信范围的网络掩码;
第四单元, 用于根据所述第三单元接收的探测包中携带的所述临时 IP 地址、所述通信范围的网关的 IP地址、服务端设备的 IP地址和所述通信范 围的网络掩码, 向所述服务端设备发送单播 DHCP请求, 接收所述服务端 设备根据所述单播 DHCP请求分配的正式 TP地址。
40、 一种通信***, 其特征在于, 包括: 如权利要求 31-36任一项所述的服务端设备; 以及,
如权利要求 37-39任一项所述的客户机。
PCT/CN2010/076796 2009-09-11 2010-09-10 Ip地址自动分配方法、设备和*** WO2011029406A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP10815008.7A EP2477361B1 (en) 2009-09-11 2010-09-10 Ip address automatic assignment method, equipment and system
US13/416,661 US9900183B2 (en) 2009-09-11 2012-03-09 IP address automatic assignment method, device, and system

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN 200910170885 CN101656763B (zh) 2009-09-11 2009-09-11 一种ip地址自动分配方法、客户端及服务器
CN200910170885.9 2009-09-11
CN200910215385.2 2009-12-31
CN200910215385.2A CN102118453B (zh) 2009-12-31 2009-12-31 Ip地址自动配置方法、服务端设备、客户机和通信***

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US13/416,661 Continuation US9900183B2 (en) 2009-09-11 2012-03-09 IP address automatic assignment method, device, and system

Publications (1)

Publication Number Publication Date
WO2011029406A1 true WO2011029406A1 (zh) 2011-03-17

Family

ID=43732019

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/076796 WO2011029406A1 (zh) 2009-09-11 2010-09-10 Ip地址自动分配方法、设备和***

Country Status (3)

Country Link
US (1) US9900183B2 (zh)
EP (1) EP2477361B1 (zh)
WO (1) WO2011029406A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102413205A (zh) * 2011-12-23 2012-04-11 华为技术有限公司 一种ip地址分配方法及相关中继设备、服务器和***
US11431674B2 (en) * 2020-12-04 2022-08-30 EMC IP Holding Company LLC Method, device, and program product for managing address of device in network
CN115550319A (zh) * 2022-11-24 2022-12-30 新华三信息技术有限公司 一种地址分配方法及装置

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102209363B (zh) * 2011-05-18 2015-05-20 中兴通讯股份有限公司 一种在操作维护中心配置到基站路由的实现方法及***
US20130283050A1 (en) * 2012-04-23 2013-10-24 Anil Gupta Wireless client authentication and assignment
KR102043099B1 (ko) * 2013-05-02 2019-11-11 삼성전자주식회사 Ip 기반의 네트워크에서 이동성 관리 방법 및 장치
US9596209B2 (en) * 2014-10-17 2017-03-14 Aruba Netwroks, Inc. Causing client device to request a new internet protocol address based on a link local address
EP3073774A1 (en) 2015-03-23 2016-09-28 Thomson Licensing Automatic configuration of a wireless residential access network
CN106254567A (zh) * 2015-06-15 2016-12-21 中兴通讯股份有限公司 一种获取地址的方法和装置
CN107809495B (zh) * 2016-09-09 2021-06-22 华为技术有限公司 地址管理方法及装置
CN107948344B (zh) * 2018-01-12 2022-02-18 上海市共进通信技术有限公司 快速分配ip地址的方法
RU2679962C1 (ru) * 2018-02-20 2019-02-14 Акционерное общество "Российская корпорация ракетно-космического приборостроения и информационных систем" (АО "Российские космические системы") Способ назначения IP-адресов в сети персональной спутниковой связи на низкоорбитальных спутниках ретрансляторах с зональной регистрацией абонентских терминалов
US20200044917A1 (en) * 2018-07-31 2020-02-06 Ciena Corporation Zero touch provisioning script to provision network elements over unnumbered interfaces
CN109951871B (zh) * 2019-04-04 2021-05-11 乐鑫信息科技(上海)股份有限公司 节点冲突的检测方法、装置、终端及存储介质
CN113746653A (zh) * 2020-05-29 2021-12-03 中兴通讯股份有限公司 网关配置方法、客户机、服务器和存储介质
CN111629083B (zh) * 2020-06-01 2023-06-27 瑞斯康达科技发展股份有限公司 一种获取ip地址的方法、装置、存储介质和电子装置
US11750560B2 (en) 2021-04-15 2023-09-05 Ciena Corporation Zero Touch Provisioning for a network element over IPv6 unnumbered interfaces in OSPFv3 networks
CN113573023B (zh) * 2021-07-27 2022-12-20 长视科技股份有限公司 摄像机配网方法、装置、计算机设备和存储介质
US11765128B2 (en) * 2021-12-07 2023-09-19 Arris Enterprises Llc DHCP server IP address allocation improvement to nullify the impact of mac randomization
CN114301876B (zh) * 2021-12-23 2023-11-21 深圳创维数字技术有限公司 地址分配方法、***、设备及计算机可读存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1567824A (zh) * 2003-06-17 2005-01-19 港湾网络有限公司 网络节点通用标签分配方法
KR20060039999A (ko) * 2004-11-04 2006-05-10 한국전자통신연구원 이더넷 기반 수동형 광가입자망에서의 동적 ip 할당 방법
CN101656763A (zh) * 2009-09-11 2010-02-24 华为技术有限公司 一种ip地址自动分配方法、客户端及服务器

Family Cites Families (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3112160B2 (ja) * 1997-09-29 2000-11-27 日本電気株式会社 ネットワークアドレス重複装置の自動検出方式
US7281036B1 (en) * 1999-04-19 2007-10-09 Cisco Technology, Inc. Method and apparatus for automatic network address assignment
US7007080B2 (en) * 1999-12-23 2006-02-28 Solution Inc Limited System for reconfiguring and registering a new IP address for a computer to access a different network without user intervention
JP3800038B2 (ja) 2001-06-08 2006-07-19 ティアック株式会社 ネットワーク装置及びサーバ装置及びクライアント装置及びネットワークのipアドレス付与方法及びプログラム
CN1189825C (zh) 2002-03-29 2005-02-16 华为技术有限公司 虚拟局域网接入中的一种ip地址分配方法
US20030236865A1 (en) 2002-06-20 2003-12-25 Microsoft Corporation Method and system for configuring remote access to a server
US7430614B2 (en) * 2003-10-31 2008-09-30 Redback Networks, Inc. Use of IP address blocks with default interfaces in a router
US8230067B2 (en) * 2003-10-31 2012-07-24 Ericsson Ab DHCP proxy in a subscriber environment
CA2457368C (en) * 2004-02-11 2013-01-08 Solutioninc Limited A server, system and method for providing access to a public network through an internal network of a multi-system operator
US7366182B2 (en) * 2004-08-13 2008-04-29 Qualcomm Incorporated Methods and apparatus for efficient VPN server interface, address allocation, and signaling with a local addressing domain
CN100592700C (zh) * 2005-03-10 2010-02-24 惠普开发有限公司 服务器***、服务器设备及其方法
CN100502413C (zh) 2005-10-12 2009-06-17 华为技术有限公司 Dhcp中继为dhcp客户端请求ip地址的方法
CN1845554B (zh) 2005-12-06 2010-05-05 华为技术有限公司 一种在3g网络中动态分配ip地址的控制方法
US8223716B2 (en) 2006-12-05 2012-07-17 Toshiba America Research, Inc. Assisted proactive IP address acquisition
CN101247356B (zh) 2007-02-13 2011-02-16 华为技术有限公司 Dhcp消息传送的方法及***
CN101287017B (zh) 2008-05-19 2013-12-25 郑宽永 主动式ip地址分配方法及***
US8549118B2 (en) * 2009-12-10 2013-10-01 At&T Intellectual Property I, L.P. Updating a domain name server with information corresponding to dynamically assigned internet protocol addresses
US8571022B1 (en) * 2010-04-19 2013-10-29 Sprint Spectrum L.P. Packet filtering by session setup association in a wireless communication system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1567824A (zh) * 2003-06-17 2005-01-19 港湾网络有限公司 网络节点通用标签分配方法
KR20060039999A (ko) * 2004-11-04 2006-05-10 한국전자통신연구원 이더넷 기반 수동형 광가입자망에서의 동적 ip 할당 방법
CN101656763A (zh) * 2009-09-11 2010-02-24 华为技术有限公司 一种ip地址自动分配方法、客户端及服务器

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"Request for Comments: 2131; Dynamic Host Configuration Protocol", NETWORK WORKING GROUP, March 1997 (1997-03-01), Retrieved from the Internet <URL:http://datatracker.ietf.org/doc/rfc2131> [retrieved on 20101101] *
See also references of EP2477361A4 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102413205A (zh) * 2011-12-23 2012-04-11 华为技术有限公司 一种ip地址分配方法及相关中继设备、服务器和***
US11431674B2 (en) * 2020-12-04 2022-08-30 EMC IP Holding Company LLC Method, device, and program product for managing address of device in network
CN115550319A (zh) * 2022-11-24 2022-12-30 新华三信息技术有限公司 一种地址分配方法及装置
CN115550319B (zh) * 2022-11-24 2023-03-28 新华三信息技术有限公司 一种地址分配方法及装置

Also Published As

Publication number Publication date
EP2477361A1 (en) 2012-07-18
EP2477361B1 (en) 2016-03-02
US20120173646A1 (en) 2012-07-05
EP2477361A4 (en) 2013-02-27
US9900183B2 (en) 2018-02-20

Similar Documents

Publication Publication Date Title
WO2011029406A1 (zh) Ip地址自动分配方法、设备和***
JP4723653B2 (ja) Ipアドレス割り当て方法およびその使用
JP4077330B2 (ja) データ生成装置
WO2008131634A1 (fr) Procédé et appareil permettant d&#39;envoyer et de recevoir des paquets multidiffusion
WO2012079474A1 (zh) 地址分配处理方法、装置和***
US20150180717A1 (en) Configuring virtual router redundancy protocol backup group
US9866522B2 (en) Method to control dynamic host configuration protocol pool exhaustion in dynamic network environments
US9756148B2 (en) Dynamic host configuration protocol release on behalf of a user
CN113194462B (zh) 节点地址分配方法、装置、存储介质及电子设备
CN106878480B (zh) 一种dhcp服务进程共享方法及装置
KR101358775B1 (ko) 사용자 액세스 방법, 시스템, 및 액세스 서버, 액세스 장치
WO2015085788A1 (zh) 一种动态主机配置协议报文处理方法及装置
WO2011079786A1 (zh) Ip地址自动配置方法、服务端设备、客户机和通信***
KR100785805B1 (ko) 휴대 인터넷 망에서의 ip 멀티캐스트 패킷 전송을 위한멀티캐스트 cid(mcid) 할당 및 상기 mcid를이용한 패킷 전송 방법과 그 장치
WO2015196755A1 (zh) 一种身份位置分离网络中的地址分配方法及接入服务节点
WO2018161795A1 (zh) 一种路由优先级配置方法、设备以及控制器
WO2014015694A1 (zh) 申请频谱的方法、装置及***
US20060007924A1 (en) Power saving in wireless packet based networks
JP5737367B2 (ja) ネットワークモード選択方法及び装置
JP2002118570A (ja) パケット通信方法および装置
KR100739299B1 (ko) 중간 dhcp 서버를 이용한 중앙집중관리방식의 아이피자동할당 방법
WO2013189130A1 (zh) 一种基于点对点网络的通讯***及通讯方法
JP3783664B2 (ja) ルータ装置およびプログラム
JP2004166060A (ja) 通信システム、アドレス管理装置、通信端末、アドレス管理方法およびプログラム
WO2023221850A1 (zh) 组网方法和组网装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10815008

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2521/CHENP/2012

Country of ref document: IN

WWE Wipo information: entry into national phase

Ref document number: 2010815008

Country of ref document: EP