You are on page 1of 1

Birla Institute of Technology & Science - Pilani, Hyderabad Campus

Second Semester 2018-2019


IS F462: NETWORK PROGRAMMING
Mid Semester Examination (ONE PAGE SOLUTION KEY)
Type: Closed Book Time: 1.5 hours Max Marks: 40 Date: 11/03/2019

1) D (Refer to Slide 6, Lecture 7…pdf – available on CMS)

2.a) Blocking Socket: functions of socket in blocking mode return nothing until the action is completed and
Non-Blocking Socket: functions of socket in non-blocking mode returns immediately. (marks are given for
other right answers as well)
2.b) reducing processor overhead, simpler code design for synchronous servers. (marks are given for other
right options as well)
2.c) handling multiple clients efficiently, asynchronous server. (marks are given for other right options as
well)
2.d) Blocking Mode.

3) Refer to DNS Slides 24-29 (Lecture 8-19 Sem 2nd 2018-2019 NP.pdf– available on CMS)

4) Refer to TLS Slides 72-80 (Lecture 8-19 Sem 2nd 2018-2019 NP.pdf– available on CMS)

5 – first part) Symmetric encryption: same key for encryption and decryption, Asymmetric encryption: Uses
a pair of keys: a private and a public key where public key is use to encrypt a message that can be only
decrypted using a private key.

5 – second part) SSL uses asymmetric encryption during the handshake protocol and establish a secret key
for symmetric encryption. After the handshake, the data is exchanged between the client and server using
symmetric encryption with a secret key generated during the handshake.

6.a) 13 (marks are also given in case you have counted ACK’s and handshake packets). No Partial Marking.
6.b) 232 (approx. 4.19 Gb). TCP sequence number increments by the number of bytes sent. The maximum
file size is independent of the MSS. (Note: Marks are given for both 232 or 232-1). No Partial Marking.

7) To verify that the UDP datagram has reached its correct destination. (marks are given for similar right
options as well). No partial marking.

8) (i) Between line 11 and 12, add listener.bind(address), Connection refused error at Client(s)

(ii) Line 10, replace with sock.SOCK_STREAM, OSError at Server (operation not permitted)

(iii) Line 61, replace with select.POLLOUT, no output at Client(s) on number sent or received.

(iv) Line 49, insert in sock.recv(4096) or any other number such that the integer are received. Run time error
at server (recv() takes at least one argument.) and BrokenPipe or ConnectionResetError at Client(s).

(v) Between Line 68 and 69, add data = data + b’.’, No output at Client(s) since there is no delimiter. (Marks
are given if the delimiter is added at any other part of the code and it is correct).

You might also like