Professional Documents
Culture Documents
The second bit is incorrect. So the original value is 1010 0100 1111, i.e. 0xA4F.
Dada: 1010 1111, i.e. 0xAF
M(x) = x 7 + x 5 + 1
G(x) = x 3 + 1
Since degree of G(x) is r = 3, append 3 zero bits to the lower end of M(x).
Frame: 10100001
Generator: 1001
Message after 3 zero bits are appended: 10100001000
1
The remainder obtained by dividing x7 + x5 + 1 by the generator polynomial x3 + 1 is
111.
2. (3.19) In protocol 3, is it possible that the sender starts the timer when it is already
running? If so, how might this occur? If not, why is it impossible?
Yes, this can happen. This is the case when "no positive ack arrives" at the sender in
last iteration of the while loop in sender3(void) code on page 210. So, the frame that the
sender is transmitting when the timer is running (and therefore reset), is a repeat/duplicate
frame.
(3.20) Imagine a sliding window protocol using so many bits for sequence numbers
that wraparound never occurs. What relations must hold among the four window
edges and the window size, which is constant and the same for both the sender and
the receiver.
There are three main conditions that must hold among the four window edges and the
window size:
1. The sender must keep track of 0 to w frames that have currently been sent but
have no acknowledgment i.e outstanding.
0 <= S2 – S1 + 1 <= W
2
3. The receiver’s sequence number must be within the sender’s window
S1 <= R1 <= S2 + 1
3. (3.33) Suppose that we model protocol 4 using the finite state machine model. How
many states exist for each machine? How many states exist for the communication
channel? How many states exist for the complete system (two machines and the
channel?) Ignore the checksum errors.
4. (4.3) Consider the delay of pure ALOHA versus slotted ALOHA at low load.
Which one is less? Explain your answer.
At low load, the delay of pure ALOHA is less than that of slotted ALOHA. This
is because in slotted ALOHA, when a message is ready, the station has to wait until the
beginning of the next slot, but in pure ALOHA, the station can sent at any time a message
is ready.
(4.8) How long does a station s have to wait in the worst case before it can start
transmitting its frame over a LAN that uses
The worst case would be when a station wants to transmit (just after its bit slot is
passed), and all of the other stations are transmitting. Then, on the next pass all the
stations are transmitting again, and station, s, is the very last station on the map. So first it
has to wait for (N-1) frame slot, then entire N bit-slot (contention period), and another
(N-1) frame slot, so total waiting time is N+2(N-1)d bit slots.
(b) Mok and Ward’s protocol with permuting virtual station numbers?
3
As an example of the worst case scenario with the Mok and Ward protocol, consider 8
stations arranged in virtual priority order of A, B, C, D, E, F, G, S with priority
(7,6,5,4,3,2,1,0). The worst case will occur when every station wants to transmit a frame.
The protocol will allow every station in front of S to transmit, shifting S towards the front
of the line one step at a time. So S will be forced to wait through N contention
countdowns, each of which takes log 2 N bits to complete. After each countdown, one
frame will be transmitted. So in total, S will have to wait through N contention
countdowns and N-1 frame transmissions of length d bits as each other station goes ahead
of S. In total, this takes (N log 2 N ) + (N-1)d bits in the worst case.
5. (4.10) Sixteen stations, numbered 1 through 16, are contending for the use of a
shared channel by using the adaptive tree walk protocol. If all the stations whose
addresses are prime numbers suddenly become ready at once, how many bit slots
are needed to resolve the contention?
Prime numbers less than 16 are 2,3,5,7,11, 13. In this case, stations 2, 3, 5, 7, 11, 13 are
contending for access to the shared channel. Each step will represent a bit slot needed to
resolve the contention for each transmitting station.
B C
D E F G
H I J K L M N O
10 11 12 13 14 15 16
1 2 3 4 5 6 7 8 9
4
• E is tested and encounters a collision from 5 and 7.
• J is tested and 5 transmits uncontested.
• K is tested and 7 transmits uncontested.
• C is tested and encounters a collision from 11 and 13.
• F is tested and 11 transmits uncontested.
• G is tested and 13 transmits uncontested.
After all these tests are complete, there are no more contentions that need to be resolved.
This process took 11 bit slots to complete.
(4.11) A collection of 2 n stations uses the adaptive tree walk protocol to arbitrate
access to a shared cable. At a certain instant, two of them become ready. What are
the minimum, maximum, and mean number of slots to walk the tree if 2 n >> 1 ?
Minimum:
The best case is that the two stations are the first and last station (say 1 and 2 n ). The only
common ancestor is the root node, level 0. So it needs 3 slots.
Maximum:
If two stations have the same parent, it takes 2n+1 slots to walk the tree and this is the
maximum number of slots to walk the tree.
Mean:
The probability that we need to go i level back in the tree to find a common ancestor of
1
the two stations is n −i+1 , and the number of slots to walk the tree is 2(n - i +1) + 1.
2
n
So the mean number of slots to walk the tree is ∑ n−i +1 [ 2( n − i + 1) + 1]
1
i =1 2