WO2014101891A1 - Method and device for configuring ip address - Google Patents

Method and device for configuring ip address Download PDF

Info

Publication number
WO2014101891A1
WO2014101891A1 PCT/CN2013/091156 CN2013091156W WO2014101891A1 WO 2014101891 A1 WO2014101891 A1 WO 2014101891A1 CN 2013091156 W CN2013091156 W CN 2013091156W WO 2014101891 A1 WO2014101891 A1 WO 2014101891A1
Authority
WO
WIPO (PCT)
Prior art keywords
prefix
message
ipv6
option
address
Prior art date
Application number
PCT/CN2013/091156
Other languages
French (fr)
Chinese (zh)
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 华为技术有限公司
Publication of WO2014101891A1 publication Critical patent/WO2014101891A1/en

Links

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/5092Address allocation by self-assignment, e.g. picking addresses at random and testing if they are already in use
    • 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 embodiments of the present invention relate to the field of communications, and in particular, to a method and a device for configuring an IP address.
  • IPv6 Internet Protocol version 6
  • IPv6 prefix Then, according to the obtained IPv6 prefix, the CE supports each IPv6 dynamic host configuration protocol (IPv6) or the stateless address auto configuration (SLAAC).
  • IPv6 terminal device such as an IPv6 host (host), is configured with an IPv6 address.
  • the IETF proposes a scheme for address allocation.
  • the CE obtains multiple IPv6 prefixes from multiple ISPs.
  • DHCPv6 or SLAAC assigns multiple IPv6 addresses to all terminal devices.
  • DHCPv6 mode When using DHCPv6 mode,
  • the CE allocates multiple IPv6 addresses to each terminal device according to the number of prefixes obtained.
  • the number of addresses is the same as the number of acquired IPv6 prefixes.
  • the CE passes the route advertisement (Router
  • the advertisement informs each terminal device of all IPv6 prefixes, and each terminal device generates multiple IPv6 addresses according to the obtained IPv6 prefix. Since the terminal device acquires multiple
  • RFC 3484 proposes an IPv6 default address selection method, which involves a default address selection algorithm and a default address selection policy table.
  • the default algorithm cannot guarantee that the terminal device can select the correct source IPv6 address. Therefore, the IETF upgrades the RFC and replaces RFC3484 with RFC6724.
  • RFC6724 does not define a mechanism for configuring an address selection policy table.
  • Draf t_iet f_6man_addr_se lect_opt manuscript proposes how to implement the configuration and update of the address selection policy table when using the DHCPv6 mode, but does not give advice on the configuration of the address selection policy table when using the SLAAC mode.
  • the embodiments of the present invention provide a method and a device for configuring an IP address, which are used to solve the problem that the configuration of the address selection policy table cannot be implemented when the SLAAC mode is used in the prior art.
  • a method for configuring an IP address including: receiving a router request RS message sent by a terminal device; sending a first router advertisement RA message to the terminal device, where the first RA message is used to respond to the RS The message carries the first IPv6 prefix and the first accessible network segment corresponding to the first IPv6 prefix.
  • the first RA message includes a prefix information option, where the prefix information option includes the first IPv6 prefix and a sub-option, where the sub-option includes the first Access the network segment.
  • the first RA message includes a prefix information option and a prefix description option corresponding to the prefix information option, where the prefix information option includes the first IPv6 prefix,
  • the prefix description option includes the first accessible network segment.
  • the third implementation manner is further provided, where the first RA message further includes the Internet corresponding to the first IPv6 prefix. Service Provider ISP ID.
  • the fourth implementation manner is further provided, where the method further includes: The terminal device sends a second RA message, where the second RA message carries a second IPv6 prefix and a second accessible network segment corresponding to the second IPv6 prefix.
  • the second aspect provides a method for configuring an IP address, including: receiving a router request RS message sent by a terminal device, and sending a router advertisement RA message to the terminal device, where the RA message is used by Responding to the RS message, and carrying an IPv6 prefix and an Internet Service Provider ISP identifier corresponding to the IPv6 prefix.
  • a first implementation manner where the RA message includes a prefix information option, where the prefix information option includes the IPv6 prefix and a sub-option, and the sub-option includes the ISP identifier.
  • a second implementation manner where the RA message includes a prefix information option and a prefix description option corresponding to the prefix information option, where the prefix information option includes the IPv6 prefix, and the prefix description option
  • the ISP logo is included.
  • a network device including a receiving unit and a sending unit.
  • the receiving unit is configured to receive a router request RS message sent by the terminal device.
  • the sending unit is configured to send a first router advertisement RA message, where the first RA message is used to respond to the RS message, and carries a first IPv6 prefix and a first accessible network segment corresponding to the first IPv6 prefix.
  • a first implementation manner where the first RA message includes a prefix information option, where the prefix information option includes the first IPv6 prefix and a sub-option, where the sub-option includes the first Access the network segment.
  • a second implementation manner where the first RA message includes a prefix information option and a prefix description option corresponding to the prefix information option, where the prefix information option includes the first IPv6 prefix,
  • the prefix description option includes the first accessible network segment.
  • the third implementation manner is further provided, where the first RA message further includes the Internet corresponding to the first IPv6 prefix. Service Provider I SP logo.
  • the sending unit is further configured to send a second RA message to the terminal device, where the second RA message carries the second The second accessible network segment corresponding to the IPv6 prefix and the second IPv6 prefix.
  • a fourth aspect provides a terminal device, including: a sending unit, a receiving unit, and a processing unit.
  • the sending unit is configured to send a router request RS message.
  • the receiving unit is configured to receive a first router advertisement RA message, where the first RA message is used to respond to the RS message, and carries a first IPv6 prefix and a first accessible network segment corresponding to the first IPv6 prefix.
  • the processing unit is configured to generate a first IPv6 address according to the first IPv6 prefix, and configure a first address selection policy table according to the first RA message, where the first address selection policy table includes the first IPv6 address
  • a first implementation manner where the first RA message includes a prefix information option, where the prefix information option includes the first IPv6 prefix and a sub-option, where the sub-option includes the first Access the network segment.
  • a second implementation manner where the first RA message includes a prefix information option and a prefix description option corresponding to the prefix information option, where the prefix information option includes the first IPv6 prefix,
  • the prefix description option includes the first accessible network segment.
  • the receiving unit is further configured to receive a second RA message, where the second RA message carries a second IPv6 prefix and a second corresponding to the second IPv6 prefix. Access to the network segment.
  • the processing unit is further configured to generate a second IPv6 address according to the second IPv6 prefix, and configure a second address selection policy table according to the second RA message, where the second address selection policy table includes the second IPv6 An address of the second accessible network segment corresponding to the second IPv6 address, where the second accessible network segment is used to identify a network segment that the terminal device can access when using the second IPv6 address as a source address. .
  • the RA message received by the terminal device carries an IPv6 prefix and an accessible network segment corresponding to the IPv6 prefix, and the terminal device can configure an address selection policy table according to the RA message, where the address selection policy table includes an IPv6 address. An accessible network segment corresponding to the IPv6 address.
  • the terminal device communicates with other devices, the appropriate IPv6 address can be selected as the source address according to the address selection policy table. Therefore, the solution of the embodiment of the present invention can implement automatic configuration of the address selection policy table in the SLAAC mode.
  • a fifth aspect provides a terminal device, including: a sending unit, a receiving unit, and a processing unit.
  • the sending unit is configured to send a router request RS message.
  • the receiving unit is configured to receive an RA message, where the RA message is used to respond to the RS message, and carries a first IPv6 prefix and an identifier of a first Internet service provider ISP corresponding to the first IPv6 prefix.
  • the processing unit is configured to determine, from the first IPv6 prefix, a third IPv6 prefix corresponding to the ISP identifier preset by the terminal device, and generate a first IPv6 address by using the third IPv6 prefix.
  • a first implementation manner where the RA message includes a prefix information option, where the prefix information option includes the first IPv6 prefix and a sub-option, and the sub-option includes the first ISP identifier.
  • a second implementation manner where the RA message includes a prefix information option and a prefix description option corresponding to the prefix information option, where the prefix information option includes the foregoing An IPv6 prefix, the prefix description option including the first ISP identifier.
  • the RA message received by the terminal device carries an IPv6 prefix and an I SP identifier corresponding to the IPv6 prefix, and the terminal device can use the preset ISP identifier according to the local
  • the RA message from the IPv6 prefix carried in the RA message, selects an IPv6 prefix corresponding to the preset ISP identifier to generate an IPv6 address. Therefore, the solution of the embodiment of the present invention can save an IPv6 address.
  • FIG. 1 is a schematic diagram of a network structure in an embodiment of the present invention.
  • FIG. 2 is a schematic diagram of signaling interaction of a bridge mode in an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of signaling interaction of a routing mode according to an embodiment of the present invention.
  • FIG. 4 is a flowchart of a method for configuring an IP address according to an embodiment of the present invention.
  • Figure 5 is a RA message format diagram
  • Figure 6 is a format diagram of the prefix information option in the RA message
  • FIG. 7 is a pref ix informat ion opt ion format diagram including a sub-opt ion according to an embodiment of the present invention
  • FIG. 8 is a format diagram of an RA message including a newly added pref ix descr opt ion opt ion according to an embodiment of the present invention
  • FIG. 9 is a format diagram of a pref ix descr ipt ion opt ion in a network according to an embodiment of the present invention.
  • FIG. 10 is a flowchart of a method for configuring an IP address in an embodiment of the present invention.
  • FIG. 11 is a flowchart of a method for configuring an IP address in still another embodiment of the present invention.
  • FIG. 12 is a schematic diagram of a cylindrical structure of a network device according to an embodiment of the present invention.
  • FIG. 13 is a schematic view showing a tubular structure of a terminal device according to an embodiment of the present invention.
  • FIG. 14 is a schematic diagram of a tubular structure of a terminal device according to an embodiment of the present invention.
  • 15 is a schematic diagram of a cylindrical structure of a network device according to an embodiment of the present invention
  • 16 is a schematic diagram of a tubular structure of a terminal device according to an embodiment of the present invention
  • Figure 17 is a schematic view showing the structure of a terminal device in an embodiment of the present invention.
  • FIG. 1 is a schematic diagram of a network structure in an embodiment of the present invention.
  • the terminal device 102 communicates through the CE 104, an access point (Acces s Node) 106, and a broadband remote acces s server (BRAS) 108.
  • the terminal device 102 can be a computer, an IP television (IPTV), a telephone, a medical terminal, or other terminal device.
  • IPTV IP television
  • Fig. 1 exemplarily shows three terminal devices, but the embodiment of the present invention does not limit the number and types of terminal devices.
  • the arrangement mode of the CE is also not limited in this embodiment.
  • the CE may be arranged in a bridge mode or a route mode.
  • FIG. 2 is a schematic diagram of signaling interaction of a bridge mode in an embodiment of the present invention. As shown in FIG. 2, when the arrangement mode of the CE is the bridge mode, the terminal device 102 and the BRAS 108 perform signaling interaction to configure an IPv6 address.
  • the terminal device 102 sends a router request message (Router Sol ic i tate Mes sage, called RS Mes sage ) to the BRAS 108. For example, when the interface is enabled, the terminal device sends an RS message requesting the router to generate a router advertisement message (Router Advertise s s s sage ).
  • RS Mes sage a router request message
  • the terminal device sends an RS message requesting the router to generate a router advertisement message (Router Advertise s s s sage ).
  • the BRAS 108 sends a first RA message to the terminal device 102, and is configured to respond to the RS message, where the first RA message carries a first IPv6 prefix.
  • the first IPv6 prefix may be one or more.
  • the first RA message in addition to carrying the first IPv6 prefix, the first RA message further carries the first accessible network segment corresponding to the first IPv6 prefix.
  • the first RA cancellation in addition to carrying the first IPv6 prefix, the first RA cancellation
  • the first ISP identifier corresponding to the first IPv6 prefix is also carried in the information.
  • the first RA message in addition to carrying the first IPv6 prefix, carries the first accessible network segment corresponding to the first IPv6 prefix, and carries the first IPv6 prefix. Corresponding first I SP identifier.
  • the terminal device 102 generates a first according to the first IPv6 prefix carried by the first RA message.
  • the terminal device 102 may further configure a first address selection policy table according to the first RA message, where The first address selection policy table includes the first IPv6 address and the first accessible network segment corresponding to the first IPv6 address.
  • the first RA message carries a first IPv6 prefix 1 and a corresponding first accessible network segment 1, a first I Pv 6 prefix 2, and a corresponding first accessible network segment 2, and a first IPv6 prefix 3 And the corresponding first accessible network segment 3.
  • the terminal device 102 receives the first RA message, generates a first IPv6 address 1 according to the first IPv6 prefix 1, and generates a first IPv6 address 2 according to the first IPv6 prefix 2, according to the first IPv6 prefix 3 Generate the first IPv6 address 3.
  • the terminal device 102 further configures a first address selection policy table, where the first address selection policy table includes a first IPv6 address 1 and a corresponding accessible network segment 1, a first IPv6 address 2, and a corresponding accessible network segment 1, and The first IPv6 address 3 and the corresponding accessible network segment 3. With this scheme, automatic configuration of the address selection policy table in the SLAAC mode can be implemented.
  • the terminal device 102 When the terminal device 102 presets the third ISP identifier, the foregoing 206 is implemented as follows.
  • the terminal device 102 may determine, according to the third ISP identifier, the third ISP identifier corresponding to the first IPv6 prefix. And generating, by the third IPv6 prefix, the first IPv6 address, as the IPv6 address of the terminal device 102.
  • the operation of generating an IPv6 address according to the first RA message is omitted, that is, the IPv6 address is not generated according to the first RA message.
  • the third ISP identifier is one.
  • the terminal device 102 receives the first RA message, if the terminal device The third IPv6 prefix corresponding to the third ISP identifier is selected from the first IPv6 prefix that is carried by the first RA message, and the third IPv6 prefix is generated according to the third IPv6 prefix.
  • the first IPv6 address If the third ISP identifier does not exist in the ISP identifier corresponding to the first IPv6 prefix, the operation of generating an IPv6 address according to the first RA message is omitted. If the terminal device 102 does not have a preset ISP identifier, the first IPv6 address may be generated according to the first RA message, and the first address selection policy table is configured.
  • the embodiment described in FIG. 2 may further include
  • the BRAS 108 sends a second RA message.
  • the second RA message carries a second IPv6 prefix.
  • the second IPv6 prefix may be one or more.
  • the second IPv6 prefix may be the same as the first IPv6 prefix, or may be different.
  • one or more of the plurality of the second IPv6 prefixes may be one or more of the first IPv6 prefixes. the same.
  • the second RA message may be sent periodically.
  • the terminal device 102 generates a second IPv6 address according to the second RA message.
  • the second RA message may further carry a second accessible network segment corresponding to the second IPv6 prefix
  • the terminal device 102 may generate a second IPv6 address according to the second RA message, and configure the first And a second address selection policy table, where the second address selection policy table includes the second IPv6 address and the second accessible network segment corresponding to the second IPv6 address.
  • the second RA message may further carry the second ISP identifier corresponding to the second IPv6 prefix.
  • the terminal device 102 may be configured according to the foregoing.
  • a second RA message the fourth IPv6 prefix corresponding to the third ISP identifier is determined from the second IPv6 prefix, and the second IPv6 address is generated according to the fourth IPv6 prefix, as the IPv6 of the terminal device 102 address. If the third ISP identifier does not exist in the ISP identifier corresponding to the second IPv6 prefix, the operation of generating an IPv6 address according to the second RA message is omitted.
  • the second RA message carries the second IPv6 prefix corresponding to the second IPv6 prefix and the second IPv6 prefix. I SP logo.
  • the terminal device 102 receives the second RA message, and if the terminal device 102 locally presets a third ISP identifier, the third ISP identifier may be determined from the second IPv6 prefix according to the second RA message. Corresponding fourth IPv6 prefix, generating a second IPv6 address according to the fourth IPv6 prefix. If the third ISP identifier does not exist in the ISP identifier corresponding to the second IPv6 prefix, the operation of generating an IPv6 address according to the second RA message is omitted. in case The terminal device 102 does not have a preset ISP identifier locally, and may generate a second IPv6 address according to the second RA message, and configure a second address selection policy table.
  • FIG. 3 is a schematic diagram of signaling interaction of a routing mode according to an embodiment of the present invention.
  • the terminal device 102 and the CE 104 perform signaling interaction to configure an IPv6 address. 302.
  • the terminal device 102 transmits an RS message to the CE 104.
  • the terminal device sends an RS message requesting the router to generate the first RA message.
  • the CE 104 sends the first RA message to the terminal device 102, and is configured to respond to the RS message, where the first RA message carries the first IPv6 prefix. 306.
  • the terminal device 102 generates a first IPv6 address according to the first RA message.
  • the embodiment described in FIG. 3 may further include 308.
  • the CE 104 sends a second RA message.
  • the second RA message may be sent periodically.
  • the terminal device 102 generates a second IPv6 address according to the second RA message.
  • the specific technical details of the embodiment shown in FIG. 3 are similar to the embodiment shown in FIG. 2, and details are not described herein again.
  • FIG. 4 is a flow chart of a method for configuring an IP address in an embodiment of the present invention.
  • 402. Receives an RS message sent by the terminal device 102. 404. Send the first RA message to the terminal device 102, where the first RA message is used to respond to the RS message and carry a first IPv6 prefix.
  • the embodiment described in FIG. 4 may further include 406. transmitting a second RA message to the terminal device 102, the second RA message carrying a second IPv6 prefix.
  • the second RA message may be sent periodically.
  • the implementation details of the embodiment shown in Fig. 4 are similar to those of the embodiment shown in Figs. 2 and 3, and will not be described again here.
  • the CE 104 obtains the information corresponding to the IPv6 prefix from the BRAS 108, and the information corresponding to the IPv6 prefix may be at least one of the following information: ISP identifier, accessible network segment .
  • the CE 104 obtains the information corresponding to the IPv6 prefix from the BRAS 108, and may adopt the SLAAC mode RS and RA signaling interaction scheme, or the signaling interaction defined by the Draf t-iet f-6man-addr-se lect-opt.
  • the solution is not limited in this embodiment.
  • RFC 4861 defines the format of the RS message and the format of the RA message.
  • the RS message in the foregoing embodiment may be in the format defined by RFC4861, and details are not described herein again.
  • the RA message defined by RFC4861 is shown in Figure 5.
  • RFC4861 also defines the prefix information option (pref ix informat ion opt ion ) in the RA message.
  • the prefix information option can be one or more. See Figure 6, where the Type field is 3 and the Length field.
  • RFC4861 defines the pref ix informat opt ion, which will not be described here.
  • the RA message in the embodiment of the present invention carries IPv6 before Having an IPv6 prefix corresponding to the IPv6 prefix; or carrying an IPv6 prefix and an ISP identifier corresponding to the IPv6 prefix; or carrying an IPv6 prefix, an accessible network segment corresponding to the IPv6 prefix, and an ISP corresponding to the IPv6 prefix Logo.
  • a sub-option may be added to the prefix information opt ion of the RA message automatically configured by the stateless address to indicate which ISP the IPv6 prefix belongs to in the prefix information option (other places in the text)
  • the cylinder is called the "ISP identifier corresponding to the IPv6 prefix", and/or the IPv6 address generated by the IPv6 prefix is used as the source IP address when the terminal device accesses the network segment (the other part in the text is called the "accessible network corresponding to the IPv6 prefix". segment";).
  • FIG. 7 is a diagram showing a format of a prefix information option including the sub-option in an embodiment of the present invention.
  • the length is no longer fixed to 4, but is filled according to the actual length of the option.
  • the last part of the prefix information option is a variable-length sub-option.
  • the sub-option field is at least one of the following information: an ISP identifier, an accessible network segment.
  • an ISP identifier On some IPv6 terminals with specific functions, only one IPv6 address is required.
  • the ISP can preset the ISP identifier on the terminal or terminal software provided to the user.
  • the terminal or terminal software of the ISP identifier is preset.
  • the matching prefix information option is selected according to the preset ISP identifier, and the prefix information option carries ⁇ ; IPv6 The front t generates an IPv6 address.
  • the accessible network segment shown in Figure 7 indicates that when the terminal device accesses the network segment in the sub-option, the source IPv6 address used should be the IPv6 address generated according to the prefix in the prefix information opt ion.
  • the terminal device may select an address selection policy table defined by RFC6724 according to the accessible network segment. The configuration, addition, modification, and deletion of the address selection policy table can be performed according to the prefix information opt ion and sub-opt ion of the RA message.
  • the RA message when the RA message includes multiple prefixes, the RA message may include multiple prefix information options, and each prefix information option may adopt the format shown in FIG. 7.
  • each prefix information option may adopt the format shown in FIG. 7.
  • the IPv6 prefix in the Prefix information option is the default IPv6 prefix.
  • the terminal device can generate a default IPv6 address according to the default IPv6 prefix.
  • the terminal device queries the address selection policy table according to the destination address to be accessed to determine the source IP address, if the accessible network segment in the address selection policy table does not include the destination address to be accessed, the terminal device adopts the default The IPv6 address is used as the source IP address to access the destination address.
  • a new option may be added to the RA message, such as a prefix description option (prefix descr opt ion ), which is followed by the prefix information opt ion as a supplementary description of the prefix information opt ion.
  • prefix descr ipt ion opt ion is used to describe the ISP corresponding to the IPv6 prefix in the prefix information option, and/or the corresponding accessible network segment.
  • FIG. 8 is a diagram showing an RA message format including a prefix description option added in an embodiment of the present invention.
  • Each prefix information option ⁇ follows a corresponding prefix descr pt ion, and the prefix information opt ion has a Type of 3.
  • Figure 9 is a diagram showing the format of a prefix description option in one embodiment of the present invention.
  • the prefix description opt ion includes type, length, reserved, and option data (opt ion-data). Where type is a newly defined value, such as 10, or 20, or other values not defined in RFC4861.
  • the opt ion-data includes the option data corresponding to the prefix in the prefix information option, and may be at least one of the following information: an ISP identifier, an accessible network segment.
  • FIG. 10 is a flow chart of a method for configuring an IP address in an embodiment of the present invention. As shown in FIG. 10, the method method includes: 1002. The terminal device 102 sends an RS message. 1004. The terminal device 102 receives the first RA message. 1006. The terminal device 102 generates a first IPv6 address according to the first RA message, and configures a first address selection policy table.
  • the method shown in FIG. 10 may further include: 1008.
  • the terminal device 102 receives the second RA message. 1010.
  • the terminal device 102 generates a second IPv6 address according to the second RA message, and configures a second address selection policy table.
  • the method shown in FIG. 10 may further include 1012 before 1006. Determine whether the terminal device 102 presets the ISP identifier. If the ISP ID is not preset, perform the above 1006. If the ISP identifier is preset, execution 1014. Generate a first IPv6 address according to the preset ISP identifier and the first RA message.
  • FIG. 11 is a flow chart of a method for configuring an IP address in still another embodiment of the present invention. As shown in Figure 11,
  • the terminal device 102 transmits an RS message. 1104.
  • the terminal device 102 receives the first RA message. 1106.
  • the terminal device 102 determines whether the ISP identifier is preset locally. If it is determined that the local ISP identifier is preset, 1108 is performed. 1108.
  • the terminal device 102 generates a first IPv6 address according to the preset I SP identifier and the first RA message.
  • the embodiment shown in FIG. 11 may further include 1110.
  • the terminal device 102 receives the second RA message.
  • the terminal device 102 generates a second IPv6 address according to the preset ISP identifier and the second RA message.
  • FIG. 12 is a block diagram showing the structure of the network device 1200 in one embodiment of the present invention.
  • the network device 1200 includes a receiving unit 1202 and a transmitting unit 1204.
  • the receiving unit 1202 is configured to receive an RS message sent by the terminal device.
  • the sending unit 1204 is configured to send a first RA message, where the first RA message is used to respond to the RS message.
  • the sending unit 1204 is further configured to send a second RA message.
  • the second RA message may be sent periodically.
  • the network device 1200 may further include a generating unit 1206, configured to generate the first RA message.
  • the generating unit 1206 is further configured to generate the second RA message.
  • the network device 1200 may be the BRAS 108 shown in Fig. 1, or the CE 104 shown in Fig. 3. If the network device is the CE 104 shown in FIG. 3, the network device 1200 may further include a processing unit 1208, configured to obtain information corresponding to an IPv6 prefix, such as an accessible network segment, from the BRAS 108 shown in FIG. And / or, ISP logo. Correspondingly, the generating unit 1206 is configured to generate the first RA message and/or the second RA message according to the information corresponding to the IPv6 prefix obtained by the processing unit 1208.
  • an IPv6 prefix such as an accessible network segment
  • FIG. 13 is a schematic view showing the structure of the terminal device 1300 in an embodiment of the present invention.
  • the terminal device 1300 includes a transmitting unit 1302, a receiving unit 1304, and a processing unit 1306.
  • the transmitting unit 1302 is for transmitting an RS message.
  • the receiving unit 1304 is configured to receive a first RA message that is responsive to the RS message.
  • the processing unit 1306 is configured to generate a first IPv6 address according to the first RA message, and configure a first address selection policy table.
  • the receiving unit 1304 is further configured to receive the second RA message.
  • the second RA message may be sent periodically.
  • the processing unit 1306 is further configured to generate a second IPv6 address according to the second RA message, and configure a second address selection policy table.
  • the processing unit 1306 is specifically configured to determine whether the terminal device 1300 presets an ISP identifier, and if the ISP identifier is preset, generates a first IPv6 according to the preset ISP identifier and the first RA message. If the ISP identifier is not preset, the first IPv6 address is generated according to the first RA message, and the first address selection policy table is configured.
  • the terminal device 1300 may further include a storage unit, configured to store the preset ISP identifier.
  • FIG 14 is a schematic view showing the structure of the terminal device 1400 in an embodiment of the present invention.
  • the terminal device 1400 includes a transmitting unit 1402, a receiving unit 1404, and a processing unit 1406.
  • the sending unit 1402 is configured to send an RS message.
  • the receiving unit 1404 is configured to receive a first RA message that is responsive to the RS message.
  • the processing unit 1406 is configured to determine whether the terminal device 1400 presets an ISP identifier, and if the ISP identifier is preset, generate a first according to the preset ISP identifier and the first RA message. IPv6 address.
  • the receiving unit 1404 is further configured to receive the second RA message.
  • the processing unit 1406 is further configured to generate a second IPv6 address according to the preset I SP identifier and the second RA message.
  • the terminal device 1400 may further include a storage unit, configured to store the preset ISP identifier.
  • FIG. 15 is a schematic diagram showing the structure of a network device in an embodiment of the present invention.
  • the network device 1500 includes an input/output circuit (I/O c i rcui t) 1502, a processor sor 1504, and a memory 1506.
  • the input/output circuit 1502 is configured to receive an RS message sent by the terminal device, and send a first RA message, where the first RA message is used to respond to the RS message.
  • the input/output circuit 1502 is further configured to send a second RA message.
  • the second RA message may be sent periodically.
  • the processor 1504 is configured to generate the first RA message.
  • the processor 1504 is further configured to generate the second RA message.
  • the memory 1506 is for storing program instructions that, when executed, cause the processor 1504 to perform the above operations.
  • the network device shown in Fig. 15 may be the BRAS 108 shown in Fig. 1, or the CE 104 shown in Fig. 3. If the network device is the CE 104 shown in FIG. 3, the processor 1504 is further configured to obtain information corresponding to the IPv6 prefix from the BRAS 108 shown in FIG. 3, such as an accessible network segment, and/or an ISP identifier. .
  • Figure 16 is a block diagram showing the structure of a terminal device in an embodiment of the present invention.
  • the terminal device 1600 includes an input/output circuit (I/O ci rcui t) 1602, a processor (proces sor) 1604, and a memory 1606.
  • the input/output circuit 1602 is configured to send an RS message, and receive a first RA message that is responsive to the RS message.
  • the processor 1604 is configured to generate a first IPv6 address according to the RA message, and configure a first address selection policy table.
  • the input/output circuit 1602 is further configured to receive a second RA message. The second RA message may be sent periodically.
  • the processor 1604 is further configured to generate a second IPv6 address according to the second RA message, and configure a second address selection policy table.
  • the processor 1604 is specifically configured to determine whether the terminal device 1600 presets an I SP identifier, and if the ISP identifier is preset, generates a first according to the preset ISP identifier and the first RA message. IPv6 address; if there is no preset ISP ID, then Generating the first IPv6 address according to the first RA message, and configuring the first address selection policy table.
  • the memory 1606 is for storing program instructions that, when executed, cause the processor 1604 to perform the operations described above.
  • the memory 1606 is further configured to store the preset ISP identifier.
  • Figure 17 is a block diagram showing the structure of a terminal device in an embodiment of the present invention.
  • the terminal device 1700 includes an input/output circuit (I/O c i rcui t) 1702, a processor (proces sor) 1704, and a memory 1706.
  • the input/output circuit 1702 is configured to send an RS message, and receive a first RA message that is responsive to the RS message.
  • the processor 1704 is configured to determine whether the terminal device 1700 presets an I SP identifier, and if the ISP identifier is preset, generates a first IPv6 address according to the preset ISP identifier and the first RA message.
  • the input/output circuit 1702 is further configured to receive a second RA message.
  • the processor 1704 is further configured to generate a second IPv6 address according to the preset ISP identifier and the second RA message.
  • the memory 1706 is for storing program instructions that, when executed, cause the processor 1704 to perform the operations described above.
  • the memory 1706 is further configured to store the preset ISP identifier.
  • the aforementioned program can be stored in a computer readable storage medium.
  • the steps of the foregoing method embodiments are performed; and the foregoing storage medium includes: a read-only memory (R0M), a random access memory (random acces s memory) )
  • R0M read-only memory
  • random acces s memory random acces s memory

Abstract

Provided is a terminal device, comprising a sending unit, a receiving unit, and a processing unit. The sending unit is configured to send a router request (RS) message. The receiving unit is configured to receive a first router advertisement (RA) message, the first RA message is used for responding to the RS message, and carries a first IPv6 prefix and a first accessible network segment corresponding to the first IPv6 prefix. The processing unit is configured to generate a first IPv6 address according to the first IPv6 prefix, and configure a first address selecting policy table according to the first RA message. The first address selecting policy table comprises the first IPv6 address and the first accessible network segment corresponding to the first IPv6 address, and the first accessible network segment is used for identifying a network segment that can be accessed when the terminal device uses the first IPv6 address as a source address. By using this solution, an address selecting policy table can be configured automatically in a stateless address auto configuration mode.

Description

一种配置 IP地址方法和设备 本申请要求于 2012 年 12 月 31 日提交中国专利局、 申请号为 CN 201210592011.4、 发明名称为 "配置 IP地址的方法和设备" 的中国专利申请 的优先权, 其全部内容通过引用结合在本申请中。 技术领域  The present invention claims the priority of a Chinese patent application filed on December 31, 2012, the Chinese Patent Application No. CN 201210592011.4, entitled "Method and Apparatus for Configuring an IP Address", which The entire contents are incorporated herein by reference. Technical field
本发明实施例涉及通信领域, 尤其涉及一种配置 IP地址的方法和设备。  The embodiments of the present invention relate to the field of communications, and in particular, to a method and a device for configuring an IP address.
背景技术 由于公网第四版互联网协议 ( Internet Protocol version 4,筒称 IPv4 ) 地址的短缺, 许多运营商开始部署第六版互联网协议 ( Internet Protocol version 6, 筒称 IPv6) 网络, 以解决公网 IPv4地址耗尽之后的业务发展问 题。 伴随着 IPv6网络的部署, 出现了新的网络模型及业务模型。 在有的模型 中, 用户边缘(Customer Edge, 筒称 CE )需要连接不同的因特网服务提供商 ( Internet service provider, 筒称 ISP), 并且从不同的 ISP菝取不同的BACKGROUND OF THE INVENTION Due to the shortage of the Internet Protocol version 4 (Internet Protocol version 4), many operators have begun to deploy the sixth version of the Internet Protocol (Internet Protocol version 6, called IPv6) network to solve the public network. Business development issues after the IPv4 address is exhausted. Along with the deployment of IPv6 networks, new network models and business models emerged. In some models, the Customer Edge (CE) needs to connect to different Internet service providers (ISPs) and learn from different ISPs.
IPv6前缀。 然后 CE根据获取的 IPv6前缀, 通过支持 IPv6的动态主机配置协 议 ( Dynamic Host Configuration Protocol for IPv6, 筒称 DHCPv6 )或者 无^大态地址自动酉己置 (stateless address auto configuration, 筒称 SLAAC) 为各个 IPv6终端设备, 例如 IPv6主机 ( host ), 配置 IPv6地址。 IPv6 prefix. Then, according to the obtained IPv6 prefix, the CE supports each IPv6 dynamic host configuration protocol (IPv6) or the stateless address auto configuration (SLAAC). An IPv6 terminal device, such as an IPv6 host (host), is configured with an IPv6 address.
IETF提出了一种地址分配的方案。 CE从多个 ISP获取多个 IPv6前缀, 通过 The IETF proposes a scheme for address allocation. The CE obtains multiple IPv6 prefixes from multiple ISPs.
DHCPv6或者 SLAAC给所有终端设备都分配多个 IPv6地址。 采用 DHCPv6方式时,DHCPv6 or SLAAC assigns multiple IPv6 addresses to all terminal devices. When using DHCPv6 mode,
CE按获取的前缀数量, 给每个终端设备分配多个 IPv6地址, 其中, 地址数量 与获取的 IPv6前缀数量一致。 采用 SLAAC方式时, CE通过路由通告 (RouterThe CE allocates multiple IPv6 addresses to each terminal device according to the number of prefixes obtained. The number of addresses is the same as the number of acquired IPv6 prefixes. When using SLAAC, the CE passes the route advertisement (Router
Advertisement, 筒称 RA) 消息, 把所有 IPv6前缀均告知每个终端设备, 每个 终端设备根据获取的 IPv6前缀, 生成多个 IPv6地址。 由于终端设备获取多个The advertisement, the RA message, informs each terminal device of all IPv6 prefixes, and each terminal device generates multiple IPv6 addresses according to the obtained IPv6 prefix. Since the terminal device acquires multiple
IPv6地址, 终端设备向外发送 IPv6报文的时候, 需要选择恰当的 IPv6地址作 为源 IP地址, 否则, 在某些基于源地址认证 /过滤的网络中, 该终端设备发送 的 IPv6报文将被丟弃, 从而导致该终端设备无法使用网络提供的业务。 RFC3484提出了 IPv6缺省地址选择方法, 其中涉及缺省的地址选择算法及缺省 的地址选择策略表。 终端设备发送报文时, 缺省算法不能保证终端设备能够 选择正确的源 IPv6地址, 因此 IETF对这个 RFC进行升级, 用 RFC6724取代 RFC3484 。 但 RFC6724并未定义配置地址选择策略表的机制 。 IPv6 address, when the terminal device sends an IPv6 packet to the device, the IPv6 address must be selected as the source IP address. Otherwise, in some networks based on the source address authentication/filtering, the IPv6 packet sent by the terminal device will be Discard, resulting in the terminal device being unable to use the services provided by the network. RFC 3484 proposes an IPv6 default address selection method, which involves a default address selection algorithm and a default address selection policy table. When the terminal device sends a packet, the default algorithm cannot guarantee that the terminal device can select the correct source IPv6 address. Therefore, the IETF upgrades the RFC and replaces RFC3484 with RFC6724. However, RFC6724 does not define a mechanism for configuring an address selection policy table.
Draf t_iet f_6man_addr_se lect_opt文稿提出了采用 DHCPv6方式时, 如何实现 地址选择策略表的配置和更新, 但未对采用 SLAAC方式时的地址选择策略表的 配置给出建议。 The Draf t_iet f_6man_addr_se lect_opt manuscript proposes how to implement the configuration and update of the address selection policy table when using the DHCPv6 mode, but does not give advice on the configuration of the address selection policy table when using the SLAAC mode.
发明内容 有鉴于此, 本发明实施例提供一种配置 IP地址的方法及设备, 用于解决 现有技术中采用 SLAAC方式时无法实现地址选择策略表的配置的问题。 SUMMARY OF THE INVENTION In view of the above, the embodiments of the present invention provide a method and a device for configuring an IP address, which are used to solve the problem that the configuration of the address selection policy table cannot be implemented when the SLAAC mode is used in the prior art.
第一方面, 提供一种配置 IP地址的方法, 包括: 接收终端设备发送的路 由器请求 RS消息; 向所述终端设备发送第一路由器通告 RA消息, 所述第一 RA消息用于响应所述 RS消息,并且携带第一 IPv6前缀和所述第一 IPv6前缀 对应的第一可访问网段。  In a first aspect, a method for configuring an IP address is provided, including: receiving a router request RS message sent by a terminal device; sending a first router advertisement RA message to the terminal device, where the first RA message is used to respond to the RS The message carries the first IPv6 prefix and the first accessible network segment corresponding to the first IPv6 prefix.
根据第一方面, 提供第一种实现方式, 所述第一 RA消息中包括前缀信息 选项, 所述前缀信息选项中包括所述第一 IPv6前缀和子选项, 所述子选项包 括所述第一可访问网段。  According to the first aspect, a first implementation manner is provided, where the first RA message includes a prefix information option, where the prefix information option includes the first IPv6 prefix and a sub-option, where the sub-option includes the first Access the network segment.
根据第一方面, 提供第二种实现方式, 所述第一 RA消息中包括前缀信息 选项和所述前缀信息选项对应的前缀描述选项, 所述前缀信息选项中包括所 述第一 IPv6前缀, 所述前缀描述选项包括所述第一可访问网段。  According to the first aspect, a second implementation manner is provided, where the first RA message includes a prefix information option and a prefix description option corresponding to the prefix information option, where the prefix information option includes the first IPv6 prefix, The prefix description option includes the first accessible network segment.
根据第一方面或第一方面的第一种实现方式或者第一方面的第二种实现 方式, 提供第三种实现方式, 所述第一 RA消息中还包括所述第一 IPv6前缀 对应的因特网服务提供商 ISP标识。  According to the first aspect or the first implementation manner of the first aspect, or the second implementation manner of the first aspect, the third implementation manner is further provided, where the first RA message further includes the Internet corresponding to the first IPv6 prefix. Service Provider ISP ID.
根据第一方面或第一方面的第一种实现方式或者第一方面的第二种实现 方式或者第一方面的第三种实现方式, 提供第四种实现方式, 所述方法还包 括: 向所述终端设备发送第二 RA消息, 所述第二 RA消息携带第二 IPv6前缀 和所述第二 IPv6前缀对应的第二可访问网段。  According to the first aspect or the first implementation manner of the first aspect, or the second implementation manner of the first aspect, or the third implementation manner of the first aspect, the fourth implementation manner is further provided, where the method further includes: The terminal device sends a second RA message, where the second RA message carries a second IPv6 prefix and a second accessible network segment corresponding to the second IPv6 prefix.
第二方面, 提供一种配置 IP地址的方法, 包括: 接收终端设备发送的路 由器请求 RS消息; 向所述终端设备发送路由器通告 RA消息, 所述 RA消息用 于响应所述 RS消息, 并且携带 IPv6前缀和所述 IPv6前缀对应的因特网服务 提供商 ISP标识。 The second aspect provides a method for configuring an IP address, including: receiving a router request RS message sent by a terminal device, and sending a router advertisement RA message to the terminal device, where the RA message is used by Responding to the RS message, and carrying an IPv6 prefix and an Internet Service Provider ISP identifier corresponding to the IPv6 prefix.
根据第二方面,提供第一种实现方式,所述 RA消息中包括前缀信息选项, 所述前缀信息选项中包括所述 IPv6前缀和子选项, 所述子选项包括所述 ISP 标识。  According to the second aspect, a first implementation manner is provided, where the RA message includes a prefix information option, where the prefix information option includes the IPv6 prefix and a sub-option, and the sub-option includes the ISP identifier.
根据第二方面, 提供第二种实现方式, 所述 RA消息中包括前缀信息选项 和所述前缀信息选项对应的前缀描述选项, 所述前缀信息选项中包括所述 IPv6前缀, 所述前缀描述选项包括所述 ISP标识。  According to the second aspect, a second implementation manner is provided, where the RA message includes a prefix information option and a prefix description option corresponding to the prefix information option, where the prefix information option includes the IPv6 prefix, and the prefix description option The ISP logo is included.
第三方面, 提供一种网络设备, 包括接收单元和发送单元。 其中, 所述 接收单元用于接收终端设备发送的路由器请求 RS消息。 所述发送单元用于发 送第一路由器通告 RA消息, 所述第一 RA消息用于响应所述 RS消息, 并且携 带第一 IPv6前缀和所述第一 IPv6前缀对应的第一可访问网段。  In a third aspect, a network device is provided, including a receiving unit and a sending unit. The receiving unit is configured to receive a router request RS message sent by the terminal device. The sending unit is configured to send a first router advertisement RA message, where the first RA message is used to respond to the RS message, and carries a first IPv6 prefix and a first accessible network segment corresponding to the first IPv6 prefix.
根据第三方面, 提供第一种实现方式, 所述第一 RA消息中包括前缀信息 选项, 所述前缀信息选项中包括所述第一 IPv6前缀和子选项, 所述子选项包 括所述第一可访问网段。  According to the third aspect, a first implementation manner is provided, where the first RA message includes a prefix information option, where the prefix information option includes the first IPv6 prefix and a sub-option, where the sub-option includes the first Access the network segment.
根据第三方面, 提供第二种实现方式, 所述第一 RA消息中包括前缀信息 选项和所述前缀信息选项对应的前缀描述选项, 所述前缀信息选项中包括所 述第一 IPv6前缀, 所述前缀描述选项包括所述第一可访问网段。  According to the third aspect, a second implementation manner is provided, where the first RA message includes a prefix information option and a prefix description option corresponding to the prefix information option, where the prefix information option includes the first IPv6 prefix, The prefix description option includes the first accessible network segment.
根据第三方面或者第三方面的第一种实现方式或者第三方面的第二种实 现方式, 提供第三种实现方式, 所述第一 RA消息中还包括所述第一 IPv6前 缀对应的因特网服务提供商 I SP标识。  According to the third aspect or the first implementation manner of the third aspect, or the second implementation manner of the third aspect, the third implementation manner is further provided, where the first RA message further includes the Internet corresponding to the first IPv6 prefix. Service Provider I SP logo.
根据第三方面或者第三方面的上述任何一种实现方式, 提供第四种实现 方式, 所述发送单元还用于向所述终端设备发送第二 RA 消息, 所述第二 RA 消息携带第二 IPv6前缀和所述第二 IPv6前缀对应的第二可访问网段。  According to the third aspect or any one of the foregoing implementation manners, the fourth implementation manner is provided, the sending unit is further configured to send a second RA message to the terminal device, where the second RA message carries the second The second accessible network segment corresponding to the IPv6 prefix and the second IPv6 prefix.
第四方面, 提供一种终端设备, 包括: 发送单元、 接收单元和处理单元。 其中, 所述发送单元用于发送路由器请求 RS消息。 所述接收单元用于接收第 一路由器通告 RA消息, 所述第一 RA消息用于响应所述 RS消息, 并且携带第 一 IPv6前缀和所述第一 IPv6前缀对应的第一可访问网段。 所述处理单元用 于根据所述第一 IPv6前缀生成第一 IPv6地址, 并根据所述第一 RA消息配置 第一地址选择策略表, 所述第一地址选择策略表包括所述第一 IPv6地址和所 述第一 IPv6地址对应的所述第一可访问网段, 所述第一可访问网段用于标识 所述终端设备使用所述第一 IPv6地址作为源地址时可以访问的网段。 A fourth aspect provides a terminal device, including: a sending unit, a receiving unit, and a processing unit. The sending unit is configured to send a router request RS message. The receiving unit is configured to receive a first router advertisement RA message, where the first RA message is used to respond to the RS message, and carries a first IPv6 prefix and a first accessible network segment corresponding to the first IPv6 prefix. The processing unit is configured to generate a first IPv6 address according to the first IPv6 prefix, and configure a first address selection policy table according to the first RA message, where the first address selection policy table includes the first IPv6 address The first accessible network segment corresponding to the first IPv6 address, where the first accessible network segment is used to identify A network segment that can be accessed when the terminal device uses the first IPv6 address as a source address.
根据第四方面, 提供第一种实现方式, 所述第一 RA消息中包括前缀信息 选项, 所述前缀信息选项中包括所述第一 IPv6前缀和子选项, 所述子选项包 括所述第一可访问网段。  According to the fourth aspect, a first implementation manner is provided, where the first RA message includes a prefix information option, where the prefix information option includes the first IPv6 prefix and a sub-option, where the sub-option includes the first Access the network segment.
根据第四方面, 提供第二种实现方式, 所述第一 RA消息中包括前缀信息 选项和所述前缀信息选项对应的前缀描述选项, 所述前缀信息选项中包括所 述第一 IPv6前缀, 所述前缀描述选项包括所述第一可访问网段。  According to the fourth aspect, a second implementation manner is provided, where the first RA message includes a prefix information option and a prefix description option corresponding to the prefix information option, where the prefix information option includes the first IPv6 prefix, The prefix description option includes the first accessible network segment.
根据第四方面或者第四方面的任何一种实现方式, 所述接收单元还用于 接收第二 RA消息, 所述第二 RA消息携带第二 IPv6前缀和所述第二 IPv6前 缀对应的第二可访问网段。 所述处理单元还用于根据所述第二 IPv6前缀生成 第二 IPv6地址, 并根据所述第二 RA消息配置第二地址选择策略表, 所述第 二地址选择策略表包括所述第二 IPv6地址和所述第二 IPv6地址对应的所述 第二可访问网段, 所述第二可访问网段用于标识所述终端设备使用所述第二 IPv6地址作为源地址时可以访问的网段。  According to the fourth aspect, or any implementation of the fourth aspect, the receiving unit is further configured to receive a second RA message, where the second RA message carries a second IPv6 prefix and a second corresponding to the second IPv6 prefix. Access to the network segment. The processing unit is further configured to generate a second IPv6 address according to the second IPv6 prefix, and configure a second address selection policy table according to the second RA message, where the second address selection policy table includes the second IPv6 An address of the second accessible network segment corresponding to the second IPv6 address, where the second accessible network segment is used to identify a network segment that the terminal device can access when using the second IPv6 address as a source address. .
采用提供的技术方案, 终端设备接收到的 RA消息中携带 IPv6前缀和所 述 IPv6前缀对应的可访问网段, 终端设备可以根据所述 RA消息配置地址选 择策略表, 地址选择策略表包括 IPv6地址和所述 IPv6地址对应的可访问网 段。 终端设备与其他设备通信时可以根据地址选择策略表选择合适的 IPv6地 址作为源地址。 因此, 本发明实施例的方案可以实现 SLAAC方式下地址选择 策略表的自动配置。  According to the technical solution provided, the RA message received by the terminal device carries an IPv6 prefix and an accessible network segment corresponding to the IPv6 prefix, and the terminal device can configure an address selection policy table according to the RA message, where the address selection policy table includes an IPv6 address. An accessible network segment corresponding to the IPv6 address. When the terminal device communicates with other devices, the appropriate IPv6 address can be selected as the source address according to the address selection policy table. Therefore, the solution of the embodiment of the present invention can implement automatic configuration of the address selection policy table in the SLAAC mode.
第五方面, 提供一种终端设备, 包括: 发送单元、 接收单元和处理单元。 其中, 所述发送单元用于发送路由器请求 RS消息。 所述接收单元用于接收 RA 消息, 所述 RA消息用于响应所述 RS消息, 并且携带第一 IPv6前缀和所述第 一 IPv6前缀对应的第一因特网服务提供商 ISP的标识。 所述处理单元用于从 所述第一 IPv6前缀中确定对应所述终端设备预设的 ISP标识的第三 IPv6前 缀, 利用所述第三 IPv6前缀生成第一 IPv6地址。  A fifth aspect provides a terminal device, including: a sending unit, a receiving unit, and a processing unit. The sending unit is configured to send a router request RS message. The receiving unit is configured to receive an RA message, where the RA message is used to respond to the RS message, and carries a first IPv6 prefix and an identifier of a first Internet service provider ISP corresponding to the first IPv6 prefix. The processing unit is configured to determine, from the first IPv6 prefix, a third IPv6 prefix corresponding to the ISP identifier preset by the terminal device, and generate a first IPv6 address by using the third IPv6 prefix.
根据第五方面,提供第一种实现方式,所述 RA消息中包括前缀信息选项, 所述前缀信息选项中包括所述第一 IPv6前缀和子选项, 所述子选项包括所述 第一 ISP标识。  According to the fifth aspect, a first implementation manner is provided, where the RA message includes a prefix information option, where the prefix information option includes the first IPv6 prefix and a sub-option, and the sub-option includes the first ISP identifier.
根据第五方面, 提供第二种实现方式, 所述 RA消息中包括前缀信息选项 和所述前缀信息选项对应的前缀描述选项, 所述前缀信息选项中包括所述第 一 IPv6前缀, 所述前缀描述选项包括所述第一 ISP标识。 According to the fifth aspect, a second implementation manner is provided, where the RA message includes a prefix information option and a prefix description option corresponding to the prefix information option, where the prefix information option includes the foregoing An IPv6 prefix, the prefix description option including the first ISP identifier.
采用提供的技术方案, 终端设备接收到的 RA消息中携带 IPv6前缀和所 述 IPv6前缀对应的 I SP标识, 终端设备可以根据本地预设的 ISP标识和所述 According to the technical solution provided, the RA message received by the terminal device carries an IPv6 prefix and an I SP identifier corresponding to the IPv6 prefix, and the terminal device can use the preset ISP identifier according to the local
RA消息, 从所述 RA消息中携带的 IPv6前缀中, 选择对应所述预设 ISP标识 的 IPv6前缀, 生成 IPv6地址。 因此, 本发明实施例的方案可以节省 IPv6地 址。 The RA message, from the IPv6 prefix carried in the RA message, selects an IPv6 prefix corresponding to the preset ISP identifier to generate an IPv6 address. Therefore, the solution of the embodiment of the present invention can save an IPv6 address.
附图说明 为了更清楚地说明本发明的技术方案, 下面将对实施例中使用的附图作 筒单地介绍, 显而易见地, 下面附图只是本发明的一些实施例的附图, 对于 本领域普通技术人员来说, 在不付出创造性劳动性的前提下, 还可以根据这 些附图获得同样能实现本发明技术方案的其它附图。 BRIEF DESCRIPTION OF THE DRAWINGS In order to more clearly illustrate the technical solutions of the present invention, the drawings used in the embodiments will be briefly described below. It is obvious that the following drawings are only drawings of some embodiments of the present invention. Other drawings of the technical solution of the present invention can also be obtained according to these drawings without any creative labor.
图 1为本发明一个实施例中的网络结构筒化示意图;  1 is a schematic diagram of a network structure in an embodiment of the present invention;
图 2为本发明一个实施例中桥接模式的信令交互示意图;  2 is a schematic diagram of signaling interaction of a bridge mode in an embodiment of the present invention;
图 3为本发明一个实施例中路由模式的信令交互示意图;  3 is a schematic diagram of signaling interaction of a routing mode according to an embodiment of the present invention;
图 4为本发明一个实施例中配置 IP地址的方法流程图;  4 is a flowchart of a method for configuring an IP address according to an embodiment of the present invention;
图 5为 RA消息格式图;  Figure 5 is a RA message format diagram;
图 6为 RA消息中的前缀信息选项格式图;  Figure 6 is a format diagram of the prefix information option in the RA message;
图 7 为本发明一个实施例中包含 sub-opt ion 的 pref ix informat ion opt ion格式图;  7 is a pref ix informat ion opt ion format diagram including a sub-opt ion according to an embodiment of the present invention;
图 8为本发明一个实施例中包含新增的 pref ix descr ipt ion opt ion的 RA消息格式图;  8 is a format diagram of an RA message including a newly added pref ix descr opt ion opt ion according to an embodiment of the present invention;
图 9为本发明一个实施例的网络中 pref ix descr ipt ion opt ion的格式 图;  9 is a format diagram of a pref ix descr ipt ion opt ion in a network according to an embodiment of the present invention;
图 10是本发明一个实施例中配置 IP地址的方法流程图;  10 is a flowchart of a method for configuring an IP address in an embodiment of the present invention;
图 11是本发明又一个实施例中配置 IP地址的方法流程图;  11 is a flowchart of a method for configuring an IP address in still another embodiment of the present invention;
图 12是本发明一个实施例中网络设备的筒化结构示意图;  12 is a schematic diagram of a cylindrical structure of a network device according to an embodiment of the present invention;
图 13是本发明一个实施例中终端设备的筒化结构示意图;  13 is a schematic view showing a tubular structure of a terminal device according to an embodiment of the present invention;
图 14是本发明一个实施例中终端设备的筒化结构示意图;  FIG. 14 is a schematic diagram of a tubular structure of a terminal device according to an embodiment of the present invention; FIG.
图 15是本发明一个实施例中网络设备的筒化结构示意图; 图 16是本发明一个实施例中终端设备的筒化结构示意图; 15 is a schematic diagram of a cylindrical structure of a network device according to an embodiment of the present invention; 16 is a schematic diagram of a tubular structure of a terminal device according to an embodiment of the present invention;
图 17是本发明一个实施例中终端设备的筒化结构示意图。  Figure 17 is a schematic view showing the structure of a terminal device in an embodiment of the present invention.
具体实施方式 为使本发明的目的、 技术方案和优点更加清楚, 下面将结合本发明实施 例中的附图, 对本发明实施例的技术方案进行清楚、 完整地描述。 显然, 下 述的各个实施例都只是本发明一部分的实施例。 基于本发明下述的各个实施 例, 本领域普通技术人员即使没有作出创造性劳动, 也可以通过等效变换部 分甚至全部的技术特征, 而获得能够解决本发明技术问题, 实现本发明技术 效果的其它实施例, 而这些变换而来的各个实施例显然并不脱离本发明所公 开的范围。 The technical solutions of the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It will be apparent that the various embodiments described below are merely exemplary embodiments of the invention. Based on the following various embodiments of the present invention, those skilled in the art can obtain other technical features that can solve the technical problems of the present invention and achieve the technical effects of the present invention by equivalently transforming some or even all of the technical features without creative work. The various embodiments of the invention are apparent from the scope of the invention as disclosed.
图 1是本发明一个实施例中的网络结构筒化示意图。 如图 1所示, 终端 设备 102 通过 CE 104、 接入点 (Acces s Node ) 106 和宽带远程接入服务器 ( broadband remote acces s server , 筒称 BRAS ) 108实现通信。 举例来说 , 终端设备 102可以是电脑, IP电视(IPTV ), 电话, 医疗终端, 或者其他终端 设备。 图 1 示例性地画出了三个终端设备, 但本发明实施例不限制终端设备 的数量和类型。 本实施例中也不限制 CE的布置模式, 例如, CE可以布置为桥 接模式, 或者路由模式。  FIG. 1 is a schematic diagram of a network structure in an embodiment of the present invention. As shown in FIG. 1, the terminal device 102 communicates through the CE 104, an access point (Acces s Node) 106, and a broadband remote acces s server (BRAS) 108. For example, the terminal device 102 can be a computer, an IP television (IPTV), a telephone, a medical terminal, or other terminal device. Fig. 1 exemplarily shows three terminal devices, but the embodiment of the present invention does not limit the number and types of terminal devices. The arrangement mode of the CE is also not limited in this embodiment. For example, the CE may be arranged in a bridge mode or a route mode.
图 2为本发明一个实施例中桥接模式的信令交互示意图。 如图 2所示, 在 CE的布置模式为桥接模式时, 终端设备 102与 BRAS 108之间进行信令交 互以配置 IPv6地址。  FIG. 2 is a schematic diagram of signaling interaction of a bridge mode in an embodiment of the present invention. As shown in FIG. 2, when the arrangement mode of the CE is the bridge mode, the terminal device 102 and the BRAS 108 perform signaling interaction to configure an IPv6 address.
202.终端设备 102 向 BRAS 108 发送路由器请求消息 ( Router Sol ic i tat ion Mes sage , 筒称 RS Mes sage )。举例来说 , 当接口使能 ( enabled ) 时, 终端设备发送 RS 消息请求路由器生成路由器通告消息 ( Router Adver t i sement me s sage , 筒称 RA me s s age )。  202. The terminal device 102 sends a router request message (Router Sol ic i tate Mes sage, called RS Mes sage ) to the BRAS 108. For example, when the interface is enabled, the terminal device sends an RS message requesting the router to generate a router advertisement message (Router Advertise s s s sage ).
204. BRAS 108向终端设备 102发送第一 RA消息, 用于响应所述 RS消息, 所述第一 RA消息中携带第一 IPv6前缀。 所述第一 IPv6前缀可以是一个或者 多个。  The BRAS 108 sends a first RA message to the terminal device 102, and is configured to respond to the RS message, where the first RA message carries a first IPv6 prefix. The first IPv6 prefix may be one or more.
在一种实现方式中, 除了携带所述第一 IPv6前缀外, 所述第一 RA消息 中还携带所述第一 IPv6前缀对应的第一可访问网段。  In an implementation manner, in addition to carrying the first IPv6 prefix, the first RA message further carries the first accessible network segment corresponding to the first IPv6 prefix.
在另一种实现方式中, 除了携带所述第一 IPv6前缀外, 所述第一 RA消 息中还携带所述第一 IPv6前缀对应的第一 ISP标识。 In another implementation manner, in addition to carrying the first IPv6 prefix, the first RA cancellation The first ISP identifier corresponding to the first IPv6 prefix is also carried in the information.
在又一种实现方式中, 除了携带所述第一 IPv6前缀外, 所述第一 RA消 息中既携带所述第一 IPv6前缀对应的第一可访问网段,又携带所述第一 IPv6 前缀对应的第一 I SP标识。  In another implementation, in addition to carrying the first IPv6 prefix, the first RA message carries the first accessible network segment corresponding to the first IPv6 prefix, and carries the first IPv6 prefix. Corresponding first I SP identifier.
206.终端设备 102根据所述第一 RA消息携带的第一 IPv6前缀生成第一 206. The terminal device 102 generates a first according to the first IPv6 prefix carried by the first RA message.
IPv6地址。 IPv6 address.
在所述第一 RA消息携带所述第一 IPv6前缀对应的第一可访问网段的情 形下, 所述终端设备 102还可以根据所述第一 RA消息配置第一地址选择策略 表, 所述第一地址选择策略表包括所述第一 IPv6地址和所述第一 IPv6地址 对应的第一可访问网段。 例如, 所述第一 RA消息中携带第一 IPv6前缀 1和 对应的第一可访问网段 1、 第一 I Pv 6前缀 2和对应的第一可访问网段 2、 以 及第一 IPv6前缀 3和对应的第一可访问网段 3。 终端设备 102收到所述第一 RA消息,根据所述第一 IPv6前缀 1生成第一 IPv6地址 1 ,根据所述第一 IPv6 前缀 2生成第一 IPv6地址 2 , 根据所述第一 IPv6前缀 3生成第一 IPv6地址 3。 终端设备 102还配置第一地址选择策略表, 所述第一地址选择策略表包括 第一 IPv6地址 1和对应的可访问网段 1、第一 IPv6地址 2和对应的可访问网 段 1、 以及第一 IPv6地址 3和对应的可访问网段 3。 采用这种方案, 可以实 现采用 SLAAC方式时地址选择策略表的自动配置。  In the case that the first RA message carries the first accessible network segment corresponding to the first IPv6 prefix, the terminal device 102 may further configure a first address selection policy table according to the first RA message, where The first address selection policy table includes the first IPv6 address and the first accessible network segment corresponding to the first IPv6 address. For example, the first RA message carries a first IPv6 prefix 1 and a corresponding first accessible network segment 1, a first I Pv 6 prefix 2, and a corresponding first accessible network segment 2, and a first IPv6 prefix 3 And the corresponding first accessible network segment 3. The terminal device 102 receives the first RA message, generates a first IPv6 address 1 according to the first IPv6 prefix 1, and generates a first IPv6 address 2 according to the first IPv6 prefix 2, according to the first IPv6 prefix 3 Generate the first IPv6 address 3. The terminal device 102 further configures a first address selection policy table, where the first address selection policy table includes a first IPv6 address 1 and a corresponding accessible network segment 1, a first IPv6 address 2, and a corresponding accessible network segment 1, and The first IPv6 address 3 and the corresponding accessible network segment 3. With this scheme, automatic configuration of the address selection policy table in the SLAAC mode can be implemented.
当所述终端设备 102预设第三 ISP标识时, 上述 206的实现方式如下。 在所述 RA消息携带所述 IPv6前缀对应的 ISP标识的情形下, 所述终端设备 102可以根据所述第三 ISP标识, 从所述第一 IPv6前缀中确定所述第三 ISP 标识对应的第三 IPv6前缀,根据所述第三 IPv6前缀生成所述第一 IPv6地址, 作为所述终端设备 102的 IPv6地址。 如果所述第一 IPv6前缀对应的 ISP标 识中不存在所述第三 ISP标识, 则省略根据所述第一 RA消息生成 IPv6地址 的操作, 即, 不根据所述第一 RA消息生成 IPv6地址。 举例来说, 所述第三 ISP标识为一个。 采用这种方案, 当终端设备 102只需要一个 IPv6地址时, 即使终端设备 102收到多个 IPv6前缀, 也可以根据本地预设的一个 ISP标识 和收到的 RA消息, 生成一个 IPv6地址, 从而可以避免地址浪费, 并且在发 送报文时也省去了选择源地址的麻烦。  When the terminal device 102 presets the third ISP identifier, the foregoing 206 is implemented as follows. In the case that the RA message carries the ISP identifier corresponding to the IPv6 prefix, the terminal device 102 may determine, according to the third ISP identifier, the third ISP identifier corresponding to the first IPv6 prefix. And generating, by the third IPv6 prefix, the first IPv6 address, as the IPv6 address of the terminal device 102. If the third ISP identifier does not exist in the ISP identifier corresponding to the first IPv6 prefix, the operation of generating an IPv6 address according to the first RA message is omitted, that is, the IPv6 address is not generated according to the first RA message. For example, the third ISP identifier is one. With this solution, when the terminal device 102 only needs one IPv6 address, even if the terminal device 102 receives multiple IPv6 prefixes, it can generate an IPv6 address according to a preset ISP identifier and the received RA message. Address waste can be avoided, and the trouble of selecting the source address is omitted when sending a message.
在所述第一 RA消息携带所述第一 IPv6前缀对应的第一可访问网段和第 一 ISP标识的情形下, 终端设备 102接收到所述第一 RA消息, 如果终端设备 102本地预设了一个第三 ISP标识,则从所述第一 RA消息携带的第一 IPv6前 缀中选择对应所述第三 ISP标识的第三 IPv6前缀, 根据所述第三 IPv6前缀 生成所述第一 IPv6地址。 如果所述第一 IPv6前缀对应的 ISP标识中不存在 所述第三 ISP标识, 则省略根据所述第一 RA消息生成 IPv6地址的操作。 如 果终端设备 102本地没有预设 ISP标识, 则可以根据所述第一 RA消息生成第 一 IPv6地址, 并配置第一地址选择策略表。 In a case where the first RA message carries the first accessible network segment corresponding to the first IPv6 prefix and the first ISP identifier, the terminal device 102 receives the first RA message, if the terminal device The third IPv6 prefix corresponding to the third ISP identifier is selected from the first IPv6 prefix that is carried by the first RA message, and the third IPv6 prefix is generated according to the third IPv6 prefix. The first IPv6 address. If the third ISP identifier does not exist in the ISP identifier corresponding to the first IPv6 prefix, the operation of generating an IPv6 address according to the first RA message is omitted. If the terminal device 102 does not have a preset ISP identifier, the first IPv6 address may be generated according to the first RA message, and the first address selection policy table is configured.
可选地, 图 2所述的实施例还可以包括  Optionally, the embodiment described in FIG. 2 may further include
208.所述 BRAS 108发送第二 RA消息。 所述第二 RA消息携带第二 IPv6 前缀。 所述第二 IPv6前缀可以是一个或者更多。 所述第二 IPv6前缀可以与 所述第一 IPv6前缀相同, 也可以不相同, 例如多个所述第二 IPv6前缀中的 一个或者多个可以与所述第一 IPv6前缀中的一个或者多个相同。 举例来说, 所述第二 RA消息可以是定期发送。  208. The BRAS 108 sends a second RA message. The second RA message carries a second IPv6 prefix. The second IPv6 prefix may be one or more. The second IPv6 prefix may be the same as the first IPv6 prefix, or may be different. For example, one or more of the plurality of the second IPv6 prefixes may be one or more of the first IPv6 prefixes. the same. For example, the second RA message may be sent periodically.
210.终端设备 102根据所述第二 RA消息生成第二 IPv6地址。  210. The terminal device 102 generates a second IPv6 address according to the second RA message.
举例来说, 所述第二 RA消息还可以携带对应所述第二 IPv6前缀的第二 可访问网段, 所述终端设备 102可以根据所述第二 RA消息生成第二 IPv6地 址,并配置第二地址选择策略表,所述第二地址选择策略表包括所述第二 IPv6 地址和对应所述第二 IPv6地址对应的所述第二可访问网段。  For example, the second RA message may further carry a second accessible network segment corresponding to the second IPv6 prefix, and the terminal device 102 may generate a second IPv6 address according to the second RA message, and configure the first And a second address selection policy table, where the second address selection policy table includes the second IPv6 address and the second accessible network segment corresponding to the second IPv6 address.
又举例来说, 所述第二 RA消息还可以携带所述第二 IPv6前缀对应的第 二 ISP标识, 如果所述终端设备 102本地预设第三 ISP标识, 所述终端设备 102可以根据所述第二 RA消息,从所述第二 IPv6前缀中确定所述第三 ISP标 识对应的第四 IPv6前缀, 根据所述第四 IPv6前缀生成所述第二 IPv6地址, 作为所述终端设备 102的 IPv6地址。 如果所述第二 IPv6前缀对应的 ISP标 识中不存在所述第三 ISP标识, 则省略根据所述第二 RA消息生成 IPv6地址 的操作。  For example, the second RA message may further carry the second ISP identifier corresponding to the second IPv6 prefix. If the terminal device 102 locally presets the third ISP identifier, the terminal device 102 may be configured according to the foregoing. a second RA message, the fourth IPv6 prefix corresponding to the third ISP identifier is determined from the second IPv6 prefix, and the second IPv6 address is generated according to the fourth IPv6 prefix, as the IPv6 of the terminal device 102 address. If the third ISP identifier does not exist in the ISP identifier corresponding to the second IPv6 prefix, the operation of generating an IPv6 address according to the second RA message is omitted.
再举例来说, 所述第二 RA消息除了携带所述第二 IPv6前缀外, 既携带 所述第二 IPv6前缀对应的第二可访问网段, 又携带所述第二 IPv6前缀对应 的第二 I SP标识。 终端设备 102接收到所述第二 RA消息, 如果终端设备 102 本地预设一个第三 ISP标识, 则可以根据所述第二 RA消息,从所述第二 IPv6 前缀中确定所述第三 ISP标识对应的第四 IPv6前缀, 根据所述第四 IPv6前 缀生成第二 IPv6地址。 如果所述第二 IPv6前缀对应的 ISP标识中不存在所 述第三 ISP标识, 则省略根据所述第二 RA消息生成 IPv6地址的操作。 如果 终端设备 102本地没有预设 ISP标识, 则可以根据所述第二 RA消息生成第二 IPv6地址, 并配置第二地址选择策略表。 For example, the second RA message carries the second IPv6 prefix corresponding to the second IPv6 prefix and the second IPv6 prefix. I SP logo. The terminal device 102 receives the second RA message, and if the terminal device 102 locally presets a third ISP identifier, the third ISP identifier may be determined from the second IPv6 prefix according to the second RA message. Corresponding fourth IPv6 prefix, generating a second IPv6 address according to the fourth IPv6 prefix. If the third ISP identifier does not exist in the ISP identifier corresponding to the second IPv6 prefix, the operation of generating an IPv6 address according to the second RA message is omitted. in case The terminal device 102 does not have a preset ISP identifier locally, and may generate a second IPv6 address according to the second RA message, and configure a second address selection policy table.
图 3为本发明一个实施例中路由模式的信令交互示意图。 如图 3所示, 在 CE的布置模式为路由模式时, 终端设备 102与 CE 104之间进行信令交互 以配置 IPv6地址。 302.终端设备 102向 CE 104发送 RS消息。 举例来说, 当 接口使能( enabled )时,终端设备发送 RS消息请求路由器生成第一 RA消息。 304. CE 104向终端设备 102发送所述第一 RA消息, 用于响应所述 RS消息, 所述第一 RA消息中携带第一 IPv6前缀。 306.终端设备 102根据所述第一 RA 消息生成第一 IPv6地址。 可选地, 图 3所述的实施例还可以包括 308.所述 CE 104发送第二 RA消息。举例来说, 所述第二 RA消息可以是定期发送。 310. 终端设备 102根据所述第二 RA消息生成第二 IPv6地址。 图 3所述实施例的 具体技术细节与图 2所示实施例类似, 此处不再赘述。  FIG. 3 is a schematic diagram of signaling interaction of a routing mode according to an embodiment of the present invention. As shown in FIG. 3, when the arrangement mode of the CE is the routing mode, the terminal device 102 and the CE 104 perform signaling interaction to configure an IPv6 address. 302. The terminal device 102 transmits an RS message to the CE 104. For example, when the interface is enabled, the terminal device sends an RS message requesting the router to generate the first RA message. The CE 104 sends the first RA message to the terminal device 102, and is configured to respond to the RS message, where the first RA message carries the first IPv6 prefix. 306. The terminal device 102 generates a first IPv6 address according to the first RA message. Optionally, the embodiment described in FIG. 3 may further include 308. The CE 104 sends a second RA message. For example, the second RA message may be sent periodically. 310. The terminal device 102 generates a second IPv6 address according to the second RA message. The specific technical details of the embodiment shown in FIG. 3 are similar to the embodiment shown in FIG. 2, and details are not described herein again.
图 4为本发明一个实施例中配置 IP地址的方法流程图。如图 4所示, 402. 接收终端设备 102发送的 RS消息。 404.向所述终端设备 102发送所述第一 RA 消息, 所述第一 RA消息用于响应所述 RS消息, 并且携带第一 IPv6前缀。 可 选地,图 4所述的实施例还可以包括 406.向所述终端设备 102发送第二 RA消 息, 所述第二 RA消息携带第二 IPv6前缀。 可选地, 所述第二 RA消息可以是 定期发送。 图 4所述实施例的实现细节与图 2和 3所示实施例类似, 此处不 再赘述。 如果图 4所示方法的执行主体是 CE 104 , 则 CE 104从 BRAS 108获 取 IPv6前缀对应的信息, 所述 IPv6前缀对应的信息可以是下述信息的至少 一项: ISP标识、 可访问网段。 举例来说, CE 104从 BRAS 108获取 IPv6前 缀对应的信息可以采用 SLAAC 方式的 RS 和 RA信令交互的方案, 或者采用 Draf t-iet f-6man-addr-se lect-opt定义的信令交互的方案,本实施例中不做 限定。  4 is a flow chart of a method for configuring an IP address in an embodiment of the present invention. As shown in FIG. 4, 402. Receives an RS message sent by the terminal device 102. 404. Send the first RA message to the terminal device 102, where the first RA message is used to respond to the RS message and carry a first IPv6 prefix. Alternatively, the embodiment described in FIG. 4 may further include 406. transmitting a second RA message to the terminal device 102, the second RA message carrying a second IPv6 prefix. Optionally, the second RA message may be sent periodically. The implementation details of the embodiment shown in Fig. 4 are similar to those of the embodiment shown in Figs. 2 and 3, and will not be described again here. If the executor of the method shown in FIG. 4 is the CE 104, the CE 104 obtains the information corresponding to the IPv6 prefix from the BRAS 108, and the information corresponding to the IPv6 prefix may be at least one of the following information: ISP identifier, accessible network segment . For example, the CE 104 obtains the information corresponding to the IPv6 prefix from the BRAS 108, and may adopt the SLAAC mode RS and RA signaling interaction scheme, or the signaling interaction defined by the Draf t-iet f-6man-addr-se lect-opt. The solution is not limited in this embodiment.
RFC4861定义了 RS消息的格式和 RA消息的格式。举例来说, 上述实施例 中的所述 RS消息可以采用 RFC4861定义的格式, 此处不再赘述。 RFC4861定 义的 RA消息请见图 5 , 图 5所示字段的定义请参考 RFC4861。 RFC4861还定义 了 RA消息中的前缀信息选项 (pref ix informat ion opt ion ), 前缀信息选项 可以是一个或者多个,请参见图 6 ,其中,类型(Type )字段为 3 ,长度(Length ) 字段为 4 , 其他字段的定义请参考 RFC4861 , RFC4861对 pref ix informat ion opt ion进行了定义, 此处不再赘述。 本发明实施例中的 RA消息携带 IPv6前 缀和所述 IPv6前缀对应的可访问网段; 或者携带 IPv6前缀和所述 IPv6前缀 对应的 ISP标识; 或者携带 IPv6前缀、 所述 IPv6前缀对应的可访问网段和 所述 IPv6前缀对应的 ISP标识。 RFC 4861 defines the format of the RS message and the format of the RA message. For example, the RS message in the foregoing embodiment may be in the format defined by RFC4861, and details are not described herein again. The RA message defined by RFC4861 is shown in Figure 5. For the definition of the field shown in Figure 5, please refer to RFC4861. RFC4861 also defines the prefix information option (pref ix informat ion opt ion ) in the RA message. The prefix information option can be one or more. See Figure 6, where the Type field is 3 and the Length field. For the definition of other fields, please refer to RFC4861. The RFC4861 defines the pref ix informat opt ion, which will not be described here. The RA message in the embodiment of the present invention carries IPv6 before Having an IPv6 prefix corresponding to the IPv6 prefix; or carrying an IPv6 prefix and an ISP identifier corresponding to the IPv6 prefix; or carrying an IPv6 prefix, an accessible network segment corresponding to the IPv6 prefix, and an ISP corresponding to the IPv6 prefix Logo.
举例来说, 可以在无状态地址自动配置的 RA消息的 prefix information opt ion 中增力口一个子选项 ( sub-opt ion ), 用以说明 prefix information option中的 IPv6前缀属于哪个 ISP (文中其他地方筒称 "IPv6前缀对应的 ISP标识" ),和 /或,终端设备在访问哪个网段时使用该 IPv6前缀生成的 IPv6 地址作为源 IP地址(文中其他地方筒称 "IPv6前缀对应的可访问网段";)。 图 7 示出了本发明一个实施例中包含该 sub-option 的 prefix information option格式图。如图 7所示, 长度(Length)不再固定为 4, 而是根据 option 实际长度填写, prefix information option 的最后部分是可变长度的 sub— option。 该 sub— option字段为下述信息中的至少一项: ISP标识、 可访 问网段。 在某些特定功能的 IPv6终端上, 只需要 1个 IPv6地址, 对于这种 类型的 IPv6终端, ISP可以在提供给用户的终端或终端软件上, 预设 ISP标 识。 预设了 ISP标识的终端或终端软件, 在根据 RA消息生成自身的 IPv6地 址时, 才艮据预设的 ISP标识选择匹配的 prefix information option, 利用匹 酉己^; prefix information option携带^; IPv6前t生成 IPv6地址。 图 7所 示的可访问网段表示终端设备访问 sub-option中的网段时,所使用的源 IPv6 地址应当是根据该 prefix information opt ion中的 prefix所生成的 IPv6 地址。 终端设备接收到 RA消息时, 可以根据可访问网段配置 RFC6724定义的 地址选择策略表。 地址选择策略表的配置、 增加、 修改、 删除均可以根据 RA 消息的 prefix information opt ion以及 sub-opt ion进行。 举例来说 , 当 RA 消息中包括多个前缀时, 所述 RA 消息可以包括多个 prefix information option, 每个 prefix information option都可以采用图 7所示的格式。 采 用这种方案时, 如果 RA 消息的某个 prefix information option 不携带该 sub-opt ion, 或该 sub-opt ion的内容为空, 或者该 sub-opt ion的内容为特 定值, 贝1 J表示该 Prefix information option中的 IPv6前缀是缺省的 IPv6 前缀。 终端设备可以 ^据缺省的 IPv6前缀生成缺省的 IPv6地址。 终端设备 根据要访问的目的地址查询地址选择策略表以确定源 IP地址时, 如果地址选 择策略表中的可访问网段不包括所述要访问的目的地址, 则终端设备采用所 述缺省的 IPv6地址作为源 IP地址访问所述目的地址。 另一个实施例中, 可以在 RA消息中增加新的 option, 例如前缀描述选项 ( prefix descr ipt ion opt ion ), 跟随在 prefix information opt ion后, 作为该 prefix information opt ion的补充说明。 prefix descr ipt ion opt ion 用以说明 prefix information option中的 IPv6前缀对应的 ISP, 和 /或, 对 应的可访问网段。 图 8 示出了本发明一个实施例中包含新增的 prefix description option的 RA消息格式图, 每个 prefix information option^ 跟随一个对应的 prefix descr ipt ion opt ion, prefix information opt ion 的 Type为 3。 图 9示出了本发明一个实施例中 prefix description option 的格式图。 如图 9所示, prefix description opt ion包括 type, length, 保留 ( reserved )和选项数据( opt ion-data )。 其中 type为一个新定义的值, 例如 10,或者 20,或者其他未在 RFC4861中定义的值。 opt ion-data包括 prefix information option中的 prefix对应的选项数据, 可以是下述信息中的至少 一项: ISP标识, 可访问的网段。 For example, a sub-option may be added to the prefix information opt ion of the RA message automatically configured by the stateless address to indicate which ISP the IPv6 prefix belongs to in the prefix information option (other places in the text) The cylinder is called the "ISP identifier corresponding to the IPv6 prefix", and/or the IPv6 address generated by the IPv6 prefix is used as the source IP address when the terminal device accesses the network segment (the other part in the text is called the "accessible network corresponding to the IPv6 prefix". segment";). FIG. 7 is a diagram showing a format of a prefix information option including the sub-option in an embodiment of the present invention. As shown in Figure 7, the length is no longer fixed to 4, but is filled according to the actual length of the option. The last part of the prefix information option is a variable-length sub-option. The sub-option field is at least one of the following information: an ISP identifier, an accessible network segment. On some IPv6 terminals with specific functions, only one IPv6 address is required. For this type of IPv6 terminal, the ISP can preset the ISP identifier on the terminal or terminal software provided to the user. The terminal or terminal software of the ISP identifier is preset. When the IPv6 address of the RA message is generated according to the RA message, the matching prefix information option is selected according to the preset ISP identifier, and the prefix information option carries ^; IPv6 The front t generates an IPv6 address. The accessible network segment shown in Figure 7 indicates that when the terminal device accesses the network segment in the sub-option, the source IPv6 address used should be the IPv6 address generated according to the prefix in the prefix information opt ion. When receiving the RA message, the terminal device may select an address selection policy table defined by RFC6724 according to the accessible network segment. The configuration, addition, modification, and deletion of the address selection policy table can be performed according to the prefix information opt ion and sub-opt ion of the RA message. For example, when the RA message includes multiple prefixes, the RA message may include multiple prefix information options, and each prefix information option may adopt the format shown in FIG. 7. With this scheme, if a prefix RA message information option does not carry the sub-opt ion, or the contents of the sub-opt ion content is empty, or the sub-opt ion to a specific value, expressed shell 1 J The IPv6 prefix in the Prefix information option is the default IPv6 prefix. The terminal device can generate a default IPv6 address according to the default IPv6 prefix. When the terminal device queries the address selection policy table according to the destination address to be accessed to determine the source IP address, if the accessible network segment in the address selection policy table does not include the destination address to be accessed, the terminal device adopts the default The IPv6 address is used as the source IP address to access the destination address. In another embodiment, a new option may be added to the RA message, such as a prefix description option (prefix descr opt ion ), which is followed by the prefix information opt ion as a supplementary description of the prefix information opt ion. The prefix descr ipt ion opt ion is used to describe the ISP corresponding to the IPv6 prefix in the prefix information option, and/or the corresponding accessible network segment. FIG. 8 is a diagram showing an RA message format including a prefix description option added in an embodiment of the present invention. Each prefix information option^ follows a corresponding prefix descr pt ion, and the prefix information opt ion has a Type of 3. Figure 9 is a diagram showing the format of a prefix description option in one embodiment of the present invention. As shown in FIG. 9, the prefix description opt ion includes type, length, reserved, and option data (opt ion-data). Where type is a newly defined value, such as 10, or 20, or other values not defined in RFC4861. The opt ion-data includes the option data corresponding to the prefix in the prefix information option, and may be at least one of the following information: an ISP identifier, an accessible network segment.
图 10是本发明一个实施例中配置 IP地址的方法流程图。 如图 10所示, 所述方法方法包括: 1002.终端设备 102发送 RS消息。 1004.终端设备 102接 收第一 RA消息。 1006.终端设备 102根据所述第一 RA消息生成第一 IPv6地 址, 并配置第一地址选择策略表。  FIG. 10 is a flow chart of a method for configuring an IP address in an embodiment of the present invention. As shown in FIG. 10, the method method includes: 1002. The terminal device 102 sends an RS message. 1004. The terminal device 102 receives the first RA message. 1006. The terminal device 102 generates a first IPv6 address according to the first RA message, and configures a first address selection policy table.
可选地, 图 10所示的方法还可以包括: 1008.终端设备 102接收第二 RA 消息。 1010.终端设备 102根据所述第二 RA消息生成第二 IPv6地址, 并配置 第二地址选择策略表。  Optionally, the method shown in FIG. 10 may further include: 1008. The terminal device 102 receives the second RA message. 1010. The terminal device 102 generates a second IPv6 address according to the second RA message, and configures a second address selection policy table.
可选地, 图 10所示的方法还可以在 1006之前包括 1012.判断终端设备 102是否预设 ISP标识。 如果未预设 ISP标识, 则执行上述 1006。 如果预设 ISP标识,则执行 1014.根据预设的 ISP标识和所述第一 RA消息生成第一 IPv6 地址。  Optionally, the method shown in FIG. 10 may further include 1012 before 1006. Determine whether the terminal device 102 presets the ISP identifier. If the ISP ID is not preset, perform the above 1006. If the ISP identifier is preset, execution 1014. Generate a first IPv6 address according to the preset ISP identifier and the first RA message.
图 11是本发明又一个实施例中配置 IP地址的方法流程图。如图 11所示, 11 is a flow chart of a method for configuring an IP address in still another embodiment of the present invention. As shown in Figure 11,
1102.终端设备 102发送 RS消息。 1104.终端设备 102接收第一 RA消息。 1106. 所述终端设备 102判断本地是否预设 ISP标识, 如果判定本地预设 ISP标识, 则执行 1108。 1108.所述终端设备 102根据所述预设的 I SP标识和所述第一 RA消息生成第一 IPv6地址。 可选地, 图 11所示的实施例还可以包括 1110. 所述终端设备 102接收第二 RA消息。 1112.所述终端设备 102根据预设的 ISP 标识和所述第二 RA消息生成第二 IPv6地址。 图 10和图 11所示的方法的具体实现细节请参见上述实施例, 此处不再 赘述。 1102. The terminal device 102 transmits an RS message. 1104. The terminal device 102 receives the first RA message. 1106. The terminal device 102 determines whether the ISP identifier is preset locally. If it is determined that the local ISP identifier is preset, 1108 is performed. 1108. The terminal device 102 generates a first IPv6 address according to the preset I SP identifier and the first RA message. Optionally, the embodiment shown in FIG. 11 may further include 1110. The terminal device 102 receives the second RA message. The terminal device 102 generates a second IPv6 address according to the preset ISP identifier and the second RA message. For details of the implementation of the method shown in FIG. 10 and FIG. 11, refer to the foregoing embodiment, and details are not described herein again.
图 12示出了本发明一个实施例中网络设备 1200的筒化结构示意图。 网 络设备 1200包括接收单元 1202和发送单元 1204。所述接收单元 1202用于接 收终端设备发送的 RS消息。 所述发送单元 1204用于发送第一 RA消息, 所述 第一 RA消息用于响应所述 RS消息。 可选地, 所述发送单元 1204还用于发送 第二 RA消息。第二 RA消息可以是周期性发送的。可选地,所述网络设备 1200 还可以包括生成单元 1206, 用于生成所述第一 RA消息。 可选地, 所述生成单 元 1206还可以用于生成所述第二 RA消息。 图 12所示的网络设备可以是图 1 所示的 BRAS 108, 或者图 3所示的 CE 104。 如果所述网络设备是图 3所示的 CE 104, 则所述网络设备 1200还可以包括处理单元 1208, 用于从图 3所示的 BRAS 108获取 IPv6前缀对应的信息, 例如可访问网段, 和 /或, ISP标识。 相应地, 所述生成单元 1206用于根据所述处理单元 1208获取的的 IPv6前缀 对应的信息生成所述第一 RA消息和 /或所述第二 RA消息。  Figure 12 is a block diagram showing the structure of the network device 1200 in one embodiment of the present invention. The network device 1200 includes a receiving unit 1202 and a transmitting unit 1204. The receiving unit 1202 is configured to receive an RS message sent by the terminal device. The sending unit 1204 is configured to send a first RA message, where the first RA message is used to respond to the RS message. Optionally, the sending unit 1204 is further configured to send a second RA message. The second RA message may be sent periodically. Optionally, the network device 1200 may further include a generating unit 1206, configured to generate the first RA message. Optionally, the generating unit 1206 is further configured to generate the second RA message. The network device shown in Fig. 12 may be the BRAS 108 shown in Fig. 1, or the CE 104 shown in Fig. 3. If the network device is the CE 104 shown in FIG. 3, the network device 1200 may further include a processing unit 1208, configured to obtain information corresponding to an IPv6 prefix, such as an accessible network segment, from the BRAS 108 shown in FIG. And / or, ISP logo. Correspondingly, the generating unit 1206 is configured to generate the first RA message and/or the second RA message according to the information corresponding to the IPv6 prefix obtained by the processing unit 1208.
图 13 出了本发明一个实施例中终端设备 1300的筒化结构示意图。 所述 终端设备 1300包括发送单元 1302、 接收单元 1304和处理单元 1306。 发送单 元 1302用于发送 RS消息。 接收单元 1304用于接收响应所述 RS消息的第一 RA消息。 所述处理单元 1306用于根据所述第一 RA消息生成第一 IPv6地址, 配置第一地址选择策略表。 可选地, 所述接收单元 1304还用于接收第二 RA 消息。 所述第二 RA消息可以是定期发送的。 所述处理单元 1306还可以用于 根据所述第二 RA消息生成第二 IPv6地址, 配置第二地址选择策略表。 可选 地, 所述处理单元 1306具体用于判断所述终端设备 1300是否预设 ISP标识, 如果预设 ISP标识, 则根据所述预设的 ISP标识和所述第一 RA消息生成第一 IPv6地址; 如果没有预设 ISP标识, 则根据所述第一 RA消息生成所述第一 IPv6地址, 配置所述第一地址选择策略表。 可选地, 终端设备 1300还可以包 括存储单元, 用于存储所述预设的 ISP标识。  Figure 13 is a schematic view showing the structure of the terminal device 1300 in an embodiment of the present invention. The terminal device 1300 includes a transmitting unit 1302, a receiving unit 1304, and a processing unit 1306. The transmitting unit 1302 is for transmitting an RS message. The receiving unit 1304 is configured to receive a first RA message that is responsive to the RS message. The processing unit 1306 is configured to generate a first IPv6 address according to the first RA message, and configure a first address selection policy table. Optionally, the receiving unit 1304 is further configured to receive the second RA message. The second RA message may be sent periodically. The processing unit 1306 is further configured to generate a second IPv6 address according to the second RA message, and configure a second address selection policy table. Optionally, the processing unit 1306 is specifically configured to determine whether the terminal device 1300 presets an ISP identifier, and if the ISP identifier is preset, generates a first IPv6 according to the preset ISP identifier and the first RA message. If the ISP identifier is not preset, the first IPv6 address is generated according to the first RA message, and the first address selection policy table is configured. Optionally, the terminal device 1300 may further include a storage unit, configured to store the preset ISP identifier.
图 14 出了本发明一个实施例中终端设备 1400的筒化结构示意图。 所述 终端设备 1400包括发送单元 1402、 接收单元 1404和处理单元 1406。 发送单 元 1402用于发送 RS消息。 接收单元 1404用于接收响应所述 RS消息的第一 RA消息。所述处理单元 1406用于判断所述终端设备 1400是否预设 ISP标识, 如果预设 ISP标识, 则根据所述预设的 ISP标识和所述第一 RA消息生成第一 IPv6地址。 可选地, 所述接收单元 1404还用于接收第二 RA消息。 所述处理 单元 1406还用于根据所述预设的 I SP标识和所述第二 RA消息生成第二 IPv6 地址。可选地,终端设备 1400还可以包括存储单元,用于存储所述预设的 ISP 标识。 Figure 14 is a schematic view showing the structure of the terminal device 1400 in an embodiment of the present invention. The terminal device 1400 includes a transmitting unit 1402, a receiving unit 1404, and a processing unit 1406. The sending unit 1402 is configured to send an RS message. The receiving unit 1404 is configured to receive a first RA message that is responsive to the RS message. The processing unit 1406 is configured to determine whether the terminal device 1400 presets an ISP identifier, and if the ISP identifier is preset, generate a first according to the preset ISP identifier and the first RA message. IPv6 address. Optionally, the receiving unit 1404 is further configured to receive the second RA message. The processing unit 1406 is further configured to generate a second IPv6 address according to the preset I SP identifier and the second RA message. Optionally, the terminal device 1400 may further include a storage unit, configured to store the preset ISP identifier.
图 12、 13和 14所示的实施例中, 各单元的划分仅是举例说明, 实际应 用中可以根据需要, 例如相应硬件的配置要求或者软件的实现的便利考虑, 而将上述操作分配由不同的单元完成, 以完成以上描述的全部或者部分功能。 图 12-14所示实施例的实现细节已在前面的实施例中描述过, 此处不再赘述。  In the embodiments shown in Figures 12, 13 and 14, the division of each unit is merely an example. In actual applications, the above operations may be assigned differently according to needs, such as configuration requirements of corresponding hardware or convenience of implementation of software. The unit is completed to perform all or part of the functions described above. The implementation details of the embodiment shown in Figures 12-14 have been described in the previous embodiments and will not be described again.
图 15 示出了本发明一个实施例中网络设备的筒化结构示意图。 如图 15 所示, 网络设备 1500 包括输入 /输出电路 ( I/O c i rcui t ) 1502、 处理器 ( proces sor ) 1504和存储器( memory ) 1506。 所述输入 /输出电路 1502用于 接收终端设备发送的 RS消息, 发送第一 RA消息, 所述第一 RA消息用于响应 所述 RS消息。 可选地, 所述输入 /输出电路 1502还用于发送第二 RA消息。 第二 RA消息可以是周期性发送的。 所述处理器 1504用于生成所述第一 RA消 息。可选地,所述处理器 1504还用于生成所述第二 RA消息。所述存储器 1506 用于存储程序指令, 当所述程序指令被执行时, 使得所述处理器 1504执行上 述操作。  FIG. 15 is a schematic diagram showing the structure of a network device in an embodiment of the present invention. As shown in FIG. 15, the network device 1500 includes an input/output circuit (I/O c i rcui t) 1502, a processor sor 1504, and a memory 1506. The input/output circuit 1502 is configured to receive an RS message sent by the terminal device, and send a first RA message, where the first RA message is used to respond to the RS message. Optionally, the input/output circuit 1502 is further configured to send a second RA message. The second RA message may be sent periodically. The processor 1504 is configured to generate the first RA message. Optionally, the processor 1504 is further configured to generate the second RA message. The memory 1506 is for storing program instructions that, when executed, cause the processor 1504 to perform the above operations.
图 15所示的网络设备可以是图 1所示的 BRAS 108 , 或者图 3所示的 CE 104。 如果所述网络设备是图 3所示的 CE 104 , 则所述处理器 1504还用于从 图 3所示的 BRAS 108获取 IPv6前缀对应的信息, 例如可访问网段, 和 /或, ISP标识。  The network device shown in Fig. 15 may be the BRAS 108 shown in Fig. 1, or the CE 104 shown in Fig. 3. If the network device is the CE 104 shown in FIG. 3, the processor 1504 is further configured to obtain information corresponding to the IPv6 prefix from the BRAS 108 shown in FIG. 3, such as an accessible network segment, and/or an ISP identifier. .
图 16 示出了本发明一个实施例中终端设备的筒化结构示意图。 如图 16 所示, 终端设备 1600 包括输入 /输出电路 ( I/O c i rcui t ) 1602、 处理器 ( proces sor ) 1604和存储器( memory ) 1606。 所述输入 /输出电路 1602用于 发送 RS消息, 接收响应所述 RS消息的第一 RA消息。 所述处理器 1604用于 根据所述 RA消息生成第一 IPv6地址, 配置第一地址选择策略表。 可选地, 所述输入 /输出电路 1602还用于接收第二 RA消息。 所述第二 RA消息可以是 定期发送的。所述处理器 1604还可以用于根据所述第二 RA消息生成第二 IPv6 地址, 配置第二地址选择策略表。 可选地, 所述处理器 1604具体用于判断所 述终端设备 1600是否预设 I SP标识, 如果预设 ISP标识, 则根据所述预设的 ISP标识和所述第一 RA消息生成第一 IPv6地址; 如果没有预设 ISP标识, 则 根据所述第一 RA消息生成所述第一 IPv6地址, 配置所述第一地址选择策略 表。 所述存储器 1606用于存储程序指令, 当所述程序指令被执行时, 使得所 述处理器 1604执行上述操作。 可选地, 所述存储器 1606还用于存储所述预 设的 ISP标识。 Figure 16 is a block diagram showing the structure of a terminal device in an embodiment of the present invention. As shown in FIG. 16, the terminal device 1600 includes an input/output circuit (I/O ci rcui t) 1602, a processor (proces sor) 1604, and a memory 1606. The input/output circuit 1602 is configured to send an RS message, and receive a first RA message that is responsive to the RS message. The processor 1604 is configured to generate a first IPv6 address according to the RA message, and configure a first address selection policy table. Optionally, the input/output circuit 1602 is further configured to receive a second RA message. The second RA message may be sent periodically. The processor 1604 is further configured to generate a second IPv6 address according to the second RA message, and configure a second address selection policy table. Optionally, the processor 1604 is specifically configured to determine whether the terminal device 1600 presets an I SP identifier, and if the ISP identifier is preset, generates a first according to the preset ISP identifier and the first RA message. IPv6 address; if there is no preset ISP ID, then Generating the first IPv6 address according to the first RA message, and configuring the first address selection policy table. The memory 1606 is for storing program instructions that, when executed, cause the processor 1604 to perform the operations described above. Optionally, the memory 1606 is further configured to store the preset ISP identifier.
图 17 示出了本发明一个实施例中终端设备的筒化结构示意图。 如图 17 所示, 终端设备 1700 包括输入 /输出电路 ( I/O c i rcui t ) 1702、 处理器 ( proces sor ) 1704和存储器( memory ) 1706。 所述输入 /输出电路 1702用于 发送 RS消息, 接收响应所述 RS消息的第一 RA消息。 所述处理器 1704用于 判断所述终端设备 1700是否预设 I SP标识, 如果预设 ISP标识, 则根据所述 预设的 ISP标识和所述第一 RA消息生成第一 IPv6地址。 可选地, 所述输入 / 输出电路 1702还用于接收第二 RA消息。 所述处理器 1704还用于根据所述预 设的 ISP标识和所述第二 RA消息生成第二 IPv6地址。 所述存储器 1706用于 存储程序指令, 当所述程序指令被执行时, 使得所述处理器 1704执行上述操 作。 可选地, 所述存储器 1706还用于存储所述预设的 ISP标识。  Figure 17 is a block diagram showing the structure of a terminal device in an embodiment of the present invention. As shown in FIG. 17, the terminal device 1700 includes an input/output circuit (I/O c i rcui t) 1702, a processor (proces sor) 1704, and a memory 1706. The input/output circuit 1702 is configured to send an RS message, and receive a first RA message that is responsive to the RS message. The processor 1704 is configured to determine whether the terminal device 1700 presets an I SP identifier, and if the ISP identifier is preset, generates a first IPv6 address according to the preset ISP identifier and the first RA message. Optionally, the input/output circuit 1702 is further configured to receive a second RA message. The processor 1704 is further configured to generate a second IPv6 address according to the preset ISP identifier and the second RA message. The memory 1706 is for storing program instructions that, when executed, cause the processor 1704 to perform the operations described above. Optionally, the memory 1706 is further configured to store the preset ISP identifier.
本领域普通技术人员可以理解: 实现前述各方法实施例的全部或部分步 骤可以通过程序指令相关的硬件来完成。 前述的程序可以存储于一计算机可 读取存储介质中。 该程序在执行时, 执行包括上述各方法实施例的步骤; 而 前述的存储介质包括: 只读存储器(read-only memory, 筒称 R0M )、 随机存 取存储器 (random acces s memory, 筒称 RAM )、 磁碟或者光盘等各种可以存 储程序代码的介质。  It will be understood by those skilled in the art that all or part of the steps of implementing the foregoing method embodiments may be performed by hardware associated with the program instructions. The aforementioned program can be stored in a computer readable storage medium. When the program is executed, the steps of the foregoing method embodiments are performed; and the foregoing storage medium includes: a read-only memory (R0M), a random access memory (random acces s memory) ) A variety of media that can store program code, such as a disk or a disc.
最后应说明的是: 以上各实施例仅用以示例性说明本发明的技术方案, 而非对其限制; 尽管参照前述各实施例对本发明进行了详细的说明, 本领域 的普通技术人员应当理解: 其依然可以对前述各实施例所记载的技术方案进 行修改, 或者对其中部分或者全部技术特征进行等同替换; 而这些修改或者 替换, 并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。  It should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand The technical solutions described in the foregoing embodiments may be modified, or some or all of the technical features may be equivalently replaced; and the modifications or substitutions do not deviate from the technical solutions of the embodiments of the present invention. The scope of the program.

Claims

权 利 要 求 Rights request
1、 一种配置 IP地址的方法, 其特征在于, 包括: A method for configuring an IP address, comprising:
接收终端设备发送的路由器请求 RS消息;  Receiving a router request RS message sent by the terminal device;
向所述终端设备发送第一路由器通告 RA消息, 所述第一 RA消息用于响 应所述 RS消息, 并且携带第一 IPv6前缀和所述第一 IPv6前缀对应的第一可 访问网段。  Transmitting, by the terminal device, a first router advertisement RA message, where the first RA message is used to respond to the RS message, and carries a first IPv6 prefix and a first accessible network segment corresponding to the first IPv6 prefix.
2、 根据权利要求 1所述的方法, 其特征在于, 所述第一 RA消息中包括 前缀信息选项, 所述前缀信息选项中包括所述第一 IPv6前缀和子选项, 所述 子选项包括所述第一可访问网段。  The method according to claim 1, wherein the first RA message includes a prefix information option, where the prefix information option includes the first IPv6 prefix and a sub-option, and the sub-option includes the The first accessible network segment.
3、 根据权利要求 1所述的方法, 其特征在于, 所述第一 RA消息中包括 前缀信息选项和所述前缀信息选项对应的前缀描述选项, 所述前缀信息选项 中包括所述第一 IPv6前缀, 所述前缀描述选项包括所述第一可访问网段。  The method according to claim 1, wherein the first RA message includes a prefix information option and a prefix description option corresponding to the prefix information option, where the prefix information option includes the first IPv6 a prefix, the prefix description option including the first accessible network segment.
4、 根据权利要求 1-3任一所述的方法, 其特征在于, 所述第一 RA消息 中还包括所述第一 IPv6前缀对应的因特网服务提供商 I SP标识。  The method according to any one of claims 1-3, wherein the first RA message further includes an Internet service provider I SP identifier corresponding to the first IPv6 prefix.
5、 根据权利要求 1-4任一所述的方法, 其特征在于, 还包括:  The method according to any one of claims 1 to 4, further comprising:
向所述终端设备发送第二 RA消息, 所述第二 RA消息携带第二 IPv6前缀 和所述第二 IPv6前缀对应的第二可访问网段。  Sending a second RA message to the terminal device, where the second RA message carries a second IPv6 prefix and a second accessible network segment corresponding to the second IPv6 prefix.
6、 一种配置 IP地址的方法, 其特征在于, 包括:  6. A method for configuring an IP address, the method comprising:
接收终端设备发送的路由器请求 RS消息;  Receiving a router request RS message sent by the terminal device;
向所述终端设备发送路由器通告 RA消息, 所述 RA消息用于响应所述 RS 消息, 并且携带 IPv6前缀和所述 IPv6前缀对应的因特网服务提供商 I SP标 识。  And sending, by the terminal device, a router advertisement RA message, where the RA message is used to respond to the RS message, and carries an IPv6 prefix and an Internet service provider I SP identifier corresponding to the IPv6 prefix.
7、 根据权利要求 6所述的方法, 其特征在于, 所述 RA消息中包括前缀 信息选项, 所述前缀信息选项中包括所述 IPv6前缀和子选项, 所述子选项包 括所述 I SP标识。  The method according to claim 6, wherein the RA message includes a prefix information option, and the prefix information option includes the IPv6 prefix and a sub-option, and the sub-option includes the I SP identifier.
8、 根据权利要求 6所述的方法, 其特征在于, 所述 RA消息中包括前缀 信息选项和所述前缀信息选项对应的前缀描述选项, 所述前缀信息选项中包 括所述 IPv6前缀, 所述前缀描述选项包括所述 I SP标识。  The method according to claim 6, wherein the RA message includes a prefix information option and a prefix description option corresponding to the prefix information option, where the prefix information option includes the IPv6 prefix, The prefix description option includes the I SP identifier.
9、 一种网络设备, 其特征在于, 包括接收单元和发送单元, 其中, 所述接收单元用于接收终端设备发送的路由器请求 RS消息; 所述发送单元用于发送第一路由器通告 RA消息, 所述第一 RA消息用于 响应所述 RS消息, 并且携带第一 IPv6前缀和所述第一 IPv6前缀对应的第一 可访问网段。 A network device, comprising: a receiving unit and a sending unit, wherein the receiving unit is configured to receive a router request RS message sent by the terminal device; The sending unit is configured to send a first router advertisement RA message, where the first RA message is used to respond to the RS message, and carries a first IPv6 prefix and a first accessible network segment corresponding to the first IPv6 prefix.
10、 根据权利要求 9所述的设备, 其特征在于, 所述第一 RA消息中包括 前缀信息选项, 所述前缀信息选项中包括所述第一 IPv6前缀和子选项, 所述 子选项包括所述第一可访问网段。  The apparatus according to claim 9, wherein the first RA message includes a prefix information option, where the prefix information option includes the first IPv6 prefix and a sub-option, and the sub-option includes the The first accessible network segment.
11、 根据权利要求 9所述的设备, 其特征在于, 所述第一 RA消息中包括 前缀信息选项和所述前缀信息选项对应的前缀描述选项, 所述前缀信息选项 中包括所述第一 IPv6前缀, 所述前缀描述选项包括所述第一可访问网段。  The apparatus according to claim 9, wherein the first RA message includes a prefix information option and a prefix description option corresponding to the prefix information option, where the prefix information option includes the first IPv6 a prefix, the prefix description option including the first accessible network segment.
12、 根据权利要求 9-11任一所述的设备, 其特征在于, 所述第一 RA消 息中还包括所述第一 IPv6前缀对应的因特网服务提供商 ISP标识。  The device according to any one of claims 9-11, wherein the first RA message further includes an Internet service provider ISP identifier corresponding to the first IPv6 prefix.
13、 根据权利要求 9-12任一所述的设备, 其特征在于, 所述发送单元还 用于向所述终端设备发送第二 RA消息, 所述第二 RA消息携带第二 IPv6前缀 和所述第二 IPv6前缀对应的第二可访问网段。  The device according to any one of claims 9-12, wherein the sending unit is further configured to send a second RA message to the terminal device, where the second RA message carries a second IPv6 prefix and a The second accessible network segment corresponding to the second IPv6 prefix.
14、 一种终端设备, 其特征在于, 包括: 发送单元、 接收单元和处理单 元; 其中,  A terminal device, comprising: a sending unit, a receiving unit, and a processing unit; wherein
所述发送单元用于发送路由器请求 RS消息;  The sending unit is configured to send a router request RS message;
所述接收单元用于接收第一路由器通告 RA消息, 所述第一 RA消息用于 响应所述 RS消息, 并且携带第一 IPv6前缀和所述第一 IPv6前缀对应的第一 可访问网段;  The receiving unit is configured to receive a first router advertisement RA message, where the first RA message is used to respond to the RS message, and carries a first IPv6 prefix and a first accessible network segment corresponding to the first IPv6 prefix;
所述处理单元用于根据所述第一 IPv6前缀生成第一 IPv6地址, 并根据 所述第一 RA消息配置第一地址选择策略表, 所述第一地址选择策略表包括所 述第一 IPv6地址和所述第一 IPv6地址对应的所述第一可访问网段, 所述第 一可访问网段用于标识所述终端设备使用所述第一 IPv6地址作为源地址时可 以访问的网段。  The processing unit is configured to generate a first IPv6 address according to the first IPv6 prefix, and configure a first address selection policy table according to the first RA message, where the first address selection policy table includes the first IPv6 address The first accessible network segment corresponding to the first IPv6 address, where the first accessible network segment is used to identify a network segment that the terminal device can access when using the first IPv6 address as a source address.
15、 根据权利要求 14所述的设备, 其特征在于, 所述第一 RA消息中包 括前缀信息选项, 所述前缀信息选项中包括所述第一 IPv6前缀和子选项, 所 述子选项包括所述第一可访问网段。  The device according to claim 14, wherein the first RA message includes a prefix information option, where the prefix information option includes the first IPv6 prefix and a sub-option, and the sub-option includes the The first accessible network segment.
16、 根据权利要求 14所述的设备, 其特征在于, 所述第一 RA消息中包 括前缀信息选项和所述前缀信息选项对应的前缀描述选项, 所述前缀信息选 项中包括所述第一 IPv6前缀, 所述前缀描述选项包括所述第一可访问网段。 The apparatus according to claim 14, wherein the first RA message includes a prefix information option and a prefix description option corresponding to the prefix information option, where the prefix information option includes the first IPv6 a prefix, the prefix description option including the first accessible network segment.
17、 根据权利要求 14-16任一所述的设备, 其特征在于, 所述接收单元 还用于接收第二 RA消息 ,所述第二 RA消息携带第二 IPv6前缀和所述第二 IPv6 前缀对应的第二可访问网段; The device according to any one of claims 14-16, wherein the receiving unit is further configured to receive a second RA message, where the second RA message carries a second IPv6 prefix and the second IPv6 prefix. Corresponding second accessible network segment;
所述处理单元还用于根据所述第二 IPv6前缀生成第二 IPv6地址, 并根 据所述第二 RA消息配置第二地址选择策略表, 所述第二地址选择策略表包括 所述第二 IPv6地址和所述第二 IPv6地址对应的所述第二可访问网段, 所述 第二可访问网段用于标识所述终端设备使用所述第二 IPv6地址作为源地址时 可以访问的网段。  The processing unit is further configured to generate a second IPv6 address according to the second IPv6 prefix, and configure a second address selection policy table according to the second RA message, where the second address selection policy table includes the second IPv6 An address of the second accessible network segment corresponding to the second IPv6 address, where the second accessible network segment is used to identify a network segment that the terminal device can access when using the second IPv6 address as a source address. .
18、 一种终端设备, 其特征在于, 包括: 发送单元、 接收单元和处理单 元; 其中,  A terminal device, comprising: a transmitting unit, a receiving unit, and a processing unit; wherein
所述发送单元用于发送路由器请求 RS消息;  The sending unit is configured to send a router request RS message;
所述接收单元用于接收 RA消息, 所述 RA消息用于响应所述 RS消息, 并 且携带第一 IPv6前缀和所述第一 IPv6前缀对应的第一因特网服务提供商 ISP 的标识;  The receiving unit is configured to receive an RA message, where the RA message is used to respond to the RS message, and carries a first IPv6 prefix and an identifier of a first Internet service provider ISP corresponding to the first IPv6 prefix;
所述处理单元用于从所述第一 IPv6前缀中确定对应所述终端设备预设的 ISP标识的第三 IPv6前缀, 利用所述第三 IPv6前缀生成第一 IPv6地址。  The processing unit is configured to determine, from the first IPv6 prefix, a third IPv6 prefix corresponding to the ISP identifier preset by the terminal device, and generate a first IPv6 address by using the third IPv6 prefix.
19、 根据权利要求 18所述的设备, 其特征在于, 所述 RA消息中包括前 缀信息选项, 所述前缀信息选项中包括所述第一 IPv6前缀和子选项, 所述子 选项包括所述第一 ISP标识。  The apparatus according to claim 18, wherein the RA message includes a prefix information option, where the prefix information option includes the first IPv6 prefix and a sub-option, and the sub-option includes the first ISP logo.
20、 根据权利要求 18所述的设备, 其特征在于, 所述 RA消息中包括前 缀信息选项和所述前缀信息选项对应的前缀描述选项, 所述前缀信息选项中 包括所述第一 IPv6前缀, 所述前缀描述选项包括所述第一 ISP标识。  The apparatus according to claim 18, wherein the RA message includes a prefix information option and a prefix description option corresponding to the prefix information option, where the prefix information option includes the first IPv6 prefix, The prefix description option includes the first ISP identifier.
PCT/CN2013/091156 2012-12-31 2013-12-31 Method and device for configuring ip address WO2014101891A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210592011.4 2012-12-31
CN201210592011.4A CN103916484B (en) 2012-12-31 2012-12-31 The method and apparatus for configuring IP address

Publications (1)

Publication Number Publication Date
WO2014101891A1 true WO2014101891A1 (en) 2014-07-03

Family

ID=51019903

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/091156 WO2014101891A1 (en) 2012-12-31 2013-12-31 Method and device for configuring ip address

Country Status (2)

Country Link
CN (1) CN103916484B (en)
WO (1) WO2014101891A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104394525A (en) * 2014-11-17 2015-03-04 大唐移动通信设备有限公司 IP (Internet Protocol) address assignment and obtaining method and device
CN106888450B (en) * 2016-11-09 2019-01-08 中国移动通信有限公司研究院 Information processing method and device
CN111416881B (en) * 2019-01-08 2022-07-29 中国移动通信有限公司研究院 Method and device for acquiring domain name system configuration information and storage medium
CN112887186B (en) * 2019-11-29 2024-03-22 中兴通讯股份有限公司 Multi-plane network access method, device and computer storage medium
CN111049918B (en) * 2019-12-19 2023-05-19 国网冀北电力有限公司信息通信分公司 Communication establishment method and device of Internet of things
CN111654444A (en) * 2020-06-10 2020-09-11 展讯通信(上海)有限公司 IPv6 prefix obtaining method, equipment and storage medium
CN114553831B (en) * 2020-11-25 2023-09-08 华为技术有限公司 Method and system related to sending management IP address
CN115550318A (en) * 2022-09-26 2022-12-30 Oppo广东移动通信有限公司 IPv6 address configuration method and device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1761233A (en) * 2004-10-12 2006-04-19 上海贝尔阿尔卡特股份有限公司 Network service selection and authentication in IPv6 access network, and automatic configuration without status
CN101753633A (en) * 2008-12-09 2010-06-23 华为技术有限公司 Method, system and equipment for allocating IPv6 (internet protocol version 6) prefixes
CN102223279A (en) * 2011-06-14 2011-10-19 杭州华三通信技术有限公司 Method for processing multi-VLAN (virtual local area network) and nodes
CN102299974A (en) * 2010-06-25 2011-12-28 中兴通讯股份有限公司 Method and device for realizing IPv6 (Internet Protocol Version 6) prefix distribution
CN102833732A (en) * 2012-07-25 2012-12-19 中兴通讯股份有限公司 IPv6 (Internet Protocol Version 6) address stateless autoconfiguration system, data card and implementation method thereof

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101753460B (en) * 2010-01-15 2012-07-11 杭州华三通信技术有限公司 Method and device for processing internet protocol version 6(IPV6) routing prefix
CN101909007B (en) * 2010-07-29 2013-03-13 福建星网锐捷网络有限公司 Production method, device and network equipment of binding table
CN102694752B (en) * 2011-03-21 2015-03-11 国基电子(上海)有限公司 Gateway equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1761233A (en) * 2004-10-12 2006-04-19 上海贝尔阿尔卡特股份有限公司 Network service selection and authentication in IPv6 access network, and automatic configuration without status
CN101753633A (en) * 2008-12-09 2010-06-23 华为技术有限公司 Method, system and equipment for allocating IPv6 (internet protocol version 6) prefixes
CN102299974A (en) * 2010-06-25 2011-12-28 中兴通讯股份有限公司 Method and device for realizing IPv6 (Internet Protocol Version 6) prefix distribution
CN102223279A (en) * 2011-06-14 2011-10-19 杭州华三通信技术有限公司 Method for processing multi-VLAN (virtual local area network) and nodes
CN102833732A (en) * 2012-07-25 2012-12-19 中兴通讯股份有限公司 IPv6 (Internet Protocol Version 6) address stateless autoconfiguration system, data card and implementation method thereof

Also Published As

Publication number Publication date
CN103916484A (en) 2014-07-09
CN103916484B (en) 2017-07-21

Similar Documents

Publication Publication Date Title
WO2014101891A1 (en) Method and device for configuring ip address
US9485147B2 (en) Method and device thereof for automatically finding and configuring virtual network
US9614810B2 (en) Address allocation processing method, apparatus and system
US8189567B2 (en) Method and nodes for registering a terminal
JP5967173B2 (en) Network relay device, method for setting operation mode of packet relay processing unit included in network relay device, and computer program
WO2010069181A1 (en) Method and system for configuring ipv6 address
US9319377B2 (en) Auto-split DNS
CN102025792B (en) Router and IP address setting method thereof
CN110995886B (en) Network address management method, device, electronic equipment and medium
EP2267984A1 (en) Address configuring method, apparatus and system
WO2009089741A1 (en) Method, device and system for selecting service network
JP5907239B2 (en) Network relay device, method for setting operation mode of packet relay processing unit included in network relay device, and computer program
US20120182994A1 (en) Address compatibility in a network device reload
WO2010028545A1 (en) Static route generation method, terminal route realization method and apparatus
US10574572B2 (en) Packet processing method and apparatus
US10404648B2 (en) Addressing for customer premises LAN expansion
WO2011144152A1 (en) Method for providing information, home gateway and home network system
US20140032782A1 (en) Method and apparatus for route selection of host in multihoming site
US20200274948A1 (en) Service flow configuration method and apparatus
US10623369B2 (en) Device and method for discovery and announcement of secondary end-point reachability information
CN104780229A (en) Method of setting cloud server IP address through cloud terminal, system and cloud system
WO2017202034A1 (en) Data packet sending and receiving method and device, and electronic apparatus
WO2020048177A1 (en) Set top box management method and apparatus, and device and storage medium
CN106375489B (en) Method and device for processing Media Access Control (MAC) address
US8782226B2 (en) Allocating internet protocol (IP) addresses to nodes in communications networks which use integrated IS-IS

Legal Events

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

Ref document number: 13868506

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: 13868506

Country of ref document: EP

Kind code of ref document: A1