UNIVERSITY EXAMINATIONS: 2012/2013
THIRD YEAR EXAMINATION FOR THE BACHELOR OF
SCIENCE IN INFORMATION TECHNOLOGY
BIT 3105 NETWORK PROGRAMMING
DATE: DECEMBER, 2012 TIME: 2 HOURS
INSTRUCTIONS: Answer Question ONE and any other TWO
QUESTION ONE
a) Distinguish between the following terms as used in client/server systems:
i. Datagram and Stream [2 Marks]
ii. Subnet and Subnet mask [2 Marks]
iii. RPC and RMI [2 Marks]
iv. Concurrent and Iterative servers [2 Marks]
b) What are the purposes of the ntohs(), htons(), nothl(), and htonl() functions in a
socket program? [4 Marks]
c) Every KCA University continuing academic student is required to register for
units using the Online registration system. Using this system as an example,
explain how the characteristics of a two-tier client/server implementation are
exhibited. [8 Marks]
d) Briefly explain at least two (2) differences between an Ethernet frame and IP
datagram. [4 Marks]
e) i. What is the difference between wait and waitpid functions? [4 Marks]
ii. What are the additional features available for waitpid comparing to wait?
[2 Marks]
QUESTION TWO
a) It has been said that flow control and congestion control are equivalent. Is this
true for the Internet’s connection-oriented service? Are the objectives of flow
control and congestion control the same? [4 Marks]
b) Why is it a good idea to close() each socket when you are done with it? [2 Marks]
c) List the order in which the following functions should likely be called in a TCP
server: accept(), bind(), close(), listen(), socket(), read(). [4 Marks]
d) When e-mail is sent to matende@kca.ac.ke, how does the e-mail come to arrive at
the mail server mail.kca.ac.ke, when it was not specified at all in the address of
the message? [8 Marks]
e) Explain the two reasons for TIME_WAIT. [2 Marks]
QUESTION THREE
a) Define three states of TCP Connection and Termination with a neat diagram.
[6 Marks]
b) What is sockaddr_ and how is it uniquely identified? [2 Marks]
c) Compare the implementation details of Concurrent Server and Iterative server.
[4 Marks]
d) What are the steps involved in transmission and reception of an ICMP message?
[4 Marks]
e) Define file descriptor. [2 Marks]
f) What are Byte Ordering Functions? [2 Marks]
QUESTION FOUR
a) Details of a business organisation are stored in two related database tables called
‘SUPPLIER’ and ‘PRODUCT’. The fields in the two tables are as shown below.
SUPPLIER: SupplierID, CompanyName, ContactPerson, Address, City (for the
supplier’s unique ID, company name, contact person, address and city
respectively).
PRODUCT: ProductID, ProdName, SupplierID, UnitPrice (for the unique product ID,
product name, supplier’s id and unit price of the product respectively).
Tables Relationships
Required:
Write SQL statements for doing the following:
i. To create the two related database tables. [4 Marks]
ii. To change the unit price of product ID ‘101’ to be ’75.25’ [2 Marks]
iii. To produce a listing of all products, by name, supplied by ‘Unilever (K) Ltd.’
[2 Marks]
iv. To delete a product whose ID is ‘235’ from the ‘PRODUCT’ table. [2 Marks]
b) List five (5) objectives of a communication protocol. [5 Marks]
c) List and explain the two (2) mechanisms that a middleware uses to facilitate
communication between client/server application. [4 Marks]
d) What is the main weakness of ICMP? [1 Mark]
QUESTION FIVE
a) What is the purpose of a zombie state? [2 Marks]
b) Give the generic structure of a socket address and briefly explain the parts of the
structure. [6 Marks]
c) What is the purpose of listen() of the TCP sockets? Explain. [4 Marks]
d) i. Briefly explain the purpose of buffers in a TCP connection. [2 Marks]
ii. List and explain the two (2) types of buffers that are in used in a TCP
connection. [6 Marks]
SupplierID
SUPPLIER PRODUCT