Sie sind auf Seite 1von 2

Birla Institute of Technology & Science, Pilani

Work-Integrated Learning Programmes Division


First Semester 2018-2019
Comprehensive Examination (EC-3 Regular)
Course No. : CSI ZC462
Course Title : NETWORK PROGRAMMING
Nature of Exam : Open Book
Weightage : 50% No. of Pages =2
Duration : 3 Hours No. of Questions = 5
Date of Exam : 25/11/2018 (AN)
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. Assumptions made if any, should be stated clearly at the beginning of your answer.

Q.1. Answer the following. [3 x 2 = 6]


(a) A programmer while coding a TCP fork-per-client concurrent server has written the following
SIGCHLD handler for clearing zombie processes. What do you think is the problem with this?

(b) What is the output of the following program?

(c) What changes are required in the following code to make it work for a TCP server.

CSI ZC462 (EC-3 Regular) First Semester 2018-2019 Page 1 of 2


Q.2. Answer the following briefly:
(a) How does raw sockets differ when used in IPv4 and IPv6 contexts?
(b) Why epoll() is scalable when compared to select()?
(c) While designing a event-driven server using signal-driven I/O, why real time signals are to
be used?
(d) Write similarities and differences between blocking I/O model and I/O multiplexing?
(e) Why UDP does not deliver asynchronous errors to the application? [5 x 2 = 10]
Q.3. Write code segments to do the following:
(a) a client that broadcasts and waits for replies up to a timeout of 500 nano seconds.
(b) a server using epoll API, waits for readability on fds 0,3 and 5 & for writability on 1 and 4.
(c) Implement ls | wc | sort using Unix Domain socketpair() function. [3 x 4 = 12]

Q.4. Consider the following sequence of messages in stop and wait client. Here client is sending a
request to server, though client TCP has received FIN from server. Using non-blocking I/O model,
implement the client to avoid this situation. [10]

Q.5. Computer science department has several research groups. It is decided that each group will keep
in touch using a IP-multicast chat application. A faculty member can be part of more than one
research group. Department is situated in 172.50.67/24 LAN segment. Since IP addresses are
allocated using DHCP protocol, it is not possible to fix the IP of a server which supplies list of
multicast group IPs and ports. list of multicast group IPs and ports will be available on some
system at port 8081.
Consider the following diagram. All nodes are connected over a LAN. Multicast groups are
maintained by some system that runs LiPro server. Assume that the following are the groups:

Networks 239.0.0.1 8080


Databases 239.0.0.2 8080
Distributed Systems 239.0.0.3 8080

Every time a faculty opens a chat application (Node.c), it sends a broadcast request to 8081 port
number. If the LiPro server is up in the LAN, it will reply with the list of groups, ips and port
numbers. Nodes upon receiving the list, display it to the faculty. Faculty selects the groups, he
wants to join. Nodes join the selected groups. When it receives messages on any of these groups,
it displays to the user. When user enters text and group name, it is sent to the respective multicast
group.
Implement LiPro.c and Node.c for the above specifications. [12]

CSI ZC462 (EC-3 Regular) First Semester 2018-2019 Page 2 of 2

Das könnte Ihnen auch gefallen