HW1-solutions

advertisement
Computer
Networking
Chapter 1 HW
Chapter 1: 3, 5, 10, 11, 13, 16, 18, 26
#3
Calculate the total time required to transfer a 1000-KB file in
the following cases, assuming an RTT of 50 ms, a packet size
of 1 KB data, and an initial 2 x RTT of "handshaking" before
data is sent:
a) The bandwidth is 1.5 Mbps, and data packets can be
sent continuously.
b) The bandwidth is 1.5 Mbps, but after we finish sending
each data packet we must
1-1 wait one RTT before
sending the next.
c) The bandwidth is "infinite," meaning that we take
transmit time to be zero, and up to 20 packets can be
sent per RTT
d) The bandwidth is infinite, and during the first RTT we can
send one packet (21-1), during the second RTT we can
send two packets (22-1), during the third we can send
four (23-1), and so on.
#3
We will count the transfer as completed when the last
data bit arrives at its destination. An alternative
interpretation would be to count until the last ACK
arrives back at the sender, in which case the time
would be half an RTT (25 ms) longer.
a) 2 initial RTT’s (100ms) + 1000KB/1.5Mbps (transmit) +
RTT/2 (propagation = 25ms) ≈ 0.125 +
8Mbit/1.5Mbps = 0.125 + 5.333 sec = 5.458 sec. If we
pay more careful attention to when a mega is 106
versus 220, we get 8,192,000 bits/1,500,000 bps =
5.461 sec, for a total delay of 5.586 sec.
#3
b) To the above we add the time for 999 RTTs (the
number of RTTs between when packet 1 arrives
and packet 1000 arrives), for a total of 5.586 + 49.95
= 55.536.
c) This is 49.5 RTTs, plus the initial 2, for 2.575 seconds.
d) Right after the handshaking is done we send one
packet. One RTT after the handshaking we send
two packets. At n RTTs past the initial handshaking
we have sent 1+2+4+···+2n = 2n+1 −1 packets. At n =
9 we have thus been able to send all 1,000
packets; the last batch arrives 0.5 RTT later. Total
time is 2+9.5 RTTs, or .575 sec.
#5
• Consider a point-to-point link 4 km in
length. At what bandwidth would
propagation delay (at a speed of 2 x
108 m/s) equal transmit delay for 100byte packets?
• What about 512-byte packets?
#5
Propagation delay is
4×103m/(2×108m/s) = 2×10−5sec=20μs.
100bytes/20μs is 5 bytes/μs, or 5 MBps, or 40 Mbps. For
512-byte packets, this rises to 204.8 Mbps or 25.6MBps.
#10
What differences in traffic patterns account
for the fact that STDM is a cost-effective form
of multiplexing for a voice telephone network
and FDM is a cost-effective form of
multiplexing for television and radio networks,
yet we reject both as not being cost effective
for a general-purpose computer network?
#10
• STDM and FDM both work best for channels with constant and
uniform band- width requirements. For both mechanisms
bandwidth that goes unused by one channel is simply wasted,
not available to other channels. Computer communications
are bursty and have long idle periods; such usage patterns
would magnify this waste.
• FDM and STDM also require that channels be allocated (and,
for FDM, be as- signed bandwidth) well in advance. Again,
the connection requirements for computing tend to be too
dynamic for this; at the very least, this would pretty much
preclude using one channel per connection.
• FDM was preferred historically for TV/radio because it is very
simple to build receivers; it also supports different channel
sizes. STDM was preferred for voice because it makes
somewhat more efficient use of the underlying bandwidth of
the medium, and because channels with different capacities
was not originally an issue.
#11
• How "wide" is a bit on a 10-Gbps link?
• How long is a bit in copper wire, where
the speed of propagation is 2.3 x 108
m/s?
#11
• 10 Gbps = 1010 bps, meaning each bit is
10−10 sec (0.1 ns) wide.
• The length in the wire of such a bit is
.1 ns × 2.3 × 108 m/sec = 0.023 m or
23mm.
#13
Suppose a 1-Gbps point-to-point link is being
set up between the Earth and a new lunar
colony.
The distance from the moon to the Earth is
approximately 385,000 km, and data travels
over the link at the speed of light 3x108 m/s.
a) Calculate the minimum RTT for the link.
b) Using the RTT as the delay, calculate the
delay x bandwidth
#13
a) The minimum RTT is
2×385,000,000m/3×108m/s=2.57seconds.
b) The delay × bandwidth product is
2.57s×1Gbps=2.57Gb=321MB.
c) This represents the amount of data the sender can send
before it would be possible to receive a response.
d) We require at least one RTT from sending the request
before the first bit of the picture could begin arriving at
the ground (TCP would take longer). 25 MB is 200Mb.
Assuming bandwidth delay only, it would then take
200Mb/1000Mbps = 0.2 seconds to finish sending, for a
total time of 0.2 + 2.57 = 2.77 sec until the last picture bit
arrives on earth.
#16
Calculate the latency (from first bit sent to last bit
received) for the following:
a) 100-Mbps Ethernet with a single store-and-forward
switch in the path and a packet size of 12,000 bits.
Assume that each link introduces a propagation
delay of 10us and that the switch begins
retransmitting immediately after it has finished
receiving the packet.
b) Same as (a) but with three switches.
c) Same as (a), but assume the switch implements
"cut-through" switching; it is able to begin
retransmitting the packet after the first 200 bits
have been received.
#16
a) On a 100 Mbps network, each bit takes 1/108 = 10 ns to
transmit. One packet consists of 12000 bits, and so is
delayed due to bandwidth (serialization) by 120 μs
along each link. The packet is also delayed 10 μs on
each of the two links due to propagation delay, for a
total of 260 μs.
b) With three switches and four links, the delay is 4 × 120μs
+ 4 × 10μs = 520μs
c) With cut-through, the switch delays the packet by 200
bits = 2 μs. There is still one 120 μs delay waiting for the
last bit, and 20 μs of propagation delay, so the total is
142 μs. To put it another way, the last bit still arrives
120μs after the first bit; the first bit now faces two link
delays and one switch delay but never has to wait for
the last bit along the way.
#18
Calculate the effective bandwidth for the following
cases. For (a) and (b) assume there is a steady supply
of data to send; for (c) simply calculate the average
over 12 hours.
a) 100-Mbps Ethernet through three store-andforward switches as in Exercise 16(b). Switches can
send on one link while receiving on the other.
b) Same as (a) but with the sender having to wait for
a 50·byte acknowledgment packet after sending
each 12,000-bit data packet.
c) Overnight [12-hour) shipment of 100 DVDs that hold
4.7 GB each.
#18
a) The effective bandwidth is 100 Mbps; the sender
can send data steadily at this rate and the
switches simply stream it along the pipeline. We are
assuming here that no ACKs are sent, and that the
switches can keep up and can buffer at least one
packet.
b) The data packet takes 520 μs as in 16(b) above to
be delivered; the 400 bit ACKs take 4 μs/link to be
sent back, plus propagation, for a total of 4 × 4 μs
+4 × 10μs = 56μs; thus the total RTT is 576μs. 12000
bits in 576μs is about 20.8 Mbps.
c) 100×4.7×109bytes/12hours=4.7×1011bytes/(12×3600s
)≈10.9MBps = 87 Mbps.
#26
For the following, assume that no data compression is
done, although in practice this would almost never be
the case. For (a) to (c), calculate the bandwidth
necessary for transmitting in real time:
a) Video at a resolution of 640 x 480, 3 bytes/pixel, 30
frames/second.
b) Video at a resolution of 160 x 120, 1 byte/pixel, 5
frames/second.
c) CD-ROM music, assuming one CD holds 75 minutes
worth and takes 650 MB.
d) Assume a fax transmits an 8x10 black-and-white
image at a resolution of 72 pixels per inch. How
long would this take over a 14.4-kbps modem?
#26
a) 640 × 480 × 3 × 30 bytes/sec = 26.4 MB/sec
b) 160 × 120 × 1 × 5 = 96,000 bytes/sec = 94KB/sec
c) 650MB/75 min = 8.7 MB/min = 148 KB/sec
d) 8 × 10 × 72 × 72 pixels = 414,720 bits = 51,840 bytes.
At 14,400 bits/sec, this would take 28.8 seconds
(ignoring overhead for framing and
acknowledgments).
Download