A lim itation of the m iddlew are app roach intro du ced in C hapter 3 is the lack of su p p o rt for m obility scenarios w h en no des m ove from one gatew ay to another. In this section, w e address this issue an d discuss challenges in sup po rtin g continuous d ata an d service access w hile the resources are ubiquitous. We assum e th a t w h en a device (i.e node) moves from one area to another it connects to different gateways. We also assum e th at the users access the data u sin g w eb services.
We discuss the challenges an d the requirem ents for m obility su p p o rt in ubiquitous environm ents an d b ased on this discussion, we p ropose a resource m obility schem e th a t su pp orts service continuity for end- users. In our w ork, the resources are n o t lim ited to w ireless sensor nodes an d other m obile sensing devices can be sup po rted. We p ro vide a generic use-case an d im plem entation of a pro totyp e b ased on the use-case requirem ents. The evaluation results show s u p to 30% reduction in service loss by applying ou r solution.
We describe a service-enabled scenario, w here sensors can move be tw een different areas an d can be associated w ith different gateways. A fterw ards, we identify the issues and define requirem ents to su p p o rt service-continuity. O ur approach for a continuous service provi sioning an d a discussion for gatew ay-to-gatew ay com m unication to handle the handover an d reduce the loss of service is introduced sub-
sequently. We provide the im plem entation an d evaluation results of the pro po sed m obility schem e an d discuss the results.
SOA TCP/IP Connection
II
TCP/IP Connection WS-* Server RESTful Webserver TCP Stack XML/ISON Processing Physical Layer Proxy/Gateway 1 :3 2SlowPan Connection CLowPan Stack Physical LayerFigure 23: Service rendering on Node vs Intermediate Rendering
4.1.1 Mobility for Cyber-Physical Resources
In this section, w e describe a scenario in w hich sensors provide data access via web services. As show n in Figure 23, service requests can be satisfied directly by a service prov id er ru n n in g on the node, or by interm ediate gateways th a t provide service capabilities an d forw ard the d ata requests to the node. To ease the readability of the following sections we use abbreviations of the particular com ponents addressed in this section. The services are m ad e available by Service Providers (SP). The connection betw een the sensor devices an d the SP is done by Sensor Gate Ways (SGW). We use this scenario to extract an d identify the challenges th at occur d u rin g a m obile scenario.
Figure 24 show s a m obility scenario th a t includes different interest groups in the service-enabled loT. In this scenario a user queries a SP for w eb services. The SP finds the sensing resources th a t can provide d ata related to the query. SP obtains the inform ation of the available devices an d uses this inform ation to process the sensor description, find, select an d forw ard the q u ery to relevant resources to resp on d to the u ser queries.
As show n in Figure 24, a p ub lish er (SOo) registers the sensing d e vice into SGWo (Step 1). This is su p p o rted by the autom ation process th a t w e have developed in C hapter 3. The sensor device association process provides initial discovery an d device description publication m echanism s. SP can access the sensors to retrieve the inform ation (via a com m unication link, sim plified in this case th ro u g h connection a) th ro u g h a SGW an d provides the data or the access interface to the end-user via a service provisioning m echanism .
In current loT scenarios, SGWs can b e ow ned by different stakehold ers [48] [41] [25] sim ilar to different m obile operators in cellular n et w orks or WiFi access points ow ned by different providers in w hich m obility tasks could include handover an d device tracking. However, in service-enabled loT solutions, resource-constrained devices raise new issues th a t have an im pact on the h and ling of mobility.
4-1 M O B I L I T Y S U P P O R T FOR M I D D L E W A R E 87
8
User I
S erv ice P rov id er
N e tw o rk ^ P r o v id e r
b
SGW„ SGW, SGW,
G a t e w a y
C o v e r a g e
Spatial M ovem ent over Time
H a n d o v e r D elay C o v e r a g e Loss
Figure 24: loT Scenario
In Step 2, SOo moves physically from SGWq to S G W i. D uring this process, queries are still forw arded to SGWq w hich is no longer re sponsible for SGq. In this step only after successful re-association to SGW 1 an d the u p d ate of the access p ath for the SP to SGWi (shown as link b in Figure 24), a connection to SGq can be established.
In Step 3, the sensor m oves physically to SGW2. In this case a cover age loss appears as for som e tim e the area is not covered by any SGW. In this step, m echanism s are needed to m aintain the connection be tw een user and the service offered by SP. The service providers access p ath is u p d ated to the new SGW2 (show n as Link c). The previous SGWi releases the SG an d forw ards the existing connections to the new SGW2 after the connection is established again.
In this section, we can see th a t sensors are associated w ith only one SGW an d therefore SP is no t u p d ated w ith the changes in the u n d e r lying topology. This leads to several challenges, w hich are caused by the change of the location of the sensor device. In the next section we will identify the challenges an d clarify the contribution.
4.1.1.1 Problem Identification and Requirements
Several challenges arise d u rin g the m ovem ent of the sensor nodes in the scenario discussed previously. At the service level, services can becom e unavailable because of the loss of access to the sensor. This can be d ue to several reasons. Gne reason is that the handover has not been com m unicated betw een the new an d old SGW and therefore SP is n ot inform ed about the new access p ath to retrieve the sensor data
via the new gateway. This is depicted in Figure 24 (handover delay) betw een the m ovem ents from SGWo to SGW i. A nother reason for service unavailability is the loss of signal coverage d u rin g the move m ent process. This is depicted in the Figure 24 (coverage loss) d u rin g the handover betw een SGWi an d SGW2 occurring w hile the sensor m oves in no coverage areas an d therefore no SGW can reach the sen sor node. It sh ould be no ted th a t the coverage loss m u st n o t be related to the SGW change an d can occur also d u e to other issues (e.g. net w ork or device failure). A nother challenge on the service level is the inflexibility of com m on service providers. The service provider use SOA th a t is n o t designed for m obile scenarios an d cannot autom ati cally u p d ate the access p ath s regarding to topology changes as they occur in m obile scenarios.
The aforem entioned issues can h ard ly be ad dressed on the SP level. The SP cannot su p p o rt m obility an d keep track of the devices. Fur therm ore, if SP w o uld h an dle the m obility of the sensor nodes, it m u st be aware of all possible nodes, gatew ay providers an d m u st also h and le accounting an d security related m atters. In a scenario w here different SPs are ow ned by different groups this w ould hind er an im plem entation. To solve the m entioned issues we address them on a gatew ay level w hich allow s us m ore flexibility in device tracking, security an d connectivity issues.
Since in this w ork m obility is h an d led on gatew ay level, com m uni cation has to be established betw een the different SGW responsible for the nodes d u rin g the m ovem ent. The com m unication has to con sider the above m entioned issues: Handover Delay an d Coverage Loss. Especially in scenarios w ith different stakeholders security an d tru st is a challenge contem plating the seam less service continuity. In our w ork, the security issues are ad d ressed in a secure sensor sharing fram ew ork [79] an d a tru st evaluation m echanism [80], w hich can be extended to construct a se c u rity /tru st platform in the generic loT sce nario. We do n o t discuss the details of the security related issues and w ill focus on seam less service continuity for the m entioned m obility
scenario.
4.1.1.2 Static Resource Association
We first revise the static sensor device association u sed in non-m obile scenarios as show n in C hapter 3 an d th en we extend our discussion to ad dressing the m obility aspects. In the resource association p ro cedure, SGWs send out beacon signals w hich are recognised by the w ireless sensor devices. If a sensor n o d e receives a beacon signal, it th a n starts the authentication an d registration process. SGW stores the m eta-inform ation about the sensors such as capabilities, battery life, location, signal strength in a device database an d provides a u n i fied access layer to access the sensors d ata for the external users. In C hapter 3, only a single setup w ith several sensors an d one SGW
4 - 1 M O B I L I T Y S U P P O R T FOR M I D D L E W A R E 89
has been discussed. For large-scale netw orks, this has to be extended to enable m obility betw een different SGW w ith o u t the loss of service. In m obility scenarios betw een tw o gateways, the nodes w ill be reas sociated to the n ew SGWs in the cu rren t design d u rin g a handover process. However, for the SP, the sensor n od e seem s to be connected to the old SGW an d n o t be available. This w ill h ap p en at a certain p o in t w h en the n od e is m oving an d re-associating w ith the new gate w ay before the SP is inform ed ab ou t the change of responsible SGW. This m ight result in a service th a t is n o t able to serve any requests as it is still using the old SGW to q u ery the sensor d ata although the node is n o t connected to it any more.
4.1.2 A Resource Mobility Scheme
To address the d isru p tio n issue w hich arises from the m obility an d the delay in the com m unication, w e propose a resource m obility schem e for the service-enabled loT scenarios. The schem e introduces tw o m odes: a caching an d a tunnelling m ode w hich are discussed in this section. The caching m eth od is u sed to address the delay issues:
Handover Delay an d Coverage Loss. In the caching m ode, the gatew ay
caches the last read in g from the sensor every tim e it is queried an d also d u rin g the initial sensor association. The cached d ata can be then used to serve queries w hich cannot be satisfied directly from the sen sor node. O n the other h an d , the tun nelling m ode addresses the In
flexibility of SP to handle changes in the underlying topology or the
case th at SP has n o t been u p d a te d ab ou t the new location of a p a r ticular sensor node. In case th a t SP still queries the old SGW, w hich w ill forw ard the qu ery to the new SGW an d access the node via a tunnel an d sends it to the SP in tunnelling m ode. In Figure 25 an d 26, the schemes for the caching an d tu nnelling m odes are depicted. The association p hase is the sam e for both, tunnelling m ode an d caching m ode an d w ill now be described.
In the association p hase betw een sensor an d SGW the sensor receives a beacon signal from SGWi sent as S end_B eacon() an d thereup on requests authentication w ith S ta rt_ A u th e n tic a tio n (n o d e Id ). If the sensor is allow ed to associate to the node, perm ission is gran ted by G r a n t_ P erm is si o n ( ).
The node requests a session from SGWi R equest_S ession_Id() an d a session Id is retrieved via R etreive_S ession_Id(). The session Id contains the nam e or add ress of the cu rren t associated gateway. To handle the issues w hich arise d u rin g the service provisioning we in troduce two m odes.
i) Caching:
The pro posed schem e introduces a cache, for each SGW to store the latest data of each connected sensor in a cache on the gatew ay level.
C aching Mode
S e n so r S e n s o r G atew ay: 1 S e n s o r G atew av:2 Service Provider U ser
1 Start Authentication^ • • G rant Perm issionO r" R e q u e st SessionQ . (
■ R etreive SessionQ
S e n d Inital DataO ^ ; ch e DataO
Seryi B eaconQ
G atew ay QberyQ C ach ed o b taQ
Service Consum ptionQi
ResuitQ
Tuneiling Mode
Figure 25: Caching Mode
S e n s o r Gatew ay: 1 S e n s o r G atew av:2 S ervice Provider
<-S e n d B eaconQ Start AuthenticationO . ^1
G rant P erm issio n ^ R e q u e st S essio n fl 1^ ■ Retreive SessionQ
S e n d Inital D ataQ , C a c h e DataQ S e n d B eaconQ S e n d Old ^ s s i o n ld() R etreive jSessionfl Mobility NegotiationQ Establish TunnelQ Q u e ry I ! Sensor S e n k- Forward QueryQ G atew ay QberyQ lM )ata(j_ Tunnel DataQ C a c h e DataQ Tunnel DataQ % rv ic e Consum ptionQi ResuitQ
4 - 1 M O B I L I T Y S U P P O R T FOR M I D D L E W A R E 9I
This d ata is u sed d u rin g the handover delay to respo nd to the queries. The service rem ains available even d u rin g long sensor disconnection (i.e m oving in an area w ith no coverage to another SGW). If a user queries the SP an d SP tries to access the sensor d ata via a SGW w hich cannot access the requested sensor, cached data is u sed to serve the query.
A fter the association phase in Figure 25, the sensor sends its cu rrent data to SGW by S e n d _ Im tia l_ D a ta () an d SGW caches this data. The cache is also u p d a te d d u rin g every successful sensor qu ery w ith the latest sensor data. In case th a t the sensor n od e starts to move, it w ill n o t receive a n ew beacon signal d u e to coverage issues, for th at case the caching m ode applies. D uring the m ovem ent of the sensor node, a u ser uses the SPs services by sending S erv ice_ C o n su m p tio n (). The SP queries the responsible SG W i, w hich is n o t able to contact the particular sensor. SGWi w ill use its latest cached sensor reading to respond to the SP C a c h e d _ D a ta () w hich w ill also be u sed to serve the request of the u ser via SP.
The trade-off for this approach is the inaccurateness in term s of data freshness. In som e critical scenarios w here the freshest d ata needs to be guaranteed, such as m edical or surveillance scenarios this a p proach is n ot suitable. However, in non-critical scenarios, the caching approach can be u sed to keep the service available an d also im prove the response tim e as the sensor has n o t to be queried directly an d the data is served from the cache. Especially for com posite services th a t consist of several sensors; this could be helpful to m aintain continuity w ith the loss of only one accuracy p aram eter of one sensor w hile the other sensors rem ain available.
2) Tunnelling:
The tunnelling approach can be u sed d u rin g the handover w hile the sensor node is already connected to the new SGW b u t the SP has n o t been u p d ated w ith this m ovem ent inform ation. This could be the case for static SPs w hich do n o t su p p o rt the changes in the u n derlying topology. W hile SP is n o t u p d a te d w ith the new SGW in form ation, the SGW can tu n n el the request to the n ew SGW in the tunnelling m ode of the p ro po sed resource m obility scheme. This is possible because the sensor n o d e can subm it ID of the new SGW to the old one d u rin g the re-association phase. A fter the first associa tion to SGWi / the sensor starts m oving an d w ill receive a stronger beacon signal from SGW2, the sensor sends its current session w ith S en d _O ld _S essio n(session ) to the new SGW%. A fter the authentica tion the sensor n od e receives a new session. SGW2 starts the nego tiation w ith SGWi w ith M .o b ility _ N eg o tiatio n () an d SGWi estab lishes a tunnel connection to SGW2 via E sta b lish _ T u n n e l().
In case SP has or cannot be u p d a te d w ith the u nd erly ing change the old SGW can reroute queries to the new one as show n in Figure 26. The user w ants to subscribe a service at the SP w hich w ill q u ery
the old SGWi via G atew a'y_Q uery(S G W i,serL sorId) to retrieve the sensor data. The SGWi / however, is n o t in control of the sensor device, b u t is aware of the n ew location w hich has b een exchanged du ring the M o b iU t'y _ N eg o tiatlo n (). The old SGW w ill forw ard the query from the SP to the new SGW via the established tunnel. SGW2 can q uery the sensor via Q u e ry _ S e n so r(se n so rld ) an d send this data back via the tu nn el to the SGWi • In case the sensor at the new SGW is n o t available any m ore, cached d ata (as in the caching m ode) can be used. The old SGW w ill rep ly to the SP w ith the tunnelled data and the user can be served.
However, the trade-off in this m echanism is the longer response tim e for service consum ption as the q uery w ill get rerou ted from one SGW to the other w hich increases the m essaging.
4.1.3 Implementation and Evaluation
In order to evaluate the designed resource m obility schem e we have im plem ented the scenario of a service provider, several SGWs and m obile sensor nodes in ou r sim ulator th a t is explained in detail in Section 4.2.
The sensor nodes provide atom ic service interfaces sim ilar to the CoAP im plem entation on real nodes. The no des connect to the near est SGW an d p ub lish their inform ation on it. SGW inform s SP regard ing the available sensor n odes an d SP provides a com posite services consisting of the atom ic services.
To evaluate the perform ance of the p rop osed schem es, w e use: av erage response tim e (avg), m inim u m response tim e (min) an d m axi m u m response tim e (max) m etrics, show n in Table 20. These are the m easurem ent tim es in m icroseconds as it takes to resp on d to a single user query. The error rate is defined as the ratio betw een successful queries an d failed queries resp on ded to the user. Failed queries occur in cases th at a sensor cannot be queried or its data is n o t available.
We evaluate three different scenarios w ith different m obility and coverage patterns. We first change the frequency of m ovem ent for the no des betw een different areas covered by gateways. We assum e a slow scenario sim ilar to a slow m ovem ent an d a fast scenario w ith hig h frequency betw een different gateways. W ith this param eter, we w an t to evaluate ou r tw o different m odes in term s of response tim e an d error rate (^service unavailability). The other p aram eter is the frequency of connectivity loss betw een sensor an d any gateway. This h ap p en s in scenarios w here the sensor cannot connect to any gate w ay an d therefore the service is in terru p ted completely. In the slow m obility pattern, w e assum e th a t a sensor n od e changes its location from one gatew ay to another gatew ay every 2 seconds. In the fast m o bility pattern , the frequency how often any no de in the netw ork can
4 -1 M O B I L I T Y S U P P O R T FOR M I D D L E W A R E 93
Table 20: Comparison between different modes and direct access
mode avg min max Error Rate
Fast Mobility Pattern
Tunnel Mode 10100 2090 10149 0.0 Cache Mode 9421 2018 10106 0.0 Direct 9635 2023 10107 0.58 Slow Mobility Pattern
Tunnel Mode 9981 2024 10112 0.0 Cache Mode 9625 2020 10011 0.0 Direct 9632 2012 10100 0.34
change a gatew ay is m uch higher (every 0.2 second a n od e changes its gatew ay location).
The experim ent setup consists of 10 sensor nodes w hich can con