You are on page 1of 2

1. Briefly describe the commands supported by HTTP.

HTTP can in principle be


implemented on top to either TCP or UDP sockets. Give the relative merits and demerits
of both implementations in terms of HTTP performance and complexity.

HTTP Commands:
● GET: used to retrieve information from the given server using a given URI Requests
using GET should only retrieve data and should have no other effect on the data
● POST: used to send data to the server, for example, customer information, file
upload, etc. using HTML forms
● PUT: Replaces all current representations of the target resource with the uploaded
content
● HEAD: Same as GET, but transfers the status line and header section only
● DELETE: Removes all current representations of the target resource given by a URI
HTTP over TCP:
● Merits:
○ Reliable because Connection-oriented
○ Loss less
○ Accurate Data Transmission
● Demerits:
○ Slow compared to UDP
HTTP over UDP
● Merits:
○ Fast compared to TCP’
● Demerits:
○ Unreliable due to connection-less
○ Complex as we have to incorporate reliability in protocol itself

2. Suppose N packets arrive simultaneously to a link at which no packets are currently being
transmitted or queued. Each packet is of length L and the link has transmission rate R.
a. What is the average queuing delay for the N packets?
b. Now suppose that N such packets arrive to the link every LN/R seconds. What is
the average queuing delay of a packet?

Time to transmit 1 packet is L/R.


a. First packet has queueing delay=0. Kth packet has queuing delay of (K-1)L/R. Average
delay is N(N-1)/2N*L/R = (N-1)/2*L/R.
b. All the N packets will be transmitted in LN/R time. So the average queuing delay will
remain the same as that in (a).

3. What are the five layers in the Internet protocol stack? What are the principal
responsibilities of each of these layers? Be very brief.

● Application Layer – Implements application protocol, and logic.


● Transport Layer – Implements end to end reliable service along with providing application
end-point. Provides service to application layer.
● Network Layer – Provides datagram service, addressing, and routing services.
● Data Link Layer – Provides logic link layer transmission, including medium access. May
provide reliable services.
● Physical Layer – Provides signal modulation, bit encoding, multiplexing etc.
4. Assuming that the root and TLD servers are always iterative and other lower level servers
are recursive, write down the queries and responses for resolving iter.ipr.res.in from
lab1.daiict.ac.in.

Query to root – response is NS record for the TLD server (.in)


Query to TLD server (.in) – response is NS record for the next lower server (.res.in)
Query to .res.in server – server resolves and forwards to .ipr.res.in DNS server.
.ipr.res.in server resolves the request and send A record (numerical address map) to the
.res.in DNS Server.
.res.in DNS server respond with the resolved A record to lab1.daiict.ac.in

5. Briefly describe the stop and wait protocol. In particular, explain how the packet loss and
acknowledgement loss is handled by the protocol. Derive the efficiency of stop & wait
when the round trip time is RTT, transmission time is Tt, and the propagation time is Tp.

Stop and Wait Protocol:


Sender uses a one-bit sequence number (0/1) for the packets. It sends one packet and waits
(setting a timer T) for the ACK. If it receives the ACK with correct sequence number, it advances
and send the next packet. If it receives an incorrect ACK or if the times runs out, sender sends a
copy of the same packet.
Receiver waits for a specific sequence packet (0/1). If it receives the correct packet, it sends the
ACK for that packet. If it receives a corrupted packet or it receives an incorrect packet, it sends a
copy of the previous ACK.

Efficency = (time to transmit a packet T) / (time to transmit a packet + round trip time)
= Tt / (Tt + RTT). IF RTT is roughly equal to 2*Tp then
= 1 / (1 + 2Tp/Tt)

You might also like