ORIGINAL PAPER
Using publish/subsc ibe o message ou ing in mobile en i onmen s
Ugai z Amoza ain
1
•Mikel La ea
2
Accep ed: 30 Decembe 2022 / Published online: 3 Feb ua y 2023
ÓThe Au ho (s) 2023
Abs ac
Publish/subsc ibe is a ma u e communica ion pa adigm o ou e and deli e e en s om publishe s o in e es ed sub-
sc ibe s. Ini ially concei ed o la ge scale sys ems, e.g., he In e ne , i has been used mo e ecen ly in new scena ios, e.g.,
wi eless senso ne wo ks and he In e ne o Things (IoT), whe e mobili y and dynamici y a e he no m. The loose-coupling
and asynch onici y o publish/subsc ibe makes i an in e es ing choice o IoT scena ios, i.e., each node in an IoT ne wo k
can choose a di e en ole depending on i s loca ion, capabili ies, e c. This pape p esen s MFT-PubSub, a ully mobile and
aul ole an con en -based publish/subsc ibe p o ocol. Ou p oposal is a pu ely eac i e solu ion o mobili y in a
publish/subsc ibe sys em wi hou any kind o limi s on he mobili y pa e ns o he nodes. A wi eless ad hoc ne wo k is
c ea ed wi hou he need o any p e ious connec ions o knowledge on he nodes. Handling he mobili y, be i physical o
logical, o bo h clien s and b oke s. We p o e he alidi y o ou solu ion by expe imen a ion, and compa e i wi h AODV,
a ou ing p o ocol o mobile ad hoc ne wo king. The simula ions show an imp o emen on message deli e y a e o e
p e iously used p o ocols.
Keywo ds Faul ole ance Mobile ad hoc ne wo ks Publish/subsc ibe sys ems Wi eless senso ne wo ks
1 In oduc ion
The publish/subsc ibe pa adigm p o ides a anonymous,
loosely coupled communica ion be ween e en p oduce s
and in e es ed subsc ibe s [1]. This pa adigm has been
ini ially used o la ge scale sys ems. e.g., he In e ne
[2–4]. Recen ly, i has been used in o he scena ios, e.g.,
wi eless senso ne wo ks [5–7] and he In e ne o Things
[8–10]. In his ega d, se e al sys ems can be men ioned as
ele an in he ield, e.g., SIENA [2], JEDI [11], REBECA
[12] and REDS [13] o bo h publish/subsc ibe in gene al
and o hei clien mobili y suppo in pa icula .
The main idea behind he publish/subsc ibe pa adigm is
o sepa a e he de ices ha gene a e con en om hose
ha consume i . The con en gene a ed can ange om a
empe a u e eading o a senso o an access no i ica ion on
a web page, o e en he dis ibu ion o a li e ele ision
b oadcas h ough he in e ne . In a publish/subsc ibe sys-
em he p ocesses ha gene a e and send con en o he
ne wo k a e called he publishe s, and hose ha consume
he e en s a e called subsc ibe s. The decoupling is com-
ple e be ween bo h such p ocesses. A publishe does no
need o know which is he subsc ibe ha is ecei ing he
in o ma ion i is sending o, no do bo h o hem need o be
communica ing a he same ime in o de o he message
exchange o happen.
In his pape we p opose an app oach ha no only
suppo s clien mobili y, bu also handles b oke mobili y
in a wi eless ad hoc ne wo k. In his app oach he amoun
o de ices connec ed o he ne wo k, and he connec ions
be ween hem a e able o change. Whene e a b oke
mo es physically a change is made in he ne wo k opol-
ogy. Due o he wi eless na u e o he ne wo k he b oke
migh lose connec ions o be able o connec o new
de ices. The p o ocol we p opose ies o minimize hese
changes in opology o help wi h s abili y. We can also
simpli y a aul in one o he b oke s as a loss o
&Mikel La ea
[email p o ec ed]
Ugai z Amoza ain
[email p o ec ed]
1
Depa men o S a is ics, Compu e Science and
Ma hema ics, Public Uni e si y o Na a e, Pamplona, Spain
2
Compu e A chi ec u e and Technology Depa men ,
Uni e si y o he Basque Coun y UPV/EHU, Leioa, Spain
123
Wi eless Ne wo ks (2023) 29:1831–1842
h ps://doi.o g/10.1007/s11276-023-03233-8(0123456789().,- olV)(0123456789().,- olV)
connec i i y, making i easie o he p o ocol o also be
aul ole an .
The es o he pape is o ganized as ollows. Sec ion 2
in oduces he ela ed wo k on publish/subsc ibe and he
mobili y and aul ole ance in hese sys ems. Sec ion 3
p esen s he model and de ini ions. Sec ion 4add esses he
c ea ion o he ne wo k o e lay o ou e e en s be ween
b oke s. Sec ion 5p esen s a p o ocol o handle b oke
mig a ion in publish/subsc ibe sys ems. Sec ion 6p esen s
pe o mance esul s o ou app oach and compa es i o
AODV. Finally, Sec . 7concludes he pape .
2 Rela ed wo k
Mos o he esea ch done in publish/subsc ibe sys ems is
cen e ed on imp o ing cu en solu ions, be i he eliabili y
o deli e ing an e en [14], imp o ing he pe o mance o
inc easing he aul ole ance [15]. Some wo k ies o
imp o e on a ypical ee s uc u e o e en deli e y. In
[16] au ho s p opose he c ea ion o a ee o each opic a
subsc ibe can subsc ibe o wi h he publishe being he
oo o he ee o op imal message deli e y. In some cases
a communica ion ee migh be oo weak agains node
ailu e and he au ho s o [17] p opose using gossiping so
ha he sys em can keep wo king while he ee is being
epai ed due o a node ailu e.
Ano he opic is he suppo o mobili y. Though he e
a e a ious p o ocols o publish/subsc ibe middlewa e,
ew o hem suppo mobili y [18]. In [19], au ho s men ion
some possible solu ions o mobili y suppo in pub-
lish/subsc ibe. S a egies a e sugges ed o ex end exis ing
solu ions, bo h in cen alized and decen alized ne wo ks.
In he case o a mobile ne wo k, nodes will need o adap o
disconnec ions, pa i ions o he ne wo k o he me ging o
hose pa i ions, and he s o age o undeli e ed e en s. In
[20], Huang and Ga cia-Molina s udy he ee cons uc ion
p oblem in wi eless ad hoc publish/subsc ibe sys ems.
They de ine he op imali y o a publish/subsc ibe ee by
de eloping a me ic o e alua e i s e iciency, and p opose
a g eedy algo i hm ha builds he publish/subsc ibe ee in
a ully dis ibu ed ashion. Se e al wo ks also add ess he
di e en ac o s ha a ec he pe o mance o a sys em
wi h mobile nodes [21,22], mos ly based on mobile clien s.
A p oposal o c ea e sel -con igu able and adap i e pee - o-
pee a chi ec u e o implemen ing con en -based pub-
lish/subsc ibe communica ions on op o s uc u ed o e lay
ne wo ks has also been made [23,24].
Ano he possible solu ion o suppo mobili y is he use
o in o ma ion-cen ic ne wo ks [25–27]. Since his kind o
ne wo k suppo s mobili y na i ely, au ho s p opose
exploi ing his p ope y ins ead o using adi ional TCP/IP
communica ions.
In e ne o Things (IoT) and Wi eless Senso Ne wo ks
(WSN) also cons i u e an a ea ha is s ill pushing esea ch
owa ds new opics [28,29]. A numbe o ecen con i-
bu ions ha e also been made in he a ea [30–33]. Mos o
he app oaches suppo mobili y h ough he inclusion o
ga eway nodes and he sepa a ion o he publish/subsc ibe
sys em om he WSN. The ga eway nodes ecei e mes-
sages om any numbe o senso s and ac as a publishe o
he publish/subsc ibe sys em. This allows o he senso s o
be mobile de ices ha send e en s o he ga eway hey a e
connec ed o, bu does no ully compose a mobile pub-
lish/subsc ibe sys em.
2.1 Mobile clien s
Mos o he esea ch ca ied ou o suppo he mobili y o
nodes in a publish/subsc ibe sys em has been done wi h
ega d o suppo ing mobile clien s, be hey publishe s o
subsc ibe s.
The i s sys em o suppo clien mobili y was called
JEDI [11], named o Ja a E en -Based Dis ibu ed
In as uc u e. In JEDI a node mus no i y o i s in en ion o
mig a e o he b oke o which i is connec ed, be o e he
mig a ion happens. This is done by he use o explici
mo eOu and mo eIn messages, which a subsc ibe sends
in o de o s a and inalize he mig a ion p ocess.
SIENA [2,30] was a sys em de eloped a he same ime
as JEDI ha also allowed o clien mobili y. I also uses
explici mo eOu and mo eIn messages and i uses lood-
ing, ha has been ound o be excessi e [34].
Ano he amewo k ha added suppo o clien
mobili y is he REBECA [12,35] publish/subsc ibe sys em.
In his case he mo ing node does no need o send an
explici mo eOu message, a b oke will de ec when one
o i s connec ed subsc ibe s has disconnec ed. The b oke
will hen c ea e a i ual coun e pa o he oaming sub-
sc ibe ha will be me ged wi h he eal one once he
mig a ion inishes.
Mobile XSiena [36] is a publish/subsc ibe pla o m which
seeks o ex end he XSiena [37] con en -based publish/sub-
sc ibe sys em in o de o suppo use mobili y. The key
mobili y- ela ed ea u es o Mobile XSiena a e mobile
de ice in eg a ion, seamless ne wo king, econnec ion sup-
po , loca ion-based ma ching, and pe sis en e en s. This
was la e in eg a ed in o he Phoenix amewo k [38–40].
MQTT is a commonly used p o ocol ha also has ecei ed
imp o emen s in o de o suppo clien mobili y. Though
MQTT o e s he suppo o subsc ibe mobili y by allowing
a subsc ibe o be connec ed o a subse o b oke s, c ea ing
backups in case o a link ailu e, i does no allow o ne wo k
econ igu a ion in he case o a new connec ion, he sub-
sc ibe will ha e o issue he subsc ip ions again. In [41]
au ho s ex end he p o ocol o suppo publishe mobili y, by
1832 Wi eless Ne wo ks (2023) 29:1831–1842
123
de ec ing a disconnec ion in he publishe node, and s o ing
undeli e ed messages while he sys em is econ igu ed. This
app oach gua an ees he deli e y o de o he messages o be
he same as ha o he c ea ion.
PSVR [42] is a ou ing algo i hm o a publish/sub-
sc ibe sys em in a WSN. Siegemund e . al. men ion he cos
o main aining a communica ion o e lay in a dynamic
en i onmen , ha is o en eally high o is omi ed [43,44],
whe e sys ems usually ec ea e he o e lay comple ely. The
p oposed algo i hm is designed o sys ems wi h highly
dynamic subsc ibe s and publishe s.
2.2 Mobile b oke s
The scena io o mobili y inside he e en no i ica ion se -
ice is he mos di icul o handle [45]. In his case he
algo i hms need o be able o handle he mig a ion o no
only clien s bu also econ igu a ion on he subsc ip ion
deli e y pa h. The e a e ew solu ions ha suppo ull
mobili y on publish/subsc ibe sys ems.
In [24] an ex ension o SIENA is in oduced whe e a
sel -o ganizing algo i hm execu ed by b oke s will y o
op imize message deli e y. Mechanisms a e in oduced o
allow he econ igu a ion caused by changes in opology,
mos ly o minimize he no i ica ion cos , bu i could also
be a i s s ep owa ds suppo ing mobile nodes. Though he
complexi y o he algo i hm, oge he wi h he need o a
human adminis a o in case o a b oke ailu e du ing he
opology change p ocedu e, makes i unsui able o a
highly mobile en i onmen whe e a b oke migh s a he
opology change, bu be disconnec ed by he ime i
inishes.
EMMA [46] is an ex ension o MQTT ha no only
handles clien and b oke mig a ion in a anspa en way, i
also uses i s mig a ion mechanism in o de o op imize
QoS. I uses a con olle node ha is cons an ly moni o ing
he ne wo k and is in o med o any change in de ice
connec i i y. The con olle will hen y o op imize e en
deli e y and issue mig a ions o bo h clien s and b oke s o
load balance he sys em. The equi emen o a de ice ha
needs o know he connec i i y o each node in he sys em
p e en his solu ion o be used in a ully mobile en i-
onmen whe e i migh some imes be un eachable.
2.3 P oposed solu ion
In his pape , we p opose a p o ocol whe e any node, a any
ime, can mig a e in he ne wo k wi hou he need o no i y
neighbo ing nodes o a single cen al con olle . In a uly
mobile en i onmen nodes migh no know hey need o
mig a e be o e a connec ion is los . Using ou p o ocol,
nodes (publishe s, subsc ibe s o b oke s) will be able o
join o lea e he publish/subsc ibe se ice a any ime.
Unlike exis ing solu ions, in ou p o ocol, i he ne wo k
is pa i ioned, he se ice will no ha e o wai o con-
nec ions o es o e. Any pa i ion will wo k as an inde-
penden se ice, and a e some ime i connec ions eco e
he pa i ions will me ge and any messages ha we e no
deli e ed ye will be each hei des ina ion.
3 Model and de ini ions
In a publish/subsc ibe sys em we migh ind wo di e en
componen s. Clien s will p oduce and consume e en s
while he no i ica ion se ice handles he subsc ip ions
issued by he clien s and assu es he co ec deli e y o
e en s o he in e es ed clien s.
We can u he di ide he clien s in o wo subse s:
subsc ibe s ha will egis e hei in e es s and consume
e en s, and publishe s ha will p oduce hose e en s. We
will use s2S o e e o a subsc ibe belonging o he se o
subsc ibe s Sand p2P o e e o a publishe ha belongs
o he se o publishe s P. Any clien s in he sys em may
beha e as a subsc ibe , publishe o e en bo h a he same
ime. We will also use he nomencla u e 2Fwhen
e e ing o a il e ha belongs o he se o il e s F.
The no i ica ion se ice is composed o a se o b oke s
which we will call Band e e o indi idually as b2B. The
b oke s will be connec ed a he logical le el by an acyclic
g aph o a spanning ee. The b oke s a e esponsible o
s o ing he subsc ip ions issued by he subsc ibe s and
ou ing he published e en s o he ma ching subsc ibe s.
A any momen a b oke will ha e a se o neighbo ing
b oke s in he g aph, ha i can communica e wi h. We will
e e o his se as Ni o b oke bi. A b oke will also be
able o communica e wi h clien s ha a e connec ed o i .
Fo his eason we will e e o he se o in e aces, be i
o he b oke s o clien s, ha a b oke bican communica e
wi h a any momen as Ii.
All communica ions a e by poin - o-poin message
passing o e FIFO channels. Since pa icipan s a e mobile,
he se o channels linking hem, as well as he neighbo se
e ol es. The e is no need o ha e p e ious knowledge o
he se s, i.e., ini ially each pa icipan knows only i sel and
he amoun o pa icipan s on each se migh change as
ime passes.
3.1 Simple ou ing
The Simple Rou ing [47] p o ocol assumes a s a ic sys em
whe e b oke s a e connec ed in an acyclic g aph, and cli-
en s a e pe manen ly bound o a single b oke . This ou ing
s a egy is based on he p opaga ion o subsc ip ion (SUB)
and unsubsc ip ion (UNS) messages o all o he b oke s in
he sys em. E e y b oke bimain ains a ou ing able Ri
Wi eless Ne wo ks (2023) 29:1831–1842 1833
123
ha is based on he ecei ed SUB and UNS messages and
models he subsc ip ions in he sys em. The ou ing
ables enable b oke s o il e incoming e en s ecei ed as
PUB messages, and o wa d hem only owa ds hose
subsc ibe s wi h ma ching subsc ip ions.
The ou ing able Ria e e y b oke bicon ains, o
e e y subsc ip ion in he sys em, a ou ing en y ( ,z)
whe e 2Fand z2Ii, o indica e ha he publica ion o
an e en ema ching mus ei he be o wa ded owa ds
b oke z(i z2B) o deli e ed o subsc ibe z(i z2S).
3.2 Phoenix
The Phoenix [40] p o ocol handles subsc ibe mobili y in
con en -based publish/subsc ibe sys ems. In o de o do so,
he ou ing able a b oke s also s o es he iden i y o he
subsc ibe ha issued each subsc ip ion. This way, when a
subsc ibe mig a es, he b oke o which i was connec ed
can be no i ied o he change. The e a e wo ex a ypes o
messages used by Phoenix, one o no i ying he mig a ion
o a subsc ibe (MIG), and ano he o eplaying queued
e en s o a mig a ed subsc ibe (REP). Whene e he sub-
sc ibe e-connec s o he sys em, possibly o ano he b o-
ke , i will issue a MIG message, whose p opaga ion allows
ou ing ables o be upda ed and published messages o he
subsc ibe o be deli e ed.
4 C ea ing he ne wo k o e lay
In o de o he de ices on he ne wo k o communica e
e icien ly we mus c ea e a logical o e lay o e a wi eless
ad hoc ne wo k. We need a way o c ea e an acyclic g aph
(a spanning ee) in o de o co ec ly ou e he messages.
We also need a mechanism ha de ec s when a change in
he opology has occu ed so a new link will be c ea ed
when an old one disappea s. The algo i hm ha c ea es his
g aph mus also suppo he o ma ion o se e al pa i ions
in he ne wo k, each one wo king independen ly un il hey
can me ge oge he again. Lowe ing he changes made o
he g aph caused by physical changes on he ne wo k will
also help o educe he mig a ions needed o synch onize
he publish/subsc ibe sys em.
We can use any algo i hm ha gi es us hese p ope ies.
In ou case, we ha e chosen a leade elec ion algo i hm ha
has a hea bea mechanism in o de o keep he leade
s able [48]. Once a leade has been elec ed, his node will
keep sending messages so ha all he o he nodes will ha e
his one as hei leade . When a node ecei es one o his
messages i will know he pa h o he leade [49], and i will
b oadcas i so he message sp eads o all nodes wi hin
communica ion ange. Wi h his we c ea e he o e lay we
need o cons uc ing he publish/subsc ibe sys em.
Using his algo i hm, in he e en ha he ne wo k is
pa i ioned, each o he pa i ions will choose a leade . And
e en ually when he ne wo k becomes connec ed again
bo h pa i ions will me ge choosing a single leade and
main aining a single g aph. Fu he mo e, wi h his hea -
bea message, when a node i s ecei es he message o a
new ound i will s o e he sende as he nex hop o he
leade . This nex hop migh be modi ied by any physical
change in he loca ion o a node o by a ailu e since he
hea bea message will a i e ia ano he node. Wi h his
we can de ec when he opology has changed and no i y
he publish/subsc ibe sys em so ha i can mig a e
acco dingly.
5 The MFT-PubSub p o ocol
In his sec ion we will desc ibe he Mobile Faul Tole an
publish/subsc ibe (MFT-PubSub) p o ocol, and he changes
made o Phoenix. Since he b oke s a e mo ing any change
1834 Wi eless Ne wo ks (2023) 29:1831–1842
123
in he opology can happen a any ime. These changes can
ange om a simple clien mig a ion o he mig a ion o
mul iple b oke s a he same ime. Due o he changing
na u e o he communica ion ee b oke s migh no ha e
been no i ied o a change u he down on he connec ion
ee.
In o de o ake his in o accoun we add a imes amp o
any message sen by a subsc ibe . P e iously on Phoenix a
imes amp was also used so ha a subsc ibe could eques
all he messages i los du ing mig a ion, and hese mes-
sages we e s o ed on a single b oke . Bu , in ou case he
subsc ibe s a e no he only ones ha a e mig a ing, b oke s
will also mig a e. As a b oke mig a es i has no knowledge
o he las ecei ed message by a subsc ibe . Fu he mo e
since he b oke ne wo k is also changing, we canno
designa e a single b oke as he one esponsible o s o ing
he e en s. In o de o sol e his we need a mechanism ha
ells us i a message has been deli e ed. Wi h his, i an
e o occu s, he b oke will s o e he message as unde-
li e ed. When a b oke ecei es a mig a ion message, om
a subsc ibe o ano he b oke , i will send all messages
s o ed o he subsc ibe s ha mig a e. This is why we
decided o epu pose he imes amp concep . This new
imes amp will consis o a sequence numbe ha inc eases
each ime a subsc ibe sends a message. We will also
include a hop coun o he messages, his way any b oke
will know on how many hops i can each a subsc ibe .
This is e e ed o as ( ,h) in he algo i hms. Wi h hese
wo alues we ha e use ul in o ma ion when a mig a ion
occu s in o de o ind how he opology is changing. Any
b oke wi h a highe sequence numbe will be deemed o
ha e he la es in o ma ion and co ec pa h on ha sub-
sc ibe , i he imes amps a e equal he one ha epo s
being he closes will ha e a highe p obabili y o being
co ec .
I we wan o include his in o ma ion we ha e o
modi y he p e iously de ined SUB,UNS and MIG mes-
sages. The changes can be seen on Algo i hm 1. When a
b oke bi ecei es one o hese messages i will i s check
i he message con ains new in o ma ion by compa ing he
imes amps. Then i will s o e he new alue and be o e
p opaga ing he message o he es o he ne wo k i will
inc ease he hop coun o he message by one. Algo i hm 2
shows how he e en eplay wo ks.
We also ha e o ake in o accoun he possibili y o a
subsc ibe mig a ing om one pa i ion o he ne wo k o
ano he , and since bo h pa i ions unc ion indi idually he
subsc ibe will ha e di e en subsc ip ions in each o
hem. We added a new message called FILTERS o ix his
issue. We can see how his message is sen on lines 23–27
on Algo i hm 1. Whene e a subsc ibe s sends a MIG
message he b oke i mig a es o will answe wi h a FIL-
TERS message. This message con ains all he subsc ip ions
o ha subsc ibe ha he b oke has in i s ou ing able.
Using his in o ma ion he subsc ibe may decide ha he
subsc ip ions a e ou da ed and issue SUB o UNS messages
o ix and upda e he ou ing ables o he b oke s on ha
pa i ion.
Wi eless Ne wo ks (2023) 29:1831–1842 1835
123
Table 1shows he messages used in o de o suppo
b oke mobili y wi hou o cing mig a ions. The main
message o his p o ocol is called BMIG and i is used o
no i ying he mig a ion o a b oke . We also add wo helpe
messages o ix he ou ing ables in case o a mig a ion;
BQUERY and BSUB, o asking abou he subsc ip ions a
b oke has o an speci ic subsc ibe and o sending he
subsc ip ions issued by a single subsc ibe ha a b oke has
in i s ou ing able espec i ely.
When a b oke bimig a es om bo o bn, i calcula es
wo se s o subsc ibe s, C o i s child en and O o he es ,
based on hei nex hop. I upda es i s ou ing able o he
subsc ibe s in Owi h bnas hei new nex hop. A e
sending a BMIG message o bn, i sends any queued mes-
sage o subsc ibe s in O h ough bn. The code ha
desc ibes his beha io can be seen on Algo i hm 3.
ABMIG message has h ee pa ame e s; wo lis s o
subsc ibe s wi h hei imes amps, sepa a ing wha he
sending b oke belie es a e child en nodes Cj, and he es
Oj, and a hop coun o he message. Upon ecep ion o his
message om ano he b oke bj, a b oke bi i s goes
h ough he Cjse in o de o ind inconsis encies, as shown
in lines 75–89 on Algo i hm 4. I bihas a newe imes amp
o a lowe hop coun o he subsc ibe han wha is shown
on Cjbiwill send a message con aining he subsc ip ions o
ha subsc ibe wi h he co ec imems amp and hop coun
o bj(lines 132–138 o Algo i hm 5). On he o he hand i
he imes amp is lowe i will ask bj o send upda ed
in o ma ion on he subsc ibe . A he same ime a new lis
1836 Wi eless Ne wo ks (2023) 29:1831–1842
123
o child en subsc ibe s is c ea ed wi h he co ec ed
in o ma ion. The same p ocedu e is ollowed o all sub-
sc ibe s in Ojon lines 90–96, in his case hop coun s a e
igno ed and biwill only check he imes amps. To inish
checking o inconsis encies on bj’s ou ing able on lines
97–101 he i s b oke ha ecei es a BMIG message will
check i bo h se s Cjand Ojcon ain all he subsc ibe s bi
knows. Fo any subsc ibe ha is no in he combina ion o
bo h se s, biwill send a message back o bjwi h i s
subsc ip ions.
Once all inconsis encies ha e been ixed, in lines 103–
108, biupda es i s ou ing able o show he change in
opology o he subsc ibe s ha a e child en o bjand
p e ious nex hops o hose subsc ibe s a e s o ed. The
co ec ed child en lis will be o wa ded o hose s o ed
b oke s. Finally any queued messages will be o wa ded o
he upda ed subsc ibe s.
Once a b oke bi ecei es a BSUB message i will check
i i has a newe imes amp o he subsc ibe han wha bi
i sel has, i i is olde biwill igno e he message. Then bi
will i s emo e all en ies o ha subsc ibe om i s
ou ing able and add he ones ha came wi h he message
upda ing he subsc ibe ’s imes amp as shown on lines
117–123 o Algo i hm 5. This message will be o wa ded
as i i we e a SUB message issued by any subsc ibe .
Finally any queued message will be sen o he subsc ibe .
When a b oke ecei es a BQUERY message, wi h a
imes amp olde han wha i has, i will di ec ly answe
back wi h he subsc ip ions o he subsc ibe he message is
asking o , lines 129–131 o Algo i hm 5.
Figu e 1con ains wo examples o possible mig a ions.
I we we e o ake a look in o he messages needed o co
mple e he mig a ion shown in Fig. 1a we would only see
wo messages. A BMIG message ha is sen by b3and
needs o be ou ed o b1 h ough b2. Whe eas, he mig a ion
ha akes place in Fig. 1b is mo e complica ed. In his case
we need o no i y b3 ha b6has mig a ed be o e i so i can
upda e i s ou ing able du ing i s mig a ion.
6 Pe o mance e alua ion
This sec ion p esen s he pe o mance e alua ion o he
MFT-PubSub p o ocol p esen ed in he p e ious sec-
ion. Resul s ha e been ob ained by simula ion, using he
OMNeT?? [50] ool wi h he Cas alia [51] simula ion
amewo k. Table 2p esen s he di e en simula ed sce-
na ios. The a ea has been calcula ed o a node densi y o
0,005 nodes pe squa e me e , which is adequa e o
wi eless senso ne wo ks, i.e., gi ing an a ea o 200 squa e
me e s pe node. We also de ine a ole (publishe , sub-
sc ibe o b oke ) o each node. We a e in e es ed in
seeing how he p o ocol beha es in di e en scena ios, no
in ully s ess es ing i . Fo his eason we ha e chosen o
use only 2 publishe s o all scena ios whe eas he numbe
o subsc ibe s and b oke s inc eases. The p o ocol does no
Table 1 New Message
desc ip ions Message Payload Clien /B oke Meaning
FILTERS : 2Fb2BSend ac i e subsc ip ions
BMIG Cb;Obg2Sbb2BNo i y he mig a ion o b
BQUERY s 2Sb2BAsk o he subsc ip ions o s
BSUB : 2Fb2BSend ac i e subsc ip ions
Fig. 1 ashows a s aigh o wa d mig a ion o one b oke whe eas
bhas wo mig a ing nodes. Numbe s in links e e o he o de o
e en s
Wi eless Ne wo ks (2023) 29:1831–1842 1837
123
s o e any in o ma ion on he publishe s, a publishe simply
sends a message and he b oke s a e in cha ge o co ec ly
deli e ing i . By inc easing he subsc ibe s and b oke s we
inc ease he amoun o nodes he p o ocol has o ake in o
accoun . Subsc ibe s will also subsc ibe o 2 il e s and
publishe s will andomly choose o send messages ma ch-
ing one o he o he .
The du a ion o he simula ions is se a 700 seconds,
wi h a publica ion a e by publishe s o 1 message e e y
second. This message gene a ion a e is enough o es i
he p o ocol wo ks wi hou o e loading he communica ion
bu e s o he low powe de ices o he simula ion. The
messages ha e a cons an da a payload o 100 by es. A he
end he e is a 200 second pe iod whe e no new messages
a e sen so ha messages ha a e s ill in bu e s ha e ime,
and he oppo uni y, o be deli e ed. The mobili y o nodes
ollows a andom waypoin model [52], wi h speeds o 2-4-
6-8-10 me e s pe second. Using his mobili y model nodes
will choose a andom poin in he simula ion a ea and mo e
owa ds i a a cons an speed. Once he poin is eached he
p ocess will be epea ed. Fo he adio module we choose
o use one ha is al eady con igu ed in he Cas alia
amewo k, he CC2420 chip, wi h a ansmission powe o
0dbm and an addi i e collision model. Wi h espec o he
MAC laye , we ha e used he Ca ie -Sense Mul iple
Access (CSMA) con igu a ion ha comes wi h he Cas alia
ins alla ion. All possible combina ions o size and speed
a e epea ed 10 imes wi h a di e en andom seed o he
mobili y pa e n and he esul s a e a e aged. The combi-
na ion o node densi y and mo emen speed o he simu-
la ions means ha all i e a ions ha e la ge amoun o
mig a ions and momen s whe e he ne wo k is pa i ioned.
The o al numbe o mig a ions ange om 10 in he
smalles ones o o e 600 in he la ges simula ions. The
low ansmission and ecep ion powe , and speed o he
adio module chosen o he simula ion means ha in he
la ge scena ios he amoun o message collision inc eases,
causing o e 600 mig a ions due o nodes ying o ind
be e connec ions.
Due o he di icul y o inding an algo i hm ha allows
o ull b oke mobili y in a publish/subsc ibe sys em we
had o choose a mo e gene al communica ion p o ocol o
ad hoc ne wo ks. We compa e ou p o ocol wi h Ad hoc
On-Demand Dis ance Vec o (AODV) [53]. AODV uses a
eac i e app oach o ou e c ea ion o compensa e o he
dynamic na u e o he ne wo k, whe e ou es a e c ea ed
only whene e a node wan s o send a message. In o de o
be e compa e bo h o hem we also use he same oles ha
can be seen in Table 2. Wi h AODV publishe s a e
in o med o he subsc ibe iden i ie s ia a con igu a ion
ile and all nodes wo k as b oke s.
6.1 Deli e y a e
One o he me ics ha is able o ell us how well ou
p o ocol wo ks is he deli e y a e o messages. We con-
side he deli e y a e as he numbe o messages a sub-
sc ibe ecei es wi h espec o he ones ha we e
o iginally sen o i . In MFT-PubSub messages ha a e no
ye deli e ed a e s o ed on he b oke s wai ing o be sen as
soon as i ecei es new in o ma ion abou he subsc ibe .
E en ually all messages will be deli e ed, bu in he case o
ou simula ions we conside ha any message no ye
deli e ed a he end on he simula ion as undeli e ed.
In Fig. 2we can see a compa ison be ween ou p o ocol
and AODV. MFT-PubSub seems o ha e be e esilience
o speed, e en imp o ing he deli e y a e as he speed
goes up. Bo h p o ocols a e s ongly a ec ed by he ne -
wo k size, he bigge he ne wo k, he ha de i is o co -
ec ly deli e a message.
In addi ion, i we look a Fig. 3we can see how many
messages a e ac ually deli e ed. The beha io we see in
Fig. 2a, whe e we see an imp o emen o deli e y a e o
highe speeds can be u he analyzed wi h Fig. 3b. He e
we can see a sligh inc ease in he o al numbe o messages
deli e ed ela ed o he speed, bu as he speed eaches
6 m/s i s a s o d op. This beha io can be explained by
he way ou algo i hm bu e s he messages. Whene e a
b oke canno ind he pa h o a subsc ibe i will s o e i
and wai o new in o ma ion on ha subsc ibe , as he
speed goes he e a e mo e oppo uni ies o a subsc ibe o
pass by a b oke ha has a message o i . I we compa e
he deli e y a e di e ences in Fig. 2wi h he amoun o
messages deli e ed in Fig. 3a, we migh hink ha he
di e ence in deli e ed messages is no as big as he
deli e y a e migh sugges . This di e ence is due o how a
publish/subsc ibe sys em wo ks, in o de o deli e a
message o a subsc ibe ha subsc ibe has o i s sub-
sc ibe o some con en . In hese simula ions we only ake
in o accoun he messages ha a e ou ed o a subsc ibe as
ha ing o be deli e ed o ha subsc ibe . I a b oke
ecei es a PUB message bu does no know a subsc ibe on
he o he side o he ne wo k is in e es ed on i , he message
will no be conside ed a loss.
Table 2 Simula ion Con igu a ions
Con igu a ion #pubs #susbs #b oke s A ea
C2 2 2 2 35x35 m2
C4 2 4 4 45x45 m2
C8 2 8 8 60x60 m2
C16 2 16 16 80x80 m2
C32 2 32 32 110x110 m2
1838 Wi eless Ne wo ks (2023) 29:1831–1842
123
6.2 End- o-end delay
Ano he me ic is he ime i akes a message o each i s
des ina ion, we call his he end- o-end delay. In Fig. 4we
can see how ne wo k size a ec s he end- o-end delay.
E en hough MFT-PubSub uses bu e ing o messages o
be deli e ed a a la e da e, i s ill keeps up wi h AODV,
ha ies o deli e a message as soon as possible, e en
ob aining be e esul s on bigge ne wo ks whe e AODV
s uggles o keep ou ing ables upda ed.
6.3 Numbe o messages exchanged
Finally, an in e es ing me ic is he o al numbe o mes-
sages exchanged in he ne wo k. This gi es us insigh in o
how e icien ly a p o ocol is able o ou e messages, and
how much o e head he p o ocol c ea es. In Fig. 5we ha e
his da a as he a e age numbe o messages sen by each
node, be i o ind a ou e, deli e y o a publica ion o any
o he kind o message. Fo he smalles con igu a ion
AODV has be e pe o mance han ou p o ocol, since
MFT-PubSub has o main ain a communica ion ee. Bu ,
whe eas he numbe o messages needed as he ne wo k
size ge s bigge ba ely changes in ou algo i hm, AODV
has a huge inc ease in he numbe o messages i needs o
ind he co ec ou es.
Fig. 2 Message deli e y a e compa ison o bo h algo i hms depending on he size o he simula ion
Fig. 3 A e age numbe o messages co ec ly deli e ed. In awe show he esul s o a node speed o 8 m/s on di e en con igu a ions. And, in
bwe show he esul s o all speeds o he C16 con igu a ion
Fig. 4 Compa ison o end- o-end delay, in seconds, o da a messages
o a node speed o 8 m/s. No e he loga i hmic scale on he y axis
Wi eless Ne wo ks (2023) 29:1831–1842 1839
123