首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
代做CNCO3002、c/c++编程语言代写
项目预算:
开发周期:
发布时间:
要求地区:
Advanced Computer Communications (CNCO3002) Page 1 of 5 2nd Semester 2023
CRICOS Number: 00301
Advanced Computer Communications (CNCO3002)
CURTIN UNIVERSITY
School of Electrical Engineering, Computing and Mathematical Sciences
Discipline of Computing
Assignment
Simple Function Call
Due Date: 4pm (local time) on Monday 9th of October 2023
The objective of this network programming assignment is to develop two complementary programs, a
client and a server, which implement a simple application program, called Simple Function Call (SFC).
A. Requirements
The SFC server (server) has a set of functions that can be used by one or more SFC clients (client). As
shown in Figure 1, each client and the server are connected by two parallel TCP connections: requestline and reply-line. The client uses request-line to send a function name together with its necessary
parameters to the server. The server uses reply-line to transfer the result of executing the function. For
each request, each client stores every request and its reply in a file called log_file.
For request-line, the server listens (passive mode) on a port L. A client initiates request-line (active
mode) to the server on port L. On the other hand, for reply-line, the server uses port L+1 in active
mode, and the client is in a passive mode on port U. The client sends to the server its port number U
via request-line so that the server can initiate reply-line to the port. The reply-line is closed by the
server when the request-line is closed.
Figure 1: Connection between SFC server and its clients
Details of assignment requirement are as follows.
1. Write a TCP concurrent server program (server) that is waiting for some clients at its port L. Use
one of your assigned port numbers, e.g., L = 52000.
2. For each connection from a client C, the server creates a child thread S that will serve the client
C. You can create a new thread or use one available from a pool of threads that you have created
when you started your server (discussed in lecture). The child server S is waiting to receive client
C’s port number U. Use one of your assigned port numbers, e.g., U = 52002. Receiving U, child
SFC
Client
SFC
Server
Request Line
Reply Line
Port L
Port U Port L+1
An ephemeral Port
Advanced Computer Communications (CNCO3002) Page 2 of 5 2nd Semester 2023
CRICOS Number: 00301
server S initiates a reply-line at port number L+1, e.g., L+1 = 52001 to port U of the client. At
this stage, client C and server S are connected via request-line and reply-line.
3. Each child server S is waiting for its client C’s valid commands/functions/requests at request-line
and provides a service according to the request. For each valid request, server S sends the request’s
result to client C. Otherwise, server S sends an error message to client C. Server S sends the reply
or error message via reply-line.
The followings are the details of valid requests / commands from a client C to a server S. Notice
that for simplicity, each command does not contain any space.
• ADD(x,y)
When a user enters the command, client C sends it to server S, stores the request in log_file,
and waits to receive its result from server S. Receiving the command, server S sends the result
of x+y to client C. For example, receiving ADD(2,3), server S will send the result of 2+3, i.e.,
5 to client C. Receiving the result, client C shows the result on the screen, and also stores it
in log_file.
• MUL(x,y)
When a user enters the command, client C sends it to server S, stores the request in log_file,
and waits to receive its result from server S. Receiving the command, server S sends the result
of x*y to client C. For example, receiving MUL(2,3), server S will send the result of 2*3, i.e.,
6 to client C. Receiving the result, client C shows the result on the screen, and also stores it
in log_file.
• DIV(x,y)
When a user enters the command, client C sends it to server S, stores the request in log_file,
and waits to receive its result from server S. Receiving the command, server S sends the result
of x DIV y to client C. For example, receiving DIV(5,2), server S will send the result of 5
DIV 2, i.e., 2 to client C. Receiving the result, client C shows the result on the screen, and
also stores it in log_file.
• MOD(x,y)
When a user enters the command, client C sends it to server S, stores the request in log_file,
and waits to receive its result from server S. Receiving the command, server S sends the result
of x MOD y to client C. For example, receiving MOD(5,2), server S will send the result of 5
MOD 2, i.e., 1 to client C. Receiving the result, client C shows the result on the screen, and
also stores it in log_file.
• INFO
When a user enters the command, client C sends it to server S, stores the request in log_file,
and waits to receive its result from server S. Receiving the command, server S sends the list
of available functions, i.e., ADD(x,y), MUL(x,y), DIV(x,y), MOD (x,y), INFO, and QUIT
together with a short explanation of how to use each of them. The list of available functions
and their information is stored in a file, called info in server. Specifically, receiving request
Advanced Computer Communications (CNCO3002) Page 3 of 5 2nd Semester 2023
CRICOS Number: 00301
INFO, server S sends the content of file info to client C. Please create file info yourself.
Receiving the result, client C shows the result on the screen, and also stores it in log_file.
• QUIT
This command is used by client C to tell server S that it is terminating the SFC session with
server S. When a user enters the command, client C sends it to server S, stores the request in
log_file, and waits to receive its result from server S. Receiving the command, server S sends
a ‘goodbye’ message (e.g., Thank you for using SFC. Goodbye!) and terminates reply-line.
Receiving the message, client C shows it on its screen and terminates connection.
4. The concurrent server is able to accept up to max_client simultaneous clients. If a child server S
does not receive any command (from its client C) within a max_time, the child server S sends a
‘goodbye’ message, closes both request-line and reply-line and terminates. The max_client, and
max_time must be arguments passed to the SFC server when the server is started. The valid
numbers for these arguments are:
• max_client: 1 to 10.
• max_time: 1 to 120 seconds.
5. Write a TCP client program (client) with the following details.
a) The client connects to the server that is waiting at port L.
client Server_IP_address port
or
client Server_machine_name port
Note, Server_IP_address is the SFC server’s address (in dotted decimal notation).
Once the SFC client is connected to the SFC server, the SFC client waits for user command,
and a prompt “Client>” should be shown on the screen.
b) Once connected to the server, i.e., request-line is on, the client creates a passive socket at port
U, and sends the port U to the server, also via request-line. Receiving port U information, the
server connects to the client’s port U. At this stage, the reply-line is established.
c) Each time the client sends a request (e.g., ADD(2,3)) to the server, the client logs the request
in a file, named log_file, and later also writes the reply it receives from the server to the file.
For example, the following information would be stored in the log_file:
ADD(2,3); the result is: 5
d) Each valid command (including its parameter) should be shown on the client’s screen and be
forwarded to the server. Notice that both the client and the server should check for the validity
of each command.
e) Each received result should be shown on the client’s screen.
Advanced Computer Communications (CNCO3002) Page 4 of 5 2nd Semester 2023
CRICOS Number: 00301
6. Your program must be written in ‘C’ using TCP/IPv4 sockets and must run on a computer in any
lab in our discipline, e.g., Lab 219.
7. Make sure to check for error return from each system call, and to close every socket created.
8. You MAY make your own assumptions/requirements other than those already given. However,
YOU HAVE TO DOCUMENT ANY ADDITIONAL ASSUMPTIONS/LIMITATIONS FOR
YOUR IMPLEMENTATIONS.
B. Instruction for submission
1. Assignment submission is compulsory. Late submission is allowed. As stated in the unit outline,
the penalty for late submission is as follows:
• For assessment items submitted within the first 24 hours after the due date/time, students will
be penalised by a deduction of 5% of the total marks allocated for the assessment task;
• For each additional 24 hour period commenced an additional penalty of 10% of the total marks
allocated for the assessment item will be deducted; and
• Assessment items submitted more than 168 hours late (7 calendar days) will receive a mark of
zero.
Due dates and other arrangements may only be altered with the consent of the majority of
the students enrolled in the unit and with the consent of the lecturer.
2. You must
(i) put your program files, e.g., server.c, client.c, makefiles, and other required files, in your
home directory named CNCO3002/Assignment. Note that these files will be used when
marking your assignment during program demonstration.
(ii) submit a soft copy of your assignment to the unit Blackboard (in one zip file), i.e.,
YourID_Assignment.zip. The soft copy includes your assignment report and all your
assignment code in (i). Note that the assignment code submitted to Blackboard serves as a
backup copy.
3. The assignment report MUST include:
• A signed cover page (i.e., declaration of originality). The declaration form is available from the
unit Blackboard. By signing the form, among others, you agree on the following two statements:
1. The work I am submitting is entirely my own, except where clearly indicated otherwise and
correctly referenced.
2. Even with correct referencing, my submission will only be marked according to what I have
done myself, specifically for this assessment. I cannot re-use the work of others, or my own
previously submitted work, in order to fulfil the assessment requirements.
• A printout of your assignment code that MUST include (i) all source code for the programs
with proper in-line and header documentation. Use proper indentation so that your code can be
Advanced Computer Communications (CNCO3002) Page 5 of 5 2nd Semester 2023
CRICOS Number: 00301
easily read. Make sure that you use meaningful variable names and delete all unnecessary /
commented code that you created while debugging your program; and (ii) readme file that,
among others, explains how to compile your program and how to run the program.
• Detailed discussion on all shared data structures used in the server, and how any mutual exclusion
/ thread synchronization is achieved on shared resources, e.g., memory, server’s record, and what
threads access the shared resources.
• Description of any cases for which your program is not working correctly or how you test your
program that make you believe it works perfectly.
• Sample inputs and outputs from running your programs. For each sample output, you MUST
explain if the output is correct or incorrect.
Your report will be assessed (worth 20% of the overall mark for the Assignment)
4. Assignment demonstration
• You may be required to demonstrate your program. The time schedule for the demonstration
will be announced later.
• For the program demo, you MUST keep the source code of your programs in your home
directory, and the source code MUST be that you have submitted.
• The programs must run on any computer in the department labs.
Failure to meet these requirements may result in the assignment not being marked.
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
urba6006代写、java/c++编程语...
2024-12-26
代做program、代写python编程语...
2024-12-26
代写dts207tc、sql编程语言代做
2024-12-25
cs209a代做、java程序设计代写
2024-12-25
cs305程序代做、代写python程序...
2024-12-25
代写csc1001、代做python设计程...
2024-12-24
代写practice test preparatio...
2024-12-24
代写bre2031 – environmental...
2024-12-24
代写ece5550: applied kalman ...
2024-12-24
代做conmgnt 7049 – measurem...
2024-12-24
代写ece3700j introduction to...
2024-12-24
代做adad9311 designing the e...
2024-12-24
代做comp5618 - applied cyber...
2024-12-24
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!