CS 455 - Introduction to Computer Networks
Homework 2

Due: See class webpage.

#### Question 1: 10 pts

• In class, we have seen that the Stop-and-Wait protocol can ensure reliable communication using infinite sequence numbers.

Prove that the Stop-and-Wait protocol will operate correctly using only 2 different sequence number

I.e.: you only need to label the frame in Stop-and-Wait using sequence numbers:

 0 and 1

Your proof should focus only on why using 2 seequence numbers will not cause ambiguity

#### Question 2: 10 pts

A sender and a receiver is using the Stop-and-Wait protocol. The one-way propagation delay between the sender and receiver (and back from receiver to sender) is 1 msec.

The transmission data rate on the link is 1 Gbps.

Each data frame consists of 10000 bits and each ACK frame is 100 bits long.

The sender needs to transfer a file of 1,000,000 bytes.

There are no transmission errors.

• How long will it take for the sender to completely transfer the file. (10 pts)

Show your derivation to get full credit.

#### Question 3. (20 pts)

Suppose you are designing a Go-back-N sliding window protocol for a 1 Mbps point-to-point link to the moon.

The a one-way propagation delay between earth and moon is 1 sec.

Assume that the frame size is fixed and is equal to 1 KBytes, you can assume that 1 KBytes = 8000 bits.

You can assume the ACK frame is negligible.

• Assuming there is no transmission errors, and Go-back-N uses a send/receive window size of 100, what is the link utilization (i.e., what fraction of the 1 Mbps is used to transmit data frames) (10 pts)

 You cannot simply apply the Stop-and-Wait utilization formula. Take a look at how the utilization in Stop-and-Wait is calculated Apply the logic to compute the utilization in Go-back-N

• Assuming there are no transmission errors, what is the minimum number of bits you need for the sequence number that will allow you to use the entire capacity of the link ? (10 pts)

Hint: find the smallest send window size that will will allow the node to transmit continuously (without stopping)

#### Question 4. (20 pts)

A sliding window protocol uses the cumulative ACK scheme (where ACK n means reception of all frames upto and including frame n).

The number of bits in the sequence number field is 3 (8 different sequence numbers).

A receive windows size and send window size is 5.

The initial send and receiver windows are {0,1,2,3,4}.

The following events occurs at the receiver in the given sequence:

1. The receiver first receives the frame numbered with seq. no. 3. What ACK message (give sequence number) will the receiver send back to the sender ? (2 pts)

2. The receiver next receives the frames numbered with seq. no. 0 and 2. What ACK message (give sequence number) will the receiver send back to the sender ? (2 pts)

3. The receiver next receives the frame numbered with seq. no. 1. What ACK message (give sequence number) will the receiver send back to the sender ? (2 pts)

4. The receiver next receives the frame numbered with seq. no. 0. What ACK message (give sequence number) will the receiver send back to the sender ? (2 pts)

 Is this frame always a retransmission or can this frame be a new frame ? Show your reason (with a diagram with frame receive/loss events) to get full credit. (5 pts)

5. The receiver next receives the frame numbered with seq. no. 1. What ACK message (give sequence number) will the receiver send back to the sender ? (2 pts)

 Is this frame always a retransmission or can this frame be a new frame ? Show your reason (with a diagram with frame receive/loss events) to get full credit. (5 pts)

#### Question 5. (10 pts)

• In an Aloha network, the arrival rate is 20 messages per sec

Messages have the same length and it takes 0.1 sec to transmit a message.

 What is the throughput if the Aloha network uses unslotted transmissions (5 pts) What is the throughput if the Aloha network uses slotted transmissions (5 pts)

#### Question 6. (10 pts)

The maximum network diameter in Ethernet is 2500 m, i.e., the distance between any two nodes on an Ethernet is 2500 m. The speed of electrical signals in copper is 2x108 m/sec.

• What is the maximum end-to-end propagation delay ? (5 pts)

At time t = 0, an Ethernet host senses that the channel is idle and immediately begin to transmit. As you know, the Ethernet host will sense the channel (while it is transmitting) for possible collision.

• After how many seconds of sensing can this Ethernet host be certain that there will not be any collisions ? I.e., when can it stop sensing (because it is sure there won't be a collision). (5 pts)

#### Question 7. (20 pts)

(This question is adapted from Question 37 in the text book on page 164. --- from an old edition :))

Let A and B be two Ethernet hosts attempting to transmit on an Ethernet. Each has a steady queue of frames ready to send; A's frames will be numbered as A1, A2 and so on, and B's frames will be numbered as B1, B2 and so on. The backoff time unit is T = 50 micro seconds.

Suppose A and B simultaneously attempt to send frame 1, collide and A chooses backoff time 0xT and B chooses backoff time 1xT. So A wins the race and transmits A1 while B waits for A to finish its transmission.

• At the end of A's transmission, B will attempt to transmit frame B1 and A will attempt to transmit frame A2. Their transmissions will collide immediately and A will back off for either 0xT or 1xT and B will back off for either 0xT, 1xT, 2xT or 3xT - each outcome is equally likely.

 Find the probability that A will win the second backoff race after the first collision (this happens when A's choice of backoff time is (strictly) less than B's choice). (5 pts) Find the probability that here is a collision (5 pts)

• Suppose A wins the second backoff race. A will now attempt to transmit frame A3 while B is still attempting to transmit frame B1. B will now pick a back-off time from 0xT, 1xT, 2xT, 3xT 4xT, 5xT, 6xT, and 7xT - each outcome is equally likely.

 Find the probability than A wins the third backoff race (5 pts) Find the probabiliuty that there is a collision (5 pts)