• 沒有找到結果。

CHAPTER 2 Related Work

2.2 Query-based DTN routing protocol

2.2.1 Locus: A Location-based Data Overlay for

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

works about this kind of request and response pattern research. Then, it describes below:

2.2.1 Locus: A Location-based Data Overlay for Disruption-tolerant

Networks [11]

This research proposed a query mechanism, and use three-tier location area concept (see in Figure 2.a). Let users could look up the relevant information according to its position. Every data object will be given a utility value, and this value will vary with the distance between the creation position of data object and the position of the node which carry this data. Figure 2.b shows the changing of the utility value. If data object near its creation location, the utility of that data object will be high. When nodes encountered, they will change their data objects. Before changing objects, node sorts their data objects by utility value. And the data objects with the higher utility value will be sent first. It is because these data objects were created near here. And this rule would let the data objects be centered on its home area, then, users could query data quickly. But it just use the distance between node and home area, if a node will go out this area, but it is near the home area, encounter node still send data objects to it, then, the transmission is waste. And Locus doesn’t propose an information reply approach, it just uses the multi-copy routing [4][15] to reply data objects.

hemes for D

This resea a copy, Que endliness M ervation wi licate schem

ountered N ue greater th

ives a data ies until it h pose two s ghborhood des encount

ue, the other

a object utili

formance E

DTNs [12]

arch propos ery copy an Metric (FM,

indow) to d me, like the

ode B, Nod han Node A copy of the has only on schemes, W

query spray tered, they

r node gave

ity region Figure 2:

Evaluations

sed a comp d Data reply

it is the av decide the d

e spray phr de A will co A’s, it indicat K copies to ne copy. Thi WSS (W-cop

ying). In W compare th e half query

10 

Locus appr

s of Data-ce

plete appro y. The main verage num data delivery

rase of Spr ompare the ates Node B copies to it

b. U roach [11]

entric Infor

ach of data n contribute mber of nod

y. In Data c ve query sp query have ue first, wh t, and then k

Utility Func

rmation Re

a search ste e of the rese

es it encou copy, they p ait routing.

with Node nter more n A follows t g rule. In Q praying) an e w numbe hich one ha keep spread

ction

etrieval

eps, it inclu earch is they unters durin

propose K-c When Nod B, If Node nodes, and N

this rule to Query copy, nd LNS (L

er copies, w ave the hig ding until w

a, this appr erier. This ld get the a ue might be

2.2.3 Coo

This pape me nodes ca ess Internet a metadata r wants to q fragments.

ldn’t return

single-copy t compare t or query da s decreased roach [12] j s research a

accurate FM inaccurate.

perative Fi

er introduce an use Wi-F t. Every dat

to descript query a data

Like BitTo n to the origi

F

y scheme, t the FM valu ta first, if n

once. Until just use the ssumes the M value. If . Then these a, it has to orrent [23]

inal data.

Figure 3: Hy

11 

g in Hybrid

d DTN routi connects t ivided into e metadata find all the shares rule

ybrid DTN e

L hops to li Node A enc A sends the o

0, it doesn’t T [6] routin ng in a fixd ve in an un

d Deelay To

ing scheme to the Intern

many fragm will be spre metadata o e. But, if o

example [13

imit to que countered N only one qu t spread any ng scheme t d moving pa

npredictable

lerant Netw

e in file sha net, and som ments. And

ead out the of the data t one fragmen

3]

ery spread.

Node B, Nod uery to Nod ymore. In R to reply dat attern, so n e path, the

works [13]

aring. In DT me nodes c

every fragm network. W to downloa nt misses, n

The

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

12 

2.2.4 Searching for Content in Mobile DTNs [14]

This research focuses on query how to forward and how many queries are replicated. They propose an estimation rule to avoid the query replicates too much.

When Node A encountered Node B, Node A will estimate the query had been replicated numbers first. The estimate value is calculated by query hop count and network nodes, then, Node A could get a Utility value ( ), if it greater than a threshold T, Node A could send the query to Node B. If not, Node A couldn’t.

Therefore, if this approach can estimate the query replication number accurately, it will greatly decrease transmission overhead and look up data efficiently. But, they just use common multi-copy routing schemes to reply data. And the simulation result, they don’t have compare with other approaches, so we can’t know how this research performed.

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

13 

CHAPTER 3

Location-Based Content Search Approach

We proposed Location-Based Content Search Approach (LCS) in hybrid DTN to solve the query problem in case of disruptive Internet connection. In our research scenario, all nodes in the network are divided into two types, (1) Online-node and (2) Offline-node. Online-node can connect to the internet to access the remote server, and Offline-node cannot connect to that. All nodes have own database and it includes four tables (see Figure 4), (a) Data Message Table、(b) Encounter Nodes Table、(c) Query Message Table and (d) Reply Message Table. Then we describe below:

(a) Data_table: This table is in charge of the data message storing which is created from node self or received from the other nodes. DataId is the data message unique id, UID is the node id who created this data message, Time is the message creation time or replication time, Data is this message’s content, Sync is whether this message synchronized to the remote server or not. The detail will be described in Section 3.1.

(b) ENs_table: This table is responsible for recording encounter node. UID is the node id of the encounter node, Time is the encounter time, Longitude and Latitude is the encounter location.

(c) Query_table: This table is in charge of the query message storing, if node is

line-node, a ry message yMsg is the ail will be d (d) Reply ated from th que id of thi he reply dat l be describe

Q

In this the d by the o

all query m e unique id e content, is described in y_table: this he node tha is message, ta content, D ed in Sectio

Data_table

Query_table

esis, our go ther nodes

essages are d, Time is t sQueried is

Section 3.2 s table is in at received q Time is thi

e received f this messag whether th 2.

n charge of query mess is message c

the unique

4: Database

the Offline s possible.

from other ge creation his message

f the reply age and had creation tim id of the d

R

e Tables

e-node could In order to

Offline-nod time or re e queried d

message st d match dat me or replica estination n

ENs_table

Reply_table

d get the in o reach this

de. QryId is eplication t data or not.

toring whic ata. RepId is ation time, D node. The d

posed four ery replicat date.

In this the ee parts, Ins

Inside Are ea meters des in differe

er to identif ail see the [ Latitude tw urate to 0.5 P) to calcula

strategies tion strategi

esis, we ass ide Area, B

ea is within s is Border A

ent area use fy the node [26]), this fo wo points to millimeter ate the distan

to solve th ic, (3) Data

sume the ar order Area

Figure 5: T

n a radius o Area and th e different w

position, w formula con o calculate . We use th nce d, if

15 

his problem a reply stra

rea range is and Outside

Three parts

of γ meters he other area

ways to sele we refer to th nsidered the

the shortes he node posi

≤ , it indi a is Outside ect message he Vincenty e earth is ell t distance s ition point a icates the no

a replication Data synch

d we divide it shown as

central, ou e Area. This es and deliv y’s formula[

lipsoid, and s, and the d and the Are ode is in the

n strategic, hronization

ed the area s Figure 5.

utside the In s intention i ver message [26](Formu d use Longi deviation ca ea Central P

e Inside Are , (2)

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

16 

> ≤ + , it indicates the node is in the Border Area, if > + , it means the node is in the Outside Area.

= ( − ∆ ) (1)[26]

When two nodes encounter, they will change their metadata first (shown as Table 1), it includes node’s position, node’s type (Online-node or Offline node), node past moved path point, node encounter nodes, node collected Data message index list, Query message index list and Reply message index list.

Table 1: Metadata format

Category Value Position Longitude, Latitude

TYPE {0,1}

Path {Pt-1, Pt-2}

Encounter {UID1,UID2,…..,UIDn}

Data list {DataId1_UID1_Time1_Sync1,……,DataIdn_UIDn_Timen_Syncn} Query list {QryId1_Time1_isQueried1,…., QryIdn_Timen_isQueriedn} Reply list {RepId1_Time1, RepId2_Time2,….., RepIdn_Timen}

When two nodes encountered, we call ourself as Node A, encounter node as Node B, the Location-based Content Search approach (LCS) workflow is shown as Figure 6, and the transmission protocol is shown as Figure 7. First, Node A and Node B always detect connection, when encountering, Node A will send a metadata request to Node B, after receiving the request, Node B returned its metadata to Node A, when Node A received the metadata from Node B, the first step is check and filer the identical messages from Node A’s database, then keep the message which Node B doesn’t have, and rebuilt that metadata. The next step is Message Selection, it selects the messages which can be sent to Node B. There are three strategies step we

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

17 

proposed to select the messages, (1) Data replication strategic, Node A selected the Data messages according to Node A’s position. The detail description is in Section 3.1.

(2) Data Reply strategic, get the Query message from metadata, if Node A’s database have the queried data message, Node A will generate a Reply message. The detail description is in Section 3.2. (3) Query replication strategic, this strategic must be handled after Data Reply strategic complete, and the queries which queried data shouldn’t send out anymore. The detail description is in Section 3.3. After completing three message selection steps, Node A has chosen the messages which will be sent to Node B. The next step, Node A will check the Data messages which doesn’t synchronize to the remote server. If Node A is an Online-node, it will sync this Data messages to the server, if not, Node A doesn’t do anything, and the detail will be described in Section 3.4. Before sending messages to Node B, Node A has to schedule to messages which will be sent first. Because of the contact time of two nodes are short, it couldn’t send all the messages to the other nodes. Therefore, how send the messages to the encounter node efficiency, it is shown in Section 3.5. Then, Node A sends the selection message queue to Node B. As Node B receiving, it will check the Data messages whether it sync to server or not. If Node B is an Online-node, then sync the message to server, if not, skip this action, and then finish this contact.

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

18 

 

Figure 6: LCS workflow

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

19 

  Figure 7: LCS transmission protocol

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

20 

3.1 Data replication strategic

When two nodes encountered in the map, the processing step can be seen in Figure 8, and the selection rule is shown in Formula 2, (1) If the distance d between Node A and Area Central Point (CP) is less than or equal to radius γ, it indicates Node A is in the Inside Area. When Node A encountered Node B, it will add all the Data messages into the Data dataset D_set to prepare to send to the Node B. The main purpose is let the Inside Area fulfill with related Data messages. If any node wondered to query in this area, it can get the Data messages quickly and has high query success rate. But the encounter time of the two nodes and the transmission are limited, two nodes have to change itself metadata before transport. Then, Node A skips the identical Data messages, and adds the others into D_set; (2) If the distance d between Node A and CP is greater than radius γ and less than γ + , it indicates Node A is in the Border Area. According to Node B’s past path, if ∆ . < 0, it indicates Node B will likely enter to the Inside Area, then, Node A add the Data messages into the D_set; (3) if the distance d between Node A and CP is greater than γ + , it indicates Node A is in the Outside Area, then, Node A shouldn’t do anything.

We use ∆ . to predict whether Node B’s will enter to the Inside Area or not.

In Formula 3, . is the distance between Node B position Pt-1 and CP at time t-1, and . is the distance between Node B position Pt-2 and CP at time t-2.

Then, subtract . from . , if the result is less than 0, it means Node B is likely to enter to the Inside Area, if the result is granter then 0, it means Node B is likely to move away from the Inside Area.

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

21 

( , _ ) =

, . ≤

, . > . ≤ +

2 ∆ . < 0

,

(2)

∆ . = ( . − . ) (3)

In order to avoid data overflow, we set all the Data messages a storing time TTS (Time-to-Store) (Formula 4). TTS means the time of any message be created or replicated then store in some node. When TTS expired, the messages will drop anymore. Therefore, it can reduce the node loading.

( ) = , _ _

, ℎ (4)

 

Otherwise, if Node B is an Online-node, Node A doesn’t need to send Data messages to Node B. Because the Online-node can connect to the Internet to get the messages by itself, it doesn’t require wasting the resource to send messages.

 

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

22 

  Figure 8: Data replication strategic flow chart

 

3.2 Query replication strategic

This strategic has to do after the Data reply strategic, and the goal of this strategic is let user queried data in a shortest time. This is a three-tier Query strategic, from Node A’s local database to Node B’s local database then remote server. Query replication detail rule can see in Formula 5 and Figure 9 flow chart. When Node A receiving query messages, it has to check the database whether the query messages have the match data. If has, it doesn’t need to do Query replication, if not, there are some rules to do. (1) Node A is an Online-node. It does nothing. (2) Node A is an

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

23 

Offline-node. When Node A in the Inside Area, and then adds all the related Query messages to the Query dataset Q_set; When Node A in the Border Area, then Node A has to predict Node B’s direction ( . , the detail can see in Section 3.1, and also is shown in Formula 3), if . less than 0, it indicates Node B is likely to enter to the Inside Area, then, add the related Query messages to the Q_set. If not, then do nothing. The main purpose is Data replication strategic will centralize the related Data messages in the Inside Area. Therefore, we send the queries to the Inside Area, and there is more opportunity to query success. It has two reasons. One, There are many related messages in the Inside Area. The other, if any node leave from Inside Area, we expect it could carry much more related messages; When Node A in the Outside Area, it shouldn’t do anything.

In addition, if the query represents it had been queried ( . = ), then we don’t have to add this query into the Q_set.

( , _ ) =

, .

, . > . ≤ +

2 . < 0 ,

, ,

( ) =

. =

(5)

 

However, if we don’t have any limitation of replicate query message, it will keep replicating in spite of it has queried. Therefore, we need a mechanism to stop it. Every Query messages set a TTS, if the TTS expired (Formula 6), and then drop it. This way will inhibit query replication. There are some defects in the way. If TTS is too short, it would query data hardly. If TTS is too long, it would still create many query copies.

So we add one more rule. If query message find the match data, this query message’s attribute isQueried will be change to TRUE. And next time, nodes encountered, they

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

24 

change their metadata, then nodes will know what query message had been queried, and it will skip it to add to Q_set.

( ) = , _ _

, ℎ (6)

       

Figure 9: Query replication strategic flow chart

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

25 

3.3 Data Reply strategic

As shown in Figure 11. Node A received Node B’s metadata, it will check all query messages of Node B’s metadata. If Node A has the match data, it will generate a Reply data R_data of the Query message and change the Query message attribute isQueried to TRUE, then we can call Node A as Replier.

It is difficult to send the Reply data to the Querier. Because all nodes in the network are keeping moving, we can’t use the original packet delivery path to send back to the Querier. Therefore, we have to use the other rule to send Reply data.

Replier (Node A) can know the Querier’s location from Query message, and send the Reply data to that location. But, as time goes by, Querier may not still stay there. So, when Replier (Node A) encounters other node (Node B), it will check the Encounter Table of Node B whether it had encountered Querier or not. If it had, we will check the encounter time whose close the recent time. If Node B’s encounter time close, we will update (Formula 7) the Querier position of Replier’s (Node A) metadata.

( . )

= , ( _ ) ( . > . )

,

(7)

Then we have to distinguish which Node will move toward to the Querier, see the Formula 8, if Replier (Node A) won’t move toward to the Querier but Node B will do, it would add the R_data to the Reply dataset R_set. Otherwise, Replier (Node A) will move toward to the Querier but Node B won’t, it just keeps the R_data and does nothing.

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

26 

( _ , _ )

=

, ,

. ( ) = . ( ) =

. ( ) = . ( ) =

,, ,

& ( > )

& ( > )

(8)

If Replier (Node A) and Node B are moving the same direction and forward to the Querier, we have to calculate whose moving path will close to the Querier. In Figure 10, we can use the position Pnow , the past position Pt-1 to determine this node’s moving direction, then we add the Querier position Pq and use the basic Triangle Area formula (Formula 9) to calculate the area value , as we know the distance between Pnow and Pt-1, we can get the close Querier distance D. If Da greater than Db, it indicates Node B will move close to the Querier, then we add the R_data to the R_set and waiting for transmission. Otherwise, If Da less than Db, it indicates Replier (Node A) will move close to it, then we just keep the R_data and moving.

= 1

2 (9)

However, we could not replicate messages unlimited, so we have to make some rule to inhibit it. All the Reply data will set a TTS, when the TTS expired or R_data had forwarded to the querier , this message R_data will drop anymore (Formula 10).

( _ ) =

, _ _

, _ ℎ ℎ

, ℎ

(10)

 

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

27 

  Figure 10: Moving direction and the relative distance

 

Figure 11: Data reply strategic flow chart

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

28 

3.4 Data synchronization and update strategic

Whatever Online-node or Offline-node, it would create data messages. Beside keeping the data in local database, it has to upload this data messages to the remote server to share this information. Figure 12 shows this strategic. When node received messages, the first step is distinguishing the type of node, if it is Online-node, it should upload all the data messages which doesn’t sync to the remote server directly.

Then change the Sync attribute of this data message to TRUE. Otherwise, if it is

Then change the Sync attribute of this data message to TRUE. Otherwise, if it is

相關文件