CN102185749B - Method for avoiding routing loop by adopting tree topology relationship - Google Patents

Method for avoiding routing loop by adopting tree topology relationship Download PDF

Info

Publication number
CN102185749B
CN102185749B CN 201110151082 CN201110151082A CN102185749B CN 102185749 B CN102185749 B CN 102185749B CN 201110151082 CN201110151082 CN 201110151082 CN 201110151082 A CN201110151082 A CN 201110151082A CN 102185749 B CN102185749 B CN 102185749B
Authority
CN
Grant status
Grant
Patent type
Prior art keywords
node
topology
number
branch
sequence
Prior art date
Application number
CN 201110151082
Other languages
Chinese (zh)
Other versions
CN102185749A (en )
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
Grant date

Links

Abstract

本发明提供一种采用树形拓扑关系避免路由环路的方法,建立了树形网络,向节点分配拓扑序号,在树形网络中创建分支拓扑序列信息以及在树形网络中避免路由环路的方法,该方法包括:源节点广播RREQ报文,收到该RREQ报文的节点查询所述分支拓扑序列信息;判断源节点是否为所述收到该RREQ报文的节点的祖先节点;如果否,则所述收到该RREQ报文的节点响应该RREQ报文;如果是,则所述收到该RREQ报文的节点不响应该RREQ报文。 The present invention provides a tree-like topology method to prevent routing loops, to establish a tree network, the serial number assigned to the topological node, create a branch sequence information in the tree topology network and to avoid routing loops in the tree network , the method comprising: a source node broadcasts a RREQ message, the RREQ receives the query packet branch node topology information sequence; determining whether the source node to the ancestor node receives the RREQ message; if not , then the received RREQ message to the node responds to the RREQ message; if so, the received RREQ message to the node does not respond to the RREQ message. 该方法通过分析节点之间的拓扑层次关系,阻止路由环路发生的可能性。 In this method, topological analysis of hierarchical relationships between nodes, to prevent the possibility of routing loops occur.

Description

采用树形拓扑关系避免路由环路的方法 Avoid using a tree topology routing loop method

技术领域 FIELD

[0001] 本发明涉及一种无线传感器网络的路由方法。 [0001] The present invention relates to a routing method for wireless sensor networks. 更具体地,本发明涉及一种采用树形拓扑关系避免路由环路的无线传感器网络路由方法。 More particularly, the present invention relates to a wireless sensor network topology tree routing method employed to avoid routing loops.

背景技术 Background technique

[0002] 无线传感器网络(Wireless Sensor Networks, WSNs)技术是现代通信技术和计算机网络技术的重要组成部分,它是由分布在观测区域内的大量的廉价微型传感器节点组成,通过无线通信方式形成的一个多跳的自组织网络。 [0002] The wireless sensor network (Wireless Sensor Networks, WSNs) technology is an important component of modern communications and computer network technology, which is a large number of cheap micro-sensor nodes distributed in the observation area, which formed by a wireless communication method a multi-hop ad hoc networks. 各传感器节点之间协同合作地感知物理世界的对象信息(如:温度、湿度、加速度、光强等),并最终将数据信息汇聚、融合至服务器和观察者。 Cooperative sensing a physical world in cooperation between the sensor node object information (such as: temperature, humidity, acceleration, intensity, etc.), and finally the data aggregation, fusion to the server and the viewer.

[0003] 近年来,随着物联网的兴起和发展,无线传感器网络技术受到了更多的关注,其逐渐成为实现物理世界和信息世界相互融合的重要保障。 [0003] In recent years, with the rise and development of things, wireless sensor network technology has been more attention, it is becoming important to realize the physical world and the information world of mutual integration. 与此同时,伴随无线传感器网络技术发展而产生的应用扩展也有着越来越广阔的空间和美好的前景。 At the same time, it extends the application along with the development of wireless sensor network technology has also generated more broad space and a bright future. 目前无线传感器网络技术已广泛应用于智能交通、智能电网、智能家居、工业控制、环境监测、医疗保健、军事等领域。 Currently wireless sensor network technology has been widely used in intelligent transportation, smart grid, smart home, industrial control, environmental monitoring, health care, military and other fields.

[0004] 图1表示的是无线传感器网络的基本结构。 [0004] FIG. 1 shows a basic structure of a wireless sensor network. 无线传感器网络一般包括:传感节点(sensor节点)如W、X、Y、Z和汇聚节点(sink节点),无线传感器网络通过sink节点接入服务器从而与各种网络交互。 Wireless sensor networks generally comprise: a sensing node (sensor node) such as W, X, Y, Z and aggregation node (sink node), wireless sensor network sink node by the network access server so as to interact with various. 各传感节点(以下如无特指,统称为节点)之间协作地感知信息,通过多跳将信息汇聚至sink节点,再连接至服务器,经各种无线或有限网络供用户查询、配置和管理。 Sensing cooperatively among sensor nodes (hereinafter, especially if no, collectively referred to as node) information, the multi-hop aggregation information to the sink node, and then connected to the server via a variety of wireless or network for the user query, configure and management.

[0005] 无线传感器网络一般拥有数量众多的节点设备,在许多情况下,每一个节点都需要配置全球唯一的IP地址,因此IPv6技术在无线传感器网络中有着重要的应用价值。 [0005] wireless sensor networks typically have a large number of node devices, in many cases, each node needs to be configured globally unique IP addresses, IPv6 technology has important applications in wireless sensor networks. 但另一方面,无线传感器网络由于资源受限等原因,对于IPv6协议栈占用的资源(如128比特IPv6地址)不能很好的适应和满足,这尤其体现在路由协议的设计和实现上。 On the other hand, due to the resource-constrained wireless sensor networks and other reasons, for the resources occupied by the IPv6 protocol stack (e.g., 128-bit IPv6 address) and are not well adapted to meet, which is particularly reflected in the design and implementation of routing protocols.

[0006] AODV(Ad hoc On-Demand Distance Vector Routing)路由协议是无线传感器网络中经典的按需路由协议之一,但是考虑到资源受限等因素,因此需要重新对AODV路由协议进行改进和优化。 [0006] AODV (Ad hoc On-Demand Distance Vector Routing) routing protocol is one of the wireless sensor network classic demand routing protocols, but considering the limited resources and other factors, it is necessary to re-routing protocol AODV improved and optimized . MSRP (Micro Sensor Router Protocol)协议按照上述思想对AODV协议进行了优化,分别精简了路由交互报文格式,使用64位(8字节)IPv6地址接口标识符即IPv6地址的后64位代替IPv6中的128位(16字节)地址,可以有效减少地址字段的长度,使得路由解析过程变得更加简单、有效,符合无线传感器网络能量、存储资源受限的要求,其中,I位就是I比特(bit),8位就是I字节。 MSRP (Micro Sensor Router Protocol) protocol in accordance with the above idea of ​​AODV protocol is optimized, respectively, to streamline the interaction routing packet format, 64-bit (8 byte) after the 64-bit IPv6 address interface identifier, IPv6 in IPv6 addresses instead of 128-bit (16-byte) address, can reduce the length of the address field, so that the route resolution process becomes more simple, efficient, wireless sensor networks in line with the energy storage resource constrained claim, wherein, I bit is bit I ( bit), 8 bits are the I byte. 此外,IEEE802.15.4协议规定两种地址格式,64位地址和16位地址。 Further, two kinds of the IEEE802.15.4 protocol predetermined address format, 64-bit address and 16-bit address. 其中,采用64位地址能够保证地址的唯一性,能够实现节点地址的自动配置,而采用16位地址则需要网关分配,并且需要考虑地址重复检测、地址回收等问题,实现起来复杂,所以采用64位IPv6地址接口标识符符合IEEE 802.15.4标准对于地址字段的要求。 Wherein the 64-bit address to ensure uniqueness of the address, the automatic configuration node address, and the 16-bit address gateway is needed for allocation, and the need to consider the address duplication is detected, the address recovery problems, complex to implement, so 64 bit IPv6 address interface identifier for IEEE 802.15.4-compliant address field requirements. 以下分别为路由请求(RREQ)报文、路由回复(RREP)报文、路由错误(RERR)报文的格式: The following are a route request (the RREQ) packets, route reply (the RREP) message, a route error (the RERR) packet format:

Figure CN102185749BD00051

[0008] RREQ报文格式 [0008] RREQ message format

[0009] 其中的类型为000,表示RREQ报文类型,跳数为RREQ报文携带的从源节点到当前节点的跳数;路由请求ID为RREQ消息的唯一标识;源地址为源节点的地址即发出RREQ报文的节点或者该节点的某个RFD (Reduced Funct1n Device)节点的IEEE802.15.4定义的 [0009] wherein the type 000 indicates the number of hops from the source node to the current node the RREQ message type, number of hops for the RREQ message carries; route request ID uniquely identifies RREQ message; the source address of the source node address IEEE802.15.4 is issued defined message RREQ node or a node of the RFD (Reduced Funct1n Device) node

64比特(8字节)接口标识符;目的地址为目的节点的地址即接收RREQ请求路由节点的64 64 bits (8 bytes) interface identifier; destination address is the address of the destination node receives the RREQ i.e., request routing nodes 64

比特(8字节)接口标识符;最小LQ1:报文携带从RREQ源节点到当前节点的链路质量度量值的最小值。 Bits (8 bytes) interface identifier; Minimum LQ1: RREQ packet from the source node carries the link quality metric to a minimum value of the current node. LQI (Link Quality Indicator)是符合IEEE802.15.4标准的一项对于无线传感器网络链路质量进行度量的参数。 LQI (Link Quality Indicator) is in line with a parameter to measure the IEEE802.15.4 standard for wireless sensor network link quality. 采用此字段可以在路由建立的过程中作为选路的依据,以此建立的路由能够保证较高的链路质量。 Using this field can be used as the basis of the routing process of routing establishment in order to establish the link routing to ensure high quality. RFD节点可以理解为没有路由功能,只能与其他节点通信的采集节点。 RFD node will be appreciated that there is no routing function, can only communicate with other nodes in the collection node.

Figure CN102185749BD00052

[0011] RREP报文格式 [0011] RREP message format

[0012] 其中的类型为001,表示RREP报文类型;跳数为RREP报文携带的从源节点到当前节点的跳数;源地址为发起RREP的节点或该节点的某个RFD节点的IEEE802.15.4定义的64比特接口标识符;目的地址为接收RREP的节点即对应于RREQ发起节点的IEEE802.15.4定义的64比特接口标识符;最小LQ1:报文携带从RREP源节点到当前节点的链路质量度量值的最小值。 [0012] wherein the 001 type, showing RREP message type; the number of hops is the number of hops from the source node to the current node carried by the packet RREP; RREP source address originating node or a node of the node RFD IEEE802 .15.4 64-bit interface identifier defined; node receives the RREP to the destination address, i.e., corresponding to the RREQ initiating node IEEE802.15.4 defined 64-bit interface identifier; minimum LQ1: RREP packets carry chain from the source node to the current node minimum road quality measurements.

Figure CN102185749BD00053

[0014] RERR报文格式 [0014] RERR message format

[0015] 类型:010,表示RERR报文类型;不可达地址的数目:某节点检测的失效邻居节点的个数;不可达目的地址:某节点检测的失效邻居节点的IEEE802.15.4定义的64比特接口标识符。 [0015] Type: 010, indicates RERR message type; number is not reachable addresses: the number of neighbors a node failure detected; unreachable destination address: the IEEE802.15.4 defined neighbor node a node failure detected 64 bits interface identifier. 不可达地址的数目决定不可达目的地址的个数,因此如果有更多不可达目的地址,则报文格式中可以携带更多的不可达目的地址。 The number of unreachable address determines the number of unreachable destination addresses, so if there are more unreachable destination address, the packet format may carry more unreachable destination address.

[0016] 其中MSRP协议建立路由的基本过程是,无路由的节点向邻居节点广播路由请求(RREQ)报文,并经过中间节点转发,当sink节点收到该路由请求报文时,就向发起路由请求(RREQ)报文的节点回复路由回复(RREP)报文,从而建立节点到sink节点的路由。 [0016] The basic process wherein MSRP protocol is established route without route node to the neighboring node broadcasts a route request (the RREQ) packets, and forwarding through intermediate nodes, when the sink node receiving the route request message, to the originating route request (the RREQ) message routing node reply reply (the RREP) message, thereby establishing the route node to the sink node.

[0017] 但是MSRP协议将所有的路由回复(RREP)报文交由sink节点处理的方式,不仅大大增加了sink节点的负载,也增加了节点建立路由的时延。 [0017] However, all of the MSRP protocol routing reply (RREP) message referred to the way sink node processing, not only greatly increases the load sink nodes also increases the delay to establish a routing node. 因此现有技术又进一步采取中间节点回复RREP的方式解决sink节点负载过重和路由时延过大等缺陷,即如果中间节点的路由表中存在到达sink节点的可用路由时,由该中间节点直接回复RREP而不是向sink节点转发,而这样的方式又会不可避免的带来路由环路的新问题。 Thus the prior art further take the form of solutions intermediate node replies RREP routing latency sink node overload and excessive defects, i.e., if the available route to the sink node in the routing table of the intermediate node, the intermediate node by a direct reply RREP instead of forwarding to the sink node, and this way will inevitably bring new problems routing loops.

[0018] 所谓路由环路就是,数据包在一系列节点之间不断传输却始终无法到达其预期目的节点的一种现象。 [0018] The so-called routing loop is, a series of data packets between nodes continue to transmit a phenomenon it has failed to reach its intended destination. 当两个节点或多个节点的路由信息中存在错误地指向不可达目的节点的有效路径时,就可能发生路由环路。 When the routing information of the two or more nodes in the node to a valid path errors unreachable destination node, routing loops can occur. 举例来说,假设网络中有节点A、B、C、E,初始路由是C —B —A和E —B —A。 For example, if there are network nodes A, B, C, E, is the initial routing C -B -A and E -B -A. 某一时刻,节点B链路出错,处于失效状态。 Certain moment, the Node B link error, in a failed state. 在一次发送数据过程中,节点C发送给节点B的数据包全部收不到ACK回复,那么节点C就会判定自己到节点B的路由错误,因此开始广播RREQ重新寻找路由,这个RREQ被节点E所获取,因为节点E此时并不知道节点B不工作了,因此会回复RREP给节点C,重新建立的路由为C — E — B — A。 In a data transmission process, transmits to node C packet node B can not receive all ACK reply, then the node C will then determine their own routing errors to node B, and therefore start again to find the route broadcast RREQ, the node E is RREQ the acquisition, because node E node B does not know at this time does not work, so the route will reply RREP to node C, re-established for the C - E - B - A. 但是,这条路由仍然包括已经不工作的节点B,实际仍是无效路由。 However, this route still includes Node B is no longer working, the actual route is still invalid. 随后,节点E在发送数据的过程中也发现有大量的包丢失,因此发起广播RREQ过程,此时节点C因为路由已经更新,节点B已经不再被节点C认为无效,所以当节点C收到节点E发来的RREQ后,向其回复RREP,从而使节点E具有新的路由即变成E — C — E — B — A,对于节点C向节点E提供的路由是否仍包括节点E本身,节点C在提供路由之前是无法判断的,因此这种过程会一直往复,导致用户的数据包不停在网络上循环发送,且跳数越来越大,造成网络资源的严重浪费。 Then, node E during the transmission data have been found in a large number of packets are lost, so the process of initiating a broadcast RREQ, the node C at this time because the route has been updated, the node B is no longer considered valid node C, node C receives so when after the RREQ sent by node E, the RREP reply thereto, so that the new routing node E having i.e. becomes E - C - E - B - a, if node C to node E to provide a routing node E itself still included, before providing routing node C can not be judged, so this process would have been back and forth, causing the user's data packets sent over the network constantly circulating, and hops growing, causing serious waste of network resources.

发明内容 SUMMARY

[0019] 本发明目的在于提供一种采用树形拓扑关系避免路由环路的方法,避免在数据包传输过程中产生路由环路。 [0019] The object of the present invention to provide a method for avoiding routing loops tree topology using, avoid routing loops in a packet transmission process.

[0020] 本发明的技术方案是:一种树形网络,包括一级节点,二级节点和三级节点, [0020] aspect of the present invention is: a tree network including a node three nodes and two nodes,

[0021] 所述一级节点为所述树形网络的根节点; [0021] The root node is a node of the tree network;

[0022] 所述二级节点为所述一级节点的子节点,具有由所述一级节点分配的唯一拓扑序号; [0022] The node of the two child nodes of a node, topology has a unique number assigned by said one node;

[0023] 所述三级节点为所述一级节点或所述二级节点的子树节点,每个三级节点具有由所述一级节点或所述二级节点分配的唯一拓扑序号; [0023] The three node is a node of the two nodes or the subtree nodes, each node having three unique number assigned by the topology of a node or two nodes;

[0024] 一个或多个分支拓扑序列信息,每个分支拓扑序列信息以所述根节点的一个子树中各节点的拓扑序号的组合记录该子树中各节点的拓扑关系。 [0024] One or more sequences branch topology information, the topology of each branch sequence number of the topology information in a combination of a sub-tree of the root node of each node in the subtree recording topology each node.

[0025] 利用树形拓扑结构的描述可以构建网络中分层次的节点关系,适用于经常以广播形式发送报文的网络,为本发明中逐级分配节点的拓扑序号以及以树的形式精确记录分支拓扑序列信息提供前提。 [0025] described using a tree topology may be constructed hierarchically network node which is, for the regular broadcast packets transmitted form the network, the topology of the present invention stepwise distribution and number of nodes in a tree form accurate record branch topology sequence information provided premise.

[0026] 本发明还提供一种在树形网络中创建分支拓扑序列信息的方法,包括: [0026] The present invention further provides a method of creating branches in the tree topology sequence information network, comprising:

[0027] 步骤S1、在初始建立路由中分配拓扑序号并生成分支拓扑序列信息; [0027] step S1, the serial number assigned in the initial establishment of the routing topology and branch topology generates sequence information;

[0028] 步骤S2、一级节点的子节点向其子树节点多播所述分支拓扑序列信息; [0028] Step S2, the child node to a child node of a multicast tree, the branch node topology information sequence;

[0029] 步骤S3、所述子树节点存储所述分支拓扑序列信息; [0029] Step S3, the said sub-branch tree node stores the topology information sequence;

[0030] 步骤S4、判断是否还存在未获得拓扑序号的节点,如果存在,进入步骤S5 ; [0030] step S4, it is determined whether there is not obtained a node number of the topology, if present, proceeds to step S5;

[0031] 步骤S5、向所述未获得拓扑序号的节点补分配拓扑序号并更新分支拓扑序列信息,并返回步骤S3。 [0031] Step S5, the topology is not obtained to the node ID number and topology of distributive branch topology update information sequence, and returns to step S3.

[0032] 向网络中的节点分配数值型的拓扑序号,利用拓扑序号生成数值型分支拓扑序列信息,既能够体现节点间的拓扑层次关系也适合存储于报文中进行传输。 [0032] in the network topology the node number assigned numeric, numeric topological branch topology number generating sequence information, both to reflect the topology hierarchical relationship between the nodes is also suitable for transmission stored in the packet.

[0033] 进一步地,根据权利要求2所述的一种在树形网络中创建分支拓扑序列信息的方法,步骤SI包括以下子步骤: [0033] Further, creating a branch sequence information in the tree topology network, according to one method according to claim 2, comprising the step SI the substeps of:

[0034] 步骤S11、节点发送RREQ报文; [0034] step S11, the node sends the RREQ message;

[0035] 步骤S12、一级节点向其子节点回复RREP报文并分配拓扑序号; [0035] In step S12, a node to a child node and replies RREP packet number assignment topology;

[0036] 步骤S13、二级节点向该二级节点的子节点回复RREP报文并分配拓扑序号,生成分支拓扑序列信息; [0036] Step S13, the two child nodes of the node to the secondary node and replies RREP packet number assignment topologies, branch topologies generate sequence information;

[0037] 步骤S14、三级节点向其子节点回复RREP报文,完成初始建立路由。 [0037] Step S14, the three nodes to a child node replies RREP packet, completing the initial route establishment.

[0038] 优先利用现有技术中建立路由的过程进行拓扑序号的分配,使得拓扑序号的分配过程与现有技术的建立路由过程紧密结合,节省了节点能量。 [0038] The use of the process of establishing the priority of the prior art for routing topology assigned numbers, such that assigned numbers the topology closely with the prior art process of establishing a route, node saves energy.

[0039] 进一步地,所述步骤S5包括以下子步骤: [0039] Further, the step S5 includes the substeps of:

[0040] 步骤S51、所述未获得拓扑序号的节点发送分支拓扑序号请求报文; Node [0040] step S51, the topology of the serial number is not obtained in the transmission branch topology request packet sequence number;

[0041] 步骤S52、根据分支拓扑序号请求报文所经过的节点记录当前的分支拓扑序列信息; [0041] step S52, the topology according to the branch node number through which the packet request to record the current branch topology information sequence;

[0042] 步骤S53、接收所述分支拓扑序号请求报文的节点判断自己是否具有分配拓扑序号的权限,如果是则进入步骤S54,如果否则进入步骤S56 ; [0042] In step S53, the received sequence number of the branch topology request message to determine if they have the authority node topology numbers assigned, if the process proceeds to step S54, if otherwise, step S56;

[0043] 步骤S54、所述接收所述分支拓扑序号请求报文的节点判断自己是否具有分配拓扑序号的能力,如果是则进入步骤S55,如果否则进入步骤S56 ; [0043] step S54, the receiving node requesting the branch topology message sequence number to determine if they have the ability to distribute topology numbers, if the process proceeds to step S55, the process proceeds to step S56 if otherwise;

[0044] 步骤S55、所述接收所述分支拓扑序号请求报文的节点向其子树节点发送携带有拓扑序号和分支拓扑序列信息的分支拓扑序号更新报文,进入步骤S57 ; [0044] step S55, the sequence number of the topology of the branch receiving the request packet transmitting node to a child node tree topology carries a sequence number and spoke topology branch topology information update packet number, proceeds to step S57;

[0045] 步骤S56、所述接收所述分支拓扑序号请求报文的节点转发所述分支拓扑序号请求报文,返回步骤S52; [0045] step S56, the topology of the branch receiving the request packet sequence number of the branch node forwards the topology request packet sequence number, processing returns to step S52;

[0046] 步骤S57、所述未获得拓扑序号的节点获得所述拓扑序号。 [0046] step S57, the node number is not obtained in obtaining the topology topology number.

[0047] 在无法通过建立路由进行拓扑序号分配时,本发明设计了分支拓扑序号的分配过程,并将分配序号过程与更新分支拓扑序列信息同时通过同一报文完成,节省了链路中的传输数据量,提高了创建分支拓扑序列信息的效率。 [0047] When the topology can not establish a route through the sequence distribution, the present invention contemplates a number assignment process branch topology, and assigns a sequence number update process and branch topology information simultaneously through the same sequence of packets is completed, saving transmission link the amount of data to improve the branch topology creation sequence information efficiency.

[0048] 进一步地,所述RREQ报文包括EN字段和RREQ序号字段,所述EN字段标识RREQ源节点是否拥有拓扑序号,所述RREQ序号字段用于存储RREQ报文源节点的拓扑序号; [0048] Further, the RREQ message includes EN RREQ field and a sequence number field, the EN RREQ source node field identifies whether the topology has a number, the sequence number field for storing the topology RREQ RREQ packet sequence number of the source node;

[0049] 所述RREP报文包括CN字段和分配拓扑序号字段,所述CN字段标识是否有权限分配拓扑序号并且是否有分配能力;所述分配拓扑序号字段用于存储分配的拓扑序号。 [0049] The RREP message includes the CN field and a sequence number field distribution topology, the CN field identifies the topology has permission number and whether there is allocated capacity allocated; the distribution topology assigned sequence number field for storing the serial number of the topology.

[0050] 本发明只改变路由建立阶段的报文的格式使之既能够携带拓扑序号,分支拓扑序列信息,又能标识出报文发出节点的当前状态,使得报文传输数据信息的功能加强,并有利于接收节点根据发出节点的状态做出灵活的处理。 [0050] The present invention changes only the route setup packet format so that both phases can carry serial topology, the topology branch sequence information, but also identifies the current state of the node sent the packet, such that the data packet transmission function of reinforcement, and contribute to the receiving node to make flexible processing according to the state issued nodes.

[0051] 进一步地,所述分支拓扑序号请求报文和所述分支拓扑序号更新报文包括拓扑序列字段,所述拓扑序列字段用于存储当前的分支拓扑序列信息; [0051] Further, the branch topology request packet sequence number and the serial branch topology update message includes a sequence field topology, the topology of a field for storing the current sequence of branch topology information sequence;

[0052] 所述分支拓扑序号更新报文还包括节点序号字段,该节点序号字段用于存储所述分配的拓扑序号。 [0052] The number of the branch topology update message further comprises a node number field, the node number field for storing the allocated number topology.

[0053] 本发明增加了专门分配拓扑序号及传输分支拓扑序列信息的报文,并设置了相应的存储用字段,补充了利用路由建立的报文分配拓扑序号和生成分支拓扑序列信息的不完整,使得节点可以更有针对性地解析该专门性的报文中各字段的信息。 [0053] The present invention adds a special distribution topology number and the transmission branch topology sequence information packet, and set the corresponding storing fields, supplemented packet distribution topology number using the routing set up and generating spoke topology sequence information is not complete , so that the node can be more targeted to the specialized analysis information packet in each field.

[0054] 进一步地,步骤S2也利用所述分支拓扑序号更新报文多播所述分支拓扑序列信肩、O [0054] Further, step S2 also use the serial branch topology update message to the multicast channel branch topology sequence shoulder, O

[0055] 利用分支拓扑序号,可以在路由建立阶段不额外增加新的报文种类而传递分支拓扑序列信息,节省节点能量,并有利于本发明技术方案扩展应用。 [0055] With the serial branch topology, the routing stage may be established without additional new message type information sequence is transmitted spoke topology, energy saving nodes, and facilitate aspect of the present invention extends the application.

[0056] 进一步地,如果接收所述分支拓扑序号请求报文或所述分支拓扑序号更新报文的节点再次收到重复的分支拓扑序号请求报文,则直接丢弃。 [0056] Further, if the branch received topology request packet sequence number or the branch topology update the node ID of the received packet is repeated again spoke topology request packet sequence number is discarded.

[0057] 这样可以避免节点对重复的报文进行多次处理,节省了节点的能量,也减少了链路中冗余的数据量。 [0057] This avoids duplicate node processing multiple packets, the node saves energy, but also reduces the amount of redundant data link.

[0058] 本发明提供的一种在树形网络中避免路由环路的方法包括: [0058] A present invention is provided to prevent routing loops in the tree network method comprising:

[0059] 源节点广播RREQ报文,收到该RREQ报文的节点查询所述分支拓扑序列信息; [0059] The source node broadcasts a RREQ message, the RREQ message is received query the branch node topology information sequence;

[0060] 判断源节点是否为所述收到该RREQ报文的节点的祖先节点; [0060] The source node determines whether an ancestor node of the received RREQ message to the node;

[0061] 如果否,则所述收到该RREQ报文的节点响应该RREQ报文; [0061] If not, then the node receiving the RREQ message in response to the RREQ message;

[0062] 如果是,则所述收到该RREQ报文的节点不响应该RREQ报文。 [0062] If so, the node receiving the RREQ message does not respond to the RREQ message.

[0063] 进一步地,所述响应该RREQ报文包括以下子步骤: [0063] Further, the response to the RREQ message includes the substeps of:

[0064] 所述收到该RREQ报文的节点查询路由表是否有到目的节点的有效路由,如果有,贝IJ回复RREP报文;如果无,则转发该RREQ报文,并重复本步骤。 [0064] The receiving the RREQ packet node routing table whether there is a valid route to the destination node, if any, shellfish IJ reply RREP packets; if no, the RREQ message is forwarded and repeat step.

[0065] 本发明的技术方案采用了创建分支拓扑序列信息来记录网络树形拓扑关系,在链路出错需重新建立路由时,可以根据分支拓扑序列信息分析出接收RREQ报文的节点与RREQ源节点之间的拓扑层次关系,并对其拥有的路由中依然会经过RREQ源节点的接收节点做出判断,然后令这样的接收节点不回复RREP报文,因此避免了源节点建立的路由具有路由环路的风险,减少了链路中的传输数据量,也节省了节点的能量。 [0065] aspect of the present invention uses the creation of a branch sequence information recording topology tree topology network, when the link is re-established route for an error, can analyze the received RREQ message to the RREQ source based on the branch node topology information sequence topological hierarchical relationships between nodes, and its route will still be owned by the node after receiving RREQ source node to make judgments, and then make such a receiving node does not reply RREP packets, thus avoiding the route to the source node has established route risk loop, the amount of data transmission link, but also saves energy nodes.

附图说明 BRIEF DESCRIPTION

[0066] 下面将参照附图并结合实施例对本发明进行具体说明。 [0066] The following embodiments in conjunction with the present invention will be specifically described with reference to the accompanying drawings.

[0067] 图1为无线传感器网络的工作示意图; [0067] FIG. 1 is a working diagram of a wireless sensor network;

[0068] 图2为本发明优选实施例的网络结构示意图; [0068] Fig 2 a schematic view of a preferred embodiment of the network structure of the embodiment of the present invention;

[0069] 图3为本发明创建分支拓扑序列信息的基本方法流程图; [0069] The method of Figure 3 to create the basic sequence information flowchart branch topology of the present invention;

[0070] 图4为本发明步骤SI的具体实施方式流程图; Step [0070] FIG. 4 SI specific embodiment of the present invention flowchart;

[0071] 图5为本发明步骤S3的具体实施方式流程图; Step [0071] FIG. 5 of the present invention DETAILED DESCRIPTION S3 of the flowchart;

[0072] 图6为本发明在树形网络中避免路由环路的方法流程图。 [0072] FIG 6 is a flowchart of a method to avoid routing loops in the tree networks of the present invention.

[0073] 其中,图2中的实线表示网络拓扑结构,箭头表示数据汇聚的方向。 [0073] wherein the solid line in FIG. 2 shows a network topology, arrows indicate the direction of data aggregation.

具体实施方式 detailed description

[0074] 本发明将网络以树形结构进行拓扑层次分配,将汇聚节点(sink节点)作为根节点,并将距离汇聚节点一跳的节点为根节点的子节点即根节点的下一层次节点;每个节点所引出的各分支都是该节点的子树,比如根节点的各个子节点分别引领各自的子树,距离根节点两跳及两跳以上的节点分别属于各个所述根节点的子节点的子树节点;上一跳节点是下一跳节点的父节点,一个节点的父节点及父节点以上层次的节点是该节点的祖先节点。 [0074] The present invention is a network topology in a tree structure for distribution level, the aggregation node (sink node) as the root node, sink node and hop from the node to the next level of the child nodes of the root node of the root node ; each branch are drawn by each node of the sub-tree nodes, such as child nodes of the root, respectively, each respective sub-tree leading from the root node and two or more two-hop hop node belonging to each of the root subtree of child nodes; hop node is the parent node of a next hop node, the parent node of the parent node level and above a node is an ancestor node of this node. 通过这样的树形网络可以将节点之间传输数据的方式基于树形拓扑结构之中,为进一步描述拓扑层次关系提供了网络结构依据。 By this way a tree network data transmission between the nodes may be based in the tree topology, the network provides a basis for further description of the topology structure of the hierarchy.

[0075] 通过向节点分配唯一的拓扑序号,再通过所述拓扑序号记录树形网络中节点之间的拓扑关系,从而形成分支拓扑序列信息。 [0075] by assigning a unique number to the topological node, re-recording a tree topology between nodes in the network topology by the number, sequence information to form a branch topology. 当路由出错时,需要重建路由的源节点重新广播RREQ报文,收到RREQ报文的节点查询所述分支拓扑序列信息来比较自己与所述源节点之间的拓扑层次关系,从而确定处理所述RREQ报文的方式,这样就避免了不分辨拓扑关系而回复路由造成路由环路的风险。 When the routing error, need to rebuild routing the source node rebroadcasts the RREQ message, the RREQ message is received query node to compare the information of topological branch topology and their hierarchical relationships between said source node, to determine treatment said RREQ packet mode, thus avoiding the reply does not distinguish between topology and routing the risk of routing loops. 下面参照附图并借助本发明的实施例,对本发明的技术方案做详细描述。 By means of the following embodiments of the present invention, a detailed description of the technical solution of the present invention with reference to the accompanying drawings.

[0076] 在本发明中对路由建立过程所使用的RREQ报文、RREP报文进行了格式的改进。 [0076] In the present invention, to establish the routing process used in the packet RREQ, RREP packet format improved.

[0077] RREQ报文增加了EN字段和RREQ序号字段,所述EN字段是由RREQ报文中的5位保留字段中启用了I位而得来,标识RREQ源节点是否拥有拓扑序号,报文中RREQ序号字段用于存储RREQ报文的源节点的拓扑序号。 [0077] increases the RREQ packet RREQ EN field and a sequence number field, the field is activated by EN RREQ packets 5 bit reserved field in I obtained, the source node identifies whether it has the topology RREQ ID, the message RREQ ID field is used in the topology of the source node number storage RREQ packets. 本发明中RREQ报文格式如下: The present invention RREQ message format is as follows:

Figure CN102185749BD00091

[0079] RREQ报文格式 [0079] RREQ message format

[0080] 具体地,类型为000,表示RREQ报文;EN为O则表示RREQ源节点无拓扑序号,为I表示RREQ源节点有拓扑序号;跳数,表示RREQ源节点到当前节点的跳数;源地址,即RREQ源节点的64比特IPv6地址接口标识符;目的地址,接收RREQ节点的64比特IPv6地址接口标识符;路由请求ID,标识RREQ报文的唯一性ID ;最小LQI,从RREQ源节点到当前节点链路质量的最小值;RREQ序号存储RREQ源节点的拓扑序号。 [0080] In particular, type 000, showing RREQ packet; EN is O indicates RREQ source node no topology number as I represents RREQ source node topological number; hop count representing number of hops RREQ source node to the current node ; source address, an IPv6 address 64-bit interface identifier RREQ source node; destination address, the node receiving the RREQ 64-bit IPv6 address interface identifier; route request ID, which identifies the packet RREQ ID uniqueness; the LQI smallest, from the RREQ minimum link quality to the source node of the current node; RREQ ID number storage topology RREQ source node.

[0081] RREP报文增加了CN字段和分配拓扑序号字段,所述CN字段由RREP报文中的5位保留字段中启用了2位而得来,标识是否有权限分配拓扑序号以及是否有分配能力;分配拓扑序号字段用于存储分配给RREP目的节点即RREQ源节点的拓扑序号。 [0081] CN RREP packets increases topology assigned sequence number field and a field, the field is enabled by the CN RREP packets in the reserved field 5 is obtained by two, has permission assigned identification number and whether the distribution topology capacity; topology assigned number assigned to a field for storing topology i.e. RREP ID RREQ destination node the source node. RREP的报文格式如下: RREP packet format is as follows:

Figure CN102185749BD00101

[0083] RREP报文格式 [0083] RREP message format

[0084] 具体地,类型为001,表示RREP报文;CN,第一位表示RREP源节点是否有权限分配序号,O表示无权限,I表示有权限,第二位标识分配拓扑序号字段是否有效,也同时标识该RREP源节点是否有分配能力,O表示分配拓扑序号字段无效即该RREP源节点无分配能力,I表示分配拓扑序号字段有效即该RREP源节点有分配能力;跳数,表示RREP报文从RREP源节点到当前节点的跳数;源地址,RREP源节点即RREQ目的节点的64比特IPv6地址接口标识符;目的地址,接收RREP节点即RREQ源节点的64比特IPv6地址接口标识符;最小LQI,从RREP源节点到当前节点链路质量的最小值;分配拓扑序号,表示RREP源节点分配给RREP目的节点即RREQ源节点的拓扑序号。 [0084] In particular, type 001, showing RREP packet; the CN, the first bit indicates whether the RREP the source node has permission to assign a sequence number, O for no authority, I represents has permission, a second bit allocation identification number field is valid topology , also identify whether the RREP the source node has a distribution capacity, O for invalid assignment topology number field that is, the RREP the source node without distribution capacity, I represents distribution topology sequence number field is valid i.e. the RREP the source node has allocated capacity; hop count, expressed RREP 64-bit IPv6 address of the destination address interface identifier, i.e. a node receiving RREQ RREP the source node; RREP packets hop from the source node to the current node; source address, i.e. the source node RREP 64-bit IPv6 address interface identifier RREQ destination node ; the LQI minimum, the minimum value from the RREP the source node to the current node link quality; number distribution topology showing distribution RREP the source node to the destination node topology i.e. RREQ ID RREP the source node.

[0085] 在本发明中,将树形网络的所有节点划分为一级节点、二级节点和三级节点这三个等级,所述一级节点为所述树形网络的根节点;所述二级节点为所述一级节点的子节点,具有由所述一级节点分配的唯一拓扑序号;所述三级节点为所述一级节点或所述二级节点的子树节点,每个三级节点具有由所述一级节点或所述二级节点分配的唯一拓扑序号,也就是,网络中除一级节点和二级节点外,其余的节点被划分为三级节点,包括一级节点的子节点中除二级节点之外的节点和二级节点的子树节点。 [0085] In the present invention, all nodes of the tree is divided into a network node, node two levels and three three nodes, the root node of the tree node is a network; the child node of the two nodes is a node, topology has a unique serial number assigned by said one node; the three sub-tree node is a node or the node of the two nodes, each three node topology has a unique serial number of the node or a node allocated to the two, i.e., in addition to a network node and a secondary node, the remaining nodes are divided into three nodes, including a child node of the tree node and two child nodes other than the two nodes.

[0086] 一级节点按照一定的方法确定第一多个二级节点,具体见下文步骤S12的说明。 [0086] determining a first node of a plurality of two nodes in accordance with certain methods, see description of step S12 below. 一级节点还具有向二级节点、三级节点分配拓扑序号的权限和分配拓扑序号的能力。 A topological node also has the ability to assign node numbers to two, three and distribution permissions node topology numbers. 二级节点具有向其子树节点分配拓扑序号的权限和分配第二多个拓扑序号的能力。 Two topological nodes having the ability to assign permissions to its subtree node number and a second plurality of assigned numbers topology.

[0087] 所述第一多个和第二多个与设置的拓扑序号的位数和分配规则有关。 [0087] of the first plurality and second plurality of bits and the number of allocation rule set topology related. 例如,设置拓扑序号由8位(I字节)的二进制数值表示;拓扑序号的分配规则是:该8位二进制的拓扑序号被分为三个部分,第7位、第6至4位和第3至O位。 For example, setting the topology represented by the number 8 (I byte) binary values; topology number allocation rule is: This 8-bit binary number is divided into three topologies, No. 7, 4 to 6 and O to 3 bits. 当一级节点给二级节点分配时,第7位为0,且第3至O位也为0,仅变化第6至4位的值的拓扑序号,因此在本实施例中,所述第一多个至多为7个;当一级节点给三级节点分配时,从第7位为1,第6至4位、第3至O位都为O开始;当二级节点给其子树节点分配时,保持第7位、第6至4位数值分别与二级节点的拓扑序号相同位的值一致,仅变化第3至O位的值,因此在本实施例中,所述第二多个至多为15个。 When a node to the secondary node allocation, bit 7 is 0 and the third bit is set to 0 to O, 4 to change only the topology of the sequence number value of 6, in the present embodiment, therefore, the first a plurality of up to 7; a node when the node is assigned to three, the bit 7 is 1, 4 to 6, to the O 3 start bits are O; when the two nodes to which the subtree when node allocation, bit holder 7, to the same four 6-bit value are the same as the topology of the node number two values, only the change in value of O to 3 bits, and therefore in the present embodiment, the second a plurality of up to 15.

[0088] 如图2所示,一级节点(sink节点)确定了其子节点中的节点A、B、C、D、E、F、G 7个节点为二级节点,分别向这7个二级节点分配以下拓扑序号:0 001 0000,0 010 0000、O 011 0000,0 100 0000,0 101 0000,0 110 0000,0 1110000(本说明书为了方便区分拓扑序号的三部分各自的变化而添加了空格,实际中拓扑序号各位之间无空格,以下同);对于一级节点的其他子节点如H节点被划分为三级节点,一级节点向其分配的拓扑序号从I000 0000开始;二级节点比如节点A向其子树节点分配的拓扑序号分别为:0 001 OOOUO [0088] As shown, a node (sink node) determines which child node of the node A, B, C, D, E, F, G 7 two nodes is node 2, respectively, to seven two topological nodes are assigned the following number: 0 001 0000,0 010 0000, O 011 0000,0 100 0000,0 101 0000,0 110 0000,0 1110000 (the specification for convenience to distinguish the respective three-part serial topology change is added spaces, practically no space between the number you topology, hereinafter the same); for other nodes as child nodes of a node H is divided into three nodes, a node number assigned thereto from I000 0000 start topology; two a node such as the node level assignment to a child node of the tree topology are number: 0 001 OOOUO

0010 010,0 001 OOlUO 001 0100、......、0 001 1110,0 001 1111,可见二级节点具有至多15个拓扑序号的分配能力。 0010 010,0 001 OOlUO 001 0100, ......, 0 001 1110,0 001 1111, found two topological nodes having up to 15 in number distribution capacity.

[0089] 分支拓扑序列信息是通过所述拓扑序号分别记录所述树形网络中根节点的各子树的拓扑关系。 [0089] Topology branch sequence information are recorded in the network topology tree of the root node of each sub-tree topology by the sequence number. 本发明中分支拓扑序列信息可以以树的存储方式表达,将节点的拓扑序号按照节点的拓扑层次排列,上下层次节点之间利用I字节的O即00000000分隔。 The present invention may be a branch of topological information storage expression tree, the topology of the node number of nodes arranged according to the hierarchical topology, i.e. use I O 00000000 bytes separation between the upper and lower level nodes.

[0090] 例如图2中一级节点的节点A子树的拓扑关系由分支拓扑序列信息记录,利用树的存储方式表达为: [0090] For example topological subtree of node A in FIG. 2 is recorded by a branch node topology information sequence, the expression of storage using a tree as:

[0091] 00010000 00000000 00010001 00010010 00000000 00010100 00010011(本说明书为了方便区分分支拓扑序列信息中各拓扑序号而添加了空格,实际中各拓扑序号之间无空格,以下同); [0091] 00010000 0,000,000,000,010,001 0,001,001,000,000,000 0,001,010,000,010,011 (in this specification for convenience to distinguish one branch topology topology number sequence information added a space, no space between the respective actual topology number, hereinafter the same);

[0092] 节点B子树的分支拓扑序列信息表达为: [0092] The expression of the branch sequence information topological subtree nodes B:

[0093] 00100000 00000000 00100001 ; [0093] 00100000 0,000,000,000,100,001;

[0094] 节点C子树的分支拓扑序列信息表达为: [0094] Expression of the branch sequence information topological subtree node C is:

[0095] 00110000 00000000 00110001 00000000 00110010 00000000 00110011 [0095] 00110000 0,000,000,000,110,001 0,000,000,000,110,010 0,000,000,000,110,011

[0096] 如图3,本发明还提供一种在树形网络中创建分支拓扑序列信息的方法,包括: [0096] FIG. 3, the present invention further provides a method of creating branches in the tree topology sequence information network, comprising:

[0097] 步骤S1、在初始建立路由阶段分配拓扑序号,也就是,所有无路由的节点需初始建立到汇聚节点的路由,本发明利用建立路由的过程进行拓扑序号的分配并通过分配拓扑序号生成当前的分支拓扑序列信息。 [0097] step S1, the initial establishment of the routing phase distribution topology number, i.e., all nodes that has no route for an initial establish a route to the sink node, the present invention utilizes the process of establishing a route to be allocated topology numbers and by allocating the topology number generated the current branch topology sequence information.

[0098] 步骤S2、一级节点的子节点向其子树节点多播所述分支拓扑序列信息。 [0098] Step S2, the child node to a child node of a multicast tree, the branch node topology information sequence. 将一级节点的子树当前的分支拓扑序列信息多播给该子树中的节点,这样每个子树节点在经过步骤S3后可以掌握所在根节点子树的整体拓扑结构以及自身与其他该根节点子树中的节点之间的拓扑层次关系。 The node of a subtree of the current topology of the branch sequence information to the multicast sub-tree node so that each node in the subtree after step S3 may be located to grasp the root of the subtree and the overall topology of the root itself and other sub-node topology hierarchical relationship between the nodes in the tree.

[0099] 步骤S3、所述子树节点存储所述分支拓扑序列信息。 [0099] Step S3, the sub-tree of the node stores the information of topological branch.

[0100] 步骤S4、判断是否还存在未获得拓扑序号的节点,如果网络中还存在未获得拓扑序号的节点,则进入步骤S5。 [0100] step S4, it is determined whether there is not obtained a node number of the topology, the network if there is not obtained a node number of the topology, the process proceeds to step S5.

[0101] 由于在初始建立路由阶段,从汇聚节点开始,依次由上一层次节点向其下一层次节点回复RREP报文从而逐步使每个节点都建立到汇聚节点的路由。 [0101] Since the route established in the initial stage, starting from the sink node, followed by a return to its previous level node RREP packet to the next level node so that each node gradually establish a route to the sink node. 但由于三级节点的分布情况不同,三级节点不一定都可以在建立路由阶段获得拓扑序号。 However, due to the different distribution of three nodes, three nodes do not always get the topology routing number in the establishment phase. 比如一级节点的子节点中除二级节点之外的节点,不具有分配拓扑序号的权限,这样的三级节点的子节点在建立路由时无法获得拓扑序号;比如二级节点只能分配第二多个拓扑序号的能力,对于超过该第二多个的二级节点的子节点在建立路由时也无法获得拓扑序号。 Such as a child node of the node other than the node of the two nodes, the topology does not have permission assigned numbers, three child nodes such nodes can not be obtained when establishing routing topology number; for example only two nodes Distribution a plurality of two numbers ability topology, for exceeding the child node of the second plurality of secondary nodes can not be obtained when establishing routing topology number. 而且如果网络中还具有更多向下层次的三级节点,也无法在其父节点向其建立路由时获得拓扑序号,因此,其中距离二级节点两跳或两跳以上的节点,都需要通过步骤S5获得拓扑序号。 And if the network also has three levels down more nodes, the topology can not be obtained when the parent node to its number to establish routes, wherein a node two hops from two or more two-hop nodes, are required by step S5 obtains the topology number. 如图2所示,节点M收到节点I给予的路由回复后建立路由,但是节点I没有分配序号的权限,因此节点M在路由建立结束后未获得拓扑序号。 As shown, node M is received after establishing a route node I 2 administration route reply, but I do not have permission assigned node number and the node number M is not obtained at the end of the topology routing establishment. 所以步骤Si中生成的分支拓扑序列信息只能记录已获得拓扑序号的节点之间的拓扑层次关系。 Topological hierarchical relationship between the nodes so that the step of generating Si branch topology has been obtained sequence information can be recorded only topology number.

[0102] 步骤S5、向所述未获得拓扑序号的节点补分配拓扑序号并更新分支拓扑序列信息,并返回步骤S3。 [0102] Step S5, the topology is not obtained to the node ID number and topology of distributive branch topology update information sequence, and returns to step S3. 本发明增加了拓扑序号交互报文,通过拓扑序号交互报文,节点可以请求拓扑序号或者向其它节点分配拓扑序号,并传递更新的分支拓扑序列信息。 The present invention increases the number of packets exchanged topology, the topology interactive message sequence number, the node can request the topology or serial number assigned to other topological nodes, and transmitting the updated information of topological branch. 拓扑序号交互报文的格式如下: No. interactive topology packet format is as follows:

[0103] [0103]

类型(3bit) SN (2bit) S/D (Ibit) 保留(3bit) 跳数(8bit) Type (3bit) SN (2bit) S / D (Ibit) number of reserved (3bit) hops (8bit)

序列长度 地址(64bit) 攸1漂1?姓 Sequence length address (64bit) floating Yau 1 1? Surname

节点序号 分支拓扑序列(长度可变) Topology branch node number sequence (variable length)

[0104] 拓扑序号交互报文格式 [0104] No. interactive topology message format

[0105] 其中,类型:011,表示分支拓扑序号交互报文;SN:00表示分支拓扑序号请求报文,01表示分支拓扑序号更新报文,10表示路由通告报文,11保留;S/D:表示本报文中的地址字段是源地址或目的地址,O表示源地址,I表示目的地址;跳数:表示分支拓扑序号交互报文从源节点到目的节点的最大跳数。 [0105] wherein, type: 011, represents a branch topology number interactive message; SN: 00 represents a branch topology sequence request packet, 01 denotes a branch topology number update message, 10 represents a route advertisement message 11 Reserved; S / D : address field indicates the newspaper article is the source or destination address, O for the source address, I represents the destination address; hops: indicates a branch topology interactive message sequence number maximum number of hops from the source node to the destination node. 序列长度:表示分支拓扑序列字段的长度,长度字段的数值为几就代表分支拓扑序列实际长度为几字节;地址:用于存储发出该报文的源节点的64比特IPv6地址接口标识符或接收该报文的目的节点的64比特IPv6地址接口标识符;分支拓扑序号交互报文ID:分支拓扑序号交互报文的唯一'I"生标识;节点序号:表不被分配的分支拓扑序号或者源节点的拓扑序号;分支拓扑序列:用于存储分支拓扑序列信息。 Sequence Length: indicates the length of the value, the length field of the branch field of topological several branch topology represents the actual length of the sequence of several bytes; URL: issuing source node for storing the packet of the 64-bit interface identifier or IPv6 address the destination node receives the packet of the 64-bit IPv6 address interface identifier; serial branch topology interactive message ID: No. spoke topology packets exchanged only 'I "green identifier; node ID: No. spoke topology table is not allocated, or the topology of the source node number; spoke topology sequence: a sequence information storage branch topology.

[0106] 其中跳数字段所设置的最大跳数可以帮助支路的节点判断是否需要继续转发该报文,也就是说,交互报文每经过一次转发跳数值就减1,当某节点收到该交互报文并将跳数减I后得O时,判断出自己就是网络树形拓扑层次的末端节点(即叶节点),这样该节点不需要再试图向前转发该报文,而直接停止转发,从而节约了节点的能量。 [0106] The largest number of hops hop count field set to help determine whether a branch node needs to continue to forward the message, that is, to exchange packets with each one hop hop value is decreased by 1, when a node receives when O was after the exchange packets and reduce the number of hops I, is to determine their own level of tree topology network end nodes (ie, a leaf node), so that the node does not need to try to forward the packet forwarding, and stopped directly forwarding node thereby saving energy. 跳数字段的值可以根据网络的大小预先设定,也可以根据路由表中存储的跳数设定。 The value of the hop count field may be set in advance according to the size of the network may be set according to the number of hops stored in the routing table.

[0107] 当然,步骤S2也可以后于步骤S4、S5进行,即先判断是否存在未获得拓扑序号的节点,存在未获得拓扑序号的节点时先补分配拓扑序号并更新分支拓扑序列信息后,再执行步骤S2进行当前分支拓扑序列信息的多播。 [0107] Of course, after the step S2 may be steps S4, S5, i.e. to determine whether there is not obtained a node number of the topology, the topology distributive first number there is not obtained a node number and topology update information of topological branch, then step S2 is the current multicast topology branch sequence information.

[0108] 进一步地,在步骤S2也可以利用多播分支拓扑序号更新报文的方式发送分支拓扑序列信息,比如图2中二级节点B启用分支拓扑序号交互报文,即类型字段置为011,并将SN字段置为01,表示分支拓扑序号更新报文;将生成的分支拓扑序列信息00100000 [0108] Further, at step S2 can also use the serial number of multicast packets spoke topology update the transmission branch of topological information, such as Node-B in FIG. 2 enable two branch topology interactive message sequence number, i.e., the type field is set to 011 and the SN field is set to 01, the topology represents a branch sequence number update message; branch topology generated sequence information 00100000

00000000 00100001存入分支拓扑序列字段,由于该分支拓扑序列信息为3字节,因此将代表3的二进制数值00000011存入序列长度字段;在S/D字段置0,表示地址字段为源地址;在地址字段存入该二级节点的64比特IPv6地址接口标识符;跳数置为1,这样在分支拓扑序号更新报文从二级节点B多播至其子节点时,跳数减I后得0,这样可以使二级节点B的子节点不再转发该报文。 0,000,000,000,100,001 spoke topology stored sequence field, since the branch topology information is 3 bytes sequence, thus representing the binary value of 000000113 are stored in sequence length fields; in S / D field is set to 0, indicating the address field as a source address; in stored in the node address field 64 of two bits of the IPv6 address interface identifier; hop count is set to 1, so that the serial number obtained in the spoke topology update message multicast from the node B to the two child nodes, number of hops Save I 0 so that the two child nodes of the node B does not forward the packet. 在本实施例中,节点B的子节点仅有节点K,因此节点B将携带分支拓扑序列信息00100000 00000000 00100001的分支拓扑序号更新报文发送给节点K。 In the present embodiment, only a subset of nodes in the node B K, the node B will carry the information of topological branch No. 00100000 0,000,000,000,100,001 spoke topology update message sent to node K.

[0109] 如图4所示,步骤SI在初始建立路由阶段分配拓扑序号并生成分支拓扑序列信息还包括以下子步骤: [0109] As shown, the sub-steps in step SI an initial stage of establishing a route topology assigned sequence number and generating a branch topology information further comprises 4:

[0110] 步骤SI 1、节点发送RREQ报文,其中RREQ报文中的EN字段置0,RREQ序号字段也置0,表示RREQ源节点无拓扑序号,且RREQ序号字段没有存储拓扑序号。 [0110] Step SI 1, the node transmits RREQ packet, wherein the packet RREQ EN field to 0, RREQ ID field is also set to 0, indicating no topology RREQ source node number, and serial number field RREQ ID is not stored in the topology.

[0111] 步骤S12、一级节点向其子节点回复RREP报文并通过RREP报文分配拓扑序号。 [0111] step S12, a node to a child node and replies RREP packet RREP packets by sequence number assigned topology. 其中,一级节点可以按照回复所述RREP报文的顺序确定二级节点比如将前第一多个RREP报文的目的节点作为二级节点,但不限于这种方式,也可以通过人为指定方式或以及一级节点发送控制包方式等。 Wherein a node may determine the order of reply RREP message to the node two before such a plurality of destination nodes a first RREP message as a secondary node, but is not limited to this embodiment, targeting can also artificially or a node and a packet transmission control methods.

[0112] 优选地,如图2,拓扑序号用8位二进制数值表示,一级节点向前7个RREP报文的分配拓扑序号字段分别存入拓扑序号O 001 0000,0 010 0000,0 0110000,0 100 0000,0101 0000,0 110 0000,0 111 0000,并将RREP报文的CN字段的第一位和第二位置I,表示一级节点既有权限分配拓扑序号,又有分配能力,RREP报文中的分配拓扑序号字段的值有效。 [0112] Preferably, as shown in FIG 2, the topology represented by 8-bit binary number value, a node 7 forwards the RREP packets are stored in a sequence number field distribution topology topology No. O 001 0000,0 010 0000,0 0110000, 0100 110 0000,0101 0000,0 0000,0 1,110,000, the first RREP message and CN field and a second position I, a node represents a number of existing rights assignment topology, there distribution capacity, RREP Partition topology packet sequence number field is valid. 分别接收前7个RREP报文的节点A、B、C、D、E、F、G成为二级节点,建立到一级节点的路由并将接收到的RREP报文中携带的拓扑序号记录为自己的拓扑序号,如节点A的拓扑序号为O 001 0000,节点B的拓扑序号为O 010 0000,节点C的拓扑序号为O 011 0000。 7 before the receive RREP packet node A, B, C, D, E, F, G become the two nodes, a node to establish a route to the received RREP message carries the sequence number is recorded as the topology topology own number, serial number of the node a as the topology is O 001 0000, serial topology is node B O 010 0000, serial No. topological node C O 011 0000.

[0113] 一级节点继续给其他子节点如图2中的节点H回复RREP报文并通过该RREP报文携带拓扑序号,并从I 000 0000开始分配。 [0113] a child node continues to other nodes in the H 2 and replies RREP packets through the RREP packet sequence number carried in FIG topology, and assigned from I 000 0000. 节点H属于三级节点,不具有向其子树节点分配拓扑序号的权限。 Three nodes belonging to node H, the topology does not have permission number assigned to its sub-tree nodes.

[0114] 步骤S13、二级节点向其子节点回复RREP报文建立路由,将RREP报文中的CN字段的第一位置I,第二位置I,表示RREP源节点既具有分配权限,又具备分配能力,报文中分配拓扑序号字段的值有效,并将拓扑序号存入该RREP报文的分配拓扑序号字段。 [0114] Step S13, the two nodes to a child node route reply RREP message to establish the first position of the I CN RREP message fields, a second position I, represents both a RREP the source node to assign permissions, and comprising topology assigned sequence number field value of distribution capacity, the packet is valid, and stores the topology of the RREP packet sequence number assigned sequence number field topology.

[0115] 如图2,二级节点A向其两个子节点1、J分别回复RREP报文,回复给节点I的RREP报文的分配拓扑序号字段为O 001 0001,回复给节点J的RREP报文的分配拓扑序号字段为O 001 0010 ;二级节点B向其子节点K回复的RREP报文的分配拓扑序号字段为O 010 [0115] As shown in FIG 2, two nodes A to its two child nodes 1, J respectively reply RREP message to the node I to reply RREP packet is assigned a sequence number field topology O 001 0001, reply RREP message to the node J topological distribution text number field is O 001 0010; its two child nodes of the node B K reply RREP packet is assigned a sequence number field topology O 010

0001 ;二级节点C向其子节点L回复的RREP报文的分配拓扑序号字段为O 011 0001。 0001; its two child nodes of the node C L reply RREP packet is assigned a sequence number field topology O 011 0001.

[0116] 并且,二级节点根据其各子节点发来的RREQ报文所记录的跳数和路径生成该二级节点、该二级节点的各子节点之间的分支拓扑序列信息。 [0116] Further, the node generates two node two hops according to its sub-nodes and route incoming RREQ message recorded, the branch topology sequence information between two nodes of the child node.

[0117] 需要指出的是,由于每个二级节点具有第二多个拓扑序号的分配能力,如果某个二级节点的子节点超过该第二多个,那么这时该二级节点已不再具有分配能力,这时二级节点所回复的RREP报文的CN字段的第一位置1,而第二位置0,表示该二级节点具有分配权限,但已无分配能力,该RREP报文中分配拓扑序号字段中的值无效,因此除第二多个之外的该二级节点的子节点无法通过RREP报文获得拓扑序号。 [0117] It should be noted that, since each node has a second plurality of two topological distribution capacity numbers, if the two child nodes of a node exceeds the second plurality, then when the two nodes are not It has the ability to re-allocate, a first position at this time two nodes reply RREP packets CN field 1, and the second position 0 indicates that the node has two assign permissions, but has no distribution capacity, the RREP packet invalid value assigned sequence number field of the topology, and therefore the two child nodes of the second plurality of nodes other than the serial number can not be obtained by the topology RREP packets. 另外,如果某个二级节点的子节点不足第二多个,则该二级节点在向其子节点全部回复分配有拓扑序号的RREP报文后,依然具有分配能力。 Further, if the two child nodes of a plurality of nodes is less than a second, the two node after child nodes to return to its assigned number of RREP packet topology still has a dispensing capacity.

[0118] 步骤S14、获得路由的三级节点如果接收到了该三级节点的子节点发来的RREQ请求建立路由,则该三级节点继续向其子节点回复RREP报文建立路由,但三级节点不具有分配拓扑序号的权限,所以由三级节点回复的RREP报文中的CN字段第一位和第二位都置0,表示该三级节点既无分配权限也无分配能力。 [0118] step S14, if the routing node to obtain three sub-nodes of the receiving node three request RREQ sent by establishing a route, the node continues three established route reply RREP message to its child nodes, but three topological nodes do not have assigned numbers authority, it replies by three nodes of CN RREP message field of the first and second bits are set to 0, indicating that the three node assigned permissions neither nor distribution capacity. 并且,三级节点根据其各子节点发来的RREQ报文所记录的跳数和路径生成该三级节点及该三级节点的各子节点之间的分支拓扑序列信息。 Topology branch sequence information between the nodes and child, the node generates three nodes and three of the three hops and node according to its sub-nodes route incoming RREQ packets recorded. 至此完成网络的初始路由建立过程。 This completes the initial routing network setup process.

[0119] 如图5所示,步骤S4向所述未获得拓扑序号的节点补分配拓扑序号并更新分支拓扑序列信息还包括以下子步骤: [0119] As shown in FIG. 5, step S4 is allocated to the node topology is not obtained serial number and update the topology of the complement sequence spoke topology information further comprises the substeps of:

[0120] 步骤S51、所述未获得拓扑序号的节点发送分支拓扑序号请求报文; Node [0120] step S51, the topology of the serial number is not obtained in the transmission branch topology request packet sequence number;

[0121] 步骤S52、根据分支拓扑序号请求报文所经过的节点记录当前的分支拓扑序列信息; [0121] step S52, the topology according to the branch node number through which the packet request to record the current branch topology information sequence;

[0122] 步骤S53、接收所述分支拓扑序号请求报文的节点判断自己是否具有分配拓扑序号的权限,如果是则进入步骤S54,如果否则进入步骤S56 ; [0122] step S53, the received sequence number of the branch topology request message to determine if they have the authority node topology numbers assigned, if the process proceeds to step S54, if otherwise, step S56;

[0123] 步骤S54、所述接收所述分支拓扑序号请求报文的节点判断自己是否具有分配能力,如果是则进入步骤S55,如果否则进入步骤S56 ; [0123] step S54, the receiving node requesting the branch topology message sequence number to determine if they have the distribution capability, if the process proceeds to step S55, the process proceeds to step S56 if otherwise;

[0124] 步骤S55、所述接收所述分支拓扑序号请求报文的节点向其子树节点发送携带有拓扑序号和分支拓扑序列信息的分支拓扑序号更新报文,进入步骤S57 ; [0124] step S55, the sequence number of the topology of the branch receiving the request packet transmitting node to a child node tree topology carries a sequence number and spoke topology branch topology information update packet number, proceeds to step S57;

[0125] 步骤S56、所述接收所述分支拓扑序号请求报文的节点转发所述分支拓扑序号请求报文,返回步骤S52; [0125] step S56, the topology of the branch receiving the request packet sequence number of the branch node forwards the topology request packet sequence number, processing returns to step S52;

[0126] 步骤S57、所述未获得拓扑序号的节点获得所述拓扑序号。 [0126] step S57, the node number is not obtained in obtaining the topology topology number.

[0127] 例如,如图2所示,在路由建立过程中,由于节点N在路由建立中未被分配到拓扑序号。 [0127] For example, as shown in FIG. 2, the routing setup process, since the establishment of the node N in the routing number is not allocated to the topology. 因此节点N执行步骤S5,首先执行步骤S51、节点N发送分支拓扑序号请求报文,该拓扑序号请求报文格式中,类型字段为011,SN字段置00,S/D字段置0,即地址字段为源地址,在地址字段写源节点即节点N的地址,节点序号字段、分支拓扑序列字段、序号长度字段均置O。 Thus N step node S5, first performs step S51, the node N transmits spoke topology number request message, the topology sequence request packet format, the type field 011, SN field is set to 00, S / D field is set to 0, i.e., the address a source address field, a source node i.e. node N a write address in the address field, the node number field, branch topology sequence field, a length field are set number O. 该分支拓扑序号请求报文会经过节点J,在步骤S52中,该分支拓扑序号请求报文会记录当前的分支拓扑序列信息,比如当前的分支拓扑序列信息记录了节点A、1、J、的拓扑层次关系即00010000 00000000 00010001 00010010,并且记录节点N是节点J的下一层次节点。 The branch topology sequence request packets will go through node J, in step S52, the branch topology sequence request packets will record the current branch of topological information, such as the current branch of topological information recording node A, 1, J, the topology hierarchy i.e. 0,001,000,000,000,000 0,001,000,100,010,010, and recording the node N is a node J to the next level. 在步骤S53中,节点J判断出自己不具有分配权限,因此执行步骤S56将分支拓扑序号请求报文转发至节点A,节点A也执行步骤S52,记录当前的分支拓扑序列信息,比如当前的分支拓扑序列信息记录了节点A、1、J、M的拓扑层次关系即00010000 00000000 000100010001001000000000 00010100,并记录节点N所在的拓扑层次。 In step S53, the node J is determined that they do not have to assign permissions, so step S56 branch topology sequence request packets forwarded to the node A, the node A also performs step S52, the recording current branch of topological information, such as the current branch sequence topology information recording node a, 1, topological hierarchy J, M, i.e. 0,001,000,000,000,000 000100010001001000000000 00010100, and records the topology hierarchy node N is located. 节点A执行步骤S53,判断出自己具有分配权限,执行步骤S54,判断自己是否具有分配能力。 A node performing step S53, the assigned permissions determine their own having performed step S54, to determine if they have the distribution capability.

[0128] 如果节点A分配的拓扑序号数量未达到第二多个,则此时节点A仍具有分配拓扑序号的能力,节点A执行步骤S55,节点A要分配拓扑序号0001 0011给节点N,启动分支拓扑序号更新报文,类型字段置011,SN字段置01,将拓扑序号0001 0011存入节点序号字段,将分支拓扑序号请求报文所记录的分支拓扑序列信息结合节点N的拓扑序号更新分支拓扑序列信息为: [0128] If the number of the node A does not reach the assigned number of a second plurality of topology, at this time, still has the ability to assign node A number of topology, node A performs a step S55, the node A to be allocated to the node topology No. 00,010,011 N, start No. spoke topology update messages, type field set to 011, SN field is set to 01, the topology of the node number stored in the serial number 00010011 field, branch topology request packet sequence number of the recorded information of topological branch junction node N branch topology update sequence number sequence topology information:

[0129] 00010000 00000000 00010001 00010010 00000000 00010100 00010011,并存入分支拓扑序列字段,由于该分支拓扑序列信息为7字节,因此将代表7的二进制数值00000111存入序列长度字段;在S/D字段置I,表示地址字段为目的节点地址即节点N的地址;在地址字段存入节点N的64比特IPv6地址接口标识符;跳数置为2,节点A向其子树的所有节点多播发送该分支拓扑序号更新报文。 [0129] 00010000 0,000,000,000,010,001 0,001,001,000,000,000 0,001,010,000,010,011, and spoke topology stored sequence field, since the branch topology information of 7 bytes sequence, thus representing the binary value of 000001117 are stored in sequence length fields; S / D in the field to I, as destination node address field indicates the address that is the address of the node N; N is stored in the node address field of the 64-bit IPv6 address interface identifier; hop count is set to 2, the node a to all nodes in the subtree the multicast transmission No. spoke topology update message.

[0130] 如果节点A已经分配完第二多个拓扑序号,则此时节点A不具有分配能力,节点A执行步骤S56,继续向汇聚节点(sink节点)转发,sink节点经过步骤S53、S54的判断,具备分配权限和分配能力,因此由sink节点给节点N分配拓扑序号,并向节点A发送携带有拓扑序号和当前分支拓扑序列信息的分支拓扑序号更新报文,再由节点A向其子树的所有节点多播转发该分支拓扑序号更新报文。 [0130] If node A has finished allocation of the second plurality of serial topology, node A at this time does not have the capacity allocation, the node A performs step S56, the node continues to forward to the sink (sink node), sink node through steps S53, S54 of judgment, assign permissions, and have the ability to assign, thus the topology number assigned to the node N, and sends the serial number and topology carries current branch topology update packet number information of topological branch sink node by node a, then the node a to a child All nodes of the tree branch topology of the multicast forwarding number update message.

[0131] 步骤S57,节点N获得了拓扑序号00010011。 [0131] step S57, a node number N obtained 00010011 topology.

[0132] 步骤S5中,节点A的子树的所有节点包括节点N在内,通过分支拓扑序号更新报文获得了最新的分支拓扑序列信息。 [0132] In step S5, all nodes in the subtree of node A includes the node N included, through a branch topology update message ID of the latest branch topology obtained sequence information. 因此均将其存储并更新为自己的分支拓扑序列信息。 So they are stored and updated its own branch topology sequence information. 从而创建完毕节点A子树的分支拓扑序列信息。 A node is created so that the sub-branch of the tree topology sequence information.

[0133] 进一步地,分支拓扑更新报文可以定时发送,从而保证子树节点能够实时获得最新的分支拓扑序列信息。 [0133] Further, the branch topology update message may be regularly sent to ensure subtree branch node can obtain the latest information of topological real-time.

[0134] 进一步地,如果接收所述分支拓扑序号请求报文或所述分支拓扑序号更新报文的节点再次收到重复的分支拓扑序号请求报文,则直接丢弃。 [0134] Further, if the branch received topology request packet sequence number or the branch topology update the node ID of the received packet is repeated again spoke topology request packet sequence number is discarded. 由于发出分支拓扑序号交互报文时,可能会经过多条路径转发,因此接收该分支拓扑序号交互报文的节点可能会接收到多个重复的报文,为避免该节点重复处理同样的报文,该节点将再次收到的重复报文直接丢弃。 Due issued spoke topology interactive message sequence number may be forwarded through multiple paths, so that the receiving branch topology number of packets exchanged node may receive a plurality of duplicate packets, the node repeats the process in order to avoid the same packet the node will repeat again received packets discarded.

[0135] 本发明增加了分支拓扑序号交互报文入口表来判断接收到的分支拓扑序号交互报文是否重复,该入口表格式为: [0135] The present invention increases the number of packets exchanged spoke topology table entry to determine whether the received packet spoke topology whether repeated interaction number, the table entry format is:

Figure CN102185749BD00151

[0137] 分支拓扑序号交互报文入口表 [0137] Reference interaction spoke topology packet entry table

[0138] 具体地,分支拓扑序号报文源地址:发起分支拓扑序号交互报文节点的64比特IPv6地址接口标识符;分支拓扑序号交互报文ID:用于存储分支拓扑序号交互报文中的分支拓扑序号交互报文ID字段的值;生存时间:该入口表项的生存时间。 [0138] Specifically, the branch source address of the packet sequence number topology: initiating 64-bit interface identifier spoke topology IPv6 address to exchange packets node ID; ID spoke topology interactive message ID: No. interaction spoke topology for storing packets No. interaction spoke topology packet ID field value of the message; survival: survival time of the entry table entry.

[0139] 将节点第一次收到分支拓扑序号交互报文,它会把该报文的源地址和分支拓扑序号交互报文ID分别存入入口表中分支拓扑序号报文源地址字段和分支拓扑序号交互报文ID字段,当该节点再次收到一个分支拓扑序号交互报文时,会将这个报文的源地址和ID分别与所述入口表中已存储的源地址和ID进行比较,如果二者的源地址和ID分别一样,那么该节点不会再次处理这个报文,而是直接丢弃。 [0139] The branch nodes receive the topology interactive message sequence number, it will packet source address and branch topology interactive message ID number are stored in the topology branch table entry packet sequence number and the branch source address field topological source address and ID number interactive message ID field, when the branch node receives a topology interactive message sequence number again, this will be the source address and the packet ID of the entry table are stored are compared, If both the source address and ID are the same, then the node will not re-process the packet, but discarded.

[0140] 当网络运行稳定后,如果有新节点加入该网络,重复上述步骤SI至S5,但是,由于网络的不断变化,该新节点的邻居节点所维护的路由表中如果不存在有效路由,那么该新节点的RREQ报文需要经过多跳才能获得RREP报文的回复,在本发明中,为了保持与初始建立路由时的一致性,设计距离二级节点两跳以上的节点只能通过步骤S5的分支拓扑序号请求和更新报文获得拓扑序号,而不能通过二级节点回复RREP报文来获得拓扑序号,即使该二级节点还具有分配能力。 [0140] When the network is stable, if a new node joins the network, repeating the above steps SI to S5, however, due to the changing network, neighbor nodes of the new node is maintained in the routing table, if there is no valid route, so RREQ message to the new node needs to get through multiple hops RREP message reply, in the present invention, in order to maintain consistency with the initial establishment of the route, from the design of more than two nodes of two-hop node can only step S5 branch topology sequence request and obtains the topology update message sequence number, not by two reply RREP message to the node obtains the topology number, even if the two nodes further has a dispensing capacity. 具体地,如果为该新节点回复RREP报文的节点恰好是还具有分配能力的二级节点时,二级节点通过判断接收到的RREQ的跳数值是否大于I来决定回复的RREP报文是否携带要分配的拓扑序号,如果跳数值大于1,则二级节点将要回复的RREP报文中的CN字段第一位置1,而将第二位置0,从而把分配拓扑序号的过程放在后续的步骤S5执行。 Specifically, whether, if the reply RREP message for the new node is a node further having exactly two nodes assigned capacity, the received hop count by two node determines RREQ is greater than I to determine the reply RREP message carries serial number to be assigned topology, if the hop count is greater than 1, the secondary node will reply RREP message to the CN field in a first position 1, while the second position 0, so that the process of assigning numbers topology in a subsequent step S5 execution.

[0141] 在经过上述创建分支拓扑序列信息的过程,网络进入数据通信过程,在通信过程中,若有节点例如图2中的节点O发送数据包未收到回复,则说明节点O到汇聚节点的链路出错,需要该节点重新广播RREQ报文,重新建立路由。 [0141] In the process branches through the topology information of the created sequence, a data communications network entry process, the communication process, for example, if the node in FIG 2 O node transmits a packet reply is not received, then the node to the sink node O the link error, the node needs to rebroadcast RREQ message, re-established routes.

[0142] 为了避免路由环路,本发明还提供一种在树形网络中避免路由环路的方法,如图6所示,包括: [0142] In order to avoid routing loops, the present invention also provides a way to avoid routing loops in the tree in the network, as shown in FIG 6, comprising:

[0143] S601、源节点广播RREQ报文,收到该RREQ报文的节点查询所述分支拓扑序列信息; [0143] S601, the source node broadcasts a RREQ message, the branch topology receives the query sequence information of the RREQ message nodes;

[0144] 例如,节点O发送RREQ报文并附带了源节点O所拥有的拓扑序号00110010,并且将RREQ报文中的EN字段置I,表示该源节点O具有拓扑序号。 [0144] For example, O node transmits RREQ message and attaches the source node topology No. 00110010 owned by O, and the RREQ packet field set in EN I, O indicates that the source node has a topological number. 接收到RREQ报文的节点L、P各自查询自己所存储的分支拓扑序列信息,即节点C子树的分支拓扑序列信息: Receiving the RREQ message node L, P are each query sequence spoke topology information stored in its own, i.e., node C subtree branch topology information sequence:

[0145] 00110000 00000000 00110001 00000000 00110010 00000000 00110011。 [0145] 00110000 0,000,000,000,110,001 0,000,000,000,110,010 0,000,000,000,110,011.

[0146] S602、比对源节点拓扑序号和接收到RREQ报文的节点自身的拓扑序号在分支拓扑序列信息中的拓扑层次关系,判断源节点是否为所述收到该RREQ报文的节点的祖先节点。 [0146] S602, the source node topology than the number of the received RREQ message and the own node number topology hierarchy branch topology of topological information, the source node determines whether the node received the RREQ message is ancestor node.

[0147] S603、如果否,则所述收到该RREQ报文的节点响应该RREQ报文,该收到RREQ报文的节点查询路由表是否有到目的节点即汇聚节点的有效路由,若有有效路由,则直接回复RREP报文。 [0147] S603, if not, the received RREQ message to the node responds to the RREQ message, the node receives the RREQ packet routing table if there is a valid route to the destination node to the sink node i.e., if effective routing directly replies RREP message. 若无有效路由,则进一步向其父节点转发,并查询当前接收RREQ报文的节点路由表的有无有效路由,直到具有有效路由的节点回复RREP报文。 If there is no valid route, the further forward to its parent node, and queries whether the current effective routing node receives RREQ packet routing table until the node has a valid route reply RREP message.

[0148] 例如图2中,在节点L的拓扑序号0011 0001处于节点O的拓扑序号00110010的上一层次,因此节点O不是节点L的祖先节点,因此节点L在其路由表具有有效路由时,向节点O回复RREP报文建立路由,在不具有有效路由时,向更上一层次节点C转发,直到有节点回复RREP报文。 [0148] For example in FIG. 2, the node L topology No. 00110001 at node O topology the serial number on a level 00110010 and the node O is not the node L ancestor node, when L has a valid route in its routing table the node, reply to node O RREP message to establish route, when not having a valid route to on a more level node C forwards until the node reply RREP message.

[0149] 根据RREQ报文的EN字段值为1,该RREP报文只用来建立路由而不需要分配拓扑序号,因此,即使回复RREP报文的节点是具有分配拓扑序号权限和能力的二级节点甚至一级节点,该RREP报文中的CN字段第一位置1,第二位置O。 [0149] The RREQ packet field values ​​EN, the RREP message only to establish the routing topology without the need to assign the serial number, and therefore, even if the reply RREP message topological nodes having assigned serial number and capacity of two permissions even a node node, the RREP message field in a first position of CN 1, a second position O. 从而避免了RREQ源节点在收到RREP报文时再解析该报文分配拓扑序号字段,从而节省了节点能量。 Thus avoiding the RREQ source node re-analyzing the packet sequence number field distribution topology when receiving RREP message, the node thereby saving energy.

[0150] S604、如果是,则所述收到该RREQ报文的节点不响应该RREQ报文。 [0150] S604, if so, the received RREQ message to the node does not respond to the RREQ message.

[0151] 例如节点P的拓扑序号0011 0011处于节点O的拓扑序号0011 0010的下一层次,节点O是节点P的祖先节点,因此节点P不查询路由表,不予回复RREP报文。 Topology Serial [0151] P topology such as node number in the node O 00110011 00110010 next level, the node O is the ancestor of the node P, the node routing table is not P, not reply RREP message. 在本发明中,节点P继续转发该RREQ报文,由于节点O是节点P的下一跳节点,因此该RREQ报文被转发回节点0,节点O收到该RREQ报文会发现此报文源于自己,因此将此RREQ报文丢弃。 In the present invention, the node P continues to forward the RREQ packet, since the node O is the next hop node P, so that the RREQ message is forwarded back to node 0, node O receives the RREQ packet will find the packet from ourselves, so this RREQ packets discarded. 从而避免了现有技术中节点P无法判断路由表中的路由依然是须经过节点O的路径而为节点O建立路由后出现的数据传输的路由环路问题。 Thereby avoiding the prior art P node routing loop can not be determined after the data transmission route in the routing table is still required to route through the nodes of the established route O O node problem.

[0152] 另外,分支拓扑序号交互报文还包括路由通告报文,即SN字段为10。 [0152] Further, the branch number topology interactive message further includes routing advertisement message, i.e., the SN field is 10. 路由通告报文主要用于拓扑序号失效时的通告,也就是,一个节点如果退出了网络,那么已经分配给它的拓扑序号需要通告失效,并且回收其拓扑序号以便重新分配给其他新加入网络的节点,此时就需要用到路由通告报文。 Mainly used for routing advertisement message notification if a number of topology failure, that is, if a node out of the network, so it has been assigned to the topological number required notice fail, and recover its topological numbers for re-allocated to other newly added network node, then you need to use the router advertisement message.

[0153] 应当理解,以上借助优选实施例对本发明的技术方案进行的详细说明是示意性的而非限制性的。 [0153] It should be understood that the foregoing detailed description is illustrative and not limiting examples of preferred embodiments of the aspect of the present invention by means of. 本领域的普通技术人员在阅读本发明说明书的基础上可以对各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。 Those of ordinary skill in the art upon reading the specification may be performed on the basis of the present invention, the technical solutions described in each of the modified embodiments, some technical features or equivalent replacements; such modifications or replacements do not cause the corresponding technical solutions departing from the essence of the present invention, various embodiments spirit and scope of the technical solutions. 本发明的保护范围仅由随附权利要求书限定。 The scope of the present invention is only defined by the appended claims.

Claims (9)

  1. 1.一种在树形网络系统中创建分支拓扑序列信息的方法,其特征在于, 所述树形网络系统包括一级节点,二级节点和三级节点, 所述一级节点为所述树形网络的根节点; 所述二级节点为所述一级节点的子节点,具有由所述一级节点分配的唯一拓扑序号;所述三级节点为所述一级节点或所述二级节点的子树节点,每个三级节点具有由所述一级节点或所述二级节点分配的唯一拓扑序号; 一个或多个分支拓扑序列信息,每个分支拓扑序列信息以所述根节点的一个子树中各节点的拓扑序号的组合记录该子树中各节点的拓扑关系; 创建分支拓扑序列信息的具体步骤包括: 步骤S1、在初始建立路由中分配拓扑序号并生成分支拓扑序列信息; 步骤S2、一级节点的子节点向其子树节点多播所述分支拓扑序列信息; 步骤S3、所述子树节点存储所述分支拓扑序列信息 1. A method of creating branches in the tree topology sequence information network system, characterized in that, the network system includes a node tree, two nodes and three nodes, the primary node of the tree shaped root network; the two child nodes of the node is a node, topology has a unique serial number assigned by said one node; the three node is a node of the said two or subtree of nodes, each node has three unique sequence number of the topology or a node allocated to the two nodes; one or more branch topology information sequences, each branch of the topology to the root node sequence information of topological number of each node is recorded topological relationship of the sub-tree of each node of a subtree; specific steps to create a branch topology sequence information comprising: a step S1, the assignment topology number in the initial set-up route and generates the branch topology sequence information ; step S2, a child node to a child node of the branch node multicast tree topology information sequence; step S3, the branches of the sub-tree stores the information of topological nodes 步骤S4、判断是否还存在未获得拓扑序号的节点,如果存在,进入步骤S5,如果不存在,则结束; 步骤S5、向所述未获得拓扑序号的节点分配拓扑序号并更新分支拓扑序列信息,并返回步骤S3。 Step S4, it is determined whether there is not obtained a node number of the topology, if present, enters step S5, and if not, the ends; step S5, the topology is not obtained to the number of distribution nodes and updating the topology branch number of topological information, and returns to step S3.
  2. 2.根据权利要求1所述的一种在树形网络系统中创建分支拓扑序列信息的方法,其特征在于,步骤SI包括以下子步骤: 步骤SI 1、节点发送RREQ报文; 步骤S12、一级节点向其子节点回复RREP报文并分配拓扑序号; 步骤S13、二级节点向该二级节点的子节点回复RREP报文并分配拓扑序号,生成分支拓扑序列信息; 步骤S14、三级节点向其子节点回复RREP报文,完成初始建立路由。 1 2. A method according to one of the branch sequence information created in the topology tree network system as claimed in claim, wherein the step comprises the sub-steps SI: SI Step 1, the node transmits RREQ packet; step S12, a stage node to a child node and replies RREP packet number assignment topology; step S13, the two child nodes of the node to the secondary node and replies RREP packet number assignment topologies, branch topologies generate sequence information; step S14, three nodes its child nodes reply RREP packet to complete the initial setup routing.
  3. 3.根据权利要求1所述的一种在树形网络系统中创建分支拓扑序列信息的方法,其特征在于,所述步骤S5包括以下子步骤: 步骤S51、所述未获得拓扑序号的节点发送分支拓扑序号请求报文; 步骤S52、分支拓扑序号请求报文所经过的节点记录当前的分支拓扑序列信息; 步骤S53、接收所述分支拓扑序号请求报文的节点判断自己是否具有分配拓扑序号的权限,如果是则进入步骤S54,如果否则进入步骤S56 ; 步骤S54、所述接收所述分支拓扑序号请求报文的节点判断自己是否具有分配拓扑序号的能力,如果是则进入步骤S55,如果否则进入步骤S56 ; 步骤S55、所述接收所述分支拓扑序号请求报文的节点向其子树节点发送携带有拓扑序号和分支拓扑序列信息的分支拓扑序号更新报文,进入步骤S57 ; 步骤S56、所述接收所述分支拓扑序号请求报文的节点转发所述分支拓 The method of one of the branches of the topology of a sequence information created in the tree-like network system as claimed in claim, wherein said step comprises the sub-steps S5: step S51, the topology is not obtained a node number of the transmitting No. spoke topology request packet; step S52, the branch node topology sequence request packet passes the current branch topology recording sequence information; step S53, the branch node receives the topology sequence request message to determine if they have a number of dispensing topology authority, if the process proceeds to step S54, if otherwise, proceeds to step S56; step S54, the receiving node requesting the branch topology message sequence number to determine if they have the ability to distribute topology numbers, if the process proceeds to step S55, the if else proceeds to step S56; step S55, the topology of the branch receiving the request packet sequence number of the node to a child node can transmit a topological tree and branch topology sequence number spoke topology information update packet sequence number, proceeds to step S57; step S56, the the branch receiving the topology request packet sequence number of the branch node forwards extension 序号请求报文,返回步骤S52 ; 步骤S57、所述未获得拓扑序号的节点获得所述拓扑序号。 Serial number request message, returns to step S52; step S57, the node number is not obtained in obtaining the topology topology number.
  4. 4.根据权利要求2所述的一种在树形网络系统中创建分支拓扑序列信息的方法,其特征在于, 所述RREQ报文包括EN字段和RREQ序号字段,所述EN字段标识RREQ源节点是否拥有拓扑序号,所述RREQ序号字段用于存储RREQ报文源节点的拓扑序号; 所述RREP报文包括CN字段和分配拓扑序号字段,所述CN字段标识是否有权限分配拓扑序号并且是否有分配能力;所述分配拓扑序号字段用于存储分配的拓扑序号。 4. A method according to one of the two branches of the topology tree sequence information created in the network system as claimed in claim, characterized in that the RREQ packet RREQ field includes a sequence number field and the EN, EN field identifies the source node RREQ if the number has a topology, the topology of the sequence number field RREQ RREQ packet number storage source node; RREP message includes the CN field and a sequence number field distribution topology, the CN field identifies whether a permission assignment number and topology if there distribution capacity; the distribution topology assigned sequence number field for storing the serial number of the topology.
  5. 5.根据权利要求3所述的一种在树形网络系统中创建分支拓扑序列信息的方法,其特征在于, 所述分支拓扑序号请求报文和所述分支拓扑序号更新报文包括拓扑序列字段,所述拓扑序列字段用于存储当前的分支拓扑序列信息; 所述分支拓扑序号更新报文还包括节点序号字段,该节点序号字段用于存储所述分配的拓扑序号。 5. A method according to one of the three branches of the topology tree sequence information created in the network system as claimed in claim, wherein said spoke topology request packet sequence number and the serial branch topology update message includes a sequence field topology the topology of a field for storing the current sequence of branch topology information sequence; sequence number of the branch topology update message further comprises a sequence number field topological node number, the node number field for storing the allocation.
  6. 6.根据权利要求5所述的一种在树形网络系统中创建分支拓扑序列信息的方法,其特征在于, 步骤S2也利用所述分支拓扑序号更新报文多播所述分支拓扑序列信息。 6. The method of claim 5, wherein the branch sequence information created in the topology tree network system, wherein the step S2 also use the serial branch topology update the multicast packet sequence information branch topology.
  7. 7.根据权利要求4所述的一种在树形网络系统中创建分支拓扑序列信息的方法,其特征在于, 如果接收所述分支拓扑序号请求报文或所述分支拓扑序号更新报文的节点再次收到重复的分支拓扑序号请求报文,则直接丢弃。 7. A method according to one of the 4 branches of the topology tree sequence information created in the network system, wherein, if the receiving node message sequence number spoke topology or serial number of the branch topology update request message claim branch topology repeated again received request packet sequence number is discarded.
  8. 8.一种在树形网络系统中避免路由环路的方法,其特征在于, 所述树形网络系统包括一级节点,二级节点和三级节点, 所述一级节点为所述树形网络的根节点; 所述二级节点为所述一级节点的子节点,具有由所述一级节点分配的唯一拓扑序号;所述三级节点为所述一级节点或所述二级节点的子树节点,每个三级节点具有由所述一级节点或所述二级节点分配的唯一拓扑序号; 一个或多个分支拓扑序列信息,每个分支拓扑序列信息以所述根节点的一个子树中各节点的拓扑序号的组合记录该子树中各节点的拓扑关系; 避免路由环路的具体步骤包括: 源节点广播RREQ报文,收到该RREQ报文的节点查询所述分支拓扑序列信息; 判断源节点是否为所述收到该RREQ报文的节点的祖先节点; 如果否,则所述收到该RREQ报文的节点响应该RREQ报文; 如果是,则所述收到 A avoid routing loops in the tree network system, characterized in that, the network system includes a node tree, two nodes and three nodes, one node of the tree is the the root node of the network; the two child nodes of the node is a node, topology has a unique serial number assigned by said one node; the three or the node is a node of the two nodes subtree nodes, each node having three unique number assigned by the topology of a node or two nodes; one or more branch topology information sequences, each branch of the topology information to the root node of the sequence a subcombination tree topology each node of the record numbers of the sub-tree topology each node; specific steps to avoid routing loops comprising: a source node broadcasts a RREQ message, the RREQ receives the query packet node branch topology information sequence; determining whether the source node to the ancestor node receives the RREQ message; if not, the receiving the RREQ message to the node in response RREQ message; if so, the received to RREQ报文的节点不响应该RREQ报文。 RREQ message to the node does not respond RREQ packet.
  9. 9.根据权利要求8所述的一种避免路由环路的方法,其特征在于,所述响应该RREQ报文包括以下子步骤: 所述收到该RREQ报文的节点查询路由表是否有到目的节点的有效路由,如果有,则回复RREP报文;如果无,则转发该RREQ报文,并重复本步骤。 According to claim 8, wherein one of the methods to avoid routing loops, wherein said response to the RREQ message includes the substeps of: receiving the RREQ message to the node routing table is queried whether there is to valid route to the destination node, if there is, then the reply RREP packet; if no, the RREQ message is forwarded and repeat step.
CN 201110151082 2011-06-07 2011-06-07 Method for avoiding routing loop by adopting tree topology relationship CN102185749B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201110151082 CN102185749B (en) 2011-06-07 2011-06-07 Method for avoiding routing loop by adopting tree topology relationship

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201110151082 CN102185749B (en) 2011-06-07 2011-06-07 Method for avoiding routing loop by adopting tree topology relationship

Publications (2)

Publication Number Publication Date
CN102185749A true CN102185749A (en) 2011-09-14
CN102185749B true CN102185749B (en) 2014-12-10

Family

ID=44571820

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201110151082 CN102185749B (en) 2011-06-07 2011-06-07 Method for avoiding routing loop by adopting tree topology relationship

Country Status (1)

Country Link
CN (1) CN102185749B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102420699B (en) * 2011-11-22 2014-08-20 京信通信系统(中国)有限公司 Equipment number distribution method of digital radio frequency remote system and system thereof
CN103023731B (en) * 2012-11-29 2016-01-13 深圳市迪威视讯股份有限公司 Cascaded Conference method and system
CN103401789A (en) * 2013-07-23 2013-11-20 杭州华三通信技术有限公司 Method and equipment for transmitting LSP (Link State Protocol Data Unit) messages
CN103414644B (en) * 2013-07-31 2016-12-07 华为技术有限公司 Issued by the entry controller and method
CN103596283A (en) * 2013-11-28 2014-02-19 无锡清华信息科学与技术国家实验室物联网技术中心 Conflict resolving method and system based on correlation sequence
CN104270466B (en) * 2014-10-22 2018-07-03 中国建设银行股份有限公司 Data reporting method and associated apparatus

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1934560A (en) * 2004-03-26 2007-03-21 城域信息包系统公司 Method of sending information through a tree and ring topology of a network system
CN101043444A (en) * 2007-04-26 2007-09-26 浙江大学 Distributed quality of service multicast routing process based on ant group optimization
CN101179466A (en) * 2007-10-15 2008-05-14 北京交通大学 Centralized service based distributed peer-to-peer network implementing method and system
CN101252479A (en) * 2008-04-01 2008-08-27 杭州华三通信技术有限公司 Loop detection method and switch

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100387018C (en) * 2005-04-12 2008-05-07 华为技术有限公司 Method for obtaining tree group network topological structure and address distributing method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1934560A (en) * 2004-03-26 2007-03-21 城域信息包系统公司 Method of sending information through a tree and ring topology of a network system
CN101043444A (en) * 2007-04-26 2007-09-26 浙江大学 Distributed quality of service multicast routing process based on ant group optimization
CN101179466A (en) * 2007-10-15 2008-05-14 北京交通大学 Centralized service based distributed peer-to-peer network implementing method and system
CN101252479A (en) * 2008-04-01 2008-08-27 杭州华三通信技术有限公司 Loop detection method and switch

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王利国 等.基于6LoWPAN的传感器网络动态路由协议研究.《重庆邮电学院学报(自然科学版)》.2006,第18卷(第6期),参见论文第2节. *

Also Published As

Publication number Publication date Type
CN102185749A (en) 2011-09-14 application

Similar Documents

Publication Publication Date Title
Youssef et al. Overlapping multihop clustering for wireless sensor networks
Pan et al. The orphan problem in zigbee wireless networks
US20130250809A1 (en) Region-based route discovery in reactive routing networks
Dawson-Haggerty et al. Hydro: A hybrid routing protocol for low-power and lossy networks
US20120320923A1 (en) Redirecting traffic via tunnels to discovered data aggregators
US20050036486A1 (en) Route discovery in ad-hoc networks with data packets
US20110228788A1 (en) Alternate down paths for directed acyclic graph (dag) routing
US20090296704A1 (en) Method for multi-path source routing in sensor network
US20070153707A1 (en) Ad hoc network formation and management based on aggregation of ad hoc nodes according to an aggregation hierarchy
US20120158933A1 (en) Data Reporting Using Reporting Groups in a Computer Network
CN101197748A (en) Multi-jump wireless self-organizing network construction method based on partition tree
CN101707763A (en) Method for achieving automatic configuration of IPv6 addresses for wireless sensor network
Pan et al. Address Assignment and Routing Schemes for ZigBee-Based Long-Thin Wireless Sensor Networks.
CN101588293A (en) Full IP communication interconnection system of Ad Hoc network and IPv6 network
CN101815287A (en) Wireless sensor network routing method and system based on tree network
CN101083624A (en) Tree structure based routing method
Chaudhuri et al. TreeCast: A stateless addressing and routing architecture for sensor networks
CN102223734A (en) Wireless communication network and communication method of same
Lee et al. Performance evaluation of table-driven and on-demand ad hoc routing protocols
Li et al. An improved ZigBee routing strategy for monitoring system
Clausen et al. Loadng: Towards aodv version 2
CN102158983A (en) Method for constructing 6LoWPAN wireless sensor network
CN101848459A (en) Wireless transducer network address configuration method based on IEEE 802.15.4
CN101707764A (en) Realization method of next generation all-IP wireless sensor network
Bhatia et al. A cluster based minimum battery cost AODV routing using multipath route for ZigBee

Legal Events

Date Code Title Description
C06 Publication
C10 Request of examination as to substance
C14 Granted