Thursday, July 18, 2013

Update #2

My apologies for the late update. I had to change the track of the project after discussing with my mentor (nextgens) and toad_
Presently, as a starting step, we plan to send signed beacons over the local area network and when the mobile picks it and verifies signature, it raises an intent asking the user to confirm whether it is talking to correct node. If user confirms, the phone pulls the nodereference through fproxy.
I have implemented the same by modifying the official MDNSDiscovery plugin to broadcast fproxy through DSA signed packets. One major modification is, instead of just broadcasting on one network interface, I loop through all network interfaces and broadcast on each one of their netwiorks. This is for people connected to multiple networks (the user maybe connected by bluetooth or wifi to the mobile while connected to internet via Ethernet Adapter).

Though this doesn't solve the problem completely (i.e. the user may connect via a different interface lateron while during our initial scan we found that the particular interface is down), it solves partially atleast for testing purposes.We might have to poll frequently to check if any network interface came alive and start broadcasting on its network
Also, I've used a java properties file to store the private key and public key in Base64 for future signatures. Not sure whether it is the right way (no crypt?)

I made the basic application on mobile phone which looks for multicast beacons and verifies the signature. Though it is in a very nascent stage with a crappy UI, it works. If the signature is verified, it pops an intent with a message asking the user to confirm. Once, the user confirms, it notes the name,ip and port from the broadcast and pulls the node reference through the fproxy link.  "http://" +ip+port + "/addfriend/myref.txt". Also, it stores the name of the node separately. Now the mobile and node can be said to be configured.

Work to be done on step1: USB support, Improving UI, Extensive Testing
How good is an option of synchronizing with the home node only when the user opens our application? The other options include
1) Running a service which runs in the background. Drawback: Severe battery drain since we are dealing with multicast WiFi packets continually.
2) Periodically displaying messages on the notification bar reminding to sync up with homenode
3) A widget which responds to changes in wifi state. If it gets a call from the OS that Wi-Fi state is changed, it checks if the MAC id of access point to be the same as that of home. If it detects home network, then it starts background service Drawback: A little more effort+time, many acces points may be on same network (campus/office WiFi)
4) Same as #3 minus widget plus another background service which does nothing but waits for a callback from OS regarding Wi-Fi. If it finds home MAC id, it starts up the other background service to synchronize. The former could also post notifications if home* is not detected for long time

Suggestions are welcome