In this assignment you will create a tcp server and client


Assignment

In this assignment you will create a TCP Server and Client.

You have two options. You can implement a TCP QOTD Client and Server program similar to the UDP assignment. This option is worth the standard 50 points. The second option is to implement a TCP Simple File Server and Client. This option includes 8 extra credit points. You can only get credit for one of the options. Do not turn in both. Submit your .py files on Canvas.. A description of each option follows.

TCP QOTD Client and Server

The client program should:

1. accept a host and port number from the command line or prompt the user for these values at startup
2. Request the QOTD from the specified host and port over TCP
3. Print out the resulting quote

The server program should:

1. accept a port number from the command line or prompt the user for this value at startup

2. Accept connections from any address

You do not need to handle more than one connection at a time.

However, once you have transferred the file you should go back to accepting connections.

3. Reply to requests with the QOTD

This can be a single hard-coded quote.

To test your client, try requesting the qotd from djxmmx.net on port 17

To test your sever, try requesting the qotd from your server using your client.

Because TCP is byte/stream oriented, you will want to consider how your program will handle the sending and receiving of information. Will you use a fixed-size format for the request? Will you specify the size of the request in the first several bytes of the message. Will you use a delimiter to indicate the end of the request? Will you close the connection after the request has been sent?

Similarly you need to decide the same thing for the response. Will you use a fixed-size format for the response? Will you specify the response size in the first several bytes of the message. Will you use a delimiter to indicate the end of the response? Will you close the connection after the response has been sent?

You will not get full credit if you program does not handle the byte/stream nature of TCP even if it "appears" to be working correctly.

TCP Simple File Server and Client

The client program should:

1. accept a host, port number, remote file name and local file name from the command line or prompt the user for these values at startup
2. Request the remote file from the specified host and port over TCP
3. Save the received file to local file name

The server program should:

1. accept a port number from the command line or prompt the user for this value at startup

2. Accept connections from any address

You do not need to handle more than one connection at a time.

However, once you have transferred the file you should go back to accepting connections.

3. Get the filename to be transferred

4. Send the file to the client.

To test your client, try requesting sample.txt from icarus.cs.weber.edu on port 2080(uses a half-close for requests) or from icarus.cs.weber.edu on port 2081(uses a new-line delimiter for requests). You will want to be connected to the Weber State network (on campus or use vpn).

To test your sever, try requesting a file from your server using your client.

Because TCP is byte/stream oriented, you will want to consider how your program will handle the sending and receiving of information. Will you use a fixed-size format for the filename? Will you specify the filename size in the first several bytes of the message. Will you use a delimiter to indicate the end of the filename? Will you close the connection after the filename has been sent? Similarly you need to decide the same thing for the actual file. Will you use a fixed-size format for the file? Will you specify the file size in the first several bytes of the message. Will you use a delimiter to indicate the end of the file? Will you close the connection after the file has been sent?

You will not get full credit if you program does not handle the byte/stream nature of TCP even if it "appears" to be working correctly.

Request for Solution File

Ask an Expert for Answer!!
Computer Networking: In this assignment you will create a tcp server and client
Reference No:- TGS02741103

Expected delivery within 24 Hours