Professional Documents
Culture Documents
(Middleware) "
-1614
2012
.
/
1.
2.
3.
,
, , , , ,
.
.
, ,
.
,
, ,
.
,
.
, -(middleware)
.
.
.
.
,
, TinyOS. ,
Agilla .
TOSSIM,
TinyOS. , TinyViz
.
,
Agilla TinyOS
Agilla TinyViz AgentInjector.
, , (tutorial)
.
................................................................................................................................ 7
1: ................................................................ 10
1.1 .............................................................. 10
1.2 .......................................................................................................................... 11
1.3 Ad-Hoc ........................................ 13
1.4 ................................... 14
2: ................................................................ 15
2.1 ........................................................................................................... 18
2.2 ............................................................................................. 20
2.3 ...................................................................................................................... 23
2.4 .......................................................................................................... 25
2.5 .................................................................................................................. 26
2.6 .............................................................................................................. 27
2.7 ..................................................................................................... 28
3: ....................... 30
3.1 ................................................................................................................. 30
3.2 ........................................................................................................... 30
3.3 .................................................................................................................... 31
3.4 .................................................................................................................... 31
3.5 .............................................................................................. 32
3.6 ................................................................................................................................. 35
3.7 ....................................................................................................................... 35
3.8 ............................................................................................................. 36
3.8.1 ......................................................................................................................... 37
3.8.2 .................................................................................................... 37
3.9 .................................................................. 37
3.9.1 To E (Physical Layer)................................................................................... 38
3.9.2 To (Data Link Layer) .............................................................. 38
3.9.3 (Network Layer) ................................................................................. 39
3.9.4 (Transport Layer) ........................................................................ 40
1 : (WSNs)
11
2 :
18
3 : WSNs
19
4 : WSNs a
20
5 :
21
6 : WSNs
22
7 :
23
8 :
24
9 : WSNs
25
10 :
26
11 :
27
12 :
28
13 :
29
14 : WSNs
33
15 : -layers WSNs
38
16 :
42
17:
42
18 :
43
47
20 : : )
)
48
21 : Agilla
48
22 : Agilla
49
23 : agent Agilla
50
24 : Mires
52
25 : Mires
52
26 : topic advertisement
53
27 :
54
28 : DSWare
57
29 : DSWare
58
30 : MiLAN
61
31 : Mate
64
32 : MiLAN
66
33 : WSN. a)
, b) , c)
, d)
69
72
35 : Environment Variables
System Properties class path
73
36 : TinyOS
74
74
38 : locate-jre
75
39 : compile java
75
40 : JNI
75
41 : tos-check-env
76
42 : Makefile.Agilla
77
79
44 : Agilla
80
45 : SerialForwarder localhost
80
81
47 : Agilla
Serial Forwarder
82
48 : Agilla
Agent Injector
83
49 : TestTinyVIz
84
50 : TestTinyViz
85
86
87
1:
1.1
.
. ,
,
. ,
,
(Wireless Sensor Networks - WSNs).
(WSNs)
,
. ,
.
,
.
,
,
. [1]
, (WSNs)
sink ( base station)
(sensor nodes), .
,
, . ,
, , , ,
.. ,
sink. , sink
(queries) ,
. [2]
,
.
.
,
. [3]
10
1: (WSNs)
1.2
,
, , , ,
, , ,
.
.
,
.
.
.
11
.
multi-hop
.
hop
.
. ,
,
.
,
.
.
.
,
.
.
. ,
.
.
.
Rk(t)
Poisson
(0,t) :
Rk t exp( k t )
k t k
.
.
. ,
,
.
.
.
12
.
,
,
.
,
,
.
, ,
.
,
& ,
.
, . .
.
.
.
,
.
bits, ,
.
1.3 Ad-Hoc
adhoc .
:
:
ad-hoc .
13
:
.
: , ad-hoc
.
: ad-hoc point-topoint, meshnetworking.
:
, ,
.
:
,
ad-hoc .
:
(MAC/IP )
ad-hoc .
: ad-hoc ,
.
: .
ad-hoc .
1.4
. .
.
:
/ -
- bit (,
),
- (
).
.,
,
14
, ,
.,
/.
,
,
.
.
, , . ,
, .
,
,
gateway.
coverage. , .
bandwidth
.
, .
2:
, ,
, , , ,
:
.
15
,
.
,
, ,
. -
.
, , , .
, , .
,
: ,
, ,
, , , , .,
,
, , ,
.
. - -
.
,
,
, GPS
.
.
,
, , .
- -
, 21
.
16
(, )
. , ,
,
.
, ,
.
.
. .
(, , , .)
( , ,
)
,
.
, , ,
,
(
, . ),
(), ,
.
,
-
.
,
,
.
,
(, )
. [4]
17
2 :
2.1
, , , , ,
, .
, , - ,
.
,
,
.
,
, ,
, , ,
, () .
:
. , ,
.
18
.
.
: , ,
.
,
.
:
,
.
:
.
:
.
: ,
( )
.
,
, .
.
3 : WSNs
19
2.2
, ,
, ,
, ,
, ,
, ,
, ,
, .
:
, ,
.
.
.
, .
4 : WSNs
:
. [5]
,
.
,
20
, ,
.
5 :
, ..
,
. ,
.
James . [6]
25-100
.
:
ALERT [7] .
ALERT ,
.
. ,
COUGAR [8],
.
: WSNs
, ..
.
21
6 : WSNs
, ,
(Precision Agriculture). ,
, (data acquisition)
,
(.. , , ..)
( ),
.
, (2011)
,
, .
, ,
,
() () ()
.
()
.[25]
22
7 :
2.3
:
, , ,
,
,
.
:
, .
, .. .
.
.
Faculty Grenoble
.
23
8 :
:
.
.
.
,
.
:
,
.
..
24
9 : WSNs
2.4
.
,
, , ..
, , . ,
, .
, WSNs
, , ,
. ,
,
. ,
WSNs.
WSNs
,
,
25
.
, WSNs
,
.
10 :
2.5
: ,
,
, , .
.
.
:
. . ,
.
, ,
26
.
.
.. ,
.
-,
-, .
Georgia. ,
.
11 :
2.6
.
.
. master node ,
.
,
.
.
,
, .
(
, ) - (
,
27
).
,
.
,
. , .
. ,
.
12 :
SOSUS (Sound
Surveillance System, ).
1950, ,
(). SOSUS ,
, .
2.7
, , ,
28
, ,
,
, ,
, ,
,
, , ,
, .
:
.
(.
).
.
BTUs ,
$55
35 . .
:
.
. ,
.
.
:
.
.
13 :
29
3:
3.1
,
, ,
. ( )
. .
.
,
.
. ,
,
.
, ,
.
.
.
3.2
.
, . ,
30
.
.
10m. ,
.
.
3.3
,
.
,
.
.
Bluetooth [9],
, 10
.
. ,
,
. ,
.
3.4
,
: 1) , 2) , 3)
4) .
, ,
. : )
) - .
-
. ,
,
.
.
.
31
(scavenging energy) .
,
.
.
.
.
.
. ,
:
,
.
.
(Wireless Integrated Network Sensors
WINS) 30
.
(Li) (2.5 cm
1 cm ).
.
3.5
32
WSN (sources)
(sinks).
, . , WSN
, .
, ,
, ,
.
gateway,
.
WSN, ,
:
star,
- .
peer-to-peer (mesh), -
, . ,
, multi-hop
.
star-mesh ( - hybrid), ,
, -
- (end-points)
. ,
peer-to-peer .
14 : WSNs
-
.
, ,
, ,
.
20 ,
33
. ,
:
1) .
, -, .
, :
i) .
ii) ( )
.
iii) , .. .
iv) .
. ,
,
,
- .
2) .
,
:
a)
b)
c)
d)
e)
.
.
.
.
.
,
:
.
.
.
.
34
3) .
.
.
,
,
.
3.6
,
, .
. , :
,
,
,
,
,
, ,
,
,
,
,
.
,
.
3.7
,
.
, .
35
,
.
ISM
(Industrial Scientific Medical ISM Band),
. 433 MHz
. 915 MHz.
.
:
AMPS Bluetooth 2.4 GHz,
.
, 916 MHz.
WINS .
,
,
.
.
.
.
,
. ,
, ,
,
.
3.8
, (<0.5 Ah, 1.2V).
,
.
,
,
.
36
, : 1) , 2)
3) .
3.8.1
.
. , ,
.
3.8.2
. ,
3.9
,
, (Physical Layer), -
MAC (Link Layer) .
37
15 : -layers WSNs
,
, ,
.
hardware .
,
,
(bandwidth) .
,
.
, ,
(multiple
access).
38
.
, ,
.
(frames)
, ,
. multi-hop -
,
.
(error control)
( ) (Forward Error Correction-FEC)
(Automatic Repeat RequestARQ). ARQ multi-hop
overhead. ,
FEC
error control. , error control
.
ad-hoc
. network
layer (.
).
:
- (data-centric).
,
(attribute-based)
.
energyefficient
(available power - PA)
.
:
39
Maximum PA route,
,
.
.
TCP
.
TCP, .
,
, .
:
40
4: (Middleware)
4.1
.
.
, .
, 16.
) (Programming Abstractions)
.
B) (system services)
.
) (Runtime support)
.
) (QoS mechanisms)
(QoS).
41
16 : [24]
[ 16],
.
, ,
.
17: [24]
,
(sensor nodes),
(sink node) ,
17.
42
18 : [24]
(gateway)
.[10]
. ,
,
.
: (abstraction
level), (programming paradigm)
(interface type).
. (node level abstraction)
,
. H
(system level abstraction)
.
,
43
,
.
. .
.
.
, (event-driven)
(query-based). ,
( ). ,
, (mobile
agents), / (Publish/Subscribe).
, /
(event-driven).
. ,
.
SQL .
.
,
.
,
.
.
.
4.3
.
,
.
, (common services)
(domain services).
.
.
44
:
(code managment)
(Data management)
, ,
(Discovery of resources)
-
.
(Management of resources)
, ,
)
(Integration)
Internet.
.
, . EnviroTrack
. WSN-SHM
.
4.4
,
, , .
(hardware)
.
,
.
45
, smart task .
(virtual machine)
.
.
.
.
.
,
(aggregation delay) .
.
.
, .
.
5.
5.1
,
(migration) .
.
.
(code update),
.
,
.
46
. SINA
(Sensor Execution Environment),
SQTL
. Cougar
(query optimizer)
.
, Sensor Execution Environment
scalability.
(code migration)
,
BerthaOS MagnetOS.
(code interpretation)
.
,
(task migration) (mobile code)
.
(
TCL Sensorware SQTL SINA)
Java. (mobile agent),
. .
(modular)
.
.
mobile agent
,
.
sink node.
mobile agents re-tasking
.
mobile agent (mobile agent paradigm)
. [11]
47
20 : : )
) [11]
(interpreter),
.
(mobile code) TCL
SQTL ,
. (mobile agents)
Java scalability .
Agilla. Agilla
.
.
. Agilla
tuple spaces
.
21 : Agilla [24]
48
tuple space . tuple space
.
tuple space
.
(one-hop node).
, tuple spaces.
22 : Agilla [24]
49
23 agent. agent
(stack), (heap) .
agent
. agent,
(program counter) . agent
agent (migration
operations). agent .
. ,
(reaction manager)
. agent
,
. (condition code) .
, Agilla
(reaction approach). tuple space, agent
Agilla tuple
. tuple spaces
agent (reaction manager).
tuple, tuple
. , tuple space agent,
.
(code migration)
agent . tuple space
agent
. agent,
. ,
.
(multi-hop migration) .
50
5.2
5.2.1
,
.
(event-based),
, /,
.
. ,
.TinyDB, DSware, Mires
Impala event-based .
event-based
/ (Publish/Subscribe), .
.
Pub/Sub .
(sink node)
event-publisher .
Pub/Sub Mires. 23
Mires 24 Mires.
51
24 : Mires [14]
25 : Mires [14]
.
. , ,
. Pub/Sub
. Mires ,
. [13]
(query-based data model),
.
(global level abstraction)
. TinyDB, Cougar SensorWare.
.
26
Publish/Subscribe
Mires. Publish/Subscribe
53
.
Publish/Subscribe advertiseMsg
MultiHopRouter.
AdveriseMsg .
, MultiHopRouter
AdveriseMsg . Publish/Subscribe
,
MultiHopRouter .
27 : [14]
27,
:
, , , .
clusters.
, cluster head. cluster
cluster
head.
.
,
. [14]
TinyDB
. TinyDB
54
TinyOS. TinyDB ,
SENSORS, ,
.
SENSORS .
800 F
.
.
TinyDB (controlledflooding) .
/ (spanning tree) (
).
,
. , (parent-node) (root) . [14]
5.2.2
. (centralized processing)
55
. , (distributed processing)
.
,
.
,
,
(aggregation).
: 1) ,
. 2)
.
event-based ,
.
Mires. Mires
AVG SUM.
.
.
.
(query-based),
(pipeline), TinyDB SensorWare.
(data
calibration) .
.
5.2.3
.
.
, ,
. H (data centric)
56
.
(data) .
DSWare (Data Service Middleware).
28 : DSWare [24]
28, DSWare ,
.
(Event Detection)
, (
) . (Group
management)
. (Scheduling)
DSWare :
(energy-aware) real-time .
(Data storage), 28
DSWare
.
.
.
57
29 : DSWare [24]
, DSWare
.
,
, .
.
.
. DSWare
(replication) ,
.
.
. DSWare
,
.
,
.
DSWare
. DSWare
. (feedback control
scheme)
58
. ,
,
.
.
.
(abstraction)
. ,
.
.
.
.
,
.
5.3
( , , A/D).
,
.
,
.
.
,
,
.
, SLP Bluetooth SDP.
MiLAN . , TinyLime tuple
space .
,
(content-based)
.
59
, Ultrasound, RF ultrawideband, RSSI
.
.
.
5.4
.
,
.
- (self-organization).
(runtime)
.
,
.
,
.
.
(cluster service), .
(granular services)
, .
.
(cluster service)
(cluster member maintenance)
. , ,
EnviroTrack, MiLAN, DSWare, AutoSec SINA
. EniviroTrack
. MiLAN AutoSec
.
/
. ,
.
,
60
.
,
/ MAC
.
. Mate
,
.
.
,
. MagnetOS
(multi-hop) . ,
,
. Mires
Pub/Sub .
Pub/Sub,
.
,
, Impala
, MiLAN.
30 : MiLAN [24]
30 MiLAN.
MiLAN
. plug-ins
MiLAN
. MiLAN
.
61
. (policy-based)
.
5.5
,
, Internet, Gird
.
,
, .
,
.
,
(leverage
system).
,
.
proxy server.
(client) (non-standardized
services) proxy server
.
standard open architecture,
.
. ,
. WSDL
SOAP
.
.
.
SOA, SensorWeb. ,
,
(WWW).
. Sensor Web Enablement
62
OpenGISConsortium(OGC), , Sensor
ML, Sensor Collection Service, Sensor Planning Service Web Notification Service.
OGC , ,
, SWE,
SensorWeb Grid Computing
Sensor Webs.
, proxy server
proxy server
.
, .
.
.
,
, ,
,
runtime (runtime support).
,
. runtime
(inter process communication-IPC),
/ .
, smart task
,
. Runtime
(virtual machines).
.
63
31 : Mate [24]
Mate,
TinyOS. 31 . Mate
. ,
. Mate byte,
TinyOS , (componentbased) event-driven .
Mate FIFO scheduler,
byte capsule store
. Mate
, .
. Mate
Trickle.
Magnet, runtime MagnetOS,
power-aware,
ad-hoc . ,
MagnetOS ad-hoc
Java VM
. ad-hoc ,
. conference room
single hop ad-hoc . Magnet
.
. runtime ( )
.
64
(task cooperation)
runtime ,
. task cooperation
. , TinyTime Agilla,
task cooperation tuple space. tuples
(passive data values). tuple space
, tuples ,
. (global) tuple space
. , tuple spaces
inter-agent .
tuple space agents
.
.
tuple tuple space
.
tuple
() .
tuple .
.
agent . Agilla, agents
agents .
Agilla agents
tuple space. ,
. Agilla tuple spaces
(span across nodes).
tuple space.
7: WSN
, -.
, ,
(real-time). context-ware .
65
.
,
, , .
, (aggregation delay), .
,
.
.
.
,
.
,
.
.
.
,
.
32 : MiLAN [24]
66
32, MiLAN
.
.
.
, MiLAN
,
. , ,
.
,
MiLAN State-based Variable
Requirements Graph .
MiLAN
.
,
.
, MiLAN
.
.
8:
WSN
WSN
.
(spanning trees),
. spanning tree
.
33, ,
. spanning trees
.
(denoted),
(alternative),
.
67
( 33a),
WSN (underlying network).
. WSN
.
.
WSN
.
( 33a)
, ( 33b)
( 33c).
,
.
.
(implementation-related
features) ,
(context features).
,
WSN
(poor scalability).
(scalable), ,
WSN.
tuple spaces event-driven
, WSN.
68
33 : WSN. a) , b)
, c) , d)
[24]
69
,
(hardware transparent features)
hardware .
.
WSN .
.
WSN
.
(resource
management adaptation)
(open resources configuration).
(computational reflection)
. proactive reactive
.
reactive ,
, proactive
( )
.
WSN( 33d)
WSN
(
33d).
. ,
(data query
command). .
.
WSN. ,
(mobile target), (mobile sensor)
(mobile sink).
. WSN ( 33d)
.
70
9: Tutorial TinyOS
9.1 TinyOS
TinyOS, Cygwin
Java. :
Cygwin.
cvs, gcc, gdb, openssh, perl, rpm vim.
Suns javax.comm
[1]
javacomm20-win32.zip
comm..jar
C:\Program
71
Graphviz
Eclipse
, Text
editor. Textpad.
72
35 : Environment Variables
System Properties class path
9.2 TinyOS
TinyOS. :
tinyos-tools-1.2.2-1.cygwin.i386.rpm
nesc-1.2.7a-1.cygwin.i386.rpm
make-3.80tinyos-1.cygwin.i386.rpm
Cygwin
.(: Windows Vista Cygwin Administrator)
73
Cygwin
: rpm -ignoreos -ivh *.rpm
.
36 : TinyOS
cd /opt
cvs -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos login
cvs -z3 d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co -P tinyos1.x
: /opt/tinyos1.x/tools/make/MakeLocal.
Windows . text editor
.
locate-jre /usr/local/bin.
74
38 : locate-jre
compile
/opt/tinyos-1.x/tools/java make
39 : compile java
JNI Cygwin
/opt/tinyos-1.x/tools/java/jni
make install.
40 : JNI
Cygwin.[15]
Cygwin
Cygwin : tos-check-env
75
41 : tos-check-env
9.3 Agilla,
1. Agilla[16]
2. Agilla agilla.
extract
Agilla
, agents, java nesc.
3. Agilla
Cygwin
Agilla.
Agilla.sh /etc/profile.d.
i.
Cygwin :
export AGILLA=[directory to Agilla's root directory] alias cda="cd
$AGILLA" alias cdaa="cd $AGILLA/agents" alias cdaj="cd
$AGILLA/java/agilla" Agilla
C : export AGILLA=/cygdrive/c/Agilla
Agilla
:
a) $AGILLA/nesc/agilla: Agilla's mote firmware written in NesC
b) $AGILLA/java: Agilla's AgentInjector application written in Java
c) $AGILLA/agents: Example Agilla mobile agents
4. Makefille.Agilla
$Agilla/nesc/agilla.
-
Agilla :
76
42 : Makefile.Agilla
$AGILLA/nesc/agilla/README
.
5. AgentInjector
mobile agents Agilla.
$AGILLA/java/. agilla.AgentInjector.
compile AgentInjector,
$AGILLA/java classpath.
classpath : echo $CLASSPATH.
classpath
:
export CLASSPATH=$CLASSPATH:$AGILLA/java
classpath,
Makefile.Agilla
AgnetInjector( $AGILLA) :
cd $AGILLA/java/agilla
make
$AGILLA/java/agilla/Makefile.Agilla MIG.
:
77
6. agilla.properties
AgentInjector, ..
$AGILLA/java/.
AgentInjector.
:
cd $AGILLA/java
agent
AgntInjector. $AGILLA/agents agents
Agilla. README
agent.[18]
9.4 AgentInjector
AgentInjector agilla.properties.
. default :
initDir=agents
defaultAgent=3Blink.ma
runTest=false
numCol=20
enableClustering=false
nwName=unk
Agent Injector
agilla.properties :
$ cd $AGILLA
com1:57600 TinyOs
.
78
TOSSIM, . 2 ,
default agent agent injector.
Agent Injector agents
TOSSIM.
$AGILLA/nesc/agilla/components/AgentMgrM.nc
INCLUDE_DEFAULT_AGENT 0.
#define
44 : Agilla
45 : SerialForwarder localhost
80
3Blink.ma
INJECT AGENT Cygwin
:
81
47 : Agilla Serial
Forwarder
82
48 : Agilla Agent
Injector
9.5 TinyViz
Cygwin Tinyviz
83
. TinyViz
TOSSIM java. TinyViz
plugins .
. debug
.[17]
TinyViz .
cygwin:
cd $TOSROOT/apps/TestTinyViz
make pc
export DBG=usr1
49 : TestTinyVIz
TinyViz 5
.
plugins
.[19]
84
50 : TestTinyViz
TinyViz
, agilla. : $AGILLA/nesc/Avilla
:
DBG=usr1
85
Set breakpoint: ,
.
.
Radio links: .
.
86
Set location:
LOCATION.[20]
15
(network traffic).
15.[21]
87
10:
. ,
.
,
.
,
.
.
.
. ,
.[22]
,
. ,
,
.[23]
.
.
. ,
,
.
.
2
.[24]
88
89
[25]http://www.newsbeast.gr/greece/arthro/276326/diethnis-diakrisi-gia-to-polutehneio-kritis/
90
91