CN106576120B - Internet Protocol address assignment method, router, and computer-readable storage medium - Google Patents
Internet Protocol address assignment method, router, and computer-readable storage medium Download PDFInfo
- Publication number
- CN106576120B CN106576120B CN201580044872.0A CN201580044872A CN106576120B CN 106576120 B CN106576120 B CN 106576120B CN 201580044872 A CN201580044872 A CN 201580044872A CN 106576120 B CN106576120 B CN 106576120B
- Authority
- CN
- China
- Prior art keywords
- router
- prefix
- proxy
- network device
- local
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5007—Internet protocol [IP] addresses
- H04L61/5014—Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/54—Store-and-forward switching systems
- H04L12/56—Packet switching systems
- H04L12/5691—Access to open networks; Ingress point selection, e.g. ISP selection
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/52—Multiprotocol routers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2101/00—Indexing scheme associated with group H04L61/00
- H04L2101/30—Types of network names
- H04L2101/35—Types of network names containing special prefixes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2101/00—Indexing scheme associated with group H04L61/00
- H04L2101/60—Types of network addresses
- H04L2101/618—Details of network addresses
- H04L2101/659—Internet protocol version 6 [IPv6] addresses
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2101/00—Indexing scheme associated with group H04L61/00
- H04L2101/60—Types of network addresses
- H04L2101/668—Internet protocol [IP] address subnets
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/60—Router architectures
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Small-Scale Networks (AREA)
Abstract
本发明实施例提供一种互联网协议地址分配方法及路由器。本发明的互联网协议地址分配方法包括:接收上级网络设备的代理前缀;上级网络设备为路由器的WAN接口连接的网络设备;根据上级网络设备的代理前缀生成路由器的本地前缀和路由器的代理前缀;将路由器的本地前缀和路由器的代理前缀发送至路由器的下级路由器。本发明实施例可获取级联组网中各设备的IP地址。
The embodiments of the present invention provide an Internet protocol address allocation method and a router. The Internet protocol address allocation method of the present invention includes: receiving a proxy prefix of an upper-level network device; the upper-level network device is a network device connected to a WAN interface of a router; generating a local prefix of the router and a proxy prefix of the router according to the proxy prefix of the upper-level network device; The router's local prefix and the router's proxy prefix are sent to the router's subordinate routers. In the embodiment of the present invention, the IP addresses of each device in the cascaded networking can be obtained.
Description
技术领域technical field
本发明实施例涉及通信技术,尤其涉及一种互联网协议地址分配方法及路由器。Embodiments of the present invention relate to communication technologies, and in particular, to an Internet Protocol address allocation method and a router.
背景技术Background technique
随着互联网技术的不断发展,互联网协议也在不断的更新。随着互联网协议的更新,组网方式也在不断更新。在互联网协议第6版(Internet Protocol Version 6,简称IPV6)的组网中,多采用宽带接入服务器(Broadband Access Server,简称BAS)连接路由器,路由器连接终端的组网方式。With the continuous development of Internet technology, Internet protocols are also constantly updated. With the update of the Internet protocol, the networking method is also constantly updated. In the Internet Protocol Version 6 (Internet Protocol Version 6, referred to as IPV6) networking, a broadband access server (Broadband Access Server, referred to as BAS) is mostly used to connect the router, and the router connects to the terminal.
在现有的IPV6组网中,该BAS对与该BAS连接的一个路由器的接口服务可配置一个服务器本地前缀(Local Prefix)和一个服务器代理前缀(Delegate Prefix)。该BAS可根据该服务器本地前缀为该路由器上与该BAS连接的广域网(Wide Area Network,简称WAN)接口配置互联网协议(Internet Protocol,简称IP)地址。该BAS可将该服务器本地前缀携带及该服务器代理前缀发送至该路由器。该路由器可根据该服务器代理前缀生成该路由器的本地前缀,并根据该路由器的本地前缀获取该路由器的局域网(Local Area Network,简称LAN)接口的IP地址,即该路由器连接的终端的IP地址。该路由器还根据该服务器的本地前缀获取该路由器的WAN接口的IP地址。In the existing IPV6 networking, the BAS can configure a server local prefix (Local Prefix) and a server proxy prefix (Delegate Prefix) for the interface service of a router connected to the BAS. The BAS may configure an Internet Protocol (Internet Protocol, IP for short) address for a wide area network (Wide Area Network, referred to as WAN) interface on the router connected to the BAS according to the local prefix of the server. The BAS may carry the server local prefix and send the server proxy prefix to the router. The router can generate the local prefix of the router according to the server proxy prefix, and obtain the IP address of the local area network (LAN) interface of the router according to the local prefix of the router, that is, the IP address of the terminal connected to the router. The router also obtains the IP address of the router's WAN interface based on the server's local prefix.
在企业用户或大型实验室内,通过BAS连接互联网的入口路由器通常只有一个,通过在该入口路由器连接路由器形成级联组网来满足不同局域网的多台终端的接入。在IPV6组网中前缀获取方式,该入口路由器仅可从该BAS 获取一个服务器代理前缀,也就是说,该入口路由器仅具有一个路由本地前缀。因此,对于级联组网,级联路由器连接的设备便无法获取到IP地址。In enterprise users or large laboratories, there is usually only one ingress router connected to the Internet through the BAS. By connecting the routers at the ingress router to form a cascaded network, the access of multiple terminals in different local area networks can be satisfied. In the prefix acquisition method in the IPV6 networking, the ingress router can only acquire one server proxy prefix from the BAS, that is, the ingress router only has one route-local prefix. Therefore, for cascaded networking, devices connected to cascaded routers cannot obtain IP addresses.
发明内容SUMMARY OF THE INVENTION
本发明实施例提供一种互联网协议地址分配方法及路由器,以为级联组网中各设备分配IP地址。Embodiments of the present invention provide an Internet protocol address allocation method and router, so as to allocate IP addresses to each device in a cascaded networking.
第一方面,本发明实施例提供一种互联网协议地址分配方法,包括:In a first aspect, an embodiment of the present invention provides an Internet Protocol address allocation method, including:
路由器接收上级网络设备发送的所述上级网络设备的代理前缀;所述上级网络设备为所述路由器的广域网WAN接口连接的网络设备;The router receives the proxy prefix of the upper-level network device sent by the upper-level network device; the upper-level network device is the network device connected to the WAN interface of the router;
所述路由器根据所述上级网络设备的代理前缀生成所述路由器的本地前缀和所述路由器的代理前缀;The router generates the local prefix of the router and the proxy prefix of the router according to the proxy prefix of the upper-level network device;
所述路由器将所述路由器的本地前缀和所述路由器的代理前缀发送至所述路由器的下级路由器;所述下级路由器为所述路由器的局域网LAN接口连接的路由器;所述路由器的本地前缀用于使所述下级路由器确定所述下级路由器的WAN接口的互联网协议IP地址;所述路由器的代理前缀用于使得所述下级路由器生成所述下级路由器的本地前缀。The router sends the local prefix of the router and the proxy prefix of the router to the subordinate router of the router; the subordinate router is the router connected to the local area network LAN interface of the router; the local prefix of the router is used for The lower-level router is made to determine the Internet Protocol IP address of the WAN interface of the lower-level router; the proxy prefix of the router is used to make the lower-level router generate the local prefix of the lower-level router.
根据第一方面,在第一方面的第一种可能实现的方式中,所述上级网络设备为所述路由器的WAN接口连接的宽带接入服务器BAS或路由器。According to the first aspect, in a first possible implementation manner of the first aspect, the upper-level network device is a broadband access server BAS or a router connected to a WAN interface of the router.
根据第一方面或第一方面的第一种可能实现的方式,在第二种可能实现的方式中,所述路由器根据所述上级网络设备的代理前缀生成所述路由器的本地前缀和所述路由器的代理前缀,包括:According to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner, the router generates the local prefix of the router and the router according to the proxy prefix of the upper-level network device proxy prefixes, including:
若所述路由器开启级联模式,所述路由器根据所述上级网络设备的代理前缀生成所述路由器的本地前缀和所述路由器的代理前缀。If the router enables the cascade mode, the router generates the local prefix of the router and the proxy prefix of the router according to the proxy prefix of the upper-level network device.
根据第一方面的第二种可能实现的方式,在第三种可能实现的方式中,所述路由器根据所述上级网络设备的代理前缀生成所述路由器的本地前缀和所述路由器的代理前缀包括:According to a second possible implementation manner of the first aspect, in a third possible implementation manner, the router generates the local prefix of the router and the proxy prefix of the router according to the proxy prefix of the upper-level network device, including :
所述路由器将所述上级网络设备的代理前缀的最低比特位的下一比特位配置为第一比特值,并在所述下一比特位后补随机值,以得到所述路由器的本地前缀,使得所述路由器的本地前缀的位数等于终端唯一标识符EUI的前缀位数;The router configures the next bit of the lowest bit of the proxy prefix of the upper-level network device as the first bit value, and supplements the next bit with a random value to obtain the local prefix of the router, Make the number of bits of the local prefix of the router equal to the number of bits of the prefix of the terminal unique identifier EUI;
所述路由器将所述下一比特位配置为第二比特值,并对所述上级网络设备的代理前缀的位数加一,以得到所述路由器的代理前缀;其中,所述第一比特值不同于所述第二比特值。The router configures the next bit as a second bit value, and adds one to the number of bits of the proxy prefix of the upper-level network device to obtain the proxy prefix of the router; wherein the first bit value different from the second bit value.
根据第一方面的第三种可能实现的方式,在第四种可能实现的方式中,所述上级网络设备的代理前缀的位数小于所述EUI的前缀位数。According to a third possible implementation manner of the first aspect, in a fourth possible implementation manner, the number of bits of the proxy prefix of the upper-level network device is smaller than the number of bits of the prefix of the EUI.
第二方面,本发明实施例还提供一种路由器,包括:In a second aspect, an embodiment of the present invention further provides a router, including:
接收模块,用于接收上级网络设备发送的所述上级网络设备的代理前缀;所述上级网络设备为所述路由器的广域网WAN接口连接的网络设备;a receiving module, configured to receive the proxy prefix of the upper-level network device sent by the upper-level network device; the upper-level network device is a network device connected to the WAN interface of the router;
生成模块,用于根据所述上级网络设备的代理前缀生成所述路由器的本地前缀和所述路由器的代理前缀;a generating module, configured to generate the local prefix of the router and the proxy prefix of the router according to the proxy prefix of the upper-level network device;
发送模块,用于将所述路由器的本地前缀和所述路由器的代理前缀发送至所述路由器的下级路由器;所述下级路由器为所述路由器的局域网LAN接口连接的路由器;所述路由器的本地前缀用于使所述下级路由器确定所述下级路由器的WAN接口的互联网协议IP地址;所述路由器的代理前缀用于使得所述下级路由器生成所述下级路由器的本地前缀。A sending module, configured to send the local prefix of the router and the proxy prefix of the router to a subordinate router of the router; the subordinate router is a router connected to the local area network LAN interface of the router; the local prefix of the router The lower-level router is used to make the lower-level router determine the Internet Protocol IP address of the WAN interface of the lower-level router; the proxy prefix of the router is used to enable the lower-level router to generate the local prefix of the lower-level router.
根据第二方面,在第二方面的第一种可能实现的方式中,所述上级网络设备为所述路由器的WAN接口连接的宽带接入服务器BAS或路由器。According to the second aspect, in a first possible implementation manner of the second aspect, the upper-level network device is a broadband access server BAS or a router connected to a WAN interface of the router.
根据第二方面或第二方面的第一种可能实现的方式,在第二种可能实现的方式中,所述生成模块,还用于若所述路由器开启级联模式,根据所述上级网络设备的代理前缀生成所述路由器的本地前缀和所述路由器的代理前缀。According to the second aspect or the first possible implementation manner of the second aspect, in the second possible implementation manner, the generating module is further configured to, if the router enables the cascade mode, according to the upper-level network device The proxy prefix generates the router's local prefix and the router's proxy prefix.
根据第二方面的第二种可能实现的方式,在第三种可能实现的方式中,所述生成模块,还用于将所述上级网络设备的代理前缀的最低比特位的下一比特位配置为第一比特值,并在所述下一比特位后补随机值以得到所述路由器的本地前缀,使得所述路由器的本地前缀的位数等于终端唯一标识符EUI 的前缀位数;将所述下一比特位配置为第二比特值,并对所述上级网络设备的代理前缀的位数加一,以得到所述路由器的代理前缀;其中,所述第一比特值不同于所述第二比特值。According to a second possible implementation manner of the second aspect, in a third possible implementation manner, the generating module is further configured to configure the next bit of the lowest bit of the proxy prefix of the upper-level network device is the first bit value, and a random value is added after the next bit to obtain the local prefix of the router, so that the number of bits of the local prefix of the router is equal to the number of prefix bits of the terminal unique identifier EUI; The next bit is configured as the second bit value, and one is added to the number of bits of the proxy prefix of the upper-level network device to obtain the proxy prefix of the router; wherein the first bit value is different from the first bit value. Two-bit value.
根据第二方面的第三种可能实现的方式,在第四种可能实现的方式中,所述上级网络设备的代理前缀的位数小于所述终端唯一标识符EUI的前缀位数。According to a third possible implementation manner of the second aspect, in a fourth possible implementation manner, the number of bits of the proxy prefix of the upper-level network device is less than the number of bits of the prefix of the terminal unique identifier EUI.
第三方面,本发明实施例还提供一种路由器,包括:接收机、处理器及发射机;In a third aspect, an embodiment of the present invention further provides a router, including: a receiver, a processor, and a transmitter;
所述接收机,用于接收上级网络设备发送的所述上级网络设备的代理前缀;所述上级网络设备为所述路由器的广域网WAN接口连接的网络设备;The receiver is configured to receive the proxy prefix of the upper-level network device sent by the upper-level network device; the upper-level network device is a network device connected to the WAN interface of the router;
所述处理器,用于根据所述上级网络设备的代理前缀生成所述路由器的本地前缀和所述路由器的代理前缀;the processor, configured to generate the local prefix of the router and the proxy prefix of the router according to the proxy prefix of the upper-level network device;
所述发射机,用于将所述路由器的本地前缀和所述路由器的代理前缀发送至所述路由器的下级路由器;所述下级路由器为所述路由器的局域网LAN 接口连接的路由器;所述路由器的本地前缀用于使所述下级路由器确定所述下级路由器的WAN接口的互联网协议IP地址;所述路由器的代理前缀用于使得所述下级路由器生成所述下级路由器的本地前缀。The transmitter is used to send the local prefix of the router and the proxy prefix of the router to the lower-level router of the router; the lower-level router is the router connected to the local area network LAN interface of the router; the router's The local prefix is used to enable the lower-level router to determine the Internet Protocol IP address of the WAN interface of the lower-level router; the proxy prefix of the router is used to enable the lower-level router to generate the local prefix of the lower-level router.
根据第三方面,在第三方面的第一种可能实现的方式中,所述上级网络设备为所述路由器的WAN接口连接的宽带接入服务器BAS或路由器。According to a third aspect, in a first possible implementation manner of the third aspect, the upper-level network device is a broadband access server BAS or a router connected to a WAN interface of the router.
根据第三方面或第三方面的第一种可能实现的方式,在第二种可能实现的方式中,所述处理器,还用于若所述路由器开启级联模式,根据所述上级网络设备的代理前缀生成所述路由器的本地前缀和所述路由器的代理前缀。According to the third aspect or the first possible implementation manner of the third aspect, in the second possible implementation manner, the processor is further configured to: if the router enables the cascade mode, according to the upper-level network device The proxy prefix generates the router's local prefix and the router's proxy prefix.
根据第三方面的第二种可能实现的方式,在第三种可能实现的方式中,所述处理器,还用于将所述上级网络设备的代理前缀的最低比特位的下一比特位配置为第一比特值,并在所述下一比特位后补随机值,以得到所述路由器的本地前缀,使得所述路由器的本地前缀的位数等于终端唯一标识符EUI 的前缀位数;将所述下一比特位配置为第二比特值,并对所述上级网络设备的代理前缀的位数加一,以得到所述路由器的代理前缀;其中,所述第一比特值不同于所述第二比特值。According to a second possible implementation manner of the third aspect, in a third possible implementation manner, the processor is further configured to configure the next bit of the lowest bit of the proxy prefix of the upper-level network device is the first bit value, and a random value is added after the next bit to obtain the local prefix of the router, so that the number of bits of the local prefix of the router is equal to the number of prefix bits of the terminal unique identifier EUI; The next bit is configured as a second bit value, and one is added to the number of bits of the proxy prefix of the upper-level network device to obtain the proxy prefix of the router; wherein the first bit value is different from the second bit value.
根据第三方面的第三种可能实现的方式,在第四种可能实现的方式中,所述上级网络设备的代理前缀的位数小于所述EUI的前缀位数。According to a third possible implementation manner of the third aspect, in a fourth possible implementation manner, the number of bits of the proxy prefix of the upper-level network device is smaller than the number of bits of the prefix of the EUI.
第四方面,本发明实施例还提供一种计算机可读存储介质,包括:至少一个程序;所述至少一个程序包括计算机可读指令;In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, including: at least one program; the at least one program includes computer-readable instructions;
所述计算机可读指令,用于使路由器的处理器调取并执行,以接收上级网络设备发送的所述上级网络设备的代理前缀,根据所述上级网络设备的代理前缀生成所述路由器的本地前缀和所述路由器的代理前缀,将所述路由器的本地前缀和所述路由器的代理前缀发送至所述路由器的下级路由器;其中,所述上级网络设备为所述路由器的广域网WAN接口连接的网络设备;所述下级路由器为所述路由器的局域网LAN接口连接的路由器;所述路由器的本地前缀用于使所述下级路由器确定所述下级路由器的WAN接口的互联网协议IP地址;所述路由器的代理前缀用于使得所述下级路由器生成所述下级路由器的本地前缀。The computer-readable instructions are used to cause the processor of the router to call and execute, to receive the proxy prefix of the upper-level network device sent by the upper-level network device, and to generate a local proxy prefix of the router according to the proxy prefix of the upper-level network device. prefix and the proxy prefix of the router, and send the local prefix of the router and the proxy prefix of the router to the lower-level routers of the router; wherein, the upper-level network device is a network connected to the WAN interface of the router equipment; the lower-level router is a router connected to the local area network LAN interface of the router; the local prefix of the router is used to enable the lower-level router to determine the Internet Protocol IP address of the WAN interface of the lower-level router; the proxy of the router The prefix is used to cause the subordinate router to generate the local prefix of the subordinate router.
根据第四方面,在第四方面的第一种可能实现的方式中,所述上级网络设备为所述路由器的WAN接口连接的宽带接入服务器BAS或路由器。According to a fourth aspect, in a first possible implementation manner of the fourth aspect, the upper-level network device is a broadband access server BAS or a router connected to a WAN interface of the router.
根据第四方面或第四方面的第一种可能实现的方式,在第二种可能实现的方式中,所述计算机可读指令,还用于在所述路由器开启级联模式时,使得所述路由器的处理器调取并执行,以根据所述上级网络设备的代理前缀生成所述路由器的本地前缀和所述路由器的代理前缀。According to the fourth aspect or the first possible implementation manner of the fourth aspect, in the second possible implementation manner, the computer-readable instructions are further configured to cause the router to enable the cascade mode when the router starts the cascade mode. The processor of the router invokes and executes to generate the local prefix of the router and the proxy prefix of the router according to the proxy prefix of the upper-level network device.
根据第四方面的第二种可能实现的方式,在第三种可能实现的方式中,所述计算机可读指令,还用于使得所述路由器的处理器调取并执行,以将所述上级网络设备的代理前缀的最低比特位的下一比特位配置为第一比特值,并在所述下一比特位后补随机值,以得到所述路由器的本地前缀,使得所述路由器的本地前缀的位数等于终端唯一标识符EUI的前缀位数,将所述下一比特位配置为第二比特值,并对所述上级网络设备的代理前缀的位数加一,以得到所述路由器的代理前缀;其中,所述第一比特值不同于所述第二比特值。According to a second possible implementation manner of the fourth aspect, in a third possible implementation manner, the computer-readable instructions are further used to cause the processor of the router to call and execute, so as to The next bit of the lowest bit of the proxy prefix of the network device is configured as the first bit value, and a random value is added after the next bit to obtain the local prefix of the router, so that the local prefix of the router is The number of bits is equal to the number of prefix bits of the terminal unique identifier EUI, the next bit is configured as the second bit value, and one is added to the number of bits of the proxy prefix of the upper-level network device to obtain the router's number of bits. a proxy prefix; wherein the first bit value is different from the second bit value.
根据第四方面的第三种可能实现的方式,在第四种可能实现的方式中,所述上级网络设备的代理前缀的位数小于所述EUI的前缀位数。According to a third possible implementation manner of the fourth aspect, in a fourth possible implementation manner, the number of bits of the proxy prefix of the upper-level network device is smaller than the number of bits of the prefix of the EUI.
本发明实施例互联网协议地址分配方法、路由器及计算机可读存储介质,可通过路由器接收上级网络设备,即该路由器的WAN接口连接网络设备发送的该上级网络设备的代理前缀,根据该上级网络设备的代理前缀生成该路由器的本地前缀和该路由器的代理前缀,并将该路由器的本地前缀和该路由器的代理前缀发送至该路由器的下级路由器,也就是该路由器的LAN接口连接的路由器,由于该路由器的本地前缀可用于使该下级路由器确定该下级路由器的WAN接口的IP地址,该路由器的代理前缀用于使得该下级路由器确定该下级路由器的LAN接口连接的终端的IP地址,从而获取级联组网中各设备的IP地址。The Internet protocol address allocation method, router, and computer-readable storage medium according to the embodiments of the present invention can receive the upper-level network device through the router, that is, the proxy prefix of the upper-level network device sent by the WAN interface of the router connected to the network device, according to the upper-level network device. The proxy prefix of the router generates the local prefix of the router and the proxy prefix of the router, and sends the local prefix of the router and the proxy prefix of the router to the subordinate router of the router, that is, the router to which the router's LAN interface is connected. The local prefix of the router can be used to enable the subordinate router to determine the IP address of the WAN interface of the subordinate router, and the proxy prefix of the router is used to enable the subordinate router to determine the IP address of the terminal connected to the LAN interface of the subordinate router, so as to obtain the cascade connection. IP address of each device in the network.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description These are some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can also be obtained from these drawings without any creative effort.
图1为本发明实施例所适用的IPV6级联组网的结构示意图;1 is a schematic structural diagram of an IPv6 cascaded networking to which an embodiment of the present invention is applicable;
图2为本发明实施例一提供的互联网协议地址分配方法的流程图;2 is a flowchart of a method for allocating an Internet Protocol address according to Embodiment 1 of the present invention;
图3为本发明实施例二提供的互联网协议地址分配方法的流程图;3 is a flowchart of a method for allocating an Internet Protocol address according to Embodiment 2 of the present invention;
图4为本发明实施例三的级联组网的结构示意图;4 is a schematic structural diagram of a cascaded networking according to Embodiment 3 of the present invention;
图5为本发明实施例三提供的互联网协议地址分配方法的流程图;5 is a flowchart of a method for allocating an Internet Protocol address according to Embodiment 3 of the present invention;
图6为本发明实施例四的路由器的结构示意图;6 is a schematic structural diagram of a router according to Embodiment 4 of the present invention;
图7为本发明实施例五提供的路由器的结构示意图;7 is a schematic structural diagram of a router according to Embodiment 5 of the present invention;
图8为本发明实施例六提供的计算机可读存储介质的结构示意图。FIG. 8 is a schematic structural diagram of a computer-readable storage medium according to Embodiment 6 of the present invention.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purposes, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments These are some embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
本发明各实施例适用于IPV6级联组网。在IPV6的级联组网中的路由器可直接连接终端,也可通过中继设备与终端连接,还可通过其他路由器与终端连接。其中,该其他路由器可称为级联路由器。图1为本发明实施例所适用的IPV6级联组网的结构示意图。如图1所示,在IPV6级联组网中,与BAS 101连接的第一路由器102可称为入口路由器。该第一路由器102通过WAN 接口(未示出)与BAS 101连接。该第一路由器102通过LAN接口与第一终端103连接,该第一路由器102还通过LAN接口(未示出)与第二路由器 104连接。该第二路由器104即为级联路由器。该第一路由器102可以是通过LAN接口与该第二路由器104的WAN接口连接,从而实现该第一路由器 102与该第二路由器104的连接。其中,该第二路由器104还与第二终端105 连接。需要说明的是,与第一路由器102相类似的,该第二路由器104还可下接其他的路由器以实现多级级联。若第一路由器102仅从BAS101获取一个服务器代理前缀,第一路由器102仅可根据该一个服务器代理前缀生成一个路由本地前缀,则第一路由器102不具有代理前缀以下发至第二路由器 104,这使得第二路由器104不具有本地前缀,因此与第二路由器104连接的设备,即第二终端则便无法获取到IP地址。The embodiments of the present invention are applicable to IPV6 cascaded networking. The routers in the IPV6 cascading networking can be directly connected to the terminal, or can be connected to the terminal through a relay device, and can also be connected to the terminal through other routers. Among them, the other routers can be called cascade routers. FIG. 1 is a schematic structural diagram of an IPv6 cascaded networking to which an embodiment of the present invention is applicable. As shown in FIG. 1 , in the IPV6 cascaded networking, the first router 102 connected to the BAS 101 may be called an ingress router. The first router 102 is connected to the BAS 101 through a WAN interface (not shown). The first router 102 is connected to the first terminal 103 through a LAN interface, and the first router 102 is also connected to the second router 104 through a LAN interface (not shown). The second router 104 is a cascade router. The first router 102 may be connected to the WAN interface of the second router 104 through a LAN interface, so as to realize the connection between the first router 102 and the second router 104. Wherein, the second router 104 is also connected with the second terminal 105 . It should be noted that, similar to the first router 102, the second router 104 may also be connected to other routers to implement multi-level cascading. If the first router 102 only obtains one server proxy prefix from the BAS 101, and the first router 102 can only generate a routing local prefix according to the one server proxy prefix, the first router 102 does not have the proxy prefix and sends it to the second router 104, which is The second router 104 does not have a local prefix, so the device connected to the second router 104, that is, the second terminal, cannot obtain an IP address.
实施例一Example 1
本发明实施例一提供一种互联网协议地址分配方法。该方法可由路由器执行。图2为本发明实施例一提供的互联网协议地址分配方法的流程图。如图2所示,该方法可包括:The first embodiment of the present invention provides an Internet protocol address allocation method. The method may be performed by a router. FIG. 2 is a flowchart of a method for allocating an Internet Protocol address according to Embodiment 1 of the present invention. As shown in Figure 2, the method may include:
S201、路由器接收上级网络设备发送的该上级网络设备的代理前缀;该上级网络设备为该路由器的WAN接口连接的网络设备。S201. The router receives the proxy prefix of the upper-level network device sent by the upper-level network device; the upper-level network device is the network device connected to the WAN interface of the router.
具体地,该路由器可以为IPV6级联网络中具有下级路由器的任一路由器。其中,该下级路由器可以是通过路由器的LAN接口连接的路由器。Specifically, the router may be any router with lower-level routers in the IPV6 cascaded network. Wherein, the lower-level router may be a router connected through a LAN interface of the router.
该路由器可以是通过接收该上级网络设备通过动态主机设置协议 (DynamicHost Configuration Protocol,简称DHCP)报文的代理前缀身份关联(IdentityAssociation for Prefix Delegation,简称IA_PD)消息所发送的代理前缀。由于在IPV6级联组网中,设备,包括终端或路由器大多支持前缀为 64比特位的终端唯一标识符(End-System Unique Identifier,简称EUI),也就是说,在该IPV6级联组网中,用于生成IP地址的前缀可以是64位。那么在本实施例中,对于该路由器获取的该上级网络设备的代理前缀的长度可小于64位。该上级网络设备的代理前缀可用于表示该路由器的LAN接口连接的各设备,如终端或路由器所在的域。The router may be a proxy prefix sent by receiving a proxy prefix identity association (Identity Association for Prefix Delegation, abbreviated IA_PD) message of the upper-level network device through a Dynamic Host Configuration Protocol (Dynamic Host Configuration Protocol, referred to as DHCP) message. Because in the IPV6 cascading networking, most devices, including terminals or routers, support the End-System Unique Identifier (EUI) with a prefix of 64 bits, that is to say, in the IPv6 cascading networking , the prefix used to generate the IP address can be 64 bits. Then, in this embodiment, the length of the proxy prefix of the upper-level network device obtained by the router may be less than 64 bits. The proxy prefix of the upper-level network device can be used to represent each device connected to the LAN interface of the router, such as the domain where the terminal or the router is located.
S202、该路由器根据该上级网络设备的代理前缀生成该路由器的本地前缀和该路由器的代理前缀。S202. The router generates a local prefix of the router and a proxy prefix of the router according to the proxy prefix of the upper-level network device.
该路由器可以是获取该上级网络设备的代理前缀,并根据该上级网络设备的代理前缀生成该路由器的本地前缀,和该路由器的代理前缀。其中,该路由器的本地前缀的比特位的值,不同于,该路由器的代理前缀的比特位的值。在IPV6级联组网中,设备大多支持64比特位的EUI,因此该路由器的本地前缀的比特位数可等于EUI的前缀位数。该路由器的代理前缀的比特位数可小于或等于该EUI的前缀位数。其中,该路由器的本地前缀的比特位数可等于该EUI的前缀位数。The router may obtain the proxy prefix of the upper-level network device, and generate the local prefix of the router and the proxy prefix of the router according to the proxy prefix of the upper-level network device. The bit value of the local prefix of the router is different from the bit value of the proxy prefix of the router. In the IPV6 cascading networking, most devices support 64-bit EUI, so the number of bits of the router's local prefix can be equal to the number of prefixes of the EUI. The number of bits of the router's proxy prefix may be less than or equal to the number of bits of the EUI's prefix. The number of bits of the local prefix of the router may be equal to the number of bits of the prefix of the EUI.
举例来说,若该上级网络设备的代理前缀的比特位数为60位。该EUI 的前缀位数为64位。该路由器可以是将该上级网络设备的代理前缀的最低比特位的低比特位即第61比特位至第64比特位进行配置。该路由器可以将该上级网络设备的代理前缀的第60比特位配置为与该路由器的本地前缀中第 60比特位配置不同的值,以得到该路由器的代理前缀。For example, if the number of bits of the proxy prefix of the upper-level network device is 60 bits. The number of prefix bits for this EUI is 64 bits. The router may configure the lower bits of the lowest bits of the proxy prefix of the upper-level network device, that is, the 61st bit to the 64th bit. The router may configure the 60th bit of the proxy prefix of the upper-level network device to a value different from the 60th bit configured in the local prefix of the router, so as to obtain the proxy prefix of the router.
S203、该路由器将该路由器的本地前缀和该路由器的代理前缀发送至该路由器的下级路由器;该下级路由器为该路由器的LAN接口连接的路由器;该路由器的本地前缀用于使该下级路由器确定该下级路由器的WAN接口的 IP地址;该路由器的代理前缀用于使得该下级路由器生成所述下级路由器的本地前缀。S203, the router sends the local prefix of the router and the proxy prefix of the router to the subordinate router of the router; the subordinate router is a router connected to the LAN interface of the router; the local prefix of the router is used to enable the subordinate router to determine the The IP address of the WAN interface of the lower-level router; the proxy prefix of the router is used to make the lower-level router generate the local prefix of the lower-level router.
可选的,该路由器可以是将该路由器的本地前缀携带在路由广播(RouterAdvertisement,简称RA)消息或DHCP报文的非临时地址身份关联(Identity Associationfor non-temporary addresses,简称IA_NA)消息中发送至该下级路由器。该下级路由器也可称为该路由器的级联路由器。该路由器可以是将该路由器的代理前缀携带在DHCP报文的IA_PD消息中发送至该下级路由器。Optionally, the router may carry the local prefix of the router in a router advertisement (Router Advertisement (RA) message or a non-temporary address identity association (Identity Association for non-temporary addresses, abbreviated IA_NA) message of a DHCP packet and send it to the router. the subordinate router. The subordinate router may also be referred to as the cascade router of the router. The router may carry the proxy prefix of the router in the IA_PD message of the DHCP message and send it to the subordinate router.
该下级路由器可根据RA消息或DHCP报文的IA_NA消息获取到该路由器的本地前缀,并根据该路由器的本地前缀及该下级路由器的WAN接口的状态标识或该下级路由器的WAN接口的媒体访问控制(Media Access Control,简称MAC)地址生成该下级路由器的WAN接口的IP地址。由于在IPV6级联组网中,设备大多支持64比特位的EUI,也就是说,设备的IP地址中,无论前缀还是后缀均为64比特位,因此该下级路由器的WAN接口的状态标识或该下级路由器的WAN接口的MAC地址转换为EUI地址,也就是64位的后缀,从而根据该64位的该路由器的本地前缀和该64位的后缀生成该下级路由器的WAN接口的IP地址。The subordinate router can obtain the local prefix of the router according to the RA message or the IA_NA message of the DHCP message, and according to the local prefix of the router and the status identification of the WAN interface of the subordinate router or the media access control of the WAN interface of the subordinate router (Media Access Control, MAC for short) address generates the IP address of the WAN interface of the lower-level router. In the IPV6 cascaded networking, most of the devices support 64-bit EUI, that is to say, in the IP address of the device, both the prefix and the suffix are 64-bit, so the status identifier of the WAN interface of the subordinate router or this The MAC address of the WAN interface of the subordinate router is converted into an EUI address, that is, a 64-bit suffix, thereby generating the IP address of the WAN interface of the subordinate router according to the 64-bit local prefix of the router and the 64-bit suffix.
该下级路由器可以是根据DHCP报文的IA_PD消息获取该路由器的代理前缀,并根据该路由器的代理前缀生成该下级路由器的本地前缀。该下级路由器的本地前缀,可用于使得该下级路由器根据该下级路由器的本地前缀及该下级路由器的LAN接口连接的终端的状态标识生该下级路由器的LAN接口连接的终端的IP地址。需要说明的是,该下级路由器在生成该下级路由器的LAN接口连接的终端的IP地址之前,还需对该下级路由器的LAN接口连接的终端的状态标识转换为EUI地址,也就是64位的后缀。The subordinate router may obtain the proxy prefix of the router according to the IA_PD message of the DHCP message, and generate the local prefix of the subordinate router according to the proxy prefix of the router. The local prefix of the subordinate router can be used to make the subordinate router generate the IP address of the terminal connected to the LAN interface of the subordinate router according to the local prefix of the subordinate router and the status of the terminal connected to the LAN interface of the subordinate router. It should be noted that, before the subordinate router generates the IP address of the terminal connected to the LAN interface of the subordinate router, the state identifier of the terminal connected to the LAN interface of the subordinate router needs to be converted into an EUI address, that is, a 64-bit suffix. .
或者,该下级路由器还可将该下级路由器的本地前缀发送至该下级路由器的LAN接口连接的终端,使得该下级路由器的LAN接口连接的终端根据该下级路由器的本地前缀及该下级路由器的LAN接口连接的终端的MAC地址生成该下级路由器的LAN接口连接的终端的IP地址。需要说明的是,该下级路由器的LAN接口连接的终端在生成该下级路由器的LAN接口连接的终端的IP地址之前,还需对该下级路由器的LAN接口连接的终端的MAC 地址转换为EUI地址的64位后缀。Alternatively, the lower-level router may also send the local prefix of the lower-level router to the terminal connected to the LAN interface of the lower-level router, so that the terminal connected to the LAN interface of the lower-level router is based on the local prefix of the lower-level router and the LAN interface of the lower-level router. The MAC address of the connected terminal generates the IP address of the terminal connected to the LAN interface of the lower-level router. It should be noted that before generating the IP address of the terminal connected to the LAN interface of the subordinate router, the terminal connected to the LAN interface of the subordinate router also needs to convert the MAC address of the terminal connected to the LAN interface of the subordinate router into an EUI address. 64-bit suffix.
本发明实施例一提供一种互联网协议地址分配方法,可通过路由器接收上级网络设备,即该路由器的WAN接口连接网络设备发送的该上级网络设备的代理前缀,根据该上级网络设备的代理前缀生成该路由器的本地前缀和该路由器的代理前缀,并将该路由器的本地前缀和该路由器的代理前缀发送至该路由器的下级路由器,也就是该路由器的LAN接口连接的路由器,由于该路由器的本地前缀可用于使该下级路由器确定该下级路由器的WAN接口的IP地址,该路由器的代理前缀用于使得该下级路由器确定该下级路由器的 LAN接口连接的终端的IP地址,从而为级联组网中各设备进行分配IP地址。The first embodiment of the present invention provides an Internet protocol address allocation method, which can receive the proxy prefix of the upper-level network device sent by the upper-level network device through the router, that is, the WAN interface of the router is connected to the network device, and generate the proxy prefix according to the proxy prefix of the upper-level network device. The router's local prefix and the router's proxy prefix, and send the router's local prefix and the router's proxy prefix to the router's subordinate router, that is, the router connected to the router's LAN interface, because the router's local prefix It can be used to enable the lower-level router to determine the IP address of the WAN interface of the lower-level router, and the proxy prefix of the router is used to enable the lower-level router to determine the IP address of the terminal connected to the LAN interface of the lower-level router. The device is assigned an IP address.
需要说明的是,由于本发明实施例一提供的互联网协议地址分配方法,可实现级联组网中路由器或终端的IP地址的自动获取,而无需通过管理员进行人工配置,使得级联组网的网络维护更方便,且准确度更高。It should be noted that, due to the Internet Protocol address allocation method provided in the first embodiment of the present invention, the IP addresses of routers or terminals in the cascaded networking can be automatically obtained without manual configuration by the administrator, so that the cascaded networking can be achieved. The network maintenance is more convenient and the accuracy is higher.
实施例二Embodiment 2
在上述实施例一的方法的基础上,本发明实施例二还提供一种互联网协议地址分配方法。可选的,上述实施例一中的该上级网络设备为该路由器的 WAN接口连接的BAS或路由器。On the basis of the method in the above-mentioned first embodiment, the second embodiment of the present invention further provides an Internet protocol address allocation method. Optionally, the upper-level network device in the first embodiment is a BAS or a router connected to the WAN interface of the router.
具体地,若该上级网络设备为该路由器的WAN接口连接的BAS,那么该上级网络设备的代理前缀可以是该BAS根据该路由器的接口服务所配置的服务器代理前缀。若该上级网络设备为该路由器的WAN接口连接的路由器,那么该上级网络设备的代理前缀可以是该路由器的WAN接口连接的路由器接收的其他路由器发送的该其他路由器的代理前缀所生成的。Specifically, if the upper-level network device is a BAS connected to the WAN interface of the router, the proxy prefix of the upper-level network device may be a server proxy prefix configured by the BAS according to the interface service of the router. If the upper-level network device is a router connected to the WAN interface of the router, the proxy prefix of the upper-level network device may be generated by the proxy prefix of the other routers received by the router connected to the WAN interface of the router and sent by the other routers.
若该上级网络设备为该路由器的WAN接口连接的BAS,则该路由器可以称为入口路由器,那么该实施例的方法至少可实现一级级联组网中级联路由器连接的设备的IP地址的获取。若该上级路由器为该路由器的WAN接口连接的路由器,则该路由器本身为级联路由器,那么该实施例的方法还可实现多级级联组网中的级联路由器连接的设备的IP地址的获取。If the upper-level network device is the BAS connected to the WAN interface of the router, the router can be called an ingress router, and the method of this embodiment can at least realize the IP address of the device connected to the cascaded routers in the first-level cascaded networking. Obtain. If the upper-level router is a router connected to the WAN interface of the router, then the router itself is a cascade router, then the method of this embodiment can also realize the IP address of the device connected to the cascade router in the multi-level cascade network. Obtain.
可选的,上述S202该路由器根据该上级网络设备的代理前缀生成该路由器的本地前缀和该路由器的代理前缀,可包括:Optionally, in the above S202, the router generates the local prefix of the router and the proxy prefix of the router according to the proxy prefix of the upper-level network device, which may include:
若该路由器开启级联模式,该路由器根据该上级网络设备的代理前缀生成该路由器的本地前缀和该路由器的代理前缀。If the router enables the cascading mode, the router generates the local prefix of the router and the proxy prefix of the router according to the proxy prefix of the upper-level network device.
其中,该级联模式,指的是该下级路由器可通过该路由器、BAS与网络建立的连接,继而传输网络数据对应的该路由器与该下级路由器的连接模式。The cascading mode refers to the connection mode between the lower-level router and the lower-level router that can be established by the lower-level router through the router and the BAS, and then transmits network data corresponding to the router and the lower-level router.
可选的,该路由器根据该上级网络设备的代理前缀生成该路由器的本地前缀和该路由器的代理前缀,可以包括:Optionally, the router generates the local prefix of the router and the proxy prefix of the router according to the proxy prefix of the upper-level network device, which may include:
该路由器将该上级网络设备的代理前缀的最低比特位的下一比特位配置为第一比特值,并在该下一比特位后补随机值,以得到该路由器的本地前缀,使得该路由器的本地前缀的位数等于EUI的前缀位数;The router configures the next bit of the lowest bit of the proxy prefix of the upper-level network device as the first bit value, and supplements the next bit with a random value to obtain the local prefix of the router, so that the router's local prefix The number of bits of the local prefix is equal to the number of prefix bits of the EUI;
该路由器将该下一比特位配置为第二比特值,并对该上级网络设备的代理前缀的位数加一,以得到该路由器的代理前缀。其中,该第一比特值不同于该第二比特值。The router configures the next bit as the second bit value, and adds one to the number of bits of the proxy prefix of the upper-level network device to obtain the proxy prefix of the router. Wherein, the first bit value is different from the second bit value.
具体地,该第一比特值可以为0或1。若该第一比特值为0,则该第二比特值为1;对应的,若该第一比特值为1,则该第二比特值可以为0。举例来说,该路由器可以,是通过对该上级网路设备的代理前缀的最低比特位的下一比特位配置为比特值0,以得到该路由器的本地前缀,通过对该上级网路设备的代理前缀的最低比特位的下一比特位配置为比特值1,以得到该路由器的代理前缀。该路由器还可以是通过对该上级网路设备的代理前缀的最低比特位的下一比特位配置为比特值1,以得到该路由器的本地前缀,通过对该上级网路设备的代理前缀的最低比特位的下一比特位配置为比特值0,以得到该路由器的代理前缀。Specifically, the first bit value may be 0 or 1. If the value of the first bit is 0, the value of the second bit is 1; correspondingly, if the value of the first bit is 1, the value of the second bit may be 0. For example, the router can obtain the local prefix of the router by configuring the next bit of the lowest bit of the proxy prefix of the upper-level network device to be a bit value of 0, and obtain the local prefix of the router through the proxy prefix of the upper-level network device. The next bit of the least significant bit of the proxy prefix is configured as a bit value of 1 to obtain the proxy prefix of the router. The router can also obtain the local prefix of the router by configuring the next bit of the lowest bit of the proxy prefix of the upper-level network device to be a bit value of 1. The next bit of the bit is configured with a bit value of 0 to obtain the proxy prefix for this router.
可选的,该路由器否开启级联模式,可以是预先配置的。若该路由器开启级联模式,该路由器的LAN接口连接其他路由器,且该路由器可向该其他路由器发送DHCP报文的IA_PD消息。也就是说,若该路由器开启级联模式,与该路由器的LAN接口连接的其他路由器,如该下级路由器,该路由器可通过发送DHCP报文的IA_PD消息向该其他路由器下发该路由器的代理前缀。Optionally, whether the router enables the cascade mode may be pre-configured. If the router enables the cascading mode, the LAN interface of the router is connected to other routers, and the router can send the IA_PD message of the DHCP message to the other routers. That is to say, if the router enables cascading mode, other routers connected to the router's LAN interface, such as the lower-level router, the router can send the router's proxy prefix to the other routers by sending the IA_PD message of the DHCP message. .
若该路由器未开启级联模式,则该路由器对该上级网络设备的代理前缀的最低比特位后补随机值从而获取该路由器的本地前缀,根据该路由器的本地前缀确定该路由器连接的终端的IP地址,或者,将该路由器的本地前缀发送至该路由器连接的终端使得该路由器连接的终端根据该路由器的本地前缀生成该路由器连接的终端的IP地址。If the router does not enable the cascading mode, the router will add a random value to the lowest bit of the proxy prefix of the upper-level network device to obtain the local prefix of the router, and determine the IP of the terminal connected to the router according to the local prefix of the router. address, or, the local prefix of the router is sent to the terminal connected to the router, so that the terminal connected to the router generates the IP address of the terminal connected to the router according to the local prefix of the router.
可选的,该方法还包括:Optionally, the method further includes:
该路由器根据该路由器的本地前缀确定该路由器的LAN接口连接的终端的IP地址。The router determines the IP address of the terminal connected to the LAN interface of the router according to the local prefix of the router.
具体地,该路由器可以是根据该路由器的本地前缀,及该路由器为该路由器连接的终端分配的状态标识,生成有状态的该路由器连接的终端的IP地址。该路由器为该路由器连接的终端分配的状态标识可以是对该路由器连接的终端的编号,该路由器连接的不同终端分别具有不同的编号,即不同的状态标识。Specifically, the router may generate a stateful IP address of the terminal connected to the router according to the local prefix of the router and the state identifier allocated by the router to the terminal connected to the router. The state identifier assigned by the router to the terminal connected to the router may be the number of the terminal connected to the router, and different terminals connected to the router have different numbers, ie, different state identifiers.
可选的,该方法可包括:Optionally, the method may include:
该路由器将该路由器的本地前缀发送至该路由器的LAN接口连接的终端;该路由器的本地前缀用于使该路由器的LAN接口连接的终端根据该路由器的本地前缀确定该路由器的LAN接口连接的终端的IP地址。The router sends the local prefix of the router to the terminal connected to the LAN interface of the router; the local prefix of the router is used to enable the terminal connected to the LAN interface of the router to determine the terminal connected to the LAN interface of the router according to the local prefix of the router. IP address.
该路由器的LAN接口连接的终端的IP地址可以是将该路由器的LAN接口连接的终端的MAC地址转换为EUI地址,并根据转换后的EUI地址及该路由器的本地前缀,生成有状态的该路由器LAN接口连接的终端的IP地址。The IP address of the terminal connected to the LAN interface of the router can be converted from the MAC address of the terminal connected to the LAN interface of the router into an EUI address, and the stateful router is generated according to the converted EUI address and the local prefix of the router The IP address of the terminal connected to the LAN interface.
本发明实施例二还提供一种互联网协议地址分配方法。图3为本发明实施例二提供的互联网协议地址分配方法的流程图。如图3所示,该方法还包括:The second embodiment of the present invention also provides an Internet protocol address allocation method. FIG. 3 is a flowchart of a method for allocating an Internet Protocol address according to Embodiment 2 of the present invention. As shown in Figure 3, the method further includes:
S301、该路由器接收该上级网络设备发送的该上级网络设备的本地前缀。S301. The router receives the local prefix of the upper-level network device sent by the upper-level network device.
该路由器可以是通过接收该上级网络设备通过RA消息或DHCP报文的 IA_NA消息发送的该上级网络设备的本地前缀。The router may be the local prefix of the upper-level network device sent by the upper-level network device through the RA message or the IA_NA message of the DHCP message.
S302、该路由器根据该上级网络设备的本地前缀确定该路由器的WAN 接口的IP地址。S302. The router determines the IP address of the WAN interface of the router according to the local prefix of the upper-level network device.
该路由器根据该上级网络设备的本地前缀确定该路由器的WAN接口的IP地址,与上述该下级路由器根据该路由器的本地前缀确定该下级路由器的 WAN接口的IP地址的具体实现过程类似,在此不再赘述。The router determines the IP address of the WAN interface of the router according to the local prefix of the upper-level network device, which is similar to the specific implementation process in which the lower-level router determines the IP address of the WAN interface of the lower-level router according to the local prefix of the router. Repeat.
本发明实施例二提供的互联网协议地址的分配方法,可使得级联组网中,级联路由器连接的设备的IP地址更准确,保证级联组网数据的正常传输。The method for allocating Internet protocol addresses provided by the second embodiment of the present invention can make the IP addresses of the devices connected to the cascade routers more accurate in the cascaded networking, and ensure the normal transmission of the cascaded networking data.
实施例三Embodiment 3
本发明实施例三还提供一种互联网协议地址分配方法。图4位本发明实施例三的级联组网的结构示意图。如图4所示,该级联组网中,BAS 401与第一路由器402的WAN接口连接。该第一路由器402的一个LAN接口与第一终端403连接,该第一路由器402的另一个LAN接口与第二路由器404的 WAN接口连接。第二路由器404的一个LAN接口与第二终端405连接,第二路由器404的另一个LAN接口与第三路由器406的WAN接口连接。需要说明的是,该第三路由器406的LAN接口可连接其他终端或路由器,以实现多级级联。The third embodiment of the present invention also provides an Internet protocol address allocation method. FIG. 4 is a schematic structural diagram of a cascaded networking according to Embodiment 3 of the present invention. As shown in FIG. 4 , in the cascaded networking, the BAS 401 is connected to the WAN interface of the first router 402 . One LAN interface of the first router 402 is connected to the first terminal 403 , and the other LAN interface of the first router 402 is connected to the WAN interface of the second router 404 . One LAN interface of the second router 404 is connected to the second terminal 405 , and the other LAN interface of the second router 404 is connected to the WAN interface of the third router 406 . It should be noted that, the LAN interface of the third router 406 can be connected to other terminals or routers, so as to realize multi-level cascading.
图5为本发明实施例三提供的互联网协议地址分配方法的流程图。如图 5所示,该方法可包括:FIG. 5 is a flowchart of a method for allocating an Internet Protocol address according to Embodiment 3 of the present invention. As shown in Figure 5, the method may include:
S501、BAS根据第一路由器发送的RS消息确定该BAS的本地前缀和该 BAS的代理前缀。S501. The BAS determines the local prefix of the BAS and the proxy prefix of the BAS according to the RS message sent by the first router.
该BAS的本地前缀可以通过该BAS的本地前缀和该BAS的本地前缀的长度表示。该BAS的本地前缀例如可以表示为2014::/64,即该BAS的本地前缀的长度为64位。The local prefix of the BAS can be represented by the local prefix of the BAS and the length of the local prefix of the BAS. For example, the local prefix of the BAS may be represented as 2014::/64, that is, the length of the local prefix of the BAS is 64 bits.
该BAS的代理前缀的比特位可小于EUI的前缀位数,如64位,该BS 的代理前缀的比特位例如可以为60位。该BAS的代理前缀可表示为 2014:1010::/60。The bits of the proxy prefix of the BAS may be smaller than the prefix bits of the EUI, such as 64 bits, and the bits of the proxy prefix of the BS may be, for example, 60 bits. The proxy prefix for this BAS can be represented as 2014:1010::/60.
S502、该BAS将该BAS的本地前缀携带在RA消息或DHCP的IA_NA 消息中发送至第一路由器,将该BAS的代理前缀携带在该DHCP的IA_PD 消息中发送至该第一路由器。S502. The BAS carries the local prefix of the BAS in the RA message or the IA_NA message of the DHCP and sends it to the first router, and carries the proxy prefix of the BAS in the IA_PD message of the DHCP and sends it to the first router.
S503、该第一路由器根据该BAS的本地前缀生成该第一路由器的WAN 接口的IP地址。S503. The first router generates the IP address of the WAN interface of the first router according to the local prefix of the BAS.
该第一路由器可以根据该BAS的本地前缀及该第一路由器的状态标识生成该第一路由器的WAN接口的IP地址。若该第一路由器的状态标识为1,则该第一路由器的WAN接口的IP地址可以表示为2014::1。The first router may generate the IP address of the WAN interface of the first router according to the local prefix of the BAS and the state identifier of the first router. If the state identifier of the first router is 1, the IP address of the WAN interface of the first router may be represented as 2014::1.
S504、若该第一路由器开启级联模式,该第一路由器将该BAS的代理前缀的最低比特位的下一比特位配置为比特值0,并在该BAS的代理前缀的最低比特位的下一比特位后补随机值,以得到该第一路由器的本地前缀,使得该第一路由器的本地前缀的位数等于EUI的前缀位数。S504. If the first router enables the cascading mode, the first router configures the next bit of the lowest bit of the proxy prefix of the BAS to a bit value of 0, and configures the next bit of the lowest bit of the proxy prefix of the BAS to a bit value of 0, and the first router is below the lowest bit of the proxy prefix of the BAS. One bit is followed by a random value to obtain the local prefix of the first router, so that the number of bits of the local prefix of the first router is equal to the number of prefix bits of the EUI.
S505、该第一路由器将该BAS的代理前缀的最低比特位的下一比特位配置为比特值1,并对该BAS的代理前缀的位数加一,以得到该第一路由器的代理前缀。S505. The first router configures the next bit of the lowest bit of the proxy prefix of the BAS as a bit value of 1, and adds one to the number of bits of the proxy prefix of the BAS to obtain the proxy prefix of the first router.
该BAS的代理前缀的比特位为60位,EUI的前缀位数为64位,那么该第一路由器可以在该BAS的代理前缀的最低比特位的下一比特位,也就是第 61比特位配置为0,第62至第64比特位根据随机数进行配置,以得到该第一路由器的本地前缀。该第一路由器的本地前缀例如可以表示为 2014:1010::0003/64。在该第一路由器的本地前缀的第62至第64比特位的值即011为随机数。该第一路由器的本地前缀的比特位数可等于该EUI的前缀位数,如64位。The bits of the proxy prefix of the BAS are 60 bits, and the prefix bits of the EUI are 64 bits, so the first router can be configured in the next bit of the lowest bit of the proxy prefix of the BAS, that is, the 61st bit. If it is 0, the 62nd to 64th bits are configured according to random numbers to obtain the local prefix of the first router. The local prefix of the first router may be represented as 2014:1010::0003/64, for example. The value of the 62nd to 64th bits of the local prefix of the first router, namely 011, is a random number. The number of bits of the local prefix of the first router may be equal to the number of bits of the prefix of the EUI, eg, 64 bits.
该第一路由器可以是在该BAS的代理前缀的第61比特位配置为比特值 1,并对该BAS的代理前缀的位数加一,以得到该第一路由器的代理前缀。该第一路由器的代理前缀例如可以表示为2014:1010::0008/61。The first router may be configured with a bit value of 1 at the 61st bit of the proxy prefix of the BAS, and add one to the number of bits of the proxy prefix of the BAS to obtain the proxy prefix of the first router. The proxy prefix of the first router may be represented as 2014:1010::0008/61, for example.
S506、该第一路由器根据该第一路由器的本地前缀生成该第一终端的IP 地址。S506. The first router generates the IP address of the first terminal according to the local prefix of the first router.
该第一路由器根据该第一路由器的本地前缀和该第一路由器为该第一终端分配的状态标识生成该第一终端的IP地址。若该第一终端的状态标识为2,则该第一终端的IP地址可以表示为2014:1010:0003::2。The first router generates the IP address of the first terminal according to the local prefix of the first router and the state identifier allocated to the first terminal by the first router. If the status identifier of the first terminal is 2, the IP address of the first terminal may be represented as 2014:1010:0003::2.
S507、该第一路由器将该第一路由器的本地前缀携带在RA消息或DHCP 的IA_NA消息中发送至第二路由器,将该第一路由器的代理前缀携带在该 DHCP的IA_PD消息中发送至该第二路由器。S507. The first router carries the local prefix of the first router in the RA message or the IA_NA message of the DHCP and sends it to the second router, and carries the proxy prefix of the first router in the IA_PD message of the DHCP and sends it to the second router Two routers.
S508、该第二路由器根据该第一路由器的本地前缀生成该第二路由器的 WAN接口的IP地址。S508. The second router generates the IP address of the WAN interface of the second router according to the local prefix of the first router.
该第二路由器可以根据该第一路由器的本地前缀及该第二路由器的状态标识生成该第二路由器的WAN接口的IP地址。若该第二路由器的状态标识为1,则该第二路由器的WAN接口的IP地址可以表示为2014:1010:0003::1。The second router may generate the IP address of the WAN interface of the second router according to the local prefix of the first router and the state identifier of the second router. If the status identifier of the second router is 1, the IP address of the WAN interface of the second router may be represented as 2014:1010:0003::1.
S509、若该第二路由器开启级联模式,该第二路由器通过在该第一路由器的代理前缀的最低比特位的下一比特位配置为比特值0,并在该第一路由器的代理前缀的最低比特位的下一比特位后补随机值,以得到该第二路由器的本地前缀,使得该第二路由器的本地前缀的位数等于EUI的前缀位数。S509. If the second router enables the cascading mode, the second router is configured with a bit value of 0 through the next bit of the lowest bit of the proxy prefix of the first router, and the proxy prefix of the first router is configured with a bit value of 0. The next bit of the least significant bit is followed by a random value to obtain the local prefix of the second router, so that the number of bits of the local prefix of the second router is equal to the number of prefix bits of the EUI.
S510、该第二路由器将该第一路由器的代理前缀的最低比特位的下一比特位配置为比特值1,并对该第一路由器的代理前缀的位数加一,以得到该第二路由器的代理前缀。S510. The second router configures the next bit of the lowest bit of the proxy prefix of the first router as a bit value of 1, and adds one to the number of bits of the proxy prefix of the first router to obtain the second router proxy prefix.
该第一路由器的代理前缀的比特位数为61位,那么该第二路由器可以在该第一路由器的代理前缀的最低比特位的下一比特位,也就是第62比特位配置为比特值0,并将第63至第64比特位配置为随机数,以得到该第二路由器的本地前缀。该第二路由器的本地前缀例如可以表示为 2014:1010::0009/64,在该第二路由器的本地前缀的第63至第64比特位的值 01为随机数。The number of bits of the proxy prefix of the first router is 61 bits, then the second router can configure the bit value 0 in the next bit of the lowest bit of the proxy prefix of the first router, that is, the 62nd bit , and configure the 63rd to 64th bits as random numbers to obtain the local prefix of the second router. The local prefix of the second router can be represented as, for example, 2014:1010::0009/64, and the value 01 in the 63rd to 64th bits of the local prefix of the second router is a random number.
该第二路由器可以是在该第一路由器的代理前缀的第62比特位配置为比特值1,并对该第一路由器的代理前缀加一,以得到该第二路由器的代理前缀。该第二路由器的代理前缀例如可以表示为2014:1010::000C/62。The second router may configure the 62nd bit of the proxy prefix of the first router as a bit value of 1, and add one to the proxy prefix of the first router to obtain the proxy prefix of the second router. The proxy prefix of the second router may be represented as 2014:1010::000C/62, for example.
S511、该第二路由器根据该第二路由器的本地前缀生成该第二终端的IP 地址。S511. The second router generates the IP address of the second terminal according to the local prefix of the second router.
该第二路由器根据该第二路由器的本地前缀和该第二路由器为该第二终端分配的状态标识生成该第二终端的IP地址。若该第二终端的状态标识为2,则该第二终端的IP地址可以表示为2014:1010:0009::2。The second router generates the IP address of the second terminal according to the local prefix of the second router and the state identifier allocated to the second terminal by the second router. If the status identifier of the second terminal is 2, the IP address of the second terminal may be represented as 2014:1010:0009::2.
S512、该第二路由器将该第二路由器的本地前缀携带在RA消息或DHCP 的IA_NA消息中发送至第三路由器。S512 , the second router carries the local prefix of the second router in an RA message or an IA_NA message of DHCP and sends it to the third router.
S513、该第三路由器根据该第二路由器的本地前缀生成该第三路由器的 WAN接口的IP地址。S513. The third router generates the IP address of the WAN interface of the third router according to the local prefix of the second router.
该第三路由器可以根据该第二路由器的本地前缀及该第三路由器的状态标识生成该第三路由器的WAN接口的IP地址。若该第三路由器的状态标识为1,则该第三路由器的WAN接口的IP地址可以表示为2014:1010:0009::1。The third router may generate the IP address of the WAN interface of the third router according to the local prefix of the second router and the state identifier of the third router. If the status identifier of the third router is 1, the IP address of the WAN interface of the third router may be represented as 2014:1010:0009::1.
本发明实施例三提供的互联网协议地址分配方法,通过具体的实例对上述任一实施例的方法进行具体说明,其有益效果与上述实施例类似,在此不再赘述。The method for allocating an Internet Protocol address provided by the third embodiment of the present invention is described in detail by using a specific example to describe the method of any of the above embodiments, and the beneficial effects thereof are similar to those of the above embodiments, and are not repeated here.
实施例四Embodiment 4
本发明实施例四还提供一种路由器。该路由器可执行上述实施例一至实施例三中任一实施例的互联网协议地址分配方法。图6为本发明实施例四的路由器的结构示意图。如图6所示,该路由器600可包括:接收模块601、生成模块602及发送模块603。The fourth embodiment of the present invention also provides a router. The router can execute the method for allocating an Internet Protocol address according to any one of the foregoing Embodiments 1 to 3. FIG. 6 is a schematic structural diagram of a router according to Embodiment 4 of the present invention. As shown in FIG. 6 , the router 600 may include: a receiving module 601 , a generating module 602 and a sending module 603 .
接收模块601,用于接收上级网络设备发送的该上级网络设备的代理前缀;该上级网络设备为该路由器的WAN接口连接的网络设备。The receiving module 601 is configured to receive the proxy prefix of the upper-level network device sent by the upper-level network device; the upper-level network device is the network device connected to the WAN interface of the router.
生成模块602,用于根据该上级网络设备的代理前缀生成该路由器的本地前缀和该路由器的代理前缀。The generating module 602 is configured to generate the local prefix of the router and the proxy prefix of the router according to the proxy prefix of the upper-level network device.
发送模块603,用于将该路由器的本地前缀和该路由器的代理前缀发送至该路由器的下级路由器;该下级路由器为该路由器的LAN接口连接的路由器;该路由器的本地前缀用于使该下级路由器确定该下级路由器的WAN接口的IP地址;该路由器的代理前缀用于使得该下级路由器生成该下级路由器的本地前缀。The sending module 603 is used for sending the local prefix of the router and the proxy prefix of the router to the subordinate router of the router; the subordinate router is the router connected to the LAN interface of the router; the local prefix of the router is used to make the subordinate router Determine the IP address of the WAN interface of the subordinate router; the proxy prefix of the router is used to make the subordinate router generate the local prefix of the subordinate router.
可选的,该上级网络设备为该路由器的WAN接口连接的BAS或路由器。Optionally, the upper-level network device is a BAS or a router connected to the WAN interface of the router.
可选的,生成模块602,还用于若该路由器开启级联模式,根据该上级网络设备的代理前缀生成该路由器的本地前缀和该路由器的代理前缀。Optionally, the generating module 602 is further configured to generate the local prefix of the router and the proxy prefix of the router according to the proxy prefix of the upper-level network device if the router enables the cascade mode.
可选的,生成模块602,还用于将该上级网络设备的代理前缀的最低比特位的下一比特位配置为第一比特值,并在所述下一比特位后补随机值以得到所述路由器的本地前缀,使得该路由器的本地前缀的位数等于EUI的前缀位数;将所述下一比特位配置为第二比特值,并对所述上级网络设备的代理前缀的位数加一,以得到该路由器的代理前缀;其中,所述第一比特值不同于所述第二比特值。Optionally, the generating module 602 is further configured to configure the next bit of the lowest bit of the proxy prefix of the upper-level network device as the first bit value, and add a random value after the next bit to obtain the result. The local prefix of the router, so that the number of bits of the local prefix of the router is equal to the number of prefix bits of the EUI; the next bit is configured as the second bit value, and the number of bits of the proxy prefix of the upper-level network device is added. One, to obtain the proxy prefix of the router; wherein the first bit value is different from the second bit value.
可选的,该上级网络设备的代理前缀的位数小于该终端唯一标识符EUI 的前缀位数。Optionally, the number of bits of the proxy prefix of the upper-level network device is less than the number of bits of the prefix of the terminal unique identifier EUI.
本发明实施例四提供的路由器可执行上述实施例一至实施例三中任一实施例的互联网协议地址分配方法,其有益效果与上述实施例类似,在此不再赘述。The router provided in Embodiment 4 of the present invention can execute the Internet Protocol address allocation method in any of the foregoing Embodiments 1 to 3, and the beneficial effects thereof are similar to those of the foregoing embodiments, which will not be repeated here.
实施例五Embodiment 5
本发明实施例五还提供一种路由器。图7为本发明实施例五提供的路由器的结构示意图。如图7所示,该路由器700可包括:接收机701、处理器 702及发射机703。The fifth embodiment of the present invention also provides a router. FIG. 7 is a schematic structural diagram of a router according to Embodiment 5 of the present invention. As shown in FIG. 7 , the router 700 may include: a receiver 701, a processor 702 and a transmitter 703.
接收机701,用于接收上级网络设备发送的该上级网络设备的代理前缀;该上级网络设备为该路由器的WAN接口连接的网络设备。The receiver 701 is configured to receive the proxy prefix of the upper-level network device sent by the upper-level network device; the upper-level network device is the network device connected to the WAN interface of the router.
处理器702,用于根据该上级网络设备的代理前缀生成该路由器的本地前缀和该路由器的代理前缀。The processor 702 is configured to generate the local prefix of the router and the proxy prefix of the router according to the proxy prefix of the upper-level network device.
发射机703,用于将该路由器的本地前缀和该路由器的代理前缀发送至该路由器的下级路由器;该下级路由器为该路由器的LAN接口连接的路由器;该路由器的本地前缀用于使该下级路由器确定该下级路由器的WAN接口的IP地址;该路由器的代理前缀用于使得该下级路由器生成该下级路由器的本地前缀。The transmitter 703 is used to send the local prefix of the router and the proxy prefix of the router to the subordinate router of the router; the subordinate router is the router connected to the LAN interface of the router; the local prefix of the router is used to make the subordinate router Determine the IP address of the WAN interface of the subordinate router; the proxy prefix of the router is used to make the subordinate router generate the local prefix of the subordinate router.
可选的,该上级网络设备为该路由器的WAN接口连接的BAS或路由器。Optionally, the upper-level network device is a BAS or a router connected to the WAN interface of the router.
可选的,处理器702,还用于若该路由器开启级联模式,根据该上级网络设备的代理前缀生成该路由器的本地前缀和该路由器的代理前缀。Optionally, the processor 702 is further configured to generate the local prefix of the router and the proxy prefix of the router according to the proxy prefix of the upper-level network device if the router enables the cascade mode.
可选的,处理器702,还用于将该上级网络设备的代理前缀的最低比特位的下一比特位配置为第一比特值,并在该下一比特位后补随机值,以得到所述路由器的本地前缀,使得该路由器的本地前缀的位数等于EUI的前缀位数;将所述下一比特位配置为第二比特值,并对所述上级网络设备的代理前缀的位数加一,以得到该路由器的代理前缀。其中,所述第一比特值不同于所述第二比特值。Optionally, the processor 702 is further configured to configure the next bit of the lowest bit of the proxy prefix of the upper-level network device as the first bit value, and add a random value to the next bit to obtain the desired value. The local prefix of the router, so that the number of bits of the local prefix of the router is equal to the number of prefix bits of the EUI; the next bit is configured as the second bit value, and the number of bits of the proxy prefix of the upper-level network device is added. One, to get the proxy prefix for that router. Wherein, the first bit value is different from the second bit value.
可选的,所述上级网络设备的代理前缀的位数小于所述EUI的前缀位数。Optionally, the number of bits of the proxy prefix of the upper-level network device is less than the number of bits of the prefix of the EUI.
本发明实施例五提供的路由器可执行上述实施例一至实施例三中任一实施例的互联网协议地址分配方法,其有益效果与上述实施例类似,在此不再赘述。The router provided in Embodiment 5 of the present invention can execute the Internet Protocol address allocation method in any of the foregoing Embodiments 1 to 3, and the beneficial effects thereof are similar to those of the foregoing embodiments, which will not be repeated here.
实施例六Embodiment 6
本发明实施例六还提供一种计算机可读存储介质。图8为本发明实施例六提供的计算机可读存储介质的结构示意图。如图8所示,该计算机可读介质800包括:至少一个程序801;该至少一个程序包括计算机可读指令802。Embodiment 6 of the present invention further provides a computer-readable storage medium. FIG. 8 is a schematic structural diagram of a computer-readable storage medium according to Embodiment 6 of the present invention. As shown in FIG. 8 , the computer-readable medium 800 includes: at least one program 801 ; the at least one program includes computer-readable instructions 802 .
计算机可读指令802,用于使路由器的处理器调取并执行,以接收上级网络设备发送的该上级网络设备的代理前缀,根据该上级网络设备的代理前缀生成该路由器的本地前缀和该路由器的代理前缀,将该路由器的本地前缀和该路由器的代理前缀发送至该路由器的下级路由器;其中,该上级网络设备为该路由器的WAN接口连接的网络设备;该下级路由器为该路由器的 LAN接口连接的路由器;该路由器的本地前缀用于使该下级路由器确定该下级路由器的WAN接口的IP地址;该路由器的代理前缀用于使得该下级路由器生成该下级路由器的本地前缀。Computer-readable instructions 802, used to cause the processor of the router to call and execute, to receive the proxy prefix of the upper-level network device sent by the upper-level network device, and generate the local prefix of the router and the router according to the proxy prefix of the upper-level network device. The proxy prefix of the router, the local prefix of the router and the proxy prefix of the router are sent to the lower-level router of the router; wherein, the upper-level network device is the network device connected to the WAN interface of the router; the lower-level router is the LAN interface of the router The connected router; the local prefix of the router is used to enable the subordinate router to determine the IP address of the WAN interface of the subordinate router; the proxy prefix of the router is used to enable the subordinate router to generate the local prefix of the subordinate router.
可选的,该上级网络设备为该路由器的WAN接口连接的BAS或路由器。Optionally, the upper-level network device is a BAS or a router connected to the WAN interface of the router.
可选的,计算机可读指令802,还用于在该路由器开启级联模式时,使得该路由器的处理器调取并执行,以根据该上级网络设备的代理前缀生成该路由器的本地前缀和该路由器的代理前缀。Optionally, the computer-readable instructions 802 are further used to cause the processor of the router to call and execute when the router turns on the cascade mode, so as to generate the local prefix of the router and the proxy prefix of the upper-level network device according to the proxy prefix of the upper-level network device. The router's proxy prefix.
可选的,计算机可读指令802,还用于使得该路由器的处理器调取并执行,以将该上级网络设备的代理前缀的最低比特位的下一比特位配置为第一比特值,并在该下一比特位后补随机值,以得到该路由器的本地前缀,使得该路由器的本地前缀的位数等于EUI的前缀位数,将该下一比特位配置为第二比特值,并对该上级网络设备的代理前缀的位数加一,以得到该路由器的代理前缀;其中,该第一比特值不同于该第二比特值。Optionally, the computer-readable instructions 802 are further used to cause the processor of the router to call and execute, to configure the next bit of the lowest bit of the proxy prefix of the upper-level network device as the first bit value, and A random value is added after the next bit to obtain the local prefix of the router, so that the number of bits of the local prefix of the router is equal to the number of prefix bits of the EUI, the next bit is configured as the second bit value, and the The number of bits of the proxy prefix of the upper-level network device is increased by one to obtain the proxy prefix of the router; wherein the first bit value is different from the second bit value.
可选的,该上级网络设备的代理前缀的位数小于该EUI的前缀位数。Optionally, the number of bits of the proxy prefix of the upper-level network device is less than the number of bits of the prefix of the EUI.
本发明实施例六提供的计算机可读存储介质,可包括计算机可读指令的至少一个程序,用于使得路由器的处理器调用并执行,从而实现上述实施例一至实施例三中任一所述的互联网协议地址分配方法,其有益效果与上述实施例类似,在此不再赘述。The computer-readable storage medium provided in Embodiment 6 of the present invention may include at least one program of computer-readable instructions, which is used to cause the processor of the router to call and execute, thereby implementing any of the foregoing Embodiments 1 to 3. The beneficial effects of the method for allocating an Internet protocol address are similar to those of the above-mentioned embodiment, which will not be repeated here.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by program instructions related to hardware, the aforementioned program can be stored in a computer-readable storage medium, and when the program is executed, execute It includes the steps of the above method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes.
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The technical solutions described in the foregoing embodiments can still be modified, or some or all of the technical features thereof can be equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the embodiments of the present invention. scope.
Claims (13)
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2015/080206 WO2016191906A1 (en) | 2015-05-29 | 2015-05-29 | Internet protocol address allocation method and router |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106576120A CN106576120A (en) | 2017-04-19 |
CN106576120B true CN106576120B (en) | 2019-09-13 |
Family
ID=57439857
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201580044872.0A Active CN106576120B (en) | 2015-05-29 | 2015-05-29 | Internet Protocol address assignment method, router, and computer-readable storage medium |
Country Status (6)
Country | Link |
---|---|
US (1) | US10432579B2 (en) |
EP (1) | EP3255866B1 (en) |
JP (1) | JP6517377B2 (en) |
KR (1) | KR101974023B1 (en) |
CN (1) | CN106576120B (en) |
WO (1) | WO2016191906A1 (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111314567B (en) * | 2020-01-20 | 2021-10-26 | 广州芯德通信科技股份有限公司 | Communication method based on cascade connection of multiple IAD (inter-integrated access device) devices |
JP6990745B2 (en) * | 2020-06-10 | 2022-01-12 | エレコム株式会社 | IPv6 CE router with built-in interface setting program, interface setting method, and interface setting program for IPv6 CE router |
US11973739B2 (en) * | 2021-06-16 | 2024-04-30 | Verizon Patent And Licensing Inc. | Systems and methods for supporting host devices with a single network address when multiple prefixes are delegated |
US11870694B2 (en) * | 2021-11-19 | 2024-01-09 | Qualcomm Incorporated | Network prefix-generating customer premises equipment |
CN114339835B (en) * | 2021-12-30 | 2023-06-06 | 瑞斯康达科技发展股份有限公司 | Small base station opening method, small base station and small base station system |
JP7481638B2 (en) | 2022-03-31 | 2024-05-13 | ダイキン工業株式会社 | Air conditioning system and IP address generation method |
CN117640368A (en) * | 2022-08-19 | 2024-03-01 | 华为技术有限公司 | Routing method, access equipment and medium of home network |
CN117714266B (en) * | 2023-08-30 | 2024-08-23 | 荣耀终端有限公司 | Communication method and electronic device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1879425A (en) * | 2003-11-10 | 2006-12-13 | 思科技术公司 | Arrangement in an access router for optimizing mobile router connections based on delegated network prefixes |
CN101572692A (en) * | 2008-04-28 | 2009-11-04 | 华为技术有限公司 | Method, system and equipment for IP address assignment |
WO2014058488A1 (en) * | 2012-10-11 | 2014-04-17 | Cable Television Laboratories, Inc. | Adaptive prefix delegation |
Family Cites Families (24)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
AU743258B2 (en) * | 1997-01-03 | 2002-01-24 | Fortress Technologies, Inc. | Improved network security device |
JP3725070B2 (en) * | 2001-12-21 | 2005-12-07 | 株式会社東芝 | Network system, router, host, prefix management method and IP address management method |
US20040019664A1 (en) * | 2002-02-15 | 2004-01-29 | Franck Le | Method and system for discovering a network element in a network such as an agent in an IP network |
US7454519B2 (en) * | 2002-03-22 | 2008-11-18 | Motorola, Inc. | Method for automatically allocating address prefixes |
JP4028331B2 (en) | 2002-08-30 | 2007-12-26 | 富士通株式会社 | Router that automatically generates an IP address |
US7246231B2 (en) * | 2002-10-31 | 2007-07-17 | Ntt Docomo, Inc. | Location privacy through IP address space scrambling |
US7333461B2 (en) * | 2003-06-05 | 2008-02-19 | Cisco Technology, Inc. | Arrangement in a router of a mobile network for generating a local router prefix for anonymous route connections |
JP2005072685A (en) * | 2003-08-27 | 2005-03-17 | Ntt Docomo Inc | Router device, route information distribution method in the device, and communication system |
US7039035B2 (en) | 2003-11-10 | 2006-05-02 | Cisco Technology, Inc. | Arrangement in an access router for optimizing mobile router connections based on delegated network prefixes |
JP3950874B2 (en) * | 2004-07-01 | 2007-08-01 | 株式会社東芝 | Network connection device, route information distribution program, and route information distribution method |
KR20060002564A (en) * | 2004-07-02 | 2006-01-09 | 삼성전자주식회사 | washer |
FR2879871B1 (en) | 2004-12-20 | 2007-03-09 | Cit Alcatel | DEVICE FOR DYNAMICALLY ALLOCATING VARIABLE LENGTH PREFIXES FOR NETWORK EQUIPMENT OF AN IP NETWORK |
US7894433B2 (en) * | 2005-08-08 | 2011-02-22 | Cisco Technology, Inc. | Default gateway router supplying IP address prefixes ordered for source address selection by host device |
CN100499674C (en) * | 2006-01-06 | 2009-06-10 | 华为技术有限公司 | Method for distributing terminal device IP address under router |
EP3042668B1 (en) * | 2006-06-07 | 2018-09-19 | The Board of Trustees of the Leland Stanford Junior University | Anti-leukocyte recruitment therapy for the treatment of seizures and epilepsy |
US8102775B2 (en) * | 2007-03-12 | 2012-01-24 | Cisco Technology, Inc. | Joining tree-based networks into an autonomous system using peer connections between the tree-based networks |
US8045558B2 (en) * | 2007-04-23 | 2011-10-25 | Cisco Technology, Inc. | Extensions to IPv6 neighbor discovery protocol for automated prefix delegation |
US8219800B2 (en) * | 2007-06-06 | 2012-07-10 | Cisco Technology, Inc. | Secure neighbor discovery router for defending host nodes from rogue routers |
CN102413033B (en) * | 2010-09-26 | 2015-07-08 | 华为技术有限公司 | Method, device and system for realizing route aggregation |
US8995360B2 (en) * | 2011-06-09 | 2015-03-31 | Time Warner Cable Enterprises Llc | Techniques for prefix subnetting |
JP6029449B2 (en) | 2012-12-17 | 2016-11-24 | 三菱電機株式会社 | Smart meter system, management router and meter |
US9467482B2 (en) * | 2013-01-31 | 2016-10-11 | Cable Television Laboratories, Inc. | Reverse prefix delegation |
US9438507B2 (en) * | 2013-05-31 | 2016-09-06 | Cisco Technology, Inc. | Routing aggregation and prefix delegation |
EP2955904B1 (en) * | 2014-06-10 | 2016-10-19 | Siemens Aktiengesellschaft | Allocation of network addresses for network participants |
-
2015
- 2015-05-29 JP JP2017567514A patent/JP6517377B2/en active Active
- 2015-05-29 EP EP15893570.0A patent/EP3255866B1/en active Active
- 2015-05-29 US US15/556,553 patent/US10432579B2/en active Active
- 2015-05-29 CN CN201580044872.0A patent/CN106576120B/en active Active
- 2015-05-29 KR KR1020177026824A patent/KR101974023B1/en active Active
- 2015-05-29 WO PCT/CN2015/080206 patent/WO2016191906A1/en active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1879425A (en) * | 2003-11-10 | 2006-12-13 | 思科技术公司 | Arrangement in an access router for optimizing mobile router connections based on delegated network prefixes |
CN101572692A (en) * | 2008-04-28 | 2009-11-04 | 华为技术有限公司 | Method, system and equipment for IP address assignment |
WO2014058488A1 (en) * | 2012-10-11 | 2014-04-17 | Cable Television Laboratories, Inc. | Adaptive prefix delegation |
Also Published As
Publication number | Publication date |
---|---|
JP6517377B2 (en) | 2019-05-22 |
EP3255866A1 (en) | 2017-12-13 |
JP2018509120A (en) | 2018-03-29 |
EP3255866A4 (en) | 2018-03-28 |
WO2016191906A1 (en) | 2016-12-08 |
US20180054415A1 (en) | 2018-02-22 |
KR20170118905A (en) | 2017-10-25 |
US10432579B2 (en) | 2019-10-01 |
CN106576120A (en) | 2017-04-19 |
EP3255866B1 (en) | 2019-08-21 |
KR101974023B1 (en) | 2019-04-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106576120B (en) | Internet Protocol address assignment method, router, and computer-readable storage medium | |
CN108848100B (en) | A stateful IPv6 address generation method and device | |
EP3264731B1 (en) | Method, relay agent, and system for acquiring internet protocol address in network | |
JP5967173B2 (en) | Network relay device, method for setting operation mode of packet relay processing unit included in network relay device, and computer program | |
US20120324063A1 (en) | Method, network device, and system for automatically configuring network device in ipv6 network | |
CN112654049B (en) | Method, system, node and medium for configuring a wireless communication coverage extension system | |
CN101656725A (en) | Method for implementing safety access and access equipment | |
CN103561122B (en) | IPv6 address collocation method, IPv6 client and server | |
JP5241957B2 (en) | Method and apparatus for connecting a subscriber unit to an aggregation network supporting IPv6 | |
EP2765743A1 (en) | Layer 2 inter-connecting method, apparatus and system based on ipv6 | |
CN103916484A (en) | IP-address configuring method and device | |
CN108206783A (en) | Address configuration method and its device in a kind of software defined network system | |
EP2690832B1 (en) | Communication device, communication system, and communication method | |
CN103051544B (en) | Realize method and the access device of IPv4 private network access IPv6 network | |
US20160065536A1 (en) | Home gateway apparatus and packet transfer method | |
CN103701942B (en) | Prevent client from frequently initiating the methods, devices and systems of IP address distribution request | |
CN102075921B (en) | Inter-network communication method and device | |
CN110636146B (en) | User address allocation method and device | |
US10673809B2 (en) | Technique for managing an address in a local area network | |
CN102291628B (en) | Method for obtaining information of network business server, client and DHCP (dynamic host configuration protocol) device | |
KR101303030B1 (en) | Method for operating and searching host in internet protocol version 6 network | |
JP2016515371A (en) | Packet transmission method and apparatus, and server | |
CN104717313B (en) | mDNS gateway address configuration method and device | |
EP3264724B1 (en) | Method and apparatus for sending, transferring and acquiring capability | |
CN104662860A (en) | Method and apparatus for processing control rules |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |