Professional Documents
Culture Documents
Test 1
Solution
Saad Mneimneh
Visiting Professor
Hunter College of CUNY
NAME:
This test is closed book, closed notes, open minds...
There are 4 Problems (but each problem has multiple parts).
Scratch pages are provided at the end. Scratch pages will not be graded.
Make sure your answer is clear.
Do not leave unanswered questions even if you think you do not have the
complete answer. Partial credit might be given.
Read all questions first. This will help you identify which questions you
can easily answer first.
(b) (4 points) Show that a 0 must always be stuffed after 015 in the string
015 0| .{z
. . 0} 1
k
for any k 1, in order to destuff correctly at the receiver. Hint: show that this
is true for k = 1, then work by induction.
The base case (k = 1): If 0 is not stuffed after 015 in 015 01, then the receiver
cannot distinguish between 015 1 with a stuffed 0, and 015 01 as original data.
Therefore, a 0 must be stuffed after 015 in 015 01.
Inductive step: Assume that a 0 must be stuffed after 015 in 015 |0 .{z
. . 0} 1, lets
k
. . 0} 1 with
015 in 015 0| .{z
. . 0} 1, then the receiver cannot distinguish between 015 |0 .{z
k+1
k+1
(c) (3 points) A student in CSCI 415 suggests the following alternative for bit
stuffing: pick any flag you want of some length n, say x1 x2 . . . xn , and stuff xn
after the appearance of x1 x2 . . . xn1 within the transmitted frame, where
0 xn = 1
xn =
1 xn = 0
Show by example that this strategy does not work.
Let the flag be 0101, i.e. n = 2. We must stuff a 0 after 010. Consider the
following frame:
. . . 01
Regardless of the stuffing that needs to be done, adding the flag at the end of
the frame will produce the following:
. . . 010101
Now the receiver will interpret the first occurrence of 0101 as the flag, hence
accepting the frame before it actually ends.
(e) (2 points) Construct a pattern of 6 errors (in data and parity) that cannot
be detected by this code.
We have to construct a pattern of errors such that we have exactly 2 errors in
each row and each column. Heres a possibility:
011
101
110
with error:
xx1
1xx
x1x
(1)
(2)
(c) (3 points) Discuss the implication of a TCP slow receiver on the sliding
window algorithm.
The key point here is the synchronization through the advertised window.
(d) (1 point) What is your favorite restaurant in New York city?
SCRATCH
SCRATCH
SCRATCH