COMPUTER NETWORKS (MCA) – QUIZ 4

October 8, 2016


  1. Which transport protocol will you use for developing an application which is based on wireless networks such as 802.11?

    (Ans: Since 802.11 is an unreliable medium, the preferred transport layer protocol is TCP unless the application itself does not require reliability.)

  2. What is the demultiplexing field in UDP or TCP?

    (Ans: Destination Port)

  3. If the path from the source to the destination has the following MTUs on the links of the path – 1500, 1500, 3100, 576, 1500, 3100 – what is the size of the MSS in TCP?

    (Ans: Path MTU is the minimum MTU of the path – 576. MSS is 576-40 = 536.)

  4. An application uses UDP to send 7000 bytes of data in a single message on a path with MTU = 1500 and there is an error in one of the fragments transmitted. The application is a reliable application and so retransmits the 7000B again. How much more data is transmitted by this application as compared to it using TCP as the transport protocol?

    (Ans: UDP transmits 14000B – since this will be split into segments of 1460 and there will be five segments and only one is lost, TCP transmits 8460B – i.e., 5540B more data is transmitted by UDP)

  5. What is the problem with estimating RTT when a segment is retransmitted?

    (Ans: There is no way to decide whether the ack. received is to the first or second transmission. In one case we have an unnecessarily long timeout interval keeping the line idle and in the other we have a shorter time interval than the real one. This leads to too many retransmissions and so adds to the congestion.)

  6. When a retransmission timeout occurs, what does Karn's algorithm propose that TCP should do?

    (Ans: Karn's algorithm states that no RTT estimate should be made with this sample. Instead, the timeout should be exponentially backed off and a retransmission made.)

  7. What is the purpose of the URG bit in TCP?

    (Ans: URG is set to indicate that the segment carries out-of-order data.)

  8. What is the purpose of the PSH bit in TCP?

    (Ans: PSH bit is set to indicate that there should be no buffering for the data in question. Typically used by interactive applications.)

  9. The segments of data sent in a new connection have 100B, 200B, 300B, 200B and 100B. The acknowledgments received are 101, 101, 601, 601 and 901 without a retransmission timeout. What is the order in which the datagrams may have been received?

    (Ans: The first segment should return an ack of 101 since it is the next expected in-sequence byte. When it is received again, it means that the second segment has not reached but some other segment has reached the receiver. You cannot tell which segment yet. When the next segment's ack comes and it is 601, you know that 600B have been received in sequence. This means that the second and third segments have been received and so on. )

  10. Why does TCP header have a header length field whereas UDP does not?

    (Ans: Because TCP has options unlike UDP.)

  11. Which of client and server does active and passive TCP socket open?

    (Ans: The server opens a listening socket and just waits for connections – therefore it is called passive open (look up the meaning of passive vs active in the dictionary). The client actually initiates the connection through the 3-way handshake and so is called active open.)

  12. Why are ports used in UDP and TCP and not process IDs of the client/server processes?

    (Ans: Process IDs need not be same when run across machines or even within one machine across different times. Thus, they cannot be used to identify a server process by a client trying to reach it.)

  13. What is the difference between window and MSS in TCP?

    (Ans: Window is the buffer space available in the receiver – it represents the maximum amount of data that can be transmitted to the receiver without getting any ack. MSS represents the maximum amount of data that can be sent in a single segment.)

  14. What are the contents of the pseudo header used in UDP and TCP checksum calculations and why?

    (Ans: )

  15. What is the method for TCP to open a connection?

    (Ans: Open uses 3-way SYN handshake and Close uses 3-way FIN handshake.)

  16. Give an example of an application where UDP is better than TCP? Why?

(Ans: An application which requires less latency and no reliability such as video streaming

where the loss of a single datagram does not affect the user experience)

  1. When does a source get an ICMP_DEST_UNREACH/NET_UNREACH message?

(Ans: Whenever a router does not find a matching entry for the destination IP address)

  1. An operating system sets the DF bit to 1 by default. What ICMP message is sent if the datagram size is more than the Path MTU?

    (Ans: ICMP_DEST_UNREACH/DF_BIT_IS_SET_BUT_FRAG_NEEDED)

  2. Given the topology and H1 tries to ping H3, what ICMP message does it get as reply?

  3. A fragment is lost due to noise on the path to the destination. What ICMP message, if any, does the source get?

    (Ans: It gets the ICMP message TIME_EXCEEDED/REASSEMBLY TIMER EXPIRED)

  4. If a datagram is lost due to noise, what ICMP message, if any, does the source get?

    (Ans: It does not get any ICMP message)

  5. Given the topology and the routing table entries, what happens when H1 tries to ping to the machine with a host IP not found?

  6. What is a well-known port number?

    (Ans: The port number of a standard application whose port is decided by IANA)

  7. How is the port number of a client connection obtained?

    (Ans: The kernel gives the next available free port no as the client port)

  8. Can a server have the port number decided by the operating system? Give the reason.

    (Ans: The server needs the port no. to be fixed. So, the kernel cannot give the port to a server)

  9. A client is trying to reach a web server on a system. But, at the time the client is connecting, the web server process has crashed. What, if any , ICMP message will be sent to the client?

    (Ans: ICMP_DEST_UNREACH/PORT_UNREACH)

  10. How is a socket defined?

    (Ans: The 5-tuple (SIP, DIP, SP, DP and Proto))

  11. What is the difference between message-oriented and stream-oriented services?

    (Ans: The message oriented service delivers the messages as given to the network layer whereas the stream-oriented protocol can combine/divide the messages given by the application before giving to the network layer)

  12. What is sliding window used for?

    (Ans: Flow control)

  13. What type of ack does TCP use? What is the advantage of this type of ack?

    (Ans: Cumulative ack. Advantage is that when acks are lost, segments/acks are reordered, it allows an application to infer the data that has been delivered without explicit acks for every segment. It allows for delayed acks that combine ack for multiple received segments also)