Uploaded by Saurabh Pandey

17CH30055 CN CT-3

advertisement
Indian Institute of Technology Kharagpur
Department of Computer Science and Engineering
Class Test-3, Spring 2020-21
Computer Networks (CS31006)
Students: 155
Full marks: 30
Credit: 20%
SAURABH KUMAR PANDEY
Date: 13-March-2021
Time: 60 minutes
17CH30055
1. Does TCP use Selective Repeat (SR) or a Go-Back-N (GBN) for flow control? Explain your answer.
[2 + 2 = 4]
TCP use a combination of SR and GBN for flow control. To understand better, let us look at the similarities and
differences of TCP with SR and GBN.
TCP is similar to SR because if a packet gets lost, it does not require the sender to transmit every packet was not
ACK’ed, the sender just retransmits the oldest packet not delivered. TCP is similar to GBN because both have a
limit on the number of packets that can be retransmitted by the sender into the network.
TCP is different from SR because SR requires individual acknowledgement of each packet sent by the receiver.
TCP is different from GBN because it requires the transmission of every failed packet delivery whereas TCP only
retransmits the oldest packet.
Thus, TCP is a hybrid of both SR and GBN.
2. Explain the “SYN Flood” attack on TCP connections. Also, suggest one method of resisting the attack.
[2 + 2 = 4]
SYN Flood attacks the normal TCP three-way handshake as it consumes resources on target server and renders
it unresponsive. The attack description is as follows.
The attacker sends repeated SYN packets to every port using a fake IP Address. The server is unaware of the
attack and every open port tries to make a connection with a SYN-ACK packet. The client does not send the ACK
packet or never receives the ACK-SYN packet, thus exposing all the open ports during the time connection
remains open. Eventually the client’s overflow tables fill and the server malfunctions or crashes.
One of the solutions to resist the attack is to use cryptographic function to generate sequence numbers,
popularly known as SYN Cookies. In this, the server sends its SYN-ACK response with a sequence number that is
constructed from client IP address, port number and other information. When the client responds, this hash is
included in the ACK packet. The server verifies the ACK, and then only allocates the memory or port for
connection establishment.
3. Assume that you have set up a TCP connection over a lossless link with end-to-end bandwidth 2 Gbps. Further
assume that you are using 16-bit sequence numbers for individual bytes. If the end-to-end link delay is 50
milliseconds, is it safe to use this 16-bit sequence number field for a sliding window based flow control
algorithm? [Hint: By “safe”, we mean the ability of the protocol to distinguish between different segments.
Further, note that we can use a simple sliding window protocol and not an ARQ protocol, as the link is
lossless.]
[3]
4. Explain the Silly Window Syndrome of TCP, and Clark’s Solution to solve it.
[2 + 2 = 4]
Silly Window Syndrome is a problem that arises due to poor implementation of TCP and makes the data
transmission extremely inefficient. It is named so since it causes the sender window size to shrink to a silly
value, basically to such an extent where data being transmitted is even smaller than TCP header. It is caused by
two major issues – Sender window transmitting one byte of data repeatedly and Receiver window accepting one
byte of data repeatedly.
Clark’s solution solves the second issues, that is, receiver window accepting one byte of data repeatedly.
Consider when the receiver is unable to process all the incoming data. In such a case, the receiver will
advertise a small window size. The window size becomes smaller and smaller. A stage arrives when it
repeatedly advertises window size of 1 byte. This makes receiving process slow and inefficient. The solution
to this problem is as follows as provided by Clark.
1.
2.
3.
Receiver should not send a window update for 1 byte.
Receiver should wait until it has a decent amount of space available.
Receiver should then advertise that window size to the sender.
5. Consider a TCP connection, which calculates the TCP Retransmission Timeout SRTT, RTTVAR and RTO
parameters following the standard Jacobson’s Algorithm, with parameters α and β determined as follows. The
parameter α can be calculated from your roll number, by adding all the letters and digits, calculating the
remainder modulo-5, dividing by 10, and adding to . The letters are assumed to have the following numerical
values: A=1, B=2, ··· Z=26. For example, if your roll number is 15YZ12345, then
is set to be
. Assume the
following initial values: SRTTinitital = 0 ms and RTTVARinitial = 0 ms. Given that the first two measured values of the
round-trip time are 1100 milliseconds and 1500 milliseconds respectively, and your roll number, calculate the
value of the RTO parameter after the acknowledgement for the second TCP segment has been received. [5]
Roll – 17CH30055
Alpha = (1+7+3+8+3+0+0+5+5)mod5/10 +1/2 = 7/10
Beta = 7/20, R1 = 1100 ms, Ra = 1500 ms
SRTT-1 = alpha * SRTT(initial) +(1-alpha)*R1 = 330 ms
RTTVAR-1 = (7/20)*0 + (13/20)*|330-1100| = 500.5 ms
SRTT-2 = (7/10)*330+(3/10)*1500 = 681 ms
RTTVAR-2 = (7/20)*500.5 + (13/20)*|500.5-1500| = 824.85 ms
RTO = max(SRTT-2 + 4*RTTVAR-2, 1 second) = 3980.4 ms
6. State whether each of the following statements is True or False, with a brief (1-2 sentence(s)) explanation in
support of your answer:
(a) Ordinary implementations of TCP uses Selective Acknowledgement (SACK) to request for missing
segments.
True. The receiving TCP sends back SACK packets to the sender informing about the data that has been
received. The sender then checks and retransmits the missing segments.
[2]
(b) The Maximum Segment Size (MSS) for a TCP connection is often set to about 1500 bytes in practice.
[2]
False. MSS refers to a field in TCP header that tells the maximum amount of data that can be received in the
TCP segment in bytes. It is often set to 1500 bytes since in Ethernet or Data link layer, MSS value is 1500 bytes
which goes on to decrease to 1460 bytes to the transport layer. The payload that transport gets is known as
MSS and is equal to 1460 bytes.
(c) During the Slow Start phase, the CWnd parameter in TCP Tahoe increases at an extremely slow rate.
[2]
False. CWnd parameter doubles at every RTT and is not at all a slow rate to increase. This is done to avoid slow
convergence.
(d) Delayed Acknowledgement combined with Nagle’s Algorithm can result in starvation in a TCP
connection.
True. Since Nagle’s algorithm only allows one packet to be transported on any network at a given time and
Delayed ACK further renders the process inefficient, thus causing starvation in a TCP connection.
(e) The URG flag has lower priority than PSH flag in TCP.
False. URG is urgent pointer and hence has higher priority.
[2]
Download