Giter Club home page Giter Club logo

ndn-wsn's Introduction

内容

NDN-WSN

一个基于NDN**的无线传感器网络的设计与实现,采用Tinyos实现。

-使用CTP协议作为底层协议,然后再生成的汇聚树上面构造FIB表与NDN策略。

-NDN命名规则依据地理位置(传感器节点的经纬度)。不同于传统NDN字符串形式,通过地理位置信息判断数据的转发路径。

项目提供了代码的基本实现以及TOSSIM测试用例。

  • /NDN-WSN/ndn/ -------核心代码的实现
  • /NDN-WSN/test/-------一个测试用例
  • /NDN-WSN/picture/-----测试截图

/NDN-WSN/ndn

代码的具体实现,主要分为三个模块:

  • 底层 CTP启动模块,用来启动CTP协议,同时指定根节点。构造汇聚树。
  • 数据读取模块,读取传感器数据。
  • 数据刷新模块,定时刷新网络中FIB表,CS表以及PIT表。
  • NDN策略模块,核心模块,实现NDN的基本策略,包括FIB表的构造,以及接收Interest包和Data包的处理。

代码结构


/ndn/config.h
/ndn/content.nc
/ndn/funcitonsP.nc
/ndn/ndn.nc
/ndn/ndnC.nc
/ndn/ndnWsn.nc
/ndn/net.nc
/ndn/netC.nc
/ndn/readData.nc
/ndn/readDataC.nc
/ndn/refresh.nc
/ndn/refreshC.nc
/ndn/strategy.nc
/ndn/strategyP.nc

CTP启动模块

具体文件


/ndn/net.nc
/ndn/netC.nc

  提供了底层CTP协议的相关功能,启动CTP以及设置根节点。提供net接口,netC模块具体实现接口功能。

数据读取模块

具体文件


/ndn/readData.nc
/ndn/readDataC.nc

  开启传感器读取数据功能。提供readData接口,可以获得三种数据,分别为光强,温度以及湿度。readDataC模块实现接口具体功能。

数据刷新模块

具体文件


/ndn/refresh.nc
/ndn/refreshC.nc

  因为CTP协议的特性,无线传感器网络的拓扑结构会因为节点间的通信质量作出相应改变。因此我们需要刷新FIB表从而根据新的拓扑结构重新构造FIB表。   同时由于NDN的CS缓冲特性,当有请求新数据Interest包时,会根据规则从就近节点的CS表中构造Data数据包返回,这样会造成无法获得最新的数据,定时刷新CS表和PIT表是为了获取新的数据。   提供refresh接口,refreshC模块实现接口具体功能。

NDN策略模块

具体文件


/ndn/strategy.nc
/ndn/strategyP.nc

  核心模块,主要包括FIB表的建立以及NDN策略的制定。因为采用的是地理位置的命名形式。不同于以往NDN的字符串匹配规则,我们通过为节点创建路由能力,来完成数据包转发的判断。   路由能力实际指的是节点管理区域的范围,表现形式为两个点划出的矩形区域。当查询某一节点的数据发出请求后,收到该请求的节点会根据自己的路由能力判断被查询节点的位置是否在自己的路由能力内,然后进行转发。路由能力的初始值为自己的地理位置。表现形式为一个点。    FIB表的建立:当使用CTP协议构造完一棵汇聚树的时候,开始构建FIB表。每一个节点向自己的父亲节点发送自己的路由能力。节点根据收到的路由能力更新自己的路由能力,同时将收到的路由能力信息加入到自己的FIB表当中。   对于Interest包和Data包的处理和传统NDN是一样的。

其它文件

具体文件

 
/ndn/content.nc
/ndn/funcitonsP.nc
/ndn/ndn.nc
/ndn/ndnC.nc
/ndn/ndnWsn.nc
 
 

功能性模块和封装模块。


  /NDN-WSN/test

测试文件

文件结构

  测试文件,一个简答的测试用例,构造NDN策略,然后让节点1广播Interest数据包查询节点信息。   代码结构   

  
  /test/Makefile
  /test/test.py
  /test/meyer-heavy.txt
  /test/topo.txt
  /test/testAppC.nc
  /test/testC.nc
  
     testC.nc,testAppC.nc和Makefile文件是具体的实现文件,其它文件为TOSSIM仿真文件

仿真测试

将/NDN-WSN/test/文件夹内的文件拷贝到/NDN-WSN/ndn/文件夹内,然后:


make micaz sim
python test.py

执行

ndn-wsn's People

Contributors

ptrdu avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.