Friday October 24, In-lab Assignment:

We will explain the basic SMTP commands and then you will fill the missing code in the SMTP client skeleton. The sample .exe helps you understand how it works. A brief explanation of SMTP commands follows:

SMTP MODEL

The sender-SMTP establishes a two-way transmission channel to a receiver-SMTP. The receiver-SMTP may be either the ultimate destination or an intermediate. SMTP commands are generated by the sender-SMTP and sent to the receiver-SMTP. SMTP replies are sent from the receiver-SMTP to the sender-SMTP in response to the commands.

COMMANDS - STEPS

• HELO: This command is used to identify the sender-SMTP to the receiver-SMTP. The argument field contains the host name of the sender-SMTP. The receiver-SMTP identifies itself to the sender-SMTP in the connection greeting reply, and in the response to this command. This command and an OK reply to it confirm that both the sender-SMTP and the receiver-SMTP are in the initial state, that is, there is no transaction in progress and all state tables and buffers are cleared.

• MAIL: This command is used to initiate a mail transaction in which the mail data is delivered to one or more mailboxes. The argument field contains a reverse-path.

• RECIPIENT (RCPT): This command is used to identify an individual recipient of the mail data.

• DATA: The receiver treats the lines following the command as mail data from the sender. This command causes the mail data from this command to be appended to the mail data buffer. The mail data is terminated by a line containing only a period that is the character sequence "<CRLF>.<CRLF>". This is the end of mail data indication. The end of mail data indication requires that the receiver must now process the stored mail transaction information. If the processing is successful the receiver must send an OK reply. If the processing fails completely the receiver must send a failure reply.

• SEND: This command is used to initiate a mail transaction in which the mail data is delivered to one or more terminals. The argument field contains a reverse-path. This command is successful if the message is delivered to a terminal.

• QUIT: This command specifies that the receiver must send an OK reply, and then close the transmission channel. The receiver should not close the transmission channel until it receives and replies to a QUIT command (even if there was an error). The sender should not close the transmission channel until it send a QUIT command and receives the reply (even if there was an error response to a previous command).

Replies to SMTP commands are devised to ensure the synchronization of requests and actions in the process of mail transfer, and to guarantee that the sender-SMTP always knows the state of the receiver-SMTP. Every command must generate exactly one reply.

For more details concerning SMTP, please refer to RFC 821 and RFC 2821.


Friday October 17, In-lab Assignment:

In previous labs , we have read the code of talker and listener for UDP. Moreover, we inserted a middle node , "forwarder", to that system. Now we'll try to the something very similar in TCP. This time the talker will send to the forwarder, the IP address and port of the listener, and at the same time it will take the local system's current time. Then the forwarder will communicate wiht the listener. But instead of just passing a messsage, the forwarder will ask the listener the time of the day. When it gets the reply, it will forward it back to talker. When talker gets the reply, it will immediately take the local time again and calculate the difference between the last and the first values of time.

Suppose in talker we type "./talker ", meaning talker asked forwarder to communicate with listener, take the system time of listener and forward it back to the talker.

Note: You can use TCPecho client and server files in order to start programming.