[ SDF Public Access UNIX System .. Est. 1987 ]

join welcome faq status members projects store tour gopher abuse dialup minecraft social
tilde nihongo europa webmail gallery usermap irc tutorials telnet git ssh

Port Allocation

The elusive topic of MetaARPA users being able to allocate ports has come up several times on bboard and has yet to be documented. Here's official word from smj:

    TACKER:  smj (Stephen M. Jones)
    SUBJECT: .. SDF user port allocation
    DATE:    20-Apr-13 22:35:45
    HOST:    ol

    Its quite simple and should be add to the tutorials.  The port number is
    based on your numeric id.  You may run a simple server process on
    meta.sdf.org as long as it does not circumvent a membership (for instance,
    running your own webserver to host your own domain name bypassing the VHOST
    membership).  IRC bots are fine and servers of reasonable or less foot
    print.  For instance if you ran a nickserver or bot you'll likely be fine.
    If you run a minecraft server you'll probably get emails from other users
    asking you to stop hogging CPU and Memory.

How To:
Now that you know the policy, you might ask yourself, how do I get my numeric id?
Which system provides the correct numeric id? Answer is simple, you run the 
`id` command from any cluster server, and note your uid, this is your numerically
assigned port number.
$ id
uid=56395(user) gid=500(arpa) groups=500(arpa),600(MetaARPA),900(motd)
in the above example, note the port number would be 56395. You are now ready to setup
your server software.

Here's a good way suggested by a user on how to test your port allocation (with an example assuming your allocated port is 12345):

I recommend starting with a protocol that's much simpler than HTTP,
and working your way up.  I also recommend starting with the simplest
possible network (localhost), and working your way up.

Based on those ideas, here are some first steps:

Open two terminals logged in to the Meta Array.

In one of them, run this simple date/time server:

    socat -d -d -d -v TCP-LISTEN:12345,fork EXEC:date

In the other, run this simple client:

    nc -v -v localhost 12345

If that works (i.e. if the client prints the date and time),
try the client again but with "ma.sdf.org" instead of "localhost":

    nc -v -v ma.sdf.org 12345

If that works, try running the client on the SDF cluster instead
of on the Meta Array.  If that works, try running the client on
your PC.  If that works, you're ready to start working your way
up to more complicated protocols.

Not just for learning, but also for debugging...

Starting with a simple protocol and a simple client and server helps
isolate TCP- and IP- and DNS-level problems from other possible 

Bind address: Note that depending on what service you want to run, you might need to tell it what address to bind to. To know this address, you can use the "dig" command on the MetaArray to identify it.
$ dig [your username].sdf.org

....[other output]....

[your username].sdf.org.        43200   IN      A

....[other output]....
In this example, would be the bind address.

$Id: port_allocation.html,v 1.6 2020/09/26 17:50:46 penonek Exp $

©1987-2065 SDF Public Access UNIX System, Inc. 501(c)(7)
(this page was generated using ksh, sed and awk)