Tanenbaum Solutions

Embed Size (px)

Citation preview

  • 8/13/2019 Tanenbaum Solutions

    1/45

    PROBLEM SOLUTIONS 1

    SOLUTIONS TO CHAPTER 1 PROBLEMS

    1.The dog can carry 21 gigabytes, or 16 gigabits! " s#eed o$ 1 %&'ho(r

    e)(a*s +!++ %&'sec! The ti&e to tra-e* distancex %& isx '+!++ =2+0x sec,

    yie*ding a data rate o$ 168/ 2+0x .b#s or /0/x Mb#s! 0orx !6 %&, thedog has a higher rate than the co&&(nication *ine!2.The L"N &ode* can be gron incre&enta**y! I$ the L"N is 3(st a *ong cab*e!it cannot be bro(ght don by a sing*e $ai*(re 4i$ the ser-ers are re#*icated5 Itis #robab*y chea#er! It #ro-ides &ore co(ting #oer and better interacti-einter$aces!3. " transcontinenta* $iber *in% &ight ha-e &any gigabits'sec o$ bandidth,b(tthe *atency i** a*so be high d(e to the s#eed o$ *ight #ro#agation o-ertho(sands o$ %i*o&eters! In contrast, a 6%b#s &ode& ca**ing a co(ter inthe sa&e b(i*ding has *o bandidth and *o *atency!4. " (ni$or& de*i-ery ti&e is needed $or -oice, so the a&o(nt o$ 3itter in thenetor%is iortant! This co(*d be e7#ressed as the standard de-iation o$ thede*i-ery ti&e! 8a-ing short de*ay b(t *arge -ariabi*ity is act(a**y orse thana so&ehat *onger de*ay and *o -ariabi*ity!5. No! The s#eed o$ #ro#agation is 2++,+++ %&'sec or 2++ &eters'9sec! In 1+9sec the signa* tra-e*s 2 %&! Th(s, each sitch adds the e)(i-a*ent o$ 2 %&o$ e7tra cab*e! I$ the c*ient and ser-er are se#arated by +++ %&, tra-ersinge-en + sitches adds on*y 1++ %& to the tota* #ath, hich is on*y 2:! Th(s,sitching de*ay is not a &a3or $actor (nder these circ(&stances!6.The re)(est has to go (# and don, and the res#onse has to go (# anddon!

    The tota* #ath *ength tra-ersed is th(s 16+,+++ %&! The s#eed o$ *ight in airand -ac((& is ;++,+++ %&'sec, so the #ro#agation de*ay a*one is

    16+,+++';++,+++ sec or abo(t ;; &sec!7.There is ob-io(s*y no sing*e correct anser here, b(t the $o**oing #ointssee& re*e-ant! The #resent syste& has a great dea* o$ inertia 4chec%s andba*ances5b(i*t into it! This inertia &ay ser-e to %ee# the *ega*, econo&ic, andsocia* syste&s $ro& being t(rned (#side don e-ery ti&e a di$$erent #artyco&es to #oer! "*so, &any #eo#*e ho*d strong o#inions on contro-ersia*socia* iss(es, itho(t rea**y %noing the $acts o$ the &atter! "**oing #oor*yreasoned o#inions be to ritten into *a &ay be (ndesirab*e! The #otentia*e$$ects o$ ad-ertising caaigns by s#ecia* interest gro(#s o$ one %ind oranother a*so ha-e to be considered! "nother &a3or iss(e is sec(rity! " *ot o$#eo#*e &ight orry abo(t so&e 1/year %id hac%ing the syste& and $a*si$ying

    the res(*ts!2 PROBLEM SOLUTIONS 0OR

  • 8/13/2019 Tanenbaum Solutions

    2/45

    9.The &ean ro(terro(ter #ath is tice the &ean ro(terroot #ath! N(&berthe*e-e*s o$ the tree ith the root as 1 and the dee#est *e-e* as n.The #ath $ro&

    the root to *e-e* n re)(ires n 1 ho#s, and +!+ o$ the ro(ters are at this *e-e*!

    The #ath $ro& the root to *e-e* n 1 has +!2 o$ the ro(ters and a *ength o$

    n 2 ho#s! 8ence, the &ean #ath *ength, *, is gi-en by

    l =+! (n 15 ++!2 (n 25 ++!12 (n ;5 +!!!

    or

    l =

    i =1 8

    n 4+!5i

    i =1 8

    i 4+!5i

    This e7#ression red(ces to l =n 2.The &ean ro(terro(ter #ath is th(s

    2n 4.10. =isting(ish n +2 e-ents! E-ents 1 thro(gh n consist o$ the corres#onding

    host s(ccess$(**y atteting to (se the channe*, i!e!, itho(t a co**ision! The

    #robabi*ity o$ each o$ these e-ents is #41 #5n 1 . E-ent n +1 is an id*e

    channe*, ith #robabi*ity 41 #5n . E-ent n +2 is a co**ision! Since these

    n +2 e-ents are e7ha(sti-e, their #robabi*ities &(st s(& to (nity! The #roba

    bi*ityo$ a co**ision, hich is e)(a* to the $raction o$ s*ots asted, is then 3(st

    1 n#41 #5n 1 41 #5n .

    11. "&ong other reasons $or (sing *ayered #rotoco*s, (sing the& *eads tobrea%ing

    (# the design #rob*e& into s&a**er, &ore &anageab*e #ieces, and *ayering&eans that #rotoco*s can be changed itho(t a$$ecting higher or *oer ones,12. No! In the ISO #rotoco* &ode*, #hysica* co&&(nication ta%es #*ace on*yinthe *oest *ayer, not in e-ery *ayer!13.

  • 8/13/2019 Tanenbaum Solutions

    3/45

    each! Aith a byte strea&, the &essage bo(ndaries do not co(nt and therecei-er i** get the $(** 2+/ bytes as a sing*e (nit! The $act that there ereorigina**y to distinct &essages is *ost!15. Negotiation has to do ith getting both sides to agree on so&e#ara&eters or-a*(es to be (sed d(ring the co&&(nication! Ma7i&(& #ac%et sie is one

    e7a*e, b(t there are &any others!16.The ser-ice shon is the ser-ice o$$ered by *ayer k to *ayer k +1! "nother

    ser-ice that &(st be #resent is be*o *ayer %, na&e*y, the ser-ice o$$ered to

    *ayer k by the (nder*ying *ayer k 1!

    17.The #robabi*ity, P k , o$ a $ra&e re)(iring e7act*y k trans&issions is the#robabi*ity

    o$ the $irst k 1 attets $ai*ing,p k 1 , ti&es the #robabi*ity o$ the %th

    trans&ission s(cceeding, 41 #).The &ean n(&ber o$ trans&ission is then

    3(st

    k =1 8

    kP k =

    k =1 8

    %41 #5p k 1 =1 p

    1 3333318. 4a5 =ata *in% *ayer! 4b5 Netor% *ayer!19. 0ra&es enca#s(*ate #ac%ets! Ahen a #ac%et arri-es at the data *in%*ayer, theentire thing, header, data, and a**, is (sed as the data $ie*d o$ a $ra&e! Theentire #ac%et is #(t in an en-e*o#e 4the $ra&e5, so to s#ea% 4ass(&ing it $its5!20. Aith n *ayers and h bytes added #er *ayer, the tota* n(&ber o$ header

    bytes#er &essage is hn, so the s#ace asted on headers is hn! The tota* &essage

    sie is M +nh, so the $raction o$ bandidth asted on headers is

    hn / (M +hn5!

    21. Both &ode*s are based on *ayered #rotoco*s! Both ha-e a netor%,trans#ort,and a##*ication *ayer! In both &ode*s, the trans#ort ser-ice can #ro-ide are*iab*e endtoend byte strea&! On the other hand, they di$$er in se-era*ays! The n(&ber o$ *ayers is di$$erent, the T

  • 8/13/2019 Tanenbaum Solutions

    4/45

    16.The ser-ice shon is the ser-ice o$$ered by *ayer k to *ayer k +1! "nother

    ser-ice that &(st be #resent is be*o *ayer %, na&e*y, the ser-ice o$$ered to

    *ayer k by the (nder*ying *ayer k 1!

    17.The #robabi*ity, P k , o$ a $ra&e re)(iring e7act*y k trans&issions is the#robabi*ity

    o$ the $irst k 1 attets $ai*ing,p k 1 , ti&es the #robabi*ity o$ the %th

    trans&ission s(cceeding, 41 #).The &ean n(&ber o$ trans&ission is then

    3(st

    k =1 8

    kP k =

    k =1 8

    %41 #5p k 1 =1 p

    1 3333318. 4a5 =ata *in% *ayer! 4b5 Netor% *ayer!

    19. 0ra&es enca#s(*ate #ac%ets! Ahen a #ac%et arri-es at the data *in%*ayer, theentire thing, header, data, and a**, is (sed as the data $ie*d o$ a $ra&e! Theentire #ac%et is #(t in an en-e*o#e 4the $ra&e5, so to s#ea% 4ass(&ing it $its5!20. Aith n *ayers and h bytes added #er *ayer, the tota* n(&ber o$ headerbytes#er &essage is hn, so the s#ace asted on headers is hn! The tota* &essage

    sie is M +nh, so the $raction o$ bandidth asted on headers is

    hn / (M +hn5!

    21. Both &ode*s are based on *ayered #rotoco*s! Both ha-e a netor%,trans#ort,and a##*ication *ayer! In both &ode*s, the trans#ort ser-ice can #ro-ide a

    re*iab*e endtoend byte strea&! On the other hand, they di$$er in se-era*ays! The n(&ber o$ *ayers is di$$erent, the T

  • 8/13/2019 Tanenbaum Solutions

    5/45

    &(ch too conser-ati-e, since by then #robab*y e-ery te*e-ision in the or*dand #ossib*y bi**ions o$ other a##*iances i** be on ho&e L"Ns connected to

    PROBLEM SOLUTIONS 0OR

  • 8/13/2019 Tanenbaum Solutions

    6/45

    24. =o(b*ing e-ery 1 &onths &eans a $actor o$ $o(r gain in ; years! In @years,the gain is then / ; or 6/, *eading to 6!/ bi**ion hosts! My int(ition says that is&(ch too conser-ati-e, since by then #robab*y e-ery te*e-ision in the or*dand #ossib*y bi**ions o$ other a##*iances i** be on ho&e L"Ns connected to

    4 PROBLEM SOLUTIONS 0OR

  • 8/13/2019 Tanenbaum Solutions

    7/45

    32.There are &any e7a*es, o$ co(rse! So&e syste&s $or hich there isinternationa*standardiation inc*(de coact disc #*ayers and their discs, Aa*%&anta#e #*ayers and a(dio cassettes, ca&eras and ;&& $i*&, and a(to&ated

    PROBLEM SOLUTIONS 0OR

  • 8/13/2019 Tanenbaum Solutions

    8/45

    10. In the te7t it as stated that the bandidths 4i!e!, the $re)(ency ranges5o$ the

    three bands ere a##ro7i&ate*y e)(a*! 0ro& the $or&(*a .! = ./ . 2 ,it is

    c*ear that to get a constant .$, the higher the $re)(ency, the *arger .. has to

    be! The 7a7is in the $ig(re is . , so the higher the $re)(ency, the &ore ..

    yo( need! In $act, .. is )(adratic in . ! The $act that the bands are a##ro7i&ate*ye)(a* is an accidenta* #ro#erty o$ the %ind o$ si*icon (sed!

    11. Start ith . ! =c! Ae %no that c is ; C1+ &'s! 0or .=1 c&, e get ;+

    .8! 0or .= &, e get 6+ M8! Th(s, the band co-ered is 6+ M8 to ;+

    .8!12. "t 1 .8, the a-es are ;+ c& *ong! I$ one a-e tra-e*s 1 c& &ore thanthe other, they i** arri-e o(t o$ #hase! The $act that the *in% is + %& *ong isirre*e-ant!13. I$ the bea& is o$$ by 1 && at the end, it &isses the detector! Thisa&o(nts toa triang*e ith base 1++ & and height +!++1 &! The ang*e is one hose

    tangent is th(s +!++++1! This ang*e is abo(t +!+++? degrees!14. Aith 66'6 or 11 sate**ites #er nec%*ace, e-ery @+ &in(tes 11 sate**ites#asso-erhead! This &eans there is a transit e-ery /@1 seconds! Th(s, there i**be a hando$$ abo(t e-ery &in(tes and 11 seconds!15.The sate**ite &o-es $ro& being direct*y o-erhead toard the so(thernhorion,

    ith a &a7i&(& e7c(rsion $ro& the -ertica* o$ 2 ! It ta%es 2/ ho(rs to

    go $ro& direct*y o-erhead to &a7i&(& e7c(rsion and then bac%!16.The n(&ber o$ area codes as C2 C1+, hich is 16+! The n(&ber o$#re$i7es as C C1+, or 6/+! Th(s, the n(&ber o$ end o$$ices as *i&itedto 1+2,/++! This *i&it is not a #rob*e&!

    17. Aith a 1+digit te*e#hone n(&ber, there co(*d be 1+ 1+ n(&bers,a*tho(gh&any o$ the area codes are i**ega*, s(ch as +++! 8oe-er, a &(ch tighter*i&it is gi-en by the n(&ber o$ end o$$ices! There are 22,+++ end o$$ices,each ith a &a7i&(& o$ 1+,+++ *ines! This gi-es a &a7i&(& o$ 22+ &i**ionte*e#hones! There is si*y no #*ace to connect &ore o$ the&! This co(*dne-er be achie-ed in #ractice beca(se so&e end o$$ices are not $(**! "n endo$$ice in a s&a** ton in Ayo&ing &ay not ha-e 1+,+++ c(sto&ers near it, sothose *ines are asted!18. Each te*e#hone &a%es +! ca**s'ho(r at 6 &in(tes each! Th(s, ate*e#honeocc(#ies a circ(it $or ; &in(tes'ho(r! Tenty te*e#hones can share a circ(it,

    a*tho(gh ha-ing the *oad be c*ose to 1++: (.... 1 in )(e(eing ter&s5 i*ies-ery *ong ait ti&es5! Since 1+: o$ the ca**s are *ong distance, it ta%es 2++te*e#hones to occ(#y a *ongdistance circ(it $(** ti&e! The intero$$ice tr(n%

    PROBLEM SOLUTIONS 0OR

  • 8/13/2019 Tanenbaum Solutions

    9/45

    *ength o$ this &ateria*, ith to strands #er #air has a -o*(&e o$

    2/ / C1+ 2 & ; ! This -o*(&e is abo(t 1,?+ c& ; ! Aith a s#eci$ic gra-ity

    o$ @!+, each *oca* *oo# has a &ass o$ 1/1 %g! The #hone coany th(s ons1!/ C1+ @ %g o$ co##er! "t ; do**ars each, the co##er is orth abo(t /!2 bi**iondo**ars!20. Li%e a sing*e rai*road trac%, it is ha*$ d(#*e7! Oi* can $*o in eitherdirection,b(t not both ays at once!21.Traditiona**y, bits ha-e been sent o-er the *ine itho(t any errorcorrectingsche&e in the #hysica* *ayer! The #resence o$ a

  • 8/13/2019 Tanenbaum Solutions

    10/45

    there$ore 2'1@; H 1;:!31. In both cases +++ sa*es'sec are #ossib*e! Aith dibit encoding, tobitsare sent #er sa*e! Aith T1, ? bits are sent #er #eriod! The res#ecti-e datarates are 16 %b#s and 6 %b#s!32.Ten $ra&es! The #robabi*ity o$ so&e rando& #attern being +1+1+1+1+1

    4on adigita* channe*5 is 1'1+2/!33. " coder acce#ts an arbitrary ana*og signa* and generates a digita* signa*$ro&it! " de&od(*ator acce#ts a &od(*ated sine a-e on*y and generates a digita*signa*!34. 4a5 6/ %b#s! 4b5 ;2 %b#s! 4c5 %b#s!35.The signa* &(st go $ro& + toA in one )(arter o$ a a-eKthat is, in ati&e" '4. In order to trac% the signa*, ste#s &(st $it into the )(arter a-e, or ;2sa*es #er $(** a-e! The ti&e #er sa*e is 1/x so the $(** #eriod &(st be

    *ong eno(gh to contain ;2 sa*esKthat is, " ;2/x or ! &a7 =x ';2.

    36. " dri$t rate o$ 1+ @ &eans 1 second in 1+ @ seconds or 1 nsec #er second!"tO

  • 8/13/2019 Tanenbaum Solutions

    11/45

    is sent at # =$ +x / k% the &essage arri-es! Aith #ac%et sitching, the

    *ast bit is sent at # =x /b.To get to the $ina* destination, the *ast #ac%et &(st

    be retrans&itted k 1 ti&es by inter&ediate ro(ters, each retrans&ission ta%

    ing

    p /b sec, so the tota* de*ay isx / (k 1)p /b +k%. Pac%et sitching is

    $aster i$ $ 4k 1)p /b.43.The tota* n(&ber o$ #ac%ets needed isx /#, so the tota* data headertra$$ic is

    (p +h)x /p bits! The so(rce re)(ires (p +h)x /pb sec to trans&it these bits!

    The retrans&issions o$ the *ast #ac%et by the inter&ediate ro(ters ta%e (# a

    tota* o$ (k 154p +h5/b sec! "dding (# the ti&e $or the so(rce to send a** the

    bits, #*(s the ti&e $or the ro(ters to carry the *ast #ac%et to the destination,

    th(s c*earing the #i#e*ine, e get a tota* ti&e o$ (p +h)x /pb

    (p +h54k 1)/b sec! Mini&iing this )(antity ith res#ect to #,e$ind

    p =77777777 hx / (k 15 .

    44. Each ce** has si7 neighbors! I$ the centra* ce** (ses $re)(ency gro(# ", its

    si7neighbors can (se B,

  • 8/13/2019 Tanenbaum Solutions

    12/45

    26+ C? =1@! %b#s! Th(s, the )(a*ity *oss as an intentiona* tradeo$$ to

    #(t &ore (sers #er ce** and th(s get aay ith bigger ce**s!49. ="MPS (ses ;2 channe*s 4in each direction5 ith three (sers sharing asing*echanne*! This a**os ="MPS to s(##ort (# to 2/@6 (sers si&(*taneo(s*y#er ce**! .SM (ses 12/ channe*s ith eight (sers sharing a sing*e

    channe*! This a**os .SM to s(##ort (# to @@2 (sers si&(*taneo(s*y! Bothsyste&s (se abo(t the sa&e a&o(nt o$ s#ectr(& 42 M8 in each direction5!="MPS (ses ;+ J8 C@2 H 26!?6 M8! .SM (ses 2++ J8 C12/ H2/!+ M8! The di$$erence can be &ain*y attrib(ted to the better s#eech)(a*ity #ro-ided by .SM 41; Jb#s #er (ser5 o-er ="MPS 4 Jb#s #er(ser5!50.The res(*t is obtained by negating each o$ ", B, and C and then addingthethree chi# se)(ences! "*ternati-e*y the three can be added and thennegated!

    The res(*t is 4; 1 1 1 ; 1 1 15!

    51. By de$inition

    S d T =&

    1 333

    i =1 &

    S i " iI$ " sends a + bit instead o$ 1 bit, its chi# se)(ence is negated, ith the ith

    e*e&ent beco&ing " i ! Th(s,

    S d T =&

    1 333

    i =1 &S i (" i 5 =&

    1 333

    i =1 &

    S i " i =+

    52. Ahen to e*e&ents &atch, their #rod(ct is 1! Ahen they do not &atch,

    their #rod(ct is 1! To &a%e the s(& +, there &(st be as &any &atches as

    &is&atches! Th(s, to chi# se)(ences are orthogona* i$ e7act*y ha*$ o$ thecorres#onding e*e&ents &atch and e7act*y ha*$ do not &atch!53.(st co(te the $o(r nor&a*ied inner #rod(cts>

    (1 1 ; 1 1 ; 1 15 d (1 1 1 11 1 1 15' H 1

    (1 1 ; 1 1 ; 1 15 d (1 1 1 1 111 15' H 1

    PROBLEM SOLUTIONS 0OR

  • 8/13/2019 Tanenbaum Solutions

    13/45

    di-ide 1+ .b#s by 6/ %b#s e get 16,2+ ho(ses #er cab*e!

  • 8/13/2019 Tanenbaum Solutions

    14/45

    abo(t @!; trans&issions!2.The so*(tion is4a5 +++++1++ +1+++111 111+++11 111+++++ +111111+4b5 +111111+ +1+++111 111+++11 111+++++ 111+++++ 111++++++111111++111111+

    4c5 +111111+ +1+++111 11+1+++11 111++++++ +11111+1+ +111111+3. "$ter st($$ing, e get " B ES< ES< < ES< ES< ES< 0L". ES< 0L". =!4. I$ yo( co(*d a*ays co(nt on an end*ess strea& o$ $ra&es, one $*ag byte&ightbe eno(gh! B(t hat i$ a $ra&e ends 4ith a $*ag byte5 and there are no ne$ra&es $or 1 &in(tes! 8o i** the recei-er %no that the ne7t byte is act(a**ythe start o$ a ne $ra&e and not 3(st noise on the *ine The #rotoco* is&(ch si*er ith starting and ending $*ag bytes!5.The o(t#(t is +1111+11111++11111+1+!6. It is #ossib*e! S(##ose that the origina* te7t contains the bit se)(ence+111111+ as data! "$ter bit st($$ing, this se)(ence i** be rendered as

    +11111+1+! I$ the second + is *ost d(e to a trans&ission error, hat isrecei-ed is +111111+, hich the recei-er sees as end o$ $ra&e! It then *oo%s

    3(st be$ore the end o$ the $ra&e $or the chec%s(& and -eri$ies it! I$ the chec%s(&is 16 bits, there is 1 chance in 2 16 that it i** accidenta**y be correct,*eading to an incorrect $ra&e being acce#ted! The *onger the chec%s(&, the*oer the #robabi*ity o$ an error getting thro(gh (ndetected, b(t the #robabi*ityis ne-er ero!7. I$ the #ro#agation de*ay is -ery *ong, as in the case o$ a s#ace #robe on ornear Mars or Den(s, $orard error correction is indicated! It is a*so a##ro#riate,

    in a &i*itary sit(ation in hich the recei-er does not ant to disc*ose his*ocation by trans&itting! I$ the error rate is *o eno(gh that an errorcorrectingcode is good eno(gh, it &ay a*so be si*er! 0ina**y, rea*ti&esyste&s cannot to*erate aiting $or retrans&issions!8. Ma%ing one change to any -a*id character cannot generate another -a*idcharacterd(e to the nat(re o$ #arity bits! Ma%ing to changes to e-en bits or tochanges to odd bits i** gi-e another -a*id character, so the distance is 2!9. Parity bits are needed at #ositions 1, 2, /, , and 16, so &essages that donote7tend beyond bit ;1 4inc*(ding the #arity bits5 $it! Th(s, $i-e #arity bits ares($$icient! The bit #attern trans&itted is +11+1+11++11++111+1+110.The encoded -a*(e is 1+1++1++1111!

    PROBLEM SOLUTIONS 0OR

  • 8/13/2019 Tanenbaum Solutions

    15/45

    12. " sing*e error i** ca(se both the horionta* and -ertica* #arity chec%s toberong! To errors i** a*so be easi*y detected! I$ they are in di$$erent ros,the ro #arity i** catch the&! I$ they are in the sa&e ro, the co*(&n #arityi** catch the&! Three errors &ight s*i# by (ndetected, $or e7a*e, i$ so&ebit is in-erted a*ong ith its ro and co*(&n #arity bits! E-en the corner bit

    i** not catch this!13. =escribe an error #attern as a &atri7 o$ n ros by k co*(&ns! Each o$ thecorrect bits is a +, and each o$ the incorrect bits is a 1! Aith $o(r errors #erb*oc%, each b*oc% i** ha-e e7act*y $o(r 1s! 8o &any s(ch b*oc%s are

    there There are nk ays to choose here to #(t the $irst 1 bit, nk 1 ays

    to choose the second, and so on, so the n(&ber o$ b*oc%s is

    n%4n 154n 254n ;5! Undetected errors on*y occ(r hen the $o(r 1 bits

    are at the -ertices o$ a rectang*e! Using

    n%4nk 154nk 254nk ;5

    p =+ k 2

    =+ n 2

    (k p 154n 15

    333333333333333333333333

    14.The re&ainder isx 2 +x +1.

    15.The $ra&e is 1++111+1! The generator is 1++1! The &essage a$tera##endingthree eros is 1++111+1+++! The re&ainder on di-iding 1++111+1+++ by1++1 is 1++! So, the act(a* bit string trans&itted is 1++111+11++! Therecei-ed bit strea& ith an error in the third bit $ro& the *e$t is1+1111+11++!=i-iding this by 1++1 #rod(ces a re&ainder 1++, hich is di$$erent $ro& ero!

    Th(s, the recei-er detects the error and can as% $or a retrans&ission!16.The

  • 8/13/2019 Tanenbaum Solutions

    16/45

    18.To o#erate e$$icient*y, the se)(ence s#ace 4act(a**y, the send indosie5&(st be *arge eno(gh to a**o the trans&itter to %ee# trans&itting (nti* the$irst ac%no*edge&ent has been recei-ed! The #ro#agation ti&e is 1 &s! "t

    T1 s#eed, hich is 1!;6 Mb#s 4e7c*(ding the 1 header bit5, a 6/byte $ra&eta%es +!;++ &sec! There$ore, the $irst $ra&e $(**y arri-es 1!; &sec a$ter its

    trans&ission as started! The ac%no*edge&ent ta%es another 1 &sec togetbac%, #*(s a s&a** 4neg*igib*e5 ti&e $or the ac%no*edge&ent to arri-e $(**y!In a**, this ti&e is ;6!; &sec! The trans&itter &(st ha-e eno(gh indos#ace to %ee# going $or ;6!; &sec! " $ra&e ta%es +!; &s, so it ta%es 121$ra&es to $i** the #i#e! Se-enbit se)(ence n(&bers are needed!19. It can ha##en! S(##ose that the sender trans&its a $ra&e and a garb*edac%no*edge&ent co&es bac% )(ic%*y! The &ain *oo# i** be e7ec(ted asecond ti&e and a $ra&e i** be sent hi*e the ti&er is sti** r(nning!20. Let the senderGs indo be (S l , S * 5 and the recei-erGs be (+ l , + *). Lettheindo sie be ,.The re*ations that &(st ho*d are>

    + =S * S l +1 =A1

    + * + l +1 =,

    S l =+ l =S * +1

    21.The #rotoco* o(*d be incorrect! S(##ose that ;bit se)(ence n(&bersare in(se!

    A3(st sent $ra&e ?!B gets the $ra&e and sends a #iggybac%ed "

  • 8/13/2019 Tanenbaum Solutions

    17/45

    25.

  • 8/13/2019 Tanenbaum Solutions

    18/45

    "BDAEACDACBDE

    1234

    The syste& &ode*ed is &(t(a* e7c*(sion! B and E are critica* sections that&ay not be acti-e si&(*taneo(s*y, i!e!, state BE is not #er&itted! P*ace Cre#resents a se&a#hore that can be seied by eitherA or D b(t not by bothtogether!

  • 8/13/2019 Tanenbaum Solutions

    19/45

    36. PPP as c*ear*y designed to be i*e&ented in so$tare, not in hardareas8=L< near*y a*ays is! Aith a so$tare i*e&entation, or%ing entire*yith bytes is &(ch si*er than or%ing ith indi-id(a* bits! In addition,PPP as designed to be (sed ith &ode&s, and &ode&s acce#t and trans&itdata in (nits o$ 1 byte, not 1 bit!

    37. "t its s&a**est, each $ra&e has to $*ag bytes, one #rotoco* byte, and tochec%s(& bytes, $or a tota* o$ $i-e o-erhead bytes #er $ra&e!SOLUTIONS TO CHAPTER 4 PROBLEMS

    1.The $or&(*a is the standard $or&(*a $or Mar%o- )(e(eing gi-en in section

    /!1!1, na&e*y, " =1/ (..C . 5! 8ere C =1+ and ?1+ / ,so

    " =1/ 41++++ la&b%a5 sec! 0or the three arri-a* rates, e get 4a5 +!1 &sec,4b5 +!11 &sec, 4c5 1 &sec! 0or case 4c5 e are o#erating a )(e(eing syste&

    ith . =./ C =+!@, hich gi-es the 10de*ay!

    2. Aith #(re "LO8" the (sab*e bandidth is +!1/ C6 %b#s H 1+!; %b#s!

    Each station re)(ires 1+ b#s, so N =1+;+0/ 1+ =1+;+ stations!

    18 PROBLEM SOLUTIONS 0OR

  • 8/13/2019 Tanenbaum Solutions

    20/45

    by 1! The res(*t is @, 1, 2, 6, /, , , ?, +, and ;!10. Stations 2, ;, , ?, 11, and 1; ant to send! E*e-en s*ots are needed, iththecontents o$ each s*ot being as $o**os>s*ot 1> 2, ;, , ?, 11, 1;s*ot 2> 2, ;, , ?

    s*ot ;> 2, ;s*ot /> 2s*ot > ;s*ot 6> , ?s*ot ?> s*ot > ?s*ot @> 11, 1;

    PROBLEM SOLUTIONS 0OR

  • 8/13/2019 Tanenbaum Solutions

    21/45

    15. 4a5 N(&ber the $*oors 1?! In the star con$ig(ration, the ro(ter is in the&idd*e

    o$ $*oor /! trans&itter seies cab*e 41+ 9sec5trans&it data 42!6 9sec5=e*ay $or *ast bit to get to the end 4!+ 9sec5recei-er seies cab*e 41+ 9sec5ac%no*edge&ent sent 4;!2 9sec5=e*ay $or *ast bit to get to the end 4!+ 9sec5

    The s(& o$ these is ! 9sec. In this #eriod, 22/ data bits are sent, $or a rateo$ abo(t ;! Mb#s!20. N(&ber the ac)(isition attets starting at 1! "ttet i is distrib(teda&ong2 i 1 s*ots! Th(s, the #robabi*ity o$ a co**ision on attet i is 2 (i 15 .The

    #robabi*ity that the $irst k 1 attets $ai*, $o**oed by a s(ccess on ro(nd k

    is

    P k =41 2 (k 15 5

    i =1 .k 1

    2 (i 15hich can be si*i$ied to

    P k =41 2 (k 15 52 (k 154k 2)/ 2

    The e7#ected n(&ber o$ ro(nds is then 3(st kP k .21. 0or a 1%& cab*e, the oneay #ro#agation ti&e is 9sec, so 2.... 1+ 9sec!

    To &a%e

  • 8/13/2019 Tanenbaum Solutions

    22/45

    in this inter-a*! "t 1 .b#s, a** $ra&es shorter than 1+,+++ bits can be co*ete*ytrans&itted in (nder 1+ 9sec, so the &ini&(& $ra&e is 1+,+++ bits or12+ bytes!22.The &ini&(& Ethernet $ra&e is 6/ bytes, inc*(ding both addresses in theEthernet

    $ra&e header, the ty#e'*ength $ie*d, and the chec%s(&! Since the header$ie*ds occ(#y 1 bytes and the #ac%et is 6+ bytes, the tota* $ra&e sie is ?bytes, hich e7ceeds the 6/byte &ini&(&! There$ore, no #adding is (sed!23.The &a7i&(& ire *ength in $ast Ethernet is 1'1+ as *ong as in Ethernet!24.The #ay*oad is 1++ bytes, b(t hen the destination address, so(rceaddress,ty#e'*ength, and chec%s(& $ie*ds are co(nted too, the tota* is indeed 11!

    PROBLEM SOLUTIONS 0OR

  • 8/13/2019 Tanenbaum Solutions

    23/45

    (sed to increase the $raction o$ $ra&es that arri-e correct*y!33. It is iossib*e $or a de-ice to be &aster in to #iconets at the sa&eti&e!

    There are to #rob*e&s! 0irst, on*y ; address bits are a-ai*ab*e in the headerhi*e as &any as se-en s*a-es co(*d be in each #iconet! Th(s, there o(*d beno ay to (ni)(e*y address each s*a-e! Second, the access code at the start

    o$the $ra&e is deri-ed $ro& the &asterGs identity! This is ho s*a-es te** hich

    22 PROBLEM SOLUTIONS 0OR

  • 8/13/2019 Tanenbaum Solutions

    24/45

    direct*y and not going o-er the bac%#*ane!40.The orst case is an end*ess strea& o$ 6/byte 412bit5 $ra&es! I$ thebac%#*anecan hand*e 1+ @ b#s, the n(&ber o$ $ra&es it can hand*e is 1+ @/ 12! Thisis 1,@;,12 $ra&es'sec!

    PROBLEM SOLUTIONS 0OR

  • 8/13/2019 Tanenbaum Solutions

    25/45

    the )(estion co&es don to the re*ati-e cost o$ /+,+++ bytesec o$ &e&ory-ers(s @6++ byteho#s o$ circ(it ca#acity! I$ &e&ory is de#reciated o-er2 C2 C/+ C;6++ H 1! C1+ ? sec, a bytesec costs 6!? C1+ cents, and/+,+++ o$ the& cost 3(st o-er 2 &i**icents! I$ a byteho# costs 1+ 6 cents,@6++ o$ the& cost @!6 &i**icents! Dirt(a* circ(its are chea#er $or this set o$#ara&eters!

    6.Qes! " *arge noise b(rst co(*d garb*e a #ac%et bad*y! Aith a %bitchec%s(&,there is a #robabi*ity o$ 2 k that the error is (ndetected! I$ the destination$ie*d or, e)(i-a*ent*y, -irt(a*circ(it n(&ber, is changed, the #ac%et i** bede*i-ered to the rong destination and acce#ted as gen(ine! P(t in otherords, an occasiona* noise b(rst co(*d change a #er$ect*y *ega* #ac%et $oronedestination into a #er$ect*y *ega* #ac%et $or another destination!7. It i** $o**o a** o$ the $o**oing ro(tes>ABC=,ABC0,ABE0,ABE.,

    A5=,A50,A5EB, andA5E0! The n(&ber o$ ho#s (sed is 2/!8. Pic% a ro(te (sing the shortest #ath! No re&o-e a** the arcs (sed in the#ath

    3(st $o(nd, and r(n the shortest #ath a*gorith& again! The second #ath i** beab*e to s(r-i-e the $ai*(re o$ any *ine in the $irst #ath, and -ice -ersa! It isconcei-ab*e, tho(gh, that this he(ristic &ay $ai* e-en tho(gh to *inedis3oint#aths e7ist! To so*-e it correct*y, a &a7$*o a*gorith& sho(*d be (sed!9. .oing -ia B gi-es 411, 6, 1/, 1, 12, 5!.oing -ia D gi-es 41@, 1, @, ;, @, 1+5!.oing -ia E gi-es 412, 11, , 1/, , @5!

    Ta%ing the &ini&(& $or each destination e7ce#t C gi-es 411, 6, +, ;, , 5!The o(tgoing *ines are (B, B, , =, E, B5!10.The ro(ting tab*e is /++ bits! Tice a second this tab*e is ritten ontoeach*ine, so ++ b#s are needed on each *ine in each direction!11. It a*ays ho*ds! I$ a #ac%et has arri-ed on a *ine, it &(st beac%no*edged! I$no #ac%et has arri-ed on a *ine, it &(st be sent there! The cases ++ 4has notarri-ed and i** not be sent5 and 11 4has arri-ed and i** be sent bac%5 are*ogica**y incorrect and th(s do not e7ist!12.The &ini&(& occ(rs at 1 c*(sters, each ith 16 regions, each regionha-ing2+ ro(ters, or one o$ the e)(i-a*ent $or&s, e!g!, 2+ c*(sters o$ 16 regions o$1ro(ters! In a** cases the tab*e sie is 1 16 2+ H 1!13.

  • 8/13/2019 Tanenbaum Solutions

    26/45

    14. 4a5 The re-erse #ath $orarding a*gorith& ta%es $i-e ro(nds to $inish! The#ac%et reci#ients on these ro(nds areA

  • 8/13/2019 Tanenbaum Solutions

    27/45

    needed! The &ean n(&ber o$ trans&issions can be $o(nd by rea*iing thatthe

    #robabi*ity o$ a s(ccess$(* trans&ission a** the ay is 41 #52 , hich e i**

    ca** .The e7#ected n(&ber o$ trans&issions is 3(st

    +2 41 5 +3 41 5 2 +!!! =

    133

    = 41 #521 33333333

    0ina**y, the tota* ho#s (sed is 3(st (p 2 p +;5'41 #52 .

    23. 0irst, the arning bit &ethod e7#*icit*y sends a congestion noti$ication totheso(rce by setting a bit, hereas RE= i*icit*y noti$ies the so(rce by si*ydro##ing one o$ its #ac%ets! Second, the arning bit &ethod dro#s a #ac%eton*y hen there is no b($$er s#ace *e$t, hereas RE= dro#s #ac%ets be$ore a**the b($$er are e7ha(sted!24.The ro(ter has to do a##ro7i&ate*y the sa&e a&o(nt o$ or% )(e(eing a#ac%et, no &atter ho big it is! There is *itt*e do(bt that #rocessing 1+ #ac%ets o$ 1++ bytes each is &(ch &ore or% than #rocessing 1 #ac%et o$ 1+++

    bytes!25. It is not #ossib*e to send any #ac%ets greater than 1+2/ bytes, e-er!26. Aith a to%en e-ery 9sec, 2++,+++ ce**s'sec can be sent! Each ce** ho*ds/data bytes or ;/ bits! The net data rate is then ?6! Mb#s!27.The nai-e anser says that at 6 Mb#s it ta%es /'; sec to drain an &egabitb(c%et! 8oe-er, this anser is rong, beca(se d(ring that inter-a*, &oreto%ens arri-e! The correct anser can be obtained by (sing the $or&(*a

    S =C'4M . 5! S(bstit(ting, e get S ='46 15 or 1!6 sec!

    28. 2,B>+,1,E>;,8>;,>;,J>2, and L>1!

    30. 8ere 9is 2 &i**ion and . is 1! &i**ion, so . =./ 9is +!?, and $ro& )(e(eing

    theory, each #ac%et e7#eriences a de*ay $o(r ti&es hat it o(*d in anid*e syste&! The ti&e in an id*e syste& is ++ nsec, here it is 2 9sec! Aith1+ ro(ters a*ong a #ath, the )(e(eing #*(s ser-ice ti&e is 2+ 9sec!31.There is no g(arantee! I$ too &any #ac%ets are e7#edited, their channe*

    &ayha-e e-en orse #er$or&ance than the reg(*ar channe*!32. It is needed in both! E-en in a concatenated -irt(a*circ(it netor%, so&enetor%s a*ong the #ath &ight acce#t 1+2/byte #ac%ets, and others &ighton*y acce#t /byte #ac%ets! 0rag&entation is sti** needed!33. No #rob*e&! (st enca#s(*ate the #ac%et in the #ay*oad $ie*d o$ adatagra&be*onging to the s(bnet being #assed thro(gh and send it!34.The initia* IP datagra& i** be $rag&ented into to IP datagra&s at I1! No

  • 8/13/2019 Tanenbaum Solutions

    28/45

    other $rag&entation i** occ(r!Lin%A;n=#h H @/+ D H7D H+M H+>!!$# H+Lin% +1415 ;n=#h H ++ D H7D H+M H1>!!$# H+425 ;n=#h H /6+ D H7D H+M H+>!!$# H6+

    Lin% +2415 ;n=#h H ++ D H7D H+M H1>!!$# H+425 ;n=#h H /6+ D H7D H+M H+>!!$# H6+35. I$ the bit rate o$ the *ine is b, the n(&ber o$ #ac%ets'sec that the ro(tercane&it is b/1@2, so the n(&ber o$ seconds it ta%es to e&it a #ac%et is 1@2/b!

    To #(t o(t 6,;6 #ac%ets ta%es 2 2@/b sec! E)(ating this to the &a7i&(&

    #ac%et *i$eti&e, e get 2 2@/b =1+! Then, b is abo(t ;,6?,+@1 b#s!

    36. Since the in$or&ation is needed to ro(te e-ery $rag&ent, the o#tion &(sta##ear in e-ery $rag&ent!37. Aith a 2bit #re$i7, there o(*d ha-e been 1 bits *e$t o-er to indicate thenetor%!

  • 8/13/2019 Tanenbaum Solutions

    29/45

    &a##ing can be done correct*y and &(*tiho&ing ith N"T can be &ade toor%!45.Qo( say that "RP does not #ro-ide a ser-ice to the netor% *ayer, it is#art o$the netor% *ayer and he*#s #ro-ide a ser-ice to the trans#ort *ayer! Theiss(e

    o$ IP addressing does not occ(r in the data *in% *ayer! =ata *in% *ayer #rotoco*sare *i%e #rotoco*s 1 thro(gh 6 in

  • 8/13/2019 Tanenbaum Solutions

    30/45

    sche&e that has an e$$iciency o$ 1'1+++ 4+!1 #ercent5, one i** ne-er r(no(t!52.The P-#cl $ie*d te**s the destination host hich #rotoco* hand*er to gi-etheIP #ac%et to! Inter&ediate ro(ters do not need this in$or&ation, so it is notneeded in the &ain header! "ct(a**y, it is there, b(t disg(ised! The Nx#

    ha%- $ie*d o$ the *ast 4e7tension5 header is (sed $or this #(r#ose!53. +" and the ser-er is not*isteningto that #ort, the #ac%et i** not be de*i-ered to the ser-er!4. 4a5 The c*oc% ta%es ;2?6 tic%s, i!e!, ;2?6! sec to cyc*e aro(nd! "t erogeneration

    rate, the sender o(*d enter the $orbidden one at ;2?6! 6+ H

    ;216! sec!

    4b5 "t 2/+ se)(ence n(&bers'&in, the act(a* se)(ence n(&ber is 4t, here #is in sec! The *e$t edge o$ the $orbidden region is 1+4# ;216!). E)(ating

    these to $or&(*as, e $ind that they intersect at # =;61!; sec!

    5. Loo% at the second d(#*icate #ac%et in 0ig! 6114b5! Ahen that #ac%etarri-es, it o(*d be a disaster i$ ac%no*edge&ents to ere sti** $*oatingaro(nd!6. =ead*oc%s are #ossib*e! 0or e7a*e, a #ac%et arri-es atA o(t o$ the b*(e,andA ac%no*edges it! The ac%no*edge&ent gets *ost, b(tA is no o#enhi*e B %nos nothing at a** abo(t hat has ha##ened! No the sa&e thingha##ens to B, and both are o#en, b(t e7#ecting di$$erent se)(ence n(&bers!

    Ti&eo(ts ha-e to be introd(ced to a-oid the dead*oc%s!7. No! The #rob*e& is essentia**y the sa&e ith &ore than to ar&ies!

    8. I$ the "A or A" ti&e is s&a**, the e-ents "

  • 8/13/2019 Tanenbaum Solutions

    31/45

    11. " ero*ength &essage is recei-ed by the other side! It co(*d be (sed $orsigna*ingend o$ $i*e!12. None o$ the #ri&iti-es can be e7ec(ted, beca(se the (ser is b*oc%ed!

    Th(s,on*y #ac%et arri-a* e-ents are #ossib*e, and not a** o$ these, either! Call+),

    Cla-+), Da#aPkt, and C-%i# are the on*y *ega* ones!13.The s*iding indo is si*er, ha-ing on*y one set o$ #ara&eters 4theindoedges5 to &anage! 0(rther&ore, the #rob*e& o$ a indo beingincreased and then decreased, ith the TP=Us arri-ing in the rong order,does not occ(r! 8oe-er, the credit sche&e is &ore $*e7ib*e, a**oing adyna&ic &anage&ent o$ the b($$ering, se#arate $ro& theac%no*edge&ents!14. No! IP #ac%ets contain IP addresses, hich s#eci$y a destination &achine!Once s(ch a #ac%et arri-ed, ho o(*d the netor% hand*er %no hich #rocessto gi-e it to U=P #ac%ets contain a destination #ort! This in$or&ation

    is essentia* so they can be de*i-ered to the correct #rocess!PROBLEM SOLUTIONS 0OR

  • 8/13/2019 Tanenbaum Solutions

    32/45

    19.The de$a(*t seg&ent is ;6 bytes! T

  • 8/13/2019 Tanenbaum Solutions

    33/45

    o-erhead is 2+ bytes! The Ethernet o-erhead is 26 bytes! This &eans that $or1++ bytes o$ #ay*oad, 166 bytes &(st be sent! I$ e are to send 2;,6+$ra&es o$ 166 bytes e-ery second, e need a *ine o$ 2@@ Mb#s! Aith anything$aster than this e r(n the ris% o$ to di$$erent T

  • 8/13/2019 Tanenbaum Solutions

    34/45

    (sing T

  • 8/13/2019 Tanenbaum Solutions

    35/45

    inc*(ded! So&e #eo#*e (se their acade&ic tit*es in their na&es, so e need

    PROBLEM SOLUTIONS 0OR

    Pro$! =r! "bigai* Barbara &essage!

    There is certain*y a $i*e or database here these na&es are *ocated!That $i*e co(*d be e7tended to ha-e a*iases o$ the $or& FF E**en!ohnsonGG that#oint to the #ersonGs &ai*bo7! Then e&ai* can a*ays be sent (sing the#ersonGs act(a* na&e!13.The base 6/ encoding i** brea% the &essage into 1+2/ (nits o$ ; byteseach!Each o$ these i** be encoded as / bytes, $or a tota* o$ /+@6 bytes! I$ theseare then bro%en (# into *ines o$ + bytes, 2 s(ch *ines i** be needed,adding2

  • 8/13/2019 Tanenbaum Solutions

    36/45

    in-o%ed (nti* the (ser co&es bac% $ro& -acation!

    PROBLEM SOLUTIONS 0OR ''!abcd!co&'i&'i&2'a

    34. It o(*d be a hre$Hhtt#>''!ac&!org "

    Adder

    Please enter first number:

    Please enter second number:

    The P8P scri#t that does the #rocessing *oo%s *i%e this>

    Addition The sum is

    38 PROBLEM SOLUTIONS 0OR

  • 8/13/2019 Tanenbaum Solutions

    37/45

    year gets hich ca*endar! " P8P scri#t co(*d a*so be (sed, b(t it o(*d bes*oer!4b5 This re)(ires a *arge database! It &(st be done on the ser-er by (singP8P!4c5 Both or%, b(t a-aScri#t is $aster!38.There are ob-io(s*y &any #ossib*e so*(tions! 8ere is one!

    JavaScript test

    function response(test 3 form) {

    var n = 2;var has 3 factors = 0;var number = eval(test 3 form.number.value);

    var limit = Math.sqrt(number);while (n++ < limit) if (number % n == 0) has 3 factors = 1;document.open();

    document.writeln(" ");if (has 3 factors > 0) document.writeln(number, " is not a prime");

    if (has 3 factors == 0) document.writeln(number, " is a prime");document.writeln(" ");document.close();

    }

    Please enter a number:

  • 8/13/2019 Tanenbaum Solutions

    38/45

    42. S(re! The ISP goes to a n(&ber o$ content #ro-iders and gets their#er&issionto re#*icate the content on the ISPGs site! The content #ro-ider &ighte-en #ay $or this! The disad-antage is that it is a *ot o$ or% $or the ISP tocontact &any content #ro-iders! It is easier to *et a

  • 8/13/2019 Tanenbaum Solutions

    39/45

    53. Aith 1++,+++ c(sto&ers each getting to &o-ies #er &onth, the ser-ero(t#(ts2++,+++ &o-ies #er &onth or abo(t 66++ #er day! I$ ha*$ o$ these are atP!M!, the ser-er &(st hand*e abo(t ;;++ &o-ies at once! I$ the ser-er has totrans&it ;;++ &o-ies at / Mb#s each, the re)(ired bandidth is 1;!2 .b#s!Using O1+11111 ++++1++ 111++++ 1+11+11 1++1+++ 11+++1+ +++1+11 ++1+111 1++11+1 111++++11+111+

    4. "t 1++ .b#s, a bit ta%es 1+ 11 sec to be trans&itted! Aith the s#eed o$*ightbeing 2 C1+ &eters'sec, in 1 bit ti&e, the *ight #(*se achie-es a *ength o$ 2&& or 2+++ &icrons! Since a #hoton is abo(t 1 &icron in *ength, the #(*se is2+++ #hotons *ong! Th(s, e are nohere near one #hoton #er bit e-en at1++ .b#s! On*y at 2++ Tb#s do e achie-e 1 bit #er #hoton!5. 8a*$ the ti&e Tr(dy i** g(ess right! "** those bits i** be regeneratedcorrect*y! The other ha*$ she i** g(ess rong and send rando& bits to Bob!8a*$ o$ these i** be rong! Th(s, 2: o$ the bits she #(ts on the $iber i**be rong! BobGs oneti&e #ad i** th(s be ?: right and 2: rong!6. I$ the intr(der had in$inite co(ting #oer, they o(*d be the sa&e, b(tsince that is not the case, the second one is better! It $orces the intr(der todoa co(tation to see i$ each %ey tried is correct! I$ this co(tation is e7#ensi-e,it i** s*o the intr(der don!

  • 8/13/2019 Tanenbaum Solutions

    40/45

    7.Qes! " contig(o(s se)(ence o$ Pbo7es can be re#*aced by a sing*e Pbo7!Si&i*ar*y $or Sbo7es!8. 0or each #ossib*e 6bit %ey, decry#t the $irst ci#herte7t b*oc%! I$ theres(*ting#*ainte7t is *ega*, try the ne7t b*oc%, etc! I$ the #*ainte7t is i**ega*, try thene7t %ey!

    9.The e)(ation 2 n =1+ 1 te**s (s n, the n(&ber o$ do(b*ing #eriods needed!So*-ing, e get n =1 *og 2 1+ or n =+ do(b*ing #eriods, hich is ? years!

    (st b(i*ding that &achine is )(ite a ay o$$, and MooreGs *a &ay not contin(e$or ? &ore years!

    42 PROBLEM SOLUTIONS 0OR

  • 8/13/2019 Tanenbaum Solutions

    41/45

    g(ess MariaGs #ri-ate %ey4% 1, n 15 by si*y en(&erating di$$erent so*(tions

    o$ the e)(ation % 1 1 =1 &%n 1!

    16. No! The sec(rity is based on ha-ing a strong cry#to a*gorith& and a *ong%ey!

    The @ is not rea**y essentia*! The %ey is hat &atters!17.The + A s $ro& the *ast &essage &ay sti** be in R"M! I$ this is *ost, Tr(dy

    cantry to re#*ay the &ost recent &essage to Bob, ho#ing that he i** not see thatit is a d(#*icate! One so*(tion is $or Bob to rite the + A o$ e-ery inco&ing

    PROBLEM SOLUTIONS 0OR

  • 8/13/2019 Tanenbaum Solutions

    42/45

    nonce, his on nonce, and the #(b*ic %ey! Tr(dy cannot $orge this &essage,and i$ she sends rando& 3(n%, hen decry#ted it i** not contain "*iceGsnonce! To co*ete the #rotoco*, "*ice sends bac% BobGs nonce encry#tedith BobGs #(b*ic %ey!23. Ste# 1 is to -eri$y the V!+@ certi$icate (sing the root

  • 8/13/2019 Tanenbaum Solutions

    43/45

    22. It is doab*e! "*ice encry#ts a nonce ith the shared %ey and sends it toBob!Bob sends bac% a &essage encry#ted ith the shared %ey containing thenonce, his on nonce, and the #(b*ic %ey! Tr(dy cannot $orge this &essage,and i$ she sends rando& 3(n%, hen decry#ted it i** not contain "*iceGsnonce! To co*ete the #rotoco*, "*ice sends bac% BobGs nonce encry#ted

    ith BobGs #(b*ic %ey!23. Ste# 1 is to -eri$y the V!+@ certi$icate (sing the root

  • 8/13/2019 Tanenbaum Solutions

    44/45

    detected beca(se she can &ani#(*ate the chec%s(& thro(gh the encry#tion!30. In &essage 2, #(t + B inside the encry#ted &essage instead o$ o(tside it!Inthis ay, Tr(dy i** not be ab*e to disco-er + B and the re$*ection attac% i**not or%!

    31. Bob %nos that = x &od n =1@1! 8e co(tes 1@1 1 &od ?1@ =/+! "*ice

    %nos that = &od n =/;! She co(tes /; 16 &od n =/+! The %ey is /+!

    The si*est ay to do the abo-e ca*c(*ations is to (se the UNIV bc #rogra&!

    PROBLEM SOLUTIONS 0OR

  • 8/13/2019 Tanenbaum Solutions

    45/45

    39.