ECE358: Computer Networks Spring 2012

advertisement
ECE358: Computer Networks
Fall 2014
Solutions to Homework #1
R 11.
Suppose there is exactly one packet switch between a sending host and a receiving host. The
transmission rates between the sending host and the switch and between the switch and the receiving host are
𝑅1 and 𝑅2 , respectively. Assuming that the switch uses store-and-forward packet switching, what is the total
end-to-end delay to send a packet of length 𝐿? (Ignore queuing, propagation delay, and processing delay.)
Store
and
forward
Transmitting
1st bit
π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘  1 =
𝐿
𝑅1
A
t1
R1
Switch
Packet
R2
B
No
processing
delay
L
t2
π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘  2 =
Transmitting
last bit
Time
𝐿
𝑅2
t3
No
propagation
delay
𝐿
𝐿
𝑑𝑒𝑛𝑑−π‘‘π‘œ−𝑒𝑛𝑑 = π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘  1 + π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘  2 = 𝑅1 + 𝑅2
2
R 13.
Suppose users share a 2Mbps (Megabits per second) link. Also suppose each user transmits
continuously at 1Mbps when transmitting, but each user transmits only 20 percent of the time.
a) When circuit switching is used, how many users can be supported?
b) Suppose packet switching is used, why will there be essentially no queuing delay before the link if two or
fewer users transmit at the same time?
a. Circuit switching
Only two users οƒ 
1Mbps+1Mbps= 2Mbps
X
2Mbps
b. Since each user requires 1Mbps when transmitting, if two or
fewer users transmit simultaneously, a maximum of 2Mbps will be
required. Since the available bandwidth of the shared link is
2Mbps, there will be no queuing delay before the link. Whereas, if
three users transmit simultaneously, the bandwidth required will
be 3Mbps which is more than the available bandwidth of the
shared link. In this case, there will be queuing delay before the
link.
3
R 18.
How long does it take a packet of length 1,000 bytes to propagate over a link of distance 2,500 Km,
propagation speed 2.5 X 108 m/s, and transmission rate 2Mbps? More generally, how long does it take a packet
of length L to propagate over a link of distance d, propagation speed s, and transmission rate R bps? Does this
delay depend on packet length? Does this delay depend on transmission rate?
d=2500km
A
R=2Mbps
S = 2.5 ∗ 108 π‘š/𝑠𝑒𝑐
B
Packet
L=1000 Bytes
𝑑
𝑠
π‘‘π‘π‘Ÿπ‘œπ‘ = =
2500 π‘˜π‘š
2.5 ∗105 π‘˜π‘š/𝑠𝑒𝑐
= 10 π‘šπ‘ π‘’π‘
• Depending on packet length οƒŸ No
• Depending on transmission rate οƒŸ No
4
R 19.
Suppose Host A wants to send a large file to Host B. The path from Host A to Host B has three links,
of rates R1= 500kbps, R2=2Mbps, and R3=1Mbps.
a) Assuming no other traffic in the network, what is the throughput for the file transfer?
b) Suppose the file is 4 million bytes. Dividing the file size by the throughput, roughly how long will it take to
transfer the file to Host B?
c) Repeat (a) and (b), but now with R_2 reduced to 100kbps.
X
A
R1=500Kbps
a.
R2=2Mbps
X
B
R3=1Mbps
Throughput=min(R1 , R2 , R3)= R1
= 500Kbps
4∗106 ∗8 𝑏𝑖𝑑𝑠
500 ∗103 𝑏𝑖𝑑/𝑠𝑒𝑐
b.
d=
c.
R2=100Kbps οƒ  throughput = min(R1 , R2 , R3)= R2
= 100Kbps
d=
4∗106 ∗8 𝑏𝑖𝑑𝑠
100 ∗103 𝑏𝑖𝑑/𝑠𝑒𝑐
= 64 𝑠𝑒𝑐
= 320 𝑠𝑒𝑐
5
P 6.
This elementary problem begins to explore propagation delay and transmission delay, two central
concepts in data networking. Consider two hosts, A and B, connected by a single link of rate 𝑅 bps. Suppose that the
two hosts are separated by π‘š meters, and suppose the propagation speed along the link ia 𝑠 meter/sec. π»π‘œπ‘ π‘‘ 𝐴 is to
send a packet of size 𝐿 bits to π»π‘œπ‘ π‘‘ 𝐡.
a) Express the propagation delay , π‘‘π‘π‘Ÿπ‘œπ‘ , in terms of π‘š and 𝑠.
b) Determine the transmission time of the packet , π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘  , in terms of 𝐿 and 𝑅.
c) Ignoring processing and queuing delays, obtain an expression for the end-to-end delay.
d) Suppose π»π‘œπ‘ π‘‘ 𝐴 begins to transmit the packet at time 𝑑 = 0. At time 𝑑 = π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘  , where is the last bit of the packet?
e) Suppose π‘‘π‘π‘Ÿπ‘œπ‘ is greater than π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘  . At time 𝑑 = π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘  , where is the first bit of the packet?
f) Suppose π‘‘π‘π‘Ÿπ‘œπ‘ is less than π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘  . At time 𝑑 = π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘  , where is the first bit of the packet?
g) Suppose 𝑠 = 2.5 × 108 π‘š/𝑠, 𝐿 = 120 bits, and 𝑅 = 56 kbps. Find the distance π‘š so that π‘‘π‘π‘Ÿπ‘ equals π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘  .
m meters
A
R bps
S π‘š/𝑠𝑒𝑐
B
Packet
L bits
a. π‘‘π‘π‘Ÿπ‘œπ‘ =
π‘š
𝑠
𝑠𝑒𝑐
6
Continue P6.
b. π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘  =
c.
d.
e.
f.
𝐿
𝑅
𝑠𝑒𝑐
𝑑𝑒𝑛𝑑−π‘‘π‘œ−𝑒𝑛𝑑 = π‘‘π‘π‘Ÿπ‘œπ‘ + π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘ 
At 𝑑 = π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘  οƒ  the last bit is just leaving host
A.
The first bit is still in the link, and has not
reached Host B yet.
The first bit has aready reached host B.
g. π‘‘π‘π‘Ÿπ‘œπ‘ =
m=
𝐿𝑠
𝑅
π‘š
𝑠
, π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘  =
𝐿
𝑅
= 536 π‘˜π‘š
7
P 7.
In this problem, we consider sending real-time voice from Host A to Host B over a packetswitching network (VoIP). Host A converts analog voice to a digital 64 kbps bit streaming on the fly. Host A then groups
the bits into 56-byte packets. There is one link between Hosts A and B; its transmission rate is 2Mbps and its
propagation delay is 10 msec. as soon as Host A gathers a packet, it sends it to Host B. As soon as Host B receives an
entire packet, it converts the packet's bits to an analog signal. How much time elapses from the time a bit created (from
the original analog signal at Host A) until the bit is decoded ( as part of analog signal at host B)?
π‘‘π‘π‘Ÿπ‘œπ‘ = 10 π‘šπ‘ π‘’π‘
A R=2M bps
Packet
B
L = 56 bytes
Encode rate= 64Kbps
Generating
the packet
π‘‘π‘π‘Ÿπ‘œπ‘
π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘ 
π‘‘π‘π‘Ÿπ‘œπ‘
time
56∗8 𝑏𝑖𝑑𝑠
π‘‘π‘π‘Ÿπ‘œπ‘ =
64∗103 𝑏𝑝𝑠
= 7π‘šπ‘ π‘’π‘, π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘  =
56∗8 𝑏𝑖𝑑𝑠
2∗106 𝑏𝑝𝑠
=
0.224π‘šπ‘ π‘’π‘
Delay till decodeing =7+0.224+10=17.224msec
8
P 10.
Consider a packet of length 𝐿 which begins at end system 𝐴 and travels over three links to a
destination end system. These three links are connected by two packet switches. Let 𝑑𝑖 , 𝑠𝑖 and 𝑅𝑖 denote the length,
propagation speed, and the transmission rate of link 𝑖, for 𝑖 = 1, 2, 3. The packet switch delays each packet by π‘‘π‘π‘Ÿπ‘œπ‘ .
Assuming no queuing delays, in terms of 𝑑𝑖 , 𝑠𝑖 , 𝑅 𝑖 , (𝑖 = 1, 2, 3), and 𝐿, what is the total end-to-end delay for the
packet? Suppose now the packet is 1,500 bytes, the propagation speed on all three links is 2.5 x 108 m/s, the
transmission rates of all three links are 2Mbps, the packet switch processing delay is 3msec, the length of the first link is
5,000 km, the length of the second link is 4,000 km, the length of the last link is 1,000 km . for these values, what is the
end-to-end delay?
d1
A
R1
d3
d2
R2
s1
s2
R3
s3
B
Packet
L
π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘  1
π‘‘π‘π‘Ÿπ‘œπ‘ 1
π‘‘π‘π‘Ÿπ‘œπ‘ 2
π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘  2
π‘‘π‘π‘Ÿπ‘œπ‘ 2
π‘‘π‘π‘Ÿπ‘œπ‘ 3
π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘  3
time
π‘‘π‘π‘Ÿπ‘œπ‘ 3
𝑑𝑒𝑛𝑑−π‘‘π‘œ−𝑒𝑛𝑑 = π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘  1 + π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘  2 + π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘  3 + π‘‘π‘π‘Ÿπ‘œπ‘ 1 + π‘‘π‘π‘Ÿπ‘œπ‘ 2 + π‘‘π‘π‘Ÿπ‘œπ‘ 3 + π‘‘π‘π‘Ÿπ‘œπ‘ 2 + π‘‘π‘π‘Ÿπ‘œπ‘ 3
𝐿
𝐿
𝐿
𝑑1 𝑑2 𝑑3
=
+
+
+
+
+
+ 2 ∗ π‘‘π‘π‘Ÿπ‘œπ‘ = 64π‘šπ‘ π‘’π‘
𝑅1 𝑅2 𝑅3 𝑠1 𝑠2 𝑠3
9
P 11.
In the above problem. Suppose 𝑅1 = 𝑅2 = 𝑅3 = 𝑅 and π‘‘π‘π‘Ÿπ‘œπ‘ = 0. Further suppose the packet
switch does not store-and– forward packets but instead immediately transmits each bit it receives before
waiting for the entire packet to arrive. What is the end-to-end delay?
d1
A
R
s1
d3
d2
R
s2
R
s3
B
Packet
L
π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘  1
π‘‘π‘π‘Ÿπ‘œπ‘ 1
π‘‘π‘π‘Ÿπ‘œπ‘ 2
π‘‘π‘π‘Ÿπ‘œπ‘ 3
time
𝑑𝑒𝑛𝑑−π‘‘π‘œ−𝑒𝑛𝑑 = π‘‘π‘‘π‘Ÿπ‘Žπ‘›π‘  1 + π‘‘π‘π‘Ÿπ‘œπ‘ 1 + π‘‘π‘π‘Ÿπ‘œπ‘ 2 + π‘‘π‘π‘Ÿπ‘œπ‘ 3
𝐿 𝑑1 𝑑2 𝑑3
= +
+
+
𝑅 𝑠1 𝑠2 𝑠3
10
Download