Networking – Computer Science Questions and Answers

The objective of this article (Networking – Computer Science Questions and Answers) is to provide you a rough guess about the questions that are usually asked in networking-computer science and also the very important and very basic questions asked in Interview. So no matter you are a student or a professional you can gain benefit from our uploaded documents.

Q.1 Consider an HTTP client that wants to retrieve a Web document at a given URL. The IP address of the HTTP server is initially unknown. What transport and application-layer protocols besides HTTP are needed in this scenario?

Ans:- DNS and HTTP for application layer protocol
UDP for DNS and TCP for HTTP in transport layer protocol

Q.2. Obtain the HTTP/1.1 specification (RFC 2616). Answer the following questions:

a. Explain the mechanism used for signaling between the client and server to indicate that a persistent connection is being closed. Can the client, the server, or both signal the close of a connection?

Ans:- Typically, the mechanism used for signaling between client and server is Acknowledgement with closing information on it, Yes both can signal to close the connection.

b. What encryption services are provided by HTTP?

Ans:- There are no encryption services provided by HTTP. Because HTTP is not secure and now a day’s every individual is preferring HTTPS over HTTP.The reason behind this is that HTTPS is much more secure than HTTP and it also provide encryption services.

c. Can a client open three or more simultaneous connections with a given server?

Ans:- Yes, a client can open as many connections as it wanted with a given server.

d. Either a server or a client may close a transport connection between them if either one detects the connection has been idle for some time. Is it possible that one side starts closing a connection while the other side is transmitting data via this connection? Explain.

Ans:- Yes, it is possible that one side i.e. client or server closes a connection while the other is transmitting data. This is because the client and server knows each other state after they have received data from each other. If a connection is idle by any side , it could be closed even though a message is transmitted from the opposite side and it would result in closing.

Q.3.Suppose within your Web browser you click on a link to obtain a Web page.
The IP address for the associated URL is not cached in your local host, so a DNS lookup is necessary to obtain the IP address. Suppose that n DNS servers are visited before your host receives the IP address from DNS; the successive visits incur an RTT of RTT1, . . ., RTTn. Further suppose that the Web page associated with the link contains exactly one object, consisting of a small amount of HTML text. Let RTT0 denote the RTT between the local host and the server containing the object. Assuming zero transmission time of the object, how much time elapses from when the client clicks on the link until the client receives the object?

Ans:- 2RTT0+(RTT1+…+RTT_n)+RTT

2RTT0 = 1st for requesting the connection and 2nd for requesting the address or URL
(RTT1+…+RTT_n) = Address is not copied into our cache and not in our local DNS, so all the n DNS servers visited adds up
RTT = This RTT is to fetch our object because we have exactly 1 object on the given URL, i.e. some HTML text.

Q.4. How does SMTP mark the end of a message body? How about HTTP? Can HTTP use the same method as SMTP to mark the end of a message body? Explain.

Ans:- SMTP uses a period to mark the end of a message body. HTTp simply uses entire message length in header part known as “Content Length Header Field”.
No, HTTP cannot use the method used by SMTP, because HTTP message uses  binary  data, whereas in SMTP, the message body should be in 7-bit ASCII format.

Q5. a. What is a whois database?

Ans:- WHOIS is a public database it allows us to find out information about a specific domain name. It’s just like a registrar where anyone can find out who registered it, who the registrar is, and who you can contact about the domain name.

b. Use various whois databases on the Internet to obtain the names of two DNS servers. Indicate which whois databases you used.

Ans:- Whois database I am using is
c. Use nslookup on your local host to send DNS queries to three DNS servers: your local DNS server and the two DNS servers you found in part (b). Try querying for Type A, NS, and MX reports. Summarize your findings.

d. Use nslookup to find a Web server that has multiple IP addresses. Does the Web server of your institution (school or company) have multiple IP addresses?

Ans:- The web server I am using is because it is a huge site and will have multiple IP addresses.
Yes, the web server of our university ( have multiple IP addresses.

e. Use the ARIN whois database to determine the IP address range used by your university?

Ans:- – (Calculated using

f. Describe how an attacker can use whois databases and the nslookup tool to perform reconnaissance on an institution before launching an attack?

Ans:-  The attacker use whois database to look for DNS server they want to attack,  and there is one more possibility that they can install themselves as a DNS server for our site and can attack on our site.

g. Discuss why whois databases should be publicly available?

Ans:- It should be publically available because they are the just like references when one have to evaluate who is the registrant of this domain name. It’s  already publically available and one can also set a privacy.

Q.6. Suppose Bob joins a Bit Torrent torrent, but he does not want to upload any data to any other peers (so called free-riding).
a. Bob claims that he can receive a complete copy of the file that is shared by the swarm. Is Bob’s claim possible? Why or why not?

Ans:- Yes, Bob’s claim is possible because he refuses to upload any data but his seeders randomly unchoke him and his torrent file begins to download, but on a low speed because he is not uploading any data so according to TIT FOR TAT rule his downloading will be slow but at the end he will be able to receive the complete copy of that file.

b. Bob further claims that he can further make his “free-riding” more efficient by using a collection of multiple computers (with distinct IP addresses) in the computer lab in his department. How can he do that?

Ans:- Yes, Bob can further make his free-riding more efficient by simply making the systems in computer lab his seeders. The file he wants to download is on the lab’s systems and he is downloading from these computers, this is more efficient because the lab’s computers are not downloading this file they are just uploading this file to a Single system.

Q.7. Can you configure your browser to open multiple simultaneous connections to a Web site? What are the advantages and  disadvantages of having a large number of simultaneous TCP connections?

Ans:- Yes a browser can open multiple TCP connections simultaneously with the help of extra tab, there is no such configuration required to open parallel TCP connections. The number of TCP connection user can open at a time depends upon browser per browser. Modern browser support 5 to 10 parallel TCP connections simultaneously.


ü  Reduced Latency on requests
ü  Congestion Control because of long lasting connections
ü  Pipelining allows requests made by a client with a minimum elapsed time


ü  Poor performance or performance degradation due to keeping connections open long after requests
ü  Less scalable in case of traffic burst all web connections will be busy by few clients and each user have to wait for response time that is coming from server

Q.8. UDP and TCP use 1s complement for their checksums. Suppose you have the following three 8-bit bytes: 01010011, 01100110, 01110100. What is the 1s complement of the sum of these 8-bit bytes? (Note that although UDP and TCP use 16-bit words in computing the checksum, for this problem you are
being asked to consider 8-bit sums.) Show all work. Why is it that UDP takes the 1s complement of the sum; that is, why not just use the sum? With the 1s complement scheme, how does the receiver detect errors? Is it possible that a 1-bit error will go undetected? How about a 2-bit error?

Ans:-               01010011  +   01100110  =  10111001
10111001  +  01110100  =  00101110

One’s complement of final answer  = 11010001

To detect errors, the receiver adds the four words (the three original words and the checksum). If the sum contains a zero, the receiver knows there has been an error. All one-bit errors will be detected, but two-bit errors can be undetected (e.g., if the last digit of the first word is converted to a 0 and the last digit of the second word is converted to a 1) .

Q.9. Is it possible for an application to enjoy reliable data transfer even when the application runs over UDP? If so, how?

Ans:- Yes it can. By sending sequence numbers with the packet you can rearrange the packets on the target machine and send them to the application in order. UDP has checksum, and understands if data reached is true or not, of course, it is under application level. You only get something true or nothing. You can make a private protocol (means a protocol by yourself) to obtain reliability which is built on UDP, then it will be reliable.

Q.10. Suppose that a Web server runs in Host C on port 80. Suppose this Web server uses persistent connections, and is currently receiving requests from two different Hosts, A and B. Are all of the requests being sent through the same socket at Host C? If they are being passed through different sockets, do both of the sockets have port 80? Discuss and explain.

Ans:-  Port 80 is used only for the initial connection. As soon as a host connects, the server hands off the session to a free port and the session are established using that port. This keeps port 80 free for new incoming requests.

Let's Discuss

  • Yasser Daniyal

    Thnks Dear for shearing

  • Marva Choudhary

    kindly upload stats final past papers