0% found this document useful (0 votes)
167 views7 pages

TDTS06 Computer Networks

A computer on a 7 Mbps network is regulated by a token bucket that is initially filled to 2 Mbps capacity. The token bucket refills at 1 Mbps. The computer can transmit at the full 7 Mbps rate for 0.5 seconds before needing more tokens.

Uploaded by

Shalu Tuteja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
167 views7 pages

TDTS06 Computer Networks

A computer on a 7 Mbps network is regulated by a token bucket that is initially filled to 2 Mbps capacity. The token bucket refills at 1 Mbps. The computer can transmit at the full 7 Mbps rate for 0.5 seconds before needing more tokens.

Uploaded by

Shalu Tuteja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 7

TDTS06 Computer Networks

Exercises
Networking basics
1. Calculate the total time required to transfer a 1000-KB file, with RTT of 100 ms, packet size of 1 KB data, and
and initial ! RTT of handshakin" #efore data is sent.
o a$The #andwidth is 1.% &#ps, and data packets can #e sent continuousl' ()#ack-to-#ack)$.
o #$The #andwidth is 1.% &#ps, #ut after we finish sendin" each data packet we must wait one RTT
#efore sendin" the ne!t.
o c$The #andwidth is )infinite), meanin" that we take transmit to #e zero, and up to 0 packets can #e
sent per RTT.
o d$The #andwidth is infinite, and durin" the first RTT we can send one packet (
1-1
$, durin" the second
RTT we can send two packets (
-1
$, durin" the third we can send four (
*-1
$, and so on.
A: We count a transfer as completed when the last bit of data has arrived 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 (! ms" lon#er."
a" $ initial RTTs ($!! ms" % &!!! K'(&. )bps (transmit time" % RTT($ (propa#ation of data" * !.$! % + )bit(&.
)bps % !.! * !.$! % .,, seconds % !.! * .+ seconds. (With me#a * &!
-
."
b" To a" above we add the time for ... RTTs, which is the number of RTT/ between when packet & arrives and packet
&!!! arrives. The total time is then ., % .... * &!.0, seconds.
c" This is 0.. RTTs % the initial handshake of $ RTTs * 0.. % !.$! * .& seconds. (We onl1 count the time for data
arrivin#, not includin# the final ACK for the last packet, as stated in the introduction above."
d" Ri#ht after the handshakin# of $!! ms we send one packet. 2ne RTT after the handshakin# we send two packets,
after two RTTs four packets, etc. At n+ RTTs past the initial handshakin# we have sent & % $ % 0 % ... % $
n
* $
n%&
3 &
packets. At n * . we have sent all &!!! packets. The last batch arrives !. later. Total time is $ % .. RTTs * !.$! %
!.. * &.& seconds. (This is actuall1 what we do in a slowstart in TC45 see the chapter about con#estion control6"
. Calculate the #andwidth ! dela' product for the followin" links. ,se one-wa' dela', measured from the first #it
sent to the last #it recei-ed.
o a$ 10-&#ps .thernet with a dela' of 10 microsecs
o #$ 10-&#ps .thernet with a sin"le store-and-forward switch (the switch #e"ins retransmittin" after it
has finished recei-in" the packet$, packet size %000 #its, and a 10 microsecs per link propa"ation dela'
o c$ 1.%-&#ps T1 link, with a transcontinental one-wa' dela' of %0 ms
o d$ 1.%-&#ps T1 link throu"h a satellite in "eos'nchronous or#it, *%,/00 km hi"h. The onl' dela' is
speed-of-li"ht propa"ation dela'.
A:
o a" The b 7 w product is &! 7 &!
-
bits(sec 7 &! 7 &!
3-
secs * &!! bits * &$. b1tes
b" The first3bit dela1 is $! microsecs throu#h the store3and3forward switch. The bandwidth 7 dela1 product is thus &!
)bps 7 $! microsecs * $!! bits (Alternativel1, 1ou can think of it as each link can hold &!! bits and the switch can
hold !!! bits."
c" &. 7 &!
-
bits(sec 7 ! 7 &!
3,
sec * 8,!!! bits * .,8 b1tes
d" 4lease note that this should be throu"h a satellite, that is, between two #round stations, not to a satellite. The total
one3wa1 travel distance between two #round stations throu#h a satellite is then $ 7 ,,.!!,!!! meters. With a
propa#ation speed of c * , 7 &!
+
meters(sec, the one3wa1 propa#ation dela1 is thus $ 7 ,,.!!,!!! ( c * !.$0 sec.
'andwidth 7 dela1 is thus &. 7 &!
-
bits(sec 7 !.$0 sec * ,-!,!!! bits * appro7. 0 K'1tes.
*. 0ma"ine that 'ou ha-e trained 'our polecat 1oran to carr' a #o! full of three 2 mm tapes. These tapes each
contain 3 1B. The polecat can tra-el to 'our side, where-er 'ou are, at 12 km4hour. 5or what ran"e of distances does
1oran ha-e a hi"her data rate than a transmission line whose data rate (e!cludin" o-erhead$ is 1%0 &#ps6
A: The polecat can carr1 $& 9', or &-+ 9bits. A speed of &+ km(hour e:uals !.!! km(sec. The time to travel a
distance 7 km is 7(!.!! sec * &(!.!! 7 sec * $!! 7 sec, 1ieldin# a data rate for the polecat of &-+ 9bits(($!!7"
bits(sec, or +0! )bits(7 bits(sec * +0!(7 )bps. ;ow, if the polecat is to be faster than the transmission line of &!
)bps, then +0!(7 < &! *< 7 * +0!(&! * .- km
7. Calculate the latenc' for the followin" (from the first #it to the last #it$8
o a$10-&#ps .thernet with a sin"le store-and-forward switch in the path, and a packet size of %000 #its.
9ssume that each link introduces a propa"ation dela' of 10 microsecs, and that the switch #e"ins retransmittin"
immeadiatl' after it has finished recei"in the packet.
o #$ as in a$, #ut with three switches
o as #$ a#o-e, #ut with switches that implement )cut-throu"h switchin"), which means the' are a#le to
#e"in transmittin" the packet after the first 00 #its ha-e #een recei-ed (another t'pe of switch, which can #e found
in real life$.
A:
a" 2ne packet consists of !!! bits, so the dela1 due to bandwidth is !! microseconds alon# each link (se the fi#ure
in the te7tbook". The packet is also dela1ed &! microseconds on each of the two links due to propa#ation dela1, for a
total of &!$! microseconds.
b" With three switches and four links, the dela1 is 0 7 !! microseconds % 0 7 &! microseconds * $.!0 milliseconds
(ms"
c" With cutthrou#h and three switches, each switch dela1s the packet b1 $!! bits * $! microseconds. There is still
one !! microseconds dela1 waitin# for the last bit, so the total is !! % , 7 $! % 0 7 &! * -!! microseconds.
=n other words, the last bit still arrives !! microseconds after the first bit5 the first bit now faces four link dela1s and
three switch dela1s but never has to wait for the last bit alon# the wa1.
With cutthrou#h and one switch, the total is !! % & 7 $! % $ 7 &! * 0! microseconds.
TCP
1. :uppose TC; operates o-er a 1-1#ps link.
o a$ <ow lon" would it take for the TC; sequence num#ers to wrap around completel'6
o #$ :uppose an added *-#it timestamp field increments 1000 times durin" the wraparound time 'ou
found out a#o-e. <ow lon" would it take for the timestamp to wrap around6
A:
o a" >irst, we convert the speed of the link to the unit of b1tes: & 9bps * (& 9bits ( + bits" * &$ )'(sec.
The se:uence numbers wrap around when we have sent $
,$
' worth of se#ments * 0 9'. 2n the link #iven in the
:uestion, the wrap3around would take 0 9' ( (&$ )'(sec" * ,$ seconds.
o b" =ncrementin# ever1 ,$ ms (,$ secs(&!!!", it would take about ,$ 7 0 7 &!
.
ms, or about four 1ears,
for the timestamp field to wrap.
$. Checksum e!ample e!ercise. ?: /uppose the followin# block of &- bits is to be sent usin# a checksum of + bits
(we simplif1 the ori#inal =nternet checksum al#orithm, which uses &- bits":
,. <--- 10101001 00111001

a" What is the final pattern sent@
b" /how how the receiver determines if there is an error or not in the messa#e pattern sent6
c" /uppose there is a burst error of len#th five that affects four bits in the messa#e:
<--- 10101111 11111001
^^ ^^
errors

/how how the error is detected b1 the receiver6
A
a" >irst, the numbers are added usin# oneAs complement arithmetic to #et the checksum:
10101001
00111001
--------
Sum 11100010
Checksum: 00011101

The pattern sent is then:
<--- 10101001 00111001 00011101
checksum

b" When the receiver adds the three sections to#ether, it will #et all &s, which, after complementin# is all !s and
shows that there is no error:
10101001
00111001
00011101
--------
Sum 11111111
Complement 00000000 means that the pattern is O.K.

c" When the receiver adds the three sections to#ether, it #ets
10101111
11111001
00011101
-----------
Result 1 11000101
Carry 1
-----------
Sum 11000110
Complement 00111001 means that the pattern is corrupted, ecause the complement is not !ero

IP
1. The ta#le #elow is a routin" ta#le usin" C0=R. 9ddress #'tes are in he!adecimal. The notation )41) in
C7.%0.0.0.041 denotes a netmask with 1 leadin" 1 #its, that is, 55.50.0.0. >ote that the last three entries co-er
e-er' address and thus ser-e in lieu of a default route. :tate to what ne!t hop the followin" will #e deli-ered8
o C7.%..1*.23
o C7.%...0/
o C*.71.20.0
o %..7*./1.1
o C7.?=.*1..
o C7.?B.*1..
". Routin# tale:
$. -----------------------------
%. &et'(ask )en#th &e*t +op
,. -----------------------------
-. C%.,0.0.0'1" .
/. C%.,0.10.0'"0 1
2. C%.-0.0.0'1" C
3. C%.-2.0.0'1% 4
10. 20.0.0.0'1 0
11. %0.0.0.0'" 5
1". 00.0.0.0'" 6
1$. -----------------------------

A: The destinations are as follows:
a" '.
b" A.
c" B.
d" >.
e" C.
f" C (note that the first &0 bits of C0.-' and C0.-+ match6".
17. 9 computer on a ?-&#ps network is re"ulated #' a token #ucket. The token #ucket is filled at a rate of 1 &#ps. 0t
is initiall' filled to the capacit' with 2 &#ps. <ow lon" can the computer transmit at the full ? &#ps6
A: Det us denote the call burst len#th / secs, token bucket capacit1 C b1tes, token arrival rate p b1tes(sec, and ma7.
output rate ) b1tes(sec. Then the output burst contains a ma7imum of C % p/ b1tes. We also know that the number
of b1tes in a ma73speed burst of len#th / seconds i )/. /o we have C % p/ * )/. We solve the e:uation and #et / *
C ( () 3 p". =f we denote the capacit1 of the token bucket with C * + me#abits, the token #eneration rate with p * &,
the transmission rate of the computer with ) * -5 then we #et the time (or burst len#th" as / * C ( () p" * + ( (-
&" * &.- seconds.
Routing
1. Consider the network #elow and assume each node initiall' knows the costs to each of its nei"h#ours. Consider
the distance--ector al"orithm and show the distance ta#le entries at node z when the al"orithm has sta#ilized itself.
A: The first table below shows the initial values at E. The second table shows the contents after one hop of information
received from the nei#hbours, the third after two hops, and the last after three hops (where the least3cost path from
73to3u via E is found".
LANs
1. Consider the arran"ement of self-learnin" switches shown in the fi"ure #elow. 9ssumin" all are initiall' empt',
"i-e the forwardin" ta#les for each of the switchs B1-B7 after the followin" transmission8
o 9 sends to C
o C sends to 9
o = sends to C.
".
$. 1$ ---- C
%. 7
,. 7
-. . ---- 11 ---- 1"
/. 7
2. 7
3. 1% ---- 4
A: When A sends to C, all switchs '&3'0 see the packet and learn where A is because the packet is flooded. Fowever,
when C then sends to A, the packet is routed directl1 to A and '0 does not learn where C is. /imilarl1, when C sends
to C, the packet is routed b1 '$ towards ', onl1, and '& does not learn where C is. The ports of the switchs after the
transmissions are as follows.
/witch '&: A3interface * A5 '$3interface * C (not C"
/witch '$: '&3interface * A5 ',3interface * C5 '03interface * C
/witch ',: '$3interface * A,C5 C3interface * C
/witch '0: '$3interface * A (not C"5 C3interface * C.

You might also like