行政院國家科學委員會補助專題研究計畫
□ 成 果 報 告
■期中進度報告
ZigBee 無線樹狀感測網路之初始化及通訊問題研究
計畫類別:■ 個別型計畫 □ 整合型計畫
計畫編號:NSC 97-2221-E-009-142-MY3
執行期間: 2008 年 08 月 01 日 至 2009 年 07 月 31 日
計畫主持人:曾煜棋
共同主持人:
計畫參與人員:
成果報告類型(依經費核定清單規定繳交):■精簡報告 □完整報告
本成果報告包括以下應繳交之附件:
■赴國外出差或研習心得報告一份
□赴大陸地區出差或研習心得報告一份
□出席國際學術會議心得報告及發表之論文各一份
□國際合作研究計畫國外研究報告書一份
處理方式:除產學合作研究計畫、提升產業技術及人才培育研究計畫、
列管計畫及下列情形者外,得立即公開查詢
□涉及專利或其他智慧財產權,□一年□二年後可公開查詢
執行單位:國立交通大學資訊工程學系
中 華 民 國 98 年 06 月 27 日
中英文摘要
無線感測網路相關的研究議題得到許多研究單位及學者的關注,近年來ZigBee通訊協
定被視為最適用於感測網路的通訊協定,本計畫將研究以ZigBee 樹狀網路為基礎之無線感
測網路相關通訊協定,本計畫為三年之計畫,其目標主要包含三個面向:(1) ZigBee無線感
測網路生成之研究,(2) ZigBee樹狀網路資料傳遞排程,(3) ZigBee基礎之長鏈狀網路研究。
在第一年中,我們研究ZigBee感測網路的生成問題,在ZigBee規範中,一個節點加入到一
個網路的條件為:該節點能找到一個父節點能夠給予該節點一ZigBee 網路位址,父節點們
可利用ZigBee 所定義之分散式位址分配法來指定位址給子節點們,這一個位址指定方法相
當簡單但是卻限制了一個節點最多可容忍之子節點個數以及整體網路的深度,我們觀察到
如果使用ZigBee所定義之網路生成方式,會使得網路位址的使用率偏低,進而造成節點無
法連上網路,因此在本計畫中,我們提出適用於ZigBee之網路生成方法,使得網路上的節
點能夠自動組態並且形成一個可通訊之網路,並且提升網路位址使用率,降低網路中Orphan
的數目。
關鍵字:圖形理論、IEEE 802.15.4、網路形成、孤兒問題、無線感測器網路、ZigBee
Recently, a lot of research works have been dedicated to the wireless sensor networks (WSNs)
field. ZigBee is a communication standard which is considered to be suitable for WSNs. In this
project, we discuss initialization and communication protocols for ZigBee tree-based WSNs. This
project contains three research topics including 1) formation of a ZigBee-based WSN, 2)
scheduling for ZigBee tree-based networks considering data flows, and 3) ZigBee-based long thin
networks. In the first year, we discuss the ZigBee network formation problem. In ZigBee, a
device is said to join a network if it can obtain a network address from a parent device. Devices
calculate addresses for their child devices by a distributed address assignment scheme. This
assignment is easy to implement, but it restricts the number of children of a device and the depth
of the network. We observe that if one uses the random formation policy specified in ZigBee, the
utilization of the address pool may be very low. Those devices that cannot receive network
addresses will be isolated from the network and become orphan nodes. In this project, we propose
network formation strategies to relieve the orphan problem.
Keywords:
graph theory, IEEE 802.15.4, network formation, orphan problem, wireless sensor
network, ZigBee.
目錄
1. 前言 ………1
2. 背景知識 ………1
3. 研究目的 ………2
4. 研究方法 ………4
5. 結果與討論 ………8
6. 參考文獻 ……… 10
一、
前言
無線感測器網路 (wireless sensor network) 近年來被廣泛熱烈的討論,相關之研究議題
包含許多方面,舉 例來說,省電之 MAC 協定 [1][2]、感測器之佈建議題 [3][4]、感測器覆
蓋範圍 [5]、定位系統 [6] …等等。而在應用層面,國內外均有許多研究成果,舉 例來說,
動物棲息地之生態監控 [7],而 FirgBug 計畫 [8] 則是監控野外火災之發生,在 [9][10],
則是將無線感測器應用於導覽之方向。
近年來有相當多的無線感測網路平台被提出,例如:MICA [11]、Dust Network [12] 等,
然而為了在不同的系統平台間相互傳遞資料封包,一個共通的通訊協定是必要的。在眾多
無線接取協定中,ZigBee/IEEE 802.15.4 [13][14] 為一個專為無線感測網路所設計的通訊協
定。IEEE 802.15 工作群組 (Working Group) 的第四任務群組 (Task Group 4, IEEE 802.15.4)
訂定一「低資料速率—無線個人區域網路 (Low Rate-Wireless Personal Area Network;
LR-WPAN)」
。該工作群組於 2000 年 12 月被批准成立,並且於 2003 年 10 月正式被 IEEE
批准而成為整個 IEEE 802.15.4 的標準。而適用於短距低速 率傳輸應用的通訊協定堆疊之上
層部分,從網路層、應用程式界面 (Application Program Interface, API) 到應用層 (包含應
用計畫檔 (Profile)) 部分則由 ZigBee 聯盟訂定標準,ZigBee 聯盟和 IEEE 共同研究合作
將產生一個易於使用且標準化的無線網路平台,以適於無線監測和控制方面的應用。ZigBee
聯盟在 2006 年底公布第二版標準。下圖一為 ZigBee 與 IEEE 802.15.4 通訊協定堆疊之關
係圖。
圖一、ZigBee/IEEE 802.15.4 協定堆疊
二、
背景知識
ZigBee 網路層協定中規範了一分散式網路位址分配演算法用以分配網路位址給加入該
網路之裝置。當網路形成時,ZigBee 協調者先定義一 ZigBee 路由器最多可容許連線之裝置
個數(Cm)以及最多的子 ZigBee 路由器的數量(Rm),以及網路的深度(Lm)。ZigBee 規定
Cm≧Rm,因此一 ZigBee 路由器至少可供(Cm-Rm) ZigBee 終端設備連結上它。在此規範中,
PHY Layer
MAC Layer
Network & Security
Application Framework
Applications
802.15.4 ZigBee Specification Hardware ZigBee stack Application裝置的網路位址是由其父節點 (Parent router) 所給定的。對 ZigBee 協調者而言,整個網路
的位址空間被劃分成 Rm+1 塊,前 Rm 塊位址空間將會分配給其 Rm 個子路由器,而最後一
部份則保留給與之連線之(Cm-Rm)個 ZigBee 終端設備。在此演算法中,ZigBee 路由器利用
Cm、Rm 和 Lm 來計算一個稱為 Cskip 的參數,接著再利用 Cskip 來計算其子路由器以及終
端設備的網路位址,假定一路由器位於網路的第 d 層,Cskip 的數值可經由下式得到:
ZigBee 規範協調者位於深度 0,假設一路由器 x 位於深度 d 且一節點 y 為 x 的小孩,Cskip(d)
則代表以 y 為根(Root)之 subtree (包括 y 自己)的最多可容納節點個數。位址的分配是由
ZigBee 協調者開始以及,ZigBee 協調者會先將自己的位址指定為 0 以及深度指定為 0,假
設一個在深度 d 的父節點的位址已被指定為 Aparent,該父節點將指定他的第 n 個子路由器
的 位 址 為 Aparent+(n-1)×Cskip(d)+1 , 並 且 指 定 他 的 第 n 個 子 終 端 設 備 的 位 址 為
Aparent+Rm×Cskip(d)+n。圖二中展示了一個位址分配的範例,在這範例中 ZigBee 協調者設
定 Cm=5、Rm=3 以及 Lm=2,協調者的 Cskip 值可由上式得知為 6。因此協調者的第一個
到 第 三 個 子 路 由 器 的 位 址 將 分 別 被 指 定 為 0+(1-1)×6+1=1 、 0+(2-1)×6+1=7 及
0+(3-1)×6+1=13,而協調者的子終端設備的位址將別為 0+3×6+1=19。值得注意的是,在
ZigBee 中,最多的網路位址容量為 2
16=65536。
圖二、ZigBee 分散式位址分配範列
三、
研究目的
於 ZigBee 分散式位址分配演算法中,
由於Cm、Rm 及Lm 的限制可以簡化網路位址
分派的複雜度,但是這三個參數亦可能使得裝置無法加入此網路,即使還有父節點有剩餘
的位址空間,甚至一個小型網路也有可能使得有孤兒節點(Orphan node)出現。舉例來說,
−
⋅
−
−
+
⋅
−
−
=
+
=
− −(b)
Otherwise
,
1
1
(a)
1
if
),
1
(
1
)
(
1Rm
Rm
Cm
Rm
Cm
Rm
d
Lm
Cm
d
Cskip
Lm d在圖二中,一個裝置A 有兩個可提供他連接之父節點 B 及 C,但是在圖二中,Router B 不
能接受 A 因為它已經達到最大的容量(Cm=5),而 Router C 也不能接受A,因為他的深度
已經達到了最大深度(Lm=2)。由此我們可以得知裝置A 變成了一孤兒節點 (Orphan node)。
同時我們於 Jennic 平台上實作出 ZigBee 網路,使可進一步了解 Orphan 問題之嚴重
性。如圖三所示,我們於一 360 cm x 360cm 之地板上,佈建 49 個 Jennic 感測器,每個
感測節點天線傳輸功率為150 mW,於實測的過程中,我們不斷的改變(Rm, Lm)之數值,來
觀察其Orphan數量的變化。由表格一可以清楚的發現,不管(Rm, Lm)如何的變化,於ZigBee
形成的網路中,大約會存在有 30% ~ 70% 的Orphans,如表格一所示。而由此觀察也可發
現,雖然較大之 Lm 可減少孤兒數量,但卻會導至更大的傳輸延遲時間。
tree link associated nodes orphan nodes 0000 0446 0448 063D 0001 088B 0447 05C4 063C 0641 0642 088C 05B3 05C3 0643 05B4 05B5 06A6 0894062D 062E 06A7 06A8 0895
05B6 088E 0890 0892
062F 088D 088F 0891
圖三、於Jennic平台上,ZigBee網路形成之實作
(Rm, Lm)
Orphans
Orphan Ratio
Delay
(6, 2)
35
71.4%
0.360 s
(5, 3)
31.4
64.1%
0.447 s
(4, 4)
30
61.2%
0.597 s
(3, 5)
21.2
43.3%
0.681 s
(2. 6)
27.8
56.7%
0.8125 s
(3, 7)
17.2
35.1%
0.991 s
(2, 8)
20.8
42.4%
1.197 s
表格一、不同 (Rm, Lm) 之組合所造成之孤兒數及傳輸延遲時間
接著我們做了一個大型網路的實驗,如圖四所示,在這實驗中我們假設一個圓形網路,
且其範圍半徑為 200 公尺,在這網路中任意的散佈 800 個 Router-capable 節點,而這些節
點的傳輸半徑為 35 公尺,我們假設(Rm, Lm) = (4, 7), (3, 9), 以及(2, 15),且 Rm = Cm,網
路協調者被安排在網路的中心處,透過模擬我們得知如果使用 ZigBee 規範之網路生成方
法,因為 圖四(b) 之 Lm 為 9 而 圖四(a) 之 Lm 為 7,所以圖四(a) 會造成較多之 orphan
數,但在圖的邊緣處,仍然有大量的網路節點無法正常的連上網路。利過圖四(c) Lm = 15,
可以發覺其 orphan 數大大的降低了,然而,在相同的參數設定下,圖四(d)卻造成了大量
的網路節點形成孤兒,無法正常的連上網路,因此得知較大之 Lm 會造成較小之 Rm,因
而可能反而會造成更多的節點無法連上網路,所以,透過簡單的參數調整,並無法解法
ZigBee 網路中所存在的 orphan problem。
(a) (b)
(c) (d)
圖四、ZigBee 網路形成大型網路的實驗,其中 (Rm, Lm) 分別為 (a) (4, 7), (b) (3, 9),
及 (c-d) (2, 15)。
同時,我們發現,一個較佳的網路生成方式可以改進上述之孤兒問題,以圖二為例,
如果Router E變更連結至Router D,如此 Router B 變空出了一個空間可以給裝置 A 來連結
上。因此在此計畫研究內容中,我們將考 量Cm、Rm、及Lm之限制 ,並且提出適用於 ZigBee
網路之網路生成演算法來改進孤兒問題。
四、
研究方法
ZigBee 網路生成問題定義
給予一個 ZigBee 網路,裡頭包含許多具 Router 能力的裝置(Router-capable device)以
及許多終端節點(end device),基於認為 Router-capable 裝置的能力較佳以及成本較高,我
們將優先考慮讓 Router-capable 裝置可以連上網路,因此我們將 ZigBee 網路生成問題切割
為兩個子題。在第一個子題中,我們只考慮 Router-capable 裝置,並且將這些點表示為一
個圖 Gr=(Vr, Er),其中 Vr 為所有 Router-capable 裝置之集合,而 Er 為所有 Vr 中的無線
連線,在給定 Cm、Rm 及 Lm 的條件下,第一個子題的目標為建構一棵樹來連接在 Vr 中
的節點,並可以使得在 Vr 中所有的節點都能夠被連上所建構之樹上,而且該樹必須符合
ZigBee 對於樹狀結構廣度(Rm)及深度(Lm)之限制。
定義 給定一個圖 Gr = (Vr, Er), Rm, Lm 以及一個整個 N≦|Vr|,我們定義第一子題為:從
Gr 中建構一棵以協調者為根(Root)之樹T,此樹T 必須滿足 ZigBee 對於廣度及深度之限
制 (Bounded-Degree-and-Depth Tree (BDDTF))且此樹必須至少包含N 個節點。
由文獻 [9] 中,我們可以知道分支度受限之展延樹(Degree-Constrained Spanning Tree)
問題為一個困難之問題(NP-hard problem),而且定義如下:
定義 給定一個圖 Gc = (Vc, Ec), 以及一個正整數 Kc ≦|Vc|, 則分支度受限之展延樹問題
為能從 Gc 中找出一延展樹 Tc,使得在 Tc 中,沒有任一個 vertex 之分支度超過 Kc。
因此,本計畫定義了一個定理如下:
定理一 BDDTF 問題為一困難 (NP-Complete) 的問題。
接著我們定義第二子題,在第二子題中,我們將嘗試把所有終端設備連接到第一子題
中所建構之樹中的Router 上,第二子題的目標為盡量使得網路上的終端設備盡量可以找到
一個ZigBee 路由器來連接。為達到這一個目的,我們將這一個網路再次表示為一個圖
Gd=({V'r∪Ve}, Ed),其中V'r 代表連接上第一個子題中所建構出之樹 T 的Router 們,Ve
代表所有終端設備,Ed 則表示所有V'r 與Ve 間的連線,每個屬於V'r 的節點v 可以接受
Cv≧(Cm-Rm)個終端設備,接著使用下列步驟將Gd 轉換成一個雙分圖(bipartite graph)
Gb=({V'br∪Vbe}, Ebd):
1.
對於每個屬於 V'r 的節點v,產生Cv 個節點v1, v2, …, vCv 於V'br 中。
2.
對於每個屬於 Ve 的節點u,產生一個節點u 於Vbe 中。
3.
對於每個在 Ed 中的連線(v, u),其中v
∈V'r 且u∈Ve,連接所有在rule 1 所產生的Cv 節
點與在rule 2 中所產生的節點u,這些連線則形成Ebd 中的子集合。
在產生完 Gb 後,我們可以定義第二個子題如下
定義 給定一個圖 Gb,我們定義第二子題為:為找到中 Gb 最大的配對數(Maximum
matching)。
ZigBee 網路生成問題之解決方案
兩個子問題:分支度及深度受限之延展樹(bounded-degree-and-depth tree formation (BDDTF))
問題及終端設備最大的配對數(end-device maximum matching(EDMM))問題。而於此兩個問
題中,我們分別提出了集中式及分散式方法來降低 orphan 的數量。
BDDTF 集中式解決方案
對於第一個子題的解決方案概念為,我們先使用一個寬度優先的樹T1 來連結網路上的
節點,接著我們在以由上到下(top-down)的方式來拜訪這樹上所有的節點,並且給予他們一
個優先順序值(priority),在給定完priority 後,我們將樹T1 給解散掉,然後在一句每個節
點的優先順序重新建構一棵符合ZigBee 規範的樹T。給定Rm 及Lm,此方法的詳細步驟如
下。
一、
將網路中所有的 Router-capable 裝置使用一個BFS 樹T1 連接起來
二、
接著我們由 T1 的根由上到下地來拜訪所有在T1 上的節點,當拜訪到一個位於深
度d 的節點v,我們先計算節點v 的所有子孫節點個數,記錄為D(v),以及與v 為同一
層深度(d)與上一層深度(d-1)的鄰居節點個數,記錄為N(v),接著我們給定節點v 一個優
先順序值p(v)為
如果 D(v)不為零,則p(v)=N(v)/D(v)。
如果 D(v)等於零,則p(v)=N(v)
三、
解散 T1。
四、
接著我們以由上到下(top-down)之策略建構一個符合ZigBee 規範的樹T,其方式
為,每一個已經連接上T 之節點v,可來找尋其鄰居中尚未連上T 的節點們,並且將那
些節點依照其優先順序值由小到大來排序,節點v 接受至多排名Rm 小的節點們,並且
指定他們為其子節點,以及他們的深 度為v 的深度加一。這一個將節點連接上T 的動作
將持續的進行直到達到最大深度Lm 或沒有節點可以連上為止。
BDDTF 分散式解決方案
由於集中式之解決方案通常需要大量的封包交換,以致於收集到足夠之資訊,通常不
適用於無線感測器網路,因此,本計畫另設計一BDDTF分散式解決方案。本方法的精神為
先執行一深度搜尋(depth-first search)後,再執行一寬度搜尋(breadth-first like search)。而深
度搜尋之目的為建立出網路中最深、最長之骨幹(backbone),並期望這此骨幹會通過網路中
感測器密度最大之區域。接著再利用骨幹上之節點來執行寬度搜尋,來增進網路節點連接
上網路之機率。此方法的詳細步驟如下。
1. (depth probing) 首先,ZigBee網路中之根(coordinator)會 flooding 一個 Probe 封包於整
個網路中,並於 Probe 封包中記錄根之深度其為0,而每一個收到 Probe 封包之節點,
會不斷地記錄此節點至根之最短路離,也就是最小之深度為何,並且記住自己的父親節
點。
2. (probe response) 當執行完上述步驟後,每個節點會回報以自己為根之子樹之節點數量及
子樹高度給節點之父親節點,同時,節點於自己的子節點中,選出一有最大深度之節點
為 tallest_child。
3. (backbone formation) 當整個網路之根節點收到所有子節點所回報之封包後,根節點會選
擇出擁有最大高度之 Rm 個子節點為骨幹節點。因此,根節點會傳送 Backbone 封包
來建立出整個 ZigBee 網路的骨幹,而當根之子節點收到此封包後,便會開始邀請自己
的 tallest_child 加此骨幹,再藉由 tallest_child 進行進一步的邀請,完成骨幹的建立。
4. (BFS-like spanning) 當網路的骨幹形成後,網路之根節點便會開始廣播 beacon 封包來
開始進行 association 的過程,而每個骨幹的節點收到 beacon 後,只能利用 association
程序來加入自己的父親節點,來形成網路。而網路中其他節點在進行 association 程序
時,會告知自己的 association priority,而收到 association request 之節點便會依照此
priority 來邀請節點加入網路。
EDMM 集中式解決方案
如同本計畫用來定義 EDMM 問題之概念與方法,因此可知這是一個最大分配
(maximum matching)的問題,因此,我們可以利用 maximum matching 演算法 [9] 來降低
終端節點形成 orphan。而 maximum matching 演算法如下:
1.
首先,先利用貪婪式的方法,任意地尋找配對,也就是任意地將終端節點連至鄰居
Routers 中。
2.
利用深度搜尋法來找尋 alternating path,當找到 alternation path 後便可使多一個終端
節點連上此網路,不斷的利用深度搜尋法,直到無法再找到 alternating path 時,便可
找到 maximum matching。
EDMM 分散式解決方案
同樣地,因為集中式演算法不適用於無線感測器網路之中,因此,本研究另外提供了
一個分散式演算法,而本研究所提供之方法類似於集中式演算法,先利用一貪婪式程序
(greedy phase),再利用探索式程序(probing phase)來找出更多的終端節點來加入網路。而此
分散式配對演算法如下。
1.
(greedy phase) 每一個 routing 會定期的廣播信標(beacon)封包來告知終端節點其是否
仍可接受額外的子節點加入網路,因此每一個終端節點可記算出一 N 值來表示其有
多少鄰居路由節點可以加入。而若 N > 0,則此終端節點便會試著發起結合(association)
程序,而 Routers 簡單地接受擁有較小 N 值之終端節點加入。
2.
(probing phase) 於貪婪程序結束後,每一個終端節點會重新計算其 N 值並廣播之,而
每一個孤兒終端節點會發起一探索程序來減少孤兒數量,此程序如下。
I.
N = 0 之孤兒終端節點會傳送一探索(Probe)封包給其任一鄰居路由節點 r。
II. 當 r 收到探索封包時,若其存在一子終端節點 e’ 其 N ≧ 2,則 r 會轉送此探
索封包給此節點 e’。
III. 當 e’ 收到 r 之探索封包時,e’ 會試著結合上其他路由結點,若成功連上時,便
傳送一 Probe_Ack 封包給 r,反之,則傳送一 Probe_Nack 給 r。
IV. r 直接將 Probe_Ack 或 Probe_Nack 封包轉送給 e,而當 e 收到 Probe_Ack
時,便會連結上 r,反之,e 會尋找下一個鄰居節點,來發起探索程序。
五、
結果與討論
在本計畫中,探討 ZigBee 所設計之分散式位址分配演算法,
由於 Cm、Rm 及 Lm 的
限制可以簡化網路位址分派的複雜度,但是這三個參數亦可能使得裝置無法加入此網路,
即使還有父節點有剩餘的位址空間,而造成了孤兒問題 (orphan problem)。同時,針對此問
題,利用我們所提出的觀察,加上實測的結果,得知此問題並無法透過簡單的參數調整等
方法來解決 orphan 的情形。因此,我們將此問題重新定義,並依照路由節點及終端節點
兩種不同節點的特性,將此問題分成兩個子問題,分別為:分支度及深度受限之延展樹
(BDDTF) 問題及終端設備最大的配對數 (EDMM) 問題。同時,我們也證明了 BDDTF 為
一個複雜的問題 (NP-Complete),因為我們提供了一集中式的 BDDTF 演算法來降低孤兒
之數量,而因應無感感測器硬體限制,也提供了一分散式演算法。而針對 EDMM 問題,
本計畫證明了其為一最大分配 (maximum matching) 的問題,因此可以簡單的利用最大分配
演算法來得到最佳解,也就是使得終端節點成為孤兒的情形最小。同樣地,我們也提供了
一分散式的分配演算法,使得 ZigBee 網路可以利用較輕量 (lightweight) 的方式,使得網
路位址可以最有效的應用,降低節點形成孤兒的機會。
赴國外出差或研習心得報告一份
所參與之研討會為「
IEEE VTC 2009-Spring Conference」
,其出國之報告書如附錄一
本計畫目前的研究成果為二篇論文如下:
附錄二:
M.-S. Pan, C.-H. Tsai, and Y.-C. Tseng, "The Orphan Problem in ZigBee Wireless Networks",
IEEE Transactions on Mobile Computing, to appear. (SCI, EI).
附錄三:
M.-S. Pan and Y.-C. Tseng, “The Orphan Problem in ZigBee-based Wireless Sensor Networks”,
ACM/IEEE Int'l Symp. on Modeling, Analysis and Simulation of Wireless and Mobile Systems
(MSWiM), 2007.
計畫成果自評
第一年的主要工作目標有兩項:(1) ZigBee 網路生成之研究方法及問題定義,(2) 針
對所定義之問題提出適切的解決方案。而在本計畫中,針對 ZigBee 網路生成問題,根據
無線感測路由節點及終端節點不同之特性,將此生成問題分為 (1)滿足 ZigBee 對於廣度及
深度之限制 (Bounded-Degree-and-Depth Tree (BDDTF))樹,及 (2) 最大的配對數問題。同
時,我們提出了定理一來證明 BDDTF 為一個困難的問題,且證明了 EDMM 為一個最大
配對數問題。
此外,分別針對 BDDTF 及 EDMM 問題,我們也分別提出了集中式及分散式演算法
來解之,因此本研究可利用我們所提出之方法來降低 ZigBee 網路生成時,所造成的orphan
數。
六、
參考文獻
1.
W. Ye, J. Heidemann, and D. Estrin. An energy-ef
ficient MAC protocol for wireless sensor
networks. In Proc. of IEEE INFOCOM, 2002.
2.
S. Du, A. K. Saha, and D. B. Johnson. Rmac: A routing-enhanced duty-cycle MAC protocol
for wireless sensor networks. In Proc. of IEEE INFOCOM, 2007.
3.
C.-F. Huang, Y.-C. Tseng, and L.-C. Lo. The coverage problem in three-dimensional
wireless sensor networks. Journal of Interconnection Networks, 8(3):209–227, 2007.
4.
T.-T.Wu and K.-F. Ssu. Determining active sensor nodes for complete coveragewithout
location information. International Journal of Ad Hoc and Ubiquitous Computing,
1(1/2):38–46, 2005.
5.
C.-F. Huang, Y.-C. Tseng, and L.-C. Lo. The coverage problem in three-dimensional
wireless sensor networks. Journal of Interconnection Networks, 8(3):209–227, 2007.
6.
J. Bachrach, R. Nagpal, M. Salib, and H. Shrobe. Experimental results and theoretical
analysis of a self-organizing global coordinate system for ad hoc sensor networks.
Telecommunications Systems Journal, 26(2-4):213–234, 2004.
7.
Habitat monitoring on great duck island.
http://www.greatduckisland.net/technology.php
.
8.
Design and construction of a wildfire instrumentation system using networked sensors.
http://firebug.sourceforge.net/
.
9.
Q. Li, M. DeRosa, and D. Rus. Distributed algorithm for guiding navigation across a sensor
network. In Proc. of ACM Int’l Symposium on Mobile Ad Hoc Networking and Computing
(MobiHoc), 2003.
10. Y.-C. Tseng, M.-S. Pan, and Y.-Y. Tsai. Wireless sensor networks for emergency navigation.
IEEE Computer, 39(7):55–62, 2006.
11.
Motes, smart dust sensors, wireless sensor networks.
http://www.xbow.com/
.
12.
Dust network Inc.
http://dust-inc.com/flash-index.shtml
.
13.
ZigBee-2006 specification, ZigBee document 064112, 2006.
14.
IEEE standard for information technology - telecommunications and information exchange
between
systems - local and metropolitan area networks specific requirements part 15.4:
wireless medium access
control (MAC) and physical layer (PHY) specifications for low-rate
wireless personal area networks
(LR-WPANs), 2003.
15. M. R. Garey and D. S. Johnson. Computers and Intractability: A Guide to the Theory of
NP-Completeness. W. H. Freeman, 1979.
附錄一
出國報告書
IEEE VTC 2009-Spring Conference
出國報告書
撰寫時間: 2009 年 5 月 2 日
姓 名
曾煜棋
單 位
資訊工程系
連絡電話
03-5131366
出生年月日
52 年 4 月 5 日
職 別
教授
出席國際
會議名稱
IEEE VTC 2009-Spring Conference
到達國家
及 地 點
Barcelona, Spain (巴塞隆納, 西班牙)
出國期間
自 2009 年 4 月 26 日 迄 2009 年 4 月 29 日
內
容
議程為4/26 Workshop,4/27~29 Main Conference。本人參與
該會議有以下三項任務:
1. 代表IEEE Vehicular Technology Society,台北分會成員列
席Board of Government 會議。
2. 討論主辦VTC 2010-Spring在台北舉行之細 節。本會己經由
台北分會爭取,並確定取得Board of Government同意在台北
之舉辦權。本次出席之目的是和BoG討論舉辦之細節,以確
定大會成功,並向本次與會人員宣傳明年台北舉辦之訊息。
3. 目前organizing committee訂定由吳靜雄教授和陳光禎教担
任General Chairs,本人担任Vice General Chair。我們在大會
晚宴中並向與會人員宣傳明年在台北舉辦之訊息
本會可謂一個極大型的國際會議,會中有來自多個國家,本
人並藉此增廣見聞,同時吸收新知更,和同一領域之外國學
者互相切磋討論。
附錄二
The Orphan Problem in ZigBee Wireless
Networks
M.-S. Pan, C.-H. Tsai, and Y.-C. Tseng
IEEE TRANSACTIONS ON MOBILE COMPUTING, TMC-2007-09-0291.R1 1
The Orphan Problem in ZigBee Wireless Networks
Meng-Shiuan Pan, Chia-Hung Tsai, and Yu-Chee Tseng, Senior Member, IEEE
Abstract—ZigBee is a communication standard which is con-sidered to be suitable for wireless sensor networks. In ZigBee, a device (with a permanent 64-bit MAC address) is said to join a network if it can successfully obtain a 16-bit network address from a parent device. Parent devices calculate addresses for their child devices by a distributed address assignment scheme. This assignment is easy to implement, but it restricts the number of children of a device and the depth of the network. We observe that the ZigBee address assignment policy is too conservative, thus usually making the utilization of the address pool poor. Those de-vices that can not receive network addresses will be isolated from the network and become orphan nodes. In this paper, we show that the orphan problem can be divided into two subproblems: the bounded-degree-and-depth tree formation (BDDTF) problem and the end-device maximum matching (EDMM) problem. We then propose algorithms to relieve the orphan problem. Our simulation results show that the proposed schemes can effectively reduce the number of orphan devices compared to the ZigBee strategy.
Index Terms—graph theory, IEEE 802.15.4, network forma-tion, orphan problem, wireless sensor network, ZigBee.
I. INTRODUCTION
The recent progress of wireless communication and em-bedded micro-sensing MEMS technologies has made wireless
sensor networks (WSNs) feasible. A lot of research works
have been dedicated to this area, including energy-efficient MAC protocols [11][27], routing and transport protocols [8][13], self-organizing schemes [16][24], sensor deployment and coverage issues [14][22], and localization schemes [6][23]. Applications of WSNs include habitat monitoring [2], wildfire monitoring [1], mobile object tracking [21][25], and navigation [20][26].
Recently, several WSN platforms have been developed, such as MICA, MICAz, Imote2, TelosB [4], TI CC2431 [5], and Jennic JN5121 [3]. For interoperability purpose, most platforms have adopted ZigBee [29] as their communication protocols. ZigBee adopts IEEE 802.15.4 standard [15] as its physical and MAC protocols and solves the interoperability issues from the physical layer to the application layer.
ZigBee supports three kinds of network topologies, namely star, tree, and mesh networks. A ZigBee coordinator is respon-sible for initializing, maintaining, and controlling the network. In a star network, all devices have to directly connect to the coordinator. For tree and mesh networks, devices can
Manuscript received September 21, 2007; revised November 7, 2008. M.-S. Pan is with the Department of Computer Science, National Chiao-Tung University, Hsin-Chu, 30010, Taiwan. E-mail: [email protected]
C.-H. Tsai is with the Department of Computer Science, National Chiao-Tung University, Hsin-Chu, 30010, Taiwan. E-mail: [email protected] Y.-C. Tseng is with the Department of Computer Science, National
Chiao-Cm = 5 Rm = 3 Lm = 2
ZigBee coordinator ZigBee router
ZigBee router-capable device ZigBee end device
Tree link Communication link
Addr = 0 Cskip = 6 C E B D A Addr = 1 Cskip = 1 Addr = 2 Addr = 3 Addr = 5 Addr = 8 Addr = 7 Cskip = 1 Addr = 9 Addr = 10 Addr = 19 Addr = 15 Addr = 13 Cskip = 1 Addr = 14 Addr = 17 Addr = 18 Addr = 11 Addr = 12
Fig. 1. An example ZigBee tree network.
communicate with each other in a multihop fashion. The network is formed by one ZigBee coordinator and multiple
ZigBee routers. A device can join a network as an end device
by associating with the coordinator or a router. Fig. 1 shows a ZigBee tree network.
In ZigBee, each node has a permanent 64-bit MAC address. A device is said to successfully join a network if it can obtain a 16-bit network address from the coordinator or a router. Using a short network address is for simplicity and for saving communication bandwidths. Before forming a network, the coordinator needs to decide three important system param-eters: the maximum number of children of a router (Cm), the maximum number of child routers of a router (Rm), and the depth of the network (Lm). Note that a child of a router can be a router or an end device, so Cm ≥ Rm. Given
Cm, Rm and Lm, ZigBee has suggested a distributed address
assignment scheme. While simple, the scheme may prohibit a node from accepting a child router/device as constrained by these parameters. We say that a node becomes an orphan node when it can not associate with any parent router but there are still unused address spaces remaining. We call this the orphan
problem. For example, in Fig. 1, the router-capable device A
has two potential parents B and C. Router B can not accept
A as its child because it has reached its maximum capacity of Cm= 5 children. Router C can not accept A either because
IEEE TRANSACTIONS ON MOBILE COMPUTING, TMC-2007-09-0291.R1 2
the network scares up. We will further support this claim in Section II-B through simulations and real experiments. The orphan problem can be relieved if proper actions are taken. For example, in Fig. 1, if router E is connected to router D, router B will have capacity to accept A.
Given Cm, Rm, and Lm, we show that the orphan problem can be divided into two subproblems: 1) connecting as many routers as possible to form a tree and 2) connecting as many end devices as possible to the above tree. The first subproblem involves the router-capable devices only and can be modeled as a bounded-degree-and-depth tree formation
(BDDTF) problem. We prove that this subproblem is in fact
NP-complete. The second subproblem needs to connect as many end devices to the above tree as possible constrained by router’s capacities and can be modeled as an end-device
maximum matching (EDMM) problem. We prove that the
EDMM problem is computationally feasible and then exist an optimal algorithm to solve it. To summarize, our approach involves two stages. The first stage will try to relieve the BDDTF problem by connecting more routers. Based on the result, the second stage will be able to connect the largest number of end devices to the tree.
Several works have investigated the bounded-degree
span-ning tree problem. Reference [10] proposes polynomial-time
graph algorithms when additional connectivity and maximum degree of a graph are given. However, the depth constraint is not considered. Reference [18] introduces an approximation algorithm, which can find a spanning tree with a maximum degree of O(K+log|V |), where K is the degree constraint and
V is the set of nodes in the graph. The result is not applicable
to our case because it does not consider the depth constraint and the number of children of a node is not bounded. In [17], a polynomial time algorithm is proposed to construct a spanning tree with a bounded degree and a bounded diameter. However, this algorithm is designed for complete graphs, which is not the case in a ZigBee network. Also, these works are not tailored to ZigBee specifications. Some works have focused on address configuration. Reference [7] proposes a network address assignment scheme based on the address assignment rule for an n-dimensional hypercube. Interestingly, when the ZigBee network structure is close to an n-cube, this scheme can indeed reduce the waste of address space. However, in practice, a WSN is typically randomly deployed on a 2D plane, which is unlikely to be similar to a high-dimensional n-cube. In fact, the scheme still suffers from the compatibility issue when the n-cube is incomplete and the orphan problem may still exist. Besides, additional overhead will be incurred to ensure that no duplicate addresses are assigned to nodes. Ref-erence [19] organizes a network into concentric tiers around the sink and does not employ unique per-node addressing. When transmitting, a node will randomly choose an identifier for one-hop routing. This scheme is address-light, but it is only suitable for reporting scenarios and can not support point-to-point routing. In [28], an adaptive block addressing scheme is introduced for network auto-configuration purpose. It takes into account the actual network topology and thus is fully
addition of new nodes can cause the whole network to conduct address update. Moreover, this scheme needs two phases to initialize its adaptive tree, which is different from the ZigBee association procedure and is thus not compatible with ZigBee. The main contributions of this paper are threefold. First, this is the first work that points out the orphan problem in ZigBee wireless networks. Second, we show that the existence orphan is an inherent concern no matter how one sets the
Cm, Rm, and Lm constraints. We verify this claim through
different configurations and parameter settings. A larger Cm or Rm will impose more memory requirement on routers and packets, while a larger Lm will also induce longer network delays. Third, we connect the orphan problem to NP-complete and classical algorithms and then propose network formation heuristics that can effectively reduce the number of orphans with given Cm, Rm, and Lm.
The rest of this paper is organized as follows. Preliminaries are given in Section II. Section III and Section IV present our algorithms. Simulation results are given in Section V. Finally, Section VI concludes this paper.
II. PRELIMINARIES
A. Overview of IEEE 802.15.4 and ZigBee Standards
IEEE 802.15.4 [15] specifies the physical and data link protocols for low-rate wireless personal area networks
(LR-WPAN). In the physical layer, there are three frequency bands
with 27 radio channels. Channel 0 ranges from 868.0 MHz to 868.6 MHz, which provides a data rate of 20 kbps. Channels 1 to 10 work from 902.0 MHz to 928.0 MHz and each channel provides a data rate of 40 kbps. Channels 11 to 26 are located from 2.4 GHz to 2.4835 GHz, each with a data rate of 250 kbps.
IEEE 802.15.4 devices are expected to have limited power, but need to operate for a longer period of time. Therefore, energy conservation is a critical issue. Devices are classified as full function devices (FFDs) and reduced function devices (RFDs). IEEE 802.15.4 supports star and peer-to-peer topolo-gies. In each PAN, one device is designated as the coordinator, which is responsible for maintaining the network. A FFD has the capability of serving as a coordinator or associating with an existing coordinator/router and becoming a router. A RFD can only associate with a coordinator/router and can not have children.
According to ZigBee standard [29], a ZigBee network is formed by the following procedures. Devices that are coordinator-capable and do not currently join a network can be a candidate of a ZigBee coordinator. A device that desires to be a coordinator will scan all channels to find a suitable one. After selecting a channel, this device broadcasts a beacon containing a PAN identifier to initialize a PAN. A device that hears a beacon of an existing network can join this network by performing the association procedures and specifying its role, as a ZigBee router or an end device. If the device hears multiple beacons, it chooses the beacon sender with the smallest hop count to the coordinator. The beacon sender will
IEEE TRANSACTIONS ON MOBILE COMPUTING, TMC-2007-09-0291.R1 3
the device is successfully associated, the association response will contain a short 16-bit address for the request sender. This short address will be the network address for that device.
In ZigBee, network addresses are assigned to devices by a distributed address assignment scheme. The coordinator de-termines Cm, Rm, and Lm. The coordinator and each router can have at most Rm child routers and at least Cm− Rm child end devices. Devices’ addresses are assigned in a top-down manner. For the coordinator, the whole address space is logically partitioned into Rm+ 1 blocks. The first Rm blocks are to be assigned to the coordinator’s child routers and the last block is reserved for the coordinator’s own child end devices. From Cm, Rm, and Lm, each node computes a parameter called Cskip to derive the starting addresses of its children’s address pools. The Cskip for the coordinator or a router in depth d is defined as:
Cskip(d)= 1 + Cm × (Lm − d − 1) if Rm= 1 1+Cm−Rm−CmRmLm−d−1 1 − Rm otherwise. (1) The coordinator is said to be at depth 0; a node which is a child of another node at depth d is said to be at depth d+ 1. Address assignment begins from the ZigBee coordinator by assigning address 0 to itself. If a parent node at depth d has an address Aparent, the n-th child router is assigned to address
Aparent+(n−1)×Cskip(d)+1 and n-th child end device is
assigned to address Aparent+Rm×Cskip(d)+n. An example of the address assignment is shown in Fig. 1. The Cskip of the coordinator is obtained from Eq. (1) by setting d = 0,
Cm= 5, Rm = 3, and Lm = 2. Then the child routers of the
coordinator will be assigned to addresses0+(1−1)×6+1 = 1, 0+(2−1)×6+1 = 7, 0+(3−1)×6+1 = 13, etc. The address of the only child end device of coordinator is0+3×6+1 = 19. Note that, in ZigBee, the maximum network address capacity is 216 = 65536. This restricts that the coordinator can not decide the Cm, Rm, and Lm arbitrarily.
B. The Orphan Problem
By the above rules, the coordinator and routers can accept more routers and devices if they still have capacities. However, when a node can not join the network because all its neighbors have run out of their address capacities, we say the node has become an orphan. This situation may be relieved if there are remaining address spaces in other places of the network. Fig. 1 is a small-scale orphan problem. Here, we present some real implementation results of the ZigBee network formation procedure based on Jennic JN5121 [3]. Fig. 2 shows a deploy-ment of 49 routers on a360 cm × 360 cm grid area. The grid size is 60 cm × 60 cm. Nodes’ transmission power is set to 150 mW , which can reach a transmission range around 100 to200 cm. For each combination of (Rm, Lm), we conduct five experiments and observe the average number of orphans and the average end-to-end delay from the deepest node to the coordinator. Table I shows our experimental results. We can
TABLE I
THE PERCENTAGES OF ORPHANS AND END-TO-END DELAYS UNDER DIFFERENT COMBINATIONS OF(Rm, Lm)IN THE TEST SCENARIO OF
FIG. 2.
(Rm, Lm) Orphans Orphan Ratio Delay
(6, 2) 35 71.4% 0.360s (5, 3) 31.4 64.1% 0.447s (4, 4) 30 61.2% 0.597s (3, 5) 21.2 43.3% 0.681s (2, 6) 27.8 56.7% 0.8125s (3, 7) 17.2 35.1% 0.991s (2, 8) 20.8 42.4% 1.197s
can lead to fewer orphans, it also results in longer end-to-end delay.
Since it is infeasible to conduct large-scale real tests, we also use simulations to make more observations. In Fig. 3, 800 nodes are randomly deployed on a circular field with a radius of 230 m. Nodes’ transmission range is 25 m. To reduce orphans, given an Rm, we will set Lm to the maximum possible value. So we set (Rm, Lm)= (4, 7), (3, 9), and (2, 15) (these Lm values are the maximum possible ones for the given Rm) and Cm= Rm (which means no end devices). In Fig. 3(a), since Lm= 7, the network cannot grow too deep, so a lot of nodes are left as orphans. In Fig. 3(b), since a larger
Lm = 9 is used, there are much fewer orphans. However,
there are still a lot of nodes at the edge unable to connect to the network. In Fig. 3(c), with a larger Lm = 15, orphans are significantly reduced. However, with the same setting, Fig. 3(d) shows a more extreme case where all neighboring nodes of one of the coordinator’s children have been associated with other routers, making it a leaf node. This actually wastes a lot of address spaces. A smaller Rm may result in a non-shortest path from a router to the coordinator, thus causing a longer transmission delay and even more orphans if their routing path lengths exceed the constraint of Lm. In fact, assuming Cm = Rm, a router at depth d serving as a leaf implies a loss of 1−Rm1−RmLm−d+1 address spaces. This is why a larger part of the network at the lower right side is unable to join the network. Note that this could happen because the ZigBee tree formation is asynchronous and nodes will compete to connect to nearby routers. These observations motivate us to design our schemes by trying to maintain sufficient children for nodes nearby the coordinator.
While both routers and end devices may become orphans, there capabilities are different. A router may accept more routers/devices, while an end device cannot. Further, their address calculation rules are also different as reviewed in Section II-A. For these reasons, we divide the orphan problem into two subproblems: BDDTF and EDMM problems. In the first BDDTF problem, we consider only router-capable devices and model the network by a graph Gr = (Vr, Er), where Vr
consists of all router-capable devices and the coordinator t and Er contains all symmetric communication links between nodes in Vr. Given parameters Cm, Rm, and Lm such that
IEEE TRANSACTIONS ON MOBILE COMPUTING, TMC-2007-09-0291.R1 4 tree link associated nodes orphan nodes 0000 0446 0448 063D 0001 088B 0447 05C4 063C 0641 0642 088C 05B3 05C3 0643 05B4 05B5 06A6 0894
062D 062E 06A7 06A8 0895
05B6 088E 0890 0892
062F 088D 088F 0891
Fig. 2. A real-world ZigBee network formation example based on JN5121 in a 7x7 grid structure.
(a) (b)
IEEE TRANSACTIONS ON MOBILE COMPUTING, TMC-2007-09-0291.R1 5
possible. Below, we formulate this problem to a tree formation problem.
Definition 1: Given Gr= (Vr, Er), Rm, Lm, and an
inte-ger N ≤ |Vr|, the Bounded-Degree-and-Depth Tree Formation
(BDDTF) problem is to construct a tree T rooted at t from Gr
such that T satisfies the ZigBee tree definition and T contains at least N nodes.
In [12], it is shown that the Degree-Constrained Spanning
Tree (DCST) as defined below is NP-complete.
Definition 2: Given Gc = (Vc, Ec) and a positive integer
Kc ≤ |Vc|, the Degree-Constrained Spanning Tree (DCST)
problem is to find a spanning tree Tc from Gc such that no vertex in Tc has a degree larger than Kc.
Theorem 1: The BDDTF problem is NP-complete. Proof: To prove that the BDDTF problem is
NP-complete, we first show that the problem belongs to NP. Given a tree T in Gr, it is easy to check whether T satisfies the constraints of Rm and Lm and contains more than N nodes in polynomial time. Next, to prove that the BDDTF problem is NP-complete, we reduce the DCST problem to it. Let
Gc = (Vc, Ec) and integer Kc represent an arbitrary instance
of the DCST problem. We can transform Gc to an instance of the BDDTF problem Gr by setting Vr = Vc, Er = Ec,
N = |Vc|, Rm = Kc, and Lm→ ∞ in polynomial time. We
now claim that we can find a Tcfor the DCST problem if and only if we can find a ZigBee-conformed tree T containing N nodes. To prove the if part, if there is a ZigBee-conformed tree
T in Gr to connect N = |Vc| = |Vr| nodes with parameters
Rm = Kc and Lm → ∞, we can find a tree Tc in Gc to connect N = |Vc| nodes as a spanning tree in Gc such that no vertex in Tc has a degree larger than Kc. Conversely, to prove the only if part, suppose that there is a spanning tree Tc to connect the nodes in Gc. Since Rm = Kc and
Lm→ ∞, there must exist a ZigBee-conformed tree T = Tc
in Gr containing N = |Vc| ≤ |Vr| nodes. So the theorem is
proved. 2
By Theorem 1, we can see that the first subproblem is intractable. Definition 1 and Theorem 1 imply the orphan problem is inevitable with any Rm and Lm. This also implies that there is no optimal decision for choosing Cm, Rm, and
Lm to avoid the orphan problem.
After solving the BDDTF problem, we already have a tree
T containing the coordinator and some routers. In the second
EDMM subproblem, we will connect non-router-capable de-vices to the tree T constructed earlier following the ZigBee definition such that as many end devices are connected to
T as possible. Toward this goal, we model the network by
a bipartite graph Gd = ({ ˆVr∪ Ve}, Ed), where ˆVr consists
of the coordinator and all routers in T , excluding those at depth Lm (note that those at depth Lm are unable to accept more children), Veconsists of all end devices, and Edcontains all symmetric communication links between ˆVrand Ve. Each
vertex v ∈ ˆVr can accept at most Cv ≥ (Cm − Rm)
end devices. From Gd, we construct another bipartite graph ˜
Gd= ({ ˜Vr∪ ˜Ve}, ˜Ed) as follows.
2) From each vertex u∈ Ve, generate a vertex u in ˜Ve. 3) From each edge (v, u) in Ed, where v∈ ˆVrand u∈ Ve,
connect each of the Cvvertices v1, v2, ..., vCv generated in rule 1 with the vertex u generated in rule 2. These edges form the set ˜Ed.
Intuitively, we duplicate each v∈ ˆVr into Cv vertices, and each edge (v, u) ∈ Ed into Cv edges. These Cv vertices and Cv edges reflect the capability of router v to accept end devices. It is clear that ˜Gd is a bipartite graph with edges connecting vertices in ˜Vr and vertices in ˜Ve only. Since each vertex in ˜Vr is connected to at most one vertex in ˜Ve, this translates the problem to a maximum matching problem as follows.
Definition 3: Given a graph G˜d = ({ ˜Vr ∪ ˜Ve}, ˜Ed), the
End-Device Maximum Matching (EDMM) problem is to find
a maximum matching of ˜Gd.
Given router tree T , the maximum matching problem in Definition 3 can be solvable in polynomial time [9]. Note that even with maximum matching, it does not guarantee that all end devices will be connected, so orphan end devices may still exist after solving the second subproblem. Below, we will propose several schemes for these two subproblems.
III. ALGORITHMS FOR THEBDDTF PROBLEM
We propose two algorithms for the BDDTF problem. In our algorithms, we will repeatedly generate several BFS trees from Gr. For each tree being generated, we may decide to truncate some nodes if the tree is not conformed to the ZigBee definition. The truncation is done based on nodes’ association
priorities in the tree. Below, we show how such priorities are
defined, given a BFS tree T in Gr:
• A node x has a higher priority than another node y if the subtree rooted at x in T has more nodes than the subtree rooted at y.
• If the subtrees rooted at nodes x and y have the same number of nodes, the one with less potential parents has a higher priority. A node regards a neighbor as a potential parent if this neighbor has a smaller hop count distance to the root in T than itself.
The above definitions are based on the considerations of address space utilization. The first rule is so defined because node x may have a better utilization. The second rule is so defined because a node with less potential parents is more likely to encounter difficulty when trying to attach to the network. For example, in Fig. 4, if Rm= 3, the coordinator will choose nodes A, B, and C as its child routers since they have larger subtrees. Similarly, B will choose D, E, and F as its child routers. However, if Rm= 2, the coordinator will choose A and B as its child routers. Further, B will choose
D and E as its child routers. Node F is not selected because
it has more (two) potential parents and thus has a higher probability to be connected in later stages of the formation.
IEEE TRANSACTIONS ON MOBILE COMPUTING, TMC-2007-09-0291.R1 6 3 50 500 100 100 150 depth: 0 depth: 1 depth: 2
BFS tree link Communication link
B A F E D G Cdepth: 1 depth: 1 depth: 2 depth: 2 depth: 2 depth: 2 depth: 1 depth: 1
Fig. 4. Examples of priority assignment in our algorithm. (The numbers in triangles indicate sizes of the corresponding subtrees.)
The algorithm consists of a sequence of iterations. Initially, T contains only the coordinator t. Then in each iteration, there are two phases: Span and Prune. In the Span phase, we will pick a node in T , say x, and span from x a subtree T to include as many nodes not yet in T as possible. Then we attach T to T to form a larger tree. However, the new tree may not satisfy the ZigBee definition. So in the Prune phase, some of the newly added nodes in T may be trimmed. The resulting tree is then passed to the next iteration for another Span and Prune phases. This is repeated until no more nodes can be added. Each node in the network will be spanned at most once. To keep track of the nodes yet to be spanned, a queue Q will be maintained. The algorithm is presented below. 1) Initially, let queue Q contains only one node t. Let the depth of t to zero. Also, let the initial tree T = ({t}, ∅). 2) (Span Phase) Check if Q is empty. If so, the algorithm is terminated and T is the final ZigBee tree. Otherwise, let x = dequeue(Q) and construct a spanning tree T from x as follows. Assuming the depth of x in T to be
depth(x), we try to span a subtree from x with height
not exceeding Lm− depth(x) in Gr in a breadth-first manner by including as many nodes in Vr− VT ∪ {x} as possible. Let the resulting tree be T.
3) (Prune Phase) Attach T to T by joining node x. Still, name the new tree T . Since some of the nodes in T may violate the Rm parameter, we traverse nodes in T from x in a breadth-first manner to trim T .
a) When visiting a node, say y, set y as “traversed” and check the number of children of y. If y has more than Rm children, we will compute their priorities based on T (refer to the definitions of nodes’ priorities in a tree given in the beginning of this section). Only the Rm highest prioritized children will remain in T , and the other children
y A depth: Lm-3 depth: Lm-2 depth: Lm-1 depth: Lm C y' B D x t T' T
Fig. 5. An example of the Span-and-Prune algorithm.
or 3(b), let tree(y) be the pruned subtree rooted at
y. Since tree(y) is pruned, we will try to attach y to another node n in Tif n satisfies the following conditions: 1) n is neighboring to y but not a descendant of y, 2) n is not traversed yet, and 3) depth(n) + 1 + height(tree(y)) ≤ Lm. If so, we will connect the subtree tree(y) to node n. If there are multiple such candidates, the one with a lower depth is connected first. If no such node n can be found, y prunes all its children. Then for each pruned child, we recursively perform this step 3(b) to try to reconnect it to T. This is repeated until no further reconnection is possible.
4) After the above pruning, call the resulting tree T . For nodes that are newly added into T in step 3, insert them into queue Q in such a way that nodes with lower depth values are inserted first (these nodes will go through Span and Prune phases again). Then, go back to step 2. To summarize, step 3(a) is to prune those nodes violating the Rm constraint. In order to allow more vertices to join the network, step 3(b) tries to recursively reconnect those pruned subtrees to T. Step 4 prepares newly joining nodes in Q for possible spanning in step 2.
Fig. 5 illustrates an example. When being traversed, y decides to prune y and keep A, B, and C as children. Step 3(b) will try to reconnect yto C or D, which are the neighbors of y in T and are not traversed. In this example, only C can be considered because connecting to D violates the depth constraint Lm.
The computational complexity of this algorithm is analyzed as follows. The iteration from step 2 to step 4 will be executed at most |Vr| times. In each iteration, the complexity of con-structing the tree Tin step 2 is O(N2), where N = |Vr|−|VT|
IEEE TRANSACTIONS ON MOBILE COMPUTING, TMC-2007-09-0291.R1 7
a run in Step 3 (assume visiting node y), the cost contains: 1) In step 3(a), y can use a linear search method to find
Rm highest prioritized children and the computational cost
is O(D), where D is the degree of Gr. 2) Since the subtree size of y is at most O(N) and a pruned node checks at most
O(D) neighbors to find its new parent, the cost of step 3(b)
in a run is O(ND). So, in one iteration, the time complexity of step 3 will be O(N(D + ND)) = O(N2D). Step 4 sorts
new nodes of T according to their depth values, so the time complexity is O(N2). The complexity in each iteration is
O(N2+ N2D+ N2) = O(N2D) = O(|Vr|2D). Since there
are at most|Vr| iterations, the overall time complexity of this algorithm is |Vr| × O(|Vr|2D) = O(|Vr|3D). Although this
complexity looks somewhat too high, we believe that using
|Vr| to bound N is too strong. Our experimental experience
reveals that the value of N will degrade quickly because most nodes will be connected to the tree T after several iterations. So, the time complexity of an iteration is quite small in practice1.
B. Distributed Depth-then-Breadth-Search Algorithm
The above Span-and-Prune algorithm is a centralized one. In this section, we present a distributed algorithm, which does a depth-first search followed by a breadth-first-like search. The depth-first search tries to form some long, thin backbones, which are likely to pass through high-node-density areas. Then from these backbones, we span the tree in a breadth-first-like manner. The algorithm is presented below.
1) (Depth Probing) Given a graph Gr = (Vr, Er), the
coordinator t needs to probe the depth of the tree first. A Probe(sender addr, current depth, Lm) packet is used for this purpose. The Probe packets are flooded in a BFS-like manner, until a depth Lm is reached. Note that following the definition of ZigBee, before the final tree is determined, nodes will use their 64-bit MAC addresses to communicate with each other in this stage.
This algorithm begins by the coordinator t flooding a Probe( Addr(t), 0, Lm) packet in the network, where
Addr(t) is t’s address. When a node v receives a
Probe(sender addr, current depth, Lm) packet, it does the following:
a) If this is the first time v receiving a Probe() packet, v sets its parent par(v) = sender addr and its depth depth(v) = current depth + 1. If
depth(v) < Lm, v rebroadcasts a Probe(Addr(v), depth(v), Lm) packet.
b) If this is not the first time v receiving a Probe() packet, it checks if depth(v) > current depth+1 is true. If so, a shorter path leading to the coordinator is found. So v sets its parent par(v) = sender addr and its depth depth(v) = current depth + 1. If
depth(v) < Lm, v rebroadcasts a Probe(Addr(v), depth(v), Lm) packet.
1By our simulation, in average, almost75% of nodes can be connected to
Note that to ensure reliability, a node may periodically rebroadcast its Probe() packet. And each node can know the number of its potential parents by the Probe() packet. 2) (Probe Response) After the above probing, a BFS-like tree is formed. Each node then reports to its parent a Report() packet containing (i) the size of the subtree rooted by itself and (ii) the height of the subtree rooted by itself. In addition, each node v will compute a
tallest child(v), which records the child of v whose
subtree is the tallest among all child subtrees.
3) (Backbone Formation) After the coordinator t receives all its children’s reports, it will choose at most Rm children with the larger subtree sizes as backbone nodes. This is done by sending a Backbone() message to each of the selected children. When a node v receiving a Backbone() message, it further invites its child with the tallest subtree, i.e., node tallest child(v), into the back-bone by sending a Backback-bone() packet to tallest child(v). After this phase, t has constructed a backbone with up to Rm subtrees, each as a long, thin linear path. 4) (BFS-like Spanning) After the above backbone
forma-tion, the coordinator can broadcast beacons to start the network. A node can broadcast beacons only if it has successfully joined the network as a router (according to ZigBee, this is achieved by exchanging Associa-tion Request and AssociaAssocia-tion Response with its parent). In our rule, a backbone node must associate to its parent on the backbone, and its parent must accept the request. For each non-backbone node, it will compete with each other in a distributed manner by its association priority, where the association priority is defined by the size of the subtree rooted by this node in the BFS-like tree formed in step 1. A non-backbone node sends its association requests by specifying its priority. A beacon sender should wait for association requests for a period of time and sorts the received requests by their priorities. Then the beacon sender can accept the higher-priority ones until its capacity (Rm) is full.
Compared to the ZigBee protocol, this algorithm requires nodes to broadcast three extra packets (Probe(), Report(), and Backbone()). A Probe() packet needs to flood to the whole network and thus needs an efficient broadcast scheme (this is beyond the scope of this paper). Let n be the total number of nodes in the network. Below, we will show that the additional time and message complexity against to ZigBee are O(Lm) and O(n), respectively .
To see the additional time complexity, observe that the coordinator t will issue Probe() to check the depth of the tree and a node v will rebroadcast it only when depth(v) < Lm or it can find a shorter path to t. So, the additional time complexity will be bounded by O(Lm). In the process of finding the tallest child, each node will report to its parent. Because the reporting is started from leaf nodes, the additional time complexity is also bounded by O(Lm). Finally, the backbone formation will be triggered by t to construct a long,