How to know the IP@ the emulator gets via DHCP

Hello

On the emulator, i run a server application waiting for some requests sent via a client program located on the host PC.

The application is launched at startup and get an IP address from the DHCP server. For some reasons, this IP is not always de same, and i need to know it in order to be able to send request from the client application.
The emulator has no host name, and for some other reasons, i don't want to give it a name.

FROM the pc, is there a way to get the IP address assigned to the emulator

i used all the standard network tools like nslookup/arp/tracert/route/netdiag, etc... no way to find it. For some technical reasons, i cannot use activeSync.

Maybe via Virtual Machine Network Services, but i cannot find anything connected to it that will give me the IP of the emulator. I'm afraid all the routing is done in the driver that is probably a black box !

Any Idea how to get this IP (From the PC)

Thank's a lot


Answer this question

How to know the IP@ the emulator gets via DHCP

  • mveit

    ping emulator_name

    Make sure to change emulator name from default.



  • EliteSniper177

    Hello

    Thank's for giving attention to my question.

    As i said, my emulator cannot have hostname.
    In fact, this story takes place in a test framework where 40 Pc machines will start an emulator each, FROM THE SAME IMAGE.
    for some obvious maintenance reasons, i cannot create a different image per machine, so the image i use do NOT have hostname.
    But the DHCP server is not disturbed by that and each emulator receive a valid IP address.

    At startup, the emulator runs a server that will listen for some commands. As i don't have the source code of this server, i can't do anything in order to output the address somewhere.

    The PC is routing the packets to the emulator, but i'm afraid that it only uses the MAC addresses for that.

    Somebody knows how to get this IP address

    Thank's

  • Peter Kahn

    In that case it's not possible just like you could not determine which IP my PC got from DHCP.

    You need to know something about device/emulator or it should send you the information somehow. E.g. make some application which would run on startup and send emulator's IP to your server.



  • eldoktor007

    Hi

    thank's for the answer. It's exactly what we did to solve the problem : use the shared directory.
    But, as i was not sure that the developper would provide me a version that will output the IP@, i also managed to find another way to get the IP.

    I wrote a simple script using tethereal. By checking all broadcasted packets to port 68, you'll get the DHCP ACK from the server, which allocate the IP@ to the MAC of the emulator :

    tethereal -i 2 -w /tmp/trace -a duration:TIMER -f "ip host 255.255.255.255 and dst port 68" -S -V -p >/tmp/decoded_trace

    By using a simple search algorithm, you can easily extract the IP from the decoded trace.

    Ok, it's not a really straightforward solution, but it bypasses lot's of interfaces and can also be executed from an other machine on the same subnetwork.

    Hope it will help somebody !



  • gokce

    Unfortunately, there is no way to query the emulator itself to discover information about IP addresses... TCP/IP protocol is implemented entirely inside the guest OS, on top of the raw ethernet frames supplied by the emulated netcard.

    One thing you could do is create a small application to run inside the emulator, that logs the Windows Mobile / Windows CE IP address out to a text file under "\Storage Card", such as "\Storage Card\ipaddress.txt". Then, when you launch the emulator, configure it to use a shared folder, like c:\emulatorinfo. Then from the Windows machine, you could figure out the emulator's IP address by opening "c:\emulatorinfo\ipaddress.txt" and reading its contents.

    Barry


  • How to know the IP@ the emulator gets via DHCP