Skip to content

ASAPHops

Thomas Schwotzer edited this page Aug 15, 2021 · 10 revisions

Main purpose of a routing protocol (OSI layer 3) is the allow data exchange between to entities which do not have a direct connection. A direct connection can be a cable made of e.g. copper, glass fiber. A direct connection can also be a wireless network like Bluetooth and Wifi-direct.

Public land mobile networks (PLMN) like LTE, 5G etc. are more complex systems. A mobile phone communicates with a base station. That is direct connection. Messages are routed through telecommunication providers network to receivers’ base station. We can assume that most networks are IP based. Using a PLMN is not different from using a Internet via a Wifi Router.

There is no chance to figure out what ways an IP package actual took. Why would we even like to know?

ASAP is different. It is an opportunistic protocol and takes any (point-to-point to be exact) connection available to disseminate messages. It also takes Internet of course. ASAP apps would work without Internet access without any changes anywhere in your code. ASAP apps are quite resilient.

ASAP provides your application with the trace of each single message. Why? We do not know. But if your app is interested – this library provides the means. If not, ignore it.

complete message journey

Let's have again a look into our ASAPMessageReceivedListener.

void asapMessagesReceived(ASAPMessages messages, String senderE2E, List<ASAPHop> asapHops) throws IOException;

This method is called each time a new new chunk of messages are received from another peer. We already discussed ASAPMessages but not the other two parameters.

Second parameter provides peer ID of message originator. This peer created this message in the first place. The third parameter is a list of all steps (hops) from this orignal sender to this receiving peer. Each step is described in some details with an object of ASAPHop

That is the output of a test case, see MessageExchangeTests. All information are taken from those three parameters.

DAVID_ID:
++++++++++++++++++++++++++++++++++++++++++ chunkReceived +++++++++++++++++++++++++++++++++++++++++++
E2E|P2P: BOB_ID | ALICE_ID | uri: sn2://all | era: 0 | appFormat: shark/messenger
hop#0: sender: BOB_ID | verified: false | encrypted: false | connectionType: Internet
hop#1: sender: ALICE_ID | verified: false | encrypted: false | connectionType: Internet
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

A peer with id (DAVID_ID) received a message. Originator was BOB_ID. It came during an encounter with ALICE_ID. This message took two hops: It was sent from Bob to Alice over an encounter via Internet. This point-to-point connection was neither encrypted nor signed. The seconds hop brought it to David. This encounter had the same quality: Internet, no security at all.

We have no information about E2E security of course. That is part of your application. Assumed you have not provided E2E security, this message was vulnerable. This message was sent in clear text over an Internet connection. It would be quite easy for interested parties to read it.

It would be a bit different if you used E2E encryption. It would be very difficult to read message content but anybody could see who is communicating with whom. That would be different if point-to-point encryption would be activated. This option leaves eavesdroppers with a bunch of unreadable bytes which are exchanged between two devices.

ASAP also works on Ad-hoc networks. Assumed, this message was sent over Bluetooth. In that case, eavesdropping would be nearly impossible. You application could be close to sure that nobody beside Alice, Bob and David became even wind of the fact that any communication happened. E2E encryption would ensure that only Alice and David know the actual content.

That log entry would tell a totally different story:

DAVID_ID:
++++++++++++++++++++++++++++++++++++++++++ chunkReceived +++++++++++++++++++++++++++++++++++++++++++
E2E|P2P: BOB_ID | ALICE_ID | uri: sn2://all | era: 0 | appFormat: shark/messenger
hop#0: sender: BOB_ID | verified: true | encrypted: true | connectionType: Bluetooth
hop#1: sender: ALICE_ID | verified: true | encrypted: true | connectionType: Onion
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

ASAP offers means to set information systems which are as open and free as well known server and Internet based messenger apps. ASAP allows also to set up systems which can hide even the fact that this system exists at all to anybody but its users. Have a look at our ASAPHub project and learn how ASAP P2P systems can use Internet without using a vulnerable server.