[Beowulf] automount on high ports

Robert G. Brown rgb at phy.duke.edu
Thu Jul 3 10:45:44 PDT 2008


On Thu, 3 Jul 2008, Bogdan Costescu wrote:

> On Wed, 2 Jul 2008, Robert G. Brown wrote:
>
>> if you try to start up a second daemon on that port you'll get a EADDRINUSE 
>> on the bind
>
> While we talk about theoretical possibilities, this statement is not always 
> true. You could specify something else than INADDR_ANY here:
>
>>  serverINETaddress.sin_addr.s_addr = htonl(INADDR_ANY); /* Accept all */
>
> or bind it to a specific network interface (SO_BINDTODEVICE). Then you can 
> bind a second daemon to the same port, but with a different (and again not 
> INADDR_ANY) local address or network interface. Many daemons can do this 
> nowadays (named, ntpd, etc.).

Sure.

I meant on a single wire, single IP number (and included sample code),
not that you couldn't offer network services on more than one network
from a single machine.

Ultimately, raw networking is really difficult, and I'll freely admit
that even though I've WRITTEN some network apps, I'm far from expert.  I
code with Stevens in one hand and examples in the other, typing with my
nose, and pray.  So any of y'all that have written a lot of networking
code will have direct experience of edges I have not yet explored.

This is one reason that people use PVM and MPI and so on.  It can be
argued (and has been argued on this list IIRC) that raw networking code
will always result in a faster parallel program, all things being equal,
because encapsulating it in higher level abstractions always comes at a
cost (even though in many practical cases the people who wrote those
abstractions were better parallel coders than the person trying to write
the code anyway, so things are not equal, so the resulting code will be
MORE efficient than what one would get unless one worked really hard and
learned all the tricks used in the library to where one could go beyond
them).

It is pretty easy to write a single task server.  There is template code
for it.  It isn't horribly difficult to write a forking server.  There
is template code for it.  As you go up in complexity and expected load
beyond where these will work, you have to learn, and you will find it
harder and harder to find good, simple, templated code to start your
project with.  Such is life.

And it isn't easy to learn.  Few people teach it because few people know
it.  There aren't a lot of good books on it that I know of (outside of
Stevens).  One has to learn the hardest of ways; on the job, by doing,
by making mistakes.  I certainly have learned the modest bit that I know
on my own, and haven't had any need to go beyond it (yet) to the next
level.  And if God is good to me, I will never have to design a
20 Kconnection webserver, and can die in peace in my state of relative
ignorance...;-)

    rgb

>
>

-- 
Robert G. Brown                            Phone(cell): 1-919-280-8443
Duke University Physics Dept, Box 90305
Durham, N.C. 27708-0305
Web: http://www.phy.duke.edu/~rgb
Book of Lilith Website: http://www.phy.duke.edu/~rgb/Lilith/Lilith.php
Lulu Bookstore: http://stores.lulu.com/store.php?fAcctID=877977



More information about the Beowulf mailing list