• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Fluid Nexus for the Android Platform
 

Fluid Nexus for the Android Platform

on

  • 4,228 views

 

Statistics

Views

Total Views
4,228
Views on SlideShare
4,228
Embed Views
0

Actions

Likes
0
Downloads
6
Comments
1

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Please remove this document. I am the author of it and you have no right to claim 'All Rights Reserved'. You also provide no links to the original source of the document which was at http://fluidnexus.net.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Fluid Nexus for the Android Platform Fluid Nexus for the Android Platform Document Transcript

    • Fluid Nexus for the Android Platform Nick Knouf April , Project Idea Fluid Nexus is an application for mobile phones that is primarily designed to enable activists or relief workers to send messages and data amongst themselves independent of a centralized cellular network. e idea is to provide a means of communication between people when the centralized network has been shut down, either by the government during a time of unrest, or by nature due to a massive disaster. During such times the use of the centralized network for voice or SMS is not possible. Yet, if we can use the fact that people still must move about the world, then we can use ideas from sneaker-nets to turn people into carriers of data. Given enough people, we can create fluid, temporary, ad-hoc networks that pass messages one person at a time, spreading out as a contagion and eventually reaching members of the group. is enables surreptitious communication via daily activity and relies on a fluid view of reality. Additionally, Fluid Nexus can be used as a hyperlocal message board, loosely attached to physical locations. Project Links Website: http://fluidnexus.net Project video: http://vimeo.com/899706 Application: http://fluidnexus.net/code/FluidNexusAndroid.apk Source code (licensed under the GPL): http://fluidnexus.net/code/FluidNexusAndroid-0. 01.tar.gz Subversion repository: https://svn.zeitkunst.org/viewvc/FluidNexusAndroid
    • Application Background and Usage Fluid Nexus is an on-going project that explores mobile phone networking without the mobile phone network—that is, ad-hoc local networks without the need for prior repre- sentation (See Figure ). e application I have submitted for the Android Developer Challenge is related to concurrent work on a version of Fluid Nexus for Nokia Series phones running Python. Fluid Nexus works by using Bluetooth to connect to nearby devices and automatically share messages (or other data). is means that messages can still be passed even when there is no external network connectivity. It uses the fact that people still must move about the world, even if there are repressive regimes or natural disasters. People become carriers of data, and their phone becomes a data carrying device. Since the phone can be hidden, data transmission between people can still occur without any outward activity, thus allowing communication to occur surreptitiously. e Fluid Nexus application is divided into three components: a series of UI activities, a server Service, and a client Service (there is an associated Bluetooth simulation service that was written to get around emulator deficiencies; see the next section). e server waits for connections from nearby phones, advertising the “FluidNexus” service, as well as advertising hashes of messages that are already on the phone (see the section “Message Passing Protocol Details” for information on the message passing protocol). e client actively searches for other phones or devices running Fluid Nexus and tries to send messages that are in the phone’s “outgoing” box using the message passing protocol. All messages are saved on the phone itself in an SQLite database; nothing travels over the network. No identifying information is kept in the database excepting a hash of the message sender’s phone’s IMEI number to enable future passing of messages based on pre-determined groups. is structure ensures that identifying information cannot fall into the wrong hands, as long as this information is also kept out of the contents of the messages themselves. e application comes with the Bluetooth simulator enabled, so upon starting the application you will see simulated Bluetooth events occurring: some will be new messages, some will refer to “searches” and “discovery” of other Bluetooth devices. e default messages illustrate some of the expected usages of Fluid Nexus. You can play around with adding messages, sorting by application type, deleting messages, looking at Notifications, and reading more about the project concept and related work. e application has been designed for the m -rc version of the emulator. It has been tested to work in all display modes, although I developed it specifically for the x portrait resolution, with a few changes for the x portrait resolution.
    • Fluid Nexus How it works. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent eros ante, viverra vel, pulvinar ac, malesuada vitae, neque. Suspendisse quam tellus, venenatis eget, tincidunt vitae, rhoncus vitae, sapien. Vestibulum vitae nisi vel nisi consequat dictum. Sed non justo. Etiam tempor bibendum odio. Phasellus sit amet nibh. Fusce metus. Mauris volutpat mollis est. Praesent accumsan. Proin magna The person first downloads Fluid Nexus to their mobile phone. 1 La primera persona baja Fluid- Nexus a su móvil. 2 Next, the user types a message in the interface. Enseguida, en usuario escribe un BI mensaje en la interfaz. P!! ! phone !! BIP! 4 3 The message is saved in a The message is broadcast via database on their phone. Bluetooth to nearby phones running Fluid Nexus. El mensaje es guardado en una BIP El mensaje es emitido para otras base de datos dentro del móvil. !!! BIP!!! personas utilizando FluidNexus en las cercanías a través de !! BIP! Bluetooth BIP!!! 5 As the message is passed from one phone to another, it is passed BI P! from one person to another—a !! viral spreading. En la medida que el mensaje pasa BI de un móvil a otro, la información P! !! pasado de una a otra persona- una distribución viral. BI !!! P BIP !!! El mensaje se puede transmitir The message can be passed for durante el máximo de tiempo, BI hasta posiblemente sacar 6 ... inf as long as possible, potentially P! getting sensitive information información importante de una !! out of a dangerous situation. situación de peligro. Figure – Fluid Nexus conceptual design
    • Figure – Fluid Nexus opening screen, showing all messages Android-Specific information Writing an application like Fluid Nexus for Android is somewhat difficult given the current state of the emulator. Since the emulator does not natively support Bluetooth, I had two options for simulation, both of which are detailed in the video and below. simulated bluetooth For the submitted application, I simulate Bluetooth by firing Bluetooth device discovery intents, which are then picked up by my client and server processes. ese mirror as much as possible those that exist in the current SDK (following Gabor Paller’s discoveries¹). When there were no existing Intents to be found, I created my own. ese intents up- http://mylifewithandroid.blogspot.com/2008/01/hacking-into-androids-bluetooth-support. html
    • Figure – Fluid Nexus menu options date Notifications that let the user know what is going on. For received messages by the FluidNexusServer Service, a Notification is created that lets the user know that a new message has arrived; the Intent updates the message view. For the FluidNexusClient Ser- vice, Notifications let the user know that the Service is actively looking for external devices that are running Fluid Nexus. In an actual phone, with a working Bluetooth stack, these Notifications would not be shown. socket-based bluetooth In order to show how Fluid Nexus on Android can work with the previous version that runs on Nokia Series phones, I developed a bridge that connects the emulator to the Bluetooth adapter on your local machine (using ideas first put forth by Tom Gibara²). is bridge, for both the client and the server Services, communicates a subset of Bluetooth information http://www.tomgibara.com/android/camera-source
    • Figure – Entering a new message that will show up in the outgoing box over a TCP socket, enabling the emulator to send and receive messages from the phone, and vice versa. e project video (http://vimeo.com/899706) makes this process clear. In order to run the bridge, you need to do the following: . Install the lightblue library for Python: http://lightblue.sourceforge.net/ . Start the emulator . Type adb forward tcp:7010 tcp:7010 to setup the necessary port forwarding . From within the source code archive, go to the assets directory . Start the Server and Client bridges: python bridgeServer.py and python bridge- Client.py . Start Fluid Nexus in the emulator. Go to “Settings” and make sure that “Simulate Bluetooth” is unchecked. Restart the emulator if necessary.
    • Figure – Viewing the details of a message You will now be able to connect between the emulator and your host’s Bluetooth adapter. Of course, this still requires a phone that is running Fluid Nexus for Series ; you can get installation instructions for that version online³. Future work • Integrate with Android Bluetooth API once it is stabilized and functional within the emulator • Integrate message hash advertisements with the stabilized Bluetooth API • Work with the WiFi API to perform similar message passing activities http://fluidnexus.net/#install
    • • Develop means, and easy-to-use UI, to enable the creation of groups that limit who can or cannot receive a message • Consider issues of security. While this system is completely open, it can work because of the cat-and-mouse game we are playing. Further refinements to the system and protocol will have to occur as situations change on the ground. • Consider geo-location of messaging events. is may have the downside, however, of highlighting activity in a manner we might not want. • Code clean-up and documentation Detailed project information What would happen if the cell phone became a repository for data, transmitting its store to other cell phones as they came into local proximity? Cell phones are (in most cases) associ- ated directly with people, but do not necessarily represent them, an important consideration given problems with representation in networks. Nevertheless, cell phones travel with people and can be considered a proxy for the short-term, ad hoc, unconscious links between people as they travel about their day. ese are links of a strange sort, because they do not necessarily represent any connections between people that are often attributed to edges in social networks. Rather, they simply represent local proximity, dying away as soon as I have passed someone else on the street. Additionally, cell phones provide ever increasing amounts of storage space, and many come with a form of ad-hoc networking already: Bluetooth. We could consider the possibility of using short-term Bluetooth connections to share forbidden data amongst cell phones within the Bluetooth range, hoping that blanketing all phones within an area, coupled with geographic dispersion of people, might enable the transmission of data over distances not otherwise possible. us the person using the cell phone becomes part of a “sneaker-net”, carrying data that is highly sensitive but possibly without knowledge of its contents. e "links" between the current "node" and other nodes are serendipitous, making any determination of a network structure impossible and unnecessary: the network is, for many purposes, simply a random one that would be different for each particular data transmission. is form of network is therefore constructed partially as a response to concerns about representation in networks. First, it does not try to represent people, yet it uses what people are good at: geographic travel and random interconnections. Second, the network is used for a political and activist end, enabling those who would otherwise be marginalized the ability to subvert the dominant power. ird, the network structure is entirely undetermined,
    • with any definition of structure being undetermined. is differs from other work such as TxTMob⁴ that used lists for wide dissemination of data on cell phones; the networks were thus pre-determined. is is a type of hybrid network that uses the power of people to make short-term links but without explicitly trying to represent them within a model. e network can be used by people often ignored or eliminated by the networks that are in power, suggesting a way in which technology can have an emancipatory role. Conceptual Motivation problems with the network view of reality I would like to approach the problems with the network view of reality from a science and technology studies (STS) lens. From this perspective I want to ask: what happens when we try to model behavior through the domain of nodes and edges? What happens to humans when we try and force them into a model or prior representation? I want to suggest that the view that we can model behavior assumes that there is one true representation of the world, if only we can find it. Other types of perspectives, like those of STS, would suggest otherwise: that there are actually many different ways to represent the world. My work as a technologist with an STS view, then, is to show how we might be able to create technological artefacts that might not reduce the world to an imperfect mathematical equation. Yet STS has not been immune to the network phenomenon. Indeed, there is a method- ological approach known as “actor-network theory” (Latour ; Law ; Latour ) which attempts to look at how different types of human (and importantly, non-human) agents work to construct a scientific or technological artefact. However, the choice to view things as a network implies then a certain ontological stance towards the world: you begin to think that everything can be reduced to nodes and edges. is is perhaps the reason why Watts ( ) is so excited about the possibilities of network models of the world: one type of mathematical formalism can be applied across a number of domains, thereby potentially unifying disparate fields. ere are severe critiques of the network view, however, and these have to do with political and representational concerns. By political, I do not necessarily mean the explicit politics of elections, government, and so on; rather, I mean how you choose to view people and the groups that they may or may not belong to. e main question with the network view, then, is who gets left out? Who makes the choice of membership in the network? is is exactly the concern of some STS scholars with actor-network theory (Star ; Winner ) and it is my concern with network models of social behavior. ese decisions about representation then become not only political http://txtmob.com
    • but ethical as well: as a designer of a network model, who do I choose to represent in the network? What about marginal people who do not fit into my “mold”? What types of power am I reifying by choosing a particular network structure? once you have a network, everything begins to look like a node… ese questions about power, ethics, and politics of viewing the social world as a network have been raised by a number of contemporary social theorists. In fact, a recent conference entitled “New Network eory” had a number of panels and discussions of the ways in which the dominant views of networks enforce certain types of understandings of social behavior⁵. In fact, one of the participants of the conference, Bernhard Rieder, has discussed⁶ the ways in which the software we use to map out networks influences how we then view these networks: “ e point I’m trying to make is the following: the way we map networks is in large part channeled by the software we use and these tools are therefore not mere accessories to research but indeed epistemological agents that participate in the production of knowledge and participate in shaping research results.” us these political and ethical questions are actually technical ones as well. What we decide to represent in a technical form determines what types of worlds we can have. For example, if I decide to store only sex and not age, my system can never know how old my users are. Similarly, if I assume that people are always linked symmetrically with people and have a stable number of links, then my representation of the world will embody these facts, setting up a particular political situation where things remain static and bidirectional, even if Joe might see the connection with Sue more strongly and is always trying to re-frame his social circle. e analyst might decide to make these decisions based on questions of tractability: adding in the messiness of the social world makes the calculations too difficult. But since I am not a modeller, nor a developer of algorithms, and am in fact specifically interested in this messiness, I view things from a different perspective, one that tries to not wipe away what cannot be fit within an equation and rather attempts to use this messiness for a particular goal. us the model is only one representation of reality, one that, perhaps unexpectedly, embodies a particular politics. My approach embodies a politics as well, one that tries to see where models fail the individual and where particular people are not able to fit into the model and are thus forgotten. http://www.networkcultures.org/networktheory/index.php?onderdeelID=12&paginaID= 75&itemID=197 http://thepoliticsofsystems.net/2007/10/11/the-epistemology-of-research-tools-in-network-exploration/
    • networks without stable links: an activist approach My previous discussion should show the ways in which a movement away from a desire for complete representation of people in a social network might be beneficial. If this is the case, then what comes of the study of social networks? Perhaps instead of trying to model behavior within networks, explicitly formulating rules and functions that rational “actors” (i.e., individual humans) follow, we can instead use that behavior as a means to an end, taking advantage of what already exists without having to approximate and therefore misrepresent a single person. One motivating example conveys how extremely ad-hoc networks of people, where the edges exist for the most fleeting of moments, could be used for the propagation of political and activist information in war zones or other dangerous physical locations. burma: fall 2007 e protests that began in Burma last fall, first with Buddhist monks and then later with members of the general population, were the largest the country had seen since . Given the near-total control the military junta has on the infrastructure of the country, it was amazing that anyone was able to get information out and to external media outlets. Indeed, even things like cell phone service were cut⁷, leaving only landline connections. What might be the possibility, then, of using technology to spread information in tightly-controlled situations such as this? Could we use the movement of people as a proxy for the movement of data? is is one of the motivating use cases for Fluid Nexus. Message Passing Protocol Details using stigmergy in the design of the forwarding protocol Mass-forwarding of messages, while the most obvious way to approach the problem of shar- ing data within a local area, is not necessarily the best given the limitations of our underlying network protocol. To understand this, we need to understand how we communicate over Bluetooth connections. Communication is a three step process: . Device Discovery: a device scans the local neighborhood, finding other devices that are advertising their presence over Bluetooth http://www.concernedjournalists.org/niemanwatchdog-filing-reports-burma-between-gunshots and http://www.commsday.com/node/192
    • . Service discovery: once a particular device is found, this step queries the device for available services . Message transmission: once the relevant service has been found, the device transmits data or a message via the provided service. is is also the step where we would query whether or not a particular message should be sent. Individual steps in this process can take to seconds or more. Given that Bluetooth devices, at least when carried by humans, are likely to be highly mobile, any time we can eliminate from these steps increases the chance we will be successful in transmitting our message. If we could even eliminate parts of one of the steps we would be in better shape. To figure out which part of the chain we can cut out, I have to make a slight detour into ideas from swarm intelligence which has interesting parallels with the current problem. It has long been an interest of researchers to better understand how groups of agents, each with simple abilities, can self-organize into a very complicated systems. In biological systems these types of behaviors often rely quite strongly on the leaving of perceptible markers of recent behavior. For example, ants will leave pheromones on the trail of food; as more ants follow one particular path, there will be more pheromones left, and thus later ants will follow the stronger scent. is is an example of active stigmergy. In general, stigmergy is where “individual behavior modifies the environment, which in turn modifies the behavior of other individuals” (Bonabeau, Dorigo, and eraulaz , p. ). On the other hand, passive stigmergy is when agents modify parts of the environment in line with their normal behavior, but this modification sends signals to other agents to change their behavior. An example of this is the building of structures in certain shapes that cause other agents to choose one path over another. ere has been much work on the “optimal” design of broadcast or epidemic forwarding protocols in mesh or ad-hoc networks. Many of the refinements to these transmission protocols relied on knowing some prior information about community affiliation (Hui and Crowcroft b), “concentration” of files (Hui, Leguay, Crowcroft, Scott, Friedmani, and Conan ), or hierarchical rankings of communities (Hui and Crowcroft a). Each approach requires the imposition of some underlying structure on the network that, in our case, may not be there. Additionally, and perhaps more worryingly, is the fact that any lookup of data requires that we go through all three steps of the process described earlier: in order to get information about “concentration” of files, or to determine whether or not we should send a file, requires that we find the device (step one), find the right service (step two), and successfully transmit and receive data about server holdings (step three) before we can even transmit our desired message.
    • Yet if we use ideas from stigmergy, we can eliminate the third step entirely. To see how, we have to go into depth how we advertise services using Bluetooth. Listings and show how we use Bluetooth service advertising as a means of stigmergy. is is the second step of the three-step data transmission chain described previously. e lists of services were made from commands entered at a Python prompt⁸. Each entry in the list is a tuple of three elements: Bluetooth address, service port, and service name. We can see in Listing the Fluid Nexus service is active at port number . is is the service and port that clients would connect to in order to send data to the server. More interesting, for our purposes of exploring stigmergy, is the service at port number . is service does not have any methods that listen for connections; rather, the service is there to advertise the hash⁹ of a recent message that was accepted by the server¹⁰. Instead of having to query the “Fluid Nexus” service at port number in order to determine whether or not to transfer a particular message, a client can merely query for the list of services, comparing the discovered hashes with local ones and streamlining the data transmission process. Listing – List of services before acceptance of new item >>> findservices(psont) [('00:02:EE:6B:86:09', None, u'SDP Server'), ('00:02:EE:6B:86:09', 1, u'Hands-Free Audio Gateway'), ('00:02:EE:6B:86:09', 10, u'OBEX File Transfer'), ('00:02:EE:6B:86:09', 11, u'SyncMLClient'), ('00:02:EE:6B:86:09', 12, u'Nokia OBEX PC Suite Services'), ('00:02:EE:6B:86:09', 9, u'OBEX Object Push'), ('00:02:EE:6B:86:09', 2, u'Dial-Up Networking'), ('00:02:EE:6B:86:09', 3, u'AppleAgent'), ('00:02:EE:6B:86:09', 4, u'Fluid Nexus'), ('00:02:EE:6B:86:09', 5, u':f51ffdfc71bc943e9ac1d6515b3e7c31')] is is a form of active stigmergy, where the server explicitly leaves traces of previous interactions for other clients (mobile phones) that might interact with the server. Because of the multi-step process of the Bluetooth protocol, and the fact that devices are going to be in constant motion, using this active leaving of traces of previous interactions at the second step of the process cuts down on unnecessary traffic and hopefully will lead to more data All Bluetooth code, on the phone and for testing on the laptop, used the open-source lightblue (http://lightblue.sourceforge.net/) library e hash is the md sum of the title and data of a message; this gives a unique fingerprint of any message we transmit or receive. e hash has an additional “:” given as a prefix in order to enable quick programmatic differenti- ation of this service from the other advertised services.
    • transmissions occurring. Using stigmergy we have eliminated the third step entirely when deciding whether or not to transmit a message. Listing shows another example of stigmergy, after we have successfully transmitting a different message to the same server. We see that two hashes are now advertised. If a new client communicated with this server, the client would know not to send messages with those hashes, if the client were in possession of them. Listing – List of services after acceptance of new item >>> findservices(psont) [('00:02:EE:6B:86:09', None, u'SDP Server'), ('00:02:EE:6B:86:09', 1, u'Hands-Free Audio Gateway'), ('00:02:EE:6B:86:09', 10, u'OBEX File Transfer'), ('00:02:EE:6B:86:09', 11, u'SyncMLClient'), ('00:02:EE:6B:86:09', 12, u'Nokia OBEX PC Suite Services'), ('00:02:EE:6B:86:09', 9, u'OBEX Object Push'), ('00:02:EE:6B:86:09', 2, u'Dial-Up Networking'), ('00:02:EE:6B:86:09', 3, u'AppleAgent'), ('00:02:EE:6B:86:09', 4, u'Fluid Nexus'), ('00:02:EE:6B:86:09', 5, u':063ab2111a1c5499ab4fc128bcdb490e'), ('00:02:EE:6B:86:09', 6, u':f51ffdfc71bc943e9ac1d6515b3e7c31')] We can now describe the networking protocol in detail for both the server and the client. server protocol . On startup, advertise hashes of messages on the phone . Loop: a) Accept connections from clients b) Add new data to the database and to the list in the UI c) Add the hash of the new data to the database and advertise the hash As far as I can tell from the Bluetooth Specification (SIG ), there is no limit as to the number of services that any one device can advertise. Whether advertising services that do not accept connections is a violation of the protocol or not is something I still need to determine. But this re-appropriation of service advertisement should significantly cut down on the amount of time to transmit a large number of messages.
    • REFERENCES client protocol . Loop: a) Search for available devices b) For each available device i. Get list of services available on device ii. Use discovered hashes as a blacklist of hashes to not send iii. Until device is not in range anymore A. Send messages marked as “outgoing” B. Send send other messages e client protocol actively uses the provided stigmergy of the server to create a “blacklist” of messages hashes to not send, thereby improving on epidemic forwarding algorithms, as well as cutting down the amount of time that would be needed to find out this information in standard ways. References Bonabeau, Eric, Marco Dorigo, and Guy eraulaz ( ). Swarm Intelligence: From Natural to Artificial Systems. New York, NY, USA: Oxford University Press. Hui, Pan and Jon Crowcroft ( a). Bubble Rap: Forwarding in small world DTNs in ever decreasing circles. Tech. rep. UCAM-CL-TR- . University of Cambridge. Hui, Pan and Jon Crowcroft ( b). “How Small Labels Create Big Improvements”. In: Proeedings of the Fifth Annual IEEE International Conference on Pervasive Computing and Communications Workshops, . PerCom Workshops ’ . Pp. – . Hui, Pan, J. Leguay, J. Crowcroft, J. Scott, T. Friedmani, and V. Conan ( ). “Osmosis in Pocket Switched Networks”. In: pp. – . Latour, Bruno ( ). Science in Action: How to follow scientists and engineers through society. Cambridge, MA, USA: Harvard University Press. — ( ). Reassembling the Social: An Introduction to Actor-Network- eory. Clarendon Lectures in Management Studies. New York, NY, USA: Oxford University Press. Law, John ( ). After Method: Mess in social science research. New York, NY, USA: Routledge. SIG, Bluetooth ( ). Specification of the Bluetooth System. Bluetooth SIG. Star, Susan Leigh ( ). “Power technologies, and the phenomenology of conventions: on being allergic to onions”. In: A Sociology of Monsters: Essays on Power, Technology, and Domination. Ed. by John Law. London, UK: Routledge. Pp. – .
    • REFERENCES Watts, Duncan J. ( ). “ e “New” Science of Networks”. In: Annual Review of Sociology . . Pp. – . DOI: 10.1146/annurev.soc.30.020404.104342. URL: http://arjournals.annualreviews.org/doi/abs/10.1146/annurev.soc. 30.020404.104342. Winner, Langdon ( ). “Upon Opening the Black Box and Finding It Empty: Social Constructivism and the Philosophy of Technology”. In: Science, Technology, & Human Values . . Pp. – .