Advanced Operating Systems (CIS432)

Programming Assignment 1 (telnetd)

revision date: Wed. Feb 21
Date Posted:  Wednesday February 21, 2001
Date Due:   Wednesday April 4th, 2001 UPLOADBEFORE 6:00 PM, HAND IN A HARD COPY AT 6:00PM

Submit your code by using my upload utility, onto "UPLOAD ASSIGNMENT 1" area.
FOLLOW THE NAMING CONVENTION.
PLEASE READ THE ENTIRE ASSIGNMENT (THIS PAGE) VERY CAREFULLY.
UPDATES TO THIS ASSIGNMENT WILL POSTED ON "MESSAGE OF THE DAY" PAGE.

BACKGROUND:
In order to establish a telnet connection to a UNIX system, there must be two components working together, telnet server and telnet client. Telnet server runs as a daemon (usually) on one system and telnet client runs as an application on another machine. Telnet server by default listens on TCP port 23 and of course the client by default connects to that port of the server, you could specify the client to connect to different port if the telnet server is listening on the different port, e.g. "telnet myserver 2000" which tells the telnet client to connect to port 2000 on a system called myserver. Ones telnet connection is established and user is authenticated, then user can enter any command on the remote system.

DESCRIPTION:
Write a telnet server using SOCKET for IPC to implement UNIX like "telnetd" server, your program should only comply with my specification rather than the real UNIX telnetd server.

SERVER PROGRAM:
The server should run in the foreground of the system on a none privilege port, (above 1024), the client will be invoked, to communicate with the server. Unlike the actual UNIX telnet server, each instance of a server will only connect to ONE client at a time and also the user can invoke only the commands that are allowed by the server, such as date, who, ls, finger, etc...
Server should accept a port number to listen to.
 

CLIENT PROGRAM:
You can use the telnet client which is already included with any OS.

The following is the sequence of events that should happen:

1. Start the server in the background
    afs23% Telnetserver 1234
.....
....
Client connected from afs12.njit.edu IP address: 128.235.204.73 at: Wed Feb 21 17:07:10 EST 2001

2. Run the client : e.g.

    afs12% telnet afs23 1234
    Welcome to My telnet server.
     Enter your command or help for list of commands: help
        list of commands: date, pwd, who, ls, quit.
     Enter your command or help for list of commands:  pwd
       /export/home/vahid/cis604/socket
     Enter your command or help for list of commands:  quit

Good bye.
     afs12%
 

Conditions:

What You Should Submit: (very important)        BUG:  my programs compile and runs but it dumps core after execution.
BUG and the bug explanation should be in a same line!


EXTRA CREDIT:  The following is optional not required.
If you do any of the extra credit, you must mention it in the above "des" file.


Please direct questions or errors to: CIS432@cis.njit.edu