android home network
DESCRIPTION
Chris Bednarz Justin Jones Prof. Xiang. Android Home Network. http://code.google.com/p/alt-hs/ svn checkout. Follow Us . Background USB Tethering for Linux Completely Extensible for Home Network Use Alternative to the recent “portable hotspot” capability - PowerPoint PPT PresentationTRANSCRIPT
ANDROID HOME NETWORK
Chris BednarzJustin JonesProf. Xiang
ABOUT AHNBackground USB Tethering for Linux Completely Extensible for Home Network Use Alternative to the recent “portable hotspot”
capability A “Non-root”, unmodified Kernel solutionAdvantages Enables Linux scalable/customizable security
features Much easier on the phone (Power Consumption
/ Processing) Works on all Android capable devices
MAJOR DESIGN REQUIREMENTS1. A “Non-root”, unmodified Kernel solution
Phone must fetch data requests at the application level ( TCP Layer 5)2. Routing capable
All data across the network must come in and out at the internet layer (TCP Layer 3)
3. Phone and Computer interface must be USB Allows fast transportation
4. Support the major protocols TCP, UDP, ICMP
5. Scalable customizable security features Linux IPTables
6. Fast Divide and conquer, multi-thread different tasks into independent
threads
HIGH LEVEL DESIGN
Layer 3 Request
User Mode Program
Layer 5 Request
Phone
Android Kernel/Internet
Time
COST / HARDWARE COMPONENTS AHN is a software based design utilizing
open source freeware tools Only cost includes the Android devices and
services Hardware includes any laptop or
desktop PC as a router and any networking device to connect wirelessly
TASKS Tunnel to Router Interface Phone to Router API Interface Router TCP State Driver Phone Ping Communication Demo Router Abstract Tester Router UDP/ICMP Stateless Driver Phone TCP Driver Phone UDP/ICMP Stateless Driver
COMPLETED ROUTER DEVELOPMENT
ROUTER DESIGN OVERVIEW Subdivided into 4 threads:
1. Tunnel Interface2. Incoming processing3. Phone/Router Interface4. Outgoing processing
Threads communicate through a thread safe shared resource (Called buffer_queue)
Linux GNU C library (POSIX compliant)
BUFFER_QUEUE / BUFFERQUEUE Created both a C and Java version A shared resource that allows neighboring
threads to communicate Enables multi-threading
Acts like any queue but requires no memory copy (stores pointers)
Tailored for network traffic Performs atomic operations in order to be
thread safe
SIMPLIFIED VHL DESIGN
TUNNEL INTERFACE THREAD Must hook requests from the Kernel to the userspace
program TUN driver performs this, but must be properly configured Can be acquired via file descriptor with root privileges
from the userspace program Must reconfigure the routing tables
No processing performed Simply passes incoming requests to the next thread, and
outgoing data through the network Developed the program that properly configures the
TUN driver Developed a script that performs all necessary
changes
TUNNEL INTERFACE STRUCTURE
Source/Destination Computer
WLAN / ETH
Router, Kernel Mode
User Mode Program
TUN
Router, User Mode
IPTables (Firewall)
INCOMING/OUTGOING PROCESSING THREAD
L3 L5 Protocol dependent Replace protocol header with a simplified
command TCP:
Connection Oriented Requires State Machine (Requires Complexity) Must synchronize with the phone
UDP/ICMP: Connectionless / Best Effort Stateless
Encapsulate completed requests with the correct protocol header
TCP Reliable protocol to the expense of complexity Simplifications
Many Options, simplified to: MSS (1460) Do not process TSTAMP, SACK, etc.
NO IP fragmentation NO physical way to process PSH, or Urgent ptr
Must maintain a TCP state machine in order to encapsulate the correct header
Max Window (Both ends) = 9 * MSS In case of network error all outgoing data is
saved until ACK
PHONE TO ROUTER INTERFACE THREAD
Google provides a utility program that allows USB communication through a program called ADB
ADB allows for TCP or UDP port forwarding. A host socket channel started from the phone
can connect to a client socket on the host computer (router)
Packets are sent continuously through the port, and all requests confirmed or declined depending on the state on both ends.
PHONE/ROUTER INTERFACE
User Mode Program
ADB/USB
Android Program
Internet
Cell Phone
SIMPLIFIED VHL DESIGN
COMPLETED PHONE DEVELOPMENT
PHONE PROGRESS Ping Program Java Elements
EditText TextView Buttons
PHONE PROGRESS Communication
Program Currently working on
the TCP protocol Future work includes
UDP & ICMP
TIMELINE
Week Of
Su M Tu W Th Fri Sat
9/49/11 Router: TCP Driver9/189/25 Router: Abstracter/ Bug Fixes
Week Of
Su M Tu W Th Fri Sat
10/2 Phone: TCP Driver10/9 Router: Bug Fixes
10/16 Start Report Phone: Bug Fixes10/23 Submit Abstract Router: UDP/ICMP Driver
September
October
Week Of
Su M Tu W Th Fri Sat
10/30 Phone: UDP/ICMP Driver11/6 Router Bug Fixes
11/13 Complete Final Report Draft
Phone Bug Fixes
11/20
Week Of
Su M Tu W Th Fri Sat
11/27 Complete Final Report 2nd Draft Final Router Fixes12/4 Final Phone Fixes
12/11 CODE FREEZE Finish Final Report12/18 Presentation
Novemeber
December
QUESTIONS