Browse Source

Refactoring of the technology decision chapter

Carsten Porth 5 years ago
parent
commit
6cdae25be8

+ 7 - 0
thesis/abbreviations.tex

@@ -25,11 +25,18 @@
 	\acro{IPFS}{InterPlanetary File System}
 	\acro{JSON}{JavaScript Object Notation}
 	\acro{JSON-LD}{JavaScript Object Notation for Linked Data}
+	\acro{NAT}{Traversal Using Relays around NAT}
 	\acro{NFC}{Near Field Communication}
 	\acro{OSN}{Online Social Network}
 	\acro{P2P}{Peer-to-Peer}
 	\acro{PWA}{Progressive Web App}
 	\acro{SDK}{Software Development Kit}
+	\acro{STUN}{Session Traversal Utilities for NAT}
+	\acro{TCP}{Transmission Control Protocol}
+	\acro{TURN}{Traversal Using Relays around NAT}
 	\acro{TTL}{Time to Live}
 	\acro{W3C}{World Wide Web Consortium}
+	\acro{WebRTC}{Web Real-Time Communication}
+	\acro{XML}{Extensible Markup Language}
+	\acro{XMPP}{Extensible Messaging and Presence Protocol}
 \end{acronym}

+ 33 - 0
thesis/bib/bibliography.bib

@@ -421,4 +421,37 @@
   note         = {Online, accessed 29.01.2019},
 }
 
+@Misc{hive2hiveXXXXguide,
+  author       = {Nico Rutishauser},
+  title        = {{Hive2Hive - Guide for System Admins}},
+  howpublished = {\url{https://github.com/Hive2Hive/Android/wiki/Guide-for-System-Admins}},
+  month        = mar,
+  year         = {2015},
+  note         = {Online, accessed 21.03.2019},
+}
+
+@Misc{hive2hiveXXXXrepo,
+  author       = {Christian Lüthold},
+  title        = {{Hive2Hive repository on GitHub - README}},
+  howpublished = {\url{https://github.com/Hive2Hive/Hive2Hive}},
+  month        = mar,
+  year         = {2015},
+  note         = {Online, accessed 21.03.2019},
+}
+
+@Misc{yjsXXXXrepo,
+  author       = {Jahns, Kevin and Koren, István and Noronha, Michael and Karbo, Lars and Drgon, Lukas},
+  title        = {{Yjs repository on GitHub - README}},
+  howpublished = {\url{https://github.com/y-js/yjs}},
+  month        = feb,
+  year         = {2019},
+  note         = {Online, accessed 21.03.2019},
+}
+
+@Misc{wifiXXXXdistance,
+  title        = {{How far does a Wi-Fi Direct connection travel?}},
+  howpublished = {\url{https://www.wi-fi.org/knowledge-center/faq/how-far-does-a-wi-fi-direct-connection-travel}},
+  note         = {Online, accessed 21.03.2019},
+}
+
 @Comment{jabref-meta: databaseType:bibtex;}

+ 29 - 28
thesis/content/05-proof-of-concept/technology-decisions.tex

@@ -1,48 +1,49 @@
-In order to implement the concept in the best possible way, some technology decisions had to be made. These included the implementation of the data exchange on a peer-to-peer basis and the choice of a framework for the development of the app. In the following, different technologies and libraries are presented that were considered for the implementation.
-
-\subsection{Peer 2 Peer Network}
-\label{sec:p2p-network-technology}
-Basically, there are two conceivable approaches for the P2P network:
+In order to meet the requirements of the concept best, a detailed consideration of the technology to be used is necessary. These decisions include the application framework itself and libraries and protocols for data exchange in a \ac{P2P} network. Basically, there are two conceivable approaches for the \ac{P2P} network:
 
 \begin{itemize}
-	\item Creation of a separate P2P network between the hybrid clients
-	\item Use of an existing P2P network for own purpose
+	\item The creation and buildup of a separate \ac{P2P} network connecting the hybrid clients
+	\item The use of an existing \ac{P2P} network for own purpose
 \end{itemize}
 
-In the following, solutions for both ways are presented and compared with each other.
-
-\subsubsection{Creation of a P2P Network}
+\subsection{Creation of a \ac{P2P} Network}
 \label{sec:create-p2p-network}
-The advantage of having an extra P2P network is that it is completely under control. Accordingly, it can be designed to fit exactly to the use case and require little or no compromise. However, setting up a P2P network is a big challenge and some hurdles must be overcome. These challenges include peer discovery (how peers find each other), global data exchange over the Internet and data storage, and availability of the stored data. And of course, all these requirements must scale. It should work for P2P networks with only a few peers and also for a few thousand or even more peers. Two approaches are conceivable here: the use of an established standard such as Wi-Fi Dircet or WebRTC or the use of a library (for example Hive2Hive, Y-Js) to create a dedicated P2P network.
+The advantage of having an extra \ac{P2P} network is that it is completely under control. Accordingly, it can be designed to fit exactly to the use case and require little or no compromise. However, setting up a \ac{P2P} network is a big challenge and some hurdles must be overcome. These challenges include peer discovery (how peers find each other), global data exchange over the Internet and data storage, and availability of the stored data. And of course, all these requirements must scale. It should work for \ac{P2P} networks with only a few peers and also for a few thousand or even more peers. Two approaches are conceivable here: the use of an established standard such as Wi-Fi Dircet and \ac{WebRTC} or the use of a library (e.g., Hive2Hive, Yjs) to create a dedicated \ac{P2P} network.
 
-\subsubsection*{Wi-Fi Direct}
-Wi-Fi Direct is a standard (IEEE 802.11) for data transmission between two WLAN terminals. There is no need for an access point between the two devices. However, the distance that may lie between the two peers is thus limited. Without obstacles, which contribute to the attenuation of the signal, a distance of up to 95m is possible. In buildings, it sinks to 32m or less. However, the requirement for the P2P network to expand Twitter is different. Users can be scattered around the world and may be online through the mobile network. There is no P2P connection via Wi-Fi Dircet in this case.
+\subsubsection{Wi-Fi Direct}
+\label{sec:wifi-direct}
+Wi-Fi Direct is a standard (IEEE 802.11) for data transmission between two WLAN terminals. There is no need for an access point between the two devices. However, the distance that may lie between the two peers is thus limited. Without obstacles, which contribute to the attenuation of the signal, a distance of up to 200\,m is possible \cite{wifiXXXXdistance}. However, the requirement for the \ac{P2P} network to expand Twitter is different. Users can be scattered around the world and may be online through the mobile network. There is no \ac{P2P} connection via Wi-Fi Dircet in this case.
 
-\subsubsection*{WebRTC}
-WebRTC (Web Real-Time Communication) is an open standard that provides various communication protocols for real-time communication between two or more peers. Above all, WebRTC is popular for its ability to easily perform video calls, as known from Skype, in the browser without a server. But also the file transfer between peers is possible. In a separate P2P network, data could be exchanged between the clients. However, the connection between the clients is complex, since in addition to the two peers also a STUN server and optionally a TURN server is involved. Furthermore, it is unclear whether the system scales. At least for Google Chrome browser is known that a maximum of 265 connections to other peers can be maintained in parallel.
+\subsubsection{\ac{WebRTC}}
+\label{sec:webrtc}
+\ac{WebRTC} is an open standard\footnote{https://www.w3.org/TR/webrtc/} that provides various communication protocols for real-time communication between two or more peers. Above all, \ac{WebRTC} is popular for its ability to easily perform video calls, as known from Skype, in the browser without a server. But also the file transfer between peers is possible. In a separate \ac{P2P} network, data could be exchanged between the clients. However, the connection between the clients is complex, since in addition to the two peers also a \ac{STUN} server and optionally a \ac{TURN} server is involved. Furthermore, it is unclear whether the system scales.
 
-\subsubsection*{Y-JS}
-The JavaScript library Y-JS describes itself as \enquote{a framework for offline-first P2P shared editing on structured data-like text, richtext, json, or XML.} The library takes care of solving synchronization conflicts when editing distributed files. By choosing a connector, you can set the protocol for the communication between the peers.There is the possibility to use WebRTC, XMPP or Websockets, but with some connectors running a server is a prerequisite. Further extensions can be used to supplement a database and data types, but the focus here is on the joint editing of data by multiple peers. For all connectors, the authors of the library recommend using an own server.
+\subsubsection{Yjs}
+\label{sec:yjs}
+The JavaScript library Yjs\footnote{https://github.com/y-js/yjs} describes itself as \enquote{a framework for offline-first \ac{P2P} shared editing on structured data-like text, richtext, \ac{JSON}, or \ac{XML}}\cite{yjsXXXXrepo}. The library takes care of solving synchronization conflicts when editing distributed files. By choosing a connector, you can set the protocol for the communication between the peers.There is the possibility to use \ac{WebRTC}, \ac{XMPP} or websockets, but with some connectors running a server is a prerequisite. Further extensions can be used to supplement a database and data types, but the focus here is on the joint editing of data by multiple peers. For all connectors, the authors of the library recommend using an own server. Yjs is released under the MIT license.
 
-\subsubsection*{Hive2Hive}
-Hive2Hive is a Java library for \enquote{secure, distributed, P2P-based file synchronization and sharing}. There is no less promise than \enquote{a free and open-sourced, distributed and scalable solution that focuses on maximum security and privacy of both users and data}. In order to be able to use Hive2Hive globally via the Internet, it is necessary to operate at least one relay peer - five are recommended\footnote{https://github.com/Hive2Hive/Android/wiki/Guide-for-System-Admins}. Since a permanent TCP connection between peer and relay peer is maintained, the power consumption is quite high. Constant TCP connection can be avoided by using Google Cloud Messaging (GCM). However, Google has already discontinued this service. And since the development of Hive2Hive was discontinued in March 2015 too, there is currently no solution to this problem.
+\subsubsection{Hive2Hive}
+\label{sec:hive2hive}
+Hive2Hive\footnote{https://github.com/Hive2Hive/Hive2Hive} is a Java library for \enquote{secure, distributed, \ac{P2P}-based file synchronization and sharing}\cite{hive2hiveXXXXrepo}. There is no less promise than \enquote{a free and open-sourced, distributed and scalable solution that focuses on maximum security and privacy of both users and data}\cite{hive2hiveXXXXrepo}. In order to be able to use Hive2Hive globally via the Internet, it is necessary to operate at least one relay peer - five are recommended for sufficient data replication \cite{hive2hiveXXXXguide}. Since a permanent \ac{TCP} connection between peer and relay peer is maintained, the power consumption is quite high. Constant \ac{TCP} connection can be avoided by using Google Cloud Messaging. However, Google has already discontinued this service. And since the development of Hive2Hive was discontinued in March 2015 too, there is currently no solution to this problem. Hive2Hive is released under the MIT license.
 
-\subsubsection*{GUN}
-GUN is a graph database that keeps a state in sync across multiple instances. GUN is written in JavaScript and unlike Hive2Hive and Y-JS, the project is still being worked on.
+\subsubsection{GUN}
+\label{sec:gun}
+In 2014, Mark Nadal began developing a decentralized database called GUN. GUN\footnote{https://gun.eco} is written in JavaScript and will be further developed by the community as an open source\footnote{https://github.com/amark/gun} project. It is licensed under the Apache License 2.0, so free use is allowed. The \ac{P2P} database exists only within a browser and synchronizes itself with other peers over the Internet. It has offline support, so changes are automatically synchronized and merged as soon as a connection is established. The data is stored in a graph structure in the local storage of the browser. For connecting peers among each other, at least one relay server is required.
 
-\textit{todo...}
+\subsubsection{OrbitDB}
+\label{sec:orbitdb}
+The open source project OrbitDB\footnote{https://github.com/orbitdb/orbit-db} is a serverless, distributed, \ac{P2P} database on top of \ac{IPFS}. The data are stored in \ac{IPFS} and \ac{IPFS} Pubsub is used to sync the database automatically with other peers. Various types of databases are provided like log, feed, key-value, and counter. There is a JavaScript library for usage in browsers and NodeJS which is currently in alpha stage. OrbitDB is released under the MIT license and therefore free to use in private and commercial projects.
 
-\subsubsection{Using an Existing P2P Network}
+\subsection{Using an Existing P2P Network}
 \label{sec:using-existing-p2p-network}
-As mentioned in the previous section, setting up your own P2P network involves a number of challenges. If you use an already existing P2P network for your own purpose, these challenges can be elegantly avoided. For this purpose, however, a suitable P2P network must be found whose properties and possible uses meet the requirements of the hybrid OSN client.
+As mentioned in the previous section, setting up your own \ac{P2P} network involves a number of challenges. If you use an already existing \ac{P2P} network for your own purpose, these challenges can be elegantly avoided. For this purpose, however, a suitable \ac{P2P} network must be found whose properties and possible uses meet the requirements of the hybrid \ac{OSN} client.
 
-In the following, various P2P networks are considered and examined for their usability for a potential deployment to extend an OSN.
+In the following, various \ac{P2P} networks are considered and examined for their usability for a potential deployment to extend an \ac{OSN}.
 
-\subsubsection*{Filesharing P2P Networks}
+\subsubsection*{Filesharing \ac{P2P} Networks}
 
 \subsubsection*{Blockchain}
 
-\subsubsection*{IPFS}
+\subsubsection*{\ac{IPFS}}
 
 \subsubsection{Conclusion}
 
@@ -52,6 +53,6 @@ With the Android \ac{SDK} apps for Android can be written in Java, Kotlin, and C
 
 The open source framework Ionic\footnote{https://ionicframework.com/} is used to create hybrid apps and \acp{PWA}. A hybrid app combines the advantages of a native app with those of web applications. With \ac{HTML}, \ac{CSS}, and JavaScript, this framework can be used to design platform-independent applications (including Android and iOS). The core of Ionic is based on the JavaScript Framework Angular and Apache Cordova, which serves as a bridge to access sensors and functions of the device. Ionic can be used free of charge and is published under the MIT license, so private and commercial use is permitted.
 
-Compared to the standard way of programming an Android app to the use of Ionic, the platform independence and the JavaScript language are the two main advantages. With Ionic, the same code can be used to create apps for the majority of mobile operating systems. Additionally, as \ac{PWA} the app runs also in every modern web browser. The previously defined requirements of a hybrid solution demanded this independence, so Ionic is a good match. Regarding the programming language JavaScript, many projects in the field of \acp{dApp} and decentralization in general provide only libraries for JavaScript (e.g., Gun). Besides, JavaScript is also the language to write add-ons for browsers. Even though Ionic cannot be used to create browser add-ons, the used JavaScript libraries can. So, the same technology could be used to deliver clients to all popular environments.
+Compared to the standard way of programming an Android app to the use of Ionic, the platform independence and the JavaScript language are the two main advantages. With Ionic, the same code can be used to create apps for the majority of mobile operating systems. Additionally, as \ac{PWA} the app runs also in every modern web browser. The previously defined requirements of a hybrid solution demanded this independence, so Ionic is a good match. Regarding the programming language JavaScript, many projects in the field of \acp{dApp} and decentralization in general provide only libraries for JavaScript (e.g., GUN). Besides, JavaScript is also the language to write add-ons for browsers. Even though Ionic cannot be used to create browser add-ons, the used JavaScript libraries can. So, the same technology could be used to deliver clients to all popular environments.
 
 With React Native\footnote{https://facebook.github.io/react-native/} and NativeScript\footnote{https://www.nativescript.org/} there are comparable frameworks to Ionic. They also use JavaScript and are used to create hybrid apps for several environments. But the provided components to create the user interface are most promising with Ionic and the initial learning barrier is low compared to the other two. Because of these advantages, Ionic was finally chosen for programming the Hybrid \ac{OSN} client app.