WO2012163000A1 - 一种报文转发的方法、设备及系统 - Google Patents

一种报文转发的方法、设备及系统 Download PDF

Info

Publication number
WO2012163000A1
WO2012163000A1 PCT/CN2011/080647 CN2011080647W WO2012163000A1 WO 2012163000 A1 WO2012163000 A1 WO 2012163000A1 CN 2011080647 W CN2011080647 W CN 2011080647W WO 2012163000 A1 WO2012163000 A1 WO 2012163000A1
Authority
WO
WIPO (PCT)
Prior art keywords
prefix
dhcpv6
ipv6 address
intermediate router
length
Prior art date
Application number
PCT/CN2011/080647
Other languages
English (en)
French (fr)
Inventor
戴岳华
罗勇
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN2011800021977A priority Critical patent/CN102439918A/zh
Priority to PCT/CN2011/080647 priority patent/WO2012163000A1/zh
Publication of WO2012163000A1 publication Critical patent/WO2012163000A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/659Internet protocol version 6 [IPv6] addresses

Definitions

  • the invention relates to the field of network communication technologies, and in particular, to a packet forwarding method, device and system.
  • IPv6 Internet Protocol Version
  • DHCPv6 Dynamic Host Configuration Protocol for IPv6, IPv6 dynamic host configuration protocol
  • the server sends a DHCPv6 request packet, and the DHCPv6 request packet includes IA_NA (Identity Association for Non-temporary Addresses, identity associations for non-temporary addresses) or IA_TA (Identity Association for Temporary) Addresses, the identity of the temporary address).
  • IA_NA Identity Association for Non-temporary Addresses, identity associations for non-temporary addresses
  • IA_TA Identity Association for Temporary
  • the DHCPv6 server After receiving the DHCPv6 request message, the DHCPv6 server allocates an IPv6 address to the user host, and returns a DHCPv6 response message to the user host, and the assigned IPv6 address is carried in the DHCPv6 response.
  • the intermediate router does DHCPv6 A relay (relay) generates a neighbor entry in the neighbor table according to the prefix of the IPv6 address carried in the DHCPv6 response packet, and then forwards the DHCPv6 response packet according to the neighbor table.
  • router devices generally have a problem of less neighbor table resources. Therefore, the nodes that the router can connect are limited, and the network size is limited. If you need to expand the network scale, you need to increase the corresponding router, which increases the cost of networking.
  • the object of the present invention is to provide a method, device and system for packet forwarding, which solves the problem caused by a small number of neighbor table resources of a router device.
  • a method for forwarding a message including:
  • the intermediate router forwards the dynamic host configuration protocol DHCPv6 request packet sent by the user host to the DHCPv6 server.
  • the intermediate router receives a DHCPv6 response message sent by the DHCPv6 server, where the DHCPv6 response message carries an Internet Protocol IPv6 address allocated for the user host;
  • the intermediate router acquires a length of a prefix of an IPv6 address
  • the intermediate router generates a prefix routing entry according to the prefix, and forwards the DHCPv6 response packet according to the prefix routing entry.
  • a router that includes:
  • the request message forwarding module is configured to forward the dynamic host configuration protocol DHCPv6 request message sent by the user host to the DHCPv6 server;
  • the response message receiving module is configured to receive a DHCPv6 response message sent by the DHCPv6 server, where the DHCPv6 response message carries an Internet Protocol IPv6 address allocated for the user host;
  • a prefix obtaining module configured to obtain a prefix of an IPv6 address, and obtain a prefix of an IPv6 address from the IPv6 address according to the length of the prefix;
  • the route forwarding module is configured to generate a prefix routing entry according to the prefix, and forward the DHCPv6 response packet according to the prefix routing entry.
  • a dynamic host configuration protocol DHCP server is connected to a user host through an intermediate router, and the DHCP server includes:
  • a request message receiving module configured to receive a DHCPv6 request message from the user host
  • the response message sending module is configured to send, by the intermediate router, a DHCPv6 response message to the user host, where the DHCPv6 response message carries an Internet Protocol version 6 IPv6 address and the IPv6 address allocated for the user host.
  • the length of the prefix is such that the intermediate router obtains the prefix of the IPv6 address according to the length of the prefix and generates a prefix routing entry according to the prefix.
  • a message forwarding system includes: an intermediate router, and a dynamic host configuration protocol DHCP server connected to the user host through the intermediate router;
  • the DHCP server is configured to receive a DHCPv6 request message from the user host, and send a DHCPv6 response message to the user host by using the intermediate router, where the DHCPv6 response message carries an IPv6 address assigned to the user host. ;
  • the intermediate router is configured to receive the DHCPv6 response packet, obtain the prefix of the IPv6 address according to the length of the obtained address prefix, generate a prefix routing entry according to the prefix, and forward the report according to the prefix routing entry. Text.
  • the method, the device, and the system provided by the embodiment of the present invention because the router generates a prefix routing entry according to the IPv6 address, and forwards the packet according to the routing table, instead of forwarding the packet according to the neighbor table. This avoids the problem of limited network size and low forwarding efficiency caused by fewer neighbor table resources. Because the routing table resource of the router is large, the device uses the route to forward packets, which also improves the utilization of the router device.
  • FIG. 1 is a flowchart of a method according to an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of a network according to an embodiment of the present invention.
  • FIG. 3 is a signaling diagram of a method according to Embodiment 1 of the present application.
  • FIG. 5 is a schematic structural diagram of an intermediate router according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic structural diagram of a server according to an embodiment of the present disclosure.
  • FIG. 7 is a schematic structural diagram of a system according to an embodiment of the present invention.
  • the embodiment of the invention provides a method for packet forwarding.
  • the method is as shown in FIG. 1 and includes the following operations:
  • the intermediate router forwards the DHCPv6 request packet sent by the user host to the DHCPv6 server.
  • the intermediate router receives a DHCPv6 response message sent by the DHCPv6 server, where the DHCPv6 response message carries an IPv6 address allocated for the user host.
  • the prefix length of the IPv6 address does not exceed the processing capability of the intermediate router.
  • the maximum processing capability of the intermediate router is 64 bits, and the prefix length does not exceed 64 bits.
  • the intermediate router acquires a length of a prefix of an IPv6 address allocated to the user host.
  • the intermediate router obtains a prefix of an IPv6 address from the IPv6 address according to the length of the obtained prefix.
  • the intermediate router generates a prefix routing entry according to the prefix, and forwards the DHCPv6 response packet according to the prefix routing entry.
  • the intermediate router learns the prefix into a routing table, and performs routing according to the routing table.
  • the router In the method provided by the embodiment of the present invention, the router generates a prefix route according to the IPv6 address, and performs packet forwarding according to the routing table, instead of forwarding the packet according to the neighbor table. This avoids the problem of limited network size or high networking cost caused by fewer neighbor table resources. Because the routing table resource of the router is large, the device uses the route to forward packets, which also improves the utilization of the router device.
  • the intermediate router specifically obtains the prefix length of the IPv6 address, and intercepts the prefix from the IPv6 address according to the prefix length.
  • the prefix length of the IPv6 address may be, but is not limited to, a static configuration and a dynamic configuration.
  • the prefix length is fixed, you can configure the prefix length in the storage space that the intermediate router can read.
  • the configured prefix length is the same as the prefix length assigned by the DHCPv6 server. Specifically, it can be configured by an administrator or configured by a DHCPv6 server.
  • the storage space may be set inside the intermediate router or may be set in other network nodes accessible by the intermediate router.
  • the prefix length assigned by the DHCPv6 server to each user host may be the same or different. If the length of the prefix is different for each user host, the configuration is saved according to the correspondence between the host ID and the prefix length assigned to the user host. It should be noted that regardless of whether the prefix lengths assigned to individual user hosts are the same, the DHCPv6 server assigns different prefix contents to each user host to identify each user host according to the prefix.
  • the intermediate router obtains the prefix length of the IPv6 address from the configuration information.
  • the DHCPv6 response packet carries the prefix length of the IPv6 address, which is an example and is not limited.
  • the DHCPv6 response packet includes an address allocation policy option, where the address allocation policy option includes: The length of the prefix, etc.
  • the intermediate router obtains a prefix length of the IPv6 address from the DHCPv6 response message.
  • the intermediate router that generates the prefix routing entry according to the prefix in the S105 includes: the intermediate router generates a prefix routing entry of the routing table according to the prefix, and the prefix routing
  • the content of the entry includes: the prefix; the outbound interface information, where the outbound interface information is a Layer 3 interface of the DHCPv6 request packet received by the intermediate router; the next hop information, the next hop information The source IP address and host MAC of the user host.
  • the user host is connected to the network through an edge router, and the edge router can be an AN (Access). Node, access node), can also be RG (Residential Gateway, resident gateway, etc., the specific implementation device may be a bridge.
  • the intermediate router can be, but is not limited to, BNG (Broadband Network) Gateway, broadband network gateway).
  • BNG Broadband Network Gateway
  • FIG. 3 is only a network diagram in which an edge router can connect to more than one user host, an intermediate router can connect to more than one edge router, and a DHCPv6 server can connect to more than one intermediate router.
  • the edge router is implemented by a bridge and the intermediate router is a BNG.
  • the prefix length of the IPv6 address is configured in the storage space that can be read by the BNG.
  • the configuration is as described above and will not be described here.
  • the process of applying the first embodiment is as shown in FIG. 3, and includes the following operations:
  • the user host sends a DHCPv6 request packet to the BNG.
  • the DHCPv6 request packet includes an IA_NA or IA_TA option, and the DHCPv6 request packet is used to request a 128-bit IPv6 address from the DHCPv6 request packet.
  • S302 The BNG forwards the foregoing DHCPv6 request packet to the DHCPv6 server.
  • the DHCPv6 server allocates an IPv6 address to the user host.
  • the prefix of the IPv6 address assigned by the DHCPv6 server to each user host is different.
  • the assigned prefix length is fixed, and the prefix length does not exceed the processing capability of the intermediate router.
  • the DHCPv6 server returns a DHCPv6 response message to the BNG, and the IPv6 address allocated for the user host is included in the IA_NA or IA_TA option in the DHCPv6 response message.
  • S305 The BNG detects the DHCPv6 response packet and obtains an IPv6 address in the DHCPv6 response packet.
  • the BNG obtains the prefix length corresponding to the user host from the configuration information, and the prefix of the IPv6 address is intercepted according to the prefix length, and the prefix routing entry of the routing table is generated according to the prefix.
  • S307 The BNG forwards the DHCPv6 response packet to the user host according to the generated prefix routing entry.
  • the problem of insufficient neighbor table resources is particularly prominent.
  • the prefix length is configured in a static manner, so that the BNG generates a prefix route according to the IPv6 address, and forwards the packet according to the routing table instead of forwarding the packet according to the neighbor table, thereby avoiding insufficient resource of the neighbor table.
  • the problem make full use of the advantages of BNG routing table resources, and improve the utilization of equipment.
  • the edge router is implemented by a bridge and the intermediate router is a BNG.
  • the process of applying the second embodiment is as shown in FIG. 4, and includes the following operations:
  • the user host sends a DHCPv6 request message to the BNG.
  • the DHCPv6 request packet includes an IA_NA or IA_TA option, and the DHCPv6 request packet is used to request a 128-bit IPv6 address from the DHCPv6 request packet.
  • S402 The BNG forwards the foregoing DHCPv6 request packet to the DHCPv6 server.
  • the DHCPv6 server allocates an IPv6 address to the user host.
  • the prefix of the IPv6 address assigned by the DHCPv6 server to each user host is different.
  • the assigned prefix length is fixed, and the prefix length does not exceed the processing capability of the intermediate router.
  • the DHCPv6 server returns a DHCPv6 response message to the BNG.
  • the DHCPv6 response message includes an IA_NA or IA_TA option, and the IA_NA or IA_TA option carries an IPv6 address assigned to the user host.
  • the DHCPv6 also includes an ADD_ALLOC_POLICY option, and the ADD_ALLOC_POLICY option is an extended option proposed by the present invention.
  • the option is used to carry an address allocation policy, including: the length of the prefix, and the like.
  • S405 The BNG detects the DHCPv6 response packet and obtains the IPv6 address in the DHCPv6 response packet.
  • the BNG obtains the prefix length corresponding to the user host from the DHCPv6 response packet, and the prefix of the IPv6 address is intercepted according to the prefix length, and the prefix routing entry of the routing table is generated according to the prefix.
  • the BNG forwards the DHCPv6 response packet to the user host according to the generated prefix routing entry.
  • the problem of insufficient neighbor table resources is particularly prominent.
  • the technical solution provided by the second embodiment of the present invention uses the dynamic configuration mode to carry the prefix length in the DHCPv6 response packet, so that the BNG generates a prefix route according to the IPv6 address, and then forwards the packet according to the routing table instead of forwarding according to the neighbor table.
  • the message avoids the problem of insufficient resources in the neighbor table. Make full use of the advantages of BNG routing table resources, and improve the utilization of equipment.
  • IPv6 address assigned by the DHCPv6 server to A and B has different prefixes, but the prefix length is 64 bits.
  • IPv6 addresses assigned to A and B are as follows:
  • the prefix of the IPv6 address assigned to A is 2001:1:1, and the prefix length of the IPv6 address assigned to B is 2001:1:1:2.
  • the routing table updated according to the prefix routing option generated by the BNG is as follows through the method provided in the foregoing application embodiment 1 or the application embodiment 2:
  • the content of the destination routing information is a 64-bit prefix.
  • the content of the outbound interface information is the Layer 3 interface of the DHCPv6 request packet.
  • the content of the Next_hop in the next hop information is the source IP address of the user host.
  • DMAC is the MAC address of the user host.
  • the content of the destination route is the prefix of the IPv6 address assigned to A, which is 2001:1:1:1, and the prefix length is 64 bits.
  • the Layer 3 interface of the DHCP request packet sent by A is an interface of the BNG and the Bridge;
  • the content of Next_hop is the source address of A (LLA_A);
  • the content of DMAC is the MAC address of A (MAC_A).
  • the routing entry generated for the DHCP reply message returned to B The content of the destination route is the prefix 2001:1:1:2 of the IPv6 address assigned to B, and the prefix length is 64 bits; the content of the outbound interface is B.
  • the Layer 3 interface is a BNG-Bridge interface; the content of Next_hop is the source address of B (LLA_B); the content of the DMAC is the MAC address of B (MAC_B) ).
  • All or part of the steps of implementing the foregoing method embodiments may be performed by hardware related to the program instructions.
  • the foregoing program may be stored in a computer readable storage medium, and when executed, the program includes the steps of the foregoing method embodiments;
  • the foregoing storage medium includes various media that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
  • An embodiment of the present invention further provides an intermediate router, and the structure thereof is as shown in FIG. 5, including:
  • the request message forwarding module 501 is configured to forward the DHCPv6 request message sent by the user host to the DHCPv6 server.
  • the response message receiving module 502 is configured to receive a DHCPv6 response message sent by the DHCPv6 server, where the DHCPv6 response message carries an IPv6 address allocated for the user host.
  • the prefix length of the IPv6 address does not exceed the processing capability of the intermediate router.
  • the maximum processing capability of the intermediate router is 64 bits of the routing length, and the prefix length described above does not exceed 64 bits.
  • the prefix obtaining module 503 is configured to obtain a prefix of the IPv6 address, and obtain a prefix of the IPv6 address from the IPv6 address according to the length of the prefix.
  • the routing and forwarding module 504 is configured to generate a prefix routing entry according to the prefix, and forward the DHCPv6 response packet according to the prefix routing entry.
  • the prefix obtaining module 503 may specifically include:
  • the prefix length obtaining sub-module 5031 is configured to obtain the length of the prefix from the configuration information, or obtain the length of the prefix from the DHCPv6 response message.
  • the prefix obtaining sub-module 5032 is configured to obtain the prefix of the prefix obtained by the sub-module 5031 according to the prefix length, and obtain the prefix from the IPv6 address.
  • the routing and forwarding module 504 may specifically include:
  • the route generation sub-module 5041 is configured to generate, according to the prefix, a prefix routing entry of the routing table, where the content of the prefix routing entry includes: the prefix, the outbound interface information, and the next hop information;
  • the message forwarding sub-module 5042 is configured to forward the DHCPv6 response message according to the prefix routing entry generated by the route generation sub-module.
  • the router provided by the embodiment of the present invention generates a prefix route according to the IPv6 address, and forwards the packet according to the prefix route, instead of generating the neighbor table to forward the packet. This avoids the problem of limited network size or high networking cost caused by fewer neighbor table resources. Because the routing table resource of the router is large, the device uses the route to forward packets, which also improves the utilization of the router device.
  • the embodiment of the present invention further provides a DHCPv6 server, where the DHCPv6 server is connected to the user host through an intermediate router, and the structure thereof is as shown in FIG. 6, including:
  • the request message receiving module 601 is configured to receive a DHCPv6 request message from the user host;
  • the response message sending module 602 is configured to send, by using the intermediate router, a DHCPv6 response message to the user host, where the DHCPv6 response message carries an IPv6 address allocated to the user host and a prefix of the IPv6 address.
  • the length is such that the intermediate router obtains the prefix of the IPv6 address according to the length of the prefix and generates a prefix routing entry according to the prefix.
  • the DHCPv6 response packet sent to the user host carries the prefix length of the IPv6 address, so that the intermediate router can obtain the prefix according to the prefix length, and then generate a prefix routing entry, which is performed according to the prefix routing table. Packet forwarding, instead of forwarding packets by generating a neighbor table. This avoids the problem of limited network size caused by fewer neighbor table resources. Because the routing table resource of the router is large, the device uses the route to forward packets, which also improves the utilization of the router device.
  • the embodiment of the present invention further provides a packet forwarding system, which has the structure shown in FIG. 7, and includes an intermediate router 701 and a DHCP server 702 connected to the user host through the intermediate router 701.
  • the DHCP server 702 is configured to receive a DHCPv6 request message from the user host, and send a DHCPv6 response message to the user host by using the intermediate router 701, where the DHCPv6 response message carries the user host.
  • the intermediate router 701 is configured to receive the DHCPv6 response packet, obtain the prefix of the IPv6 address according to the length of the obtained address prefix, generate a prefix routing entry according to the prefix, and forward the packet according to the prefix routing entry. Message.
  • the router In the system provided by the embodiment of the present invention, the router generates a prefix route according to the IPv6 address, and forwards the packet according to the routing table, instead of forwarding the packet according to the neighbor table. This avoids the problem of limited network size or high networking cost caused by fewer neighbor table resources. Because the routing table resource of the router is large, the device uses the route to forward packets, which also improves the utilization of the router device.

Landscapes

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

Abstract

本发明涉及一种根据地址分配策略减少使用邻居表的方法,包括:中间路由器将用户主机发来的DHCPv6请求报文转发给服务器;中间路由器接收服务器发送的DHCPv6应答报文,DHCPv6应答报文中携带为用户主机分配的IPv6地址,IPv6地址的前缀长度不超过中间路由器的处理能力;所述中间路由器获取IPv6地址的前缀,根据前缀生成前缀路由。本发明实施例还提供一种中间路由器和DHCPv6服务器。由于路由器根据IPv6地址生成前缀路由,根据路由进行报文转发,而不是通过生成邻居表来进行报文转发。这样就避免了邻居表资源少而导致的网络规模受限的问题。又由于路由器的路由表资源较大,因此,通过生成路由的方式转发报文,也提高了路由器设备的利用率。

Description

一种报文转发的方法、设备及系统
技术领域
本发明网络通信技术领域,尤其涉及一种报文转发的方法、设备及系统。
发明背景
用户主机需要获取IPv6(Internet Protocol Version 6,互联网协议版本6)地址时,可以向DHCPv6(Dynamic Host Configuration Protocol for IPv6,IPv6动态主机配置协议)服务器发送DHCPv6请求报文,该DHCPv6请求报文中包含IA_NA(Identity Association for Non-temporary Addresses,非临时地址的身份关联)或IA_TA(Identity Association for Temporary Addresses,临时地址的身份关联)选项;DHCPv6服务器在收到上述DHCPv6请求报文后,为上述用户主机分配IPv6地址,并向该用户主机返回DHCPv6应答报文,将分配的IPv6地址携带在DHCPv6应答报文的IA_NA选项或IA_TA选项中。上述过程中,中间路由器做DHCPv6 relay(中继),根据DHCPv6应答报文中携带的IPv6地址的前缀生成邻居表中的邻居表项,进而根据该邻居表转发DHCPv6应答报文。
目前,路由器设备普遍存在邻居表资源少的问题,因此,路由器能够连接的节点有限,网络规模受限。如果需要扩大网络规模,就需要增加相应的路由器,这样提高了组网的成本。
发明内容
本发明的目的是提供一种报文转发的方法、设备及系统,解决路由器设备邻居表资源少导致的问题。
一种报文转发的方法,包括:
中间路由器将用户主机发来的动态主机配置协议DHCPv6请求报文转发给DHCPv6服务器;
所述中间路由器接收所述DHCPv6服务器发送的DHCPv6应答报文,所述DHCPv6应答报文中携带有为所述用户主机分配的互联网协议IPv6地址;
所述中间路由器获取IPv6地址的前缀的长度;
所述中间路由器根据获取的前缀的长度,从所述IPv6地址中获取IPv6地址的前缀;
所述中间路由器根据所述前缀生成前缀路由表项,根据所述前缀路由表项转发所述DHCPv6应答报文。
一种路由器,包括:
请求报文转发模块,用于将用户主机发来的动态主机配置协议DHCPv6请求报文转发给DHCPv6服务器;
应答报文接收模块,用于接收所述DHCPv6服务器发送的DHCPv6应答报文,所述DHCPv6应答报文中携带有为所述用户主机分配的互联网协议IPv6地址;
前缀获取模块,用于获取IPv6地址的前缀的长度,并根据所述前缀的长度,从所述IPv6地址中获取IPv6地址的前缀;
路由转发模块,用于根据所述前缀生成前缀路由表项,并根据所述前缀路由表项转发所述DHCPv6应答报文。
一种动态主机配置协议DHCP服务器,所述DHCP服务器通过中间路由器连接用户主机,所述DHCP服务器包括:
请求报文接收模块,用于接收来自用户主机的DHCPv6请求报文;
应答报文发送模块,用于通过所述中间路由器向所述用户主机发送DHCPv6应答报文,所述DHCPv6应答报文中携带有为所述用户主机分配的互联网协议版本6IPv6地址以及所述IPv6地址的前缀的长度,以便所述中间路由器根据所述前缀的长度获取所述IPv6地址的前缀并根据所述前缀生成前缀路由表项。
一种报文转发系统,包括:中间路由器、和通过所述中间路由器与用户主机连接的动态主机配置协议DHCP服务器;
所述DHCP服务器,用于接收来自用户主机的DHCPv6请求报文,通过所述中间路由器向所述用户主机发送DHCPv6应答报文,所述DHCPv6应答报文携带有为所述用户主机分配的IPv6地址;
所述中间路由器,用于接收所述DHCPv6应答报文,根据获取的地址前缀的长度获取所述IPv6地址的前缀,并根据所述前缀生成前缀路由表项以及根据所述前缀路由表项转发报文。
本发明实施例提供的方法、设备及系统,由于路由器根据IPv6地址生成前缀路由表项,根据路由表进行报文转发,而不是根据邻居表来进行报文转发。这样就避免了邻居表资源少而导致的网络规模受限和转发效率低的问题。又由于路由器的路由表资源较大,因此,通过生成路由的方式转发报文,也提高了路由器设备的利用率。
附图简要说明
图1为本发明一个实施例提供的方法流程图;
图2为本发明实施例提供的网络结构示意图;
图3为本发明应用实施例一提供的方法信令图;
图4为本发明应用实施例二提供的方法信令图;
图5为本发明实施例提供的中间路由器结构示意图;
图6为本发明实施例提供的服务器结构示意图;
图7为本发明实施例提供的系统结构示意图。
实施本发明的方式
本发明实施例提供一种报文转发的方法。
在中间路由器侧,该方法如图1所示,包括如下操作:
S101、中间路由器将用户主机发来的DHCPv6请求报文转发给DHCPv6服务器;
S102、所述中间路由器接收所述DHCPv6服务器发送的DHCPv6应答报文,该DHCPv6应答报文中携带有为所述用户主机分配的IPv6地址。
其中,所述IPv6地址的前缀长度不超过所述中间路由器的处理能力,通常,中间路由器的最大处理能力为路由长度64位,则上述的前缀长度不超过64位。
S103、所述中间路由器获取为所述用户主机分配的IPv6地址的前缀的长度;
S104、所述中间路由器根据获取的前缀的长度,从所述IPv6地址中获取IPv6地址的前缀;
S105、所述中间路由器根据所述前缀生成前缀路由表项,根据所述前缀路由表项转发所述DHCPv6应答报文。
具体的,所述中间路由器将所述前缀学习到路由表中,根据所述路由表进行路由。
本发明实施例提供的方法,由于路由器根据IPv6地址生成前缀路由,根据路由表进行报文转发,而不是根据邻居表来进行报文转发。这样就避免了邻居表资源少而导致的网络规模受限或组网成本高的问题。又由于路由器的路由表资源较大,因此,通过生成路由的方式转发报文,也提高了路由器设备的利用率。
上述本发明实施例提供的方法中,中间路由器具体是获取IPv6地址的前缀长度,根据前缀长度,从IPv6地址中截取前缀。其中,IPv6地址的前缀长度可以但不仅限于包括静态配置和动态配置两种方式。
静态配置:
由于前缀长度固定,可以预先在中间路由器能够读取的存储空间中配置前缀长度,配置的前缀长度与DHCPv6服务器分配的前缀长度一致。具体的,可以由管理员进行配置,也可以由DHCPv6服务器配置。所述的存储空间可以设置在中间路由器内部,也可以设置在中间路由器能够访问的其他网络节点中。本发明实施例中,DHCPv6服务器为各个用户主机分配的前缀长度可以相同,也可以不同。如果为各个用户主机分配的前缀长度不同,则在存储空间中配置前缀长度时,具体按照用户主机标识与为该用户主机分配的前缀长度的对应关系来保存配置。应当指出的是,无论为各个用户主机分配的前缀长度是否相同,DHCPv6服务器为每个用户主机分配的前缀内容均不同,以便根据前缀来识别各个用户主机。
通过静态配置前缀长度后,中间路由器从上述配置信息中获取IPv6地址的前缀长度。
动态配置:
在动态配置实现方式中,所述的DHCPv6应答报文中携带IPv6地址的前缀长度,作为举例而非限定,该DHCPv6应答报文中包含地址分配策略选项,该地址分配策略选项中包括:所述前缀长度等。
则,所述的中间路由器从所述DHCPv6应答报文中获取IPv6地址的前缀长度。
本发明实施例提供的方法中,S105中所述的中间路由器根据所述前缀生成前缀路由表项具体包括:所述中间路由器根据所述前缀,生成路由表的前缀路由表项,所述前缀路由表项的内容包括:所述的前缀;出接口信息,所述出接口信息为所述中间路由器收到的所述DHCPv6请求报文的三层接口;下一跳信息,所述下一跳信息为所述用户主机的源IP地址和主机MAC。
下面将对本发明实施例在实际应用过程中的具体实现方式进行详细的说明。
如图2所示的网络示意图中,用户主机通过边缘路由器连接到网络,边缘路由器可以是AN(Access Node,接入节点),也可以是RG(Residential Gateway,驻地网关)等,其具体实现设备可以是网桥。中间路由器可以但不仅限于是BNG(Broadband Network Gateway,宽带网络网关)。应当指出的是,图3仅是一种网络示意图,其中,边缘路由器可以连接不止一台用户主机,中间路由器可以连接不止一台边缘路由器,DHCPv6服务器可以连接不止一台中间路由器。
应用实施例一
在图2所示的网络中,假设边缘路由器由网桥实现,中间路由器为BNG。预先在BNG可以读取的存储空间中配置IPv6地址的前缀长度,具体配置方式如前所述,这里不再赘述。则应用实施例一的处理过程如图3所示,包括如下操作:
S301、用户主机向BNG发送DHCPv6请求报文;
该DHCPv6请求报文中包含IA_NA或IA_TA选项,该DHCPv6请求报文用来向DHCPv6请求报文申请128位的IPv6地址;
S302、BNG将上述DHCPv6请求报文转发给DHCPv6服务器;
S303、DHCPv6服务器为该用户主机分配IPv6地址;
其中,DHCPv6服务器为每个用户主机分配的IPv6地址的前缀各不相同,分配的前缀长度固定,且前缀长度不超过中间路由器的处理能力。
S304、DHCPv6服务器向BNG返回DHCPv6应答报文,并将为用户主机分配的IPv6地址包含在DHCPv6应答报文中的IA_NA或IA_TA选项中;
S305、BNG侦听到DHCPv6应答报文,获取DHCPv6应答报文中的IPv6地址;
S306、BNG从配置信息中获取该用户主机对应的前缀长度,按照该前缀长度截取上述IPv6地址的前缀,根据该前缀生成路由表的前缀路由表项;
S307、BNG根据生成的前缀路由表项向用户主机转发DHCPv6应答报文。
在网桥-BNG的网络架构中,邻居表资源不足的问题尤其突出。通过本发明应用实施例一提供的技术方案,采用静态方式配置前缀长度,以便BNG根据IPv6地址生成前缀路由,根据路由表转发报文,而不是根据邻居表转发报文,避免了邻居表资源不足的问题。充分利用了BNG路由表资源比较大的优势,提高了设备的利用率。
应用实施例二
在图2所示的网络中,假设边缘路由器由网桥实现,中间路由器为BNG。则应用实施例二的处理过程如图4所示,包括如下操作:
S401、用户主机向BNG发送DHCPv6请求报文;
该DHCPv6请求报文中包含IA_NA或IA_TA选项,该DHCPv6请求报文用来向DHCPv6请求报文申请128位的IPv6地址;
S402、BNG将上述DHCPv6请求报文转发给DHCPv6服务器;
S403、DHCPv6服务器为该用户主机分配IPv6地址;
其中,DHCPv6服务器为每个用户主机分配的IPv6地址的前缀各不相同,分配的前缀长度固定,且前缀长度不超过中间路由器的处理能力。
S404、DHCPv6服务器向BNG返回DHCPv6应答报文;
该DHCPv6应答报文中包含IA_NA或IA_TA选项,所述的IA_NA或IA_TA选项中携带为用户主机分配的IPv6地址。
该DHCPv6中还包含ADD_ALLOC_POLICY选项,ADD_ALLOC_POLICY选项为本发明提出的扩展选项,该选项用来携带地址分配策略,具体包括:该前缀的长度等。
S405、BNG侦听到DHCPv6应答报文,获取DHCPv6应答报文中的IPv6地址;
S406、BNG从该DHCPv6应答报文中获取该用户主机对应的前缀长度,按照该前缀长度截取上述IPv6地址的前缀,根据该前缀生成路由表的前缀路由表项;
S407、BNG根据生成的前缀路由表项向用户主机转发DHCPv6应答报文。
在网桥-BNG的网络架构中,邻居表资源不足的问题尤其突出。通过本发明应用实施例二提供的技术方案,采用动态配置方式,在DHCPv6应答报文中携带前缀长度,以便BNG根据IPv6地址生成前缀路由,进而根据路由表转发报文,而不是根据邻居表转发报文,避免了邻居表资源不足的问题。充分利用了BNG路由表资源比较大的优势,提高了设备的利用率。
应用实施例三
在如图2所示的网络中,假设有两台用户主机(A和B)连接到网桥上。假设DHCPv6服务器为A和B分配的IPv6地址的前缀不同,但前缀长度均为64位。例如,为A和B分配的IPv6地址如下:
A=2001:1:1:1:0:0:0:1
B=2001:1:1:2:0:0:0:1。
其中,为A分配的IPv6地址的前缀为2001:1:1:1,为B分配的IPv6地址的前缀长度为2001:1:1:2。
那么,通过上述应用实施例一或应用实施例二提供的方法,根据BNG生成的前缀路由选项更新的路由表如下所示:
目的路由 出接口 Next_hop DMAC
2001:1:1:1 / 64 BNG 连 Bridge 的接口 LLA_A MAC_A
2001:1:1:2 / 64 BNG 连 Bridge 的接口 LLA_B MAC_B
其中,目的路由信息的内容是64位的前缀,出接口信息的内容是DHCPv6请求报文的三层接口,下一跳信息中的Next_hop内容是用户主机的源IP地址,下一跳信息中的DMAC是用户主机的MAC地址。
那么,针对返回给A的DHCP应答报文生成的路由表项中:目的路由的内容是为A分配的IPv6地址的前缀2001:1:1:1,其前缀长度为64位;出接口的内容是A发送的DHCP请求报文的三层接口,本发明实施例中,该三层接口是BNG连Bridge的接口; Next_hop的内容是A的源地址(LLA_A);DMAC的内容是A的MAC地址(MAC_A)。
针对返回给B的DHCP应答报文生成的路由表项中:目的路由的内容是为B分配的IPv6地址的前缀2001:1:1:2,其前缀长度为64位;出接口的内容是B发送的DHCP请求报文的三层接口,本发明实施例中,该三层接口是BNG连Bridge的接口;Next_hop的内容是B的源地址(LLA_B);DMAC的内容是B的MAC地址(MAC_B)。
实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
本发明实施例还提供一种中间路由器,其结构如图5所示,包括:
请求报文转发模块501,用于将用户主机发来的DHCPv6请求报文转发给DHCPv6服务器;
应答报文接收模块502,用于接收所述DHCPv6服务器发送的DHCPv6应答报文,所述DHCPv6应答报文中携带为所述用户主机分配的IPv6地址;
其中,所述IPv6地址的前缀长度不超过所述中间路由器的处理能力。通常,中间路由器的最大处理能力为路由长度64位,则上述的前缀长度不超过64位。
前缀获取模块503,用于获取所述IPv6地址的前缀的长度,并根据所述前缀的长度,从所述IPv6地址中获取IPv6地址的前缀;
路由转发模块504,用于根据所述前缀生成前缀路由表项,并根据所述前缀路由表项转发所述DHCPv6应答报文。
上述本发明实施例提供的中间路由器中,前缀获取模块503具体可以包括:
前缀长度获取子模块5031,用于从配置信息中获取所述前缀的长度,或者用于从所述DHCPv6应答报文中获取所述前缀的长度;
前缀获取子模块5032,用于根据所述前缀长度获取子模块5031获取的前缀的长度,从所述IPv6地址中获取所述前缀。
路由转发模块504具体可以包括:
路由生成子模块5041,用于根据所述前缀,生成路由表的前缀路由表项,所述前缀路由表项的内容包括:所述前缀、出接口信息以及下一跳信息;
报文转发子模块5042,用于根据所述路由生成子模块生成的前缀路由表项,转发所述DHCPv6应答报文。
本发明实施例提供的路由器根据IPv6地址生成前缀路由,根据前缀路由进行报文转发,而不是通过生成邻居表来进行报文转发。这样就避免了邻居表资源少而导致的网络规模受限或组网成本高的问题。又由于路由器的路由表资源较大,因此,通过生成路由的方式转发报文,也提高了路由器设备的利用率。
本发明实施例还提供一种DHCPv6服务器,该DHCPv6服务器通过中间路由器连接用户主机,其结构如图6所示,包括:
请求报文接收模块601,用于接收来自用户主机的DHCPv6请求报文;
应答报文发送模块602,用于通过所述中间路由器向所述用户主机发送DHCPv6应答报文,所述DHCPv6应答报文中携带为所述用户主机分配的IPv6地址以及所述IPv6地址的前缀的长度,以便所述中间路由器根据所述前缀的长度获取所述IPv6地址的前缀并根据所述前缀生成前缀路由表项。
本发明实施例提供的DHCPv6服务器,由于发送给用户主机的DHCPv6应答报文中携带有IPv6地址的前缀长度,使得中间路由器可以根据前缀长度获取前缀,进而生成前缀路由表项,根据前缀路由表进行报文转发,而不是通过生成邻居表来进行报文转发。这样就避免了邻居表资源少而导致的网络规模受限的问题。又由于路由器的路由表资源较大,因此,通过生成路由的方式转发报文,也提高了路由器设备的利用率。
本发明实施例还提供一种报文转发系统,其结构如图7所示,包括:中间路由器701、和通过所述中间路由器701与用户主机连接的DHCP服务器702。
其中,所述DHCP服务器702,用于接收来自用户主机的DHCPv6请求报文,通过所述中间路由器701向所述用户主机发送DHCPv6应答报文,所述DHCPv6应答报文携带有为所述用户主机分配的IPv6地址;
所述中间路由器701,用于接收所述DHCPv6应答报文,根据获取的地址前缀的长度获取所述IPv6地址的前缀,并根据所述前缀生成前缀路由表项以及根据所述前缀路由表项转发报文。
本发明实施例提供的系统,由于路由器根据IPv6地址生成前缀路由,根据路由表进行报文转发,而不是根据邻居表来进行报文转发。这样就避免了邻居表资源少而导致的网络规模受限或组网成本高的问题。又由于路由器的路由表资源较大,因此,通过生成路由的方式转发报文,也提高了路由器设备的利用率。

Claims (8)

  1. 一种报文转发的方法,其特征在于,包括:
    中间路由器将用户主机发来的动态主机配置协议DHCPv6请求报文转发给DHCPv6服务器;
    所述中间路由器接收所述DHCPv6服务器发送的DHCPv6应答报文,所述DHCPv6应答报文中携带有为所述用户主机分配的互联网协议IPv6地址;
    所述中间路由器获取IPv6地址的前缀的长度;
    所述中间路由器根据获取的前缀的长度,从所述IPv6地址中获取IPv6地址的前缀;
    所述中间路由器根据所述前缀生成前缀路由表项,根据所述前缀路由表项转发所述DHCPv6应答报文。
  2. 根据权利要求1所述的方法,其特征在于,所述中间路由器获取IPv6地址的前缀的长度包括:
    所述中间路由器从配置信息中获取所述前缀的长度;
    或者,
    所述中间路由器从所述DHCPv6应答报文中获取所述前缀的长度,所述DHCPv6应答报文中携带有所述IPv6地址的前缀的长度。
  3. 根据权利要求1或2所述的方法,其特征在于,所述中间路由器根据所述前缀生成前缀路由表项具体包括:
    所述中间路由器根据所述前缀,生成路由表的前缀路由表项,所述前缀路由表项的内容包括:
    所述前缀、出接口信息以及下一跳信息。
  4. 一种路由器,其特征在于,包括:
    请求报文转发模块,用于将用户主机发来的动态主机配置协议DHCPv6请求报文转发给DHCPv6服务器;
    应答报文接收模块,用于接收所述DHCPv6服务器发送的DHCPv6应答报文,所述DHCPv6应答报文中携带有为所述用户主机分配的互联网协议IPv6地址;
    前缀获取模块,用于获取IPv6地址的前缀的长度,并根据所述前缀的长度,从所述IPv6地址中获取IPv6地址的前缀;
    路由转发模块,用于根据所述前缀生成前缀路由表项,并根据所述前缀路由表项转发所述DHCPv6应答报文。
  5. 根据权利要求4所述的路由器,其特征在于,所述前缀获取模块具体包括:
    前缀长度获取子模块,用于从配置信息中获取所述前缀的长度,或者用于从所述DHCPv6应答报文中获取所述前缀的长度;
    前缀获取子模块,用于根据所述前缀长度获取子模块获取的前缀的长度,从所述IPv6地址中获取所述前缀。
  6. 根据权利要求4或5所述的路由器,其特征在于,所述路由转发模块具体包括:
    路由生成子模块,用于根据所述前缀,生成路由表的前缀路由表项,所述前缀路由表项的内容包括:所述前缀、出接口信息以及下一跳信息;
    报文转发子模块,用于根据所述路由生成子模块生成的前缀路由表项,转发所述DHCPv6应答报文。
  7. 一种动态主机配置协议DHCP服务器,所述DHCP服务器通过中间路由器连接用户主机,其特征在于,所述DHCP服务器包括:
    请求报文接收模块,用于接收来自用户主机的DHCPv6请求报文;
    应答报文发送模块,用于通过所述中间路由器向所述用户主机发送DHCPv6应答报文,所述DHCPv6应答报文中携带有为所述用户主机分配的互联网协议版本6IPv6地址以及所述IPv6地址的前缀的长度,以便所述中间路由器根据所述前缀的长度获取所述IPv6地址的前缀并根据所述前缀生成前缀路由表项。
  8. 一种报文转发系统,其特征在于,包括:中间路由器、和通过所述中间路由器与用户主机连接的动态主机配置协议DHCP服务器;
    所述DHCP服务器,用于接收来自用户主机的DHCPv6请求报文,通过所述中间路由器向所述用户主机发送DHCPv6应答报文,所述DHCPv6应答报文携带有为所述用户主机分配的IPv6地址;
    所述中间路由器,用于接收所述DHCPv6应答报文,根据获取的地址前缀的长度获取所述IPv6地址的前缀,并根据所述前缀生成前缀路由表项以及根据所述前缀路由表项转发报文。
PCT/CN2011/080647 2011-10-11 2011-10-11 一种报文转发的方法、设备及系统 WO2012163000A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN2011800021977A CN102439918A (zh) 2011-10-11 2011-10-11 一种报文转发的方法、设备及系统
PCT/CN2011/080647 WO2012163000A1 (zh) 2011-10-11 2011-10-11 一种报文转发的方法、设备及系统

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2011/080647 WO2012163000A1 (zh) 2011-10-11 2011-10-11 一种报文转发的方法、设备及系统

Publications (1)

Publication Number Publication Date
WO2012163000A1 true WO2012163000A1 (zh) 2012-12-06

Family

ID=45986271

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/080647 WO2012163000A1 (zh) 2011-10-11 2011-10-11 一种报文转发的方法、设备及系统

Country Status (2)

Country Link
CN (1) CN102439918A (zh)
WO (1) WO2012163000A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107968844B (zh) * 2016-10-19 2022-01-11 中兴通讯股份有限公司 一种网关地址冲突的处理方法、装置及路由器
WO2021031904A1 (en) * 2019-08-16 2021-02-25 Telefonaktiebolaget Lm Ericsson (Publ) Method and entity for transmitting a plurality of mac addresses
CN112272244B (zh) * 2020-10-22 2023-02-17 北京自如信息科技有限公司 一种路由器WAN端IPv6上网模式配置方法及装置
CN114448941A (zh) * 2021-12-24 2022-05-06 苏州浪潮智能科技有限公司 一种网络设备管理方法、装置、电子设备及存储介质
CN116095000B (zh) * 2023-02-13 2024-05-10 烽火通信科技股份有限公司 路由发布方法、装置、设备及可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050027778A1 (en) * 2003-07-29 2005-02-03 Arthur Dimitrelis Automatic configuration of an address allocation mechanism in a computer network
CN101005461A (zh) * 2007-01-16 2007-07-25 中兴通讯股份有限公司 一种IPv6路由表查找、转发的方法
CN101753460A (zh) * 2010-01-15 2010-06-23 杭州华三通信技术有限公司 一种ipv6路由前缀的处理方法及装置
CN102025797A (zh) * 2010-11-30 2011-04-20 北京星网锐捷网络技术有限公司 地址前缀处理方法、装置、系统及网络设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050027778A1 (en) * 2003-07-29 2005-02-03 Arthur Dimitrelis Automatic configuration of an address allocation mechanism in a computer network
CN101005461A (zh) * 2007-01-16 2007-07-25 中兴通讯股份有限公司 一种IPv6路由表查找、转发的方法
CN101753460A (zh) * 2010-01-15 2010-06-23 杭州华三通信技术有限公司 一种ipv6路由前缀的处理方法及装置
CN102025797A (zh) * 2010-11-30 2011-04-20 北京星网锐捷网络技术有限公司 地址前缀处理方法、装置、系统及网络设备

Also Published As

Publication number Publication date
CN102439918A (zh) 2012-05-02

Similar Documents

Publication Publication Date Title
JP4801153B2 (ja) 通信ネットワーク内のIPv6ステートレスアドレス構成をサポートするアクセス装置、ルーティング装置およびその方法
WO2010110530A1 (ko) Ipv6 네트워크 내 호스트 차단 및 탐색방법
WO2012163000A1 (zh) 一种报文转发的方法、设备及系统
WO2012162994A1 (zh) 对数据报文进行策略控制的方法和装置
WO2007009367A1 (fr) Méthode de détection de doublons d’adresse dans un réseau d’accès deux couches ipv6 et système pour celle-ci
WO2012074185A1 (ko) 6LoWPAN기반의 무선 센서 네트워크에서 디바이스의 이동성을 지원하는 방법
WO2014121502A1 (zh) 在基站中,一种开站配置方法、基站及服务器
JP2005072685A (ja) ルータ装置及びその装置における経路情報の配布方法並びに通信システム
WO2011144126A2 (zh) 一种网络设备的配置方法、装置及系统
WO2010068018A2 (en) Method for configuring closed user network using ip tunneling mechanism and closed user network system
US20130089092A1 (en) Method for preventing address conflict, and access node
CN104168338A (zh) 一种网络地址转换装置和方法
JP5241957B2 (ja) 加入者装置をIPv6対応のアグリゲーションネットワークに接続するための方法および装置
WO2014086041A1 (zh) 一种报文的流转发方法及报文转发设备
WO2013159549A1 (zh) 一种建立和使用浮动网段的方法、装置和系统
WO2015096040A1 (zh) 接入节点、移动管理网元以及寻呼消息处理方法
WO2014156143A1 (ja) ホームゲートウェイ装置およびパケット転送方法
CN1571423A (zh) 不同链路层隔离域的邻居发现实现方法
Isaac Comparative Analysis of IPV4 and IPV6
WO2023008760A1 (ko) 엣지 플랫폼 관리장치 및 엣지 플랫폼 관리장치의 동작 방법, 그리고 엣지 게이트웨이 장치
JP4610599B2 (ja) ルータ装置および通信方法
WO2013147486A1 (ko) 다중 무선 접속 기술을 지원하는 무선 통신 시스템에서 데이터 서비스 제공 장치 및 방법
WO2023008759A1 (ko) 엣지 플랫폼 관리장치 및 엣지 플랫폼 관리장치의 동작 방법, 그리고 엣지 게이트웨이 장치
WO2023054988A1 (en) Method and electronic device for device ip status checking and connection orchestration
JP6417720B2 (ja) 通信装置とネットワークシステムとアドレス解決制御方法とプログラム

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201180002197.7

Country of ref document: CN

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

Ref document number: 11866782

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11866782

Country of ref document: EP

Kind code of ref document: A1