ECE 4564 Network Application Design - Project 1 Assignment: Client-Server Design, Study Guides, Projects, Research of Electrical and Electronics Engineering

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

Pre 2010

Uploaded on 12/06/2007

vthokiegrad
vthokiegrad 🇺🇸

17 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ECE 4564
Fall 2007
Project 1 Assignment Page 1 of 6
Virginia Tech
Bradley Department of Electrical and Computer Engineering
ECE 4564: Network Application Design
Fall 2007
Project 1: Client-Server Design
Due: October 2 (Midnight)
1. Introduction
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.
2. The Basic Test Protocol
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).
2.1. General Description
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.
2.2. Specification of Methods
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.
SPACE: A single ASCII space character.
text: A case-sensitive string of at most 64 ASCII characters. The NULL character is not allowed.
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.
pf3
pf4
pf5

Partial preview of the text

Download ECE 4564 Network Application Design - Project 1 Assignment: Client-Server Design and more Study Guides, Projects, Research Electrical and Electronics Engineering in PDF only on Docsity!

Virginia Tech Bradley Department of Electrical and Computer Engineering

ECE 4564: Network Application Design  Fall 2007

Project 1: Client-Server Design

Due: October 2 (Midnight)

1. Introduction

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.

2. The Basic Test Protocol

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).

2.1. General Description

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.

2.2. Specification of Methods

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.

  • SPACE: A single ASCII space character.
  • text : A case-sensitive string of at most 64 ASCII characters. The NULL character is not allowed.

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).

3.3. Examples

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

3.4. Implementation Constraints

The following constraints apply to the implementation and testing of the client and server programs.

  • Programs must be developed in C# using the Microsoft .NET Framework.
  • For client-server communication, your code can use classes as used in the posted code examples. Please ask permission before using other classes for client-server communication. You may use any classes or libraries available for text processing, user interface, and other functions not involving client-server communication.
  • All code must be clearly written, easily understandable by a knowledgeable reviewer, and neatly formatted. Code should be “self-documenting,” i.e., all information needed to understand the structure and operation of your code and data structures should be contained with the code itself.
  • You may test your programs on a single stand-alone host using “localhost” as the server address and “127.0.0.1” as the IP address. If at all possible, test your programs across a network with client and server executing on different hosts.

4. Grading

4.1. Grade Distribution

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).

4.2. Optional Add-Ons for Full Credit

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.

5. Submission Requirements

You must submit a project report, all source files that you create, and executable file as specified below.

5.1. Report Requirements

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.

  • Cover page with name of project (Project 1), date, number and name of this class, your name, your student ID number, CRN number for your section, your lecture location (i.e., “Whitt 277” or “Smyth 331”), tool(s) and version(s) used for development, operating system(s) and version(s) used for testing, and list of implemented options (1 page).
  • Testing results, including the following (3 pages maximum).

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.

5.2. Submission Logistics

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.

  • The report can be either a Microsoft Word or an Adobe Acrobat PDF file. The report file should be named using the same scheme as the zip file, i.e., the report file should be named either LAST_FIRST_p1.doc or LAST_FIRST_p1.pdf.
  • Submit all source files and the final executable file for your program. The source files are the *.cs files. The executable is a *.exe file. Do not submit other intermediate or supporting files that may be in your project.
  • All files must be virus-free. Files that contain a virus as detected by the latest version of Symantec Antivirus^3 will not be graded.

6. Honor Code

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/.