Вы находитесь на странице: 1из 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. 2. 3. 4. This question paper consists of three (3) questions. Answer ALL questions in the Answer Booklet. Start each answer on a new page. 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) ii) the Question Paper 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

CONFIDENTIAL

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) 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) WRITE a program in C that will demonstrate how a process handles the following signals. i. ii. iii. SIGINT SIGTERM, and SIGHUP

b)

f)

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) Briefly explain the difference between Host Byte Order and Network Byte Order. (4 marks) 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)
CONFIDENTIAL

b)

c)

Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL QUESTION 3 a)

CS/APR2010/ITT440

Write an explanation on the following function calls by specifying the syntax, operation and necessity. i. ii. iii. iv. v. vi. listen inet_pton setsockoopt recvfrom bind socket (18 marks)

b)

Compare differences/similarities that exists between iterative server and concurrent server. (8 marks) 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. ii. Briefly explain how the server monitor several sockets at the same time. Write a short program to demonstrate your answer. (10 marks)

c)

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

Вам также может понравиться