=========================preview======================
(comp361)[2009](s)mid~PPSpider^sol_10214.pdf
Back to COMP361 Login to download
======================================================
1.
2.
3.
4.
COMP361 Midterm Exam Suggested Solution
(a)
Width of a bit = 1/(1*106)*2.5*108=250m. R*dprop=1*106*10*103/(2.5*108)=40.
(b)
The maximal bits on the link = 10*103/(2.5*108)*106=40. Time to transmit the packet = 40000/(1*106) + 10*103/(2.5*108) = 40.04 ms
Upper bound: ( M=N-1) N + NM + NM2+ + NM(K-1) = N(1 + M + M2+ + M(K-1) ) = N(1-MK)/(1-M) = N[(N-1)K- 1]/(N-2) . Lower bound: 0 since there may be no neighbor nodes connected to Alice.
(a)
UDP for DNS, TCP for HTTP.
(b)
The total amount of time to get the IP address is
RRT +RRT "
++RRT .
12 n
Once the IP address is known, RRTO elapses to set up the TCP connection and another
RRTO elapses to request and receive the small object. The total response time is
++RRT2RRT +RRT +RRT "
o 12 n
(c) Non-persistent HTTP:
1.
At most one object is sent over a TCP connection;
2.
Each TCP connection is closed after the server sends the object;
Persistent HTTP:
Multiple objects can be sent over single TCP connection between client and server. The total
amount of time to get the IP address is
RRT +RRT "
++RRT .
12 n
For non-persistent HTTP with no parallel TCP connections, once the IP address is known,
RRTO elapses to set up the TCP connection and another RRTO elapses to request and
receive the HTML text; since the there are other ten small objects referenced to by this
HTML text, similar to get the HTML text, 2RRTO elapses to get each object. So the total
time needed is:
++RRT22RRT +RRT +RRT "
o 12 n
(a)
GBN has much better bandwidth utilization than stop-and-wait. Compared with GBN, SR only retransmits packets required for retransmission and removes the unnecessary retransmissions.
(b)
Sender Receiver
Time slot Window Recv Ack Sending Recv Seq Response Ack Expected Seq
1 1 1 1
2 1 2 2
1 1 2
3 2 3 1 3(lost)
2 2 3
4 3 4 2 4
(lost) 3
5 3 4 5 5
4(discard) 2 3
6(3 timeout) 3 4 5 6 2 3 4 5 6
5(discard) 2 3
7 3 4 5 6 2
3 4 5 6 3 4 5 6(lost) 7
8 6 7 8 3 4 5 7 8
7
9(6 timeout) 6 7 8 9 6 7 8 9
7 8 7 8 9
10 9 10 7 8 10
6 7 8 9 9 10
5.
Flow control is to control the sender not to overwhelm receivers capacity to receive data. Congestion control is to handle congestion in network from source to destination. The three mechanisms are: Additive Increase Multiplicative Decrease, Slow start, Conservative after timeout events.
6.
(a) The timeout mechanism. (not stop and wait, it is also used in previous protocols such as rdt2.0).
(b) Ttransmission=1KB/1Gbps=8*10-6.
Utilization = Ttransmission/( Ttransmission+RTT)=8*10-6/(8*10-6 + 2*20*10-3)=2*10-4
7.
(1) Create a socket at 9876
(4)
Create a packet for received data.
(5)
Receive data from the socket.
(6)
Get the ip address of the sender.
(7)
Get the port number of the sender.