Simple TCP and Http Service (stcp module)
- loads extensions from a http server
The simpilefied tcp engine and http client talk to httpd server (velvet:8080 by default) and fetch extensions. ¼£¼£This service provides (hopefully) more reliable way to get extensions from the network than tftp did.
While user/init directly calls SimpleHttp.Get() to load init.* and extensions, scirpt shell command loads files from /spin/username/* which is served by stcpfs and stcpfs calls SimpleHttp.Get().
There are some tips to control stcp how it works. These are discribed below.
A very simple TCP engine and a http client
It has a very simple TCP engine which just performs active connect, passive close. It does not do a lot of neat things TCP/IP¼£¼£protocol usually provides.
- active connect, passive close
Since stcp is used only to fetch extensions from the server, it just talks to the server (active connect), ask it to send a file and close the channel when it gets FIN (passive close).
- one channel at a time
- hardcoded http server ip address
Since there is no way right now to tell where a http server is, the ip address(es) is embedded in the kernel image. You need to change and/or add ip address if you want to use another server.
- hardcoded passwd to access to the server
The Netscape commerce server on velvet is configured to request passwd to access to extensions. The passwd is also encoded into the service.
- GET operation only
Though http protocol defines three request types (GET, HEAD, POST), stcp does only GET requests.
- just use it !
By default, stcp is enabled and talks to velvet (you may need to update your local tree if you use spin-29 or older one.)
- some tips
user/init loads init.ALPHA_SPIN (or IX86_SPIN) script from a server and executes it. By default, http is used to fetch extensions from velvet:8080. You may change http server or service (ie. http vs tftp) by adding "boot" line(s) to init.*.
boot tftp
boot http [servername]
servername should be one of hardcoded servernames. velvet, www-spin and some other crash machines are hardcoded right now. In case of httpd on SPIN, you need a sym link from www-spin to your working directory, as http://www-spin is mapped to /var/a/wally/spin/www/www-spin not to /spin.
Once console and shell are launched, you may specify a http server with a shell variable from where stcpfs loads extensions.
> set HttpdServer servername
The same restriction is applied to the servername. See above.
In order to make stcp more robust, re-transmitting should be implemented. Currently, itsimply discards the port and try an another one if timeout happens.
Also, timeout time should be variable rather than a constant (4 sec).
It does not have many features that normal tcp engine provides such as delayed acks, low start, fast Retransmit and so on. It's mainly becuase it's a "simple" tcp.