Enabling Digital Twins – a Comparative Study on Messaging Protocols and Serialization Formats for Digital Twins in Iov
Total Page:16
File Type:pdf, Size:1020Kb
Linköping University | Department of Computer and Information Science Master’s thesis, 30 ECTS | Datateknik 2019 | LIU-IDA/LITH-EX-A--19/066--SE Enabling Digital Twins – A comparative study on messaging protocols and serialization formats for Digital Twins in IoV Att möjliggöra digitala tvillingar Daniel Persson Proos Supervisor : Patrick Lambrix Examiner : Niklas Carlsson Linköpings universitet SE–581 83 Linköping +46 13 28 10 00 , www.liu.se Upphovsrätt Detta dokument hålls tillgängligt på Internet - eller dess framtida ersättare - under 25 år från publicer- ingsdatum under förutsättning att inga extraordinära omständigheter uppstår. Tillgång till dokumentet innebär tillstånd för var och en att läsa, ladda ner, skriva ut enstaka ko- pior för enskilt bruk och att använda det oförändrat för ickekommersiell forskning och för undervis- ning. Överföring av upphovsrätten vid en senare tidpunkt kan inte upphäva detta tillstånd. All annan användning av dokumentet kräver upphovsmannens medgivande. För att garantera äktheten, säker- heten och tillgängligheten finns lösningar av teknisk och administrativ art. Upphovsmannens ideella rätt innefattar rätt att bli nämnd som upphovsman i den omfattning som god sed kräver vid användning av dokumentet på ovan beskrivna sätt samt skydd mot att dokumentet ändras eller presenteras i sådan form eller i sådant sammanhang som är kränkande för upphovsman- nens litterära eller konstnärliga anseende eller egenart. För ytterligare information om Linköping University Electronic Press se förlagets hemsida http://www.ep.liu.se/. Copyright The publishers will keep this document online on the Internet - or its possible replacement - for a period of 25 years starting from the date of publication barring exceptional circumstances. The online availability of the document implies permanent permission for anyone to read, to down- load, or to print out single copies for his/hers own use and to use it unchanged for non-commercial research and educational purpose. Subsequent transfers of copyright cannot revoke this permission. All other uses of the document are conditional upon the consent of the copyright owner. The publisher has taken technical and administrative measures to assure authenticity, security and accessibility. According to intellectual property law the author has the right to be mentioned when his/her work is accessed as described above and to be protected against infringement. For additional information about the Linköping University Electronic Press and its procedures for publication and for assurance of document integrity, please refer to its www home page: http://www.ep.liu.se/. © Daniel Persson Proos Abstract In this thesis, the trade-offs between latency and transmitted data volume in vehicle- to-cloud communication for different choices of application layer messaging protocols and binary serialization formats are studied. This is done with the purpose of getting enough performance improvement to enable delay-sensitive Intelligent Transport System (ITS) fea- tures, and to reduce data usage in mobile networks. The studied protocols are Constrained Application Protocol (CoAP), Advanced Message Queuing Protocol (AMQP) and Message Queuing Telemetry Transport (MQTT), and the serialization formats studied are Protobuf and Flatbuffers. The results show that CoAP – the only User Datagram Protocol (UDP) based protocol – has the lowest latency and overhead while not being able to guarantee reliable transfer. The best performer that can guarantee reliable transfer is MQTT. For the serialization formats, Protobuf is shown to have three times smaller serialized message size than Flatbuffers and also faster serialization speed. Flatbuffers is the winner in the case of memory use and deserialization time, which could make up for the poor performance in other aspects of data processing in the cloud. Further, the implications of these results in ITS communication are discussed suggestions made into future research topics. Acknowledgments First, I want to thank Scania CV AB for letting me do my Master’s thesis at their company. I would also like to thank my company supervisors Håkan Carlqvist and Farshad Naghibi. Further, I would like to thank Lasse Öberg and all other helpful people at Scania. I also want to thank my examiner Niklas Carlsson for his never-ending support during this thesis. Further, I want to thank my friends and all the people that made my university studies such a great time. Lastly, I want to thank my girlfriend Johanna and my mother Cecilia for all their love and support through the years. iv Contents Abstract iii Acknowledgments iv Contents v List of Figures vii List of Tables viii 1 Introduction 1 1.1 Motivation . 1 1.2 Aim............................................ 2 1.3 Purpose . 2 1.4 Research Questions . 2 1.5 Delimitations . 3 1.6 Contributions . 3 2 Background 4 2.1 Internet of Vehicles . 4 2.2 LTE Networks . 4 2.3 Messaging Protocols . 6 2.4 Data Serialization . 8 2.5 Related Work . 9 3 Evaluation Platform Implementation 11 3.1 Pre-study . 11 3.2 Benchmarking . 13 3.3 Limitations . 16 4 Performance Results: Serialization Formats 18 5 Performance Results: Protocol Comparison 21 5.1 Large Chunks Case . 21 5.2 Small Chunks Case . 24 5.3 Cross-Case Observations . 25 5.4 Impact of Message Sizes and Throughput . 27 6 Discussion 30 6.1 Results . 30 6.2 Method . 32 6.3 The Work in a Wider Context . 34 7 Conclusion 35 v 7.1 Protocols . 35 7.2 Serialization Formats . 36 7.3 Future Work . 36 Bibliography 38 vi List of Figures 2.1 Structure of the EPS. 5 2.2 Illustration of the Internet Protocol suite. 6 3.1 Histogram showing the distribution of JSON message sizes. 13 3.2 Path taken by packets in the protocol experiments. 15 3.3 Upload bandwidth trace used for the protocol tests. 16 4.1 Serialization and deserialization speeds and serialized message sizes, averaged over all messages and over 1000 runs per message. 18 4.2 Histograms showing the distributions of serialized message sizes. 19 4.3 Histograms showing the distributions of serialization memory usage, averaged over 1000 serializations for each message. 19 4.4 Histograms showing the distributions of deserialization memory usage, averaged over 1000 serializations for each message. 20 5.1 Histogram showing sizes of the 100 chosen Protobuf messages. 21 5.2 Latencies per message for large chunks, averaged over all messages. 22 5.3 Message overhead for large chunks, averaged over all messages. 22 5.4 Percentage of unsuccessful message transfers for large chunks. 23 5.5 Latencies for small chunks, averaged over all messages. 24 5.6 Message overhead for small chunks, averaged over all messages. 25 5.7 Percentage of unsuccessful message transfers for small chunks. 25 5.8 Average latencies for different message sizes. 27 5.9 Average latencies when keeping the loss rate at 0% and scaling the bitrate of the used throughput traces for large chunks. ......................... 28 5.10 Average latencies using the best possible network conditions with small chunks. 29 vii List of Tables 3.1 Software placement for the networking experimental setup. 14 viii 1 Introduction 1.1 Motivation Scania CV AB (henceforth Scania) is moving from a manufacturer of trucks and busses to- wards being a provider of complete solutions in the transport industry. One thing that makes this possible is connected vehicles, which Scania has today. To use these in the best possi- ble manner, one goal is to extract as much data as possible from vehicles in use. This data can then be used to extract valuable information and to enable further services based on that data. Today, data is extracted at a course time granularity, often with significant time elapsing between each collection instance. This is something that Scania wants to change. The transport industry is headed into a connected future called the Internet of Vehicles (IoV) [1]. There have been technological developments in the last decade that allow this. This has opened up completely new opportunities to enable functionalities for vehicles that have previously been impossible. Connecting to the cloud creates possibilities in uploading data from a vehicle that can then be analyzed using computers which are much more powerful than what is economically feasible to put inside a vehicle. This, in turn, will lead to improve- ments in the quality of experience for the customers through new product functionalities. As the technology evolves, more functionalities that rely on the computing power enabled by cloud computing will emerge. These new functionalities will put higher demand on the net- work connection between the vehicle and computing resources in terms of both bandwidth and latency. One enabler of such functionalities is Digital Twins [2]. A Digital Twin is a model of a physical entity, in this case a vehicle, which is stored in the cloud. This approach enables the model to be regularly updated, while historical values are stored for data analysis purposes to provide solutions that in the end will benefit the customer. Amazon Web Services (AWS), which Scania uses, provides a service called AWS IoT Device Shadow to enable this [3]. Certain uses for Digital Twins are more time sensitive than others and therefore have stricter demands on, e.g., latency[4]. Others are more focused on reliable data transfer than latency. In this thesis, both latency and reliability in the connection between the vehicle and the cloud are investigated. Latency will be used as the term for the time it takes to deliver a network packet from the sender to the recipient. In other words, it is half a round-trip time (RTT). Looking at the connection between the vehicle and the cloud, there are several things that could be done to improve the overhead in terms of memory use and the latency added 1 1.2. Aim because of it. One thing that can be optimized for different use-cases is the choice of the application layer networking protocol that is used for messaging in this type of connection [5].