BIT 3105 NETWORK PROGRAMMING KCA Past Paper

UNIVERSITY EXAMINATIONS: 2012/2013
EXAMINATION FOR THE BACHELOR OF SCIENCE IN
INFORMATION TECHNOLOGY
BIT 3105 NETWORK PROGRAMMING
DATE: AUGUST, 2013 TIME: 2 HOURS
INSTRUCTIONS: Answer Question ONE and any other TWO Questions

QUESTION ONE
a) Define the following terms as used in network programming. (4 Marks)
i) Protocol
ii) socket
iii) port
iv) client
b) Compare and contrast the TCP and UDP modes of data transfer (8 Marks)
c) i) Explain the term socket programming (2 Marks)
ii) State the ordered steps for creating a simple UDP client program (4 Marks)
d) Study the sample program shown below and answer the questions that follow
import java.io.*;
public class Replicate {
public static void main(String args[]) throws IOException {
A File inputFile = new File(“examScores.txt”);
B File outputFile = new File(“analysis.txt”);
C FileReader in = new FileReader(inputFile);
D FileWriter out = new FileWriter(outputFile);
int c;
while ((c = in.read()) != -1) out.write(c);
in.close();
out.close();

i) Elaborate the purpose of each of the I/O file stream statements labeled A to D
(8 Marks)
ii) Describe the effect of the set of the statements labeled E. (4 Marks)
QUESTION TWO
a) Explain the term distributed architecture as used in network programming. (2 Marks)
b) i) Highlight FOUR Key Characteristics of distributed system (2 Marks)
ii) Describe FOUR key challenges involved in designing, implementing and
operating a distributed system. (4 Marks)
c) Differentiate among the following distributed systems programming tools. (6 Marks)
i) CORBA
ii) RPC
iii) RMI
d) With the aid of diagrams describe each of the following (6 Marks)
i) CORBA Architecture
ii) RPC operational mechanism
QUESTION THREE
a) Describe the role of each of the following methods implemented in the Socket and the
ServerSocket classes of Java (4 Marks)
i) Socket (String host, int portNumber)
ii) Inputstream getInputStream
iii)ServerSocket (int port)
iv) Socket accept()
b) Explain the following network security concepts (4 marks)
i) TCP security with SSL
ii) Buffer overflow
c) Explain the following Socket interfaces (6 marks)
i) Stream socket
ii) Datagram socket
iii) Raw socket
d) With the aid of diagram describe the two-way client-server communication
(6 Marks)
QUESTION FOUR
a) Define the following terms in the context of network programming (2 Marks)
i) Process
ii) thread
b) i) State the TWO ways by which a thread may be created using Java (2 Marks)
ii) With the aid of a diagram describe the entire lifecycle of a thread (6 Marks)
c) For each of the ways you stated in b (i) above write program that creates a new thread
and starts it running (10 Marks)
QUESTION FIVE
a) State three advantages of distributed systems (3 Marks)
b) Explain the concept of I/O streams on the bases of multiplexing (5 Marks)
c) Write both the serve side and client side programs to accomplish each of the
following tasks
i) Find and display the IP Address of the Local Host. (6 Marks)
ii) Allow a chat between the client-side user and the server-side user. (6 Marks)

(Visited 154 times, 1 visits today)
Share this:

Written by