CIS 427 Homework #2, Due Tuesday, February 11, 2003

advertisement
Solutions for CIS 527 Exercise #1.
1. Design a reliable byte-stream protocol that uses a sliding window (like TCP). This protocol
will run over a 100-Mbps network. The RTT of the network is 80 ms, and the maximum
segment lifetime is 300 seconds. How many bits would you include in the
AdvertisedWindow and SequenceNum fields of your protocol header? (Note that 210 = 1K,
220 = 1M, 230 = 1G = 1024 M)
Solution:
Bandwidth = 100 Mbps
RTT = 80 ms
MSL = 300 seconds
Advertised Window Size = BW * RTT
= 100Mbps * 80 ms
= (100 * 220 ) b/s * (80 * 10-3 ) sec
= 100 * 220 * (80 * 10-3 ) bits
= 8 * 220 bits = 8 Mbits = 1M Bytes = 220 Bytes
Hence Advertised Window Size = 20 bits
Size
= BW * MSL
= 100 Mbps * 300sec
= 30000Mbits
= 3750 MB < 4GB = 232 B
Hence we need 32 bits in the Sequence Number Field
2. (15 points) Suppose host A sends two TCP segment back to back to host B over TCP
connection. The first segment has sequence number 90; the second has sequence number
110.
a) How much data is in the first segment?
b) Suppose that the first segment is lost but the second segment arrives at B. In the
Acknowledgement that host B sends to host A, what will be the acknowledgement number?
Solution:
i.
ii.
Data Size in the First Segment: 110 –90 = 20 bytes
Acknowledgement Number = 90
3. Exercises Ch5 : problem 12, on Page 439
Solution:
(a) This is 125MB/sec; the sequence numbers wrap around when we send 232 B = 4GB. This
would take 4GB/(125MB/sec) = 32 seconds.
(b) Incrementing every 32 ms, it would take about 32×4×109 ms, or about four years, for the
timestamp field to wrap.
4. Exercises Ch5 : problem 26, on Page 442
Solution:
Using initial Deviation =1.0 it took 21 iterations for TimeOut to fall below 4.0. With an
initial Deviation of 0.1, it took 20 iterations; with an initial Deviation of 2 it took 22.
Iteration SampleRTT EstRTT Dev
0
1.00
4.00 1.00
1
1.00
3.63 1.25
2
1.00
3.31 1.42
3
1.00
3.03 1.53
4
1.00
2.78 1.59
5
1.00
2.56 1.61
6
1.00
2.37 .61
7
1.00
.20
1.58
8
1.00
2.05 1.54
9
1.00
1.92 1.48
10
1.00
1.81 1.41
11
1.00
1.71 1.34
12
1.00
1.63 1.27
13
1.00
1.56 1.19
14
1.00
1.49 1.12
15
1.00
1.43 1.05
16
1.00
1.38 .98
17
1.00
1.34
.91
18
1.00
1.30
.84
19
1.00
1.27 .78
20
1.00
1.24 .72
21
1.00
1.21 .66
diff
TimeOut
-3.00
-2.63
-2.31
-2.03
-1.78
-1.56
-1.37
-1.20
-1.05
-.92
-.81
-.71
-.63
-.56
-.49
-.43
-.38
-.34
-.30
-.27
-.24
8.63
8.99
9.15
9.14
9.00
8.81
8.52
8.21
7.84
7.45
7.07
6.71
6.32
5.97
5.63
5.30
4.98
4.66
4.39
4.12
3.85
Download