第三章 研究方法
3.2 系統概觀
3.2.2 相關表格
在本論文提出之方法中,在環境中車輛、入口閘道、雲端將需要各自之表格 以計算處理儲存資料。此小節將先定義包括環境中車輛、入口閘道、雲端之表格:
存放於車輛中的入口閘道搜尋表 ( Internet Gateway Discovery Table ):
此 Table 存放於車輛中,紀錄雲端幫忙預約之所有入口閘道資訊。
Internet Gateway List
Internet Gateway List:紀錄 Internet Gateway 節點的節點編號、開始服 務與結束服務之時間
存放於入口閘道中的車輛服務預約表(Reservation of Client Vehicle Table):
此 Table 存放於入口閘道中,記錄已預約之車輛資訊。
Reserved Vehicle List
Reserved Vehicle List:紀錄已預約之車輛的節點編號、開始服務與結束 服務時間
存放於雲端中的入口閘道資訊表(Internet Gateway Global View Table):
此 Table 存放於雲端中,記錄所有 Internet Gateway 之資訊。
Internet Gateway ID Internet Gateway Communication Range Function Number of users
Internet Gateway ID:記錄 Internet Gateway 的節點編號
Internet Gateway Communication Range Function:記錄 Internet Gateway 的 Internet Gateway Communication Range Function
Number of users:記錄 Internet Gateway 的使用者數目
存放於雲端中的服務車輛之入口閘道預約表(Reserved Internet Gateway of Client Vehicle Table in the Cloud):
此 Table 存放於雲端中,記錄所有欲連上網路之車輛其預約之所有 Internet Gateway
Client Vehicle ID Routing Function Reservation of Internet Gateway List
21
Client Vehicle ID:記錄 Client Vehicle 的節點編號
Routing Function:記錄 Client Vehicle 的 Routing Function
Reservation of Internet Gateway List:記錄 Internet Gateway ID 及預約開 始與預約結束時間
3.3 連結存活時間
3.3.1 連結存活時間預測
根據第二章可以得知,一個可以準確預測 Link Lifetime 的方法是必需的。而 為此 Gateway Planning 機制,本論文設計了一預測車輛與 Internet Gateway Link Lifetime 方法,以計算出車輛進入與離開 Internet Gateway 通訊範圍之時間,以做 到預約規劃 Internet Gateway 之動作。本文假設每台車上都裝有一台 GPS,讓每 台車都可以知道其自身的位置、速度與方向等資訊,並可輸入目的地到 GPS 中,
以產生 Routing Function。式子( 3.1 )為本論文所定義的 Routing Function of Client Vehicle,依照車輛目前之位置( , )(node position)以及車輛目前之速度向量 和 (velocity vector),以計算未來車輛在時間 t 之動態位置(X ,Y),如 Figure 3.2。
( 3.1 )
Figure 3.2:車輛之動態位置
式子( 3.2 )依照 Internet Gateway 目前之位置( , )以及目前之速度向量 和 ,以計算 Internet Gateway 最大通訊範圍。其中,R 是通訊範圍。
22
( 3.2 )
主要可以分為兩個情形討論。其一,若 Internet Gateway 是固定式,如 Figure 3.3 所示,則依 AP 位置 AP( , )即速度向量為 0 計算,任一節點目前位置(X ,Y)
若符合 ,則此節點目前在此 AP 之通訊範圍內。其二,
若 Internet Gateway 為可移動之 Mobile Gateway,如 Figure 3.4 所示,則依 Mobile Gateway 目前位置( , )及向量 和 計算,任一節點目前位置(X ,Y)若符 合 ,則節點在 t 單位時間後仍在此 Mobile Gateway 之通訊範圍內。
Figure 3.3:AP 可通訊範圍 Figure 3.4: Mobile Gateway 可通訊範圍
當車輛欲與 Internet Gateway 通訊時,將車輛之 方程式與 Internet Gateway 之 方程式結合而成聯立方程式,我們將可以得到式子( 3.3 ):
將 X,Y 代入,可以求得 t1與 t2。此時 t1與 t2有三種情況可能,再分別計算出 Link Lifetime。
23
情況一,t1與 t2皆為正解。較小的正解為車輛進入 Internet Gateway 通訊範 圍之時間,也就是 Entry Time。較大的正解為車輛離開 Internet Gateway 通 訊範圍之時間,也就是 Exit Time。將 Exit Time 減掉 Entry Time 即為 Link Lifetime。
Link Lifetime =Exit Time – Entry Time ( 3.4 )
情況二,t1為正解、t2為負解。此時為車輛已在 Internet Gateway 通訊範圍內,
正解即為 Exit Time,也就是 Link Lifetime。
Link Lifetime =Exit Time ( 3.5 )
情況三,t1與 t2無解。代表車輛不會進入 Internet Gateway 通訊範圍內,所 以 t1與 t2無法求得,故 Link Lifetime 為零。
Link Lifetime =0 ( 3.6 )
3.3.2 Example
範例說明如 Figure 3.5 與 Figure 3.6,其中所提及的參數請參考 Table 3.1。車 輛欲與 AP 通訊時,將 Table 3.1 之參數代入式子( 3.3 )可得到式子( 3.7 ),如此求 得 t 為 27.78 和 70.2。故 Link Lifetime 為 42.42。此外,車輛欲與 Mobile Gateway 通訊時,將 Table 3.1 之參數代入式子( 3.3 )可得到式子( 3.8 ),如此求得 t 為 5.63 和 32.63。故 Link Lifetime 為 27。
((10 + 10*t)-500)2+ ((10 + 10*t)-500)2=3002 ( 3.7 )
24
((10 + 10*t)-(300 + 8*t))2+ ((10 + 10*t)-(300 + 0*t))2=3002 ( 3.8 )
Table 3.1:範例之參數設定
Figure 3.5: 車輛與 AP 通訊範例圖
25
Figure 3.6:車輛與 Mobile Gateway 通訊範例圖
3.4 與車輛連線之 Internet Gateway 規劃
本論文透過結合雲端的特性於 VANET 中,提出一 Gateway Planning 機制,
以增進 VANET 網路效能。Gateway Planning 機制主體架構主要由以下兩部分組 成:
Discovery Portal Gateway:我們假設每台車輛( Client Vehicle )上都裝置 著一台 GPS,車輛行進時將其目的地輸入到 GPS,藉此產生其路徑上 所有的 Routing Functions。當 Client Vehicle 欲取得雲端服務時,須先搜 尋第 一台 Internet Gateway 作為首次連線之閘道,透過該 Internet Gateway 將自身相關資訊如位置、行進方向、移動速度等資訊傳送至雲 端。
Planning in Cloud:主要有以下兩個執行動作。
1. Evaluating Link Lifetime of Gateway:當雲端收到 Client Vehicle 的 RREQ 訊息時,啟動第此機制計算 Link Lifetime,將 RREQ 中的 Routing Functions 擷取出來並與雲端中入口閘道資訊表的所有 Communication Range Function of Gateway 作計算。
26
2. Planning in Cloud:首先,判斷現在時間點與車輛 Link Lifetime 最 長的 Internet Gateway 集合,每個集合皆為一個單位時間範圍。再 利用 Load Balance Selection Scheme 挑選預約使用者最少之 Internet Gateway,Load Balance Selection Scheme 在稍後將會介紹。若環境 中任何 Internet Gateway 與車輛之 Link Lifetime 皆為零,則挑選與 車輛距離最短並且其 Relay Vehicle( 中繼車輛 )為最多之 Internet Gateway。接著挑選預約下一個之 Internet Gateway,判斷在上一個 Internet Gateway 服務結束時間時,所有可挑選之 Internet Gateway 中與車輛 Link Lifetime 最長的 Internet Gateway 集合,再利用 Load Balance Selection Scheme 挑選預約使用者最少之 Internet Gateway,
作為下一個 Internet Gateway。若環境中任何 Internet Gateway 與車 輛之 Link Lifetime 皆為零,則挑選與車輛距離最短並且其 Relay Vehicle( 中繼車輛 )為最多之 Internet Gateway。以上動作重複 H 次,
也就是為每台欲取得服務之車輛在接下來路徑上預約 H 個 Internet Gateway。
3.4.1 Basic Gateway Planning
而 Gateway Planning 的訊息流程如 Figure 3.7,細項說明如下。而為了使各 項訊息以及各項 Table 在何時產生、由誰產生、並且由誰更新、由誰管理能更容 易了解,我們將其整理於 Table 3.2 與 Table 3.3 中:
1. 當 Client Vehicle 欲取得雲端服務時,透過 Internet Gateway 傳送 含有其 Routing Function 的 RREQ 訊息至雲端。
2. 雲端依據先前收到的 Client Vehicle 相關資訊,進行 Evaluating Link Lifetime of Gateway 與 Planning in Cloud,並產生 Gateway
27
Global View Table 及 Gateway Scheduling Table,分別將運算結果 記錄於其中。
3. 雲端回傳含有 Internet Gateway List 的 RREP 訊息給 Client Vehicle。
4. 雲端回傳含有 Client Vehicle 之服務請求的 RRES 訊息至將提供 服務的 Internet Gateway,藉此讓 Internet Gateway 預先保留頻寬 與相關資源,以確保 Client Vehicle 所要求的連線服務品質。
5. Client Vehicle 收到含有 Internet Gateway List 的 RREP 訊息後,
產生 Internet Gateway Discovery Table,並將資訊記載於其中。
6. 將 提 供 服 務 的 Internet Gateway 收 到 了 RRES 訊 息 , 產 生 Reservation of Client Vehicle Table 並將資訊記載於其中。
7. Client Vehicle 開始與由雲端提供規劃規劃之 Internet Gateway 進 行通訊,連接網際網路以取得雲端服務 。
Figure 3.7:Message Flow of Gateway Planning
28 Internet Gateway 資訊 Reserved Internet
Gateway of Client Vehicle Table
雲端收到 RREQ
訊息時 雲端
記錄雲端幫 Client Vehicle 規劃可提供服務
之 Internet Gateway List Reservation of
之 Internet Gateway List
3.4.2 減少不必要訊息
Gateway Planning 機制可以解決像 Figure 3.8 之問題發生。在 Figure 3.8 中可
29
以看到 Client Vehicle 剛駛離某一 Internet Gateway 的通訊範圍,此時此台 Client Vehicle 廣播了 RREQ 封包出去搜尋 Internet Gateway。而下一個 Internet Gateway 離 Client Vehicle 很近,所以在 RREP 訊息還沒回到 Client Vehicle 前,Client Vehicle 就已駛進下一個 Internet Gateway 的通訊範圍,所以此廣播 RREQ 封包的動作是 非必要的。Client Vehicle 會廣播 RREQ 訊息原因為 Client Vehicle 並不知道下一 個 Internet Gateway 之資訊。不過,因為 Gateway Planning 機制結合了雲端,讓 擁有所有 Internet Gateway 資訊的雲端幫忙做計算,以減少 RREQ 訊息的廣播,
減少 VANET 中控制訊息的氾濫。
Figure 3.8:不必要之控制訊息傳送情境圖
3.4.3 負載帄衡
而為了避免 Figure 3.9 之問題發生,本論文定義了一 Load Balance Selection Scheme。在 Figure 3.9 中有十台欲連線至 Internet 取得服務之車輛,其中這十台 車輛與 Internet GatewayA、Internet GatewayB、Internet GatewayC的 Link Lifetime 分別為 28 秒、27.5 秒、27.5 秒。若是直接依照 Link Lifetime 最長來選擇連線之 Internet Gateway,那麼這十台車輛都會透過 Internet GatewayA連上 Internet,造成 互搶頻寬,網路壅塞。可是若是這十台車輛可以帄均分配至另外兩個 Link Lifetime 也不差的 Internet GatewayB、Internet GatewayC,將減少頻寬互搶的現象。
30
而 Load Balance Selection Scheme 為在所有車輛與 Internet Gateway 的 Link Lifetime 差距為單位時間的集合中選出最少使用者的機制,其目的是為了減少頻 寬爭搶之動作,以減少掉包率,增加網路效能,如 Figure 3.10。
Figure 3.9:Before Load Balance Selection Scheme
Figure 3.10:After Load Balance Selection Scheme
3.4.4 虛擬碼
下面我們用 Pseudo-Code 來描述,Gateway Planning 機制的處理方式:
Table 3.4:Parameter Definition in Psedo-Code
Parameter Defination
( Xp,Yp ) The coordinate of Client Vehicle V The vector of Client Vehicle
R The communication range of Internet Gateway[j]
Gateway-Usersj The user numbers connected to Internet Gateway[j] ; 0≦j≦k Time-inj The time car get into the communication range of Internet
Gatewayj ; 0≦j≦k
Time-outj The time car get out the communication range of Internet
31
Gatewayj ; 0≦j≦k
Link Lifetimej The Link Lifetime between car and Internet Gatewayj ; 0≦j≦k
Reserved-Gatewayi The reserving Internet Gateway of car; 0≦i≦h
1
Scheduling (Computing in Cloud) {
If ( Cloud receives the RREQ message ) Then { Call Lifetime ( ( Xp,Yp ) , V);
For ( i ==0;i ≦ h;i++ ){
Call Choose (Link Lifetime, Time-in, Time-out );
Call Update ( Reserving-Gatewayi );
}End of For }//End of Then }//End of Scheduling
19 }//End of Lifetime() 32
33 35
Update ( Reserving-Gatewayi ) {//Reserving information of Internet-Gatewayj
Send reserving information to Reserving-Gatewayi;
32
Choose( Link Lifetime, Time-in, Time-out ) {//choose the Reserving-Gateway
Case 1:Choose the longest Link Lifetime { If ( There has Link Lifetimej bigger then zero ){
For ( j ==1;j ≦ k;j++ ){
Reserving-Gatewayi = the longest Link Lifetimej and least Gateway-Usersj ;
Case 2:Choose the shortest distance { If ( There has no Link Lifetimej≧0 ){
For ( j ==1;j ≦ k;j++ ){
Reserving-Gatewayi = the shortest distance and least Gateway-Usersj ; return Reserving-Gatewayi ;
是否可以預約 Internet Gateway、是否有做到負載帄衡,表格如 Table 3.5。
而在各協定適用之情境將分成三個項目比較,分別是環境中車輛速度、車輛 數量、Internet Gateway 的數量,表格如 Table 3.6。
33
Table 3.5:各協定優缺點比較表
Routing Type
Internet Gateway Selection
Internet Gateway Reservation
Load Balance
GPSR[28] Reactive Closet to the
destination No No AODV+[13] Reactive
Proactive Hop Count No No
Gateway
Planning Reactive
Primary:Link Lifetime Second:Load
Balance
Yes Yes
Table 3.6:各協定適用情境比較表
車輛速度 車輛數量 Internet Gateway 數量
GPSR[28] 慢 多 多
AODV+[13] 慢 多 多
Gateway Planning 快 少 少
34
第四章 數值分析
為了驗證本論文所提出之 Gateway Planning 機制,結合雲端為欲連上 Internet 使用者預約規劃 Internet Gateway,可減少重新找尋 Gateway 的次數,改善 VANET 中傳送資料的產出量( Throughput )與控制訊息成本( Signaling Load )。本章將建 立 Gateway Planning 機制的運作模型所影響的效能表現項目,並利用 Markov Chain 來建立效能分析模型,藉此解釋 Gateway Planning 機制的運作型態與狀態 轉移機率,並以此推導 Gateway Planning 機制的效能評估計算方法。
4.1 數值分析項目
Gateway Planning 機制所影響的效能表現,可由 Figure 4.1 所呈現之 Time Model 來說明。以 Figure 4.1 為例,Client Vehicle 開始運作 Internet Gateway 尋找 程序,尋找第一個 Internet Gateway,以連上 Internet 透過雲端幫忙預約規劃接下 來適合連線之 Internet Gateway。並在確實找到第一個傳輸路徑之後開始與 Internet Gateway 傳輸資料,接收雲端幫忙預約規劃之 Internet Gateway List。因 為雲端幫忙規劃之 Internet Gateway 會以可直接連線之 Internet Gateway 為優先考 量。不需再發送額外的 RREQ 控制訊息搜尋其與 Internet Gateway 間的路徑。因 此,Client Vehicle 是否有透過 Relay 與 Internet Gateway 連線影響著 Client Vehicle 與 Internet Gateway 連線的效能表現。Client Vehicle 與越多不必透過 Relay 就可
Gateway Planning 機制所影響的效能表現,可由 Figure 4.1 所呈現之 Time Model 來說明。以 Figure 4.1 為例,Client Vehicle 開始運作 Internet Gateway 尋找 程序,尋找第一個 Internet Gateway,以連上 Internet 透過雲端幫忙預約規劃接下 來適合連線之 Internet Gateway。並在確實找到第一個傳輸路徑之後開始與 Internet Gateway 傳輸資料,接收雲端幫忙預約規劃之 Internet Gateway List。因 為雲端幫忙規劃之 Internet Gateway 會以可直接連線之 Internet Gateway 為優先考 量。不需再發送額外的 RREQ 控制訊息搜尋其與 Internet Gateway 間的路徑。因 此,Client Vehicle 是否有透過 Relay 與 Internet Gateway 連線影響著 Client Vehicle 與 Internet Gateway 連線的效能表現。Client Vehicle 與越多不必透過 Relay 就可