On Thu, Jul 16, 2009 at 1:06 PM, Mani <mani.on.gt...@gmail.com> wrote:

>
> All :
>
> Currently , when i launch the Android Emulator , it creates a Virtual
> eth0 interface and assigns the IP Address 10.0.2.15 to it .  It also
> has a Host Loop Back address 10.0.2.2 which is nothing but the alias
> to the PC Loop Back address 127.0.0.1 .
>
> Now , if i am running the Anrdroid Emulator on a PC , containing the
> IP address, say,  192.168.11.2 and another Machine-A is connected to
> the Same LAN  , and contains the IP address , say , 192.168.11.14.
>
> Q1 -
> How does the Client process running in Android space communicate with
> server process running on Machine-A ( 192.168.11.14 ) ?
> I assume the packet flow as
> Android eth0 ( 10.0.2.15) ---> Android host loopback ( 10.0.2.2) --->
> PC Loopback ( 127.0.0.1) ---> PC eth0 ( 192.168.11.2) ----> Machine-A
> ( 192.168.11.14)
>

The emulator maintains a virtual ethernet LAN and intercepts Ethernet
packets
from the emulated kernel. It then converts them into standard BSD/Winsock
socket
calls whenever that makes sense.

Emulated Kernel -> virtual LAN -> emulator "router" -> BSD/Winsock Sockets
-> host kernel -> whatever..

Of course, it does the opposite, i.e. it will convert incoming connections
or answers on sockets
into emulated ethernet packets. This is all kind of tricky and happens in
external/qemu/slirp2

This code is from QEMU, also know as the "user network" mode, which is very
handy for us because
it doesn't require any root priviledges or special drivers to work on all
supported host development
environments the emulator must run on.


>
> Can you kindly let me know if this is correct ? if so , how is packet
> flowing from PC Loopback to PC eth0 ? if not , how exactly is the
> packet flowing ?
>
> Q2 -
> How exactly is the virtual eth0 interface created in the android
> Emulator, what API's are used ?  . If i want to create a eth1
> interface and assign some IP Address to virtual eth1 and then be able
> to use eth1 interface to send a Packet to Machine-A . How can i
> acheive it
>

it is setup with "ifconfig" by /system/etc/init.goldfish.rc, e.g. see here:

http://android.git.kernel.org/?p=platform/system/core.git;a=blob;f=rootdir/etc/init.goldfish.sh;h=0eb0154bf5fadbe99dc5f8f91a8f8decf879c24b;hb=dc9d52f35d6d590863b358997bf25605cf72be5f

/system/etc/init.goldfish.rc (not the same file) also contains some DNS
setup instructions
for the emulated system.



> Q3 -
> How is the Android Router ( with IP Address 10.0.2.1) used ?
>

I don't understand what you exactly mean here. Can you be more specific?


>
>
> Can you Kindly Provide any links , that would provide these
> information , on how to work with the Android Virtual network
>
> Thanks
> Mani
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to