Summary of the invention
Embodiments of the invention provide a kind of method and apparatus that assigns IP address for subscriber terminal, and need not on DHCP Server to give each QINQ sub-interface configuration corresponding address pond, thus reduced ISP address administration difficulty.
A kind of method that assigns IP address for subscriber terminal comprises:
Each service provider to the needs access; Loopback interface of configuration on dynamic host configuration protocol relay DHCP Relay equipment; And on each loopback interface, dispose corresponding IP address and the Dynamic Host Configuration Protocol server address that needs relaying, on each loopback interface, bind and said service provider corresponding virtual private network;
On an access interface of access device, insert the user terminal that belongs to same service provider; On a said access interface, dispose the function of using of the corresponding loopback interface of said same service provider; Said implication of using function comprises: said access interface is used the corresponding loopback interface of same service provider of said configuration; As gateway address, this gateway address also is the gateway address of the user terminal that inserts on the said access interface with the IP address of this loopback interface; Said DHCP Relay equipment is with the IP address of the said loopback interface gateway address as the user terminal that belongs to same service provider that inserts on the said access interface;
The said gateway address of said DHCP Relay equipment utilization, relaying is used for the DHCP message of IP address assignment between said user terminal and dynamic host configuration protocol DHCP server.
A kind of device that assigns IP address for subscriber terminal comprises:
The loopback interface configuration module is used for to service provider configuration loopback interface, and gives said loopback interface distributing IP address;
The DHCP message processing module (MPM); Be used on an access interface of access device, inserting the user terminal that belongs to same service provider; On a said access interface, dispose the function of using of the corresponding loopback interface of said same service provider; Said implication of using function comprises: said access interface is used the corresponding loopback interface of same service provider of said configuration; With the IP address of this loopback interface as gateway address; This gateway address also is the gateway address of the user terminal that inserts on the said access interface, with the IP address of the said loopback interface gateway address as the user terminal that belongs to same service provider that inserts on the said access interface; Utilize said gateway address, relaying is used for the DHCP message of IP address assignment between said user terminal and dynamic host configuration protocol DHCP server;
Said loopback interface configuration module specifically comprises:
The address configuration module is used for each service provider to the needs access, disposes a loopback interface, and on each loopback interface, disposes corresponding IP address and the Dynamic Host Configuration Protocol server address that needs relaying;
The virtual private network binding module is used on each loopback interface, binding and said service provider corresponding virtual private network.
Technical scheme by the embodiment of the invention described above provides can be found out; The embodiment of the invention can be come the distributing IP address according to the quantity of the ISP that inserts on DHCP Relay equipment; Thereby reduce and reduce the IP number of addresses that disposes on the DHCP Relay equipment effectively, thereby the IP address resource that the saving system takies.
Embodiment
In the embodiment of the invention, on DHCP Relay equipment, dispose Loopback (loopback) interface, and give said Loopback distributing IP address to service provider.Then; With the IP address of said loopback interface gateway address as the user terminal of said service provider; The said gateway address of said DHCP Relay equipment utilization, relaying is used for the DHCP message of IP address assignment between said user terminal and dynamic host configuration protocol DHCP server.
Further; Each service provider to the needs access; Loopback interface of configuration on DHCP Relay equipment, and on each loopback interface, dispose corresponding IP address and the Dynamic Host Configuration Protocol server address that needs relaying, the Virtual Private Network that binding need insert on each loopback interface.
Further, the corresponding identical or different DHCP Relay equipment of described each service provider.
Further, on an access interface of access device, insert the user terminal that belongs to same service provider;
On a said access interface the corresponding loopback interface of the said same service provider of configuration use function, with the IP address of said loopback interface gateway address as the user terminal that belongs to same service provider that inserts on the said access interface.
Further, the access interface of said access device according to the gateway address of said user terminal, is relayed to said DHCP Relay equipment with said DHCP request message after receiving the DHCP request message that is used for IP address assignment of said user terminal transmission;
The Virtual Private Network of binding on the said loopback interface of said DHCP Relay equipment utilization is relayed to said DHCP request message the pairing Dynamic Host Configuration Protocol server in Dynamic Host Configuration Protocol server address that needs relaying that disposes on the said loopback interface;
Said DHCP Relay equipment receives the DHCP response message that said Dynamic Host Configuration Protocol server returns; Obtain the said Dynamic Host Configuration Protocol server that carries in the said DHCP response message and give said user terminal IP address allocated, said IP address is issued to said user terminal through said access device.
Further, said Dynamic Host Configuration Protocol server distributes the IP address in the same network segment for the user terminal that belongs to same service provider.
Further, the loopback interface that access device, access interface, this access interface of the said user terminal of said DHCP Relay equipment records used, and the related information between the media access control MAC address of this user terminal;
Said DHCP Relay equipment is given said user terminal IP address allocated according to said Dynamic Host Configuration Protocol server, and the related information of the said user terminal of record, and the DHCP that disposes and issue said user terminal surveys binding table.
For ease of the understanding to the embodiment of the invention, will combine accompanying drawing below is that example is done further and explained with several specific embodiments, and each embodiment does not constitute the qualification to the embodiment of the invention.
Embodiment one
The handling process of a kind of method that assigns IP address for subscriber terminal that this embodiment provides is as shown in Figure 1, comprises following treatment step:
Step 11, on the DHCP of appointment Relay equipment to Loopback interface of each ISP that need insert configuration.
At first, to each ISP that needs insert, Loopback interface of configuration on the DHCP of appointment Relay equipment, this Loopback interface is an overall interface, the DHCP Relay equipment of the appointment that each ISP is corresponding can be identical or different.And on each Loopback interface, dispose corresponding IP address, need the DHCP Server address of relaying.Said Loopback interface does not rely on concrete physical interface, and its state is UP (connection status) forever.
In the planning process of networks such as ether metropolitan area network; The user terminal of a general ISP belongs to same VPN (Virtual Private Network; Virtual Private Network), therefore, also need be on above-mentioned Loopback interface binding need the VPN that inserts; Said VPN and ISP are corresponding one by one, and the IP address of said Loopback interface is the IP address among this VPN.
Step 12, the Loopback interface function is used in configuration on the QINQ sub-interface on the physical port of the DSLAM of access user terminal equipment, this QINQ sub-interface with the IP address of the Loopback interface used as gateway address.
When carrying out the user terminal access, the user terminal that will belong to same ISP inserts through one or more QINQ sub-interfaces, and these one or more QINQ sub-interfaces belong to one or more DSLAM equipment.And all user terminals that insert on the same QINQ sub-interface can only belong to same ISP.
Inserting the function of using that disposes the Loopback interface on the QINQ sub-interface of the user terminal that belongs to same ISP; This main meaning of using function comprises: the QINQ sub-interface is used the corresponding Loopback interface of same ISP of above-mentioned configuration; As gateway address, this gateway address also is the gateway address of the user terminal that inserts on this QINQ sub-interface with the IP address of this Loopback interface.This QINQ sub-interface does not produce the IP route.
Such as; In the configuration schematic diagram of a kind of Loopback interface as shown in Figure 2; QINQ sub-interface 3013:100 under the physical port Port1 and the QINQ sub-interface 3013:200 under the physical port Port2 go up the user terminal that inserts and belong to same ISP, and these 2 QINQ sub-interface 3013:100,3013:200 use same Loopback1 interface; Equally; The user terminal of QINQ sub-interface 3014:200 under the Port2 and the QINQ sub-interface 3077:100 under the Port1, the last access of 3088:100 belongs to same ISP, and these 3 QINQ sub-interface 3014:100,3077:100,3088:100 use same Loopback2 interface.
The DSLAM equipment of access user terminal need write down the Loopback interface that physical port, QINQ sub-interface, this QINQ sub-interface that each user terminal inserts are used, and the information such as MAC Address of this user terminal.
QINQ sub-interface on the physical port of the DSLAM equipment of step 13, access user terminal is relayed to the DHCP request message of user terminal the DHCPRelay equipment of appointment according to the above-mentioned gateway address of using.
During the DHCP request message of the user terminal that DSLAM equipment inserts on transmitting above-mentioned QINQ sub-interface; According to the above-mentioned gateway address of using; Above-mentioned DHCP request message is forwarded on the DHCP Relay equipment of the appointment of having disposed above-mentioned gateway address, also need carries the mac address information of physical port that user terminal inserts, QINQ sub-interface, user terminal in the above-mentioned DHCP request message.
Step 14, DHCP Relay equipment are relayed to the DHCPServer of appointment again with this DHCP request message, and receive the DHCP ACK message that DHCP Server returns.
The VPN that binds on the Loopback interface that the above-mentioned QINQ sub-interface of DHCP Relay equipment utilization of above-mentioned appointment is used; Above-mentioned DHCP request message is relayed to the DHCP Server of above-mentioned Loopback interface appointment, need carries the IP address of above-mentioned Loopback interface and the MAC Address of user terminal in the above-mentioned DHCP request message.
The gateway address that the DHCP Relay equipment of above-mentioned appointment also needs physical port, QINQ sub-interface, this QINQ sub-interface of the DSLAM equipment of recording user terminal access to use, and the MAC Address of this user terminal.
After above-mentioned DHCP Server received above-mentioned DHCP request message, the IP address information according to the Loopback interface that carries in the above-mentioned DHCP request message assigned IP address for subscriber terminal.DHCPServer distributes the IP address in the same network segment for the user terminal that belongs to same ISP, and promptly DHCPServer gives an ISP configuration address pool.
Then, respond for the user terminal that sends above-mentioned DHCP request message and carry the above-mentioned DHCP ACK message of giving the user terminal IP address allocated.
The DHCP Relay equipment of above-mentioned appointment is according to above-mentioned information recorded; With the DSLAM equipment of above-mentioned DHCP ACK message relay to access user terminal; DSLAM equipment extracts gives the user terminal IP address allocated in the DHCP ACK message; Physical port, QINQ sub-interface through user terminal inserts are handed down to user terminal with this IP address.
The DHCP Relay equipment of above-mentioned appointment also issues the DHCP Snooping binding table of user terminal to the data forwarding aspect; Binding table is the validity checking of carrying out the MAC+ member port according to IP+QINQ+VRFID, when the data forwarding aspect is received message, according to above-mentioned binding table message is carried out security inspection; If do not hit; Then can above-mentioned packet loss be attacked the fail safe of enhancement apparatus thereby reduce invalid packet.
This embodiment can reduce the IP number of addresses and the DHCPServer that dispose on the DHCP Relay equipment effectively and go up the network segment quantity of configuration.Quantity such as the ISP that on a DHCP Relay equipment, inserts is 10, then only need on this DHCP Relay equipment, dispose 10 IP addresses.
Embodiment two
The embodiment of the invention also provides a kind of device that assigns IP address for subscriber terminal, and its concrete structure is as shown in Figure 3, comprises like lower module:
Loopback interface configuration module 31 is used for to service provider configuration loopback interface, and gives said loopback interface distributing IP address;
DHCP message processing module (MPM) 32; Be used for the IP address of said loopback interface gateway address as the user terminal of said service provider; Utilize said gateway address, relaying is used for the DHCP message of IP address assignment between said user terminal and dynamic host configuration protocol DHCP server.
Described loopback interface configuration module 31 specifically can comprise:
Address configuration module 311 is used for each service provider to the needs access, disposes a loopback interface, and on each loopback interface, disposes corresponding IP address and the Dynamic Host Configuration Protocol server address that needs relaying;
Virtual private network binding module 312 is used on each loopback interface, binding and said service provider corresponding virtual private network.
Described DHCP message processing module (MPM) 32 specifically can comprise:
DHCP request message processing module 321; Be used to receive the DHCP request message that the access device of user terminal sends; Said DHCP request message is after said access device receives the DHCP request message that is used for IP address assignment that user terminal sends, and forwards according to the gateway address of said user terminal.Utilize the IP address in the Virtual Private Network of binding on the said loopback interface, said DHCP request message is relayed to the pairing Dynamic Host Configuration Protocol server in Dynamic Host Configuration Protocol server address that needs relaying that disposes on the said loopback interface;
DHCP response message processing module 322; Be used to receive the DHCP response message that said Dynamic Host Configuration Protocol server returns; Obtain the said Dynamic Host Configuration Protocol server that carries in the said DHCP response message and give said user terminal IP address allocated, said IP address is issued to said user terminal through said access device.
DHCP surveys binding table processing module 323, is used to write down the loopback interface that access device, physics access interface, this access interface of said user terminal are used, and the related information between the media access control MAC address of this user terminal; Give said user terminal IP address allocated according to said Dynamic Host Configuration Protocol server, and the related information of the said user terminal of record, the DHCP that disposes and issue said user terminal surveys binding table.
One of ordinary skill in the art will appreciate that all or part of flow process that realizes in the foregoing description method; Be to instruct relevant hardware to accomplish through computer program; Described program can be stored in the computer read/write memory medium; This program can comprise the flow process like the embodiment of above-mentioned each side method when carrying out.Wherein, described storage medium can be magnetic disc, CD, read-only storage memory body (Read-Only Memory, ROM) or at random store memory body (Random Access Memory, RAM) etc.
In sum; The embodiment of the invention can be come the distributing IP address according to the quantity of the ISP that inserts on DHCP Relay equipment; Reduce the network segment quantity that disposes on the IP number of addresses that disposes on the DHCP Relay equipment and the DHCP Server effectively thereby reduce, thus IP address that the saving system takies and network segment resource.
Through distributing the IP address in the same network segment for the user terminal belong to same ISP, can reduce configured address pool count on address network segment number and the DHCP Server of ISP planning, be convenient to ISP and carry out the network planning and address administration.
The above; Be merely the preferable embodiment of the present invention, but protection scope of the present invention is not limited thereto, any technical staff who is familiar with the present technique field is in the technical scope that the present invention discloses; The variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection range of claim.