itt440 network programming exam paper

3
CONFIDENTIAL CS/APR2010/ITT440 UNIVERSITI TEKNOLOGI MARA FINAL EXAMINATION COURSE COURSE CODE EXAMINATION TIME NETWORK PROGRAMMING ITT440 APRIL 2010 3 HOURS INSTRUCTIONS TO CANDIDATES 1. This question paper consists of three (3) questions. Answer ALL questions in the Answer Booklet. Start each answer on a new page. 2. 3. 4. Do not bring any material into the examination room unless permission is given by the invigilator. Please check to make sure that this examination pack consists of: i) the Question Paper ii) an Answer Booklet - provided by the Faculty DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO DO SO This examination paper consists of 3 printed pages © Hak Cipta Universiti Teknologi MARA CONFIDENTIAL

Upload: calvin-pius-ohsey

Post on 28-Apr-2015

128 views

Category:

Documents


3 download

DESCRIPTION

Exam Paper

TRANSCRIPT

Page 1: ITT440 Network Programming Exam Paper

CONFIDENTIAL CS/APR2010/ITT440

UNIVERSITI TEKNOLOGI MARA FINAL EXAMINATION

COURSE

COURSE CODE

EXAMINATION

TIME

NETWORK PROGRAMMING

ITT440

APRIL 2010

3 HOURS

INSTRUCTIONS TO CANDIDATES

1. This question paper consists of three (3) questions.

Answer ALL questions in the Answer Booklet. Start each answer on a new page. 2.

3.

4.

Do not bring any material into the examination room unless permission is given by the invigilator.

Please check to make sure that this examination pack consists of:

i) the Question Paper ii) an Answer Booklet - provided by the Faculty

DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO DO SO

This examination paper consists of 3 printed pages © Hak Cipta Universiti Teknologi MARA CONFIDENTIAL

Page 2: ITT440 Network Programming Exam Paper

CONFIDENTIAL 2 CS/APR2010/ITT440

Answer ALL Questions.

QUESTION 1

a) Briefly explain how does Operating System (OS) such as Unix and Linux create a new process.

(2 marks)

b) Distinguish between a child process and a parent process. (6 marks)

c) Define zombie process. (2 marks)

d) Briefly explain what happens to the child process when the parent died first. (4 marks)

e) List and briefly explain FOUR (4) ways in which a process can communicate. (12 marks)

f) WRITE a program in C that will demonstrate how a process handles the following signals.

i. SIGINT

ii. SIGTERM, and

iii. SIGHUP

For each signal caught, the program will output:

"Signal (SIGINT) has been successfully caught"

where (SIGINT) will be replaced by the caught signal. (7 marks)

QUESTION 2

a) Briefly explain the difference between the two Internet sockets, SOCK_STREAM and SOCK_DGRAM.

(4 marks) b) Briefly explain the difference between Host Byte Order and Network Byte Order.

(4 marks)

c) Write a stream socket server program in C. The server will listen on port 1234 and will hold pending connections of 5 queues. While waiting for connection the server will print out "Server waiting for connections". Once a client is connected, the server will get an input strings from the client and print it out. (hints: this is similar to an echo server).

(14 marks) © Hak Cipta Universiti Teknologi MARA CONFIDENTIAL

Page 3: ITT440 Network Programming Exam Paper

CONFIDENTIAL 3 CS/APR2010/ITT440

QUESTION 3

a) Write an explanation on the following function calls by specifying the syntax, operation and necessity.

i. listen

ii. inet_pton

iii. setsockoopt

iv. recvfrom

v. bind

vi. socket (18 marks)

b) Compare differences/similarities that exists between iterative server and concurrent server.

(8 marks)

c) A server will normally accept multiple incoming connections from client. This means that it will have to accept() and recv() multiple data at the same time.

i. Briefly explain how the server monitor several sockets at the same time.

ii. Write a short program to demonstrate your answer. (10 marks)

d) There are three methods in which a program can transfer a binary data across a network. List and briefly explain the THREE (3) methods.

(9 marks)

END OF QUESTION PAPER

© Hak Cipta Universiti Teknologi MARA CONFIDENTIAL