ECSE 414 – Intro. to Telecom. Networks
Assignment #2 - Fall 2010
27/09/10
M. Rabbat
ECSE 414 - Homework Assignment #2 – Transport Layer
Due Thursday, October 7, 2010
Note:
Unless otherwise noted, all assignments are due at the beginning of the lecture period on the
due date.
For “paper and pencil” problems (such as Problems 1, 2, 3 and 4 below), you may submit
a hard copy of your assignment in class or to the instructor’s mailbox, or you can submit your
assignment electronically via WebCT. For programming problems (such as Problem 5), you must
upload an archive file (e.g., zip, rar, or tgz) on WebCT containing the source code, executable (or
.class file for Java applications), and a Readme file containing any special instructions for compiling
and running your application.
Problem 1
(K&R Ch3, P4) (3 marks, one per part)
a)
Suppose you have the following 2 bytes: 01011100 and 01010110.
What is the 1’s complement
of the sum of these two bytes?
b)
Suppose you have the following 2 bytes: 11011010 and 00110110.
What is the 1’s complement
of the sum of these two bytes?
c)
For the bytes in part (a), give an example where one bit is flipped in each of the two bytes and
yet the 1’s complement doesn’t change.
Problem 2 (K&R Ch3, P12)
(3 marks)
Consider the Stop-and-wait ARQ protocol discussed in class (also called
rdt 3.0
in the textbook).
Draw a diagram showing that if the network connection between the sender and receiver can reorder
messages (that is, two messages propagating in the medium between the sender and receiver can be
reordered), then the alternating-bit protocol (alternating between sequence numbers 0 and 1) will not
work correctly.
Make sure you clearly identify the sense in which it will not work correctly (i.e.,
how will the received message differ from what was sent).
Your diagram should have the sender on
the left and the receiver on the right, with the time axis running down the page.
Indicate data
packets as D
x
, and acknowledgement messages as A
x
, where
x
is replaced by the sequence number
(0 or 1).
Problem 3 (K&R Ch3, P21)
(4 marks)
Consider the Go-Back-N and Selective Repeat protocols. Suppose the sequence number space is of
size
k
(i.e., sequence numbers range from 0 to k-1). What is the largest allowable sender window that
will avoid the occurrence of problems such as that in Figure 3.27 (reproduced below) for each of
these protocols?