WO2012051909A1 - 一种获取IPv6接口标识的方法及装置 - Google Patents

一种获取IPv6接口标识的方法及装置 Download PDF

Info

Publication number
WO2012051909A1
WO2012051909A1 PCT/CN2011/080685 CN2011080685W WO2012051909A1 WO 2012051909 A1 WO2012051909 A1 WO 2012051909A1 CN 2011080685 W CN2011080685 W CN 2011080685W WO 2012051909 A1 WO2012051909 A1 WO 2012051909A1
Authority
WO
WIPO (PCT)
Prior art keywords
magic word
interface identifier
magic
negotiation
ipv6 interface
Prior art date
Application number
PCT/CN2011/080685
Other languages
English (en)
French (fr)
Inventor
孙亚权
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2012051909A1 publication Critical patent/WO2012051909A1/zh

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/5046Resolving address allocation conflicts; Testing of addresses

Definitions

  • the present invention relates to a method for accessing a PPP network by using a home gateway device, and supporting the capability of IPV6 negotiation, and a method and device for obtaining an IP V6 interface identifier based on a PPP link.
  • PPP Point to Point Protocol
  • PPP is a data link layer protocol that provides encapsulation and transmission of network layer data packets on a point-to-point link.
  • PPP is a layered structure (physical layer, link layer, Network layer), in the link layer (LCP (Link Control Protocol)) negotiation phase, negotiates link-related parameters, including magic numbers negotiated to prevent loops, while on the network Layer, the only IPV6 interface identifier on the link needs to be negotiated.
  • LCP Link Control Protocol
  • the methods for generating IPV6 interface identifiers are as follows: According to the 48-bit MAC address generation, or the two methods are generated according to the random number, the method of generating the IPV6 interface identifier according to the 48-bit MAC address has the advantages of easy viewing and easy positioning of the IPV6 interface identifier and the network interface. Correspondence, but the defect is that the MAC address of the hardware needs to be obtained, and the conflict of the MAC address cannot be guaranteed, especially the device of the same manufacturer; the method of generating the IPV6 interface identifier according to the random number needs to generate a random number by using a random number algorithm, and is random. The number cannot be completely unique.
  • the technical problem to be solved by the present invention is to provide a method and a device for obtaining an IPV6 interface identifier to avoid packet interaction caused by duplicate IPV6 interface identifiers.
  • the present invention provides a method for obtaining an IPV6 interface identifier, including: generating an IPV6 interface identifier according to a magic word in a network core protocol negotiation process.
  • the foregoing method has the following features: the step of negotiating a magic word in the link control protocol negotiation process, including: determining, in the link control protocol negotiation process, whether the magic word carried in the received configuration request message is Consistent with the last received magic word, if they match, the generated and received magic words are not The same magic word, and then send the message carrying the generated magic word; if not, the magic word negotiation is successful.
  • the foregoing method further has the following features: the step of generating an IP V6 interface identifier according to the magic word includes:
  • the 32-bit magic word is padded to 48 bits, and then a 64-bit IPV6 interface identifier is generated according to the 64-bit extended unique identifier algorithm.
  • the foregoing method further has the following features: after the step of generating an IPV6 interface identifier, the method further includes:
  • the link local address is generated based on the IPV6 interface identifier.
  • the present invention further provides an apparatus for obtaining an identifier of an IPV6 interface, including:
  • a negotiation module which is configured to: negotiate a magic word during link control protocol negotiation after establishing a point-to-point protocol channel;
  • the generating module is configured to: generate an IP V6 interface identifier according to the magic word during the network core protocol negotiation process.
  • the above device also has the following features:
  • the negotiation module is further configured to: determine, during the link control protocol negotiation process, whether the magic word carried in the received configuration request message is consistent with the last received magic word, and if yes, generate and receive The magic words with different magic words are then sent with the message carrying the generated magic word; if they are inconsistent, the magic word negotiation is successful.
  • the above device also has the following features:
  • the generating module is further configured to: in the network core protocol negotiation process, fill the 32-bit magic word into 48 bits, and then generate a 64-bit IPV6 interface identifier according to the 64-bit extended unique identifier algorithm.
  • the above device also has the following features:
  • the negotiation module is further configured to: send a configuration request message, and carry the generated by the generating module After receiving the configuration confirmation packet, the IPV6 interface identifier generates a link-local address based on the IPV6 interface identifier.
  • the embodiment of the present invention provides a method and a device for acquiring an IPv6 interface identifier, which can directly generate an IPV6 interface identifier without using other algorithms and calls, and completely guarantee the uniqueness on the PPP link.
  • FIG. 1 is a flowchart of a method for obtaining an IPV6 interface identifier according to the present invention
  • FIG. 2 is a schematic diagram of an apparatus for obtaining an IPV6 interface identifier according to the present invention
  • FIG. 3 is a process diagram of the PPPoE negotiation phase
  • Figure 4 is a process diagram of the PPP negotiation phase
  • Figure 5 is a process diagram of magic word negotiation
  • FIG. 6 is a schematic diagram of a prior art IPV6 interface identifier negotiation process
  • FIG. 7 is a diagram of an IPV6 interface identifier negotiation process of the present invention.
  • Figure 8 is a diagram showing an algorithm for generating an IPV6 interface identifier
  • FIG. 9 is a flow chart of a method of generating an IPV6 interface identifier of the present invention.
  • the invention uses the unique magic word negotiated by the PPP link layer to be applied to the PPP network layer to avoid packet exchange caused by the duplicated IPV6 interface identifiers, which can reduce the link negotiation time and improve the packet transmission performance.
  • FIG. 1 is a flowchart of a method for obtaining an IPV6 interface identifier according to the present invention. As shown in FIG. 1, the method includes the following steps: S10. After establishing a point-to-point protocol channel, negotiate a magic word by using a link control protocol.
  • S20 Generate an IPV6 interface identifier according to the magic word in a network core protocol negotiation process. Specifically, in the link control protocol negotiation process, it is determined whether the magic word carried in the received configuration request message is consistent with the last received magic word, and if they are consistent, a magic different from the received magic word is generated. Word, and then send a message carrying the generated magic word; if not, the magic word negotiation is successful.
  • the method may further include: sending a configuration request message that carries the identifier of the IPV6 interface;
  • the link local address is generated based on the IPV6 interface identifier.
  • the apparatus of the present invention includes: a negotiation module and a generation module, where
  • a negotiation module configured to negotiate a magic word in a link control protocol negotiation process after establishing a point-to-point protocol channel
  • a generating module configured to generate an IPV6 interface identifier according to the magic word during a network core protocol negotiation process.
  • the negotiation module is specifically configured to determine, in the process of the link control protocol negotiation, whether the magic word carried in the received configuration request message is consistent with the last received magic word, and if yes, generate and receive The magic word of the magic word is different, and then the message carrying the generated magic word is sent; if not, the magic word negotiation is successful.
  • the negotiation module is further configured to send a configuration request message, and carry an IPV6 interface identifier generated by the generating module. After receiving the configuration confirmation message, generate a link local address based on the IPV6 interface identifier.
  • FIG. 3 is a flow chart of establishing a PPPoE link between the home gateway and the server.
  • the home gateway initiates a PPPoE session request by sending a PADI (PPPoE Active Discovery Initiation) broadcast packet; receiving PAD0 (PPPoE) After the unicast packet is sent by the Active Discovery Offer, the PPPoE Active Discovery Request (PAPoE Active Discovery Request) unicast packet is received; the PADS (PPPoE Active Discovery) is received.
  • PADI PPPoE Active Discovery Initiation
  • PAD0 PPPoE
  • PAPoE Active Discovery Request PAPoE Active Discovery Request
  • PADS PPPoE Active Discovery
  • the PPPoE dynamic discovery session is terminated, the session identifier is generated, the PPPoE link is negotiated, and the PPP link is negotiated.
  • the PPPoE Active Discovery Terminate (PPPoE Active Discovery Terminate) is used. Disconnect the PPPoE link.
  • FIG 4 is a flowchart of the PPP link negotiation.
  • the PPP is negotiated by the LCP. After the negotiation succeeds, the PPP enters the Auth (authentication) phase. After the authentication succeeds, the NCP (Network Core Protocol) negotiation is performed. After the negotiation is successful, a PPP link is established.
  • Auth authentication
  • NCP Network Core Protocol
  • the basis of the present invention is the negotiation and uniqueness of the magic word.
  • the negotiation process of the magic word is illustrated, as shown in Fig. 5 (the ID in the figure indicates the serial number identifier of the negotiation message, and M indicates the negotiated magic word).
  • the magic word is a parameter that is important in the link establishment process. This parameter is negotiated in the Config-Request of the LCP stage. The main function is to prevent the loop (if the magic word is not negotiated on both sides) In the case, the magic word is 0, so it can not be used for the IPV6 interface identifier, but almost all devices on the market now have magic word negotiation enabled by default.
  • the magic word is sent in the configuration option parameter of the LCP stage Config-Request, and needs to be generated independently by the communication device itself. In order to avoid the possibility that both parties may generate the same magic word, the communication may cause unnecessary trouble, so
  • the device uses a random method to generate a unique magic word. In general, the choice of magic word will use the serial number of the device, the network hardware address or the clock. The possibility that the two sides produce the same magic word cannot be said to be absent, but should be avoided as much as possible. Usually, this happens when devices of the same manufacturer are interconnected, because the method of producing magic words by a device produced by one manufacturer is the same. .
  • the role of the magic word is to help detect whether there is a loop in the link.
  • the negotiation process of the magic word is shown in Figure 5.
  • the receiving end receives a Config-Request message, it will compare the message with the previous one.
  • the received Config-Request is compared. If the magic characters contained in the two packets are inconsistent, it indicates that there is no loop in the link. However, if they are consistent, the receiving end thinks that there may be a loop in the link, but there is no loop, and further confirmation is needed.
  • the receiving end will send a Config-Nak (Configuration Part Acknowledgment) message, and carry a regenerated magic word in the message, and before this time, before receiving any Config-Request or Config-Nak message, The receiving end will not send any Config-Request message. It is assumed that the following two situations may occur: 1. The link does not actually have a loop, but the other party is consistent with the receiver when generating the magic word, but the probability of occurrence of this situation is very small. After the Config-Nak is received by the peer, a Config-Request packet should be sent (the magic word in the Config-Request packet is the magic word in the Config-Nak packet).
  • the receiving end When the peer receives it, The last comparison, because the receiving end has generated a different magic word in the Config-Nak message, the magic word in the Config-Request message received by the receiving end is different from the last configuration request message. Therefore, the receiving end can conclude that there is no loop in the link.
  • the link actually has a loop. After a period of time, the Config-Nak packet will be returned to the same end that sent the Config-Nak packet. At this time, the receiving end compares the magic word in the Config-Nak message with the last sent out, so the possibility of a loop in the link increases.
  • the receiving end compares the magic word in the Config-Nak message with the last sent out, so the possibility of a loop in the link increases.
  • one end When one end receives a Config-Nak message, it will send a Config-Request message (the magic word in the message is the same as in Config-Nak), which returns to the original state, in this chain.
  • the Config-Request and Config-Nak messages will continue to appear on the road. Therefore, the receiver will think that there is a possibility of loops on the PPP link. When it reaches a certain order of magnitude, it can be considered as this. There is a loop in the link. (It is not the first time you receive the same
  • IPV6 interface identifier negotiation is described, as shown in Figure 6. (The ID indicates the sequence number of the negotiation packet, and Iden indicates the negotiated IPV6 64-bit interface identifier):
  • the IPV6CP IPv6 control protocol
  • IPv6 control protocol IPv6 control protocol
  • LLA Link Local Address
  • the receiving end receives the Config-Nak packet from the peer end, it indicates that the previous IPV6 interface identifier is duplicated, and the receiving end resends the Config-Request packet (the IPV6 interface identifier of the packet is in the Nak packet). The negotiation is successful until the Config-Ack packet is sent, otherwise the negotiation continues.
  • the core of the present invention is that after the PPP reaches the NCP phase negotiation, the IPV6 interface identifier is generated based on the magic word negotiated in the LCP phase. Because the magic word is uniquely unique on the PPP link during the LCP link negotiation phase, At the same time, the IPV6 interface identifier can also be guaranteed in this section of PPP. Uniqueness on the link.
  • the IPV6 interface identifier negotiation process of the present invention as shown in FIG. 7, after the sender sends a Config-Request packet containing the IPV6 interface identifier generated by the present invention, the Config-Ack packet received by the peer end is received. This IPV6 interface identifier is unique and can be used to generate LLAs.
  • the method of the invention can quickly generate an IPV6 interface identifier on the home gateway device side to avoid
  • the packet exchange caused by the duplicated IPV6 interface can reduce the link negotiation time and improve the packet transmission performance.
  • IPV6 interface identifier generation rule of the present invention is as follows, as shown in FIG. 8:
  • EUI64 64-bit extended unique identifier
  • IEEE Institute of Electrical and Electronics Engineers
  • the magic word is 32-bit. You can fill the 32-bit magic word to 48 bits. For example, add 0 to the front of the magic word to make 48 bits. Of course, you can also add numbers after or after the magic word. It can be 48 bits, and then generate a 64-bit IPV6 interface identifier according to the EUI64 algorithm.
  • the present invention is applicable to other devices based on the PPP link protocol, in addition to the home gateway device.
  • the following is an example of establishing an IPV6 type PPPOE connection by the home gateway, and the method for generating the IPV6 interface identifier of the present invention is shown in FIG. 9.
  • the implementation steps are as follows:
  • the home gateway establishes a PPPoE channel.
  • Step 101 The home gateway initiates PPPoE dialing, and starts PPPoE Active Discover (phase discovery) phase negotiation.
  • Step 102 The home gateway sends a PADI (PPPoE Active Discovery Initiation) request
  • Step 103 The home gateway receives a response PADO (PPPoE Active Discovery Offer, PPPoE) Dynamic discovery provides) messages
  • Step 104 The home gateway initiates a PPPoE Active Discovery Request (PPPoE Active Discovery Request) packet.
  • PPPoE Active Discovery Request PPPoE Active Discovery Request
  • Step 105 The home gateway receives the PADS (PPPoE Active Discovery Session-confirmation) packet, and the PPPoE channel is successfully established.
  • PADS PPPoE Active Discovery Session-confirmation
  • the home gateway enters the LCP phase.
  • Step 106 The home gateway generates a random magic word, and sends a Config-Request with a magic word option negotiation.
  • the interaction between the server and the home gateway is mutual.
  • the server also sends a Config-Request message with the magic word option negotiation to the home gateway. Therefore, the home gateway can also receive the Config-Request message of the server, and the subsequent processing flow is Steps 107-110 are similar.
  • Step 107 The server receives the Config-Request message, and determines whether the magic word is consistent with the value in the Config-Request message received last time. If not, go to step 108; if yes, go to step 109; Step 108 The server responds to the Config-Ack message and proceeds to step 111.
  • Step 109 The server generates a magic word different from the last received magic word, and sends a Config-Nak (Configuration Part Confirmation) message, carrying the generated magic word.
  • Config-Nak Configuration Part Confirmation
  • Step 110 The home gateway receives the Config-Nak message, uses the same magic word as the Config-Nak message, and sends a Config-Request message, and returns to step 107.
  • Step 111 The home gateway receives the Config-Ack packet, indicating that the magic word negotiation is successful. After the authentication negotiation, the process proceeds to step 112.
  • Step 112 The home gateway generates an IPV6 interface identifier according to the magic word negotiated by the LCP link, and sends a Config-Request packet of the IPV6CP, and carries the IPV6 interface identifier to negotiate the interface identifier.
  • Step 113 If the home gateway receives the IPV6CP Config-Request packet, it responds to IPV6CP.
  • Config-Ack message go to step 115.
  • Step 114 If the home gateway receives the Config-Ack message, the process proceeds to step 115.
  • Step 115 The NCP negotiation is successful.
  • the invention has the following advantages: By using the magic word negotiated in the LCP phase, a unique IPV6 interface identifier is generated, and the technical advantages are as follows:
  • the uniqueness of the magic word in the present invention can be applied to any scenario in which the system needs to use the PPP link for uniqueness determination.
  • the embodiment of the present invention provides a method and an apparatus for acquiring an IPv6 interface identifier, which can directly generate an IPV6 interface identifier without using other algorithms and calls, and completely guarantee the uniqueness on the PPP link.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Communication Control (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本发明提供一种获取IPv6接口标识的方法及装置,该方法包括:在网络核心协议协商过程中,根据魔术字生成IPv6接口标识。根据本发明能够以避免由于IPv6接口标识重复而引起的报文交互。

Description

一种获取 IPv6接口标识的方法及装置
技术领域
本发明涉及利用家庭网关设备接入 PPP 网络中的能力, 并且支持 IPV6 协商的能力, 提供一种基于 PPP链路获取 IP V6接口标识的方法及装置。
背景技术
PPP ( Point to Point Protocol, 点对点协议)协议是一种提供在点到点链 路上封装、 传输网络层数据包的数据链路层协议, PPP是一个分层结构 (物 理层、 链路层、 网络层), 在链路层(LCP ( Link Control Protocol, 链路控制 协议) )协商阶段, 会协商链路相关的参数, 包括为防止环路而协商的魔术 字 ( magic number ) , 而在网络层, 需要协商链路上唯一的 IPV6接口标识。 目前常用生成 IPV6接口标识方法有: 根据 48位 MAC地址生成, 或者根据 随机数生成两种方法, 根据 48位 MAC地址生成 IPV6接口标识的方法的优 点是易查看、容易定位 IPV6接口标识与网络接口的对应关系,但缺陷是需要 获取硬件的 MAC地址, 并且不能保证 MAC地址的冲突性, 特别是同一厂家 的设备;根据随机数生成 IPV6接口标识的方法需要使用随机数算法生成随机 数, 并且随机数不能做到完全的唯一性。
发明内容
本发明所要解决的技术问题是提供一种获取 IPV6接口标识的方法及装 置, 以避免由于 IPV6接口标识重复而引起的报文交互。
为了解决上述技术问题, 本发明提供了一种获取 IPV6接口标识的方法, 包括: 在网络核心协议协商过程中, 根据魔术字生成 IPV6接口标识。
优选地, 上述方法还具有下面特点: 在链路控制协议协商过程中协商一 魔术字的步骤, 包括: 在链路控制协议协商过程中, 判断接收到的配置请求报文中携带的魔术 字是否与上一次接收到的魔术字一致, 若一致, 则生成与接收到的魔术字不 同的魔术字, 然后发送携带所述生成的魔术字的报文; 若不一致, 则魔术字 协商成功。
优选地,上述方法还具有下面特点: 所述根据魔术字生成 IP V6接口标识 的步骤包括:
将 32位的所述魔术字补齐为 48位,然后根据 64位扩展唯一标示符算法 生成 64位的 IPV6接口标识。
优选地,上述方法还具有下面特点:所述生成 IPV6接口标识的步骤之后, 还包括:
发送携带所述 IPV6接口标识的配置请求报文;
接收到配置确认^艮文后, 基于所述 IPV6接口标识生成链路本地地址。 为了解决上述问题, 本发明还提供了一种获取 IPV6接口标识的装置, 包括:
协商模块, 其设置为: 在建立点到点协议通道后, 在链路控制协议协商 过程中协商一魔术字; 以及
生成模块, 其设置为: 在网络核心协议协商过程中, 根据所述魔术字生 成 IP V6接口标识。
优选地, 上述装置还具有下面特点:
所述协商模块还设置为: 在链路控制协议协商过程中, 判断接收到的配 置请求报文中携带的魔术字是否与上一次接收到的魔术字一致, 若一致, 则 生成与接收到的魔术字不同的魔术字, 然后发送携带所述生成的魔术字的报 文; 若不一致, 则魔术字协商成功。
优选地, 上述装置还具有下面特点:
所述生成模块还设置为: 在网络核心协议协商过程中, 将 32位的所述魔 术字补齐为 48位, 然后根据 64位扩展唯一标示符算法生成 64位的 IPV6接 口标识。
优选地, 上述装置还具有下面特点:
所述协商模块还设置为: 发送配置请求报文, 携带所述生成模块生成的 IPV6接口标识; 接收到配置确认报文后, 基于所述 IPV6接口标识生成链路 本地地址。
综上, 本发明实施例提供一种获取 IPv6接口标识的方法及装置, 无需其 他的算法和调用, 直接生成 IPV6接口标识, 完全保证在 PPP链路上的唯一 性。 附图概述
此处所说明的附图用来提供对本发明的进一步理解, 构成本申请的一部 分, 本发明的示意性实施例及其说明用于解释本发明, 并不构成对本发明的 不当限定。 在附图中:
图 1为本发明的获取 IPV6接口标识的方法的流程图;
图 2为本发明的获取 IPV6接口标识的装置的示意图;
图 3是 PPPoE协商阶段的过程图;
图 4是 PPP协商阶段的过程图;
图 5是魔术字协商的过程图;
图 6是现有技术的 IPV6接口标识协商过程图;
图 7是本发明的 IPV6接口标识协商过程图;
图 8是 IPV6接口标识生成算法图;
图 9是本发明的生成 IPV6接口标识的方法的流程图。
本发明的较佳实施方式
本发明利用 PPP链路层协商的唯一魔术字, 应用于 PPP网络层, 以避免 IPV6接口标识重复而引起的报文交互, 可以减少链路协商时间, 提高报文传 输性能。
图 1为本发明的获取 IPV6接口标识的方法的流程图, 如图 1所示, 包 括步骤: S10、 建立点到点协议通道后, 通过链路控制协议协商一魔术字;
S20、在网络核心协议协商过程中,根据所述魔术字生成 IPV6接口标识。 具体地, 在链路控制协议协商过程中, 判断接收到的配置请求报文中携 带的魔术字是否与上一次接收到的魔术字一致, 若一致, 则生成与接收到的 魔术字不同的魔术字, 然后发送携带所述生成的魔术字的报文; 若不一致, 则魔术字协商成功。
进一步地, 在所述生成 IPV6接口标识的步骤之后, 还可包括步骤: 发送携带所述 IPV6接口标识的配置请求报文;
接收到配置确认报文后, 基于所述 IPV6接口标识生成链路本地地址。 图 2为本发明的获取 IPV6接口标识的装置的示意图, 如图 2所示, 本 发明的装置包括: 协商模块和生成模块, 其中,
协商模块, 用于在建立点到点协议通道后, 在链路控制协议协商过程中 协商一魔术字;
生成模块, 用于在网络核心协议协商过程中, 根据所述魔术字生成 IPV6 接口标识。
其中, 所述协商模块, 具体用于在链路控制协议协商过程中, 判断接收 到的配置请求报文中携带的魔术字是否与上一次接收到的魔术字一致, 若一 致, 则生成与接收到的魔术字不同的魔术字, 然后发送携带所述生成的魔术 字的报文; 若不一致, 则魔术字协商成功。
所述协商模块还用于发送配置请求报文,携带所述生成模块生成的 IPV6 接口标识;接收到配置确认报文后,基于所述 IPV6接口标识生成链路本地地 址。
下面以具体的实施例详细说明本发明的生成 IPV6接口标识的流程。 图 3中为家庭网关与服务器建立 PPPoE链路的流程图, 如图 3所示, 家 庭网关通过发送 PADI ( PPPoE Active Discovery Initiation, PPPoE动态发现初 始)广播包发起 PPPoE会话请求;接收到 PAD0( PPPoE Active Discovery Offer, PPPoE动态发现提供)单播包后,发送 PADR( PPPoE Active Discovery Request, PPPoE 动态发现请求) 单播包; 接收到 PADS ( PPPoE Active Discovery Session-confirmation, PPPoE动态发现会话确认)单播包后, 生成会话标识, 协商出 PPPoE链路,在其基础上进行 PPP链路的协商;最后通过 PADT( PPPoE Active Discovery Terminate, PPPoE动态发现终止) 断开 PPPoE链路。
图 4为 PPP链路协商的流程图, 如图 4所示, PPP首先经过 LCP协商, 协商成功后进入 Auth (认证 )阶段协商,认证成功后进入 NCP ( Network Core Protocol, 网络核心协议)协商, 协商成功后建立 PPP链路。
本发明的基础是魔术字的协商及其唯一性, 首先说明一下魔术字的协商 过程, 如图 5所示(图示中 ID表示协商报文的序号标识, M表示协商的魔术 字) 。
魔术字是在链路建立过程中比较重要的一个参数, 这个参数是在 LCP阶 段的 Config-Request (配置请求 )里面被协商的, 主要的作用是防止环路(如 果在双方不协商魔术字的情况下, 魔术字都为 0, 故也不能用于 IPV6接口标 识, 但现在市场上几乎所有的设备都默认开启了魔术字协商) 。
魔术字被放在 LCP阶段 Config-Request的配置选项参数中进行发送, 而 且需要由通信设备自身独立产生,协议为了避免双方可能产生同样的魔术字, 从而导致通信出现不必要的麻烦, 因此要求由设备釆用一些随机方法产生一 个独一无二的魔术字。 一般来说, 魔术字的选择会釆用设备的系列号、 网络 硬件地址或时钟。 双方产生相同魔术字的可能性不能说是没有的, 但应尽量 避免, 通常这种情况是发生在相同厂商的设备进行互连时, 因为一个厂商所 生产的设备产生魔术字的方法是一样的。
魔术字产生的作用是用来帮助检测链路是否存在环路, 魔术字的协商过 程如图 5所示, 当接收端收到一个 Config-Request报文时, 会将此报文与上 一次所接收到的 Config-Request进行比较, 如果两个报文中所含的魔术字不 一致的话, 表明链路不存在环路。 但如果一致的话, 接收端认为链路可能存 在环路, 但不一定存在环路, 还需进一步确认。 此时接收端将发送一个 Config-Nak (配置部分确认)报文, 并在该报文中携带一个重新产生的魔术 字, 而且此时在未接收到任何 Config-Request或 Config-Nak报文之前, 接收 端也不会发送任何的 Config-Request报文, 这时假设可能会有以下两种情况 发生: 1、链路实际不存在环路, 而是由于对方在产生魔术字时与接收端产生的 一致,但实际这种情况出现的概率是很小的。 当 Config-Nak被对端接收到后, 应该发送一个 Config-Request报文(此 Config-Request报文中的魔术字为 Config-Nak报文中的魔术字) , 当对端接收到后, 与上次比较, 由于接收端 已经在 Config-Nak报文中产生了一个不同的魔术字, 此时接收端收到的 Config-Request报文中的魔术字与上次配置请求报文中不一样,所以接收端可 断定链路不存在环路。
2、 链路实际上确实存在环路, 一段时间后 Config-Nak报文会返回到发 送该 Config-Nak报文的同一端。这时接收端比较这个 Config-Nak报文中的魔 术字与上一次发出去的一样, 因此链路存在环路的可能性又增大了。 当一端 收到了一个 Config-Nak报文时, 又会发送一个 Config-Request报文(该报文 中的魔术字与 Config-Nak中的一致) , 这样又回到了最初的状态, 在这条链 路上就会不断的出现 Config-Request、 Config-Nak报文, 因此这样周而复始下 去, 接收端就会认为 PPP链路存在环路的可能性在不断增加, 当达到一定数 量级时, 就可认为此链路存在环路。 (不是第一次收到相同的魔术字就判断 有环路的) 。
最后再描述下 IPV6接口标识协商的流程, 如图 6所示 (图示中 ID表示 协商报文的序号标识, Iden表示协商的 IPV6 64位接口标识 ) :
PPP到达 NCP阶段协商后, 需要根据 IPV6CP ( IPv6控制协议)协商出 链路唯一的 IP V6接口标识, 用于生成 LLA ( Link Local Address, 链路本地地 址),以配置到 PPP网络接口上,发送一个含有 IPV6接口标识的 Config-Request 报文, 如果接收端收到对端回应的 Config-Ack报文, 则此 IPV6接口标识是 唯一的, 可以用于生成 LLA。
如果接收端收到对端回应的 Config-Nak报文, 则说明上一个 IPV6接口 标识重复, 接收端重新发送 Config-Request报文(该报文的 IPV6接口标识为 Nak报文中的) , 收到 Config-Ack报文则协商成功, 否则继续协商。
本发明的核心在于, PPP到达 NCP阶段协商后,就直接基于 LCP阶段协 商的魔术字生成 IPV6接口标识, 因在 LCP链路协商阶段已经保证了魔术字 在本条 PPP链路上的唯一性, 故同时也可以保证 IPV6接口标识在本条 PPP 链路上的唯一性。 本发明的 IPV6接口标识协商的流程, 如图 7所示, 发送端 发送一个含有通过本发明生成的 IPV6接口标识的 Config-Request报文后, 将 接收到对端回应的 Config-Ack报文, 此 IPV6接口标识是唯一的, 可以用于 生成 LLA。
本发明的方法, 对家庭网关设备侧可以快速生成 IPV6接口标识, 避免
IPV6接口标识重复而引起的报文交互, 可以减少链路协商时间, 提高报文传 输性能。
本发明的 IPV6接口标识生成规则如下, 如图 8所示:
EUI64 ( 64-bit extended unique identifier, 64位扩展唯一标示符) 由电气 和电子工程师协会 (IEEE) 定义, 本方案基于其算法, 说明如何通过魔术字生 成 IP V6接口标识。
魔术字是 32位的, 可以将 32位的魔术字补齐为 48位, 例如, 在魔术字 前面加 0补齐为 48位, 当然, 也可以在魔术字后或中间补入数字, 只要补齐 为 48位即可, 再根据 EUI64算法生成 64位的 IPV6接口标识。
除 EUI64位算法外, 也可以在 32位魔术字的基础上, 任意扩展生成唯 一的 IP V6接口标识。
本发明除适用于家庭网关设备之外, 还适用于其他基于 PPP链路协议的 设备。
为了更好地理解本发明, 下面结合附图和具体实施例对本发明作进一步 地描述。
下面以家庭网关建立一个 IPV6类型的 PPPOE连接为例, 说明本发明的 生成 IPV6接口标识的方法, 如图 9所示, 其实施步骤如下:
首先, 家庭网关建立 PPPoE通道。
步骤 101、 家庭网关发起 PPPoE拨号, 开始 PPPoE Active Discover (动 态发现 ) 阶段协商
步骤 102、 家庭网关发送 PADI ( PPPoE Active Discovery Initiation, PPPoE 动态发现初始) 文请求
步骤 103、家庭网关收到回应 PADO( PPPoE Active Discovery Offer, PPPoE 动态发现提供)报文
步骤 104、 家庭网关发起 PADR ( PPPoE Active Discovery Request, PPPoE 动态发现请求)报文
步骤 105、 家庭网关收到回应 PADS ( PPPoE Active Discovery Session-confirmation, PPPoE动态发现会话确认)报文, PPPoE通道建立成功。
家庭网关进入 LCP阶段。
步骤 106、 家庭网关生成随机的魔术字, 发送带有魔术字选项协商的 Config-Request才艮文。
服务器与家庭网关的交互是相互的, 服务器同时也向家庭网关发送带有 魔术字选项协商的 Config-Request报文, 所以家庭网关也可接收到服务器的 Config-Request报文, 之后的处理流程与步骤 107-110类似。
步骤 107、服务器收到 Config-Request报文, 判断魔术字是否与上一次接 收到的 Config-Request报文中的值一致,如不一致,则转向步骤 108;如一致, 则转向步骤 109; 步骤 108、 服务器回应 Config-Ack (配置确认)报文, 转向步骤 111。 步骤 109、 服务器生成与上一次接收到的魔术字不一样的魔术字, 并发 送 Config-Nak (配置部分确认)报文, 携带该生成的魔术字。
步骤 110、 家庭网关收到 Config-Nak报文, 使用与该 Config-Nak报文中 一样的魔术字, 并发送 Config-Request报文, 返回步骤 107。
步骤 111、 家庭网关收到 Config-Ack报文, 说明魔术字协商成功, 认证 协商后, 转向步骤 112。
步骤 112、 家庭网关根据 LCP链路协商的魔术字, 生成 IPV6接口标识, 发送 IPV6CP的 Config-Request报文, 携带所述 IPV6接口标识, 以协商接口 标识。
步骤 113、家庭网关若接收到 IPV6CP Config-Request报文,则回应 IPV6CP
Config-Ack报文, 转向步骤 115。
步骤 114、 家庭网关若接收到 Config-Ack报文, 则转向步骤 115。 步骤 115、 NCP协商成功。
本发明具有以下优点: 通过利用 LCP 阶段协商的魔术字, 生成唯一的 IPV6接口标识, 技术方案优点如下:
a) . 利用 PPP LCP阶段协商字段魔术字, 直接生成 IPV6接口标识, 无需 另外的算法和调用, 效率高。
b) . 魔术字的唯一性保证了 IP V6接口标识的唯一性, 可以完全避免由于 IPV6接口标识重复而产生交互的 Config-Nak报文。
本发明中魔术字的唯一性可以应用于系统需要使用 PPP链路做唯一性判 断的任何场景。
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序 来指令相关硬件完成, 所述程序可以存储于计算机可读存储介质中, 如只读 存储器、 磁盘或光盘等。 可选地, 上述实施例的全部或部分步骤也可以使用 一个或多个集成电路来实现。 相应地, 上述实施例中的各模块 /单元可以釆用 硬件的形式实现, 也可以釆用软件功能模块的形式实现。 本发明不限制于任 何特定形式的硬件和软件的结合。
以上仅为本发明的优选实施例, 当然, 本发明还可有其他多种实施例, 在不背离本发明精神及其实质的情况下, 熟悉本领域的技术人员当可根据本 发明作出各种相应的改变和变形, 但这些相应的改变和变形都应属于本发明 所附的权利要求的保护范围。
工业实用性 本发明实施例提供一种获取 IPv6接口标识的方法及装置, 无需其他的算 法和调用, 直接生成 IPV6接口标识, 完全保证在 PPP链路上的唯一性。

Claims

权 利 要 求 书
1、 一种获取 IP V6接口标识的方法, 包括:
在网络核心协议协商过程中, 根据魔术字生成 IPV6接口标识。
2、 如权利要求 1所述的方法, 其中, 所述方法还包括: 在链路控制协议 协商过程中协商一魔术字的步骤, 包括:
在链路控制协议协商过程中, 判断接收到的配置请求报文中携带的魔术 字是否与上一次接收到的魔术字一致, 若一致, 则生成与接收到的魔术字不 同的魔术字, 然后发送携带所述生成的魔术字的报文; 若不一致, 则魔术字 协商成功。
3、 如权利要求 1所述的方法, 其中, 所述根据魔术字生成 IP V6接口标 识的步骤包括:
将 32位的所述魔术字补齐为 48位,然后根据 64位扩展唯一标示符算法 生成 64位的 IPV6接口标识。
4、 如权利要求 1-3任一项所述的方法, 其中, 所述生成 IP V6接口标识 的步骤之后, 还包括:
发送携带所述 IPV6接口标识的配置请求报文;
接收到配置确认报文后, 基于所述 IPV6接口标识生成链路本地地址。
5、 一种获取 IPV6接口标识的装置, 包括:
协商模块, 其设置为: 在建立点到点协议通道后, 在链路控制协议协商 过程中协商一魔术字; 以及
生成模块, 其设置为: 在网络核心协议协商过程中, 根据所述魔术字生 成 IP V6接口标识。
6、 如权利要求 5所述的装置, 其中,
所述协商模块还设置为: 在链路控制协议协商过程中, 判断接收到的配 置请求报文中携带的魔术字是否与上一次接收到的魔术字一致, 若一致, 则 生成与接收到的魔术字不同的魔术字, 然后发送携带所述生成的魔术字的报 文; 若不一致, 则魔术字协商成功。
7、 如权利要求 5所述的装置, 其中,
所述生成模块还设置为: 在网络核心协议协商过程中, 将 32位的所述魔 术字补齐为 48位, 然后根据 64位扩展唯一标示符算法生成 64位的 IPV6接 口标识。
8、 如权利要求 5-7任一项所述的装置, 其中,
所述协商模块还设置为: 发送配置请求报文, 携带所述生成模块生成的 IPV6接口标识; 接收到配置确认报文后, 基于所述 IPV6接口标识生成链路 本地地址。
PCT/CN2011/080685 2010-10-20 2011-10-12 一种获取IPv6接口标识的方法及装置 WO2012051909A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010523022.8 2010-10-20
CN201010523022.8A CN102457548B (zh) 2010-10-20 2010-10-20 一种获取IPv6接口标识的方法及装置

Publications (1)

Publication Number Publication Date
WO2012051909A1 true WO2012051909A1 (zh) 2012-04-26

Family

ID=45974683

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/080685 WO2012051909A1 (zh) 2010-10-20 2011-10-12 一种获取IPv6接口标识的方法及装置

Country Status (2)

Country Link
CN (1) CN102457548B (zh)
WO (1) WO2012051909A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104601462B (zh) * 2014-12-18 2018-01-16 华为技术有限公司 传输数据包的方法及设备
CN104468348A (zh) * 2014-12-22 2015-03-25 迈普通信技术股份有限公司 实现vpn快速重路由的服务商边界路由器、系统及方法
CN110601984B (zh) * 2019-09-20 2020-10-23 清华大学 一种获取本地服务、生成链路本地地址的方法及装置
CN111585852B (zh) * 2020-04-17 2021-05-18 武汉思普崚技术有限公司 一种双栈拨号方法、设备及存储介质

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1809076A (zh) * 2006-01-26 2006-07-26 中国移动通信集团公司 通信网络中终端IPv6地址的生成及解析方法
US20100158029A1 (en) * 2005-05-30 2010-06-24 Pantech Co., Ltd. Method of operating internet protocol address and subnet system using the same

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100563250C (zh) * 2006-03-06 2009-11-25 华为技术有限公司 一种ipv6接口标识获取装置及方法

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100158029A1 (en) * 2005-05-30 2010-06-24 Pantech Co., Ltd. Method of operating internet protocol address and subnet system using the same
CN1809076A (zh) * 2006-01-26 2006-07-26 中国移动通信集团公司 通信网络中终端IPv6地址的生成及解析方法

Also Published As

Publication number Publication date
CN102457548A (zh) 2012-05-16
CN102457548B (zh) 2015-05-20

Similar Documents

Publication Publication Date Title
JP4865805B2 (ja) 異なる認証証明書をサポートするための方法および機器
JP6976411B2 (ja) ネットワークアクセス方法および装置ならびにネットワークデバイス
JP4625081B2 (ja) ネットワーク・アクセスのための早いリンク確立
WO2018191854A1 (zh) 接入固定网络的方法和接入网关网元
WO2008106881A1 (fr) Procédé d'accès ppp, système correspondant et dispositif à noeud d'accès
CN101127600A (zh) 一种用户接入认证的方法
WO2014117525A1 (zh) 静态用户终端认证处理方法及装置
WO2014015775A1 (zh) 一种IPv6地址无状态自动配置的系统、数据卡及其实现方法
WO2018196587A1 (zh) 融合网络中的用户认证方法及装置
US7715562B2 (en) System and method for access authentication in a mobile wireless network
WO2014176997A1 (zh) 数据收发方法及系统、消息的处理方法及装置
WO2013056619A1 (zh) 一种身份联合的方法、IdP、SP及系统
WO2017088101A1 (zh) 一种网络连接信息获取方法及路由器
WO2012051909A1 (zh) 一种获取IPv6接口标识的方法及装置
WO2017080335A1 (zh) 一种基于pppoe网络的拨号方法、拨号系统及路由器
WO2009074072A1 (fr) Procédé, système de réseau et équipement de réseau de conversion de stratégie dynamique
WO2010000157A1 (zh) 接入设备的配置方法、装置及系统
KR20100027156A (ko) 고속 패킷 데이터 세션 해제 방법
US8615591B2 (en) Termination of a communication session between a client and a server
CN101499993B (zh) 一种认证方法、设备和系统
WO2012041168A1 (zh) 用于IPv6网络的网络连接处理方法及其装置
WO2011050660A1 (zh) 接入方法及装置
WO2013071739A1 (zh) 一种Ipv4/Ipv6双栈用户计费方法及装置
US20130191635A1 (en) Wireless authentication terminal
JP2006019934A (ja) パケット交換網の呼設定方法

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

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

Country of ref document: EP

Kind code of ref document: A1