Network Information

Whenever you join a company's, campus's, or employer's wireless network, does it ever feel like it is missing something? For instance, when you go to a cafe and join their wireless, there is a disconnect between the companies offerings (coffee) and the service you just received (wireless connectivity). Earlier in the semester I thought of a system that would bridge this disconnect. The system would provide information about the network which was recently joined. The information could be anything, but should be tailored to the company providing the wireless. An example of this could be the cafe providing information of products, sales, contact information, or privacy information regarding the internet.

To accomplish this, there would be some server running (could be the router providing internet/wireless) that would store the information to be provided. The information could be stored in anyway, but for me I chose to use XML as there are many parsers available. Here is an example of such an XML file describing the network, and some upcoming events.

   <name>University of New Orleans</name>  
      <title>Party at the library</title>  
      <description>Free food</description>  
      <title>Campus Meeting</title>  
      <description>Talk with the governor</description>  
      <eventLocation>Administration building</eventLocation>  

This XML file describes a campus network that may wish to provide students and other network users of upcoming events, but the idea is clear that other types of information may be presented as described above.

For one of my classes, I decided to craft this idea into an Android project. The fun part about this is that I would use service discovery to automatically discover the server on the network providing the information. This is in contrast to perhaps a static network address or some DHCP information similar to DNS information.

I chose to use zeroconf technology for the service discovery as there was an easy to use java version of mDNS (a portion of zeroconf) that I used for DAAP that works nicely in this situation (well not so nicely, but it works). The idea is that the network server that is providing the information, also registers a service of a network-info service type and clients that join the network request services of the network-info service type that was registered. The server responds and provides the information, which the client displays.

I created an Avahi XML file describing the service so that it would be automatically broadcast on boot. Avahi is an open source implementation of zeroconf and provides utilities such as this to advertise services.

<?xml version="1.0" standalone='no'?>  <!DOCTYPE service-group SYSTEM "avahi-service.dtd">  <service-group>    <name>UNO</name>    <service>     <type>_netfo._tcp</type>     <port>9090</port>    </service>  </service-group>  So now that the service is advertised and the information being provided is set up, we just need clients to connect.

Here are the screenshots of the implementation I wrote for my mobile computing class.

Screen presented after a server is discovered and information provided.
Screen presented when an even was clicked, providing more information.
 This is great. Imagine all the possibilities of having information from your network. If there are any great ideas that could take advantage of this, feel free to comment with them! One idea that I came up with after beginning the project is an emergency channel. Take the university campus example for instance. Imagine that campus police spotted an armed individual and wanted to alert everyone in as many ways as possible. They can send mass emergency texts, emails, etc. Using the clients connected and listening to network information could be alerted also. I wrote this quickly for the android application as well.

Clients receive a notification upon emergency information becoming available.

Information presented when the emergency is clicked.
Ok, so maybe budget cuts aren't as scary as armed individuals, but they are scary!


Mudit Agarwal said...


have you open sourced your code.. or is there any way you can point towards gud zeroconf implementations on android.


Chris Miceli said...

@Mudit Agarwal
I have not open sourced this project as there are a lot of hard coded things that should be dynamic. Also, I believe that the idea is simple enough to recreate and probably better to start from scratch with a new implementation. To answer your question about a good zeroconf implementation on android...well there really isn't one. On another project I did that does successfully use zeroconf, I used a modified version of JmDNS. The library is not perfect and under some circumstances just doesn't work. The biggest problem you will find when working with zeroconf on android is that some devices work much better than others, and others not at all. Also, using the android emulator confuses issues even more! I wish you luck with your android programming, but I am warning you now that the zeroconf code will be a pain.