UNIVERSITY EXAMINATIONS: 2014/2015
ORDINARY EXAMINATION FOR THE BACHELOR OF SCIENCE
IN INFORMATION TECHNOLOGY
BIT 3105 NETWORK PROGRAMMING
DATE: DECEMBER, 2014 TIME: 2 HOURS
INSTRUCTIONS: Answer Question ONE and any other TWO
QUESTION ONE: 30 MARKS – COMPULSORY
(a) (i) What is sub-netting? [2 Marks]
(ii) Why is sub-netting important to network programming? [2 Marks]
(b) “Commitment to open and modular systems” and “Networking is fundamental to
the operation” are among the characteristics of Client/Server systems. Briefly
explain them. [4 Marks]
(c) Briefly explain “Integration”, “Performance” and “Scalability” as three of the
attributes of middleware. [6 Marks]
(d) What is the main difference between an IP datagram and UDP datagram?
[4Marks]
(e) One of the services provided by IP is routing. Briefly explain why this is
necessary. [2 Marks]
(f) Briefly explain the fact that Ethernet is a broadcast protocol. [2 Marks]
(g) Briefly discuss any four (4) factors that one needs to consider for the best
server design. [8
Marks]
QUESTION TWO – (TOTAL MARKS: 20)
(a) The network layer facilitates host-to-host transfer of packets while the transport
layer provides end-to-end transfer/communication. What is the difference
between “host-to-host” communication and “End-to-end” communication?
[4Marks]
(b) A middleware can be defined as software that converts the heterogeneous
environment that client and server application run to a homogeneous
environment. List and briefly discuss the type of heterogeneity that middleware
tries to resolve. [6 Marks]
(c)(i) What is the main difference between an Internet family socket address and the
UNIX family socket address? [2 Marks]
(ii) Give the socket structure for a UNIX family socket. [4 Marks]
(d) List and explain any two (2) protocols that are found on the Data Link layer.
[4Marks]
QUESTION THREE – 20 MARKS
(a) What is the difference between?
(i) Process and thread [2 Marks]
(ii) Port and Interface [2 Marks]
(iii) TCP and UDP [2 Marks]
(iv) ARP and RARP [2 Marks]
(v) RPC and RMI [2 Marks]
(b) Network APIs are tools or interfaces that are used for developing clients and
servers. Identify the Network APIs that are specific for clients and those that are
specific for servers. [4 Marks]
(c) What do the following system call functions do?
(i) Wait() [2 Marks]
(ii) fork() [2 Marks]
(iii) Waitpid() [2 Marks]
QUESTION FOUR – (TOTAL MARKS: 20)
(a) Study the lines of code presented below and answer the questions that follow:
a) sock=socket(AF_INET, SOCK_DGRAM, 0);
b) if (sock < 0)
c) error(“Opening socket”);
d) length = sizeof(server);
e) bzero(&server,length);
f) server.sin_family=AF_INET;
g) server.sin_addr.s_addr=INADDR_ANY;
h) server.sin_port=htons(atoi(argv[1]));
i) if (bind(sock,(struct sockaddr *)&server,length)<0)
j) error(“binding”);
k) fromlen = sizeof(struct sockaddr_in);
i). Explain what is the role of line 2? [2 Marks]
ii). What is the importance of line 6? [3 Marks]
iii).Explain the function of line 7. [3 Marks]
iv).What is the role of htons in line 8? [2 Marks]
v). Explain what sizeof in line 11 is used for. [2 Marks]
(b) Sockets have two special needs. Name these needs and briefly explain them.
[4Marks]
(c) Differentiate between a port and a socket. [4 Marks]
QUESTION FIVE – 20 MARKS
(a) Briefly discuss the basic operation of a concurrent server and its benefits.
[5Marks]
(b) Why does an association have five (5) entries instead of six (6)? [2 Marks]
(c) Three (3) things happen when a server accepts a connection request from a client.
List and explain them. [6 Marks]
(d)(i) RPC has five (5) elements. List these elements. [5 Marks]
(ii) When it comes to RPC, there are two (2) types of server management. Name
them. [2 Marks]