Professional Documents
Culture Documents
Question 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (3 marks)
1.1 Jeff is working on a new IP address structure. It should also be noted that Jeff is a rather eccentric
individual. Jeff has decided that his new IP address structure should contain 3 hexadecimal digits, 3
octal digits, and 9 binary digits. Does Jeffs new IP address structure allow for more or less unique
addresses than IPv4? Show your calculations (you may use power notions).
(2)
(1)
(1)
2.2 Explain the difference between the get and post methods and give emamples of where it could be used.
(2)
Page 1 of 4
(2)
2.4 Write the HTML markup needed to create the following table (excluding the boarders):
(4)
(3)
(2)
3.2 On which layer of the OSI reference model does the Socket protocol reside?
(1)
Page 2 of 4
(2)
3.4 Complete the following sentences by filling in the respective word in the table which follows.
a) The acronym TCP stands for [i] .
(2)
b) TCP is a [ii] -oriented protocol, while UDP is [iii] -oriented and makes use of [iv] communication.
(3)
[i]
[ii]
[iii]
[iv]
(1)
4.2 Consider the following pseudocode segment which shows the process followed by a server using TCP/IP
and sockets to implement a chat server.
s e r v e r S o c k e t i d = s o c k e t ( I n t e r n e t P r o t o c o l , SocketStream , TCP) ;
serverAddress = getServerAddress ( ) ;
bind ( s e r v e r S o c k e t i d , s e r v e r A d d r e s s + s e r v e r P o r t ) ;
listen ( serverSocket id );
ChatServer c s ( s e r v e r P o r t , s e r v e r S o c k e t i d ) ;
c s . serverRun ( ) ;
The method serverRun spawns a thread for each client which contacts and runs the global function
chatFunction on this thread.
a) For the server to be able to accept multiple clients, an infinite loop is required. In which function or
method would you define this infinite loop?
Page 3 of 4
(1)
(1)
c) What is the call, in C++, to spawn a thread from which further communication with the client will
be controlled?
(3)
d) What functions are used to send and receive messages on the server?
(2)
4.3 What protocol can be used by the client to access the server if a specific client program has not been
written?
(1)
4.4 Which part in the connection, the client or the server, must terminate the connection? And why?
(1)
Page 4 of 4