COSC 4300 Networks and Internets

Fall 2014

Homework Assignment #9

TCP
"Measured in time of transport and communication,
the whole round globe is now smaller
than a small European country was a hundred years ago."
-- John Boyd Orr
Due: Wednesday, December 3rd, 3:30pm CST
Submit: Turn in your entire kernel source code with a subdirectory "chat" for the UNIX source code using the turnin command on the Systems Lab machines.
Please run "make clean" in your compile/ subdirectory before submitting. Work is to be completed in teams. Only one team member should turnin, but it would be courteous to notify your teammate(s) when you do this. Names of authors should be included in all work. You may submit multiple times, but only the last turnin will be kept. The automatic submission system will not accept work after the deadline.

TCP rdate

Refit your implementation of the UDP rdate client to operate over a TCP socket.

Your TCP implementation should execute the three-way handshake, transport the four-byte rdate response from the server to the client, and gracefully terminate the connection.

BONUS: The rdate server will immediately close its side of the full-duplex TCP socket after it has sent the four bytes of time data, and your client should close its side immediately after receiving the time data. This sets up a race condition in terms of which states the TCP state machine will traverse to arrive at the closed state. Your TCP state machine should gracefully shutdown the connection if either the client closes first, or if you insert a time delay before your close call to ensure that the server closes first.

TCP sendmail

Morbius's internal address (192.168.6.10) has been temporarily reconfigured to allow SMTP connections on port 25 from the router pool on the private network.

Build a mail shell command that allows a user to send an e-mail message via Morbius.

Use the SMTP application-level protocol to enable this service.

Here is what a typical SMTP transaction with Morbius looks like:

HELO mawdryn.mscs.mu.edu
250 morbius.mscs.mu.edu Hello [192.168.6.12], pleased to meet you
MAIL From: brylow@mscs.mu.edu
250 2.1.0 brylow@mscs.mu.edu... Sender ok
RCPT To: brylow
250 2.1.5 brylow... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
Subject: test 1.

Test 1 from Mawdryn.
.
250 2.0.0 sAOJHp0P013335 Message accepted for delivery

QUIT

[Revised 2014 Nov 24 15:26 DWB]