• 沒有找到結果。

第二章 相關研究

2.4 CBVANET

的cluster-tail或cluster head擁有要求的資料,並且進行HOOK_ON 的步驟進行連結,進而 取得資料。

2.4 CBVANET

Ramakrishnan 等人[7]根據行車速度和相對位置決定分群架構,稱為 Simple Highway Mobility Model (SHMM)。依照行車流量的大小,動態決定分群的大小,降低不同群組 之間的干擾,並改進舊有 VANET 分群模組中的群組建立、群組管理員的決定和重選群 組管理員。其架構隨著車流大小調整分群大小,若車流量大,道路通訊狀況會變差,因 此切割的 cluster 選擇較小的,以減少干擾其他群組;反之,車流量小,切割的 cluster 範圍就大,如圖 2-4 所示。

X

i

, Y

i

= Get_Pos(n);

A

i

, B

i

= Subset (X

i

, Y

i

);

Track the positions of nodes in cluster areas for(k=0;k<count(A

i

);k++)

{

Find Movement Speed(N[k]) }

if(average movement of all node speed is slow) {

Take the cluster size as smaller

}

開此車群,因此選擇車速最慢的,落在車流最後方的車子當 cluster head,以確保較長時 間提供傳輸能力,如圖 2-5 所示。

Procedure

Node_Count=Available nodes in the Cluster For i=0 to Node_Count

Ti x = X position of node i at time T Ti y = Y position of node i at time T U=T+10;

Ui x = X position of node i at time U Ui y = Y position of node i at time U

DIFFi(x)=Find the difference between the X position of node i between

the time T and U

DIFFi(y)=Find the difference between the Y position of node i between

the time T and U

Find the direction of node movement

If(slow moving node is in left end than all other nodes in the cluster and nodes are moving slowly towards the right direction)

then {

select that as Cluster Head

當 cluster head 的速度上升,代表可能會靠近甚至是離開 cluster 通訊範圍,此時以 同樣的方式選擇新的 cluster head 管理 cluster,如圖 2-6 所示。

function Track_Cluster()

endif

Finds the new node which has less mobility;

}

If(Current cluster head is near to cluster boundary) {

Run the cluster head election algorithm;

Copy data from old cluster head to new cluster head;

Broadcasts changes to all other cluster heads;

//cluster head updates its status and also updates their local cluster members//

}

endif

}

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

圖 2.6 重選分群管理員演算法[7]

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

第三章 研究方法

3.1 問題分析

車載網路中,分群時考慮檔案相似性,每個行動節點對檔案的需求和喜好都不完全相同。

在[1]中,雖然依照行動性劃分將各節點分配到最穩定的叢集中,但是只考慮到行動性,

無視於使用者對檔案的需求,此架構或許在車輛碰撞發出警告、得知鄰近區域資訊、前 方行車狀況、未來路徑的天候狀態、即時應用,幾個方面有很大的幫助,但是對於其他 應用,如:音樂電影下載,因為叢集只依照行動性劃分,所以無法提供此方面應用,在 長時間行駛的狀況下無疑是對時間的浪費,使用者很可能想一邊開車一邊下載檔案,或 是乘客也想在無聊的行車時間觀看電影聽聽音樂,這些都無法達成,因此需考慮叢集對 檔案類型的喜好。

簡單來說,考慮單一因素所建立群組可能會產生問題,例如:只考慮了行動性,那 麼此分群的節點彼此所需要的檔案可能無法由此分群內的節點所提供,需要與鄰近的群 組要求檔案;只考慮檔案相似性的分群方式,節點可能會把距離過遠的節點分配置相同 的群組,或是將行動性不同的節點分至相同群組,而這些節點在一段時間後,距離變的 遙遠,需進行多次跳躍傳輸,導致檔案傳輸的困難。

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

從重新決定 cluster head 的時間來看,高機動性的環境,車間的通訊可能因此斷斷 續續,當失去 cluster head 時,一般來說,行動節點會搜尋鄰近節點是否有無其他可用 的 cluster head,如果該節點馬上成為新的 cluster head 或是等到固定時間後才成為新的 cluster head 都不太適合。前者可能會造成新的 cluster head 和附近已存在的 cluster head 傳送範圍重疊,爭搶資源,傳送範圍下的組員接收封包也會發生碰撞的情形;如果是後 者使用事先既定時間,此時間可能會太久,以至於浪費這段時間可使用的資源頻寬。

3.2 File-based Affinity Propagation Cluster (FAPC)簡介

針對車載網路的特性,我們提出了兼具行動性與檔案相似性的分群架構:File-based Affinity Propagation Cluster,簡稱 FAPC。FAPC 架構解決只考慮單一因素所建立群組產 生的缺點,建立分群同時考慮行動性與檔案相似性,並改善既有的重選 cluster head 方 式,根據當下區域的流量動態設定等待時間。

FAPC 分群主要的想法為:將 Affinity Propagation 演算法與檔案相似性整合,執行 Affinity Propagation 時不單只考量行動性也考慮檔案相似性。最初,廣播 beacon 封包額 外加入行動節點擁有的檔案描述,接受到封包後才計算行動和檔案的相似性,接著再將 各節點分配到最適當的群組。

當一個群組失去cluster head時,根據行車密度決定新的cluster head,依照不同行車 流量動態決定新的cluster head門檻時間。在高密度車流的地區,車流位置變動性不大,

找到舊有的cluster head或是遇到新的cluster head,與之連線的時間也會因為行車緩慢而 有較長的連接時間,搜尋cluster head的門檻時間設定較長。如果門檻時間結束仍未找到 任何cluster head,該節點才會成為cluster head提供附近車輛服務。密度低的地區則反之,

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

此地區密度低,加上車輛的高動態性,車輛位置變換極快,網路拓樸變動性高,與cluster head失去連結的可能性也較高,再次與之連結的可能性也低,因此門檻時間設定較短。

根據車流大小動態調整搜尋cluster head時間值,找到適當的cluster head或是自行變為 cluster head。

分群特性

1. 具備動態性考量,群組內的每台車,計算各車之間的相對速度,再進行分群,

群組內的車輛會有相似的行動性,群組有相當可靠的穩定性。

2. 擁有檔案相似性,群組中的車輛具備相似的檔案類型,就會被分到相同的群組,

提供各車輛偏好的檔案類型。

3. 根據行車流量密度,調整尋找 cluster head 最大可等待的時間,適當決定等待 時間以搜尋和轉換 cluster head。

3.3 File-based Affinity Propagation Cluster (FAPC)系統架構

執行整合行動性和檔案相似的架構,每台車都擁有Ri陣列、Ai陣列和鄰居節點的清單,

Ri陣列、Ai陣列分別記錄r(i,j)和 a(j,i),每個鄰居節點清單所記錄的資訊如下:

CHcnvg ,j 收斂(converge)時,表示節點 j 為可用的 cluster head,

此時值設為 1

整個流程分為三個主要部份:首先為廣播和接收 HELLO beacon 封包,其次為廣播 RESP 和 AVAIL 封包,最後為接收 RESP 和 AVAIL 封包。首先,每台車廣播 HELLO beacon

計算出 Affinity Propagation 演算法中初始的r(i, j)和 a(j, i),再利用公式(9)算出收斂的 r i, j 和a j,i 。 的r(i,j)和 a(j,i),再加上α和β權重值,根據公式(10)選出可用的 cluster head。

α{r i,i + a i,i } + β{s i, j } > 0

(10) α 為動態相似性的加權值,β為檔案相關性的加權值,選擇動態性或是檔案相關性為主,

同時考量兩種分群因素,根據α和β權重值設定,選出的 cluster head 則會有三種可能性:

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

較高動態相似性和較低檔案相似性、較低動態相似性和較高檔案相似性,最後一種為中 等動態相似性和中等檔案相似性的三種 cluster head。符合公式的節點,表示已有適合的 cluster head,則將CHcnvg ,j設為 1,若無適合的節點則跳過此步驟,最後傳送 RESP 和 AVAIL 封包,其中 RESP 包含Ri陣列的資訊,VAIL 則擁有Ai陣列和CHcnvg欄位。

第三部份為節點 i 收到節點 j 的 RESP 或 AVAIL 封包的處理,節點 i 在此兩種封包 內查詢Rj和Aj資料,是否有節點 i 的編號,若有則更新鄰居節點清單節點 j 的r(j, i)和 a(i,j) 欄位,更新鄰居節點清單節點 i 的CHcn vg ,j,並檢查CHcnvg ,j欄位是否為 1。若為 1,則將 節點 j 設為節點 i 的 cluster head,並將鄰居節點清單中的CHi更新為節點 j。若不存在或 欄位不為 1,就等待下一個可成為 cluster head 的節點,直到找到一個適當的 cluster head。

將各節點分配至各相似的群組後,節點對檔案有所需求時,只需查詢鄰近節點清單 內各個節點的檔案相似性s i, j ,選擇較高相似性的節點。接下來則查看該節點的Pj向量,

得知該節點所擁有的檔案,查詢該群組中何節點擁有所需要的資料,最後向此節點發出 要求以獲得資料。若該群組沒有要求的資料,則透過 cluster head 延伸通訊範圍,向更 遠的群組發出要求,以獲得檔案資料。

查 cluster head 是否還存在於鄰居節點清單中,若還在代表叢集正常運作,若已無 cluster head,則代表在短時間內,需要尋找一個適當的 cluster head。

不同車流密度影響車輛的行動距離,在失去 cluster head 時,處於不同車流密度的 車輛,找到新的 cluster head 的機率也不同。Artimy [9]利用公式(11)判定所在區域的行車 密度,動態決定傳送範圍的大小,判斷車流壅塞或稀疏 流。Cluster Interval CI 為原本所設定的決定時間,計算出行動節點位於高低密度區域 後,經過行車流量動態調整後稱為CIdyn(dynamic Cluster Interval),公式如下

CIdyn = CI ∗ fS = CI ∗Ts

Tt

(12) 計算出CIdyn後,失去 cluster head 連結的行動節點就開始倒數,當時間結束時該點才成 為 cluster head。藉由公式,根據車流量的大小調整等待尋找 cluster head 的時間,車流 量大密度高的區域,機動性低,找到原本 cluster head 的機率大。並且如果找到新的 cluster head,因為該區域行動性低,與此 cluster head 的通訊時間也會拉長,因此設定較高的等 待時間。車流量小密度低的區域,機動性較高,找到原本 cluster head 的機率低,因此

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

設定較低的等待時間。而在門檻時間結束後,若仍未找到適合的 cluster head,則該節點 成為新的 cluster head。

File-based Affinity Propagation Cluster (FAPC)架構流程圖

前節完整敘述整體架構流程,從如何將檔案相似性與具行動性的 Affinity Propagation 結 合。而整合檔案和行動相似性之 Affinity Propagation 的主要步驟和原本 Affinity

Propagation 一樣,為廣播和接收 HELLO beacon、廣播 RESP 和 AVAIL 封包及接收 RESP 和 AVIL。關於維護 cluster 的部分,本論文著重在 cluster head 的部分,根據車流大小,

決定一個搜尋 cluster head 的最大時間,而整體流程如圖 3-1 所示:

Become cluster member and maintain cluster

Check cluster head exists?

Yes

Calculate time to search cluster head

No

This node become a new cluster head

Time is over?

Yes Broadcast

HELLO beacon

Broadcast RESP and AVAIL

packet

Receive RESP and AVAIL

Check car leave ?

FAPC start

行動節點所擁有的狀態為:Node does not cluster、Cluster Member、Node does not have cluster head 和 Cluster Head。首先,執行完 FAPC,根據演算法判斷節點成為分群的管理 員或是成員,因此轉變為 Cluster Member 或是 Cluster Head,Cluster Member 如果在一 段時間後,在維持 cluster 時,更新鄰居節點清單時,發現已無 cluster head 能提供服務,

此時則轉為 Node does not have cluster head 的狀態,並計算出最大搜尋等待 cluster head 的時間。時間使用完,則此節點成為 cluster head 並轉變為 Cluster Head 狀態,若在時間 未用完就找到 cluster head,就再次變回 Cluster Member 狀態,狀態轉變圖如下:

Node does not cluster

Use FAPC cluster

Cluster Head Become a cluster head

Cluster Member

Node do not have cluster

head

Timeout Detect no cluster head

Detect no neighbor

Detect no neighbor

Use FAPC cluster

Find cluster head

圖 3.2 行動節點狀態變換圖

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

File-based Affinity Propagation Cluster (FAPC) 分群虛擬碼

根據上一節的流程圖、節點狀態圖及文字敘述,將 FAPC 分群架構寫成原始虛擬碼。

根據上一節的流程圖、節點狀態圖及文字敘述,將 FAPC 分群架構寫成原始虛擬碼。

相關文件