android home network

26
ANDROID HOME NETWORK Chris Bednarz Justin Jones Prof. Xiang

Upload: oakes

Post on 23-Feb-2016

21 views

Category:

Documents


0 download

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 Presentation

TRANSCRIPT

Page 1: Android Home Network

ANDROID HOME NETWORK

Chris BednarzJustin JonesProf. Xiang

Page 2: Android Home Network

FOLLOW US

http://code.google.com/p/alt-hs/ svn checkout

Page 3: Android Home Network

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

Page 4: Android Home Network

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

Page 5: Android Home Network

HIGH LEVEL DESIGN

Layer 3 Request

User Mode Program

Layer 5 Request

Phone

Android Kernel/Internet

Time

Page 6: Android Home Network

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

Page 7: Android Home Network

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

Page 8: Android Home Network

COMPLETED ROUTER DEVELOPMENT

Page 9: Android Home Network

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)

Page 10: Android Home Network

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

Page 11: Android Home Network

SIMPLIFIED VHL DESIGN

Page 12: Android Home Network

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

Page 13: Android Home Network

TUNNEL INTERFACE STRUCTURE

Source/Destination Computer

WLAN / ETH

Router, Kernel Mode

User Mode Program

TUN

Router, User Mode

IPTables (Firewall)

Page 14: Android Home Network

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

Page 15: Android Home Network

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

Page 16: Android Home Network
Page 17: Android Home Network

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.

Page 18: Android Home Network

PHONE/ROUTER INTERFACE

User Mode Program

ADB/USB

Android Program

Internet

Cell Phone

Page 19: Android Home Network

SIMPLIFIED VHL DESIGN

Page 20: Android Home Network

COMPLETED PHONE DEVELOPMENT

Page 21: Android Home Network

PHONE PROGRESS Ping Program Java Elements

EditText TextView Buttons

Page 22: Android Home Network

PHONE PROGRESS Communication

Program Currently working on

the TCP protocol Future work includes

UDP & ICMP

Page 23: Android Home Network

TIMELINE

Page 24: Android Home Network

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

Page 25: Android Home Network

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

Page 26: Android Home Network

QUESTIONS