Second Semester 2009-2010 Mid-Semester Test (EC-1 Regular)
Course No. : IS ZC462 Course Title : NETWORK PROGRAMMING Nature of Exam : Closed Book Weightage : 40% Duration : 2 Hours Date of Exam : 06/02/2010 (FN) Note: 1. Please follow all the Instructions to Candidates given on the cover page of the answer book. 2. All parts of a question should be answered consecutively. Each answer should start from a fresh page. 3. Mobile phones and computers of any kind should not be used inside the examination hall. 4. Use of any unfair means will result in severe disciplinary action.
Q.1 (a). Write the silent features of TCP? Why there is UDP although TCP exists? Q.1 (b). Why do sockets provide the interface from upper three layers of OSI model into transport layer? [4 + 3 = 7]
Q.2 (a). List three examples, when signals are generated in the scenario of client-server based network applications? Q.2 (b). Write a pseudocode program demonstrating the generation and use of signal handlers which is catching the SIGUSR1 signal and SIGALARM signal. [3 + 4 = 7] Q.3 (a). Why a network programmer should not leave any zombies around in the client- server based network applications? Q.3 (b). How do fork() and exec() functions differ? How many new processes will be created if the following sequence is executed: fork ( ); fork ( ); fork (); Q.3 (c). What are the significant aspects of TIME_WAIT state of TCP with respect to network programming? [3 + 3 + 3 = 9] Q.4. Write only a TCP server program which can handle multiple simultaneous client requests. Your server takes port number as a command line argument and starts listening for a transmission from the clients. Your server should send Welcome message whenever any client connects to your server and then it logs the IP address and port no. of the connected clients in a file. Once the server received the reply of its sent Welcome message, it will send the current day and time as a response. Your program will take care of zombies creation. You may assume that the corresponding client program has already implemented. [9] Q.5. Write a program using pipes and signals for full duplex communication between two processes, parent and child. The parent reads a string from stdin and sends it to the child through the pipe. The child reads it, if string contains numerals it ignores them, and converts to uppercase the remaining string after removing numerals from string and sends the changed string back to parent. The parent reads it and displays it in stdout. Parent should take input from standard input until NULL is given as input string. You should handle multiple occurrences of SIGINT signal. During the process of run, if user is typing Ctr+C or Del for more than once, program should not terminate. It should continue asking for input and displaying the reverse. [8] ********* No. of Pages = 1 No. of Questions = 5