You are on page 1of 9

CMSC 417 Midterm #1 (Spring 1997) - Solution

(15 points) Define or explain the folloing terms!


1 "ount to infinit# pro$lem! % pro$lem ith distan"e &e"tor routing that
"auses it to rea"t slol# of lin' failures sin"e onl# a "ount of hops rather than
the full path is ex"hanged $eteen routers(
) pa"'et! a small unit of "ommuni"ation( *t "an $e &aria$le or fixed si+e, $ut
there is a fixed maximum si+e(
- &irtual "ir"uit &s( pa"'et sit"hed! .irtual "ir"uits in&ol&e using a
"onne"tion esta$lishment message to store traffi" "onne"tion state in a
netor'( .irtual "ir"uits tend to pro&ide stati" routing for a single "onne"tion
and thus ensure in-order deli&er# of pa"'ets(
4 *SD/! *ntegrated Ser&i"es Digital /etor'( % a# to pro&ide ) 04'$ps
"ir"uit sit"hed "hannels o&er a single pair of "opper ire(
5 flooding! a a# to send information from a sour"e to a destination $#
sending the traffi" o&er all lin's( *t its pure form is generall# leads to infinite
traffi", $ut it "an $e useful as a $asis of "omparison( %lso, $# adding a#s to
"ontrol the flood it $e"omes a pra"ti"al algorithm(
(15 points) Consider using a 4'h+ "hannel and 10 dis"rete le&els to send data(
1hat is the maximum possi$le transmission rate if the "hannel is noiseless2
) 3 log) / 4 ) 4,555 log) 10 4 -),555
1hat if the signal to noise ratio is -5d62
7 d6 4 15 log15(S8/) 15 4 -5 log15(S8/) S8/ 4 1,555
3 log)(1 9 S8/) 4 4,555 log)(1 9 1,555) 4,555 log)(15)4) 4 45,555
(15 :oints) % "ellular phone s#stem needs to a""ommodate man# users( ;xplain ho the
s#stem uses spa"e, fre<uen"#, and time di&ision multiplexing(
Spa"e Di&ision! man# "ells permit re-use of the same "hannels in an# to non-ad=a"ent
"ells(
>re<uen"# Di&ision! the "ellular $and is di&ided into ?55 separate "hannels(
@ime Di&ision! fre<uen"ies are onl# allo"ated hen the# are in use( Sin"e most "ell
phones in a single "ell are not in use at an# one time, this is a t#pe of time di&ision
multiplexing(
()5 :oints) Aist the se&en la#ers of the *SB8BS* referen"e model and for ea"h la#er
pro&ide an example of a fun"tion "ommonl# performed at that la#er(
%ppli"ation! mail header format
:resentation! en"r#ption
Session! "ursor mo&ement
@ransport! $#te ordering
/etor'! routing, "ongestion "ontrol
Ain'! sending frames, lin' errors
:h#si"al! representation of 5Cs,1Cs
()5 points) Consider routing in a netor' ith )55 routers, and on a&erage e&er# router is
"onne"ted to 4 other routers( Douting information is ex"hanged e&er# 155mse"( 3o
mu"h netor' $andidth is used under lin'-state and distan"e &e"tor routing to ex"hange
this information( %ssume se<uen"e num$ers are used to damp flood pa"'ets for lin'-state(
:lease explain an# assumptions #ou ma'e a$out the si+e of routing ta$le entries(
Ain'-state!
>or ea"h lin', ea"h router sends Eneigh$or id, lin' stateF () $#tes should $e fine)
>or ea"h route update, ea"h router sends a se<uen"e num$er (4 $#tes is safe)
@herefore ea"h routing message "ontains! 4 lin's x ) $#tes8lin' 9 4 $#tes 4 1) $#tes(
;a"h routing message tra&els o&er e&er# lin' (flooding ith se<uen"e num$ers)
)55 routers x 4 lin's8router 8 () end-points per lin') 4 455 lin's(
Douting messages are send 18155mse" 4 15 messages8se"ond
So )55 routers x 15 msgs8se"-router x 455 lin's x 1) $#tes8msg 4 9(0M $#tes8se"
Distan"e .e"tor!
;a"h routing ta$le entr# "ontains Edest, hop "ount (metri"), next hopF - $#tes
;a"h host maintains a )55 entr# routing ta$le
%t ea"h update, ea"h router sends all of its neigh$ors its entire ta$le
So )55 routers x 15 updates8se"-router x 4 lin'8router x - x )55 $#tes8lin' 4 4(? M68se"
(15 points) *n a $road"ast "hannel, lin' $andidth is asted due to multiple hosts tr#ing
to send at on"e and "an"eling ea"h others "ommuni"ation( % simple model of this
pro$lem is that time is di&ided into dis"rete slots( *f a netor' has n hosts, and the
pro$a$ilit# of an# single host tr#ing to use a slot is p, hat fra"tion of slots are asted
due to "ollisions2
% "ollision is to or more stations sending a on"e( Aet :(x) denote the pro$a$ilit# of x
stations sending at on"e(
:(F4)) 4 1 - :(5) - :(1)
:(5) 4 (1-:)n
:(1) 4 n p (1-:)n-1
(F4)) 4 1 - (1-:)n - n p (1-:)n-1
CMSC 417-5)51 Midterm #1 solution (>all 1997)
SBAG@*B/ %/D HD%D*/H :BA*CI */ *@%A*CS
1() (1) points) Define or explain the folloing terms!
%@M "ell
@he pa"'et used in %@M( 3as fixed si+e of 5- $#tes, "onsisting of 5 $#te header and 4?
$#te pa#load(
HD%D*/H( /eed a referen"e to a Jpa"'etJ( % J$lo"'J is fine(
&irtual "ir"uit &s( pa"'et sit"hed
.irtual "ir"uit the path in "onne"tion-oriented pa"'et sit"hing! the path is esta$lished $#
the "onne"tion re<uest and all pa"'ets of the "onne"tion use that path( :a"'et-sit"hed
means the netor' transfers pa"'ets from sour"e to destination $# store-and-forard
routing( @he routing "an $e either along a &irtual "ir"uit, or ea"h pa"'et "an $e routed
independentl# (datagram or "onne"tionless)(
HD%D*/H( % "omplete anser should in"lude a referen"e to the differen"e in path
organi+ation( % "orre"t des"ription of ea"h term (onl#) "osts 1 point ea"h(
:B@S
:lain Bld @elephone Ser&i"e! the usual telephone dialing and &oi"e (-Kh+ analog)
ser&i"e(
HD%D*/H( %n# referen"e to the traditional telephone goes(
>re<uen"e Di&ision Multiplexing
:ro&iding multiple "hannels on the same ph#si"al media (ired or ireless) $# shifting
the "hannels to distin"t "arrier fre<uen"ies separated $# a suffi"ient gap to a""omodate
the signals on the "hannels(
HD%D*/H( % "orre"t illustration (pi"ture onl#) gets 1 point( % referen"e to JshiftingJ
(onl#) gets 1 point( % &ague referen"e to Jassign fre<uen"#J (onl#) gets 1 point(
)() (1? points) Aimits on information ex"hange(
a) *f e ish to send 1,555 o"tets per se"ond through a ?55h+ "hannel, hat is the
minimum signal to noise ratio in de"i$els2
1555 o"tets per se"ond is e<ui&alent to ?555 '$8s( ShannonCs result for a nois# "hannel
states!
data rate 4 $andidth L log)(1 9 S8/) @hus ?555 4 ?55 log)(19S8/)(
3en"e log)(19S8/)415(
3en"e 19S8/ 4 )LL15415)4(
3en"e S8/415)-,
hi"h in de"i$els is 15Llog15(15)-),
or 15Llog15(1555) approximatel#, hi"h is 15Llog15(15-)(
3en"e approx( -5 d$(
HD%D*/H( Gsing ShannonCs formula! - points( Corre"t formula for d6! - points( B"tets
are ? $its! - points( Corre"tl# plugged in &alues in"luding ta'ing the log1515)-! ) points(
(@he latter turned out to $e a "hallenge() @otal 11 maximum(
$) ;xplain h# using additional $its per $aud ill not in"rease the maximum
transmission rate through a "hannel ith a fixed $andidth and signal to noise ratio2
B$&iousl#, ShannonCs result ma'es it "lear that using additional $its per $aud does not
in"rease the data rate( @he <uestion is h#( @o in"rease the data rate $# in"reasing the $its
per $aud, (1) e need more more signal le&els in order to en"ode more $its per $aud, and
()) e need to ma'e sure that the $auds per se"ond does not de"rease( @his means ha&ing
more le&els in the same time inter&al( 6ut this is not possi$le $e"ause the $andidth
"onstrains the magnitude of a le&el "hange in a gi&en inter&al of time, and the noise
imposes a minimum distan"e $eteen le&els (otherise the le&els "annot $e
distinguished)(
HD%D*/H( Deferen"e to ShannonCs rule (onl#) gets - points( ;xplanation h# it does
not depend on the J$its per $audJ pa"'ing fa"tor gets the rest( (Maximum 7)(
-() (15 points) Aa#ering! 1hat is the differen"e $eteen a proto"ol and a ser&i"e
interfa"e2 ;xplain #our anser in terms of a the *SB se&en la#er model(
M N M N
. M . M
------------------------------------------- S;D.*C;
M N M N
. M . M
OOOOO OOOOO
M M :DB@BCBA M M
M M E-------------F M M
MOOOOOM MOOOOOM
M N M N
. M . M
------------------------------------------- S;D.*C;
M N M N
. M . M
OOOOO OOOOO
M M M M
M M :DB@BCBA M M
MOOOOOM MOOOOOM
M N M N
. M . M
------------------------------------------- S;D.*C;
M N M N
. M . M
% proto"ol is the rules (message formats and semanti"s) folloed $# peer entities, ie,
entities in the same la#er at different sites, for "ommuni"ating ith ea"h other( % ser&i"e
is the rules (ser&i"e primiti&e formats and semanti"s) folloed $# entities in ad=a"ent
la#ers for "ommuni"ating ith ea"h other at the same site(
GRADING. Definition of each (only) gets 7 points (each). Both, 15
points. An example of each (only) gets points.
!.) (" points) A p#opose$ %ay to fix the co&nt'to'infinity p#o(lem in
$istance')ecto# #o&ting is that on a lin* fail&#e the t%o #o&te#s at
eithe# en$ of the lin* imme$iately (#oa$cast ()ia floo$ing) that the
lin* (et%een the t%o #o&te#s has faile$. +ill this sol)e the p#o(lem,
-xplain yo&# ans%e#.
No. In $istance')ecto# #o&ting, each #o&te# A maintains fo# e)e#y othe#
#o&te# B the $istance to B )ia e)e#y neigh(o# of A. .h&s A cannot ma*e
&se of the info#mation that the lin* (et%een t%o #emote #o&te#s, say /
an$ 0.
GRADING. .he negati)e ans%e# gets 5 points. A co##ect explanation gets
15 points. .otal ".
5.) (" points) .he follo%ing 1 p#og#am #&ns t%o th#ea$s, t1 an$ t,
that sha#e t%o intege# )a#ia(les, x an$ y. .h#ea$ t1 exec&tes x$ec()
an$ th#ea$ t exec&tes y$ec(). x$ec() sho&l$ #epeate$ly $o the
follo%ing2 $ec#ement x (y an$ inc#ement y (y 1 if x is at least ,
othe#%ise (loc* &ntil x is at least . y$ec() sho&l$ #epeate$ly $o the
follo%ing2 $ec#ement y (y 1 an$ inc#ement x (y if y is at least 1,
othe#%ise (loc* &ntil y is at least 1.
3sing 4th#ea$s, s&pply the 5I66ING 17D- to achie)e this2
int x 8 1" 9
int y 8 1" 9
5I66ING 17D- pth#ea$:m&tex:t xy5&tex 9
pth#ea$:con$:t xGe 9
pth#ea$:con$:t yGe1 9
x$ec() ;
%hile (1) ;
5I66ING 17D- pth#ea$:m&tex:loc*( <xy5&tex ) 9
%hile (x = ) pth#ea$:con$:%ait( <xGe, <xy5&tex ) 9
x 8 x' 9
y 8 y>1 9
5I66ING 17D- if (y 8 1) pth#ea$:con$:signal( <yGe1 ) 9
pth#ea$:m&tex:loc*( <xy5&tex ) 9
?
?
y$ec() ;
%hile (1) ;
5I66ING 17D- pth#ea$:m&tex:loc*( <xy5&tex ) 9
%hile (y = 1) pth#ea$:con$:%ait( <yGe1, <xy5&tex ) 9
y 8 y'1 9
x 8 x> 9
5I66ING 17D- if (x 8 ) pth#ea$:con$:signal( <xGe ) 9
pth#ea$:m&tex:loc*( <xy5&tex ) 9
?
?
main() ;
pth#ea$:t t1, t 9
pth#ea$:init( <t1, N3@@ ) 9
pth#ea$:init( <t, N3@@ ) 9
5I66ING 17D- pth#ea$:m&tex:init:t( <xy5&tex , N3@@)9
pth#ea$:con$:init:t( <xGe, N3@@) 9
pth#ea$:con$:init:t( <yGe1, N3@@) 9
pth#ea$:c#eate( <t1, N3@@, x$ec , N3@@ ) 9
pth#ea$:c#eate( <t, N3@@, y$ec , N3@@ ) 9
?
GRADING. .he#e a#e t%o pa#ts2 A'1" points fo# ens&#ing that x an$ y a#e
accesse$ m&t&ally excl&si)ely an$ 1"'1 points fo# implementing the
%aiting.
17557N 5I6.AB-62 3sing t%o m&texes an$ getting into $ea$loc*. B&sy
%aiting. Accessing sha#e$ )a#ia(les %itho&t fi#st ens&#ing m&t&al
excl&sion. @oc*ing an$ &nloc*ing th#ea$s. 3sing CifC instea$ of C%hileC
in the chec* fo# %aiting.
D.) (15 points) 1onsi$e# a time $i)ision s%itch fo# ci#c&it s%itching.
.he s%itch has A inp&t lines an$ A o&tp&t lines, %ith each line
$eli)e#ing an octet e)e#y mic#osecon$s. +hat is the acess time of the
s%itch memo#y,
-)e#y mic#osecon$s, an octet (8 (yte) has to (e #ea$ f#om each inp&t
line an$ %#itten to each o&tp&t line. .h&s 1D octets pe#
mic#osecon$s, %hich lea$s to an access time of one octet e)e#y E1D
mic#osecon$s, that is, one octet e)e#y 15 nanosecon$s. .he memo#y %o#$
siFe sho&l$ (e at least one octet.
GRADING. 1 points fo# only consi$e#ing inp&ts an$ not o&tp&ts, ie,
getting 5" nanosecon$s.
-ND 7G -/A5
CMSC 417 Midterm #) (Spring 1997) - Solutions

1() (15 points) Define and explain the folloing terms!
a) for$idden region! illegal "om$inations of time8se<uen"e num$ers
that "ould permit data from old "onne"tions to $e a""epted as part of a
"urrent "onne"tion( Caused $# node "rashes or se<uen"e num$er rap
around(
$) flo "ontrol! mat"hing rates $eteen produ"ers and "onsumers(
Can $e done at the lin' or netor' la#ers(
") to arm# pro$lem! explains the pro$lem of "ommuni"ating o&er an
unrelia$le netor'( @he pro$lem is that to parties "an ne&er 'no if
the last message sent as "orre"tl# re"ei&ed( @his pro$lem relates to
deleting a "onne"tion $eteen to hosts(
d) M@G! Maximum @ransfer Gnit( @he largest pa"'et8frame si+e that
"an tra&el o&er a netor' or lin'(
e) $it stuffing! a a# to pre&ent the o""urren"e of a frame $oundar#
string from o""urring in data( %fter a spe"ifi" su$-string of the pattern is
seen, a $it is inserted to pre&ent the target string from appearing(
)() (15 points) ;rror "orre"tion and dete"tion(
a) 1hat is the minimum num$er of error re"o&er# $its re<uired to
re"o&er from an n $it error2 ;xplain h# this num$er of $its is
suffi"ient(
let n 4 m 9 r, m is the message length, r is the num$er of error
re"o&er# $its( @o $e a$le to re"o&er from a d $it error e need to ha&e
n "hoose d in&alid messages for e&er# &alid message( n "hoose d is
the num$er of a#s #ou "an flip exa"tl# d $its in an n $it message(
@here are )m &alid messages so! P(n "hoose d) 9 1Q )m E4) $ut n
4 m 9 r so P(m 9 r) "hoose d 9 1Q E4 )r

so that the $it pattern ith n errors is the "losest (min( hamming
distan"e) $it pattern to the "orre"t message (it s n $its aa# and the
rest ill $e at least n91)(
$) *f the ratio of error dete"tion $its to pa#load $its remains "onstant,
hat are the tradeoffs $eteen ha&ing the error $its applied to a single
"hara"ter &s( a $lo"' of "hara"ters2
6igger $lo"'s "an dete"t longer $urst errors
Smaller $lo"'s redu"e laten"# hen sending small frames and redu"e
the amount of data to $e re-transmitted hen an error o""urs(
-() ()5 points) Bne a# to support mo$ile hosts is $# assigning a host a
temporar# *: address in its ne lo"ation, and "ontinuing to use its old address $#
tunneling *: through *: $a"' to an agent running on the mo$ile host s home netor'(
a) ;xplain the steps re<uired to permit a mo$ile host to register on a lo"al
netor' and start re"ei&ing pa"'ets using its permanent *: address(
1) "onne"t to lo"al ser&er (agent) on the foreign netor' and re<uest temp
*: address(
)) lo"al agent "onta"ts home agent to inform it of the mo$ile host s
temporar# *: address(
-) home agent starts tunneling pa"'ets destined from the mo$ile host on its
temporar#(
Bther ansers that pro&ide the same information ex"hange are possi$le(

$) Hi&e one ad&antage and one disad&antage of this approa"h to *: mo$ilit#
"ompared ith ha&ing a mo$ile host onl# use its permanent *: address(
9 onl# need the remote agent to setup the transfer, not forard ea"h pa"'et
9pa"'ets "an $e sent dire"tl# to the mo$ile host at its temporar# *: address to
pre&ent sending pa"'ets long distan"es ti"e(
- softare "ould "a"he temporar# *: address and re-use it after the mo$ile mo&es
again(
- uses to *: addresses
") 1hen tunneling *: through *:, it is not possi$le to ala#s maintain a one
for one mat"h $eteen tunneled pa"'ets and the nati&e pa"'et( 1h#2 ;xplain
the potential performan"e impli"ations of this limitation(
@unneled pa"'et needs an *: header and if the pa"'et to tunnel is alread# at the
M@G for the netor', the extra si+e ill re<uire it to $e fragmented(
>ragmentation ill slo don the netor' due to extra o&erhead of pro"essing
to pa"'ets and the need to re-transmit all parts of a fragment if one is lost(
4() (15 :oints) *: %ddresses
a) @he *nternet is running out of *: addresses to assign, $ut there are
su$stantiall# less than four $illion hosts on the *nternet( ;xplain h#
this is happening(
*nternal fragment due to *: addresses $eing assigned in $lo"'s rather than one at a
time(
$) Roe 3a"'er reads a$out *:&0 (ith 1)? $it address) and is
"on"erned a$out routing ta$le si+e( 3e de"ides that the $est solution is
to en"ode latitude and longitude into *: addresses( ;xplain ho this might
$e used to redu"e routing ta$le si+e( :ro&ide a reason h# this might
not redu"e routing ta$le si+e(
Heographi" information "ould $e used as the $asis of hierar"hi"al routing(
/odes ould store detailed routing information for its lo"al region and onl#
sparse information for distant nodes( @he pro$lem is that due to administrati&e
domains and different *S: s ph#si"al lo"ation is not e<ui&alent to nearest
neigh$or for routing purposes(
5() (15 :oints) Consider a netor' here on a&erage, messages $eteen to
hosts must tra&el through 15 routers (and thus 11 hops)( Bn a&erage, one pa"'et
in e&er# 1,555 is lost as is passes through a router(
a) *f one pa"'et in 155 is gar$led per hop, hat is the pro$a$ilit# of a
pa"'et ma'ing it through the netor' if no lin' le&el re-transmission is
used2 1hat if lin'-le&el re-transmission is used2
1ith re-transmission, lin' gar$ling does not o""ur
so p 4 (99915
1ithout re-transmission, lin' gar$ling and router drops "an happen so p 4 (99915
x (9911
$) Depeat part a if the pro$a$ilit# of a lin' gar$ling a pa"'et is 1 in a
$illion(
1ith re-transmission, lin' gar$ling does not o""ur so p 4 (99915
1ithout re-transmission, p 4 (99915 x (1-15-9)11, "on"lusion don t need lin'
retransmission hen lin' error pro$a$ilit# is &er# lo(
0() (15 points) Congestion Control
a) 1h# is "ongestion "ontrol more important in a netor' "arr#ing
traffi" hose $andidth re<uirements &ar# d#nami"all# during a session
"ompared ith fixed $andidth traffi"2
1ith stati" traffi", "ongestion a&oidan"e &ia "all admission "an $e used( 1ith
d#nami" traffi", "all admission leads to under utili+ation of the netor' due to
"onser&ati&e allo"ation "hoi"es(
$) *n @C: (Ra"o$son) "ongestion "ontrol, the &arian"e in round-trip
times for pa"'ets impli"itl# influen"es the "ongestion indo( ;xplain
ho a high &ariation in the round-trip time affe"ts the "ongestion
indo( 1hat is the impa"t of this high &ariation on the throughput for
a single "onne"tion2
1ith all other things $eing the same (i(e( losses and "ongestion), high &arian"e in
D@@ ill lead to a long timeouts for re-tranmission( @his ill ma'e "ongestion
dete"tion sloer sin"e e onl# "lose the indo hen a pa"'et is dropped
(dete"ted &ia a timeout)( %s a result, it is more li'el# the netor' ill get into a
"ongested state, this ill redu"e the throughput of our "onne"tion(

You might also like