[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [Xen-users] Problems connecting to the daytime application provided with Mini-OS



Alright, here it is, hope we can sort this out:

1. I'm simply compiling Mini-OS from xen/extras/mini-os directory with LWIP support as stated in the README:Â
   Âexport LWIPDIR=/home/mihai/lwip-1.3.2 and make.
 It creates this binary: http://pastebin.com/xyyg6P03

 I'm not using any stubdom, so I guess the default one is used If I have informed myself good about this.

2. Guest CFG file is : Âhttp://pastebin.com/VbkVq6vV and that's it.

3. This is the guest console log:Âhttp://pastebin.com/m1AYtJB8

4. This is log from creation of the guest: http://pastebin.com/a8kfu5Fw

5. Here's brctl and ifconfig from dom0:Âhttp://pastebin.com/vAvupgLz

6. Alright, here's all the things I've tried so far:

6a) Firstly I though that since eth0 and vifX.0 are bridged, you should be able to netcat to the VM. The pings works fine:Â
 This is the mini-so provided daytime which I'm running. The only difference is that I set the IP to 10.0.2.10/24: http://pastebin.com/UURCj36d
ÂÂ
 Here's where I try to ping (works) and netcat (hangs): http://pastebin.com/zHtS01Tg
 Here's ltrace and strace of netcat, to see what happens: Âhttp://pastebin.com/K9vXF5dX
 It's pretty verbose, but if you look at the last lines, you can see that connect returns EINPROGRESS.

6b) Going further, I created another VM which basically connects to 10.0.2.10/24. This is the code: http://pastebin.com/w9LCmguH
Similary to above, here's the verbose creation output: http://pastebin.com/KUKmisRs
Here's the console of "Client-OS": http://pastebin.com/bQQS9K9p
We can see that IT WORKS, it connects to the IP just fine. So what's happening here?

Here's ifconfig and brctl: http://pastebin.com/VwfXCeUu
We can see that the interfaces vif5.0 and vif7.0 are bridged together, which makes sense. I get the daytime output from "Server-OS" to "Client-OS", then the "client" thread exits just fine. It works good.

6c) Obviously, I tried to make the same "experiment" using a lwip client, thinking that I need to connect using LWIP API to a LWIP server (which is wrong, I proved this later, I can connect just find using linux sockets to a LWIP server).

What I have done at this step is using the netconn ÂAPI to create a Linux client that connects to 10.0.2.10 and outputs the received daytime value.I have looked up and found out about lwip unix ports and that there is a shared library which I can link with my linux application.

Here's the application code:Âhttp://pastebin.com/EnfYnzEC
Here's the ifconfig/brctl:Âhttp://pastebin.com/QJakkJj6

Tap0 is bridged in xenbr0. How I did this (it's not provided by defualt):Âhttps://groups.google.com/forum/#!topic/osdeve_mirror_tcpip_lwip/yQcb1YmeP54

See third answer. Basically I editedÂÂcontrib/ports/unix/netif/tapif.c which is used in compiling the liblwip.so library so firstly it adds the tap0 linux interface to xenbr0 before tries to connect to 10.0.2.10/24

Here's the ltrace when running the application (SUPER VERBOSE, probably becuase I have to use root permissions to run this due to the creation of the linux interface which requires special permissions):Âhttp://pastebin.com/4vG4QMfi

It hangs like netcat.

6d) Moving on, I tried to build the daytime application as a linux application (testing purposes, my target is to create a VM that accepts TCP connections from Linux/win32/whatever platform clients). I have used the same liblwip.so library, and I have compiled an application on my Linux PC. For simplicity, I have added my code to the already provided "simhost" application (which is a ping/telnet/http server application for lwip on linux). I compile that and it works just fine, I can even connect with netcat 10.0.0.2 13 (the default IP the application binds on) and it prints the daytime output. Thus I have concluded that you can connect with regular socket application to a LWIP server if it's configured properly.Â

PS: This application comes in the "contrib-1.3.2" archive from LWIP site at ports/unix/proj/lib (for the shared library) and ports/unix/proj/simhost (for the http server/telnet/ping answerer).

ÂÂ

Sorry for the extremly long mail, but I wanted to show you all the things I've done so maybe you understand where I've gone wrong and what I should've done better. Tell me if you need additional info.


Mihai

On Wed, Jul 29, 2015 at 11:46 AM, Ian Campbell <ian.campbell@xxxxxxxxxx> wrote:
On Tue, 2015-07-28 at 21:02 +0200, Manfred Haertel, DB3HM wrote:

I'm cross posting to minios-devel too, just to keep them in the loop.

> PÃrvu Mihai schrieb:
>
> > Basically what I'm trying to do is connect to the daytime server
> > application mini-os provdes from Dom0. The IP i set is 10.0.2.10/24
> > <http://10.0.2.10/24>. I can ping it just fine, I see it in ifconfig,
> > it
> > is bridged with xenbr0.
> >
> > More, If i create a Mini-OS Client, I can connect just fine to it, I
> > just can't do it from eth0 (using netcat, or whatever socket layer
> > API).
>
> Funny, I tried the same thing today (before reading your mail), with the
> same results.
>
> So either we make the same mistake or daytime is broken in mini-os...

Very few of the in-tree stubdoms use networking (only pvgrub might, but I
bet it isn't commonly used that way, since normally people boot of disk not
network) and I'm pretty certain that none of them use daytime specifically,
so if this ever worked I'd not be too surprised if it had regressed at some
point over the years.

Please can one or both of you provide some details of exactly what you've
done/are seeing, so:

   * Which stubdom target you have built, which configuration it is
    using, which binary you are loading
   * The guest CFG file
   * The guest console log
   * Logs from the creation of the guest
   * brctl, ifconfig etc from dom0.
   * Details of what commands run in dom0 aren't working.

Maybe something in there will give us a hint where to look next.

Ian

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.