P robl em 2
T h e fol lowingisapartofT C P h eaderdump( contents) inh exadecimalformat
E2 9 3 0 0 1 7 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 5 0 0 2 0 7 F F …
a. ! W h atisth e source portnumber?
b. ! W h atisth e destinationportnumber?
c. ! W h atisth e sequence number?
d. ! W h atisth e acknowl edgementnumber?
e. ! W h atisth e l ength ofth e h eader?
f. ! W h atisth e type ofth e segment?
g. ! W h atisth e window siz e?
A nswer
a. T h e source portnumberis( E2 9 3 )
1 6
or5 8 , 0 0 3 indecimal .
b. T h e destinationportnumberis( 0 0 1 7 )
1 6
or2 3 indecimal .
c. T h e sequence numberis( 0 0 0 0 0 0 0 1 )
1 6
or1 indecimal .
d. T h e acknowl edgmentnumberis( 0 0 0 0 0 0 0 0 ) 1 6 or0 indecimal .
e. T h e H L EN = 5 . T h e h eaderis5 x4 = 2 0 bytesl ong.
f. T h e combinationofth e reserved fiel d and th e controlfield is( 0 0 2 ) 1 6 or
(0 0 0 0 0 0 0 0 0 0 1 0 )2
. Th e
righ tmost6 bitsare 0 0 0 0 1 0 , wh ich meansonl y th e SY N bitisset. T h isisth e SY N
segmentused
forconnectionestabl ish ment.
g. T h e window siz e fiel d is( 0 7 F F )
1 6
or2 0 4 7 indecimal . T h e window siz e is2 0 4 7 bytes.
P robl em 4
InaT C P connection, th e initialsequence numberatth e cl ientside is2 , 1 7 1 . T h e client
opensth e connection,
sendsth ree segments, th e second ofwh ich carries1 , 0 0 0 bytesofdataand cl osesth e
connection. W h atisth e
val ue ofth e sequence numberineach ofth e fol l
owingsegmentssentby th e cl ient?
a. ! T h e SY N segment
b. ! T h e datasegment
c. ! T h e F IN segment
A nswer
a. T h e sequence numberinth e SY N segmentis2 1 7 1 . T h e SY N segmentconsumesone
sequence
number; th e nextsequence numberto be used is2 1 7 2 .
b. T h e sequence numberinth e datasegmentis2 1 7 2 ( wh ich representsth e sequence
numberof
th e firstbyte) . T h e bytesinth e packetsare numbered 2 1 7 2 to 3 1 7 1 . N ote th atth e cl
ient
sendsth e
datawith th e second packet( no separate A C K segment) .
c. T h e sequence numberinth e F IN segmentis3 1 7 2 . N ote th atth e F IN segmentdoes
consume a
sequence number.
Q uestion1 : [T C P h eader][1 5 points]
( A ) T h e fol lowingisadumpofaT C P h eaderinh exadecimalformat.
0 5 3 2 0 0 1 7 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 5 0 0 2 0 7 FF 0 0 0 0 0 0 0 0
1. W h atisth e source portnumber?
Source portnumber= ( 0 5 3 2 ) 1 6 = 1 3 3 0
2 . W h atisth e destinationportnumber?
Destinationportnumber= ( 0 0 1 7 ) 1 6 = 2 3
3 . W h atth e sequence number?
Sequence number= ( 0 0 0 0 0 0 0 1 ) 1 6
4 . W h atisth e acknowl
edgmentnumber?
A cknowl edgementnumber= ( 0 0 0 0 0 0 0 0 ) 1 6
5. W h atisth e length ofth e h eader?
L ength ofth e h eader= 5 * 4 = 2 0
6. W h atisth e type ofth e segment?
ItisaSY N segment.
7. W h atisth e window siz e?
W indowssiz e = ( 0 7 F F ) 1 6
(B) InaT C P connection, th e initialsequence numberatcl ientsite is2 1 7 1
T h e cl
ientopensth e connection, sendsonl y one segmentcarrying1 0 0 0 bytesofdata,
a. T h e SY N segment'?
2 1 7 1
b. T h e datasegment'?
2 1 7 2
c. T h e F IN segment'?
3 1 7 2
(C) Specify th ree reasonswh y T C P may notbe suitabl e forrealtime video streaming. ?
T C P inducesdel ay wh il
e ensuringreliable transmissionofdata. F orrealtime video
streamingdel aysare unacceptabl e.
R etransmissionofdatapacketswh enth ere ispacketl osswoul d resultinarrivalofdata
laterth anth e normaltime.
T h iswoul dlead to al agand th e datawoul d U singcongestionand fl ow control
mech anisms, th e th rough putofT C P isreduced to avoid packetlosses. A reduced
th rough putisnotidealforrealtime video
Q uestion2 : [T C P th rough put][1 5 pts]
1 . A ssume T C P issendingsegmentsusingamaximum window siz e ( 6 4 K B ) ona
ch annelth ath asinfinite bandwidth and anaverage roundtriptime of1 0 ms.
W h atisth e maximum th rough put1 ?
H ow doesth e maximum th rough putch ange ifth e roundtriptime increasesto 2 5 ms?
W indow siz e = 6 4 kB R ound triptime = 1 0 ms
( M aximum th rough put) 1 0 = W indow siz e/ R ound triptime = 6 4 * 1 0 3 / 1 0 * 1 0 - 3 = 6 4 0 0
K bps
( M aximum th rough put) 2 5 = W indow siz e/ R ound triptime = 6 4 * 1 0 3 / 2 5 * 1 0 - 3 = 2 5 6 0
K bps
W h enR T T increases, th e th rough putdecreases.
2. Describe th e congestionavoidance sch emesforth e th ree T C P variants: T C P T ah oe,
R eno and V egas. A l
so describe atl
eastone performance issue ( th rough
T ah oe: T ah oe avoidscongestionby reducingth e C wnd to 1 M SS and th e th resh ol
d to h al
f
th e previousC wnd. Itagainstartsfrom th e sl
ow startph ase. T h e th rough put
R eno: R eno avoidscongestionby h al vingth e th resh ol
d from previousC wnd and starts
additive increase from th e th resh ol
d. R eno perfomsbetterth anT ah oe interms
V egas: V egasavoidscongestionby preemptivel y decreasingth e C wd wh enapacketl
oss
isimminent. T h isisidentified based onth e R T T . T h issch eme isbetterth anth
3. A ssume al ink bandwidth of1 0 M bpsand aR T T of1 0 ms, h ow many bitssh oul
d th e
A dvertisedW indow fiel
d h ave inorderto keepth e pipe full
?
T h e pipe canh ave 1 0 M bdataevery second.
W h enth e R T T is1 0 ms, to keepth e pipe ful
l, we need to h ave awindow siz e of1 0 0 kB
4. A T C P fl ow’ sth rough putcanbe approximated as
wh ere cisaconstant, risth e round triptime, and sisth e probabil ity th atasegmentis
lost. A ssumingth ateach segmentisspl itinto nfragments, and th atth e probability
L ossofany fragmentresul tsinl ossofasegment.
Probabil ity th atno fragmentisl ostis( 1 - p) n.
Probabil ity th atatleastone fragmentisl ostis1 - ( 1 - p) n.
T h erefore, T C P th rough put= c/ r. sqrt( 1 - ( 1 - p) n)
Q uestion3 : ( R ound- T ripT ime Estimation) [1 0 points]
R ecal lth atT C P usesanexponential l
y weigh ted movingaverage to compute round- trip
times.
L ettingR i be th e estimated R T T afteri observations, and l ettingB i be th e
R i = ? R i- 1 + ( 1 - ? ) B i forsome constant? ? [0 , 1 ].
Suppose th atourversionofT C P measuresth e R T T once every R T T and usesth e ( ol d)
formul aforth e retransmissiontimer, timeout= 2 * R i.
Ifth e observed round- triptimespriorto and incl udingobservationjare al l1 5 0 ms, R j=
1 5 0 ms, and subsequentobservationsare al l5 0 0 ms, h ow many additionalobservations
( round- triptimes) wil littake before th e estimate iscl ose enough to th e actualR T T ( 5 0 0
ms) to avoid timeouts, wh en? = 0 . 6 and wh en? = 0 . 9 ? Itmay be agood ideato write a
( very sh ort) program to ch eck yourwork. F orth e same parametersasabove, write a
math ematicalexpressionforth e numberofobservationsneeded asafunctionof? . T h e
more youcansimpl ify it, th e better, butstrive
T h e givenR T T estimate formul acanbe round offto nth term as
R ( j+ n) = anR ( j) + ( 1 - an) B ( n)
B ased onth e above formul
awe canpluginth e val
uesto determine th e minimum number
ofadditionalobservationsrequired.
W e know R ( 0 ) = 1 5 0 , B ( n) = 5 0 0 , ifwe ch oose acl
ose enough val
ue with anerrorof1 ms,
we get
F ora= 0 . 6 4 9 9 = 1 5 0 * 0 . 6 n+ 5 0 0 – 5 0 0 * 0 . 6 n
T h erefore n= 1 2 ( approx. )
F ora= 0 . 9 4 9 9 = 1 5 0 * 0 . 6 n+ 5 0 0 – 5 0 0 * 0 . 6 n
T h erefore n= 5 6
Q uestion4 : ( F astR etransmitand F astR ecovery) [8 points]
Inth isquestion, youwil lbe introduced to two notions: fastretransmissionand fast
recovery.
IfT C P receivesth ree duplicate A C K S forth e same data, ittakesth isasanindicationth at
th e segmentfol lowingth e segmentth ath asbeenA C K ed th ree timesh asbeenl ost.
Inth iscase, T C P performsafastretransmit[R F C 2 5 8 1 , 2 5 8 2 ], retransmittingth e
missingsegmentwith outwaitingforth e retransmissiontimerofth issegmentto expire.
Inaddition, T C P R eno performsafastrecovery [R F C 2 5 8 1 , 2 5 8 2 ]th atessentially
cancel sth e sl
ow- startph ase afterafastretransmission( rememberth atsl ow- startph ase
occursafterordinary retransmissions) . B oth fastretransmissionand fastrecovery h ave
th e potentialofimprovingT C P performance.
IsF astR etransmitand F astrecovery more suitabl e wh enth ere are isolated packetl osses
OR
wh enth ere are l ossbursts( asequence ofconsecutive packetl osses
F astretransmitand F astrecovery are more suitabl e forisolated packetl osses.
T h ey canbe used to immediatel y recoverfrom asingl e packetloss. H oweverifth ere are
burstsofpacketl ossessometh ingiswrongwith th e network and h ence itisbetterto
reduce th e th resh old to h al
fand perform th e sl
ow startph ase to minimiz e l ossand
maximiz e th rough put.
Iffastretransmitorrecovery tech niquesare fol lowed, th iscould resultinfurth erl ossesof
packets.
T h e network coul d be congested and retransmittingth e packetscoul d furth erincrease th e
congestion.
Al so, iffastrecovery isused, th e th resh ol
d willbe decreased to h al
f.
H owever, due to congestion, additive increase coul d resultinfurth erl ossesand th e
th resh old needs
Examples on UDP Header
U serDatagram ProtocolisaT ransportL ayerprotocol . U DP isapartofth e
InternetProtocolsuite, referred to asU DP/ IP suite. U nl ike T C P, itisan
unrel iable and connectionl essprotocol . So, th ere isno need to establ ish a
connectionpriorto datatransfer. T h ough T ransmissionC ontrolProtocol
( T C P) isth e dominanttransportl ayerprotocolused with mostInternet
services; providesassured del ivery, rel iability, and much more butal lth ese
servicescostusadditionaloverh ead and l atency. H ere, U DP comesinto
th e picture. F orreal- time servicesl ike computergaming, voice orvideo
communication, l ive conferences; we need U DP. Since h igh performance
isneeded, U DP permitspacketsto be dropped instead ofprocessing
del ayed packets. T h ere isno errorch eckinginU DP, so ital so saves
bandwidth .
U serDatagram Protocol( U DP) ismore efficientintermsofboth l atency
and bandwidth .
U DP h eader :
U DP h eaderisan8 - bytesfixed and simpl e h eader. T h e first8 B ytes
containsal lnecessary h eaderinformationand th e remainingpartconsistof
data. U DP portnumberfiel dsare each 1 6 bitsl ong, th erefore th e range for
portnumbersdefined from 0 to 6 5 5 3 5 ; portnumber0 isreserved. Port
numbersh el pto distinguish differentuserrequestsorprocesses.
Exam pl e- 1 :
G ivenaDU M P ofaU DP h eaderinh exadecimalformat0 6 3 2 0 0 0 D 0 0
1 C E2 1 7 . F ind th e fol
lowing: -
1. Source portnumber?
2. Destinationportnumber?
3. L ength ofuserdatagram?
4. L ength ofth e data?
Sol
ution:
1. Source P ort–
Source Portis 2 B yte l ong field used to identify th e portnumber ofth e
source. T h e source portnumberisth e firstfourh exadecimaldigitsi. e. 0 6
3 2 ifwe converth exadecimalto decimalwe get1 5 8 6 .
2. DestinationP ort–
Itis a 2 B yte long fiel
d, used to identify th e portofth e destined packet.
T h e destination portnumber is th e second four h exadecimaldigits 0 0
0 D ifwe converth exadecimalto decimalwe get1 3
3. L ength –
L ength isth e l
ength ofU DP includingth e h eaderand th e data. Itisa1 6 -
bits field. T h e th ird four h exadecimaldigits 0 0 1 C if we convert
h exadecimalto decimalwe get1 6 define th e l ength ofth e wh ole U DP
packetas2 8
4. L ength ofth e h eader –
Itis8 bytesasitisfixed. T h e l ength ofth e dataisth e l ength ofth e wh ol
e
packet— th e l ength ofth e h eaderi. e. 2 8 – 8 = 2 0 bytes.
Exam pl
e- 2 :
G ivenaDU M P ofaU DP h eaderinh exadecimalformat0 4 2 1 0 0 0 B 0 0
2 A E2 1 7 . F ind th e fol
lowing: -
1. Source portnumber?
2. Destinationportnumber?
3. L ength ofuserdatagram?
4. L ength ofth e data?
Sol
ution:
1. T h e source portnumberisth e firstfourh exadecimaldigitsi. e. 0 4 2 1 if
we converth exadecimalto decimalwe get1 0 5 7
2. T h e destination portnumber is th e second four h exadecimaldigits 0 0
0 B ifwe converth exadecimalto decimalwe get1 1
3. T h e th ird fourh exadecimaldigits0 0 2 A ifwe converth exadecimalto
decimal4 2 define th e l ength ofth e wh ol
e U DP packetas2 8
4. Th e l ength ofth e data is th e l ength ofth e wh ol
e packet— th e l
ength
ofth e h eaderi. e. 2 8 – 8 = 2 0 bytes.
Exam pl
e- 3 :
G ivenaDU M P ofaU DP h eaderinh exadecimalformat0 3 6 1 1 0 1 A 1 0
4 C Y 2 4 2 . F ind th e fol
lowing: -
1. Source portnumber?
2. Destinationportnumber?
3. L ength ofuserdatagram?
4. L ength ofth e data?
Sol
ution:
1. T h e source portnumberisth e firstfourh exadecimaldigitsi. e. 0 3 6 1 if
we converth exadecimalto decimalwe get0 8 6 5
2. T h e destination portnumber is th e second four h exadecimaldigits 1 0
1 A ifwe converth exadecimalto decimalwe get4 1 2 2
3. T h e th ird fourh exadecimaldigits1 0 4 C ifwe converth exadecimalto
decimal4 1 7 2 define th e l ength ofth e wh ole U DP packetas2 8
4. Th e l ength ofth e data is th e l ength ofth e wh ole packet— th e l ength
ofth e h eaderi. e. 2 8 – 8 = 2 0 bytes.
N ote :
U DP h eaderal so containspayl oad datawh ich isofvariabl elength . U se of
U DP isasatunnel ingprotocol , wh ere atunnelendpointencapsul atesth e
packetsofanoth erprotocolinside U DP datagramsand transmitsth em to
anoth ertunnelendpoint, wh ich decapsul atesth e U DP datagramsand
forwardsth e originalpacketscontained inth e payl oad.