sensor module - mammasim 李 俊 廷 695430070. outline introduction motivation sensor module...

31
Sensor Module Mamma Sim 李 李 李 695430070

Post on 21-Dec-2015

231 views

Category:

Documents


0 download

TRANSCRIPT

Sensor Module - MammaSim

李 俊 廷

695430070

Outline

Introduction Motivation Sensor module (MannaSim) Extension

Outline

Introduction Motivation Sensor module (MannaSim) Extension

Introduction Wireless Sensor Network (WSN), an emerging

technology comprising of sensing, computing, and internetworking, was nominated as one of the ten most potential technologies changing our world by MIT technology Review.

A WSN tends to be composed of hundreds or thousand of sensor nodes, which are launched over an environment to form a wireless ad hoc network.

The goal of a WSN is to monitor and sometimes to control an environment.

Wireless Sensor Nodes

Ubiquitous

Outline

Introduction Motivation Sensor module (MannaSim) Extension

Wireless multimedia sensor networks

Is it feasible ? High bandwidth demand

Power consumption

Application-specific QoS requirements Ex: picture, media stream, real-time …

Multimedia coverage

Integration with other wireless technologies

WSN is application-specific

高 低

Wireless multimedia sensor networks

If it is feasible. Task scheduling In-network processing

Multimedia source coding techniques

My goal in this lesson

1. 找個 sensor module for NS2 (MannaSim)

2. 測試所提出的網路架構對多媒體 ( 影音串流 ) 的效能影響,找個影像程式加到 sensor module (MyEvalVid)

3. 實際傳送影像來分析其效能

Scenario

Sensor NodeWireless

Access PointVideo Server

?Intern

et

Outline

Introduction Motivation Sensor module (MannaSim) Extension

Why MannaSim ? 安裝簡單 提供 Script Generator Tool 自動產生 TCL 程式碼 (u

se Java, like nsBench) 有提供 flat 跟 hierarchical 的網路架構 容易擴充

Downloading and installing MannaSim Framework The MannaSim Framework is provided in tw

o flavors : ns-2.29 Patch MannaSim Source Code

ns-2.29 Patch This is the simplest way to install Mannasim in an

unmodified ns-2.29 distribution. 1. Get ns-2.29 all-in-one package from ns site.

http://sourceforge.net/project/showfiles.php?group_id=149743&package_id=169689&release_id=371538

2. Get MannaSim Framework ns-2.29 patch. http://www.mannasim.dcc.ufmg.br/download/mannasim-patch-ns2.29.tar.gz

3. Type the following command on the ns-allinone-2.29 folder: patch -p1 < mannasim-patch.diff

4. Install ns-2.29 as usual typing ns-allinone-2.29 folder: ./install

MannaSim Source Code This version is intended for users whose NS-2.2

9 distribution has already been changed. 1. Get ns-2.29 all-in-one package from ns site.

2. Get MannaSim Framework tar.gz file. http://www.mannasim.dcc.ufmg.br/download/mannasim-src-ns2.29.tar.gz

3. Unpack the tar.gz file into ns-2.29 main folder (if using ns all-in-one distribution ns-allinone-2.29/ns-2.29 folder). Inside mannasim/ folder just created look for a ns-modified-files/ folder. where ns-2.29 modified files are stored.

MannaSim Source Code (con.)

4. Substitue ns-2.29 files listed bellow by it's MannaSim version stored in ns-modified-files/ folder in mannasim/ directory.

ns-2.29/apps/udp.cc ns-2.29/common/ns-process.h ns-2.29/common/packet.cc ns-2.29/common/packet.h ns-2.29/mac/mac-802_11.cc ns-2.29/tcl/lib/ns-lib.tcl ns-2.29/tcl/lib/ns-default.tcl ns-2.29/Makefile.in

5. In ns-2.29 main folder re-run configuration script and then re-compile the system: ./configure./make

Install problem MannaSim 附的 mac-802_11.cc 可能有問題,如果

安裝失敗,用原始的 mac-802_11.cc 覆蓋過去,再重新 make

void Mac802_11::send(Packet *p, Handler *h){ ... if(mhBackoff_.busy() == 0) { if(is_idle()) { ... if((u_int32_t)ETHER_ADDR(dh->dh_ra) == MAC_BROADCAST){ mhBackoff_.start(cw_, is_idle()); }else{ if(mhDefer_.busy() == 0) { rTime = (Random::random() % cw_) * (phymib_.getSlotTime()); mhDefer_.start(phymib_.getDIFS() + rTime); } ...

This code permits that MAC still uses backoff in the case of MAC idles and broadcasting.Guarantee in an On Demand network simulation the sensor nodes don't loose broadcast messages.

MannaSim Scripts Generator

Next test Install MannaSim 利用 Scripts Generator 產生 tcl 執行 tcl 是否成功

MannaSim classes Sensor Node DataGenerator TemperatureDataGenerat

or TemperatureAppData Processing SensedData

OnDemandData OnDemandParameter SensorBaseApp CommonNodeApp ClusterHeadApp

Important Class Sensor Node Class

It extends NS-2 MobileNode class adding specific sensor nodes characteristics as power consumption for sensing and processing activities.

DataGenerator Class With methods to adjusts sensing interval and sensing ty

pe. Type : PROGRAMED 、 CONTINUOUS 、 ON_DEMAND 、 EVENT_DR

IVEN TemperatureDataGenerator and CarbonMonoxideDataGenerat

or inherit DataGenerator class.

Important Class (con.)

Battery Class It extends NS-2 EnergyModel class. The class contains methods to turn sensor node on and of

f, put it into sleep and wake it up. Also contains methods to decrease energy when a sensing, processing or disseminating job is performed by the sensor node.

SensedData Class It acts as dissemination message for processed data witc

h is stored in a data buffer. The class provides networking information such as sourc

e node identification, message type, message priority among others.

OnDemandData inherit SensedData

Outline

Introduction Motivation Sensor module (MannaSim) Extension

Extension 將簡單環境擴展到複雜環境

Sensor NodeWireless

Access PointVideo Server

Internet

Sensor node

BS

User

Internet

Extension (con.)

將簡單架構擴展到複雜架構

Extension (con.)

加入 real-time scheduling Techniques for allocating and scheduling tasks on proces

sors to ensure that deadlines are met. Ex: rate-monotonic (RM) scheduling algorithm 、 earliest

deadline first (EDF) algorithm …

補充 MyEvalvid 結合了 Evalvid 和 NS2 這兩個工具 Evalvid 是一套由德國人發明的多媒體品質評估工具,

主要功能是讓研究人員可以經過實際網路或模擬去驗證所提出來的網路相關技術對多媒體串流品質的影響

EvalVid

Source (video raw data) VS (Video Sender) ET (Evaluate Trace) FV (Fix Video) PSNR

MyEvalvid

myEvalvid

my_UDP

myEvalvid _Sink

Sink

Parser

myEvalvid : 讀取經 Parser 處理過後的影片記錄檔,並把記錄檔中每一個畫面切割成較小區段,在設定好的時間把這些區段往 UDP 層傳送 my_UDP : 只是 UDP agent 的延伸, my_UDP agent 把封包傳送時間、封包辨識和封包大小記錄在 TCL scrip 中所設定的檔案。 myEvalvid_Sink : 接收 my_UDP 所傳送出來的封包,並且紀錄接收時間、封包辨識和封包大小記錄在 TCL scrip中所設定的檔案。