基于数据命名为中心的无线传感器网络异步休眠调度方法_3

文档序号:9353380阅读:来源:国知局
图6所示,具体步 骤如下:
[0128] A1-1.节点1通过Sendlnterest函数发送interest请求包至节点2 ;
[0129] A1-2?节点 2 通过 ContentStoreFinder 函数在其 Content Store 中查找 interest 是否有匹配项存在;
[0130] A1-3.若存在,则节点 2 调用 SendMessageFromContentStore 函数,将 Content Store中interest对应的Data包进行返回给节点1 ;
[0131] A1-4.节点1收到Data信息包后,进行内容的查看,并且通过InsertContentStore 函数将返回的Data包存储到其Content Store中。
[0132] 情况2 :节点1发送Interest包到达节点2后,节点2中Content Store中没有 存储匹配其 interestName 的 Data 的数据包,则将 interest 交给 Pending Interest Table 进行处理。如图7所示,具体步骤如下:
[0133] A2-1.节点1通过Sendlnterest函数发送interest请求包至节点2 ;
[0134] A2-2?节点 2 通过 ContentStoreFinder 函数在其 Content Store 中查找 interest 是否有匹配项存在;
[0135] A2-3?若不存在,则将节点1发送的interest请求包交给Pending Interest Table进行处理
[0136] B.若节点2中经过Content Store处理后,将节点1的interest请求包交给节点 2的Pending Interest Table处理,可以分为两种情况:
[0137] 情况1 :节点2Pending Interest Table中查找节点1的interest请求包,若存 在,说明节点1之前发来过请求包,则将节点1的interest请求包中的节点号存入Pending Interest Table中对应interest项的IncomingQueue队列结构中,如图8所;^,具体步骤 如下:
[0138] B1-1?节点 2 中通过 PendingTableFindlnterest 函数在其 Pending Interest Table中查找节点1的interest请求包是否存在;
[0139] B1-2.若存在,则说明interest请求包已经到达过节点2。节点2通过 InsertlncomingPIT函数将节点1的interest请求包中的节点号存入Pending Interest Table中对应interest项的IncomingQueue队列结构中;
[0140] B1-3.节点1发送的interest请求数据整个过程结束,此interest请求包生命周 期结束。
[0141] 情况2 :节点2的Pending Interest Table中查找节点1的interest请求包,若 不存在,则将节点1此次发来的interest请求包添加进Pending Interest Table中,并且 同时将节点1的interest交给Forwarding Information Base进行处理。如果9所不;,具 体步骤如下:
[0142] B2-1?节点 2 中通过 PendingTableFindlnterest 函数在其 Pending Interest Table中查找节点1的interest请求包是否存在。
[0143] B2-2.若不存在,贝说明interest请求包从未到达过节点2。节点2通过 InsertNamePIT 函数将节点 1 的 interest 请求包存入 Pending Interest Table 中。
[0144] B2-3.将节点 1 的 interest 请求包交给节点 2 的 Forwarding Information Base 进行处理。
[0145] C.若节点2中Pending Interest Table处理后,将节点1的interest交给节点 2的Forwarding Information Base处理,则可以分为两种情况:
[0146] 情况 1 :节点 2 的 Forwarding Information Base 中查找节点 1 的 interest 请求 包,若不存在,说明节点1之前没有发来过请求包,则节点2将此次发来的interest存入 Forwarding Information Base中,并且将节点1发送的interest进行广播,最后再等待下 一跳节点(如:节点3)进行认证。如图10所示,具体步骤为:
[0147] C1-1?节点 2 通过 ForwardingTableFinder 函数在其 Forwarding Information Base中查找节点1的interest请求包是否存在。
[0148] C1-2.若不存在,说明节点1的interest第一次从节点2进行转发,贝节点2会调 用 InsertlnterestFIB 函数将此 interest 存入 Forwarding Information Base 中,并且将 节点1发送的interest进行广播。
[0149] C1-3.等待下一跳节点(如:节点3)进行ACK确认后继续处理。
[0150] 情况 2 :节点 2 的 Forwarding Information Base 中查找节点 1 的 interest 请 求包,若存在,则节点2根据Forwarding Information Base中interest对应的表项中 OutcomingQueue中已有下一跳节点号(如:节点3)进行转发如图11所示,具体步骤为:
[0151] C2-1?节点 2 通过 ForwardingTableFinder 函数在其 Forwarding Information Base中查找节点1的interest请求包是否存在
[0152] C2-2?若存在,则节点2调用Forwardinglnterest函数,并且根据Forwarding Information Base中interest对应的表项中OutcomingQueue中下一跳节点号(如:节点 3)进行转发。
[0153] D.若节点 2 中 Forwarding Information Base 处理后,则将节点 1 的 interest 通 过节点2广播发送出去后,可能出现两种情况:
[0154] 情况1 :若节点3第一次接收到通过节点2发送的节点1的interest请求包,贝1J 如图12所示,具体步骤如下:
[0155] D1-1?节点 2 通过 Forwarding Information Base 发送节点 1 的 interest 进行广 播发送;
[0156] D1-2.若节点3接收到interest后,经过节点3的Pending Interest Table调用 PendingTableFindlnterest ;
[0157] D1-3.经过步骤D1-2后,节点3从未收到过节点2发送的节点1的interest请求 包,则节点3返回给节点2ACK确认包;
[0158] D1-4?节点2接收到ACK确认包后,将节点2中Forwarding Information Base中 节点1请求的interest对应的项中OutcomingQueue队列中增加节点3的节点号,以便后 续使用。
[0159] 情况2 :若节点3没有收到或者已经收到过通过节点2发送的节点1的interest 请求包,则不用返回ACK确认包。如图13所示,具体步骤如下:
[0160] D2-1?节点 2 通过 Forwarding Information Base 发送节点 1 的 interest 进行广 播发送
[0161] D2-2.若节点3接收到interest后,经过节点3的Pending Interest Table调用 PendingTableFindlnterest,若没有接受到interest请求包,则不做任何处理。
[0162] D2-3?经过步骤D2-2后,节点3在其Pending Interest Table查找到节点1的 interest,则不返回ACK确认包。
[0163] 信息包的生命周期包括:
[0164] 由于interest请求包在其生命周期过程中留下了"面包肩",所以Data信息包的 生命周期过程相对较简单,如图14所示。具体步骤如下:
[0165] (1)节点2回传节点1的interest包匹配的数据Data包;
[0166] (2)节点 1 调用函数 PendingTableFindData 在其 Pending Interest Table 中查 看节点1是否对此信息包进行了 Interest请求包的发送。
[0167] (3)若⑵查询失败,即此Data包不是节点1的interest所请求的数据包,贝1J Data信息包被丢弃,Data包返回过程结束;
[0168] (4)若⑵查询成功,则节点1将调用SendDataFromPIT函数,并利用Pending Interest Table中查找到的Interest中IncomingQueue队列中的节点ID,进行Data信息 包回传;
[0169] (5)回传的同时,节点1调用InsertContentStore将回传的Data信息包暂存入其 Content Store中,以便后续使用。
[0170] 异步休眠调度方法:
[0171] 本发明的另一方面,根据前面提出的命名数据网络的特点,提供了一种异步休眠 调度策略,包括路由建立及请求数据阶段、休眠调度阶段、信息包回传阶段。具体包括如下 步骤:
[0172] 步骤一,路由建立及请求数据阶段:
[0173] 首先进行路由的建立,整个系统是基于消费者(Consumer-Driver)请求的方式, 所以从汇聚节点出发进行interest请求包的请求。
[0174] 步骤S10,汇聚节点发出interest请求包,其中interest包中包括数据包的类型、 请求的目的节点、请求的数据类型、请求的数据包的批次号、此节点的上一跳节点号以及一 个随机数。其中数据包类型为1表示为请求数据包;请求数据类型为1温度、2湿度、3光 照、4电压,实验中以电压为例;数据包批次从1开始;
[0175] 步骤S11,节点1判断是否收到interest请求包,如果是则执行第S12步骤;
[0176] 步骤S12,在节点1中进行Content Store的查询,查看interest是否在其中已经 存在,如果查找成功,则执行步骤S13,否则执行步骤S14 ;
[0177] 步骤S13,直接回传给汇聚节点数据,不需要进行路由建立;执行步骤S30 ;
[0178] 步骤S14,节点1将interest请求包交给此节点的Pending Interest Table 进行查询,查看interest是否在其中已经存在,如果查找成功,则执行步骤S13,将此 interest的中存储的上一跳节点号存放在Pending Interest Table中interest对应项的 IncomingQueue队列中,路由建立结束;如果查找失败,则执行步骤S16 ;
[0179] 步骤S15,节点1将此interest的中存储的上一跳节点号(本例中为汇聚节点号) 存放在Pending Interest Table中interest对应项的IncomingQueue队列中,路由建立 结束;
[0180] 步骤S16,节点1将interest请求包交给此节点的Forwarding Information Base进行查询,查看interest是否在其中已经存在。如果查询成功,则执行步骤S17 ;根据 interest 在 Forwarding Information Base 中对应项的 OutcomingQueue 中 ID 号,直接对 此interest进行转发,路由建立结束;如果查询失败,则执行步骤S18 ;
[0181] 步骤 S17,节点 1 根据 interest 在 Forwarding Information Base 中对应项的 OutcomingQueue中ID号,直接对此interest进行转发,路由建立结束;
[0182] 步骤 S18,节点 1 的 Forwarding Information Base 表中无此 interest 项,则首先 将此 interest 添加进 Forward
当前第3页1 2 3 4 5 
网友询问留言 已有0条留言
  • 还没有人留言评论。精彩留言会获得点赞!
1