You are on page 1of 15

The Constrained Application Protocol for

Pervasive Machine-To-Machine
Communications
(Rng buc giao thc ng dng cho giao tip
M2M)

I. Introduction
- Trong Constrained RESTful Environments (CoRE) lm vic trong
mt nhm Internet Engineering Task Force (IETF) c inh ngha
l vi nhng rng buc v nhng nt v mng.
- CoAP (Constrain Application Protocol) t chc xung quanh UDP v
xy dng cch truyn li n gin thay v s dng nhng cch iu
khin phc tp nh trong tiu chun TCP
- Thay vo s dng mt Message ID c bit tng quan vi
CoAP yu cu p ng nh danh yu cu truyn li.
- CoAP vi mc tiu l nhng rng buc v bng thng nh v lng
tin t, nhng giao thc tng t nh vy s c ng dng tiu biu
trong M2M ( cc thit b di ng )
- Short Message Service (SMS) hoc General Packet Radio Service
(GPRS)
- SMS c s dng nh giao tip M2M vi nng lng t v tiu th
t nng lng

II. Research Contribution


- Gii php IP c da trn gm ci nt mng cm bin.
- CoAP thu thp d liu cm bin trong qu trnh vn chuyn
- Cu trc Intelligent Contaner bao gm ci nt mng cm bin v
thit b truyn thng dung trao i thng tin nh nhit , m
- Truyn thng tin n ch vi hiu qu cao hn
- S dng hai cng ca giao thc , thng tin lin lc khng c quyn
ph bin, hiu qu vi cc dch v web RESTful ang tr nn kh
thi i vi truyn thng M2M.

- Hnh 1 cho thy cc cch truyn thng khc nhau


- 1a ch ra m hnh M2M, thng tin u ngi s dng c truyn
bng ng truyn CoAP vi SMS message t thit b truyn thng
sau c a ti mng cm bin khng dy (WSNs)
- SMS c chuyn c x l bng 1 SMS-C (SMS- Center) s
dng Computer Interface to Message Distribution (CIMD) (Giao
din my tnh phn phi tin nhn) hoc UCP/EMI....
- 1b ngi dng truy cp thng tin t cc gi c chuyn s dng
1 thit b di ng cng da trn SMS
- 1c ngi dng ang xy dng CoAP vi kt ni da trn GPRS
- 1d khi ly cc gi c vn chuyn t warehouse thit b truyn
thng c th c kt ni v s dng WSNs, do ngi dng c
th truy cp thng tin vi CoAP trn a ch IP
- CoAP c s dng trong Intelligent Container vn dng ngi
ti nguyn (nhit , m) bng cch s dng phng php:
Phc hi li ngun ti nguyn t cc nt trong mng cm bin
hoc cc thit b truyn thng. Ti nguyn s c xc nh
bi URI (GET method)
S i 1 ti nguyn hin c trn nt mng cm bin hoc thit
b truyn thng (PUT method)
III. Demonstration

1. CoAP da trn 1 SMS vn chuyn t thit b mng di ng n 1


thit b mng IP
2. CoAP da trn 1 SMS vn chuyn t thit b mng IP n 1 thit
b mng IP
3. CoAP trong 1 802.15.4/6LoWPAN/RPL mng cm bin khng
dy s dng TelosB vi TinyOS v 1 thit b xi Android

- Khch hng CoAP v server c th chy trn cc thit b truyn


thng, Smart Phone, cng nh cc nt mng cm bin
Bng I v II cho thy nhng ngun ti nguyn c th cung cp
cho cc nt cm bin v cc thit b truyn thng.

V d, mt yu cu CoAP GET c pht ra bi thit b truyn


thng c th c hin th ly gi tr m t mt nt cm bin.
My ch CoAP chy trn nt cm bin s gi phn hi CoAP vi gi
tr m c h tr bi mt tin nhn ACK.

IV. Technical requirement


- Tt c cc thit b phn cng c yu cu chi tit v cc thit lp
th nghim trong bng III

Ngoi ra cn c 1 s yu cu khc:
- Free 802.11 wireless channel
- Free 802.15.4 wireless channel
- Several power sockets
- Cellular network coverage (at least basic GSM SMS
coverage, if possible GSM GPRS coverage)
- IP connectivity by Ethernet

A Low-Power CoAP for Contiki

- Cc thit b Internet of Things s c vn hnh bng pin, nhng cc


giao thc ng dng hin ti thng khng c thit k vi hiu
sut nng lng cao.
- Trong cc mng khng dy cng sut thp th hiu qu nng lng
c nh gi bi kh nng duy tr nng lng thp theo chu k: gi
radio ng cng nhiu cng tt
- CoAP l giao thc lp ng dng c th c to ra vi hiu qu
nng lng thng qua chu k ca radio
I. Introdution
- Mng ca nhng thit b khng dy cn cc giao thc hiu qu v
nng lng, tuy nhin cc giao thc hin ti thng c thit k m
khng c hiu qu v n.
- Trong cc h thng khng dy cng sut thp, b thu pht v tuyn
thng l thnh phn tiu tn nhiu nng lng nht, do hiu qu
nng lng s chuyn i thnh chu k nhim v hiu qu ca radio:
kh nng gi cho radio tt cng nhiu cng tt.
- Giao thc mng ph hp l 1 gii php cho IoT
- IP c th c s dng truy cp trc tip cc thng s cm bin
ca 1 thnh ph, thu thp nhng thng tin cn thit cho li in
thng minh, smart home, nh my....
- Chng ti trin khai IETF Constrained Application Protocol
(CoAP) cho Contiki, cho php tng tc ti lp ng dng thng qua
dch v RESTful Web.
- Hnh 1 m t s tch hp mt chng giao thc y v cn thit
cho mt IoT v nh gi hiu sut nng lng h thng t lp ng
dng.

- Nhu cu qun l nng lng ti lp ng dng bng cch hn ch s


qun l nng lng trn chu k thc ca radio, phc tp c th
c loi b khi lp ng dng.
II. Background
A. Power Efficiency through Duty Cycling
- Radio thu pht l thit b tiu tn nhiu nng lng nht
- Vic lng nghe cc gi tin cng tiu tn nh vic nhn chng
- bt tiu tn nng lng th radio thu pht cn phi tt hu ht
thi gian
- Radio duty cycling c thit k, cho php cc nt ng 99% thi
gian trong khi vn c kh nng nhn v gi cc tin nhn.
- Giaothc ContikiMAC RDC: ContikiMAC l mt giao thc MAC
nghe in nng thp s dng c ch nh thc c hiu qu t
c hiu qu cao: vi tn s khi ng l 8 Hz, chu k rnh ca
radio ch chim 0,6%.
- Hnh 2 l c ch hot ng ca ContikiMAC
- Cc nt thc dy theo chu k kim tra knh truyn truyn t cc
nt ln cn. Nu pht hin c tn hiu radio, nt s nghe gi tin v
khi nhc c khung d liu s tr li mt khung xc nhn (ACK)
- gi gi tin, nt gi gi lin tc cc khung d liu cho n khi
nhn c mt ACK, hoc cho n khi cc gi tin c gi trong
mt giai on nh thc ton b m khng nhn c gi ACK.
B. The Constrained Application Protocol

- The IETF Constrained Application Protocol (CoAP) l mt giao


thc tng ng dng c thit k cung cp giao din ging nh
REST, nhng vi chi ph thp hn v bng thng v s phc tp ca
vic trin khai so vi giao din REST da trn HTTP.
- CoAP s dng cc mu t HTTP nh khai thc ti nguyn, cc URI,
tng tc RESTful, v tiu ty chn m rng, nhng s dng cc
i din nh phn nh gn c thit k d phn tch.
- Khng ging nh HTTP qua TCP, CoAP s dng UDP. iu ny
gip bn c th s dng CoAP trong cc m hnh truyn thng one-
to-many v many-to-one.
- C ch ca b my CoAP:

1) Cc ng dng c th gi cc tin nhn CoAP tin cy


("confirmable") hoc khng ng tin cy ("nonconfialable"). Cc
i s c truyn li vi thi gian ch cho n khi c nhn
bi ngi nhn hoc t n s ln pht li ti a.
2) CoAP nhm cung cp truyn thng nhm thng qua IP multicast
nhng c ch ny vn cha c c th ha.
3) CoAP c cc thng bo y bn a thng qua c ch
publish/subscribe c gi l "quan st ti nguyn". Client c th
gi mt yu cu vi mt tiu ty chn quan st n mt ngun
ti nguyn CoAP. Server theo di nhng ngi ng k ny v
gi phn hi bt c khi no ti nguyn quan st c thay i.
4) i vi vic pht hin ti nguyn, CoAP theo RFC 5785 bng
cch s dng ng dn /.well-known/core cung cp cc m t
ti nguyn trong CoRE Link Format. nh dng ny m rng
Web Linking v xc nh cc thuc tnh cho mt loi ng ngha
("rt"), cch s dng giao din ("if"), loi ni dung ("ct"), v kch
thc mong i ti a ("sz") ca ti nguyn. Ngoi ra, mt dch
v th mc dc d nh.
- Khi b nh RAM cho IP v b m ng dng b hn ch, thit b ch
c th x l mt s lng d liu c th trong mt thi gian. D liu
ln hn c th c x l bng cch lu tr cc "khi" ny trong b
nh fl ash, v d nh nhn c mt phn mm rmware mi hoc
cung cp mt datalog y . trnh s cn thit ca mt giao
thc th cp trao i nhng d liu ny, CoAP ch nh mt c
ch ngng v ch n gin gi l "php chuyn khi"

III. A Low-Power CoAP For Contiki

A. The Contiki REST Engine


- L mt s ci thin ca Contikis REST layer
- N cung cp cc macro xc nh v t ng khi to ngun ti
nguyn RESTful Web.
- Cng c REST mi cung cp ba khi nim tru tng to cc
ngun RESTful:
RESOURCE: i vi mi ti nguyn, ng dng phi cung cp
mt hm x l ti nguyn nhn c yu cu v to ra phn
hi tng ng. C nhng message c truy cp thng qua
REST Engine API
EVENT_RESOURCE: Yu cu mt hm iu khin th hai
c thc hin bi nh pht trin ng dng.
PERIODIC_RESOURCE: REST Engine nh k gi mt chc
nng iu khin th hai tng t vi mt cho cc s kin.
Chc nng ny c th c s dng thm d cc cm bin
on-board v v d thc hin kim tra ngng cho d ti
nguyn c nn c xem l thay i hay khng.
- Cui cng, mt ng dng dch v RESTful Web in hnh bao gm
mt C-fi duy nht. N cha cc macro ti nguyn cng vi cc chc
nng x l ca chng v mt quy trnh Contiki khi to REST
Engine, kch hot cc ti nguyn v ty chn ch i cho cc s kin
ca ngi dng cho bt k EVENT_RESOURCE no.

B. Blockwise Transfers

- CoAP thc hin h tr truyn cc Blockwise


- Nu mt phn hi c to ra bi mt trnh x l ti nguyn vt
qu kch thc khi yu cu ca khch hng, th REST Engine s t
ng chia cu tr li m khng cn s tham gia ca trnh x l.
C. Observing Resources
D. Separate Responses

- Mt vi ngun ti nguyn c th yu cu x l thi gian di hoc i


ti nguyn t phn cng nh mt cm bin chm, trong mt khong
thi gian khng xc nh.
- iu ny l khng cn thit cho s truyn li hoc tr li li timeout
- V vy, CoAP cung cp phn hi ring bit, cho php my ch gi
ACK trng ngay lp tc v mt thng bo c th b xa khi hon
thnh.
- Cung cp mt trnh x l tin x l s c ACK v xc nhn phn
ng thc t vi ID v kiu tin nhn mi.
E. Resource Discovery

F. CoAP Clients

- Cng c REST gip vic trin khai cc ng dng CoAP d dng. M


hnh lp trnh tuyn tnh ny cng c th n cc php chuyn khi,
bi v n tip tc khi tt c d liu c nhn.
G. Message Deduplication

- Qu trnh thc hin hin nay c thc hin sau khi xem xt cc quy
nh ca CoAP th gin lp li. Contiki c nh ngha l cc
thit b b hn ch v b nh. y, vic qun l mt s a ch
Internet IPv6 s gy ra mt chi ph qu ln trong khi ch cc yu cu
thng.
H. Memory Management

- Hp tc a lung ca Contiki cho php chng ti cung cp truy cp


vo cc ti trng v cc chui byte (v d nh ETag, nhng cng
phn tch c php cc bin truy vn) trc tip trong b m IP.
- i vi th h phn hi, REST Engine ca chng ti t chc cc b
m cho cc trnh x l ti nguyn. Cc b m c s dng li
tun t ha cc thng ip CoAP ti ch v lu tr cc iu kin
truyn li.
- REST Engine cho php cc nh pht trin xc nh kch thc khi
cn thit cho ng dng ca h v sau kch thc cc b m yu
cu cho ph hp.

IV. EVALUATION
nh gi c tnh nng tnh v ng ca CoAP nng lng thp
ca chng ti: du chn b nh, tiu th nng lng v thng lng
d liu.

A. Experimental Setup

- Chy cc th nghim trn Tmote Sky sensor motes. Nn da trn


MSP -bit CPU chy ti 3.9MHz. Cung cp 1 CC2420 radio chip,
48kB b nh flash v 10kB RAM
- S dng giao thc ContikiMAC v ci t chu k thc l 8Hz, tng
ng vi chu k nhn ri l 0.6%.
- Cc kt qu hin th c tnh trung bnh trn 100 ln chy v cc
thanh bo li hin th lch tiu chun. Chng ti c trng tiu
th nng lng motes qua sn phm tch hp sn ca Contiki
Powertrace
B. Memory Footprint
- Bng I cho thy du chn chi tit ca vic trin khai CoAP ca
chng ti i vi Contiki.

- Code c bin dch vi msp-430-gcc (GCC) 3.2.3 cho Tmote Sky.


- Tt c vic thc thi yu cu 8.5 kB ROM v 1.5 kB RAM ( Heap
cng vi stack ti a c o cho tt c cc chc nng lin quan n
CoAP v REST ).
- CoAP-07 vn chuyn module i hi s lng RAM ln nht, v n
cung cp cc b m thng bo cp. Vi cc ci t mc nh
c s dng, c th lu tr c bn thng ip c th cha c
vi kch thc 128 byte.
- c tch ring khi giao thc v ch s dng API REST Engine,
m ng dng l nh gn. Mt ng dng RESTful vi cc ngun ti
nguyn nh c m t trong Bng II ch tiu th 1.5 kB ROM
v 160 B heap.
- i vi vic thc hin mt h thng IoT trn cc thit b nh, kch
thc ln nht c h tr. CoAP block size l mt tham s thit k
trung tm.
- Do kch c khi m ca CoAP t 16 n 1024 byte, cc bc trn
128 byte dng nh qu th v do hn ch khng gian thit k.
N s tr nn kh khn ti u ha b nh phn phi gia cc
thnh phn h thng khc nhau v iu chnh cc ngun ti
nguyn phn cng khc nhau.

C. Energy Consumoption
- nh gi s cn bng gia mc tiu th nng lng v thi gian
tr, chng ti thit lp mt th nghim trong chng ti a ra
yu cu v cc ng c khc nhau trong mng 4 knh ca chng ti,
vi ContikiMAC b v hiu ha v bt (0.6% RDC). Ti nguyn
CoAP c yu cu tr li bng mt token 2 byte v mt ti trng
64 bytes.
- Hnh 4a cho thy biu nng lng ca tt c cc nt lin quan n
qu trnh x l. N bao gm cc nt chuyn tip cng nh my ch
CoAP c ch nh.
- Nh mong i, ContikiMAC tit kim c nhiu nng lng,
reaching an improvement by a factor of 26 compared to no duty
cycling ( ko hiu khc ny n ni g ).
- Hnh 4b cho thy rng cc hnh pht ca chu k nhim v v tr
l chp nhn c vi mt chu k nhim v di mc 1%. Gim
chm nht l v yu t 6, gi tr di 1 giy trn 4 hops.
D. Transmitting Large Data
- Khng phi tt c cc i din ca ti nguyn CoAP u c th c
cu thnh trong mt khung 802.15.4, v vy cn phi phn mnh
hoc chuyn giao theo chiu hng 6LoWPAN.
- Chi ph nng lng ca vic chuyn i theo khi lng ch n
gin l tng ng vi nhiu yu cu vi kch thc payload c
iu chnh cho ty chn Block2 header b sung.
- cho php truyn hiu qu nng lng cc khung lin tip, chng
ta s dng bursts lp lin kt. Khi sender c cc frames gi, u
tin n s nh thc neighbor bng mt b iu khin ContikiMAC
v t l frame pending bit trong 802.15.4 cho receiver bit v
frame tip s lm theo.
- Khung con li c gi lin tip v c nhn bi ngi nhn cho
n khi bit tm dng, khung c b ci t.
- Hnh 5 cho thy mc tiu th nng lng tch ly ca tt c cc nt
tham gia vo yu cu (chuyn tip v my ch) v tr p ng
yu cu. Loi th 2 gn nh khng b nh hng bi 6LoWPAN
phn mnh do cc khung v (??)
- Tuy nhin, s gia tng tiu th nng lng r rng l ng ch i
vi fragment b sung u tin (trong cu hnh 70 byte cho 4 hops
v 79 byte cho 1 v 2 hops).
- Hn na, chng ti c lch sai s chun ln do cht lng lin
kt c thay i rt cao: th nghim c thc hin v cc ng
c b nhiu WiFi. Khi mt gi tin xy ra, ContikiAC ddowngiarn
truyn li gi khung cho n khi nhn c ACK.
- Do mi trng b mt mt ny nn tng s khung c gi ph
thuc nhiu hn vo cht lng lin kt cc b so vi phn mnh.

E. Optimizing Separate Responses


- Kim tra kh nng chia ct p ng gim nng lng bng cch
trnh s truyn li.
- We targeted a mote 4 hops from the border router.
- Ti nguyn CoAP mt mt khong thi gian x l yu cu, t 1
n 24 giy. Chng ti kim tra hai cu hnh CoAP khc nhau:
u tin khng s dng cc phn hi ring bit, th hai l c.
- Hnh 6 cho thy nng lng tiu th bi cc mote ph thuc vo s
chm tr p ng pha my ch, khng c v c phn ng ring bit.
Biu tiu th tng tuyn tnh vi s chm tr do chu k nghe radio
khng hot ng.

- Sau khong 10 giy, hai ng cong i qua: ti thi im ny, phn


hi ring bt u tit kim nng lng. Trc im , c ch tit
kim nng lng nhiu hn s vi ACK.
- Vic ti u ha bng cc phn hi ring bit l khng ng k. Tuy
nhin, lu rng i vi cc yu cu di hn, c ch ny l cn thit
trnh yu cu hy b.