[openbeosnetteam] Re: Testing the stack

  • From: Philippe Houdoin <philippe.houdoin@xxxxxxx>
  • To: openbeosnetteam@xxxxxxxxxxxxx
  • Date: Fri, 2 Jan 2004 01:30:39 +0100

Hi Brennan,

> Ok, I think I've got everything squared away for testing, but one thing. 
>  I'm still a little confused about the net_server_driver file.  I guess 
> I'm a little confused about the diffrence between the userland and 
> kernel stacks.  I understand the kernel stack structure, but what is 
> net_server_driver?  Is that a replacement for the BeOS R5 net_server?  

No!
It's just a testbed/debug design for our stack, made up from the exact same 
source code for the real *meat* of the stack: the stack modules.
His purpose is to allow running the stack modules in userland, where it's far 
more confortable to debug them than in kernelland.
So, debugging purpose, nothing more.

I never plan to make this design nothing more than that. 

> Where does net_server_driver fit in to the stack architecture diagram in 
> the docs?

Nowhere, as it's not documented yet. Three month ago, this userland design 
wasn't working at all/was broken.

However, I've made a diagram to show the differences with the real design.
Here you'll find the userland testbed design diagram:
http://philippe.houdoin.free.fr/phil/beos/openbeos/network_kit/obos_net_server_d
esign_1.gif

  
> Are there two separate stacks to test? One being 'core + 
> protocols' and the other being 'net_server_driver'?

No, that's not separate stacks, but only a design where the green parts, where 
all the real stack activity is run, are compiled and hosted in userland instead 
of kernelland.
This userland test design live under current/src/tests/add-ons/kernel/network 
folder under our CVS. As you will see if you there, all stack modules there are 
just made of one single Jamfile, using the same source code as kernelland 
modules, but build as userland add-ons instead.

So, differences between the two designs are:
- stack modules (green blocks) are compiled as userland add-ons and link 
against the net_stack_tester app (was still called "net_server" at diagram 
time, but I renamed it to avoid confusion with any *final* stack design). Same 
source code is used, no difference except that net_stack_tester app emulate the 
small set of kernel API expected by modules, and that's all. In fact, 
net_stact_tester mostly do IPC and load "core" module to call start() hook on 
it, and that pretty much all. You see, the rest is under core module control, 
which is the same code as his kernelland version...
- Where in normal stack design the /dev/net/stack driver is our userland <-> 
kernelland stack gate, here the /dev/net/server driver is our userland <-> 
net_stack_tester gate.
- before being able to use (run an app) the userland version, you need to tell 
libnet.so (which is the same library for both design) to use /dev/net/server 
instead of default /dev/net/stack driver as "gate" to stack. That's the purpose 
of NET_STACK_DRIVER_PATH env variable the library use, if set.

> That said, I will be focusing on the kernel space stack for testing, 
> unless you guys think I should be testing the user space stack.

Kernel space stack is the objective. Testing the real thing is always better.
Anyway, if you feel the need to dive into stack code to find a bug and find it 
hard in kernel space (as it is most of the time), you may want to try the 
userland version and launch bdb on net_stack_tester.

You'll find a ready to use userland version in a net_stack_tester_kit I've made 
availalbe on this mailing-list some weeks ago:
http://philippe.houdoin.free.fr/phil/beos/openbeos/network_kit/net_stack_tester_
kit.zip
More instructions to use it:
//www.freelists.org/archives/openbeosnetteam/10-2003/msg00058.html

I explain how to build the userland version here, if you want to use latest CVS 
code or after you (soon!) will have find several bugs in the stack and would 
want to test your fixes:
//www.freelists.org/archives/openbeosnetteam/10-2003/msg00042.html

;-)

> Also, I am more than happy to tackle addition documentaton other than 
> just testing procedures.  I will fill in the blanks that exist in the 
> network html documentation as I go, if no-one minds.

I'm sure no-one will object here!
:-)

The current docs are under current/docs/develop/net/* in our CVS, I just 
publish them online too on my site for convenience.
 
> I will begin testing the kernel stack today.  Actually, I already 
> started, and found that the BeOS provided ftp application works!  
> However, telnet is causing a segment violation...  Anyway...

Good start!
Feel free to report often here your progress.

- Philippe

Other related posts: