Björn Richerzhagen

Alexander Wagener

Nils Richerzhagen

Rhaban Hark

Ralf Steinmetz

A Framework for Publish/Subscribe Protocol Transitions in Mobile Crowds

The increasing number of sensor-equipped mobile devices enables new applications for communication within crowds of people. Ranging from monitoring services that provide insights into the crowd's behavior to fully fledged messaging applications for end users, all such applications require communication protocols that are tailored to the characteristics of a mobile ad hoc network (MANET). A common communication scheme for such dynamic networks is the publish/subscribe (pub/sub) paradigm, that offers temporal and spatial decoupling. However, pub/sub protocols for MANETs are designed and evaluated under very restricted conditions regarding the expected mobility, number of users, application workload, and application requirements, targeting rather specific scenarios. In reality, such conditions are subject to change, especially considering people's behavior during crowded events. In this work, we propose a framework that enables dynamic transitions between different pub/sub protocols based on the currently monitored conditions or caused by an external trigger. We analyze the behavior during transitions and the overhead introduced by our framework through extensive simulations. By using simple pub/sub protocols and switching between them based on the observed conditions, we are able to maintain good service quality at reasonable overhead, thereby enabling applications to operate in dynamic conditions representative of mobile crowds.

Introduction

The trend towards mobile devices and their continuously increasing capabilities in terms of processing power, sensors, and communication interfaces motivates a range of applications for communication in crowds. Application objectives range from crowd sensing and monitoring, e.g., to detect critical densities of people, to messaging and infotainment [START_REF] Karaliopoulos | User recruitment for mobile crowdsensing over opportunistic networks[END_REF][START_REF] Ma | Opportunities in mobile crowd sensing[END_REF]. Often, these applications are tailored towards a specific type of crowd (e.g., visitors of a music festival, or first responders [START_REF] Baldini | Survey of wireless communication technologies for public safety[END_REF][START_REF] Martín-Campillo | Evaluating opportunistic networks in disaster scenarios[END_REF]), where central infrastructure might be overloaded, too costly, or not available at all. In addition, user-generated content is often only relevant in vicinity of its creator [START_REF] Huguenin | Content and geographical locality in user-generated content sharing systems[END_REF], a property that can be exploited to increase system performance and scalability [START_REF] Jaho | Joint interest-and locality-aware content dissemination in social networks[END_REF][START_REF] Vulimiri | More is less: reducing latency via redundancy[END_REF]. Therefore, direct ad hoc communication is used to replace -or at least augment [START_REF] Richerzhagen | Bypassing the cloud: Peer-assisted event dissemination for augmented reality games[END_REF] -the communication via a central infrastructure. Consequently, a plethora of pub/sub systems for MANETs have been proposed in recent years, ranging from simple approaches based on notification or subscription flooding to more complex overlays that maintain distribution trees. Each approach focuses on a particular optimization target such as increasing robustness [START_REF] Paridel | Fadip: Lightweight Publish/Subscribe for Mobile ad hoc Networks[END_REF], providing low latency communication [START_REF] Pietzuch | Hermes: A Distributed Event-Based Middleware Architecture[END_REF], or achieving a high resilience towards mobility [START_REF] Anceaume | Publish/subscribe scheme for mobile networks[END_REF]. Furthermore, each approach is able to deliver the desired performance only within bounded environmental conditions specific to the scenario it was initially designed for.

In this work we propose a framework that is able to dynamically exchange the utilized pub/sub protocol for a crowd of people, based on status information gathered within the system or based on extrinsic triggers. This allows us to adjust the performance vs. cost characteristics of the system based on the current conditions and application requirements, while at the same time relying on rather simple pub/sub protocols with well-known properties. Extending the concept of transitions and their corresponding lifecycles as proposed in [START_REF] Frömmgen | Towards the description and execution of transitions in networked systems[END_REF], our framework addresses challenges related to the state transfer as well as message translation during the execution of a transition. We argue that existing protocols can be integrated easily, as they only need to provide access to stored subcriptions through a basic and easily extendable subscription model. By relaying network operations -e.g., sending and receiving of messages -as well as interaction with the application through simple proxy interfaces, transitions between protocols are executed transparent to the application.

Based on a simulative evaluation of a prototype of our proposed framework we quantify the performance benefits as well as the additional overhead introduced by executing transitions between two basic pub/sub protocols. The simulation setup is derived from real-world measurements of people's behavior during a large-scale music festival [START_REF] Frömmgen | Crowdsourcing measurements of mobile network performance and mobility during a large scale event[END_REF], thereby providing valuable insights into protocol performance in a realistic setting. Our findings reveal that transitions executed by our framework enable the system to adapt to changing conditions, while at the same time keeping the control overhead reasonably low. The system is able to maintain the desired performance characteristics and ensure delivery of notifications during and after the execution of a transition. The evaluation results further indicate the need for efficient bootstrapping mechanisms to improve the benefit of -especially short-lived -transitions. Overall, the execution of transitions between basic pub/sub protocols is a promising approach to tackle the challenge of communication in mobile crowds under dynamic conditions. The remainder of this paper is structured as follows: In Section 2 we describe and discuss our proposed framework for transitions between pub/sub protocols in mobile crowds. We evaluate the framwork in a simulative setup derived from real-world crowdsourced measurements of people movement during a large-scale music festival and present the results in Section 3. After discussing relevant related work in Section 4, we conclude the paper and discuss future research directions in Section 5.

Figure 1 provides an overview of the entities of the transition-enabled pub/sub framework and their interactions. At the core of the framework, a number of pub/sub protocols are provided. Proper activation and termination of protocols during transitions is assured by the lifecycle management. Instead of directly interacting with the respective pub/sub protocol, applications publish, subscribe, and unsubscribe through an interaction proxy. To this end, the proxy takes care of relaying the respective method calls to the currently active pub/sub protocol. Additionally, it handles callbacks and notifications triggered by the pub/sub protocol upon reception of a notification and forwards the notification to the application for further processing. The methods provided by the proxy follow the proposal for a common pub/sub application programming interface, as defined in [START_REF] Pietzuch | Towards a common API for Publish/Subscribe[END_REF]. This ensures that transitions between protocols are transparent to the application -no modification of application code is required. The currently active pub/sub protocol stores its subscriptions -local subscriptions originating from the application, as well as subscriptions managed on behalf of other nodes -in the provided subscription storage. To this end, a uniform abstraction for subscriptions is required. This abstraction is provided by the interaction proxy and further discussed in Section 2.2. To enable communication among nodes in the system, each pub/sub protocol sends and receives messages through a common network proxy provided by the framework. The network proxy relays incoming messages to the currently active pub/sub protocol. During protocol transitions, some nodes may receive messages originating from a different protocol than their currently active one. Rather than simply discarding these messages, the network proxy attempts to resolve basic information and translate it into a form that can be processed by the currently active pub/sub protocol. This (optional) functionality is implemented on a per-protocol basis by adding the respective transformation functions to the message translation matrix. In the following section, the process of a transition within our framework is discussed in detail.

Execution of Transitions

The process of a transition itself is shown in Figure 2. For simplicity, we assume that there exists a logically centralized coordinator. For most scenarios, this assumption is reasonable, as applications usually report their data to some kind of sink infrastructure, e.g., the coordination unit of an emergency response team. In cases involving multiple coordinators, distributed consensus protocols [START_REF] Olfati-Saber | Consensus and cooperation in networked multi-agent systems[END_REF] could be used to agree on a transition. The coordinator starts a transition in consequence to a trigger event. Such an event can be the outcome of monitored state (e.g., a sharp decrease in system performance, or sudden increase in people movement), or based on an external trigger. Based on the target pub/sub protocol, a transition strategy is selected and the decision is disseminated to all mobile nodes. Dissemination can either be performed by the pub/sub protocol itself (in this case, the framework registers as a subscriber to the respective event type) or via an out-of-band dissemination protocol. Once the decision arrives at a mobile node, the respective transition strategy is executed. Each strategy consists of four basic steps: (i) start the new protocol through the lifecycle manager, (ii) transfer state to the new protocol, relying on the subscription storage, (iii) relay application and network interaction to the new protocol by utilizing the respective proxies, and (iv) terminate the previously running protocol. Before actually relaying all interaction to the new protocol, the strategy needs to wait until the lifecycle manager signals successful startup of the new protocol, as discussed in [START_REF] Frömmgen | Towards the description and execution of transitions in networked systems[END_REF]. Depending on the protocol, startup might involve the formation of a topology and, as a consequence thereof, some message exchange unrelated to the application payload. The network proxy allows such communication during the startup and shutdown phase of a protocol, thereby ensuring the functionality of bootstrap mechanisms and a graceful shutdown. Once the new protocol is ready, all further interaction is relayed through the new protocol and the old one is terminated.

Without any additional information about the pub/sub protocols involved in a transition, the framework is already able to execute a transition by only relying on the common abstraction of the subscription storage as well as the interaction proxy. However, such a transition would involve unsubscribing with the old protocol and then re-subscribing for all locally stored subscriptions afterwards, introducing significant overhead. Therefore, state transfer can be refined on a per-protocol basis, leading to more evolved transition strategies. If, for example, the target protocol and the currently active protocol have a notion of brokers (e.g., some nodes in the mobile network act as message brokers serving other nodes that act solely as clients), one can bootstrap the new protocol by assigning the role of a broker to the nodes that already previously acted as brokers. Thereby, state does not need to be redistributed during startup, but instead only as a consequence of the default maintenance mechanisms of the new protocol. This strategy significantly reduces the overhead caused by a transition.

As our framework is used for communication within a crowd of people, we demand the whole network to execute transitions. In a MANET, partitions might occur and decisions might not reach all affected nodes, potentially leading to protocol misbehavior once partitions merge. To this end, the network proxy piggybacks an identifier of the currently active protocol, the transition strategy, as well as a simple logical clock to messages sent by a node. If another node receives such a message, but does not yet employ the same protocol, the appropriate transition is executed. In cases where the sending node employs an outdated protocol, the identifier helps in determining whether the message can be translated and still be processed by the new protocol. Translation of messages is enabled as all protocols deploy a common subscription model, which is discussed in the following section.

Subscription Model and Storage

As our framework utilizes a common storage for subscriptions, all pub/sub protocols need to use or extend our basic subscription model. To this end, we deploy an attribute-based subscription scheme that supports dynamic types, as illustrated in Figure 3. In addition to an arbitrary number of types and attributes, each subscription may carry one string-typed attribute denoting a topic. In this way, the resulting subscriptions can be processed by attribute-based and simple channel-or topic-based pub/sub protocols. Subscriptions (and notifications) are built by the application, relying on factory methods provided by the interaction proxy. Therefore, applications do not depend on subscription schemes introduced by the individual protocols.

To enable protocol-independent management of subscriptions, the respective objects that are used to compose a subscription (e.g., filters and attributes) are created through factory methods provided by the interaction proxy. Therefore, if an existing pub/sub protocol needs to extend the basic subscription model, it can simply extend the respective factory method to include additional, protocolspecific state within a subscription. The same model and factory concept is also used by applications for the creation of notifications. If nodes act as brokers within the current protocol (i.e., they manage subscriptions on behalf of other nodes), the subscribers are also attached to the respective subscription. In the basic model, only an IP address is required for each subscriber.

Integrating Existing Pub/Sub Protocols

One goal of our framework is to keep the required modifications of existing protocols as simple as possible. To ensure basic interoperabilit one needs to (i) provide an adapter for the interaction proxy and the network proxy, (ii) utilize the subscription storage, and (iii) implement the basic lifecycle methods. While the current network proxy requires some modifications (the use of a custom socket), a future version of the framework could intercept 1 calls to the respective methods. As a basic lifecycle handling is already part of most protocols, and our subscription model is fairly generic, (ii) and (iii) do not pose significant challenges and only require minor changes.

To enhance system performance during a transition, one may provide a custom transition strategy for the respective protocol. As discussed in Section 2.1, a strategy might include more complex state exchange mechanisms to reduce messaging overhead. Usually, the resulting state exchange mechanisms depend on specific combinations of source and target protocol. If a matching state exchange mechanism is provided for the current transition, it is executed automatically by our framework. In addition to that, protocols might also provide custom entries to the message translation matrix. The matrix simply consists of descriptions of messages used by a protocol and pointers to some common data fields within those messages, like subscriptions or notifications. In this way, incoming messages of the wrong protocol type can be interpreted by the currently running protocol to some extent.

We aim to support simple integration of existing pub/sub protocols into the transition-enabled framework by requiring only minor modifications. However, the framework allows protocol designers to provide more elaborate transition strategies tailored towards the peculiarities of the specific protocols. 1 We are currently extending the prototype to rely on Java Reflections for this purpose.

Prototype and Evaluation

We implemented a Java-based prototype of the proposed framework on top of the Simonstrator-Platform [START_REF] Richerzhagen | Simonstrator: Simulation and prototyping platform for distributed mobile applications[END_REF] to enable both simulative, and prototypical performance studies. Goal of the evaluation is to verify the concept of transitions in pub/sub systems for crowd communication as a viable solution to react to environmental changes in a flexible and generic way. Therefore, we model a scaled-down scenario based on real-world crowdsourced measurements of people movement during a music festival [START_REF] Frömmgen | Crowdsourcing measurements of mobile network performance and mobility during a large scale event[END_REF], as illustrated in Figure 4. The scenario can roughly be categorized into two phases with respect to movement characteristics: a relatively static phase during concerts (c.f. Fig. 4a), and an active phase where the crowd moves to different stages or enters and leaves the festival area (c.f. Fig. 4b). Stages and other relevant points of interest (e.g., food booths) are modeled as attraction areas, allowing us to rely on a modified version of the SLAW movement model [START_REF] Lee | Slaw: A new mobility model for human walks[END_REF][START_REF] Stingl | Peerfactsim. kom: Take it back to the streets[END_REF]. In our evaluation scenario, we vary the probability that a node selects a new attraction area and starts moving towards it, mimicking real-world behavior during and after a concert (c.f. Fig. 4c). Fig. 4: Illustration of the evaluation scenario, derived from crowdsourced movement profiles of visitors of a music festival [START_REF] Frömmgen | Crowdsourcing measurements of mobile network performance and mobility during a large scale event[END_REF].

The evaluation was conducted by means of simulation on the Simonstrator-Platform [START_REF] Richerzhagen | Simonstrator: Simulation and prototyping platform for distributed mobile applications[END_REF], relying on the overlay simulator PeerfactSim.KOM [START_REF] Stingl | PeerfactSim. KOM: A Simulation Framework for Peer-to-Peer Systems[END_REF] and the NS-3 802.11g underlay model [START_REF] Riley | The NS-3 Network Simulator[END_REF]. We simulated 400 nodes on a 2000 m×2000 m area, with a publication rate of 1 publication per second and a fan-out of 1 : 20, meaing each publication had 20 interested subscribers. Two hours of operation are simulated: (i) during the first 30 minutes all nodes join; (ii) after 40 minutes, the workload phase starts and subscriptions, as well as publications, are issued; (iii) performance and cost metrics are measured between minute 60 and 100; (iv) the workload is applied until the end of the simulation. Each run was repeated five times with different random seeds, and the plots show the average over these five runs. The scenario starts with a concert phase lasting until minute 70.

During this concert phase, the probability of a node to start moving to a new attraction area is set to p l = 0.05. Two minutes before the end of the concert, this probability starts to increase linearly, until it reaches p h = 0.7 at minute 72, leading to a noticeable number of nodes moving around in-between attraction areas. The probability is reduced back to p l = 0.05 around minute 80, when the next concert starts. This cycle is repeated once more around minute 90.

For the evaluation, two basic pub/sub protocols are integrated into the framework: (i) an approach using notification flooding through a gossiping mechanism (termed distributed in the following), and (ii) a broker-based approach, where a subset of the nodes is elected as brokers that maintain subscriptions on behalf of the remaining nodes. In the broker-based approach, notifications are sent along a delivery tree formed by the broker nodes, thereby reducing the traffic. To understand the behavior of both protocols in our dynamic scenario, we evaluated them within our framework without triggering any transitions. The resulting performance and cost characteristics over time are shown in Figure 5. based (d-f) pub/sub protocol in the dynamic scenario.

The gossip-based approach is robust enough to maintain a delivery ratio of one over the whole duration of the simulation (c.f. Fig. 5a). However, due to the utilization of a gossiping mechanism, event delivery can take up to one second (c.f. Fig. 5b), and the resulting traffic is five times higher than for the brokerbased approach that forms a delivery tree (c.f. Fig. 5c and Fig. 5f). While delivery ratio and delay remain constant even during phases of high mobility, a slight increase in average traffic (c.f. Fig. 5c) can be observed. For the broker-based approach, the formation of delivery trees in the dynamic scenario leads to an average delivery ratio of 0.9 in the more static phases of the scenario (c.f. Fig. 5d). However, the ratio falls to an average 0.8 with significantly worse performance for a fraction of the nodes during phases with higher mobility. This is the result of failures in the delivery tree, caused by brokers that move out of range of each other. Until the failure is detected and repaired, the performance suffers. As long as the delivery tree remains functional, the broker-based approach achieves significantly better delivery delays (c.f. Fig. 5e) and consumes less traffic than the gossip-based approach.

We conduct an evaluation featuring transitions between the broker-based and the gossip-based approach in order to provide a proof-of-concept evaluation of our proposed framework, as well as for an estimation of the cost introduced by the framework to control transitions. Transitions are triggered shortly after the user-mobility changes, according to the scenario description. The results for the transition-enabled framework are shown in Figure 6. The background colors of the plots denote the currently active protocol. It can easily be seen that a transition is triggered a few minutes after the mobility starts to increase, as it becomes more probable for nodes to select a new attraction area. At minute 72, the transition from the broker-based approach to the distributed gossiping-based approach takes place. As a consequence, the delivery ratio directly increases, as the more robust protocol is used (c.f. Fig. 6a). However, this transition also leads to a significant increase in variation of the delivery delay (c.f. Fig. 6b) and an increased overall traffic consumption (c.f. Fig. 7a). As the gossip-based protocol relies on notification flooding, nodes only need to filter based on their own, locally stored subscriptions. Therefore, there is no need for state transfer when initializing the protocol. This becomes apparent from the sharp transition of the traffic at minute 72, as shown in Figure 7a. In contrast to that, the transition back to the broker-based approach at minute 82 requires some initial bootstrapping and, thus, causes higher traffic, as brokers have to be elected. Due to the scale of the x-axis, one might get the impression of a discrete switch between pub/sub protocols. A zoomed-in version of the first transition, shown in Figure 7b, reveals that it takes up to 180 ms in our setting until the last node executes the transition. As shown in our evaluation, the framework successfully executes transitions between two different pub/sub protocols during runtime. The performance of the overall system remains stable during and after transitions. Our proposed approach, thus, is able to adapt to the dynamics of the considered scenario by switching between protocols, as initially motivated.

Related Work

There exists a number of reconfigurable and adaptive pub/sub middleware concepts for fixed [START_REF] Cugola | Reds: a reconfigurable dispatching system[END_REF][START_REF] Leclercq | Dream: a component framework for the construction of resource-aware, reconfigurable moms[END_REF] and mobile networks [START_REF] Sivaharan | GREEN: A Configurable and Re-configurable Publish-Subscribe Middleware for Pervasive Computing[END_REF][START_REF] Sørensen | A context-aware middleware for applications in mobile ad hoc environments[END_REF]. As our work specifically targets mobile crowds, we focus on the latter and additionally discuss related, self-adaptive pub/sub protocols. Sivaharan et al. propose Green [START_REF] Sivaharan | GREEN: A Configurable and Re-configurable Publish-Subscribe Middleware for Pervasive Computing[END_REF], a component-based middleware for Internet-scale pub/sub, inspired by REDS [START_REF] Cugola | Reds: a reconfigurable dispatching system[END_REF]. In contrast to REDS, the authors specifically aim at integrating local MANET regions into the overall pub/sub system. To this end, mobile devices using the middleware can be configured to act as gateways for nearby devices. The device-to-device communication is then handled via a range of configurable protocols that can be integrated into Green. However, the authors do not evaluate or discuss the implications of dynamic reconfigurations on mobile networks and solely consider a protocol based on notification-flooding, thereby obviating the need for any state transfer or maintenance mechanism. With our framework, the pub/sub middleware can be extended to actually react to environmental changes and dynamics by executing protocol transitions on the fly.

Sørensen et al. propose a middleware for context-aware applications on mobile networks [START_REF] Sørensen | A context-aware middleware for applications in mobile ad hoc environments[END_REF]. While focusing explicitly on providing a higher level programming abstraction to pervasive applications, the proposed middleware also includes a communication substrate that provides pub/sub capabilities. The authors base their pub/sub substrate on the design of the MANET pub/sub protocol Steam [START_REF] Meier | STEAM: Event-Based Middleware for Wireless Ad Hoc Network[END_REF]. Unfortunately, no performance figures are given, and adaptability to changing dynamics is not evaluated. According to a recent survey of middleware approaches for pervasive applications by Raychoudhury et al. [START_REF] Raychoudhury | Middleware for pervasive computing: A survey[END_REF], event-based communication is a key building block for all kinds of middleware solutions. Therefore, we believe that our framework poses a valuable foundation for middleware concepts, such as [START_REF] Sørensen | A context-aware middleware for applications in mobile ad hoc environments[END_REF]. Instead of proposing a new middleware concept as in [START_REF] Batista | Managing dynamic reconfiguration in component-based systems[END_REF][START_REF] Sørensen | A context-aware middleware for applications in mobile ad hoc environments[END_REF], we aim at providing a core functionality as a potential component of such a middleware in a lightweight fashion, putting a focus on reconfigurability. Therefore, by integrating our framework as communication substrate as envisioned by Sørensen et al. and providing higher-level pub/sub functionality on top, one can realize mobile applications that can acutally adapt their local ad hoc communication means to dynamic environmental conditions.

Depending on the characteristics of the application and the environmental conditions, more elaborate pub/sub protocols can be utilized and incorporated into our framework. For rather static environments but large amounts of nodes, hierarchical approaches, as presented by Yoo et al. [START_REF] Yoo | A Scalable Pub/Sub System for Large Mobile ad hoc Networks[END_REF], can be deployed. By relying on fixed delivery trees, and limiting communication to the exchange of subscriptions between dedicated broker nodes, the overhead caused by flooding of notifications can be avoided. However, such a structured approach suffers from node mobility. To this end, a semi-structured, density-based approach has been presented by Friedmann et al. [START_REF] Friedman | A density-driven publish subscribe service for mobile ad-hoc networks[END_REF]. Here, routing between brokers relies on a gradient-based scheme, making it more robust against broker movement. Additionally, the election of brokers requires only very limited knowledge -the density of the two-hop neighborhood -and, thus, can be performed without adding significant overhead. To address high mobility, or frequent connection failures, completely topology-less approaches have been proposed. Extending flooding-based concepts, approaches such as [START_REF] Paridel | Fadip: Lightweight Publish/Subscribe for Mobile ad hoc Networks[END_REF] utilize gossip-based communication protocols to limit the amount of redundant data transmissions. Within our proposed framework, one can leverage the benefits of these different approaches by switching between pub/sub protocols at runtime and choosing the protocol that best fits the current conditions. At the same time, application developers just utilize a simple and well-known pub/sub interface, as all functionality of our proposed framework remains transparent to the application.

A number of interesting application concepts rely on direct ad hoc communication in crowds of people, where cellular infrastructure might be unavailable or simply overloaded. The performance of the utilized communication protocol, however, can vary significantly depending on the dynamics of the considered scenario. In this work, we propose a framework that is able to switch between different pub/sub protocols for mobile networks at runtime. To this end, the framework provides a basic abstraction for subscriptions, as well as mechanisms for state transfer and interaction with the network and the application, allowing to easily integrate new protocols. Based on real-world measurements of a music festival, we derive a representative workload for a communication system in such an environment, and use it to evaluate a prototype of our proposed framework including two basic pub/sub protocols. In contrast to a static configuration of the protocols, our framework is able to maintain the desired performance vs. cost characteristics even in the face of dynamic changes of network conditions by executing transitions between the different protocols.

Our framework can work as a wrapper for existing pub/sub middleware, as the application interface relies on default pub/sub methods (c.f. [START_REF] Pietzuch | Towards a common API for Publish/Subscribe[END_REF]) defined by the interaction proxy. To trigger transitions, the pub/sub system itself can be utilized: in such a case, the lifecycle management simply acts as a subscriber to a well-defined control channel. It is beyond the scope of this work to provide means to accurately monitor the network state as a foundation for transition execution -however, we are currently integrating an adaptive monitoring system that is targeted towards similar scenarios [START_REF] Richerzhagen | Adaptive monitoring for mobile networks in challenging environments[END_REF].

We are currently in the process of integrating a wider range of more complex pub/sub protocols into our framework, especially looking into protocols that support location-based or context-based publish/subscribe semantics. These protocols offer richer subscription semantics, enabling more sophisticated filtering of relevant notifications. One interesting application for the proposed framework is switching between direct delivery of notifications and delay-tolerant protocols [START_REF] Boldrini | Design and performance evaluation of contentplace, a social-aware data dissemination system for opportunistic networks[END_REF][START_REF] Costa | Socially-aware routing for publish-subscribe in delay-tolerant mobile ad hoc networks. Selected Areas in Communications[END_REF]. Here, our framework could help in preserving energy by disabling the direct communication interfaces opportunistically, as consequence of a protocol transition, if applications do not require instant delivery for certain types of events. However, this would require centralized coordination via a cellular interface, as previously explored in [START_REF] Richerzhagen | Bypassing the cloud: Peer-assisted event dissemination for augmented reality games[END_REF]. The prototype of the framework is available online as part of the Simonstrator platform [START_REF] Richerzhagen | Simonstrator: Simulation and prototyping platform for distributed mobile applications[END_REF].

Fig. 1 :

 1 Fig. 1: Overview of the entities and their interactions in the proposed framework.

Fig. 2 :

 2 Fig. 2: Control flow and execution steps for a transition.

Fig. 3 :

 3 Fig. 3: Subscription model within the proposed framework.

Fig. 5 :

 5 Fig. 5: Performance in terms of delivery ratio and delay, and cost in terms of traffic for static deployment of the distributed (a-c) and the tree-based (d-f) pub/sub protocol in the dynamic scenario.

Fig. 6 :

 6 Fig. 6: Transitions between the broker-based and the distributed, gossip-based protocol occur at minutes 72, 82, and 92. The performance characteristics of the system change accordingly.

Fig. 7 :

 7 Fig. 7: Bootstrapping the tree-based protocol consumes more traffic directly after the transition at minute 82. A zoomed-in version of the transition at minute 82 shows how the decision spreads in the network.

Transition Strategy running on a regular node Coordinator

			Subscription		Network Proxy
		Lifecycle	Storage
		Management		Interaction Proxy
	Trigger
	Strategy	Start target	Transfer state	Relay net I/O	Stop previous
	selection	protocol	(subscriptions)	and interaction	protocol
		decision dissemination

Acknowledgments

This work has been funded by the German Research Foundation (DFG) as part of projects B1, C2 and C3 within the Collaborative Research Centre (CRC) 1053 -MAKI. Ralf Steinmetz has been partially supported by a Chair of Excellence from University Carlos III, Madrid, Spain. The authors would like to thank Sophie Schönherr for her valuable contributions.


Towards a QoS-Oriented Migration Management Approach for Virtualized Networks

ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.


Thomas Bocek

Christian Killer
email: christian.killer@uzh.ch

Christos Tsiaras

Burkhard Stiller

An NFC Relay Attack with Off-the-shelf Hardware and Software

Keywords: NFC, Relay Attacks, Countermeasures, Credit Card

Passive Near Field Communication (NFC) devices, such as contactless smart cards, use NFC to communicate with other devices without any physical connection or an internal battery source, deriving power inductively via the radio field generated by the NFC reader device. Today, many Point-of-Sale (PoS) terminals, credit cards, and also mobile devices are NFC-capable and facilitate contactless payments. Although the communication range is typically limited to a few centimeters, NFC attacks exist that exploit such contactless communication channels. This paper focuses on NFC relay attacks and shows that a practical relay attack on public transport PoS terminals, using off-the-shelf mobile devices and hardware, is feasible. Finally, countermeasures are discussed with the main finding that currently the best countermeasure against relay attacks is to physically shield an NFC device.

Introduction

Near Field Communication (NFC) technology is defined as a standardized wireless communication technology, which operates in the High Frequency (HF) band at 13,56 MHz. NFC devices do not necessarily need a battery in place to operate. Passive NFC devices, such as contactless smart cards, can operate deriving power inductively from the magnetic field generated by the NFC reader.

Europay, Mastercard, and Visa (EMV), is a protocol for smart card payments around the world [4]. The Point-of-Sales (PoS) exchanges EMV protocol messages with the chip on the smart card, while selected data is secured with a cryptographic Message Authentication Code (MAC) using symmetric encryption in the online mode, and asymmetric encryption in the offline mode (without access to a network). In the online mode, the key is known to the card issuer, so the identity of the card can be verified. Originally, EMV was designed to fight against the threat of magnetic stripe card fraud and the effort to establish a worldwide standard for chip-based payment-cards and PoS. While the deployment of EMV progressed, and the use of chip-based transactions increased, fraud incidents including magnetic stripe card fraud decreased. However, fraudulent card-not present transactions (especially card transactions over the Internet, phone, or fax) increased as well [START_REF] Murdoch | Verified by Visa and Mastercard Securecode: Or, How Not to Design Authentication. 14th International Conference on Financial Cryptography and Data Security (FC2010)[END_REF][START_REF] Roland | Cloning Credit Cards: A Combined Pre-play and Downgrade Attack on EMV Contactless[END_REF]. The widespread distribution of EMV-compliant payment-cards, immediately raised the question if security issues have to be further investigated. Prior research showed that the EMV protocol has major vulnerabilities that can be exploited [START_REF] Bond | Chip and Skim: Cloning EMV Cards with the Pre-play Attack[END_REF][START_REF] Murdoch | Chip and PIN is Broken[END_REF][START_REF] Killer | Security Challenges in Contactless Payments Solutions[END_REF]. Today, new PoS terminals, credit cards, and mobile devices are NFC-capable and designed according to the EMV contactless standard. Thus, many security sensitive applications, such as payment applications and electronic passports, already use contactless technologies [START_REF] Ngu | How Secure are Contactless Payment Systems?[END_REF].

One type of attack with NFC and Radio-frequency Identification (RFID) is the relay attack. This type of attacks in RFID communications is known for years, but still EMV-compliant PoS terminals are at least partially vulnerable. With relay attacks, the physical presence of the credit card near a PoS is not necessary anymore. This could disrupt security and privacy assumptions, mainly due to the fact that most of these contactless smart cards are based on the International Organisation for Standardization (ISO)/International Electronical Commission (IEC) 14443 standard and are intended to operate only over a distance of around 10 cm. With a relay attack, the distance assumption of 10 cm does not hold anymore. As an example, a credit card can be physically in the US, while in Germany, with relaying, this card can be used to pay for a public transport ticket using a contactless PoS terminal. Furthermore, in some countries, small amounts can be charged from the credit card via NFC without any user intervention or credential usage.

This paper shows the feasibility and proof-of-concept of relay attacks with off-the-shelf software and hardware by implementing a practical relay attack on EMV-compliant PoS machines for public transportation. It shows that its still feasible to exploit this known vulnerability. Furthermore, a discussion follows about countermeasures and its effectiveness.

The remainder of this paper is structured as follows. Related work is discussed in Section 2, followed by a generic NFC relay attack architecture in Section 3. While Section 4 presents technical details about the implementation of this work, Section 5 proposes possible countermeasures to prevent NFC relay attacks. Finally, Section 6 summarizes this paper and draws conclusions.

Related Work

Various EMV protocol attacks have been reported in the literature. After an overview over the EMV authentication methods, downgrading, yes-card, wedging, pre-replay, and relay attacks are presented in the following.

There are three different authentication methods for EMV cards, Static Data Authentication (SDA), Dynamic Data Authentication (DDA) and Combined Data Authentication (CDA) [START_REF]EMV Key Management -Explained[END_REF]. Weaknesses have been found for all these card authentication methods. Cards using SDA are vulnerable to the "yes-card" attack, where an attacker can copy the static data. Then, the attacker can use the copied card to conduct valid, statically signed transactions. As a result, DDA improved this by signing dynamic data with a card-unique asymmetric Rivest, Shamir and Adleman (RSA) key. CDA combines DDA, the signing of changing transaction data, with the use of an application cryptogram (AC) generated by the card.

All these authentication methods improve the security of contactless transactions. There are three main Cardholder Verification Methods (CVM) which are supported by EMV. There is an online and offline Personal Identification Number (PIN) verification, or the use of signatures (which is used for magnetic-stripe cards). Usually, for low amount transactions, no additional CVM is used. Prior research showed that the payment terminal itself can be forced to fall back to old Cardholder Verification methods (CVM), such as downgrading a full EMV credit card to perform an EMV magnetic-stripe transaction [START_REF] Roland | Cloning Credit Cards: A Combined Pre-play and Downgrade Attack on EMV Contactless[END_REF]. If such an attack is possible, all of the new authentication methods are rendered useless.

Another critical issue concerning EMV is the EMV PIN verification "wedge" vulnerability. This vulnerability allows an attacker to use stolen cards without knowing the correct PIN. To do so, the attacker uses a man-in-the-middle attack, where the stolen card will accept any PIN entered, for both offline and online transactions [START_REF] Murdoch | Chip and PIN is Broken[END_REF].

Prior research presented a proof-of-concept for the so-called Pre-Replay attack [START_REF] Bond | Chip and Skim: Cloning EMV Cards with the Pre-play Attack[END_REF]. An attacker can use a tampered terminal to collect card details. Later on, the attacker can replay the data collected at a terminal of the same type that data were harvested on. The collected card details include the PIN and an Authorization Request Cryptogram (ARQC). These ARQCs are responses from the card, when presented with an Unpredictable Number (UN) by the PoS terminal. The flaw is that some PoS terminals generate predictable numbers instead of a random number. The protocol design flaw is that the terminal generates the number and the issuer relies on its random generation. Thus, for this attack to succeed, the attacker must compromise the terminal equipment and then harvest ARQCs, to be able to carry out indistinguishable transactions to the issuer.

Relay attacks on ISO/IEC 14443 Type A-based smartcards are introduced in [START_REF] Hancke | A Practical Relay Attack on ISO 14443 Proximity Cards[END_REF] and [START_REF] Francis | Markantonakis: Practical NFC Peer-to-peer Relay Attack Using Mobile Phones[END_REF]. The Radio Frequency (RF) communication was relayed up to a distance of 50 m. This work illustrates how the attacker can use commercially available tools. Moreover, it highlights the potential security implications for current contactless applications. Practical and generic relay attacks were implemented, only using two NFC-enabled mobile phones and software applications. It has been shown that many EMV-compliant systems still seem to be vulnerable [START_REF] Van Den | Relaying EMV Contactless Transactions using Off-The-Shelf Android Devices[END_REF][START_REF] Chothia | Relay Cost Bounding for Contactless EMV Payments[END_REF]. Previous work has also shown that an extension of the classic relay attack is possible [START_REF] Kfir | Picking Virtual Pockets using Relay Attacks on Contactless Smartcard[END_REF]. Such an extension could mean an increase of the distance between the reader device and the genuine card. The additional distance varies between 40 cm to 50 cm and the extra cost is less than 100 $. More precisely, a potential attacker could discreetly access a foreign card from about 50 cm far away. This is a fivefold increase in distance compared to the distance of a ISO 14443 contactless smart card transaction. Additionally, EMV transactions have a common structure. Thus, if a transaction is recorded and the static and redundant data, which is the same for every transaction, are omitted in the relayed communication, a relay attack transaction can be optimized.

Besides mobile payment, relay attacks in other scenarios, such as ticketing systems, have been successfully demonstrated as well as reported in [START_REF] Chu | Relay attacks of NFC smart cards[END_REF].

This paper shows that while the relay attack vulnerability is well known and has been reported in many papers and articles before, its still exploitable as of today with off-the-shelf hard and software.

Background and Architecture

The relay attack presented in this paper applies to ISO/IEC 14443 smart cards of operation mode type A. These smart cards are passive and the inductively coupled RFID transponders have a transceiving range of up to 10 cm. The reading device is called Proximity Coupling Device (PCD) and the card is referred to as Proximity Integrated Circuit Card (PICC). In a typical usage scenario, the PICC interacts directly with a PCD.

For a relay attack, further devices are necessary. In addition, as shown in Figure 1, two NFC devices (tablets) and at least one IEEE 802.11 wireless network (Wifi) are used. This enlarges the transceiving range up to the Wifi range to about 100 m. For larger ranges two Wifi devices connected to the Internet are required as shown in Figure 2. In both cases, one NFC device is in a proxy mode that will relay the NFC traffic from the PCD (PoS) via Wifi and back, the other NFC devices is in relay mode that will relay the NFC traffic from Wifi to the PICC (credit card) and back. The Wifi network establishes a tunnel for the traffic between the two NFC devices in proxy mode respectively in relay mode. An attacker needs to place one NFC device on the contactless payment terminal, while placing the other NFC device close to the victim's NFC credit-card.

In consequence, the physical presence of the PICC is no longer required. This work here assumes that the delay occurring is below 1.5 s and, therefore, the attack is possible [START_REF] Bond | Chip and Skim: Cloning EMV Cards with the Pre-play Attack[END_REF].

EMV Contactless Transaction

EMV Contactless [4] is the standard for contactless PICCs. The contact chips, for both contact and contactless PICCs, are usually based on the ISO/IEC 7816 standard and the "contactless integrated circuit" is designed according to ISO/IEC 14443.

Comparing ISO/IEC 7816 and ISO/IEC 14443 to the Open Systems Interconnection model (OSI model), in contact based systems, the ISO/IEC 7816-3 [START_REF]Identification cards -Integrated circuit cards, Part 3: Cards with contacts -Electrical interface and transmission protocols[END_REF] standard specifies layer 1 (Physical), 2 (Data link), and 4 (Transport). In contactless systems, these three layers are specified in ISO/IEC 14443-2 [START_REF]circuit cards -Proximity cards, Part 2: Radio frequency power and signal interface[END_REF], ISO/IEC 14443-3 [START_REF]Identification cards -Contactless integrated circuit cards -Proximity cards, Part 3: Initialization and anticollision[END_REF], and ISO/IEC 14443-4 [START_REF]Identification cards -Contactless integrated circuit cards -Proximity cards, Part 4: Transmission protocol[END_REF]. Even though the contact and contactless standards differ in various aspects (e.g. transport protocols, anti-collision, activation, bit transfer and power supply), the communication protocol as on OSI layer 7 (Application) is the same as specified in ISO/IEC 7816-4 [START_REF]Identification cards -Integrated circuit cards, Part 4: Organization, security and commands for interchange[END_REF] for contact based systems. Further, the transaction protocol supports the use of so-called Application Protocol Data Units (APDU). Before the APDU-based protocol can be started, PCD and PICC need to have the same configuration. First of all, the PCD polls for new PICCs by sending out a REQA. After that, PICCs that have not been activated yet, synchronously answer with their Answer-to-Request (ATQA). The PCD is now notified that a new PICC is available and, therefore, initiates the anti-collision procedure by starting a binary search tree algorithm and enumerating all PICCs based on their Unique Identifier (UID). If the anti-collision was successful, these PICCs send a Select Acknowledge (SAK), which indicates whether the card supports the standard data transmission of ISO/IEC 14443-4 or not. If supported, the PCD sends a request to answer the select (RATS) as a command and expects an answer to reset (ATS) as a response. The RATS contains parameters, such as the frame size the PCD can receive. In return, the ATS contains information about the chip's operating system. Now the PCD and PICC reached the same configuration. Hence, from there on the communication between PCD and PICC is always conducted in the form of APDU command-response pairs.

Visa Smart Debit/Credit (qVSDC) Protocol

Visa's payWave transactions are using the quick Visa Smart Debit/Credit (qVSDC) protocol as shown in Figure 3, which is slightly more compressed than the MasterCard PayPass protocol. The main difference between the two protocols is that Visa transactions omit using the GENERATE AC command. The functionality is brought together in the GET PROCESSING OPTIONS (GPO) (message #5 in Figure 3) request, because the card will respond to the GPO by calculating the Application Cryptogram (AC) and sign the data in the next response (message #6 in Figure 3). The different steps in a Visa contactless transaction can be divided into 8 steps [START_REF] Van Den | Relaying EMV Contactless Transactions using Off-The-Shelf Android Devices[END_REF]. The PCD then selects the AID with the highest priority which it is supporting.

4 th Message

Implementation

For this work here, the NFCProxy [START_REF]NFCProxy[END_REF] was selected to carry out the relay attack. The hardware requirements -as discussed above -are 2 NFC devices and one or more Wifi devices. Two commercially available off-the-shelf NFC-enabled mobile tablets were used. The NFCProxy requires a certain versions (9.1 and 10.1) of CyanogenMod [START_REF]CyanogenMod[END_REF]. The installation of those versions is mandatory, because the NFCProxy requires certain features for handling Host Card Emulation (HCE), which was removed in some Android versions. However, on never devices, these relay attacks work without installing a custom ROM [START_REF] Vila | Practical Experiences on NFC Relay Attacks with Android -Virtual Pickpocketing Revisited[END_REF]. To install CyanogenMod on a mobile device, the device needs to be rooted and unlocked. Furthermore, these HCE extensions require the NXP PN544 NFC Controller, which is used on many commercially available devices. To carry out the relay attack, the setup as shown in Figure 1 with a portable IEEE 802.11 b/g/n wireless router was used, which was powered on with a mobile power source.

Hardware/Software Specification

The following hardware and software was used to carry out the relay attack.

-

Relay Attack Proof-of-Concept

The relay attack implementation was tested as described in [START_REF] Van Den | NFC Hacking: The Easy Way, DEF CON 2012[END_REF] at two different public transport PoS terminals that were capable of handling contactless transactions. The attacker placed one Android device (proxy mode) on the PoS terminal and the other Android device (relay mode) next to an NFC credit card of the victim. Two relay attacks at two different terminals were video recorded and can be seen in a proof of concept (PoC) video as shown in Figure 4. Note that for this attack purely the feasibility of the attack was targeted at, as the only purpose was to show and indicate vulnerabilities. At no times at all the public transportation authority was faced with fraud or any misuse of services obtained.

Protocol Details

The Visa payWave logs that were recorded during the PoC implementation follow the protocol as described is Section 3. As a card authentication method, the offline CDA was used, following the Visa payWave Contactless EMV standards. In general, CDA verifies the card by generating an RSA signature on individual transaction data and additionally verifying using an AC generated by the card. For this reason, the message #5 as above also included an Unpredictable Number (UN). The card is expected to return a Signed Dynamic Application Data (SDAD) and an application cryptogram in message #6. SDAD is a dynamic signature generated by the card and validated by the reader during fast Dynamic Data Authentication (fDDA) processing. As the name implies, fDDA is faster than the standard DDA due to the fact that it utilizes a pre-defined list of data elements for authentication.

As indicated in Figure 3, messages #7 and #8 are repeated for every record in the AFL. Therefore, the PCD starts to read data records (message #7) from the PICC. The first response (message #8) contains an Issuer Public Key Certificate (IPK), which is certified by a Certification Authority (CA). Further, the response contains more data, such as the Certification authority public key index (to identify the CA public key) and also an Issuer Public Key Exponent, which is used for verification of the SDAD and the IPK. In return, the PCD requests another data record with the message #7. In the second response of the card (message #8), the PAN, the expiration date, the issuer code, and the ICC Public Key Certificate is returned. If everything was accepted by the POS terminal, the transaction was successful.

Although, a successful relay attack was carried out on public transport PoS terminals, no fraudulent transactions were issued. At any point in time, equipment and credit cards were used belonging to a single person. All purchased tickets over the NFC relay were paid in full by the authors.

Countermeasures

To carry out this relay attack as presented above, an attacker does not have to decrypt any of the data, thus, there is no formal breaking of keying material or credentials involved. Hence, providing sufficient protection against such relay attacks is difficult, because the attack cannot be prevented by applicationlevel cryptography [START_REF] Hancke | Confidence in Smart Token Proximity: Relay Attacks Revisited[END_REF]. Therefore, to supplement existing security mechanisms, additional countermeasures are required. These countermeasures have to focus according to today's knowledge on the essential and key aspects of the relay attack: (1) the added time delay and (2) any unnoticed access to the card [START_REF] Hancke | A Practical Relay Attack on ISO 14443 Proximity Cards[END_REF].

Countermeasures can be classified into two key categories: either (1) the card is protected or (2) the system itself is [START_REF] Kfir | Picking Virtual Pockets using Relay Attacks on Contactless Smartcard[END_REF]. The most simple, effective, and cost-efficient form to protect the card is to shield the chip (e.g., wrapping card in metal foil) and, thus, prevent almost certainly any unwanted remote activation. Additionally, the following selection of further possible countermeasure include (a) additional verifications, (b) time measurements, and (c) distance bounding.

Additional Verification

Relay attacks could be prevented by introducing secondary authentication procedures (e.g., password or biometrics). However, such additional verification countermeasures demand additional (typically unwanted -due to practicality reasons) user-interactions, which eliminates the convenience emerging from the use of the contactless smart cards. Another drawback that could arise is the resulting increase in transaction time, which might not be acceptable in every application anymore. Recent approaches in combining credit card and smartphone with NFC introducing an additional secure elemement could solve the problem e.g., by asking the user on the smartphone if a transaction should be carried out. Once a vendor is known with a previously approved transaction, further transcation with this vendor could be carried out again without any user interaction. Thus, making the relay attack much more difficult, without loosing the convenience and keeping the transaction times low.

Time Measurement

A valid and genuine contactless transaction has a certain time duration, depending on the specific PICC and PCD setup. Typically, relaying this communication results in a delayed transaction and, therefore, takes more time. Because these POS terminals would need to serve a variety [START_REF] Bond | Chip and Skim: Cloning EMV Cards with the Pre-play Attack[END_REF] of contactless cards, setting a time limit could easily lead to valid transactions being rejected (false positive).

Theoretically, if an accurate response time is recorded for every PICC and PCD combination, it would be possible to implement a maximum time duration for a transaction as presented in this work [START_REF] Weiß | Performing Relay Attacks on ISO 14443 Contactless Smart Cards using NFC Mobile Equipment[END_REF]. The implementation of such a time measurement challenge-response protocol makes a relay attacks more difficult, but wold not be able to prevent them in full [START_REF] Roland | Cloning Credit Cards: A Combined Pre-play and Downgrade Attack on EMV Contactless[END_REF].

In contrary, prior research also concluded that the time variance observed on dynamic messages between various cards was even larger than the overhead by the relay [START_REF] Chothia | Relay Cost Bounding for Contactless EMV Payments[END_REF]. Thus, simply using an overall time limit on static or dynamic data authentication (e.g., using the GENERATE AC message response in MasterCard PayPass or the GET PROCESSING OPTIONS message response in Visas PayWave) cannot be used as an efficient countermeasure against relay attacks due to different chips on cards, resulting in very different processing time.

The relay attacks in the PoC video [START_REF] Killer | NFCProxy Relay Attack in the Wild[END_REF] lasted between 671 ms and 2050 ms and those were accepted either way. Yet, the EMV Contactless standard allows for up to 500 ms of total time per transaction (e.g., for Visa [START_REF]EMV Contactless Specifications for Payment -Systems Book C-3 -Kernel 3 (Visa)[END_REF]). Prior research could also observe an equal behavior [START_REF] Chothia | Relay Cost Bounding for Contactless EMV Payments[END_REF]. Transactions would be accepted even though the transaction took longer than 500 ms. Therefore, when performing a relay attack, the genuine card could be anywhere in the world and timing constraints are not sufficient on their own to provide a suitable protection against relay attacks.

Distance Bounding

Distance bounding protocols define countermeasure against relay attacks. In essence, a cryptographic distance bounding protocols enables the PCD to compute a maximum distance between the PCD and the PICC. Distance bounding protocols assume that the PICC and the PCD share a secret and measure thereafter the time it takes to exchange a number of bits. Combining the time measurement at the level of nano seconds and the knowledge of the speed of light, the distance can be estimated within an accuracy of a few meters. However, it would still be possible to perform a relay attack with specialized hardware that is able to relay communication close to the speed of light. However, such specialized hardware is very expensive today, resulting in a poor risk/reward ratio [START_REF] Chothia | Relay Cost Bounding for Contactless EMV Payments[END_REF].

Distance bounding mechanisms have to be implemented into the physical communication layer, because all mechanisms above the physical layer, such as collision-avoidance, result in a fatal inaccuracy of the time measurement [START_REF] Hancke | An RFID Distance Bounding Protocol[END_REF][START_REF] Weiß | Performing Relay Attacks on ISO 14443 Contactless Smart Cards using NFC Mobile Equipment[END_REF]. This inaccuracy could be prevented using a dedicated and fast RF communication channel. Despite the aforementioned inaccuracy, distance bounding protocols are today and theoretically the best countermeasure against relay attacks.

A simplified distance bounding protocol has been proposed in [START_REF] Chothia | Relay Cost Bounding for Contactless EMV Payments[END_REF]. The proposed PaySafe protocol is EMV-compliant and, therefore, uses existing fields within EMV (e.g., Unpredictable Number and the ICC Dynamic Number). The main approach of PaySafe is to improve the protocol in such way, that time measurements can be used as an efficient countermeasure. For this reason, the protocol splits up the challenge and response command from the generation of the signed authentication and cryptogram. The PaySafe protocol also initiates the contactless transaction with the application selection. Now, before the PICC sends its PDOL (message #4 in Figure 3) to the reader, the PICC generates a nonce it temporarily stores. Then the PCD sends a timed GET PROCESSING OPTIONS request to the PICC (message #5 in Figure 3). The PICC immediately responses with the nonce generated in the previous step. This response does not need any computation and, therefore, the variance in the time it takes is very low. If the message was relayed, an additional overhead would be introduced and the PCD can easily detect such a deviation. The suggested upper bound for the respective time out is at 80 ms. Thus, the PaySafe protocol would stop relay attacks using mobile phones or off-the-shelf USB NFC readers.

Summary and Conclusions

This paper discussed security issues concerning the EMV protocol. Furthermore, the approach undertaken takes a deeper look at a practical path to relay attacks. As the approach was focused on public transportation PoS machines, it serves as an example only, which did not fraud any public or private body throughout the experiments. Thus, the PoC shows a successful relay attack over an IEEE 802.11 Wireless network, using two commercially available tablets, publicly available Software, and a Visa payWave credit-card.

Even though the EMV specification defines 500 ms as the maximum duration for a transaction, the transactions in those experiments have taken up to 2060 ms and were accepted! Similar behavior has been observed in prior research [START_REF] Chothia | Relay Cost Bounding for Contactless EMV Payments[END_REF].

Possible countermeasures against relay attacks include additional verification mechanisms, which could prevent the attack by adding security, but giving away convenience emerging from the usage of contactless cards. Time measurement cannot be efficiently deployed due to the variance in dynamic messages and the possibility to cache static messages. Distance bounding requires stable performance and predictable time accuracy of those communication channels in use and in compliance with ISO/IEC 14443 systems. The PaySafe protocol is a simplified distance bounding protocol that is EMV-compliant.

Even though relay attacks have been a quite prominent research topic, the EMV-compliant payment systems in place today are still partially vulnerable. While effective countermeasures are theoretically available, they are not deployed everywhere yet. Since other cards use EMV as well, these cards are vulnerable too [START_REF] Chothia | Relay Cost Bounding for Contactless EMV Payments[END_REF]. The ease to intercept and relay a full transaction shows that these systems need to be hardened against relay attacks, as currently the only effective defense strategy is to shield the chip as show in Figure 5.

In general, there are further attack scenarios possible, e.g., an attacker with his NFC device in relay mode, can stay at a PoS equipped with a contactless reader. A second attacker with his NFC device in proxy mode and an additional antenna can stay in a crowded place and try to activate foreign cards and relay the APDUs back and forth (cf. setup 2 in Figure 2). However, such an attack does not scale well and the pay-off is not as high compared to the card-not-present fraudulent activities.

Explicit Note: This work performed did proof as its key and only objective the feasibility of this type of reply attack on public Point-of-Sales (PoS) terminals. Since this and only purpose was driven by research motivations on IT system security this work only shows, demonstrates as a proof-of-concept, and indicates technical vulnerabilities. At no times at all the publicly accessible PoS was faced or threatened with any fraud or any misuse of services obtained.

Figure 1 .Figure 2 .

 12 Figure 1. Setup 1: Simple Relay Attack Setup

Figure 3 .

 3 Figure 3. EMV Contactless Transaction Sequence Diagram.

  Tablets; brand/model: ASUS Nexus 7v1, CyanogenMod 10.1 operating system -Wireless Router; brand/model: Alfa Network Hornet-UB, chip set: Atheros AR9331 SoC, 2.4 GHz, 802.11 b/g/n -Credit-Card; brand: VISA, model: Visa Card Classic, payWave limit: 40 CHF -NFCProxy [10], version 0.1.2

Figure 4 .

 4 Figure 4. Proof-of-Concept [21]

Figure 5 .

 5 Figure 5. NFC/RFID Card Protection

  The PICC responds if the application was selected successfully. The response also contains the File Control Information (FCI) template with application details, such as the Processing Options Data Object List (PDOL) with all those fields (e.g. Amount, Terminal Country Code, Terminal verification Results, Transaction Date/Type and the Unpredictable Number) needed by the PCD for the next step. GET PROCESSING OPTIONS Following the application selection, the PCD requests processing options. In essence, the PCD responds with the PDOL related data encoded according to the PICC's previous PDOL received in the 4 th message.6 th Message PICC → PCD: The card responds with the Application Interchange Profile (AIP) and Application File Locator (AFL). The AFL is used by the terminal to read the data records from the PICC. These records contain a variety of information, such as the Primary Account Number (PAN), the expiry date, and more (except for the Card Verification Value (CCV)). The AFL also indicates, if any of the data will be provided for the Authentication Process. As a result, the card is in control, which files can be read. 7 th Message PCD → PICC: Command: READ RECORDThe PCD requests the records according to the AFL and the PICC follows these requests with the according responses. Which data is being read exactly depends on how the issuer configure the card.

PICC → PCD: 5 th Message PCD → PICC: Command: 8 th Message PICC → PCD: The PICC returns the records requested.

Acknowledgments: This work was partially supported by the FLAMINGO project funded under the EU FP7 Program (Contract No. FP7-2012-ICT-318488).


Erwin Alexander Leal

Juan Felipe Botero

S3N -Smart Solution for Substation Networks, an architecture for the management of communication networks in power substations

Keywords: SDN, network, architecture, substation, power, communication, IEC 61850, virtualization

Today, the communications network has become an essential element to the operation of any type of organization or infrastructure, such is the case of the electrical power substations. Such networks in particular, demand high levels of availability and reliability, as the substation is a key element in the chain of energy generation and distribution. However, although recent network modernization introduced new features that allow to optimize the operation of the substation, the variety of devices that integrate it (Intelligent Electronic Devices -IED: breakers, switches, Protection and Control, Merging Units -MU, Network Switches, IEEE 1588 Master Clock) and the huge set of applicationlevel protocols (SMV -Sample Measure Value, GOOSE -Generic Object Oriented Substation Event, MMS -Manufacturing Message Specification, PTP -Precision Time Protocols, among others), increase the management complexity. In this context, the Applied Telecommunications Research Group (GITA), has decided to propose the development of S3N -Smart Solution for Substation Networks. S3N is defined as a network architecture that introduces the novel Software Defined Networks (SDN) and virtualization technologies, in order to simplify the management of communication networks in power substations.

Introduction

Smart Grid is a concept that aims to provide mechanisms for the generation and consumption of energy in a more efficient and intelligent manner. This concept proposes the appropriation of data networks advantages to the grid operation in the area of control, communications and monitoring [START_REF] Farhangi | The path of the smart grid[END_REF]. To reach this purpose, the modernization of the infrastructure that supports the generation, transmission, distribution and consumption of power has caused the emergence, within the communication network, of a variety of IP compliant devices that are interconnected through a network based in Ethernet technology [START_REF] Khan | A comprehensive review of the application characteristics and traffic requirements of a smart grid communications network[END_REF]. Currently, the automation process substation is oriented by the IEC 61850 standard [START_REF]Communication networks and systems for power utility automation[END_REF], which covers almost all aspects of substation automation system (SAS), providing communication specifications for operations monitoring, control and protection real time. However, this process of modernization has caused that the communication network management, in power substations, has become complex due to the large number of elements that comprise it (Intelligent Electronic Devices -IED: such as Breakers, switches, Protection and Control; Merging Units -MU, Network Switches, IEEE 1588 Master Clock), where each device is responsible for executing functions, with different requirements of connectivity, delay, bandwidth provisioning, synchronization and security [START_REF] Huang | Innovative testing and measurement solutions for smart grid[END_REF]. Nevertheless, in recent years, the field of data networks has been permeated by two major trends aiming to facilitate the administration of complex networks: SDN and virtualization technologies, which make the network management more flexible and enable the rapid development and deployment of network services. SDN allow to provide programmability to the network infrastructure, considerably facilitating their management, while virtualization technologies allow, through software, to create a virtual version of a technological resource as an operating system, a storage device, a hardware component or a network resource, where and when it is needed [START_REF] Kreutz | Software-Defined Networking: A Comprehensive Survey[END_REF] [6] [START_REF] Mijumbi | Network Function Virtualization: State-of-the-art and Research Challenges[END_REF].

In this area, we propose an experimental architecture for communications networks in substations, based in SDN and virtualization technologies, which is functional, secure, scalable and easy to manage by the energy operator.

This paper is structured as follows: Section 2 presents the research problem and Section 3 describes the methodology approach. Foreseen impacts are presented in Section 4, and the expected contribution and the conclusion are presented in Section 5.

Research Problem

Although solutions reached through SDN and virtualization technologies are positively transforming the way large datacenters, corporate networks and campuses have begun to operate their networks; it is also seen how gradually these concepts can positively impact the performance and management of the increasing complexity of communications networks in electrical substations [START_REF] Cahn | Software-defined energy communication networks: From substation automation to future smart grids[END_REF] [9] [START_REF] Lopes | SMARTFlow: Uma Proposta para a Autoconfiguração de Redes de Subestação IEC 61850 Baseada em OpenFlow[END_REF]. However, as proposed in [START_REF] Bobba | Software-Defined Networking Addresses Control System Requirements[END_REF], communication networks involved in the operation of electric grid, must meet requirements that are not the same as a corporate network. For example, a substation may contain hundreds of IEDs generating and consuming critical information in real time with different requirements of connectivity, delay, bandwidth provisioning, synchronization, and security, according to its purpose or scope; not to mention, IEDs require proper maintenance and configuration. According to the above, it can be said that the efficient, reliable and safe operation of power substation data networks, which is a critical infrastructure whose operation can significantly impact a highly energy-dependent society, is limited by the constraints introduced by high number of devices on the network (the order of hundreds, only mentioning IEDs), complex network configuration (each IED can count with 4 network interfaces to guarantee redundancy and his configuration is manual), and traffic management complexity (GOOSE is a multicast protocol that does not tolerate delays greater than 3 ms).

In this context, considering that [START_REF] Cahn | Software-defined energy communication networks: From substation automation to future smart grids[END_REF] [9] [START_REF] Lopes | SMARTFlow: Uma Proposta para a Autoconfiguração de Redes de Subestação IEC 61850 Baseada em OpenFlow[END_REF] have only presented provisional solutions to the problem exposed through testbeds where: (i) performance evaluation was always emulated [START_REF] Cahn | Software-defined energy communication networks: From substation automation to future smart grids[END_REF] [9] [10], (ii) network traffic was emulated and only limited to GOOSE and SV messages [START_REF] Molina | Using Software Defined Networking to manage and control IEC 61850-based systems[END_REF][10], (iii) SDN controllers based in Python were used in [START_REF] Cahn | Software-defined energy communication networks: From substation automation to future smart grids[END_REF][10] (Python is a interpreted language with low performance compared to other languages), and (iv) no research proposes a complete architecture for management of substation networks, or introduces technologies virtualization as a facilitator in this type of environment, they only present as the application of SDN concepts can improve performance of different tasks on this type of networks. We consider that it is necessary to implement a complete testbed to improve the mentioned limitations, where the experimentation on real network topologies, with traffic conditions matching the wide variety of environment specific protocols (GOOSE, SV, MMS, PTP, FTP, RTSP, etc.). Besides, the use of robust (production capable) SDN controllers is required. In addition, a special interest in identifying the advantages and disadvantages that SDN can bring to communications networks into Smart Grid is growing [START_REF] Bobba | Software-Defined Networking Addresses Control System Requirements[END_REF] [12] [13] [14] [START_REF] Kim | Trends and Potentials of the Smart Grid Infrastructure: From ICT Sub-System to SDN-Enabled Smart Grid Architecture[END_REF]. Therefore, we have decided to propose the development of: S3N -Smart Solution for Substation Networks. A proposal with the aim of defining an architecture for the management of communication networks in power substations, with a high degree of self-configuration, availability, scalability and security; which will use the concepts proposed by SDN and virtualization technologies, for its conception.

Research Objective and Methodology Approach

The objective of this research is to propose an architecture for the management of network communications in power substations using the concepts proposed by SDN and virtualization technologies. In this sense, we propose the development of a methodology composed by the following steps:

1. To establish what operation requirements are more restrictive for communications networks in power substations, operating under the IEC 61850 [START_REF]Communication networks and systems for power utility automation[END_REF]. 2. To review the operating characteristics offered by SDN and virtualization technologies in order to define attributes applicable to the field of communication networks in power substations, meeting the restrictions defined under the IEC 61850 standard [START_REF]Communication networks and systems for power utility automation[END_REF]. The study, of open standards and state of art review of partial solutions in this field, is proposed. 3. To propose models describing the features of the physical/logical elements that integrate the architecture, as well as their schemes of interaction, for the corresponding description of the architecture. For the development of this stage, it is suggested to follow the recommendations specified in the ISO / IEC / IEEE 42010 standard, System and software engineering -Architecture description [START_REF]Systems and software engineering, Architecture description[END_REF]. This standard provides a foundational ontology to describe system architectures or software architectures. The recommendations of this international standard present a common terminology and a conceptual base that facilitates the specification of requirements, as well as the definition, communication and review of architectures by using ADLs (Architecture description languages) . 4. To validate the functionality of the proposed network architecture by implementing use cases in a real testbed. To verify that the architecture meets the operational requirements defined by the IEC 61850 standard, compliance testing will be executed according to the guidelines of IEC 61850-10: 2005 Communication networks and systems in substations -Part 10: conformance testing. Likewise, use cases will be implemented in the following categories: Disaster Recovery, QoS Management and Security.

Foreseen Impact

The first impact of the project will be the formulation of an architecture for the management of network communications in power substations by using the concepts around SDN and virtualization technologies. This will provide the opportunity to obtain a communication network with a high degree of self-configuration, availability, scalability and security, which could be replicated in other scenarios of the smart grid. Another important impact, on the level of technological development and innovation, will be the design and implementation of a proof of concept for the management of communications network in power substations, based on SDN. The possibility of implementing this technology offers enormous potential for development and commercialization, since it contributes to reduced operating and capital costs associated with management in this specific field.

Conclusions

The concept of automated substation, which led to the transition from traditional wired connections to an Ethernet-based network with IP support devices, introduced new features in the network, but there are still challenges to be overcome before its proper implementation in current systems.

With the development of this project, we expect to answer research questions such as: (i) can the proposed architecture deliver solutions that improve the management of the communications network in substations, ensuring existing levels of reliability and availability?, (ii) is it possible, using virtualization technologies, to transfer functions that now reside on different hardware equipments (IED's -Intelligent Electronic Device) to a virtualized environment with the aim of optimizing the operation resources (physical space, maintenance, computing capacity)? (iii) can the experimental architecture proposed, contribute to the advancement of Smart Grid concept, in line with the standards and requirements set by the sector?

Acknowledgments. This research has partly been supported by the University of Antioquia, the CODI project 2014-856 and the Colciencias project COL15-2-09.