FACULTY OF SCIENCE
ACADEMY OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING
MODULE CSC2B10
COMPUTER SCIENCE 2B
CAMPUS AUCKLAND PARK CAMPUS (APK)
MAIN EXAM
DATE: 2020-11-30 SESSION: 14:00 - 16:00
ASSESOR(S): MR. T MOODLEY
MS. M FOURIE
MODERATOR: MR J.L. DU TOIT
DURATION: 120 MINUTES MARKS: 100
Please read the following instructions carefully:
1. Answer all the questions
2. Write clearly and legibly.
3. You may use a non-programmable calculator to answer the questions.
4. This paper consists of 6 pages.
Start of instructions
• You have 120 minutes to complete the assessment. Once the 120 minutes have
elapsed, you will be given an additional 30 minutes to upload. The upload time is
explicitly for that, failure to upload in time may result in the student failing the
subsequent assessment.
• FOR LATE SUBMISSIONS – AFTER THE SUBMISSION TIME CLOSES YOU HAVE 30
MINUTES TO UPLOAD UNDER THE LATE_EXAM SLOT. NOTE: IF YOU UPLOAD
UNDER THE LATE_EXAM SLOT, YOU WILL BE PENALIZED.
• ONCE THE LATE_EXAM UPLOAD HAS ELAPSED, NO FURTHER SUBMISSIONS
WILL BE ACCEPTED.
• Note: if you do not show your working out for any questions that require it, you will
receive zero.
• Please read through the following instructions and be sure to follow them carefully to
prevent any problems as failure to submit correctly can result in students failing the
assessment.
• Please name your ASSESSMENT using the following format
SN_INITIALS_SURNAME_CSC2B_EXAM where SN represents your student number. For
example, student 201900001 will name their project as 201900001_B_JAMES_
CSC2B_EXAM.
• The assessment, if done with multiple files, must be saved under a single folder
where it is easily accessible for submission. Failure to do so may result in the
student failing the assessment. If you are unable to do so, please contact the
lecturers via the discord channel or email.
• The assessment may be typed-out or handwritten, depending on the device and
software you have access to.
• Mr Moodley and Ms Fourie will be available at the following Discord server:
https://discord.gg/JWwxbFe for the duration of the test. Please do not hesitate to ask
either of them for help if you do not understand these instructions or questions.
o When joining the discord server, please set your name/nickname as your student
number, or else you will be kicked out from the server.
o You do not need to join the Discord server if you do not wish to, you can email us
as well if you have questions.
1
• It is up to you to keep track of the time. The buffer time is meant for upload and download
ONLY, and it is not extended writing time. STRICT SUBMISSIONS TIME WILL BE
KEPT, YOU HAVE A RESPONSIBILITY TO USE THE 30 MINUTES TO UPLOAD, WE
WILL NOT EXTEND UPLOAD TIME.
• You only need Internet access to download the test and then to upload your final
submission. You do not need to be connected for the duration of the test.
• If you wish to handwrite any section, please see the links for the tools and tutorials that will
help in the conversion of the handwritten documents to PDF for submission.
o CamScanner
o Students who wish to upload a handwritten submission, please comment
clearly on what each section is attempting to answer. The following links can
assist you in completing your pen and paper submission. Please upload each
page, which is clearly labelled, so we can see the order of your answers.
o With handwritten work, keep the document as neat and readable as possible.
o CamScanner App
1. Android
2. IOS
o Video Guide for uploading CamScanner images to Eve
o CamScanner Premium for Free
• All students need to complete the Honesty Declaration submission. This can be
downloaded 30 minutes before the assessment and completed up until 30 minutes
after the assessment. If you cannot sign the document, it is fine, as we will take the
submission of the documents as the agreement of the rules and regulations outlined.
However, you must complete the following details on the form:
1. Assessment name
2. Full name
3. Student number
4. Date
5. Signature (optional, if you can please do sign the document)
o Honesty Declaration can be found under practicals on EVE.
o The honesty declaration must be uploaded to EVE under practical
assignments using the “honesty declaration submission link” on the day of
the assessment.
2
• Primary submission of the assessment
o ALL DOCUMENTS MUST BE SUBMITTED AS A PDF, unless you are unable
to, in this event, please contact your lectures.
o You will submit YOUR submission to eve as you normally would for a Practical.
o If you have multiple files that you would like to submit, please ensure you place it
a single folder, zip that folder and then submit. If you have one document, you may
submit that document as is.
o An example of how your submission should look.
• Backup submission – This must be done please
o Once you have submitted the assessment to EVE, you will use the following and
submit a backup version to a Google Form, click the following link:
https://forms.gle/SuBXEDaAPGBDJvz76
o To access the Google Form, you must use your student email account, which
is the
[email protected] email address that makes use of your
ULink password.
o If you are using a browser that remembers your Gmail account, open an
incognito version of the browser, then copy and paste this link in the
incognito browser https://forms.gle/SuBXEDaAPGBDJvz76
End of instructions
3
Computer Science 2B MAIN EXAM 2020-11-30
QUESTION 1
(a) From a service perspective, describe the internet along with an example? [02]
(b) Briefly describe how FDM works. [03]
Total: 5
QUESTION 2
Assume there is a copper network with 8 nodes (N0, N1, N2, N3, N4, N5, N6 and N7)
and the transmission rates between these nodes are as follows:
1Mbps
N4 N6
4Mbps
N2
8Mbps
16Mbps
2Mbps
N3 N5
N1 32Mbps
4Mbps
N0 N7
It is also determined that the distances between the nodes are as follows: (Note that all
working out must be shown, failure to do this may result in the student receiving zero for
the question)
• N0-N1: 10km • N2-N3: 15km • N4-N6: 10km • N5-N7: 30km
• N1-N2: 20km • N2-N4: 5km • N3-N5: 25km
Answer the following questions (Do not round off):
(a) Determine the approximate transmission rate when communicating between N0 [1]
and N7.
(b) Taking this approximate transmission rate into account, how long (in seconds) [02]
will it take to transfer a 100 MegaByte file from node N0 to N7?
Page 1 of 6
Computer Science 2B MAIN EXAM 2020-11-30
(c) If it is determined that the copper installed in this network propagates a signal at [03]
a speed of 250 000 km/s. Calculate the propagation delay for communications
between N0 to N7.
(d) Assuming that there is no nodal processing delay or queueing delay, calculate the [04]
total time taken to transfer a 50 MegaByte file from from N0 to N7?
Total: 10
QUESTION 3
(a) Within computer networks, we often have complex systems, briefly describe two [02]
mechanisms that deal with the complexity?
(b) With aid of a diagram, briefly describe throughput and its relation to bottleneck. [03]
Total: 5
QUESTION 4
(a) Within the application layer, there are different architectures, list and provide a short [04]
description of two architectures within the application layer.
(b) What is the role of a socket? [01]
Total: 5
QUESTION 5
(a) Name and briefly describe the two ways multiplexing can be achieved at the trans- [04]
port layer.
(b) Name three (3) mechanisms in the transport layer that help facilitate reliability and [06]
provide a reason for why they are needed.
Total: 10
QUESTION 6
The table below represents the payload of a UDP segment. Calculate the sum of the
following two 16-bit integers, along with their associated 1s complement checksum:
Note that all working out must be shown, failure to do this may result in the
student receiving zero for the question
Number 1 1 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1
Number 2 1 0 0 1 0 0 0 0 1 1 1 1 0 1 0 0
Total: 5
QUESTION 7
(a) Discuss the network layer functions of forwarding and routing. Your discussion [06]
should include an explanation of what happens at the network level to facilitate
these functions. Make use of a diagram to support your answer.
Page 2 of 6
Computer Science 2B MAIN EXAM 2020-11-30
(b) Discuss what DHCP is and how it works by referring to a client-server scenario. [04]
Total: 10
QUESTION 8
Given the following IP address and CIDR, answer the questions that follow (Note that all
working out must be shown, failure to do this may result in the student receiving zero for the
question):
172.51.37.39/27
(a) Provide this address in binary notation. [02]
(b) How many hosts can this network accommodate? [02]
(c) Assuming classful addressing was used, what class does this address belong to? [02]
(d) Calculate the network address of this block in dotted decimal notation. [02]
(e) Calculate the broadcast address of this block in dotted decimal notation. [02]
Total: 10
QUESTION 9
Given the below network routing graph (with costs), answer the following questions
that follow (Note that all working out must be shown, failure to do this may result in the
student receiving zero for the question):
N1 N4
6 6
7
N5 N2 3
2 2
4
N3 N6
(a) What is the path with the least cost when communicating between N4 and N5. Is [02]
this the only cost effective path?
(b) Given the local datagram forwarding table for node N2 below and the destination [03]
address is 196.83.37.91, which link will this packet be forwarded to? Please ensure
to show all your calculations.
Destination Address range Output Link Interface
11000100 01010011 00100101 01011*** N1
11000100 01010011 00100101 010110** N3
11000100 01010011 00100101 010111** N4
Otherwise N6
Total: 5
Page 3 of 6
Computer Science 2B MAIN EXAM 2020-11-30
QUESTION 10
(a) Within the context of the data link layer, describe how random access MAC proto- [05]
cols work. Under which network circumstances are random access MAC protocols
efficient? Give a reason for your answer.
(b) Discuss what PPP is and what it is typically used for. [05]
Total: 10
QUESTION 11
(a) You have been approached by the South African government to create an Android [03]
mobile application which will handle confidential information. Which two security
best-practice principles would be your main focus in the creation of the app? Give a
reason for your answer.
(b) Briefly discuss how the Ping command works. [02]
Total: 5
QUESTION 12
Provide Java source code for a UDP Client that sends a message (entered by the user)
to a UDP server that runs on port 9494. The client should receive the server response
and print it out to the user.
Total: 10
QUESTION 13
The code below illustrates a TCP server that handles client requests including the return
of a specified png file. Fill in the missing code for sections A to G. Clearly label your
answers.
1 public class TCPHandler implements Runnable {
2 private Socket connectionToClient ;
3 private BufferedReader txtin ;
4 private PrintWriter txtout ;
5 public TCPHandler ( Socket newConnectionToClient ) {
6 try {
7 connectionToClient = newConnectionToClient ;
8 InputStream is = __( A (1 marks ) )__; // Setup text in stream
9 txtin = new BufferedReader (new InputStreamReader (is));
10 // Setup text out stream
11 txtout = new PrintWriter (/* Omitted */);
12 }
13 catch ( IOException ex) { ex. printStackTrace (); }
14 }
15 public void run () {
16 boolean processing = true;
17 try {
18 while ( processing ) {
19 String message = __( B (1 marks ) )__; // Get client message
20 StringTokenizer msgTokens = new StringTokenizer ( message );
21 String command = msgTokens . nextToken (). toUpperCase ();
Page 4 of 6
Computer Science 2B MAIN EXAM 2020-11-30
22 switch ( command ) {
23 case " GREETING ": {
24 String name = __( C (1 marks ) )__;
25 sendResponse ("HI " + name);
26 break ;
27 }
28 case " GETFILE ": {
29 String fileID = msgTokens . nextToken ();
30 String fileName = fileID +".png";
31 File fileToReturn = new File("data/ server /"+ fileName );
32 if( fileToReturn . exists ())
33 {
34 txtout . println (__( D (1 marks ) )__);// send the file
size to the client
35 txtout . flush ();
36
37 FileInputStream fis = new FileInputStream ( fileToReturn )
;
38 byte [] buffer = new byte [1024];
39 int n= 0;
40 while (__( E (2 marks ) )__)
41 {
42 __( F (2 marks ) )__
43 dos. flush ();
44 }
45 fis.close ();
46 System .out. println ("File sent to client ");
47 }
48 break ;
49 }
50 case " PARTING ": {
51 processing = false ;
52 sendResponse ("BYE");
53 break ;
54 }
55 default : {
56 sendResponse ("ERROR ");
57 }
58 }
59 }
60 }
61 catch ( IOException ex) { ex. printStackTrace (); }
62 finally { // Cleanup
63 try {
64 __( G (2 marks ) )__
65 }
66 catch ( IOException ex) { ex. printStackTrace (); }
67 }
68 }
69 private void sendResponse ( String response ) {
70 txtout . println ( response );
71 txtout . flush ();
72 }
73 }
Total: 10
Page 5 of 6
Computer Science 2B MAIN EXAM 2020-11-30
The End!
Page 6 of 6