Sie sind auf Seite 1von 2

Birla Institute of Technology & Science, Pilani Work-Integrated Learning Programmes Division First Semester 2009-2010 Mid-Semester Test

(EC-1 Regular) Course No. Course Title Nature of Exam Weightage Duration Date of Exam Note:
1. 2. 3. 4.

: IS ZC462 : NETWORK PROGRAMMING : Closed Book : 40% : 2 Hours : 29/08/2009 (FN)

No. of Pages =2 No. of Questions = 8

Please follow all the Instructions to Candidates given on the cover page of the answer book. All parts of a question should be answered consecutively. Each answer should start from a fresh page. Mobile phones and computers of any kind should not be used inside the examination hall. Use of any unfair means will result in severe disciplinary action.

Q.1.

Does client server design using FIFOs or Pipes have any issues related to deadlock scenario? Justify with suitable examples. [3] What is the criterion to determine whether a server is concurrent or iterative? How can you write a concurrent server which does not fork child processes or create threads? [4] How are connections established and terminated in TCP applications? Write the appropriate the functions used. [4] Write the appropriate prototype of the functions used for the following operations:
(i). (ii). (iii). (iv). (v). (vi).

Q.2.

Q.3.

Q.4.

To move the specified number of bytes from specified source to the destination variable. To get the 32-bit network byte ordered IPv4 address. To return the next completed connection from the front of the completed connection queue. To get the host name corresponding to a binary IPv4 address. To replace a running process by new program. To send a signal to a process or group of process. [3] [3]

Q.5. Q.6.

What are the three features that are provided by waitpid() but not by wait()?

What are the three different things that you can tell kernel to do when a signal occurs? What is the significance of SIGUSR1 and SIGUSR2 signals? [3]

IS ZC462 (EC-1 Regular)

Page 1 of 2

IS ZC462 (EC-1 Regular)

First Semester 2009-2010

Page 2

Q.7.

Using pipes write a program for communication between three processes , parent ,child and grand child. Parent reads a message and send it to the child through pipe. Child reads it and send to its own child to encrypt the message by using message[i]=message[i]+5 and encrypted message sent back to its own parent . Child process after receiving encrypted message from own child , decrypt the message and if it matches with the original message it received from main parent (i.e. own parent) ,then it send MATCHED else NOT MATCHED to parent process. [8] Write a client and a server application program using TCP Internet sockets using Unix Socket API. Here, you will create Stream sockets to develop both the programs. Implement a server and a client for file-copying to copy a file from the server side to the client side. The interactions between client and server should be as given below: (i). Client connects to the server by specifying server IP address and port as a command line argument. Port number of the server is specified in the client program. (ii). Client sends its ID (like, 2009 462) which is a text string to sever. Server reads this string and expects two numbers in this string i.e. 2009 and 462. Then server checks its database to make sure that second number i.e. 462 does exist in its repository. (Database may be a simple file). (iii). If successful, server sends a string valid to the client else sends a string not authorized. (iv). Now client sends a filename to the server. (v). Server opens the file, reads the content and sends the contents to client. (vi). Client should display the contents of the file received from the server on the standard output or the client may store the received file in its local disk. The content of the file is left up to you to decide. Place some creative text in the file. However, the file should not be empty. Write both client and server program . [12]

Q.8.

*********

IS ZC462 (EC-1 Regular)

Page 2 of 2

Das könnte Ihnen auch gefallen