REC Computer Interface Workshop

Internet and Networking Notes


This seminar was given in conjunction with the REC workshop, to help the participants make the most out of the workshop and gather new ideas. It was conducted in a one-hour period. The main object was to get participants involved and informed, so that they could come up with interesting ideas to interface their tools via the internet and the world wide web

Table of Contents


CGI

There are a few similar definitions out there for CGI, the Common Gateway Interface. To put it in a simple way, it is a scripting method that allows a http daemon to return the results of cgi script.

CGI scripts can be in any language, C, C++, Perl, csh, bash, sh, as long as the program itself satisfy the requirements of CGI, as defined in the specs. The restrictions are mostly on the methods in which the cgi script use to get input and dump output. As long as these restrictions are met, the script is fine.

There are two major ways of getting data in a cgi script, one through environment variable lookup, or GET method, one through parsing URL, or the POST method.

CGI scripts allow the use of forms as well. Check out the registration form for this seminar! On line!

For an example, check out the CGI script here and see what it does.

CGI scripts do present some security risks. Be careful when you write them!


Server

There are a few flavors of servers out there. Mainly NCSA, CERN (MIT/LCS/W3C), Apache (allow IP spliting and multi-domain) and Netscape. There are also http servers for mac (mac-httpd) and windows (from various vendors).

A HTTP server or HTTPD (daemon) server HTML files, gif files and whatever files you want other to access via the WWW. There is an API from LCS/W3C in C. It uses the TCP/IP protocol as the implementation backbone. The API is easy to use and fairly easy to understand.

Check out the NCSA httpd docs. Read some of the example configuration files from there.


Daemon

Daemon is just another way of saying server. It is a process that sits in the background and awaits input. For example, sendmail is a mail daemon that take cares of incoming and outgoing email messages; fingerd is a daemon that takes care of finger clients; telnetd controls telnet clients, etc.

Writing daemon is not hard. There is a very systematic way of doing it. You could also choose between different protocols, IPX and RPC are just a few examples.

The read more about writing daemons, read the on line how-to doc, and more importantly, R. Stevens' networking book. Comer also has a few very good books on networking client-server environment.

coked - Never thought your coke machine would be on the internet, right? Well. It is here...

Daemons also present a security hole. Be very careful...


Other Internet Interface

Heard about JAVA. It's interactive, it's multi-media supported, it's fun, and it's the best thing since... well, it's not done yet.

Other ways of interfacing also include using tk/tcl, specially designed server scripts (much like cgi), etc.


Benjie Chen <benjie@media.mit.edu>