



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A project assignment for ece 4564: network application design at virginia tech. The objective is to design, implement, and test client and server programs for both tcp and udp versions of the basic test protocol (btp). The project covers the design and programming objectives of implementing mandatory and optional methods of btp, including clientip, clientport, count, echo, clientname, daytime, and reverse.
Typology: Study Guides, Projects, Research
1 / 6
This page cannot be seen from the preview
Don't miss anything!




Virginia Tech Bradley Department of Electrical and Computer Engineering
Due: October 2 (Midnight)
The educational objective of this project is to reinforce concepts related to client-server protocols, socket calls, and operation of TCP and UDP sockets. The design and programming objectives of this project are to design, implement, and test client and server programs that implement both TCP and UDP versions of the Basic Test Protocol (BTP).^1 Testing is to include testing your TCP client with a provided client program. BTP, requirements for the server and client, and other related matters are presented below. Note that mandatory features and optional features are specified. Mandatory features must be implemented. A subset of the optional features may be implemented to receive full credit for the project.
The Basic Test Protocol is a simple protocol that allows a client and server to test their connection. This is not a standard protocol, but does have features found in many application-level protocols. There is a UDP version, UDP-BTP, and a TCP version, TCP-BTP. Note that you are not to design the protocol – it is specified here – so your client and server should work with other clients and servers that implement BTP (with the exception of optional requests).
BTP includes four mandatory request types (or methods), CLIENTIP, CLIENTPORT, COUNT, and ECHO, which can be sent by a client to the server. There are also two optional requests, CLIENTNAME, DAYTIME, and REVERSE. The server responds with a message that is appropriate to each request type. The server should ignore any invalid requests, but it should not fail if an invalid request is received.
TCP-BTP: To make a request, the TCP-BTP client must first establish a TCP connection with the TCP- BTP server. The client then sends the request to the server and closes the connection for sending from client to server. If the request is valid, the server then sends the reply and closes the connection for sending from server to client. Note that a new TCP connection must be established for each request.
UDP-BTP: To make a request, the UDP-BTP client must send the request in a single UDP datagram to the UDP-BTP server. If the request is valid, the server then sends the reply in a single UDP datagram. Only one request can be sent per datagram.
The methods or request types are described in more detail below. Method names must be upper case. The following symbols are used in the descriptions.
Items enclosed in square brackets (“[“ and “]”) are optional. Items enclosed in curly brackets (“{“ and “}”) are repeated zero or more times. The maximum length of any request, including the method identifier, spaces, and text parameter, is 128 bytes.
CLIENTIP Method
Request: CLIENTIP
Action: Determine and return the IP address of the client in dot-decimal form in an ASCII text message.
(^1) “BTP” is defined only for this assignment. You won’t find an RFC that describes BTP, at least not yet.
Reply: ASCII text message of at most 128 characters that contains the client’s IP address. The message must not contain the NULL character.
CLIENTPORT Method
Request: CLIENTPORT
Action: Determine and return the port number used at the client as an ASCII text message. (This is the client’s port number, not the server’s port number.)
Reply: ASCII text message of at most 128 characters that contains the client’s port number. The message must not contain the NULL character.
COUNT Method
Request: COUNT SPACE {SPACE} text
Action: Count the number of characters in text and return as an ASCII text message. Leading spaces must not be included in the count.
Reply: ASCII text message of at most 128 characters that contains the number of characters in text. The message must not contain the NULL character.
ECHO Method
Request: ECHO SPACE {SPACE} text
Action: Return text , verbatim, to the client. Leading spaces should not be returned. (This method performs a function that is similar to that of an ECHO server.)
Reply: text (in ASCII)
CLIENTNAME Method (Optional Method)
Request: CLIENTNAME
Action: Lookup the host name of the client and return the name in an ASCII text message. If the client’s host name cannot be determined, return a message indicating that the host name cannot be determined.
Reply: ASCII text message of at most 128 characters that contains the client’s host name or that indicates that the host name cannot be determined. The message must not contain the NULL character.
DAYTIME Method (Optional Method)
Request: DAYTIME
Action: Determine the current date and time at the server and send to the client as a human readable ASCII text message of at most 128 characters. (This method performs a function that is similar to that of a DAYTIME server.)
Reply: ASCII text message of at most 128 characters that contains the date and time at the server. The message must not contain the NULL character.
REVERSE Method (Optional Method)
Request: REVERSE SPACE {SPACE} text
Action: Return text in reverse order to the client. Leading spaces should not be returned.
Reply: text (in ASCII).
The following provides an example of how clients and a server might operate. Note that neither the assignment nor the protocol specifies the design of the user interface. The user interface may differ in different client implementations. Client output is in plain font. User entries are in bold italics font. The server’s reply is in bold font.
Operation (CLIENTIP, CLIENTPORT, COUNT, ECHO)? CLIENTIP Reply: Client IP address is 128.173.52.
Operation (CLIENTIP, CLIENTPORT, COUNT, ECHO)? CLIENTPORT Reply: Client is using port 1564
Operation (CLIENTIP, CLIENTPORT, COUNT, ECHO)? COUNT Text? This is a test! Reply: Received text contained 15 characters
Operation (CLIENTIP, COUNT, ECHO)? ECHO Text? This is another test! Reply: This is another test!
Operation (CLIENTIP, COUNT, ECHO)? CLIENTNAME Reply: Client’s name is somehost.ece.vt.edu. (or Client name is unknown. )
Operation (CLIENTIP, COUNT, ECHO)? DAYTIME Reply: 9/10/2006 1:02:34 PM
Operation (CLIENTIP, COUNT, ECHO, REVERSE)? REVERSE Text? test! Reply: !tset
The following constraints apply to the implementation and testing of the client and server programs.
Project grades will be based on the following factors as documented in your report and exhibited by your program.
15 points Completeness and quality of project report. 75 points Correct operation of client and server programs. 10 points Implementation of optional features (see below).
The maximum grade that you can earn by implementing just the mandatory features is 90 points out of a maximum of 100 points. Up to 10 additional points can be earned by completing optional features, as
listed below. Your total grade for the project cannot exceed 100 points. To receive credit, optional features must be tested, work properly, and listed on the title page. Note that points for the optional features can be earned for both the UDP-BTP and TCP-BTP clients and servers. For example, if you implement the CLIENTNAME method for just TCP-BTP, you will earn a bonus of 2 points. If you implement the CLIENTNAME method for both TCP-BTP and UDP-BTP, you will earn a bonus of 4 points.
2 points Implement and test the CLIENTNAME method on both the client and server. 2 points Implement and test the DAYTIME method on both the client and the server. 2 points Implement and test the REVERSE method on both the client and the server. 2 points Implement logging to a file at the server, where entries should include the date, time, remote host, and transaction.
You must submit a project report, all source files that you create, and executable file as specified below.
The report should include the following items in the specified order. Note that mandatory page limits are given for some items. You may be penalized for excess verbiage.
o Test procedure used. Be sure to test all implemented functionality. o Screen shots and/or other evidence showing test results, including with your own and the “evil client.” o Summary of test results indicating which features work or do not work properly.
You must submit the report and all source files as a single zip^2 file using the Dropbox at the class Blackboard site. The zip file must be given a name of the following form: LAST _ FIRST _p1.zip where LAST is your last or family name and FIRST is your first or given name. For example, student Jane Doe would submit the file doe_jane_p1.zip. Make only one submission. Email, paper, and diskette submissions will not be accepted.
Files contained within the zip file should adhere to the following requirements.
You must work alone on this project. Teams are not allowed. You may not share your code with other students or borrow code from other students. You may not discuss your design or code with anyone except the instructor or the TA. You may not help other students in debugging their code nor have others
(^2) Zip software is available from several sources including http://www.winzip.com/. (^3) Anti-virus software is available to Virginia Tech students at no charge at http://antivirus.vt.edu/.