Professional Documents
Culture Documents
(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