wiki:Internal/SummerInternship/Logs/ChunhuiZhang/progress
close Warning: Can't synchronize with repository "(default)" ("(default)" is not readable or not a Git repository.). Look in the Trac log for more information.

[Jun 7th] Attend the MF weekly meeting and get myself familiar with the people and environment here; talked with Kiran about the project.

[Jun 8th] Get rooted Sprint Evo phone from Ivan and start to play with it.

[Jun 9th] Tested a sample android NDK example to call C socket API (socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) succeed!); tried socket(AF_PACKET, SOCK_RAW, 0) and return errno 1 which means no root permission, so we need a way to run the app with root.

[Jun 14th] Two options for client MF stack implementation: 1) raw socket(??) 2) android libpcap. Click(use libpcap) is maybe a option if we could port it to android.

[Jun 15th] use both 'netcfg' and 'ifconfig' to check the interfaces in android.

[Jun 16th] ALL of the outdoor node have Intel Wimax card

Use following commands to load wifi driver after ubuntu.ndz was loaded

modprobe ath5k // for 5xxx card
modprobe ath9k // for 9xxx card

Use following commands to load wimax driver after ubuntu.ndz was loaded

modprobe i2400m-usb // this will in turn load module 'wimax' and 'i2400m' 

Now,

root@node1-5:/usr# ifconfig wmx0
wmx0      Link encap:Ethernet  HWaddr 00:1d:e1:37:10:c1  
          NOARP  MTU:1400  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:20 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Then, let's connect the Wimax client to Wimax BS

wimaxd -i wmx0 -b
wimaxcu ron
wimaxcu scan
wimaxcu connect network 51

But failed to connect as of today.

[Jun 20th] Connection succeed with node1-6

root@node1-6:~# wimaxcu connect network 51
Current Preferred Profile is:
	ID  : 51
	Name: GENI 4G
Connecting to GENI 4G Network...
Connection successful

Command used to check the connection status

root@node1-6:~# wimaxcu status
Connected.

Get IP.

root@node1-6:~# dhclient wmx0
root@node1-6:~# ifconfig wmx0
wmx0      Link encap:Ethernet  HWaddr 00:1d:e1:36:ff:4f  
          inet addr:10.41.1.6 Mask:255.255.0.0
          inet6 addr: fe80::21d:e1ff:fe36:ff4f/64 Scope:Link
          UP RUNNING NOARP  MTU:1400  Metric:1
          RX packets:161 errors:0 dropped:0 overruns:0 frame:0
          TX packets:214 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:20 
          RX bytes:21872 (21.8 KB)  TX bytes:18836 (18.8 KB)

Sprint Evo 4G is connected.

# netcfg
lo       UP    127.0.0.1       255.0.0.0       0x00000049
dummy0   DOWN  0.0.0.0         0.0.0.0         0x00000082
rmnet0   DOWN  0.0.0.0         0.0.0.0         0x00001002
rmnet1   DOWN  0.0.0.0         0.0.0.0         0x00001002
rmnet2   DOWN  0.0.0.0         0.0.0.0         0x00001002
usb0     DOWN  0.0.0.0         0.0.0.0         0x00001002
sit0     DOWN  0.0.0.0         0.0.0.0         0x00000080
ip6tnl0  DOWN  0.0.0.0         0.0.0.0         0x00000080
wimax0   UP    10.41.4.1       255.255.0.0     0x00000043

After Ivan add the Evo IP:10.41.4.1 to the Wimax BS config file, ping went through between Evo and ourdoor node [1,6]

[Jun 21th] NetAPI:

http://www.eecs.berkeley.edu/Pubs/TechRpts/2009/EECS-2009-141.html. http://www.icsi.berkeley.edu/~barath/papers/fii-ccr11.pdf

NetAPI use 'schemes' to encapsulate specific classes of communication --------->??? similar to 'services' in MobilityFirst

NetAPI Connection: scheme://resource (web://, video://, voice:// etc.)

NetAPI: Application responsibilities: 1) breaking content into messages 2) specifying destination names (?? ) 3) specifying a high-level security policy

disconnection tolerance;multi-interface; best performance and best battery life policy

NetAPI provides five basic high-level operations:

open(scheme://resource, options) ⇒ handle
put(handle, message, options) ⇒ result
get(handle, options) ⇒ message
control(handle, options) ⇒ result  -----------> which MF GUID to use could be specified here
close(handle, options) ⇒ result

Responsibilities of scheme

resolving names
binding to address
selecting transport protocols
encoding messages
ensuring communication security

[Jun 24th]

MF Client System with emphasis on DTN style routing

No image "MFClientImplementation.png" attached to SummerInternship/Logs/ChunhuiZhang

MF Client System with emphasis on multi-homing

No image "MFClientImplementation2.png" attached to SummerInternship/Logs/ChunhuiZhang

[Jun 27th] Working on compiling libpcap for Android (not included by default but source is available)...

Step 1: Create a 'ndk android project' using eclipse (create jni folder)

Step 2: Download the source code: $git clone git://android.git.kernel.org/platform/external/libpcap.git (libpcap version 0.9.8)

Step 3: Copy all the source files to jni folder

Step 4: Change 'include $(BUILD_STATIC_LIBRARY)' to 'include $(BUILD_SHARED_LIBRARY)' in Android.mk which is one of the file copied into jni folder in last step.

Because we want a shared library libpcap.so

Step 4: Go go project folder(upper level of jni folder) and do: ndk-build (of course you need to install android ndk in advance) Now you could find libpcap.so in libs/armeabi/

$ ndk-build
Compile thumb  : pcap <= bpf_dump.c
Compile thumb  : pcap <= bpf_filter.c
Compile thumb  : pcap <= bpf_image.c
Compile thumb  : pcap <= etherent.c
Compile thumb  : pcap <= fad-gifc.c
Compile thumb  : pcap <= gencode.c
Compile thumb  : pcap <= grammar.c
Compile thumb  : pcap <= inet.c
Compile thumb  : pcap <= nametoaddr.c
Compile thumb  : pcap <= optimize.c
Compile thumb  : pcap <= pcap.c
Compile thumb  : pcap <= pcap-linux.c
Compile thumb  : pcap <= savefile.c
Compile thumb  : pcap <= scanner.c
Compile thumb  : pcap <= version.c
SharedLibrary  : libpcap.so
Install        : libpcap.so => libs/armeabi/libpcap.so

Step 5: Copy pcap.h, pcap-bpf.h to /android-ndk-r5c/platforms/android-9/arch-arm/usr/include/

Copy libpcap.so to /android-ndk-r5c/platforms/android-9/arch-arm/usr/lib/

Step 6: Compile and run test app

Test code:

#include <stdio.h>
#include <pcap.h>

	int main(int argc, char *argv[])
	{
		char *dev, errbuf[PCAP_ERRBUF_SIZE];

		dev = pcap_lookupdev(errbuf);
		if (dev == NULL) {
			fprintf(stderr, "Couldn't find default device: %s\n", errbuf);
			return(2);
		}
		printf("Device: %s\n", dev);
		return(0);
	}
Compile: 
$ $ACC -lpcap -o pcaptest pcaptest.c  ($ACC is the cross-compiler offered by Android ndk)

Run the test app:

First I need to push libpcap.so to my phone:
$ adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system       -------> mount the phone file system to read-write
$ adb push libpcap.so /system/lib/
$ adb shell mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system       -------> mount it back to read-only

$ adb push pcaptest /data/
$ adb shell /data/pcaptest        -------> run the test app
Device: tiwlan0      -------> this is the result!!!

[Jun 28th] Working on send link layer packets with libpcap

[July 5] Be able to send link layer packets through ethernet and wifi, testing on wimax right now...[works!]

Note: ethernet and wifi interface allow at most 1514 types packet to be send with libpcap but at most 1400 bytes for wimax interface

Last modified 13 years ago Last modified on Aug 8, 2011, 3:05:40 PM
Note: See TracWiki for help on using the wiki.