Top Banner
Sensor Module Mamma Sim 李 李 李 695430070
31

Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

Dec 21, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

Sensor Module - MammaSim

李 俊 廷

695430070

Page 2: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

Outline

Introduction Motivation Sensor module (MannaSim) Extension

Page 3: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

Outline

Introduction Motivation Sensor module (MannaSim) Extension

Page 4: Sensor Module - MammaSim 李 俊 廷 695430070. 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.

Page 5: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

Wireless Sensor Nodes

Page 6: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

Ubiquitous

Page 7: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

Outline

Introduction Motivation Sensor module (MannaSim) Extension

Page 8: Sensor Module - MammaSim 李 俊 廷 695430070. 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

Page 9: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

WSN is application-specific

高 低

Page 10: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

Wireless multimedia sensor networks

If it is feasible. Task scheduling In-network processing

Multimedia source coding techniques

Page 11: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

My goal in this lesson

1. 找個 sensor module for NS2 (MannaSim)

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

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

Page 12: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

Scenario

Sensor NodeWireless

Access PointVideo Server

?Intern

et

Page 13: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

Outline

Introduction Motivation Sensor module (MannaSim) Extension

Page 14: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

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

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

Page 15: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

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

o flavors : ns-2.29 Patch MannaSim Source Code

Page 16: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

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

Page 17: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

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.

Page 18: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

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

Page 19: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

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.

Page 20: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

MannaSim Scripts Generator

Page 21: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

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

Page 22: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

MannaSim classes Sensor Node DataGenerator TemperatureDataGenerat

or TemperatureAppData Processing SensedData

OnDemandData OnDemandParameter SensorBaseApp CommonNodeApp ClusterHeadApp

Page 23: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

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.

Page 24: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

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

Page 25: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

Outline

Introduction Motivation Sensor module (MannaSim) Extension

Page 26: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

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

Sensor NodeWireless

Access PointVideo Server

Internet

Sensor node

BS

User

Internet

Page 27: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

Extension (con.)

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

Page 28: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

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 …

Page 29: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

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

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

Page 30: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

EvalVid

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

Page 31: Sensor Module - MammaSim 李 俊 廷 695430070. Outline Introduction Motivation Sensor module (MannaSim) Extension.

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中所設定的檔案。