You are on page 1of 2

Homework, sheet 5

July 24, 2013

Exercise 1. Consider transferring an enormous file of L bytes from Host A to


Host B. Assume an M SS of 512 bytes.
(a) What is the maximum value of L such that TCP sequence numbers are
not exhausted? Recall that the TCP sequence number field has 4 bytes.
Answer: There are 232 = 4, 294, 967, 296 possible sequence numbers. The
sequence number does not increment by one with each segment rather it
increments by the number of bytes of data sent. Consequently, the size of
the M SS is irrelevant and the maximum file size that can be sent from A
to B is the number of bytes representable by L = 232 bytes ≈ 4.29 GBytes.
(b) For the L you obtain in (a), find out how long it takes to transmit the
file. Assume that a total of 64 bytes of transport, network, and data-link
header are added to each segment before the resulting packet is sent out
over a 156 Mbps link. Ignore flow control and congestion control so A can
pump out the segments back to back and continuously.
Answer: The number of segments is S = d232 bytes / 512 bytes e =
8, 388, 608. To each segment, a header of 64 bytes is added and the total
number of bytes to transfer becomes L0 = S · (512 bytes + 64 bytes) =
4,831,838,208 bytes. On the 155 Mbps link, the time needed to transfer L0
bytes is L0 · 8 bit /(155 · 106 ) bit/s ≈ 249 s.
Exercise 2. Hosts A and B are communicating over a TCP connection, and
Host B has already received from A all bytes up through byte 126. Suppose
Host A then sends two segments to Host B back-to-back. The first and second
segments contain 80 and 40 bytes of data, respectively. In the first segment,
the sequence number is 127, the source port number is 302, and the destination
port number is 80. Host B sends an acknowledgement whenever it receives a
segment from Host A.

(a) In the second segment sent from Host A to B, what are the sequence
number, source port number, and destination port number?
Answer: The sequence number is 127 + 80 = 207, the source port number
is 302, and the destination port number is 80.
(b) If the first segment arrives before the second segment, in the acknowledge-
ment of the first arriving segment, what is the acknowledgement number,
the source port number, and the destination port number?
Answer: The acknowledgement number is 207, source port number is 80
and the destination port number is 302.

1
(c)
(c) IfIf the
the second
second segment
segment arrives
arrives before
before the
the first
first segment,
segment, in
in the
the acknowledge-
acknowledge-
ment of the first arriving segment, what is the acknowledgement
ment of the first arriving segment, what is the acknowledgement number? number?
Answer: The acknowledgement number is 127, indicating
Answer: The acknowledgement number is 127, indicating that it that it is
is still
still
waiting for bytes 127 and onwards.
waiting for bytes 127 and onwards.
(d)
(d) Suppose
Suppose the the two
two segments
segments sent sent by
by AA arrive
arrive in
in order
order at
at B.
B. The first ac-
The first ac-
knowledgement is lost and the second acknowledgement arrives
knowledgement is lost and the second acknowledgement arrives after the after the
first
first timeout
timeout interval.
interval. Draw
Draw aa timing
timing diagram, showing these segments
and
and all other segments and acknowledgements sent. (Assume that there
all other segments and acknowledgements
isis no
no additional
additional packet
packet loss.)
loss.) For
For each
each segment in your figure, provide the
sequence
sequence number and the number of
number and the number of bytes of data; for each acknowledge-
ment
ment that you add, provide the acknowledgement number.
that you add, provide the acknowledgement
Answer:
Answer:

Host A Host B
Seq=127, 80 bytes
timeout

Seq=207, 40
80 bytes Ack=207
X Ack=247
Seq=127, 80 bytes

Ack=247

Exercise 3.
Exercise 3. When
When establishing
establishing aa connection
connection in TCP, a ”three-way handshake”
isis done
done before
before exchanging
exchanging data.
data. Why
Why are
are three steps needed and not just two?
Explain at
Explain at aa self-chosen
self-chosen scenario
scenario what
what could
could go wrong under which conditions.
Answer: Assume
Answer: Assume HostHost AA wants
wants to
to establish
establish a TCP connection with Host B.
First, Host
First, Host A A sends
sends aa SYN
SYN messsage
messsage toto Host B. Now, Host B knows that Host
AA wants
wants to
to establish
establish aa connection
connection and
and replies
replies with a SYNACK message. If there
would only
would only be
be aa two-way
two-way handshake,
handshake, Host
Host B would assume the connection to be
established and
established and waits
waits for
for data.
data. But
But assume
assume the SYNACK message got lost, then
Host A
Host A would
would assume
assume that
that the
the connection
connection is not established but Host B does so
and would
and would wait
wait indefinitely.
indefinitely.

22

You might also like