professor:ianfoster tas:xuehaizhang,yongzhao winterquarter · 2003. 1. 31. · 3...

28
Professor:IanFoster TAs:XuehaiZhang,YongZhao WinterQuarter www.classes.cs.uchicago.edu/classes/archive/2003/winter/54001-1

Upload: others

Post on 03-Feb-2021

2 views

Category:

Documents


0 download

TRANSCRIPT

  • Professor: Ian FosterTAs: Xuehai Zhang, Yong Zhao

    Winter Quarterwww.classes.cs.uchicago.edu/classes/archive/2003/winter/54001-1

  • 2

    • Calculate the total time required to transfera 1000 KB file (RTT=100 ms, packet size = 1KB, handshaking = 2 x RTT)(a)bandwidth=1.5 Mbps, data packets sentcontinuously2 initial RTT’s (200ms) + 1000KB/1.5Mbps(transmit) + RTT/2 (propagation) H 0.25 +8Mbit/1.5Mbps =0.25+5.33 sec=5.58 sec. Ifwe pay more careful attention to when amega is 106 versus 220, we get 8,192,000bits/1,500,000 bits/sec = 5.46 sec, for a totaldelay of 5.71 sec.

  • 3

    (b) bandwidth=1.5 Mbps, wait one RTT before sending thenext packetTo the above we add the time for 999 RTTs (the numberof RTTs between when packet 1 arrives and packet 1000arrives), for a total of 5.71 + 99.9 = 105.61.

    (c) bandwidth = � ( transmit time = 0), 20 packets perRTTThis is 49.5 RTTs, plus the initial 2, for 5.15 seconds.

    (d) bandwidth = �, send 2n-1 packets at n-th RTT.At n RTTs past the initial handshaking we have sent 1 +2 + 4 + … + 2n = 2n+1 - 1 packets. At n = 9 we havethus been able to send all 1,000 packets; the last batcharrives 0.5 RTT later. Total time is 2+9.5 RTTs, or 1.15sec.

  • 4

    • Consider a LAN with a maximum distance of2km. At what bandwidth would propagationdelay (at a speed of 1 x 108 m/s) equaltransmit delay for 100-byte packets? Whatabout 512-byte packets?Propagation delay is 2×103m/(2×108m/sec) =1×10-5 sec = 10ìs. 100 bytes/10ìs is 10bytes/ìs, or 10 MB/sec, or 80 Mbit/sec. For512-byte packets, this rises to 409.6Mbit/sec.

  • 5

    • What properties of postal addresses would belikely to be shared by a network addressscheme? What differences might you expectto find? What properties of telephonenumbering might be shared by a networkaddressing scheme?

  • 6

    • Postal AddressesPostal addresses are strongly hierarchical (witha geographical hierarchy, which networkaddressing may or may not use). Addressesalso provide embedded “routing information”.Unlike typical network addresses, postaladdresses are long and of variable length andcontain a certain amount of redundantinformation. This last attribute makes themmore tolerant of minor errors andinconsistencies.

  • 7

    • Telephone NumbersTelephone numbers are more similar tonetwork addresses (although phone numbersare nowadays apparently more like networkhost names than addresses): they aregeographically) hierarchical, fixed-length,administratively assigned, and in more-or-lessone-to-one correspondence with nodes.

  • 8

    • One property of addresses is that they areunique; if two nodes had the same address itwould be impossible to distinguish betweenthem. What other properties might be usefulfor network addresses to have? Can you thinkof any situations in which network ( or postalor telephone) addresses might not be uique?

  • 9

    • One might want addresses to serve as locators,providing hints as to how data should be routed. Oneapproach for this is to make addresses hierarchical.Another property might be administratively assigned,versus, say, the factory-assigned addresses used byEthernet. Other address attributes that might berelevant are fixed-length v. variable-length, andabsolute v. relative (like file names).• If you phone a toll-free number for a large retailer,any of dozens of phones may answer. Arguably, then,all these phones have the same non-unique“address”. A more traditional application for non-unique addresses might be for reaching any of severalequivalent servers (or routers).

  • 10

    • Calculate the effective bandwidth for the following case.For (a) and (b) assume there is a steady supply of data tosend; for (c) simply calculate the average over 12 hours(a) 10-Mbps Ethernet through 3 store-and-forward switchesThe effective bandwidth is 10 Mbps; the sender can senddata steadily at this rate and the switches simply stream italong the pipeline. We are assuming here that no ACKs aresent, and that the switches can keep up and can buffer atleast one packet.(b) sender wait for a 50-byte ack packetThe data packet takes 2.04 ms as in 15(b) above to bedelivered; the 400 bit ACKs take 40ìs/link for a total of4×40ìs + 4×10ìs = 200ìsec = 0.20 ms, for a total RTT of 2.24ms. 5000 bits in 2.24 ms is about 2.2 Mbps, or 280 KB/sec.(c) Overnight (12-hour) shipping of 100 compact disks (650 MBeach)100×6.5×108bytes / 12 hours = 6.5×1010 bytes/(12×3600sec) H 1.5 MByte/sec = 12 Mbit/sec.

  • 11

    • Calculate the bandwidth × delay product for thefollowing links. Use one-way delay, measured fromfirst bit sent to first bit received.(a) 10-Mbps Ethernet with a delay of 10 ìs1×107bits/sec × 10-6 sec = 100 bits = 12.5 bytes.

    (b) 10-Mbps with 1 store-and-forward switch, packet size5000 bits, 10 ìs per link delayThe first-bit delay is 520 ìs through the store-and-forward switch, as in 15(a). 107bits/sec×520×10-6 sec =5200 bits. Alternatively, each link can hold 100 bitsand the switch can hold 5000 bits.

  • 12

    (c) 1.5-Mbps T1 link, with a transcontinental one-waydelay of 50 ms1.5×106 bits/sec × 50 × 10-3 sec = 75,000 bits = 9375bytes

    (d) 1.5-Mbps T1 link through a satellite in geosynchronousorbit, 35,900 km high. The only delay is speed-of-lightpropagation delay.This was intended to be through a satellite, ie betweentwo ground stations, not to a satellite; this ground-to-ground interpretation makes the total one-way traveldistance 2 × 35,900,000 meters. With a propagationspeed of c = 3×108 meters/sec, the one-waypropagation delay is thus 2 × 35,900,000/c = 0.24 sec.Bandwidth × delay is thus 1.5 × 106 bits/sec × 0.24 sec =360,000 bits H 45 KBytes

  • 13

    • For the network given in Figure 4.39, giveglobal distance-vector tables like those ofTables 4.5 and 4.8 when(a) Each node knows only the distances to itsimmediate neighbors.(b) Each node has reported the info it had in thepreceding step to its immediate neighbors.(c) step (b) happens a second time.

  • 14

    A C

    F

    D

    B

    E

    18

    3

    2

    2

    6

  • 15

    ��6��0

    �2120�

    8��02�

    3�0�16

    �0��2�

    0�38��

    ABCDEF

    FEDCBADistance to Reach NodeInformation Stored atNode

    9�6�70

    421207

    84302�

    330316

    �0342�

    0�3849

    ABCDEF

    FEDCBADistance to Reach NodeInformation Storedat Node

    996970

    421207

    643029

    330316

    603429

    063649

    ABCDEF

    FEDCBADistance to Reach NodeInformation Stored atNode

  • 16

    • For the network give in figure 4.39, show how the link-state algorithmbuilds the routing table for node D.D Confirmed Tentative1. (D,0,-)2. (D,0,-) (A,8,A)(E,2,E)3. (D,0,-) (A,8,A)(E,2,E) (B,4,E)(C,3,E)4. (D,0,-) (A,6,E)(E,2,E) (B,4,E)(C,3,E) (F,9,E)5. (D,0,-) (A,6,E)(E,2,E) (F,9,E)(C,3,E)(B,4,E)6. previous + (A,6,E)7. previous + (F,9,E)

  • 17

    • For the network in Figure 4.39, suppose theforwarding tables are all established as inexercise 12 and then the C-E link fails. Give(a) the tables of A, B, D and F after C and Ehave reported the news.(b) the tables of A and D after their next mutualexchange.(c) the table of C after A exchange with it.

  • 18

    -C--C

    �3��9

    BCDEF

    NexthopcostDest

    --EE-

    ��42�

    ACDEF

    nexthopcostdest

    -E-E-

    �4�2�

    ABCEF

    Nexthopcostdest

    C-C--

    9�6��

    ABCDE

    Nexthopcostdest

    (a) A

    D

    B

    F

  • 19

    DCDDC

    1238109

    BCDEF

    Nexthopcostdest

    AEAEA

    8411217

    ABCEF

    Nexthopcostdest

    AAAAF

    31511136

    ABDEF

    Nexthopcostdest

    (b) A D

    (c) C

  • 20

    • Routing table:

    Interface 0Interface 1R2R3R4

    255.255.255.128255.255.255.128255.255.255.128255.255.255.192

    128.96.39.0128.96.39.128128.96.40.0192.4.153.0(default)

    NextHopSubnetMaskSubnetNumbers

  • 21

    • The router can deliver packets directly over interfaces 0 and 1, or itcan forward packets to router R2, R3, or R4. Describe what therouter does with a packet addressed to each of the followingdestinations:(a) 128.96.39.10Applying the subnet mask 255.255.255.128, we get 128.96.39.0.Use interface0 as the next hop.(b) 128.96.40.12Applying subnet mask 255.255.255.128, we get 128.96.40.0. Use R2as the next hop.(c) 128.96.40.151All subnet masks give 128.96.40.128 as the subnet number. Sincethere is no match, use the default entry. Next hop is R4.(d) 192.4.153.17Next hop is R3.(e) 192.4.153.90None of the subnet number entries match, hence use default routerR4.

  • 22

    • Consider the simple network, in which A andB exchange distance-vector routinginformation. All link have cost 1. Suppose theA-E link fails.

    AE Cx

  • 23

    (a) give a sequence of routing table updates that leads to a routing loopbetween A and BA necessary and sufficient condition for the routing loop to form isthat B reports to A the networks B believes it can currently reach,after A discovers the problem with the A—E link, but before A hascommunicated to B that A no longer can reach E.(b) Estimate the probability of the scenario in (a), assuming A and Bsend out routing updates at random times, each at the sameaverage rate.At the instant that A discovers the A—E failure, there is a 50%chance that the next report will be B’s and a 50% chance that thenext report will be A’s. If it is A’s, the loop will not form; if it is B’s, itwill.(c) Estimate the probability of a loop forming if A broadcasts an updatedreport within 1 second of discovering the A-E failure, and Bbroadcasts every 60 seconds uniformly.At the instant A discovers the A—E failure, let t be the time until B’snext broadcast. t is equally likely to occur anywhere in the interval0d t d 60. The event of a loop forming is the same as the event thatB broadcasts first, which is the event that t < 1.0 sec; the probabilityof this is 1/60.

  • 24

    • The sequence number field in the TCP headeris 32 bit long, which is big enough to coverover 4 billion bytes of data. Even if this manybytes were never transferred over a singleconnection, why might the sequence numberstill wrap around from 232 – 1 to 0?The sequence number doesn’t always beginat 0 for a transfer, but is randomly or clockgenerated.

  • 25

    • Design a reliable byte-stream protocol that uses a slidingwindow (like TCP). This protocol will run over a 100-Mbpsnetwork (RTT=100 ms, MSL=60 s)(a) How many bits would you include in the AdvertisedWindowand SequenceNum fields in the header

    The advertised window should be large enough to keep thepipe full; delay (RTT) × bandwidth here is 100 ms × 100Mbps = 10 Mb = 1.25 MB of data. This requires 21 bits (221= 2,097,152) for the AdvertisedWindow field. Thesequence number field must not wrap around in themaximum segment lifetime. In 60 seconds, 750 MB can betransmitted. 30 bits allows a sequence space of 1024 MB,and so will not wrap in 60 seconds. (If the maximumsegment lifetime were not an issue, the sequence numberfield would still need to be large enough to support twice themaximum window size; see “Finite Sequence Numbers andSliding Window” in Section 2.5.)

  • 26

    (b) How would you determine the numbers givenabove, and which values might be less certain?The bandwidth is straightforward from thehardware; the RTT is also a precisemeasurement but will be affected by anyfuture change in the size of the network. TheMSL is perhaps the least certain value,depending as it does on such things as the sizeand complexity of the network, and on howlong it takes routing loops to be resolved.

  • 27

    • Suppose a host wants to establish the reliability of alink by sending packets an measuring the percentagethat are received; routers, for example, do this.Explain the difficulty doing this over a TCP connection.The problem is that there is no way to determinewhether a packet arrived on the first attempt orwhether it was lost and retransmitted.Having the receiver echo back immediately andmeasuring the elapsed times would help; manyBerkeley-derived implementations measure timeoutswith a 0.5 sec granularity and round-trip times for asingle link without loss would generally be one to twoorders of magnitude smaller. But verifying that onehad such an implementation is itself rather difficult.

  • 28

    • Suppose TCP operates over a 1-Gbps link.(a) How long would it take for the TCP sequence numbersto wrap around completely?This is 125MB/sec; the sequence numbers wrap aroundwhen we send 232 B = 4GB. This would take4GB/(125MB/sec) = 32 seconds.

    (b) Suppose an added 32-bit timestamp field increments1000 times during the wraparound time you foundabove. How long would it take for the timestamp towrap around?Incrementing every 32 ms, it would take about32×4×109 ms, or about four years, for the timestampfield to wrap.