ENN523 Advanced Network Engineering
Assignment Part 1: TCP/IP Communications via Socket Programming
Version 3.0 on 1 April 2020
Distribution Date: Thursday 12/03/20 (Week 3). Due Date: 11:59pm Monday 20/04/20 (Week 7)
Submit your assignment via QUT’s Blackboard
Changes to v2.0 dated on 19 March 2020:
• The due date of the assignment is extended to 11:59pm Monday 20 April 2020 in accordance
with the change of the university’s academic calendar due to the COVID-19 outbreak.
Changes to v1.0 dated on 12 March 2020:
1) The group assignment can also be attempted individually as described in the 1st paragraph of
the main text; and
2) The marking guide is modified accordingly with the assessment item for group work being
removed.
1. Introduction
This assignment of TCP/IP communications is a group-of-two-or-three assignment worth 15%.
With the consideration of the university’s pause of physical classes on campus next week as well as
the uncertainty of the following weeks due to COVID-19, individual attempt is also allowed. The
assignment project will require Socket Programming, which is the topic of Week02 Lecture and
Week03 Tutorial.
Organisation of this document:
Sections 1 through 3 introduce some background information relevant to this assignment. The
assignment tasks are described in Section 4. Section 5 highlights what and where you need to hand
in your assignment. The marking scheme of the assignment is enclosed in Section 6.
This assignment relates to the following unit outcomes described in the unit outline:
2. Skills to undertake planning and design of computer networks to satisfy a set of requirements
specifications with particular emphases on connectivity, scalability, reliability, security and
QoS; and
4. Advanced collaborative and communication skills through a group project and formal technical
report.
The criteria and performance standards used in this assessment are described in a table at the end of
this document. Use the table as a marking guide.
You are asked to self-assess your assignment (in the enclosed marking guide table) and reflect on
what you have achieved so far from study of this unit. This gives you the opportunity to reflect on
what you have learned from this assignment and also what you need to improve.
• For self-assessment, submit a separate file of your self-assessed assessment sheet together
with your assignment report. The self-assessment sheet is the table at the end of this document.
• For reflections, writes a separate section of Reflections in your assignment report. Each of
your group members writes a separate paragraph of your reflections specific to yourself.
Key technical aspects addressed in this assignment include: TCP/IP communications, socket
programming, timing control, and round trip delay. No-technical aspects of the assignment include:
team work, report and communication, and reflections.
2. Background: Dealing with Time
There are basically three types of methods to deal with time in C programming:
(1) Use some well-developed timing control APIs. For example, in Windows, a few functions are
implemented in windows library (header file: windows.h); and QueryPerformanceCounter()
2
can be used for high-resolution timing control. This is the method we have used in our
examples, and is recommended to you for this assignment.
(2) Using the standard time library. The standard time library provides a number of functions for
time operations, e.g., time(), localtime(), etc. Find a book or search the Internet to learn how
to use this time library.
(3) Using hardware timer interrupt, which is the highest hardware interrupt. In this assignment,
you are not required to use this method.
For Linux users, sys/time.h declares a few time functions for high-resolution timing control, e.g.,
gettimeofday().
If anyone is interested in good timing control and clock synchronization over networks, our recent
research paper on this topic will give you some ideas: http://eprints.qut.edu.au/73370/. The paper is
published in Journal of Network and Computer Applications, vol. 44, pp. 63-71, 2014.
3. Background: Socket Programming
What is a “network socket”? A socket is a way to talk to other programs using the standard (Unix)
file descriptors (Everything is treated as a file in Unix). A file descriptor is simply an integer
associated with an open file; and the file can be a network connection!
Where to get this file descriptor for network communication? Call the socket() system routine. Then,
send() and recv() and other socket calls can be used to talk to other computers. In this assignment, we
deal with TCP socket only although other sockets are also available, e.g., UDP.
For a basic yet still comprehensive description on socket programming in C, refer to Beej’s guide to
Network Programming using Internet Socket (http://beej.us/guide/bgnet/). The guide is for unix/linux
programming; however it also has a section for Windows programmers.
4. Assignment Tasks
You are asked to develop a Server program running on one computer, and a Client program running
on another computer. (When you test your server and client programs on one computer, you may use
Loopback IP Address 127.0.0.1, with which any packets sent out from this machine will immediately
loop back to itself.)
The Server will accept input from keyboard for system initialization, selection of menu items, human
command and instructions, etc. It will also display information on the monitor, periodically send
commands to the Client, and receive feedback from the Client. After receiving a command from the
Server, the Client will send feedback to the Server, and displays some information of your interest.
The structure of the client-server system is shown below in Figure 1.
Figure 1: A client-server system including a server and a client.
Assignment tasks are described below:
1) When the Server is started, it initializes the settings of the server’s IP addresses, port number,
and the client’s IP address, etc., through command window arguments, e.g., header file,
arguments to main(), keyboard input, or input from a configuration file which is a pure text
file.
2) Every 3 seconds, the Server sends the Client a command to ask for data, e.g., through a single
letter “R” or “r” (request). (Timing control is required here. Using our examples in the lecture
3
materials if you like.)
3) After receiving the command from the Server, the Client sends back to the Server an ACK
consisting of: (a) the client’s time in the form of hh:mm:ss:ddd (where “d” means a digit, for
example 18:03:54:793), and (b) a random integer number between 0 and 1000 with a uniform
distribution. The Client may also display some useful information on its monitor. (Use a
random generator to generate such random numbers. For example, you use rand()%1001.
For rand(), srand(time(NULL)) will give a seed, where time() function is defined in header
file time.h).
4) The Server gets the random integer and ACK from the Client, and calculates the round trip
delay from its communications with the Client, and displays the result on its monitor.
5) The Server reads keyboard input of various command and instructions. An obvious command
is to terminate the Server program, e.g., using a single letter “E” or “e” (exit). When the Sever
is to be terminated, the Server should also notify the Client of the Server’s termination so
that the Client also terminates properly. When the Client receives the single letter “E” or “e”
(exit) from the Server, the Client sends back to the Server a command using a single letter
“O” or “o” (OK). After that, both Client and Server will be terminated.
How to test your programs:
(1) At early stages of your program development, you may test your programs on a single
computer. Execute the Server program in one command window, and execute the Client
program in another command window. Both the Server and Client share the same IP address,
e.g., the Loopback IP address 127.0.0.1.
(2) If you test your programs in computer labs, you may execute the Server and Client programs
on two different computers, which have different IP addresses.
5. Where and What to Hand in
Submit your assignment via QUT’s Blackboard. Your submission is a SINGLE zipped file of the
following items:
1) A file of your assignment report on your design/solutions/discussions and other aspects that
you feel relevant. We will discuss in class what the report should look like.
a. The report should start with a cover page, followed by an Executive Summary of no more
than 1 page, and Table of Contents. Then, the report has the main body text, and references
if any.
b. The body text could be organized with the following components: background of the
project (e.g, main requirements and functions, etc), system design and logic flows at a high
level (which is independent of any programming languages), implementation of the main
components of the system (but not line-by-line code), test plan and testing results,
reflections, conclusion, and references if any. The report should be less than 20 A4 pages
for the body text. Additional materials that you feel important could be organized in an
appendix. Note that do NOT include your code in the report.
c. The report is expected to have a section of Reflections to discuss what you have learned
from this unit or this assignment, what you feel is beneficial to you, and what aspects you
think you need to improve. For reflections, each of your group members is expected to
write a separate paragraph; and an additional paragraph for the group is optional. Be
specific about yourself and the unit/module/assessment, NOT be general about others.
2) Your self-assessed assessment sheet in a separate file; and
3) Your c/c++ source files, header file/s, and data file if any. Do NOT submit any project files.
6. Marking Guide
Criteria Referenced Assessment (CRA) marking guide is enclosed, which is also used as a selfassessment
sheet.
4
ENN523 Advanced Network Engineering: TCP/IP Communication Assignment, Semester 1 2020. Marking Guide and Self-Assessment Sheet
Student1 Name: Student1 No.:
Student2 Name: Student2 No.:
Student3 Name: Student3 No.:
Your self-assessment Marker’s assessment
8 Server and Client
functional with keyboard
input to the Server, use
configuration file to
assist in initiation
Server and Client
functional with keyboard
input to the Server, make
use of keyboard input in
initialization
Server and Client
functional with
keyboard input to the
Server, all hard coded
initialization
Server and Client
mostly functional
with keyboard
input to the Server
Server or Client not
functional
G1= G1*0.08= Lg1= Lg1*0.08=
B. Report
and
assignment
submission
6 All required files
provided;
Report professionally
organised and presented
All required files
provided;
Report well organised
and presented
All required files
provided;
Report well organized
and readable
All required files
provided;
Readable report
Not all required
files provided;
Poorly organised
and presented report
G2= G2*0.06= Lg2= Lg2*0.06=
C. Group
work (Not
Assessed)
0 N/A N/A N/A N/A N/A N/A N/A N/A N/A
D. Selfassessment
1 Self-assessed, and well
written reflections
N/A N/A Self-assessed but
assessment not
reasonably done,
simple reflections
No self-assessed, no
reflections
G4= G4*0.01= Lg4= Lg4*0.01=
Total 15 Overall Overall
版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。