You are on page 1of 45

Uni

t3Net
wor
klay
er
Thenet wor klayeri sr esponsi bl
ef orthesour ce-t
o-desti
nat i
ondel i
veryofa
packet ,possibly
acrossmul ti
plenet wor ks(links).Wher east hedat al i
nkl ayerov er
seest he
deliver yof
thepacketbet weent wosy stemsont hesamenet wor k( l
inks),t
henet work
l
ay erensur es
thateachpacketget sf r
om i tspoi ntofor i
gint oi tsfinaldestinati
on.The
networ klay eraddsaheadert hati ncludest helogicaladdressesoft hesender
andr ecei vertot hepacketcor ningf r
om t heupperl ayer
.Ifapackett ravel
s
throught he
Internet ,weneedt hisaddr essingsy stem t ohelpdi sti
nguisht hesourceand
dest ination.
Wheni ndependentnet worksorl inksar econnect edt ogethert ocreatean
i
nter net wor k,
rout ers orswi tches r oute packet st ot heirf i
naldest i
nat i
on.One oft he
funct ions
oft henet worklay eri
st oprov i
dear outi
ngmechani sm.

Net workl ayeri


st hethir
dlay eri
nt heOSImodelofcomput ernetworks.It’
s
mai nf unct i
on ist ot r
ansfernetwor k packet
sf rom t he source t ot he
dest i
nati
on.I ti
sinvol
vedbot hatthesourcehostandt hedest i
nati
onhost .At
thesour ce,itacceptsapacketf rom thetranspor
tlayer,encapsulatesitina
datagram andt hendeliverthepackett ot hedatalinklay ersot hatitcan
further be sent t ot he receiv
er.At t he desti
nation,t he datagram i s
decapsul ated,thepacketi sextractedanddel iv
eredt ot hecor responding
transportlayer.

Needf
orNet
wor
kLay
er
Tosol vethepr obl
em ofdel
iver
ythroughsever
alli
nks,t
henetworklayer(
or
theinternetwork
l
ay er,
asi tissometimescal
led)wasdesigned.Thenetworkl
ayeris
responsible
forhost-to-hostdel
iver
yandforrouti
ngthepacket
st hr
oughtherouter
sor
switches.
Figure20. 2showst hesameinter
networkwit
hanet workl
ayeradded.
Feat
ures:
Mainr esponsi
bil
ityofNet workl
ayeristocar rythedat apacketsfrom the
sourcet othedestinationwithoutchangingorusi ngit.Ifthepacketsar etoo
l
argef ordeli
very
,theyar efr
agment edi
.e.,brokendowni ntosmallerpacket s.
Itdecidestheroutet obet akenbythepacket st otrav
el fr
om thesour cet othe
destinati
onamongt hemul t
ipl
eroutesav ai
lableinanet work(alsocalledas
routi
ng).Thesour ceanddest i
nati
onaddr essesar eaddedt othedat apacket s
i
nsidet henetworkl ayer.Theservi
ceswhi char eoffer
edbyt henetwor klayer
protocolareasfollows:

Packet
izi
ng–
Theprocessofencapsulat
ingthedat
areceiv
edf r
om upperlayer
softhe
network(
alsocal
ledaspayload)i
nanetworklayerpacketatthesour
ceand
decapsul
atingt
hepayloadfrom t
henetworklay
erpacketatthedesti
nat
ioni
s
knownaspacketizi
ng.

Thesourcehostaddsaheadert hatcontai
nst
hesourceanddestinat
ion
addressandsomeot herrelevanti
nformati
onrequi
redbythenetworklayer
prot
ocoltothepayloadreceiv
edf rom t
heupperlay
erprot
ocol,
anddel i
vers
thepackett
ot hedatali
nklayer.

Thedesti
nationhostr ecei
vesthenetworklay
erpacketf rom i
tsdatalinkl
ayer,
decapsul
atest hepacket,anddeli
ver
sthepay l
oadt othecorrespondingupper
l
ayerprotocol.Theroutersint
hepatharenotal l
owedt ochangeei t
herthe
sourceorthedestinati
onaddress.Therouter
si nthepatharenotallowedt o
decapsul
atethepacket stheyrecei
veunlesstheyneedt obef r
agment ed.

Rout
ingandFor
war
ding–
Thesear etwoot herserv
icesof fer
edbyt henet worklayer.I
nanet work,
ther
e
areanumberofr outesav ai
labl
ef rom thesour cet ot
hedest i
nati
on.The
networ kl
ayerspecifi
eshassomest rategieswhi chfi
ndoutt hebestpossibl
e
route.Thisprocessisreferr
edt oasr outing.Ther ear
eanumberofr outi
ng
protocolswhichareusedi nt hi
spr ocessandt heyshoul dber untohelpthe
routerscoordinat
ewi t
heachot herandhel pi
nest abl
ishingcommuni cat
ion
throughoutthenetwork.

Forwardi
ngi ssimplydef
inedast heact
ionappl
iedbyeachr out
erwhena
packetarr
ivesatoneofitsinter
faces.Whenarouterrecei
vesapacketfrom
oneofitsattachednetworks,i
tneedstoforwar
dt hepackettoanother
att
achednet work(uni
castrouti
ng)ortosomeat t
achednetworks(i
ncaseof
multi
castrouting)
.

Er
rorCont
rol–
Althoughitcanbei
mplementedi
nthenet
worklayer
,buti
tisusual
l
ynot
preferr
edbecauset
hedatapacketi
nanetwor
klayermaybefragmentedat
eachr out
er,whi
chmakeserr
orchecki
ngi
neff
ici
enti
nthenetworklay
er.

Fl
owCont
rol–
Itregulatest heamountofdat aasourcecansendwi t
houtoverl
oadingt he
receiver.Ifthesour ceproducesadat
aatav eryfasterratet
hanther eceiver
canconsumei t
,thereceiv
erwill
beoverl
oadedwi t
hdat a.Tocontr
ol theflow
ofdat a,ther eceivershoul
dsendafeedbacktothesendert oinf
ormt hel att
er
thatitisov erloadedwi t
hdata.

Ther
eisal
ackoff
lowcont
rol
int
hedesi
gnoft
henet
wor
klay
er.I
tdoesnot
dir
ectl
ypr
ovideanyflowcont
rol.Thedat
agr
amsaresentbythesenderwhen
theyar
eready,wi
thoutanyat
tentiont
other
eadi
nessofther
eceiv
er.

Congest
ionCont
rol–
Congesti
onoccur swhent henumberofdat agramssentbysour ceisbey ond
thecapacityofnetworkorrouters.Thisi
sanotherissueint henetworklayer
prot
ocol.I
fcongest i
oncontinues,sometimesasi t
uationmayar riv
ewher ethe
syst
em collapsesandnodat agramsar edeli
vered.Alt
houghcongest ion
contr
olisindir
ectl
yimplement edinnetworklayer,
butstil
lthereisalackof
congesti
oncont r
olinthenetwor klay
er.

Adv
ant
agesofNet
wor
kLay
erSer
vices:
Packet
izat
ionser
vicei
nnet
wor
klay
erpr
ovi
desaneaseoft
ranspor
tat
ionof
thedat
apackets.

Packet
izat
ional
soel
i
minat
essi
ngl
epoi
ntsoff
ail
urei
ndat
acommuni
cat
ion
syst
ems.

Routerspr
esenti
nt henetwor
klayerr
educenet
wor
ktr
aff
icbycr
eat
ing
col
li
sionandbroadcastdomains.

Withthehel
pofForwar
ding,
dat
apacket
sar
etr
ansf
err
edf
rom onepl
acet
o
anotheri
nthenet
work.

Di
sadv
ant
agesofNet
wor
kLay
erSer
vices:
Ther
eisal
ackoff
lowcont
rol
int
hedesi
gnoft
henet
wor
klay
er.

Congest
ionoccurssomet i
mesduetothepresenceoftoomanydatagr
amsin
anetwor
kwhi charebeyondthecapaci
tyofnetworkorther
outer
s.Duetot
his,
somerouter
smaydr opsomeofthedatagr
amsandsomei mport
antpi
eceof
i
nformat
ionmay belost.

Alt
houghindir
ectl
yer r
orcontr
ol i
spresenti
nnetworklay
er,
butther
eisalack
ofproperer
rorcontrolmechanismsasduet opresenceoff
ragmenteddat
a
packets,
err
orcontrolbecomesdi f
fi
cultt
oimplement.

Net
wor
kSer
viceModel
Whent hetransportlayeratasendi nghostt r
ansmitsapacketi ntothenet work( i
.e.
,
passesitdownt ot henet worklayeratthesendi nghost),cant hetransportlayer
countont henetwor klay ert
odel i
verthepackett othedestination?Whenmul ti
ple
packetsaresent,wi l
ltheybedel i
veredtot hetr
ansportlay
erint her eceivi
nghosti n
theorderinwhicht heywer esent?Wi llt
heamountoft imebet weent hesendingof
twosequent i
alpackett ransmissi
onsbet hesameast heamountoft i
mebet ween
thei
rr ecepti
on? Wi l
lthenet workpr ov
ideanyf eedbackaboutcongest ioninthe
network? Whati st heabstractv iew (pr
opert
ies)ofthechannelconnecti
ngt he
transportl
ayerinthetwohost s?Theanswer stothesequest i
onsandothersare
determinedbytheservi
cemodelpr ovidedbythenetworklay
er.Thenetworkservi
ce
modeldef inesthecharacter
isticsof end- t
o-endtranspor
tofdat abetweenone
"edge"ofthenetworkandtheother ,i.
e.,
bet
weensendingandr ecei
vi
ngendsystems.

Vi
rt
ualCi
rcui
tandDat
agr
am Net
wor
ks

Rout
er
Ar outeris a devi
ce thatconnectstwo ormor e packet
-swit
ched networ
ks or
subnetworks.Itserves two pr
imaryfunct
ions:managi ng tr
aff
ic between t
hese
networksbyf orwar
dingdatapacketstotheiri
ntendedI Paddresses,andall
owing
multi
pledevicestousethesameInter
netconnect
ion.

Thereareseveralt
ypesofr
outer
s,butmostrouterspassdatabetweenLANs(l
ocal
areanetworks)andWANs( wideareanetworks).A LAN i
sagr oupofconnected
devi
cesr est
ri
ctedtoaspecif
icgeographi
carea.A LAN usuall
yr equi
resasi
ngle
rout
er.

AWAN, bycont
rast,
isalargenet wor
kspreadoutov erav astgeographi
carea.Lar
ge
organizati
onsandcompani est hatoperat
einmul ti
plelocati
onsacr ossthecount
ry,
forinst
ance,willneedsepar at
eLANsf oreachlocati
on,whi chthenconnecttothe
otherLANst of
orm aWAN.BecauseaWANi sdist
ri
butedov eralargearea,i
toft
en
necessitatesmult
ipl
eroutersandswitches*.

*Anet
workswit
chf
orwardsdat
apacket
sbetweengroupsofdevicesi
nthesame
net
work,
wher
easar
outerfor
war
dsdat
abetweendi
ff
erentnet
works.

Rout
ingTabl
e:
Ar outi
ngt ableisasetofr ul
es,oft
enviewedi ntabl
ef ormat,thatisusedt o
deter
mi newheredatapacketstr
avel
i
ngoveranInter
netProtocol(
IP)networkwi
llbe
di
rected.Al
lI P-
enabl
eddev i
ces,i
ncl
udi
ngrouter
sandswi tches,userouti
ngtables.
SeebelowaRout i
ngTabl
e:

I
ncomput ernetworki
ng,ar out
ingtabl
e,orrouti
nginfor
mat i
onbase(RIB),i
sadat a
tabl
estoredi nar out
eroranet workhostthatli
ststheroutestopart
icul
arnetwork
desti
nati
ons,andi nsomecases,met r
ics(di
stances)associ
atedwit
ht hoserout
es.
The routing table cont
ains infor
mat i
on about the topol
ogy of the network
i
mmedi atelyaroundit
.

Theconstruct
ionofrouti
ngt
ablesist hepri
mar ygoalofrouti
ngprot
ocols.St
ati
c
routesar
eent ri
est
hatarefi
xed,ratherthanresul
ti
ngfrom routi
ngprot
ocolsand
networkt
opologydi
scover
ypr
ocedures.

Dest
inat
ion Subnetmask I
nter
face
128.
75.
43.
0 255.
255.
255.
0 Et
h0

128.
75.
43.
0 255.
255.
255.
128 Et
h1

192.
12.
17.
5 255.
255.
255.
255 Et
h3

def
aul
t Et
h2

Theentrycorr
espondi
ngt ot
hedefaul
tgatewayconfi
gurati
onisanet work
dest
inat
ionof0.0.
0.0wit
hanetwor
kmask( net
mask)of0.0.
0.0.TheSubnet
Maskofdefaul
troutei
salway
s255.
255.255.
255.

Ent
ri
esofanI
PRout
ingTabl
e:

Arout
ingtablecontai
nstheinformati
onnecessarytof orwardapacketalong
t
hebestpatht owardit
sdestinat
ion.Eachpacketcontainsinfor
mationabout
i
tsori
ginanddestinat
ion.Routi
ngTableprovi
dest hedev i
cewi t
hinstr
uct
ions
f
orsendingthepackettothenexthoponitsrouteacrosst henetwor
k.

Eachent
ryi
nther
out
ingt
abl
econsi
stsoft
hef
oll
owi
ngent
ri
es:

Net
wor
kID:Thenet
wor
kIDordest
inat
ioncor
respondi
ngt
other
out
e.

SubnetMask:Themaskt
hati
susedt
omat
chadest
inat
ionI
Paddr
esst
othe
net
workID.

NextHop:TheI
Paddr
esst
owhi
cht
hepacketi
sfor
war
ded

Out
goi
ngI
nter
face:

Out
goi
ngi
nter
facet
hepacketshoul
dgooutt
oreacht
hedest
inat
ionnet
wor
k.

Met
ri
c:

A commonuseoft hemetri
cistoindi
cat
ethemi
nimum numberofhops
(
router
scr
ossed)t
othenet
workID.

Destinat
ion:Whenar outerr
ecei
vesapacket
,itexami
nest
hedest
inati
onI P
address,andl ooksupintoit
sRouti
ngTabletof i
gur
eoutwhi
chi nt
erface
packetwillbesentout
.

Bot
hSt
ati
crout
ingandDy
nami
crout
ingar
etheTy
pesofRout
ing.

St
ati
cRout
ing:

Stat
icRouti
ngisalsoknownasnon- adapt
iveroutingwhichdoesn’
tchange
therout
ingt
ableunlessthenetwor
kadmini
stratorchangesormodif
iest
hem
manuall
y.Stat
icrouting doesnotusecompl exr out
ing al
gor
it
hmsand It
pr
ovi
deshi
ghormor
esecur
it
ythandy
nami
crout
ing.

Dy
nami
cRout
ing:

Dynamicrout
ingisal
soknownasadapt i
verouti
ngwhichchangesther
outi
ng
tabl
eaccordi
ngt othechangeint opology.Dynamicrout
ingusescompl ex
rout
ingal
gori
thmsandi tdoesnotpr ovi
dehighsecuri
tyli
kestat
icrouti
ng.
Whent henetworkchange(t
opology)occurs,itsendsthemessaget ot he
rout
ertoensurethatchangesthent heroutesarerecal
culat
edforsending
updatedr
outi
nginfor
mati
on.

Di
ff
erencebet
weenSt
ati
candDy
nami
cRout
ing:

1. I
nstat
icrout
ingr
outesareuser
-def
ined.I
n dy
nami
crout
ing,r
out
es ar
e
updat
edaccordi
ngtothetopol
ogy.

2. St
ati
crouti
ngdoesnotusecompl
exr
out
ingal
gor
it
hms.Dy
nami
c r
out
ing
usescomplexrout
ingal
gor
it
hms.

3. St
ati
crouti
ngpr
ovi
deshi
ghormor
esecur
it
y.Dy
nami
c r
out
ing pr
ovi
des
l
esssecuri
ty.

4. St
ati
crout
ingi
smanual
. Dy
nami
crout
ingi
saut
omat
ed.

5. St
ati
crout
ingi
simpl
ementedi
nsmal
lnet
wor
ks.Dy
nami
c r
out
ing i
s
i
mplementedi
nlar
genet
works.

6. I
nstati
crouting,addi
ti
onal
resourcesarenotr
equi
red. I
n dy
nami
c
rout
ing,
addit
ionalresour
cesarerequi
red.

7. I
nstati
crout
ing,
fai
lur
eoftheli
nkdi
srupt
stherer
outi
ng.
In dy
nami
c
rout
ing,
fai
lur
eoftheli
nkdoesnoti
nter
ruptt
herer
outi
ng.

8. LessBandwi
dthisr
equi
redi
nSt
ati
cRout
ing.Mor
eBandwi
dthi
srequi
red
i
nDy namicRout
ing.

9. Stat
icRout
ingi
sdi
ff
icul
ttoconf
igur
e. Dy
nami
c Rout
ing i
s easy t
o
confi
gure.

10.Anothernameforst
ati
crout
ingi
snon-
adapt
iver
out
ing.Anot
hernamef
or
dynamicrouti
ngi
sadapti
verout
ing.

Rout
ingTabl
e
Letusnowdiscussrout
ingt
ables.Ahostorarout
erhasarouti
ngt
ablewit
h
anentry
foreachdest
inati
on,
oracombinati
onofdesti
nati
ons,
torout
eIPpacket
s.
Therouti
ng
tabl
ecanbeei t
herst
ati
cordynamic.
StaticRout ingTabl e
Ast at i
cr out ingt abl econt ainsinfor mationent eredmanual ly .The
admi nistrat orent ers
ther outef oreachdest i
nationintot het able.Whenat ableiscr eat ed,i
tcannot
updat eaut omat icallywhent hereisachangei ntheI nternet.Thet abl
emust
bemanual lyal t er ed
byt headmi nist rat or.
Ast at i
cr out i
ngt abl ecanbeusedi nasmal l i
nternetthatdoesnotchange
veryof ten,
orinanexper iment al i
nternetfortroubl eshoot ing.Itispoorst rategytousea
staticrout ing
tablei nabi gi nt er netsuchast heI nternet.
Dy nami cRout ingTabl e
Ady nami cr out ingt ablei supdatedper iodicallybyusi ngoneoft hedy nami c
routing
protocol ssuchasRI P, OSPF, orBGP.Whenev erthereisachangei nthe
Internet,such
asashut downofar outerorbr eaki ngofal ink,thedy nami cr outingprot ocol
s
updat eal l
thet ablesi nt her out er
s( andev entuallyint hehost )automat ically.
Ther outersi nabi ginternetsuchast heI nternetneedt obeupdat ed
dynami cally
foref fi
cientdel i
v er yoft heIPpacket s.Wedi scussi ndet ailthet hreedy namic
routing
protocol s.

I
nter
netPr
otocol
IPstandsf orinternetpr
otocol
.Iti
sapr otocoldefinedint heTCP/ I
Pmodel
usedf orsendingthepacketsfr
om sourcet odest i
nation.Themai ntaskofIP
i
st odel i
vert hepacketsf r
om sourcet ot hedest inati
onbasedont heIP
addressesav ail
ableinthepacketheader s.IPdef inest hepacketst r
uct
ure
thathidesthedat awhichistobedeli
veredaswel last headdressi
ngmet hod
thatl
abelsthedat agram wi
thasourceanddest inati
oni nf
ormation.

AnI Ppr otocolprov i


destheconnectionl
essservi
ce,whi
chisaccompaniedby
twot ransportprot ocol
s,i.
e.,TCP/I
PandUDP/ I
P,soint
ernetpr
otocoli
salso
knownasTCP/ IPorUDP/ I
P.Thef i
rstversi
onofI P(I
nter
netProt
ocol)was
IPv4.Af t
erIPv4, I
Pv 6camei ntothemarket
, whi
chhasbeenincr
easingl
yused
ont hepubl i
cinternetsi
nce2006.

Hi
stor
yofI
nter
netPr
otocol

Thedevel
opmentoftheprotocolgetsst
artedin1974byBobKahnandVi nt
Cerf
.Iti
susedinconjunct
ionwiththeTransmissi
onCont r
olProtocol(TCP),
sotheytoget
hernamedt heTCP/ I
P.Thefirstmajorversi
onoft heinternet
prot
ocolwasIPv
4,whichwasv ersi
on4.Thisprotocolwasoff
icial
lydeclared
i
nRFC791byt
heI
nter
netEngi
neer
ingTaskFor
ce(
IETF)i
n1981.

Aft
erIPv4,thesecondmaj orver
sionoftheint
ernetprotocolwasIPv
6,whi ch
wasv er
sion6.Itwasoff
iciall
ydeclar
edbytheIETFi n1998.Themainr eason
behindt
hedev el
opmentofI Pv6wast orepl
aceIPv4.Thereisabigdi
fference
betweenIPv4andI Pv6ist hatI
Pv 4uses32bi t
sf oraddressi
ng,whil
eI Pv6
uses128bitsforaddr
essing.

Funct
ion
Themai nf unct
ionoft heinter
netprot
ocoli
stoprov i
deaddressi
ngt othe
hosts,encapsul
atingthedat ai
ntoapacketstr
uct
ure,androutingthedata
fr
om sour cetothedest i
nati
onacrossoneormoreIPnetworks.Inorderto
achievethesef unct
ional
iti
es,i
nter
netprot
ocolpr
ovidestwo maj orthi
ngs
whicharegivenbelow.

Ani
nter
netpr
otocol
def
inest
wot
hings:

• For
matofI
Ppacket

• I
PAddr
essi
ngsy
stem

I
Ppacket

Befor
eanI P packetissentoverthenet
work,twomaj
orcomponent
sar
e
addedinanI
Ppacket ,
i.
e.,
headerandapay
load.
Ty
pesofI
Paddr
esses
I
Pv4addr
essesar
edi
vi
dedi
ntot
wocat
egor
ies:

Publ
icaddr
ess
Thepublicaddressisal soknownasanext ernaladdressast heyaregr ouped
undertheWANaddr esses.Wecanal sodefinethepubl icaddressasawayt o
communi cate out
side t he networ k.This addr ess i
s used t o access the
i
nternet
.Thepubl icaddr essav ailableonourcomput erprovidestheremot e
accesstoourcomput er.Wi ththehel pofapubl icaddr ess,wecansetupt he
homeser vertoaccesst hei nternet.Thisaddressi sgenerall
yassignedbyt he
ISP(Int
ernetServi
cePr ov i
der).

Keypoi
ntsr
elat
edt
opubl
icaddr
essar
e:

• Thescopeofthepubl
icaddr
essisgl
obal
,whi
chmeanst
hatwecan
communicat
eout
sidet
henetwor
k.

• Thi
saddr
essi
sassi
gnedbyt
heI
SP(
Int
ernetSer
vicePr
ovi
der
).

• I
tisnotav
ail
abl
eatf
reeofcost
.

• Wecangett
hePubl
i
cIPbyt
ypi
ngonGoogl
e"Whati
smyI
P".

Pr
ivat
eaddr
ess
Apr i
vateaddr essisal soknownasani nt
ernaladdress, asi ti
sgroupedunder
theLAN addr esses.I tisusedt ocommuni catewi thi
nt henetwor k.These
addressesar enotr outedont heinternetsothatnot raf
ficcancomef r
om the
i
nternett othisprivateaddress.Theaddr essspacef ort heprivat
eaddr essis
all
ocatedusi ngInterNICt ocr
eateourownnet work.Thepr i
vat
eaddr essesare
assignedt omai nlythosecomput ers,print
ers,smar tphones,whi char ekept
i
nsidet hehomeort hecomput er
st hatar ekeptwi thint heorganizati
on.For
exampl e,apr i
vateaddr essisassignedt othepr i
nter,whi chiskeptinsideour
home, sot hatourfami lymembercant akeoutt heprintfrom theprinter.

Ifthecomputerisassignedwi thapr i
vat
eaddr ess,thenthedevi
cesavail
able
withi
nthelocalnet
wor kcanv iewthecomput erthroughthepri
vat
eipaddress.
Howev er,t
hedev i
cesav ai
lableoutsi
det helocalnet workcannotvi
ew t he
comput ert
hroughtheprivateIPaddress,buttheycanaccesst hecomputerif
theyknowt herout
er'spubl i
caddress.Toaccesst hecomputerdir
ect
ly,NAT
(NetworkAddressTranslator)ist
obeused.

Keypoi
ntsr
elat
edt
opr
ivat
eaddr
essar
e:

• I
tsscopei
slocal
,aswecancommuni
cat
ewi
thi
nthenet
wor
konl
y.

• I
tisgener
all
yusedf
orcr
eat
ingal
ocal
areanet
wor
k.

• I
tisav
ail
abl
eatf
reeofcost
.
• We can getto know t
he pri
vat
eIP addr
essbysi
mpl
yty
ping t
he
"
ipconf
ig"ont
hecommandpr ompt.

I
Pv4
TheI nt ernetPr otocol version4( IPv4)ist hedel i
ver ymechani sm usedbyt he
TCP/ IP
protocol s.I Pv4i sanunr el
iableandconnect i
onlessdat agram pr otocol-abest -
effortdel i
v ery
serv i
ce.Thet erm best-effor tmeanst hatI Pv 4pr ov i
desnoer rorcont r
ol orflow
cont rol
(exceptf orer rordet ectionont heheader ).IPv4assumest heunr el
iabili
tyof
theunder lying
l
ay ersanddoesi tsbestt ogetat r
ansmi ssiont hr ought oitsdest ination,but
with
noguar ant ees.
Ifreliabilityi simpor tant,IPv 4mustbepai redwi thar el
iablepr otocolsuchas
TCP.
Anexampl eofamor ecommonl yunder stoodbest -
effortdel i
veryser viceis
thepost
offi
ce.Thepostof f
icedoesi tsbestt odel i
vert hemai lbutdoesnotal ways
succeed.I f
anunr egi st eredl ett
eri slost ,itisupt ot hesenderorwoul d-ber ecipientto
discov ert he
l
ossandr ectifythepr obl em.Thepostof fi
cei t
selfdoesnotkeept rackof
ever ylet ter
andcannotnot i
fyasenderofl ossordamage.
IPv4i sal soaconnect i
onl esspr otocolf orapacket -
swi t
chi ngnet wor kthat
usest he
datagr am appr oach.Thi smeanst hateachdat agr am ishandl edindependent ly
,
and each dat agram can f ollow adi fferentr out et ot hedest i
nation.Thi s
i
mpl i
es
thatdat agr amssentbyt hesamesour cet ot hesamedest inat i
oncoul dar riv
e
outof
order .Al so,somecoul dbel ostorcor rupt eddur i
ngt ransmi ssion.Agai n,IPv4
reli
eson
ahi gher -lev elprotocol totakecar eofal lthesepr oblems.

Dat
agr
am
PacketsintheIPv4layerarecalleddatagr
ams.Adat agr
am i
sav ar
iabl
e-l
ength
packetconsisti
ngoftwopar t
s: headeranddata.Theheaderi
s20t o60by t
es
i
nlengthandcont ai
nsi nf
ormationessenti
altorouti
nganddeli
very.I
tis
customaryinTCP/ I
Ptoshowt heheaderin4-bytsecti
ons.Abr
iefdescri
pti
on
ofeachfiel
di si
norder.
oVersion(VER).This4-bitfielddefinestheversionoftheIPv4protocol.
Cur r
ent l
y
thev ersi
onis4.Howev er,v
ersi
on6( orI Png)mayt ot al
l
yr epl
acev er
sion4in
the
future.Thisfi
eldtel
lstheIPv 4sof t
war er unningi
nt heprocessingmachi ne
thatthe
datagram hast heformatofv ersion4.Al l f
iel
dsmustbei nter
pretedas
specified
i
nt hef ourt
hversionoft heprotocol.Ifthemachi nei susingsomeot her
versionof
IPv4, t
hedatagram isdiscardedrat herthani nter
pretedincorr
ectl
y .
oHeaderlength(HLEN).This4-bitfielddefinesthetotallengthofthe
datagr
am
headerin4-byt
ewor ds.Thisfieldi
sneededbecausethelengthoft
heheader
i
sv ari
able(bet
ween20and60by t
es).Whenther
earenoopt i
ons,t
heheader
l
ength
i
s20by t
es,andthev alueofthisfi
eldis5(5x4=20) .Whentheoptionf
iel
dis
atit
smaxi mum size,thevalueofthisfiel
dis15(
15x4=60) .
oServices.IETFhaschangedtheinterpretationandnameofthis8-bitfield.
This
fi
eld,
previ
ouslycal
ledservi
cet
ype,
i eddi
snowcal
l ff
erent
iat
edser
vices.We
show
bothint
erpr
etati
onsinFigur
e20.
6.
1.Ser
viceTy
pe
Inthi sinter
pretation,thefirst3bi t
sar ecall
edpr ecedencebi t
s.Thenext4bit
s
are
calledt ypeofser vi
ce( TOS)bi ts,andt helastbitisnotused.
a.Pr ecedencei sa3- bitsubf i
eldrangingfrom 0( 000inbi nar
y )t
o7(111in
binar y)
.
Thepr ecedencedef i
nest hepr i
or i
tyofthedat agram i
ni ssuessuchas
congest i
on.
Ifar outeriscongest edandneedst odiscardsomedat agrams, t
hose
dat agrams
withl owestpr ecedencear ediscar dedfir
st.Somedat agr amsi ntheI
nter
net
are
mor eimpor t
antt hanot hers.Forexampl e,adatagram usedf ornetwork
management
i
smuchmor eur gentandi mpor tantthanadat agram cont ai
ningopti
onal
i
nf ormat ionforagr oup.
Thepr
ecedencesubf
iel
dwaspar
tofv
ersi
on4,
butnev
erused.
b.TOSbi t
sisa4- bi
tsubfi
eldwit
heachbithav
ingaspeci
almeaning.
Althougha
bitcanbeei ther0or1,oneandonlyoneofthebit
scanhavethevalueof1i
n
eachdat agram.Wi t
honly1bitsetatat
ime,wecanhavefiv
ediff
erentty
pes
ofservices.

Tot
alLengt
h:Lengt
hofheader+Dat
a(16bit
s),whi
chhasami
nimum v
alue
20byt
esandthemaximum i
s65,
535byt
es.
Ident
if
icat
ion:Uni
quePacketI
dfori
dent
if
yingt
hegr
oupoff
ragment
sofa
singl
eIPdatagram (
16bi
ts)
Fl
ags:3fl
agsof1biteach:r
eser
vedbi
t(mustbezer
o),
donotf
ragmentf
lag,
morefr
agmentsf
lag(sameorder
)
FragmentOff
set
:Repr
esent
sthenumberofDataByt
esaheadoft
hepar
ti
cular
fr
agmentinthepar
ti
cul
arDatagr
am.Speci
fi
edinter
msofnumberof8bytes,
whichhasthemaxi
mum val
ueof65,
528bytes.
Timet ol
i
ve:Datagr
am’
sl i
fet
ime( 8bit
s),I
tpr
event
sthedatagr
am t
oloop
thr
oughthenetworkbyrestr
ict
ingthenumberofHopstakenbyaPacket
befor
edel
iver
ingtot
heDesti
nati
on.
Pr
otocol
:Nameoft
hepr
otocol
towhi
cht
hedat
aist
obepassed(
8bi
ts)
HeaderChecksum:16 bi
ts headerchecksum f
orchecki
ng er
ror
sint
he
dat
agram header
Sour
ceI
Paddr
ess:
32bi
tsI
Paddr
essoft
hesender
Dest
inat
ionI
Paddr
ess:
32bi
tsI
Paddr
essoft
her
ecei
ver
Opt
ion:Opti
onalinformati
onsuchassour
cerout
e,r
ecordr
oute.Usedbyt
he
Net
wor kadmini
stratort
ocheckwhet
herapat
hisworki
ngornot.

I
Pv6
Thenet wor klayerpr otocolintheTCPII
Pprotocol suit
eiscurrent
lyI
Pv4
(I
nternetwor ki
ng
Protocol,version4) .IPv4pr ovi
desthehost
-to-hostcommuni cati
onbetween
systemsi nt heInternet.AlthoughIPv4iswelldesigned,dat
acommuni cati
on
has
evolvedsincet hei nceptionofIPv4inthe1970s.I Pv4hassomedef i
cienci
es
(l
isted
below)thatmakei tunsui t
ablefort
hefast-
growi ngInt
ernet
.
oDespiteallshort-term solutions,suchassubnetting,classlessaddressing,
andNAT,
addr
essdepl
eti
oni
sst
il
lal
ong-
ter
m pr
obl
em i
ntheI
nter
net
.
oTheInternetmustaccommodatereal-timeaudioandvideotransmission.
Thist y
pe
oftransmissionrequi
resminimum del
ayst
rat
egi
esandr
eser
vat
ionof
resourcesnot
providedintheIPv4design.
oTheInternetmustaccommodateencryptionandauthenticationofdatafor
some
applicat i
ons.Noencr y
pt i
onoraut hent i
cat i
onispr ovidedbyI Pv4.
Toov ercomet hesedef iciencies,IPv6( InternetworkingPr otocol,version6) ,
also
knownasI Png( Internetwor ki
ngPr otocol ,nextgeneration),waspr oposedand
i
s
nowast andar d.InIPv6, t
heI nternetpr otocol wasext ensi v
elymodi fiedt o
accommodat e
theunf oreseengr owt hoft heI nt
ernet .Thef or
matandt hel engt
hoft heI P
address
werechangedal ongwi tht hepacketf ormat .Relat
edpr otocols,
suchasI CMP,
wereal so
modi fied.Ot herpr ot
ocol sint henet wor klay er
,suchasARP, RARP, andI GMP,
wereei therdeletedori ncludedi nt heI CMPv 6protocol (seeChapt er21) .
Routingpr otocols,
suchasRI PandOSPF( seeChapt er22) ,wer ealsoslight l
ymodi f
iedt o
accommodat e
thesechanges.Communi cationsexper tspredictthatIPv 6andi t
sr elated
protocol swi l
l
soonr eplacet hecur r
entI Pv ersi
on.I nt hissectionfirstwedi scussI Pv 6.Then
weexpl ore
thestrategi esusedf orthetransit
ionfr
om v ersi
on4t ov ersi
on6.
Theadopt ionofI Pv6hasbeensl ow.Ther easonisthattheor iginal
motivati
on
for
i
tsdev el
opment ,deplet
ionofIPv 4addresses,hasbeenr emedi edbyshort-
ter
m st r
at egies
suchascl asslessaddr essi
ngandNAT.Howev er
,thefast-spreadinguseof
theInter
net ,
andnewser v
icessuchasmobi leIP,I
Pt el
ephony ,
andI P-capabl emobil
e
tel
ephony , may
eventuallyr equir
et hetotal
replacementofI Pv4withIPv6.
Adv
ant
ages
Thenext
-gener
ati
onI
P,orI
Pv6,
hassomeadv
ant
agesov
erI
Pv4t
hatcanbe
summari
zed
asfol
l
ows:
oLargeraddressspace.AnIPv6addressis128bitslong,aswediscussed
i
nChapter
19.Comparedwit
hthe32-
bitaddr
essofI
Pv4,
thi
sisahuge(
296)i
ncr
easei
n
theaddr
essspace.
oBetterheaderformat.IPv6usesanewheaderformatinwhichoptionsare
separat
ed
fr
om thebaseheaderandinser
ted,
whenneeded,betweenthebaseheader
andtheupper-l
ayerdat
a.Thi
ssimpli
fi
esandspeedsupt herout
ingpr
ocess
because
mostoft heopt
ionsdonotneedtobecheckedbyrouter
s.
oNewoptions.IPv6hasnewoptionstoallowforadditionalfunctionalities.
oAl
lowanceforex t
ensi
on.I
Pv6isdesignedt oall
owt heext ensionoft he
protocol
if
requir
edbynewt
echnol
ogi
esorappl
i
cat
ions.
oSupportforresourceallocation.InIPv6,thetype-of-servicefieldhasbeen
removed,butamechanism (
cal
ledj
l
owl )hasbeenaddedt
abel oenablet
he
source
torequestspeci
alhandl
i
ngofthepacket.Thi
smechanism canbeusedto
support
traf
fi
csuchasr eal
-t
imeaudi
oandv i
deo.
oSupportformoresecuri
ty.Theencr
ypt
ionandaut
hent
icat
ionopt
ionsi
n
I
Pv6
pr
ovi
deconf
ident
ial
i
tyandi
ntegr
it
yoft
hepacket
.
PacketFor
mat
TheI Pv6packetisshowni
nFigure20.15.Eachpacketi
scomposedofa
mandat orybase
headerf ol
lowedbythepay
load.Thepayloadconsi
stsoftwopart
s:opti
onal
extension
header sanddatafr
om anupperlay
er.Thebaseheaderoccupi
es40by t
es,
wher easthe
extensionheadersanddatafrom t
heupperl ay
ercontai
nupt o65,535byt
es
ofi
nformat i
on.
S.
N. Fi
eld&Descr
ipt
ion
1Ver
sion(
4-bi
ts)
:Itr
epr
esent
sthev
ersi
onofI
nter
netPr
otocol
,i
.e.0110.

2Tr af
fi
cCl ass(8-bit
s):These8bit
saredi v
idedintotwopar t
s.Themost
si
gnifi
cant6bitsar eusedforTypeofServ
icetolettheRouterKnownwhat
serv
icesshouldbepr ovi
dedtothi
spacket.Theleastsigni
fi
cant2bit
sare
usedforExpli
citCongesti
onNoti
fi
cati
on(
ECN) .

3FlowLabel (20-bi
ts):Thislabeli
susedt omaint
ainthesequenti
alfl
owoft he
packetsbelongingt oacommuni cati
on.Thesourcelabelsthesequencet o
helptherouteridentifythatapar t
icul
arpacketbel
ongst oaspecifi
cflow of
i
nformati
on.Thi sfieldhelpsav oi
dr e-
order
ingofdat
apackets.Itisdesigned
forst
reaming/real-
timemedi a.

4Pay l
oadLengt h( 16-bi
ts)
:Thisfieldisusedt otel
ltheroutershow much
i
nfor
mat ionapar t
icularpacketcontainsi
nitspayl
oad.Payloadiscomposed
ofExtensionHeader sandUpperLay erdat
a.With16bits,upt o65535by t
es
canbei ndicat
ed;butiftheExtensi
onHeader scontai
nHop- by-HopExtensi
on
Header,thenthepay l
oadmayexceed65535by tesandthi
sf i
eldissett
o0.

5 NextHeader(8-bi
ts)
:Thisf i
eldisused t
oi ndi
cate ei
therthe t
ype of
Extensi
onHeader
,oriftheExtensi
onHeaderi
snotpr esenttheniti
ndi
cat
es
theUpperLay
erPDU.Thev al
uesforthet
ypeofUpperLayerPDUar esameas
I
Pv 4’
s.
6HopLi mit(8-
bit
s):Thi
sfiel
disusedt
ost oppackettoloopi
nt henetwor
k
i
nfini
tel
y.ThisissameasTTL i nIPv4.The value ofHop Li
mitfiel
dis
decrementedby1asi tpassesali
nk(r
outer/
hop).Whent hef
iel
dreaches0
thepacketisdi
scar
ded.

7Sour
ceAddr
ess(
128-
bit
s):Thi
sfi
eldi
ndi
cat
est
headdr
essofor
igi
nat
orof
t
hepacket
.

8Desti
nati
onAddress(128-
bit
s):Thi
sfi
eldpr
ovi
dest
headdr
essofi
ntended
r
eci
pientoft
hepacket.
Ext
ensi
onHeader
s
I
nI Pv6,theFixed Headercontai
nsonlyt hatmuch inf
or mati
on whi
ch is
necessary
,avoi
dingthoseinf
ormati
onwhichisei
thernotrequir
edorisrar
ely
used.Allsuchinfor
mat i
onisputbetweentheFixedHeaderandt heUpper
l
ayerheaderi ntheform ofExtensi
onHeaders.EachExt ensi
onHeaderi s
i
dentif
iedbyadisti
nctval
ue.
WhenExt ensi
onHeader sareused,IPv6Fi xedHeader ’
sNextHeaderf i
eld
point
stot hefi
rstExtensionHeader.Ifther
ei sonemor eExtensi
onHeader,
thenthef
irstExt
ensionHeader ’
s‘Next
-Header’fi
eldpoi
ntstothesecondone,
andsoon.Thel astExtensionHeader’
s‘Next-
Header’fi
eldpoi
ntstotheUpper
LayerHeader.Thus,alltheheader spointstot henextonei nalinkedli
st
manner.
I
ftheNextHeaderfiel
dcontai
nsthevalue59,i
tindi
catest
hatt
her
ear
eno
header
saf
tert
hisheader,
notevenUpperLay
erHeader.
Thef
oll
owi
ngExt
ensi
onHeader
smustbesuppor
tedasperRFC2460:

ThesequenceofExt
ensi
onHeader
sshoul
dbe:
Theseheader
s:
1.shoul
dbepr
ocessedbyFi
rstandsubsequentdest
inat
ions.
2.shoul
dbepr
ocessedbyFi
nal
Dest
inat
ion.
ExtensionHeader
sarearr
angedoneaf
teranot
heri
nal
i
nkedl
i
stmanner
,as
depictedint
hefol
lowi
ngdiagr
am:

I
CMPPr
otocol
TheI CMPst andsforInternetCont
rolMessageProtocol
.Itisanetworklay
er
protocol.I
tisusedforer rorhandl
inginthenet
workl ay
er,anditispri
maril
y
usedonnet workdev i
cessuchasr out
ers.Asdiff
erenttypesoferror
scan
existinthenetworklayer,soICMPcanbeusedt or eporttheseer
ror
sandt o
debugt hoseerror
s.
Forex ampl e,somesenderwantstosendthemessaget osomedestinat
ion,
butt heroutercoul
dn'
tsendthemessaget othedest
inat
ion.I
nthi
scase,the
routersendst hemessagetothesendert
hatIcoul
dnotsendt hemessageto
thatdestinati
on.
TheI
P
protocoldoesnothaveanyer ror-r
eporti
ngorer r
or-corr
ectingmechani sm,so
i
tusesamessaget oconveythei nf
ormat i
on.Forexampl e,ifsomeonesends
themessaget othedestinat
ion,themessagei ssomehowst olenbetweenthe
senderandt hedesti
nati
on.Ifnooner eport
stheer ror
,thent hesendermight
thi
nkt hatthemessagehasr eachedt hedesti
nation.Ifsomeonei n-
between
reportstheerr
or,
thenthesenderwi ll
resendthemessagev er yqui
ckly.
Posi
ti
onofI
CMPi
nthenet
wor
klay
er
TheI
CMPr
esi
desi
ntheI
Play
er,
asshowni
nthebel
owdi
agr
am.

I
CMPMessageFor
mat
Themessagef or
mathastwot hi
ngs;onei
sacategoryt
hatt
ell
suswhichtype
ofmessageitis.Ift
hemessagei soferr
orty
pe,theer
rormessagecont
ains
thetypeandthecode.Thetypedefinesthet
ypeofmessagewhilet
hecode
defi
nesthesubtypeoft
hemessage.
TheI
CMPmessagecont
ainst
hef
oll
owi
ngf
iel
ds:

Type:I
tisan8-bi
tfi
eld.I
tdefi
nest
heICMPmessaget
ype.Theval
uesr
ange
fr
om 0to127aredefi
nedf orI
CMPv6,
andt
heval
uesfr
om 128to255ar
ethe
i
nformati
onal
messages.
Code:
Iti
san8-
bitf
iel
dthatdef
inest
hesubt
ypeoft
heI
CMPmessage
Checksum:
Iti
sa16-
bitf
iel
dtodet
ectwhet
hert
heer
rorexi
stsi
nthemessage
ornot.

UNI
CASTROUTI
NGPROTOCOLS
Unicastmeansthetransmissi
onfrom asingl
esendert
oasingl
erecei
ver
.Iti
s
a point-
to-
pointcommuni cat
ion bet
ween senderand r
eceiv
er.There ar
e
var
iousunicastpr
otocolssuchasTCP, HTTP,et
c.
Opt
imi
zat
ion
Ar outerreceivesapacketf rom anet workandpassesi ttoanot hernet wor k.A
routeris
usuallyattachedt oseveralnetwor ks.Wheni treceivesapacket , t
owhi ch
networ k
shouldi tpasst hepacket?Thedeci si
onisbasedonopt i
mizati
on: Whi chof
theav ail
able
pathway sistheopt imum pat hway ?Whati sthedef ini
tionofthet erm
optimum?
Oneappr oachist oassi
gnacostf orpassingt hroughanet work.Wecal lthis
costa
met ri
c.Howev er ,
themet ri
cassi gnedtoeachnet workdependsont het ypeof
protocol.
Somesi mplepr otocol
s,suchast heRoutingI nformationPr ot
ocol (RIP) ,t
reat
all
networ ksasequal s.Thecostofpassi ngthroughanet wor kisthesame; itis
onehop
count.Soi fapacketpassest hrough10net wor kstoreacht hedest ination, t
he
totalcost
i
s10hopcount s.
Otherpr otocol s,such as Open Shor testPath Fi rst( OSPF),al l
ow t he
admi nistratorto
assi gnacostf orpassi ngt hroughanet wor kbasedont hetypeofser vice
requi red.Ar oute
through a net wor k can hav e di
fferentcost s( met ri
cs).Forexampl e,i f
maxi mum t hroughput
i
st hedesi redt ypeofser vi
ce,asat ell
i
telinkhasal owermet ricthanaf iber-
opticl ine.
Ont heot herhand,i fmi nimum delayi st hedesir
edt ypeofser vice,afiber-
opticl inehas
alowermet ri
ct hanasat el
li
teli
nk.Rout ersuserout ingt ablestohel pdeci de
thebest
route.OSPFpr ot ocolall
owseachr outertohav esev er alrouti
ngtabl esbased
ont he
requi redt ypeofser vi
ce.
Otherpr otocolsdef i
net hemet r
ici nat ot
all
ydiffer entway .I nt heBor der
Gat eway
Prot ocol( BGP) ,t he cri
teri
on ist he policy,which can be setby t he
admini
str
ator
.The
pol
icydef
ineswhatpat
hsshoul
dbechosen.
I
ntr
a-andI
nter
domai
nRout
ing
Today ,ani nternetcanbesol arget hatoner outi
ngpr otocolcannothandl ethe
taskof
updat ingt her outingtablesofal lr outers.Fort hisreason, aninterneti sdiv i
ded
i
nt o
autonomoussy stems.Anaut onomoussy stem (AS)i sagr oupofnet works
andr out ers
undert heaut hori
tyofasi ngleadmi nistration.Rout ingi nsideanaut onomous
system i s
referredt oasi ntradomai nr outing.Rout ingbet weenaut onomoussy stemsi s
referred
toasi nt erdomai nr outing.Eachaut onomoussy stem canchooseoneor
mor ei nt radomai n
routingpr otocolst ohandl er outi
ngi nsidet heaut onomoussy stem.Howev er,
only
onei nter domai nr out
ingpr ot
ocol handl esr outingbet weenaut onomous
systems.Sev eralintr
adomai nandi nterdomai nroutingpr otocol sarei nuse.I n
thissect ion,
wecov eronl ythemostpopul arones.Wedi scusst woi ntradomai nrouting
protocol s:
distancev ectorandl inkst ate.Weal soi ntroduceonei nterdomai nrouting
protocol :pat h
vector( seeFi gure22.13).
Rout ingI nfor mationPr ot ocol(RI P)isani mpl ement at i
onoft hedi stance
vector
protocol .OpenShor testPat hFi rst(OSPF)i sanimpl ement ati
onoft hel i
nk
statepr ot ocol.
Bor derGat ewayPr otocol( BGP)i sani mpl ement at i
onoft hepat hv ect
or
protocol .

Di
stanceVect
orRout
ing
Indistancev ectorrouting,theleast-costrout ebetweenanyt wonodesi sthe
route
withmi nimum di stance.Inthispr ot
ocol,ast henamei mpl i
es,eachnode
maintainsa
vector(table)ofmi nimum di stancest oev erynode.Thet abl
eateachnode
alsoguides
thepacket st othedesi rednodebyshowi ngt henextstopintheroute(next-
hopr outi
ng) .
Wecant hinkofnodesast heci ti
esinanar eaandt hel
inesast heroads
connect i
ng
them.At ablecanshowat ouristthemi nimum di st
ancebet weenciti
es.
InFigure22. 14, weshowasy stem offivenodeswi tht
heircorr
esponding
tabl
es.Thet ablef ornodeAshowshowwecanr eachanynodef r
om thi
snode.
Forex ampl e,
ourleastcostt or eachnodeEi s6.Ther out epassesthroughC.
.

HowDVRPr
otocol
Wor
ks?
Thedistancev ect
orr
outi
ngalgorit
hm wor
ksbyhav
ingeachrout
ermaint
aina
rout
ingtable,givi
ngt
hebest -
knowndist
ancef
rom sour
cetodesti
nat
ionand
whichrouteisusedtogetthere.
Thesetabl
esar eupdatedbyexchangi ngtheinformat
ionwiththenei
ghbor
havi
ng a di
rectl i
nk.Tabl
escont ain one ent
ryforeach rout
e,thi
sentry
contai
nstwo-part
,thepref
err
edout goi
nglineusetoreachthedesti
nat
ionor
anesti
mateoft heti
meordistancetothatdesti
nati
on.
Themet r
icusedcanbethenumberofhopsr equir
edt
oreachf
rom sour
ceto
desti
nati
on.Timedelayinmil
liseconds,therout
ercanmeasur
ei twit
ha
speci
alechosignalwhi
chthereceivercanti
mestampandsendassoonas
possi
ble.
Ther outerexchangesthenetworkt opologyinfor
mat i
onper i
odical
l
ywithits
neighboringnodeandupdatestheinformat i
onintherouti
ngtable.Thecostof
reachingt hedesti
nat
ionisestimatedbasedont hemet ri
c,andanopt imal
pathisobt ai
nedtosenddatapacketsf r
om sourcet odest
inati
on.

ForNumer
ical
s,pl
easer
eferCl
assnot
es.
RI
P
TheRout i
ngInformat
ionPr otocol(RIP)isanintr
adomai nrouti
ngprotocolused
i
nsideanaut onomoussy st
em.I ti
sav erysimpleprotocolbasedondistance
vector
routi
ng.RIPimplementsdistancev ectorrout
ingdirectl
ywithsome
consider
ati
ons:
1.Inanautonomoussy stem, wear edealingwithroutersandnetworks(li
nks).
The
router
shav erout
ingt
ables; networksdonot .
2.Thedestinati
oninaroutingt abl
eisanet work,whichmeanst hefir
stcolumn
defi
nesanet workaddress.
3.Themet ri
cusedbyRI Pisv erysimple;thedist
ancei sdefi
nedasthenumberof
l
inks( net wor ks)toreacht hedest inati
on.Fort hisreason, themet r
icinRIPis
called
ahopcount .
4.Inf inityi sdef inedas16, whi chmeanst hatanyr out einanaut onomoussy stem
using
RIPcannothav emor ethan15hops.
5.Thenex t-nodecolumndef inest headdr essoft her out ertowhi cht hepacketis
tobe
sentt or eachi tsdestinati
on.
Figur e22. 19showsanaut onomoussy stem wi t
hsev ennet wor ksandf our
rout er s.The
tableofeachr outerisalsoshown.Letusl ookatt her out i
ngt abl eforRl.The
tablehas
sev enent riest oshowhowt or eacheachnet worki nt heaut onomoussy stem.
Rout erRl is
direct lyconnect edtonet wor ks130. 10.0.0and130. 11. 0.0,whi chmeanst hat
therear eno
nex t-hopent ri
esfortheset wonet wor ks.Tosendapackett ooneoft hethree
net wor ksat
thef arl eft,routerRlneedst odel iverthepackett oR2.Thenext -nodeent r
yf or
these
threenet wor ksistheinterfaceofr outerR2wi t
hI Paddr ess130. 10.0.1.Tosenda
packet
tot het wonet worksatt hef arr i
ght ,
routerRl needst osendt hepackett othe
i
nt erf aceof
rout erR4wi thIPaddr ess130. 11.0.1.Theot hertabl escanbeexpl ainedsimilarl
y.

Li
nkSt
ateRout
ing
Linkstat
er outinghasadi ff
erentphilosophyfr
om t hatofdistancev ectorr
outing.
In
l
inkstaterouting,ifeachnodei nthedomai nhast heent i
retopologyoft he
domainthe
l
istofnodesandl inks,howtheyar econnectedincludingthet y
pe, cost(metr
ic),
and
condit
ionoft helinks(upordown) -thenodecanuseDi j
kstr
a'salgorit
hm tobuild
a
routingt able.Eachnodeusest hesamet opol
ogy
tocr eatear out
ingtable,butt herouti
ngtabl
eforeachnodei suniquebecause
thecal culations
arebasedondi ffer
entint er
pretati
onsofthetopology.Thisi
sanalogoustoacity
map.Whi l
eeachper sonmayhav et hesamemap, eachneedstotakeadiff
erent
routet o
reachherspeci ficdestinaton.Thet
i opologymustbedy namic,r
epresenti
ngthe
l
at estst ateofeachnodeandeach
l
ink.I ftherear echangesi nanypoi ntinthenetwor k(ali
nkisdown, f
or
exampl e),the
topol ogymustbeupdat edf oreachnode.
1.WemakenodeAt her ootoft het reeandmov eitt ot het entati
v eli
st .Ourt wol i
sts
are
Permanentl ist:empt yTent ativelist:A(O)
2.NodeAhast heshor testcumul ativecostf r
om al l nodesi nthet entat i
velist.We
mov eA
tothepennanentl istandaddal lneighbor sofAt ot het entativeli
st.Ournewl istsare
Permanentl ist:A(O)Tent at
ivelist:B(5), C(2),D(3)
3.NodeChast heshor testcumul ativecostf r
om al l nodesi nthet entat i
velist.We
mov e
Ct ot heper manentl i
st.NodeChast hreenei ghbor s, butnodeAi sal readypr ocessed,
whi chmakest heunpr ocessednei ghbor sjustBandE.Howev er,
Bi sal ready
i
nt het entati
vel i
stwi thacumul at i
vecostof5. NodeAcoul dalsor eachnodeB
throughCwi thacumul at i
vecostof6.Si nce5i slesst han6, wekeepnodeBwi tha
cumul ativecostof5i nt hetent ativelistanddonotr epl aceit.Ournewl i
stsar e
Permanentl ist:A(O) ,
e(2)Tent ativelist:B(5) ,
0(3) ,
E(6)
4.NodeDhast heshor testcumul ativecostofal lthenodesi nthet entativel i
st.We
mov eDt otheper manentl i
st.NodeDhasnounpr ocessednei ghbort obeaddedt o
thet ent ati
velist.Ournewl i
stsar e
Permanentl ist:A(O) C(
, 2),0(3)Tent ativel i
st:B(5),E(6)
5.NodeBhast heshor testcumul ativecostofal lthenodesi nthet entativelist.We
mov eBt otheper manentl i
st.Weneedt oaddal lunpr ocessednei ghbor sofBt othe
tentativ eli
st(thisisj ustnodeE) .Howev er,E(6)isal readyi nthel i
stwi thasmal ler
cumul ativecost .Thecumul ativecostt onodeE, ast henei ghborofB, is8.Wekeep
nodeE( 6)inthet entativelist.Ournewl istsare
Permanentl ist:A(O) B(
, 5) ,C(2),0( 3)Tent ativ
elist:E(6)
6.NodeEhast heshor testcumul ativecostf rom al l nodesi nthet entativelist.We
mov eEt otheper manentl i
st.NodeEhasnonei ghbor .Nowt het entativelistis
empt y.West op; ourshor t
estpat htreei sready .Thef inal l
istsare
Permanentl ist:A(O) B(
, 5) ,C(2),D( 3),E(6)Tent ativ
el ist:empt y
Calcul
ati
onofRout
ingTablefr
om ShortestPathTreeEachnodeusestheshort
est
pathtr
eeprot
ocolt
oconstructi
tsrouti
ngtable.Therout
ingt
ableshowsthecostof
reachi
ngeachnodefr
om theroot.Tabl
e22.2showst herout
ingtabl
efornodeA.

OSPF
TheOpenShor testPat hFi rstorOSPFpr ot ocol i
sani ntradomai nr outing
protocol
basedonl i
nkst ater outing.Itsdomai ni sal soanaut onomoussy stem.
AreasTohandl erout i
ngef f
ici
ent l
yandi nat i
mel ymanner ,
OSPFdi vi
desan
autonomous
system i ntoar eas.Anar eai sacol lectionofnet wor ks, hosts, andr out ersall
contai nedwi thi nanaut onomoussy stem.Anaut onomoussy stem canbe
divi
dedi nt o
manydi fferentar eas.Al lnetwor ksinsi deanar eamustbeconnect ed.
Rout ersi nsideanar eaf loodt hear eawi throut ingi nfor mation.Att hebor der
ofan
area, speci al rout erscalledar eabor derrout er ssummar i
zet hei nformat i
on
aboutt he
areaandsendi ttoot herar eas.Amongt hear easi nsideanaut onomous
system i saspeci al
areacal ledt hebackbone; al
l t
hear easi nsideanaut onomoussy stem mustbe
connect ed
tothebackbone.I notherwor ds, t
hebackboneser vesasapr imar yar eaand
the
otherar easassecondar yar eas.Thi sdoesnotmeant hatther outerswi thin
areascannot
beconnect edt oeachot her,howev er.Ther out ersi nsidethebackbonear e
call
edt he
backboner out ers.Not et hatabackboner out ercanal sobeanar eabor der
router.
If,
becauseofsomepr oblem, t
heconnect i
v it
ybet weenabackboneandan
areai s
broken, av i
r tual l
inkbet weenr outer smustbecr eatedbyanadmi nistratorto
all
ow
continui tyoft hef unct i
onsoft hebackboneast hepr imar yar ea.
Eachar eahasanar eai dent i
fi
cat i
on.Thear eai dent ifi
cationoft hebackbone
i
s
zero.Fi gur e22. 24showsanaut onomoussy stem andi tsareas.
Met ri
cTheOSPFpr otocolall
owst headmi ni
str
atortoassignacost ,
call
edt he
met ri
c,
toeachr oute.Themetri
ccanbebasedonat ypeofser vi
ce(minimum delay,
maxi mum
throughput,andsoon).Asamat t
eroffact,aroutercanhavemul ti
pler
out i
ng
tables,
eachbasedonadi f
ferentty
peofser vi
ce.
TypesofLi nksInOSPFt er
minology,aconnectioniscall
edalink.Fourty
pes
of
l
inkshav ebeendefined:point
-t
o-point
,transi
ent,stub,andvirt
ual(seeFigure
22.25).
Apoi nt -
to-
pointl i
nkconnect stwor outerswithoutanyot herhostorrouteri
n
bet ween.I not herwor ds,thepurposeoft helink(networ k)isjusttoconnect
thet wo
router s.Anexampl eofthistypeoflinkistwor outersconnect edbya
telephonel i
neor
aTl i
ne.Ther eisnoneedt oassignanet workaddresst ot hi
st ypeofli
nk.
Graphi call
y,
ther out ersarer epresentedbynodes, andt heli
nki srepresent edbya
bidirect i
onaledge
connect ingthenodes.Themet ri
cs,whi chareusual l
ythesame, ar
eshownat
thet wo
ends, onef oreachdi rect
ion.Inotherwor ds,eachr outerhasonl yone
neighboratt he
othersi deoft helink(seeFigure22.26).
Atransientlinkisanetwor kwi thsev eralroutersatt
achedt oi t
.Thedatacan
enter
thr
oughanyoft herout
ersandl eavet hroughanyr outer.AllLANsandsome
WANswi th
twoormor er outer
sareoft histype.Int hiscase,eachr outerhasmany
neighbors.For
example, considertheEtherneti nFigure22. 27a.RouterAhasr out
ersB,C,D,
andEas
neighbors.Rout erBhasr outersA, C,D, andEasnei ghbors.Ifwewantto
showt he
nei
ghborhoodr
elat
ionshi
pint
hissi
tuat
ion,
wehav
ethegr
aphshowni
nFi
gur
e
22.27b.
Thisi snei theref fici
entnorr eali
stic.Itisnotefficientbecauseeachr outer
needst o
adv ertisethenei ghbor hoodt ofourot herrouters, foratotalof20
adv ertisement s.I tisnotr eali
sti
cbecauset herei snosi nglenetwork( l
ink)
betweeneachpai rofr outers;
therei sonl yonenet wor kthatservesasacr ossr oadbet weenal lf
iverouter
s.
Toshowt hateachr out erisconnect edt oeveryot herrouterthroughone
singlenet work,
thenet wor kitsel fisrepr esentedbyanode.Howev er,becauseanet wor ki
s
nota
machi ne, i
tcannotf unct i
onasar outer.Oneoft her outersinthenetwor k
takest hi
s
responsi bi
lit
y.I tisassi gnedadual purpose;iti
sat r
uerouteranda
desi gnat edrout er.
Wecanuset het opol ogyshowni nFi gur e22.27ct oshowt heconnect i
onsofa
transient
networ k.

Ast ublinki
sanet workthatisconnectedt oonl
yonerouter.Thedatapacket
s
enterthenetworkthroughthissingl
erouterandleavethenetworkthrough
thi
ssame
router.Thi
sisaspecialcaseoft hetr
ansientnetwor
k.Wecanshowt hi
s
sit
uat i
onusing
therouterasanodeandusi ngthedesignatedrout
erforthenetwork.However
,
thelink
i
sonl yone-dir
ect
ional,f
rom therout
ertot henetwor
k.
Whent helinkbetweent wor outersisbroken,theadminist
rati
onmaycr eatea
vir
tuall i
nkbet weenthem, usingal ongerpaththatprobabl
ygoest hrough
several
routers.
Graphi calRepresentati
onLetusnowexami nehowanAScanber epresented
graphically
.Figure22.29showsasmal lASwi thsevennetworksandsi x
routers.Two
ofthenet wor ksarepoint-
to-pointnetworks.Weusesy mbolssuchasNl and
N2
fortransientandstubnet wor ks.Thereisnoneedt oassignani dent
itytoa
poi
nt-
topoi
nt
net
work.Thefi
gur
eal
soshowst
hegr
aphi
cal
repr
esent
ati
onoft
heASasseen
byOSPF.

Pat
hVect
orRout
ing
Dist ancev ect orandl inkst ater outingar ebot hintradomai nr outi
ngprot
ocols.
Theycan
beusedi nsideanaut onomoussy st em, butnotbet weenaut onomous
syst ems.Theset wo
prot ocol sar enotsui tabl ef orinterdomai nrout i
ngmost l
ybecauseof
scal abi li
ty.Bot hof
theser outingpr ot ocol sbecomei ntract ablewhent hedomai nofoperat
ion
becomes
l
ar ge.Di stancev ect orr out ingissubj ectt oi nstabilit
yi fther earemorethana
fewhops
i
nt hedomai nofoper at i
on.Li nkst at erout ingneedsahugeamountof
resour cest ocal cul ate
rout ingt abl es.I tal socr eat esheav yt raff i
cbecauseoff l
oodi ng.Ther
eisa
need
forat hi rdrout ingpr ot ocol whichwecal lpat hv ectorr out ing.
Pat hv ectorr out ingpr ov edt obeusef ulfori nterdomai nr outing.Thepri
nciple
of
pat hv ect orr out ingi ssi mi lartothatofdi stancev ectorr out i
ng.Inpathvector
rout ing,
weassumet hatt her ei sonenode( ther ecanbemor e, butonei senoughf or
ourconcept ual
discussi on)i neachaut onomoussy stem t hatact sonbehal foftheenti
re
aut onomous
syst em.Letuscal l i
tthespeak ernode.Thespeakernodei nanAScr eatesa
rout ingt abl eandadv er tisesi ttospeakernodesi nt henei ghboringASs.The
i
deai st he
sameasf ordi st ancev ect orroutingexceptt hatonl yspeakernodesi neach
AScancommuni cate
witheachot her.Howev er ,
whati sadv er ti
sedi sdi fferent.Aspeakernode
adv er ti
sest hepat h,nott hemet r
icoft henodes, i
ni tsaut onomoussy stem or
other
aut onomoussy st ems.
NodeAl i
st hespeakernodef orASl ,BlforAS2, ClforAS3, andDl forAS4.
NodeAl createsani nitialtablethatshowsAl toA5ar elocat edinASIandcan
be
reachedt hroughi t.NodeBl adv erti
sest hatBl t
oB4ar elocatedi nAS2and
canbe
reachedt hroughBl .Andsoon.
Shar ingJustasi ndist ancev ectorr outi
ng, i
npat hv ectorrout i
ng, aspeakerin
an
aut onomoussy stem shar esitst ablewi t
hi mmedi at
enei ghbor s.InFigure
22.30, node
Al shar esi tstabl ewi thnodesBl andCl .NodeCl sharesitstabl ewi t
hnodesDl ,
Bl,
andAl .NodeBl shar esi tstablewi thCl andAl .NodeDl sharesi tstablewithCl.
Updat ingWhenaspeakernoder eceivesat wo- columnt ablef rom anei ghbor,
i
t
updat esi t
sownt ablebyaddi ngt henodest hatar enotinitsr outingt abl
eand
addi ngi ts
ownaut onomoussy st em andt heaut onomoussy stem thatsentt het abl
e.
Afterawhi le
eachspeakerhasat ableandknowshowt or eacheachnodei not herASs.
Figur e22. 31
showst het ablesf oreachspeakernodeaf t
ert hesy stem isstabilized.
Accor dingt othef i
gur e, i
frouterAl receivesapacketf ornodesA3, i
tknows
that
thepat hi sinASI( thepacketi sathome) ;buti fitreceivesapacketf orDl,i
t
knowst hat
thepacketshoul dgof rom ASl ,
toAS2, andt hent oAS3.Ther outingt abl
e
showst he
pat hcompl et
ely .Ont heot herhand, i
fnodeDl inAS4r eceivesapacketf or
nodeA2, i
t
knowsi
tshoul
dgot
hroughAS4,
AS3,
andAS1.
BGP
Bor derGat ewayPr otocol (
BGP)i saninterdomainrouti
ngpr otocol usingpath
vect or
rout i
ng.Itfirstappearedin1989andhasgonet hroughf ourversions.
Ty pesofAut onomousSy stemsAswesai dbefore,t
heI nter
netisdi vi
dedi nt
o
hierarchical
domai nscal l
edaut onomoussy st
ems.Forexampl e,alargecor porationthat
managesi t sownnet wor kandhasf ul
lcont r
oloveriti
sanaut onomous
syst em.Al ocal
ISPt hatpr ov i
desservicestolocalcustomer si
sanaut onomoussy stem.We
candi v i
de
aut onomoussy st
emsi ntot hr
eecategories:st
ub,multi
homed, andt ransi
t.
oStubAS.AstubAShasonlyoneconnectiontoanotherAS.The
i
nt erdomai ndata
traffi
cinast ubAScanbeei t
hercreat
edorterminatedi
ntheAS.Thehostsin
theAS
cansenddat atr
aff
ictootherASs.ThehostsintheAScanr ecei
vedat
a
comi ngf r
om
host sinotherASs.Dat atr
affi
c,however
,cannotpassthr
oughast ubAS.A
stubASi seitherasourceorasink.Agoodexampl eofastubASi sasmall
cor porati
onora
smal llocalISP.
oMul
ti
homedAS.Amul
ti
homedAShasmor
ethanoneconnect
iont
oot
her
ASs,
buti
tisst i
ll
onl
yasour ceorsinkfordatatr
aff
ic.I
tcanreceivedatat raff
ic
fr
om
moret hanoneAS.Itcansenddat atr
affi
ctomor ethanoneAS, butt hereisno
tr
ansient
tr
aff
ic.Itdoesnotal
lowdat acomingfrom oneASandgoi ngt
oanot herASt o
passthrough.Agoodexampl eofamul ti
homedASi salargecorporationthat
i
sconnect ed
tomor ethanoneregional
ornationalASthatdoesnotallowtransienttraff
ic.
oTransitAS.AtransitASisamultihomedASthatalsoallowstransient
tr
affi
c.Good
examples of t
ransi
tASs ar
e nat
ionaland i
nter
nat
ionalI
SPs (
Int
ernet
backbones)
.
nextrout ertowhi chthedatapacketshouldbesent .
Theopt ional att
ribut
escanalsobesubdi vi
dedintotwocat egori
es:
t r
ansi
tiv
e
and
nontransitive.Anopt i
onalt
ransi
ti
veat t
ri
buteisonet hatmustbepassedt o
thenext
routerbyt her outert
hathasnotimplement edthi
sat tr
ibute.Anoptional
nontransitive
attr
ibutei sonet hatmustbediscardediftherecei
vingr outerhasnot
i
mpl ement edit.
BGPSessi onsTheexchangeofr outinginfor
mat i
onbet weent worouters
usingBGP
takesplacei nasessi on.Asessi oni saconnect i
ont hati sestablished
betweent woBGP
routersonl yforthesakeofexchangi ngrout inginformat ion.Tocr eatea
reli
ableenv ir
onment ,
BGPusest heser vi
cesofTCP.I not herwor ds, asessi onatt heBGPl ev el,as
anappl i
cat i
onpr ogram, isaconnect i
onatt heTCPl ev el.Howev er,ther eisa
subtledifference
betweenaconnect i
oninTCPmadef orBGPandot herappl i
cationpr ogr ams.
WhenaTCPconnect ioniscr eatedforBGP, itcanlastf oral ongt ime, until
somet hing
unusual happens.Fort hisreason, BGPsessi onsar esomet i
mesr eferredt oas
semi pennanent
connect i
ons.
External andI nternalBGPI fwewantt obepr ecise, BGPcanhav et wot ypes
of
sessions: externalBGP( E-BGP)andi nternal BGP( I-BGP)sessi ons.TheE- BGP
session
i
susedt oexchangei nformat ionbetweent wospeakernodesbel ongi ngt otwo
diff
erent
autonomoussy stems.TheI -BGPsessi on, ontheot herhand, i
susedt o
exchange
routi
ngi nformat i
onbet weent worout er
si nsideanaut onomoussy stem.
Figure22. 32
showst hei dea.

Mul
ti
cast
ing
Inmul t
icastcommuni cat
ion,t
her
eisonesourceandagr oupofdest i
nat
ions.
Ther el
ationshi
p
i
sone- to-many.Int histypeofcommunicat
ion,thesourceaddressisaunicast
address,butthedest i
nationaddr
essi
sagr oupaddress,whichdefi
nesoneor
moredest i
nati
ons.
Thegr oupaddr essi denti
fiest
hemembersoft hegroup.Fi
gure22.34shows
the
i
deabehi ndmul t
icasting.
Br oadcast i
ng
Inbr oadcastcommuni cati
on,
therelati
onshipbetweenthesourceandthe
dest i
nationi s
one- to-
all.Thereisonl
yonesour ce,butal
ltheotherhostsarethe
dest i
nations.The
Internetdoesnotexpl i
citl
ysupportbroadcasti
ngbecauseoft hehuge
amountoft raff
ic
i
twoul dcr eateandbecauseofthebandwi dthitwouldneed.Imaginet
he
traffi
cgener at
ed
i
nt heInternetifonepersonwantedt osendamessaget oeveryoneel
se
connect ed
tot heInternet.

Mul
ti
castRout
ing
Inthissecti
on, wefir
stdiscusstheideaofopt
imal routi
ng,commoni nall
multicast
protocols.Wet hengiveanov erv
iewofmulti
castroutingprotocols.
OptimalRouting:Short
estPathTrees
Thepr ocessofopt i
mal int
erdomainrout
ingeventuall
yresult
sint hefi
ndingof
the
shortestpat
ht ee.Ther
r ootofthetr
eeisthesource,andtheleav esarethe
potent i
al destinat ions.
Thepat hf rom t her oottoeachdest i
nationi stheshor testpath.Howev er ,the
numberoft r
eesandt hef ormat ionoft het r
eesi nunicastandmul t
icast
routi
ngar edi fferent .
Letusdi scusseachsepar ately.
UnicastRout i
ngI nuni castr out i
ng, whenar outerreceiv esapackett of or ward,
i
t
needst of i
ndt heshor testpat htot hedest inationoft hepacket .Ther out er
consul t
si ts
routi
ngt abl ef ort hatpar ti
cul ardest i
nation.Thenext -hopent rycor respondi ng
tothe
destinationi st hest artoft heshor testpat h.Ther outerknowst heshor test
pathf or
eachdest ination, whi chmeanst hatt her outerhasashor testpat htreet o
optimal l
y
reachal ldest inat i
ons.I not herwor ds,eachl ineoft her outingtablei sa
shortestpat h;
thewhol er outingt ableisashor testpatht r
ee.I nunicastr outi
ng, eachr out er
needs
onlyoneshor testpat ht reet of orwar dapacket ;howev er,eachr outerhasi ts
own
shortestpat ht ree.Fi gure22. 36showst hesi tuati
on.
Thef igureshowst hedet ailsoft her outingt ableandt heshor testpat htr eef or
routerRl .Eachl inei nt her out i
ngt ablecor respondst oonepat hf r
om t her oot
tothe
correspondi ngnet wor k.Thewhol etabler epresentst heshor testpat ht ree.
I
nunicastr
outi
ng,eachr
outerint
hedomai nhasat
abl
ethatdef
ines
ashort
estpat
htreetopossi
bledest
inat
ions.
Mul t
icastRoutingWhenar outerrecei
vesamul ticastpacket
,thesi
tuat
ioni
s
diff
erent
from wheni tr
ecei v
esauni castpacket.Amul ti
castpacketmayhav e
destinati
onsinmor e
thanonenet wor k.Forwardingofasi nglepackett omember sofagroup
requiresa
shortestpathtree.Ifwehav engr oups,wemayneednshor t
estpathtr
ees.
Wecani magine
thecompl exit
yofmul t
icastrouting.Twoappr oacheshav ebeenusedtosol
ve
thepr obl
em:
source-basedtreesandgr oup-sharedtrees.
Mul t
iprotocollabelswit
ching(MPLS)i satechniqueforspeedingupnet work
connect i
ons thatwas f i
rstdev el
oped int he 1990s.The publ icInt
ernet
functi
onsbyf orwardi
ngpacket sfrom oneroutertothenextunt ilt
hepackets
reach theirdest i
nati
on.MLPS,on t he otherhand,sends packet s along
predeterminednet workpat hs.Ideal
ly,theresultisthatroutersspendl ess
ti
medeci di
ngwher etof orwardeachpacket ,andpacketstaket hesamepat h
everytime.
Consi
dertheprocessofplanningalongdri
ve.Inst
eadofidenti
fyi
ngwhi ch
townsandci
ti
esonemustdr iv
et hr
oughinor
dertoreacht
hedest i
nat
ion,
itis
usual
lymoreeffi
cientt
oidenti
fytheroadsthatgointhecorrectdir
ect
ion.
Si
milar
ly,MPLSident
ifi
espat
hs— net
wor
k"r
oads"— r
athert
hanaser
iesof
i
nter
medi ar
ydest
inat
ions.
MPLSisconsider
edt ooper
ateatOSIlay
er"2.
5",bel
ow t
henet
wor
klay
er
(
lay
er3)andabovethedat
ali
nklay
er(
lay
er2).

Mobi
leI
Pisacommuni
cat
ionpr
otocol(
creat
edbyext
endi
ngI
nter
net
Prot
ocol,I
P)thatall
owstheuserstomovefrom onenetworktoanotherwith
thesameIPaddr ess.I
tensur
esthatt
hecommuni cat
ionwil
lcont
inuewithout
theuser
’ssessi
onsorconnecti
onsbei
ngdropped.
Ter
minol
ogi
es:
Mobil
eNode( MN)i sthehand-
hel
dcommuni
cat
iondev
icet
hatt
heuser
car
ri
ese.
g.Cel
lphone.
HomeNet worki
sanetwor
kt owhi
chthemobi
l
enodeor
igi
nal
l
ybel
ongsas
peri
tsassi
gnedI
Paddr
ess(homeaddr
ess)
.
HomeAgent(HA)isar
out
eri
n-homenet
wor
ktowhi
cht
hemobi
l
enodewas
or
igi
nal
l
yconnect
ed
HomeAddressistheper
manentI
Paddr
essassi
gnedt
othemobi
l
enode
(
wit
hini
tshomenet
work)
.
Forei
gnNetworkist
hecur
rentnet
wor
ktowhi
cht
hemobi
l
enodei
svi
sit
ing
(awayfr
om i
tshomenet
work)
.
Forei
gnAgent(FA)i
sar out
erinaforei
gnnetwor
ktowhi
cht
hemobilenode
i
scur r
entl
yconnect
ed.Thepacketsf r
om t
hehomeagentaresenttothe
for
eignagentwhi
chdel
i
versthem t
othemobil
enode.
Cor
respondentNode(
CN)i
sadev
iceont
hei
nter
netcommuni
cat
ingt
othe
mobil
enode.
Care-
ofAddress(
COA)isthet
emporar
yaddr
essusedbyamobi
l
enodewhi
l
e
i
tismovingawayfr
om i
tshomenet
work.
ForeignagentCOA,theCOAcoul
dbel ocat
edattheFA,i.
e.,t
heCOAi sanIP
addressoftheFA.TheFAisthet
unnelend-
poi
ntandforwardspacket
stothe
MN.ManyMNusi ngtheFAcanshar
ethisCOAasacommonCOA.
Co-locat edCOA,theCOAi sco-l
ocat
edift
heMN t emporar
il
yacqui r
edan
addi
tionalIPaddresswhi chact
sasCOA.Thisaddressisnow topologi
cal
l
y
corr
ect ,andthetunnelendpoi
ntisattheMN.Co-
locatedaddressescanbe
acquiredusingserv
icessuchasDHCP.
Wor
king:
Thecor respondentnodesendst hedat atot hemobil
enode.Dat apackets
contai
nt he corr
espondentnode’ s addr
ess (Sour
ce)and home addr ess
(Desti
nation)
.Packet sreachthehomeagent .Butnow mobilenodeisnotin
thehomenet work,ithasmov edintothefor
eignnetwork.Theforei
gnagent
sendsthecar e-of
-addresst othehomeagentt owhichallthepacket
sshould
besent .Now,at unnelwi llbeestabli
shedbetweenthehomeagentandt he
for
eignagentbyt hepr ocessoftunneli
ng.
Tunnel
ingest
abl
i
shesav i
rt
ualpipefort
hepacketsavai
labl
ebetweenatunnel
ent
ryandanendpoi
nt.I
tistheprocessofsendingapacketvi
aatunnelandit
i
sachievedbyamechani
sm call
edencapsul
ation.
Now,t hehomeagentencapsul atest hedat apacketsi ntonew packet sin
whichthesour ceaddressi sthehomeaddr essanddest i
nationisthecare-of-
addressandsendsi tt hrought het unneltothef or
eignagent .For
eignagent ,
onanot hersi deofthet unnel,receivesthedat apackets,decapsulatesthem,
andsendst hem tothemobi lenode.Themobi l
enodei nresponsetot hedata
packetsr eceivedsendsar eplyinr esponset otheforei
gnagent .Thef orei
gn
agentdirectlysendsther eplytothecor respondentnode.
KeyMechani
smsi
nMobi
l
eIP:
AgentDiscover
y:Agent
sadver
ti
sethei
rpresencebyper
iodical
lybroadcasti
ng
thei
ragentadv er
ti
sementmessages.Themobi l
enoder eceivi
ngt heagent
advert
isementmessagesobserveswhetherthemessagei sfrom itsown
homeagentanddet er
mineswhetheriti
si nthehomenet workorf orei
gn
network.
AgentRegistrati
on:Mobil
enodeaf terdi
scover
ingtheforeignagentsendsa
regi
str
ati
onr equest(RREQ)t otheforei
gnagent.Theforeignagent,inturn,
sendsther egist
rat
ionrequesttothehomeagentwi t
ht hecare-of-
address.
Thehomeagentsendsar egistr
ati
onrepl
y(RREP)totheforeignagent.Thenit
for
wardstheregi
str
ati
onr
epl
ytot
hemobi
l
enodeandcompl
etest
hepr
ocess
ofregi
str
ati
on.
Tunneli
ng:I testabl
ishesav i
rtualpipeforthepacket sav ai
l
ablebetweena
tunnelentr
yandanendpoi nt.Itistheprocessofsendingapacketv i
aat unnel
andi tisachievedbyamechani sm call
edencapsulation.Ittakesplaceto
forward an IP datagr am from t he home agentt ot he care-
of-
address.
Whenev erthehomeagentr ecei vesapacketfrom thecor r
espondentnode,it
encapsulates the packet wi th source address as home addr ess and
desti
nationascar e-
of-addr
ess.

Rout
eOpt
imi
zat
ioni
nMobi
leI
P:
Ther outeopti
mizati
onaddsaconcept ualdatast ruct
ure,t
hebindingcache,to
thecor r
espondentnode.Thebi ndingcachecont ainsbindi
ngsfort hemobile
node’shomeaddr essandi tscurrentcare-of -
address.Ever
yt i
met hehome
agentr ecei
vesanI Pdat agr
am thati sdest inedt oamobi lenodecur rent
ly
awayf rom thehomenet work,i
tsendsabi ndingupdat etothecor r
espondent
nodet oupdat etheinformati
oni nthecor respondentnode’ sbindingcache.
Afterthis,t
hecorrespondentnodecandi rectlytunnelpacketstot hemobile
node.Mobi l
eIPisprovidedbythenet workpr oviders.
TheIPsecur i
ty(I
PSec)i sanInter
netEngineeri
ngTaskForce(I
ETF)standard
suit
eofpr otocolsbetween2communi cationpoi
ntsacrosstheIPnet work
thatprovi
dedat aauthenti
cat
ion,int
egri
ty,andconfi
dent
ial
it
y.I
talsodefines
theencrypt
ed,decryptedandauthenti
cat
edpackets.Theprot
ocolsneededfor
securekeyexchangeandkeymanagementar edef
inedi
nit.

UsesofI
PSecur
it
y–
I
Pseccanbeusedt
odot
hef
oll
owi
ngt
hings:

Toencr
yptappl
i
cat
ionl
ayerdat
a.
Topr
ovi
desecur
it
yforr
out
erssendi
ngr
out
ingdat
aacr
osst
hepubl
i
cint
ernet
.
Toprov
ideaut
henti
cati
onwit
houtencr
ypt
ion,
li
ket
oaut
hent
icat
ethatt
hedat
a
or
igi
nat
esfrom aknownsender
.
Toprotectnetworkdatabysett
ingupci
rcui
tsusi
ngIPsectunnel
i
nginwhich
al
ldataisbeingsentbetweent
hetwoendpoi
ntsisencr
ypt
ed,aswithaVi
rt
ual
Pr
ivat
eNet work(
VPN)connecti
on.
Component
sofI
PSecur
it
y–
I
thast
hef
oll
owi
ngcomponent
s:
Encapsul
ati
ngSecur
it
yPay
load(
ESP)–
I
tpr
ovi
desdat
aint
egr
it
y,encr
ypt
ion,aut
hent
icat
ionandant
irepl
ay.I
tal
so
pr
ovi
desaut
hent
icat
ionf
orpay
load.
TheIPsecur i
ty(IPSec)isanInter
netEngineeri
ngTaskForce(I
ETF)standard
suit
eofpr otocolsbetween2communi cationpoi
ntsacrosstheIPnet work
thatprovi
dedat aauthenti
cat
ion,i
ntegri
ty,andconfi
dent
ial
it
y.I
talsodefines
theencrypt
ed,decryptedandauthenti
cat
edpackets.Theprot
ocolsneededfor
securekeyexchangeandkeymanagementar edef
inedi
nit.
UsesofI
PSecur
it
y–
I
Pseccanbeusedt
odot
hef
oll
owi
ngt
hings:
Toencr
yptappl
i
cat
ionl
ayerdat
a.
Topr
ovi
desecur
it
yforr
out
erssendi
ngr
out
ingdat
aacr
osst
hepubl
i
cint
ernet
.
Toprov
ideaut
henti
cati
onwit
houtencr
ypt
ion,
li
ket
oaut
hent
icat
ethatt
hedat
a
or
igi
nat
esfrom aknownsender
.
Toprotectnetworkdatabysett
ingupci
rcui
tsusi
ngIPsectunnel
i
nginwhich
al
ldataisbeingsentbetweent
hetwoendpoi
ntsisencr
ypt
ed,aswithaVi
rt
ual
Pr
ivat
eNet work(
VPN)connecti
on.

I
Pv4-Addr
essCl
asses
I
nternetProt ocolhi
erar
chycont ai
nssev eralclassesofI PAddr essestobe
usedef fi
cientl
yi nvari
oussituati
onsaspert her equir
ementofhost sper
network.Broadly,t
heIPv4Addressingsystem isdividedintofiv
eclassesofIP
Addresses.Al lt
hefi
veclassesareident
if
iedbyt hef i
rstoctetofIPAddress.

Thenumberofnet
wor
ksandt
henumberofhost
spercl
asscanbeder
ivedby
thi
sfor
mula

Cl
assAAddr
ess

Thef i
rstbitoft
hefi
rstoct
eti
sal
way
ssett
o0(
zer
o).Thust
hef
ir
stoct
et
rangesfrom 1–127,
i.
e.
Cl
assAAddr
esses

Cl
assAaddressesonl
yincludeIPstar
ti
ngfrom 1.x.
x.xto126.
x.x.
xonl
y.The
I
Prange127.
x.x.
xisr
eserv
edf orl
oopbackI
Paddr esses.

Thedefaul
tsubnetmaskforCl
assAIPaddr
essis255.
0.0.
0whichi
mplies
thatCl
assAaddressi
ngcanhave126net
wor
ks(27-
2)and16777214hosts
(224-
2).

Cl
ass A IP addr
ess f
ormat i
s t
hus:
0NNNNNNN.
HHHHHHHH.HHHHHHHH.HHHHHHHH

Cl
assBAddr
ess

AnIPaddr
esswhi
chbel
ongst
ocl
assBhast
hef
ir
stt
wobi
tsi
nthef
ir
stoct
et
sett
o10,i
.e.

Cl
assBAddr
esses

Cl
assBIPAddr
essesr
angefr
om 128.
0.x.
xto191.
255.
x.x.Thedef
aul
tsubnet
maskf
orCl
assBis255.
255.
x.x.

Class B has 16384 (


214)Net
wor
k addr
esses and 65534 (
216-
2)Host
addresses.

Class B IP addr
ess f
ormat i
s:
10NNNNNN.
NNNNNNNN.
HHHHHHHH.
HHHHHHHH

Cl
assCAddr
ess

Thef
ir
stoct
etofCl
assCI
Paddr
esshasi
tsf
ir
st3bi
tssett
o110,
thati
s−

Cl
assCAddr
esses

ClassC I
P addressesrangefrom 192.0.
0.xt
o223.
255.
255.
x.Thedef
aul
t
subnetmaskforClassCis255.
255.
255.x.

Class C gives 2097152 (


221)Net
wor
k addr
esses and 254 (
28-
2)Host
addresses.

Class C I
P addr
ess f
ormat i
s:
110NNNNN.
NNNNNNNN.
NNNNNNNN.
HHHHHHHH

Cl
assDAddr
ess

Ver
yfi
rstf
ourbit
soft
hef
ir
stoct
eti
nCl
assDI
Paddr
essesar
esett
o1110,
gi
vi
ngarangeof−

Cl
assDAddr
esses

ClassDhasIPaddressrangefr
om 224. 0.
0.0to239.
255.
255.255.Cl
assDi s
reser
vedforMul
ti
casti
ng.Inmul
ticast
ingdataisnotdest
inedforapart
icular
host,t
hati
swhytherei
snoneedt oextracthostaddr
essf
rom theIPaddress,
andCl
assDdoesnothav
eanysubnetmask.

Cl
assEAddr
ess

ThisIPClassisreserv
edf orexper
imentalpurposesonlyf
orR&DorSt udy
.IP
addressesinthi
sclassrangesfrom 240.0.
0.0to255.255.
255.
254.Li
keClass
D,thi
sclasstooisnotequippedwithanysubnetmask.

Subnet
ti
ng
Whenabi ggernetworkisdi
videdintosmallernetworks,t
omai ntainsecur
it
y,
thent hatisknownasSubnet t
ing.So,mai ntenanceiseasi erf orsmal l
er
networks.Forexample,i
fweconsi deracl
assAaddr ess,t
hepossi bl
enumber
ofhost sis224f oreachnetwork,iti
sobvioust hatitisdif
fi
cul ttomai nt
ain
suchahugenumberofhost s,butitwouldbequi t
eeasiertomai ntai
nifwe
divi
det henetworkintosmallparts.Now,let’
st al
kaboutdi vi
dinganet work
i
ntot wopar t
s:Todivi
deanet workintot
wopar ts,youneedt ochooseonebi t
foreachSubnetfrom thehostIDpart.
Intheabovediagr
am,ther
earetwoSubnet
s.Not
e:Iti
sacl
assCI
Pso,t
her
e
are24bit
sinthenetworki
dpartand8bi
tsi
nthehosti
dpar
t.

Subnet
ti
ngforanetworkshouldbedoneinsuchawaythatitdoesnotaf
fect
thenet
workbit
s.I
nclassCt hefi
rst3oct
etsar
enet
workbitssoitremai
nsas
i
tis.

ForSubnet-1:Thef i
rstbitwhichi schosenfrom t
hehostidparti
szeroand
therangewi l
lbefrom (193.
1.2.00000000til
lyougetal
l1’sint
hehostIDpart
i
.e,193.1.
2.01111111)exceptf orthefi
rstbi
twhichischosenzer
oforsubnet
i
dpar t
.Thus, t
herangeofsubnet -1:

193.
1.2.
0to193.
1.2.
127

Subneti
dofSubnet
-1i
s:193.
1.2.
0

Di
rectBr
oadcasti
dofSubnet
-1i
s:193.
1.2.
127

Tot
alnumberofhostpossi
blei
s:126(
Outof128,2i
d’sar
eusedf
or
Subneti
d& Dir
ectBr
oadcasti
d)

SubnetmaskofSubnet
-1i
s:255.
255.
255.
128

ForSubnet-
2:Thefi
rstbi
tchosenfr
om thehostidpar
tisoneandtherange
wil
lbef r
om (193.
1.2.
100000000ti
llyougetall1’
sinthehostID par
ti.e,
193.
1.2.
11111111)
.Thus,t
herangeofsubnet
-2:

193.
1.2.
128t
o193.
1.2.
255
Subneti
dofSubnet
-2i
s:193.
1.2.
128

Di
rectBr
oadcasti
dofSubnet
-2i
s:193.
1.2.
255

Totalnumberofhostpossi
blei
s:126(
Outof128,2i
d’sar
eusedf
or
Subneti
d& DirectBr
oadcasti
d)

SubnetmaskofSubnet
-2i
s:255.
255.
255.
192

Final
ly,af
terusi
ng the subnet
ti
ng t
he t
otalnumberofusabl
e host
s ar
e
reducedfr
om 254to252.

Not
e:

Todivi
deanetworki
ntofour(22)par
tsy ouneedt
ochooset
wobi
tsf
rom t
he
hosti
dpar
tforeachsubneti
.e,(
00,01,10,11)
.

Todivi
deanet
workintoei
ght(23)partsyouneedt ochoosethreebit
sfrom
thehosti
dpar
tforeachsubneti.
e,(000,001,010,011,100,101,110,111)
andsoon.

Wecansayt hati
fthet
otal
numberofsubnet
sinanet
wor
kincr
easest
het
otal
numberofusablehost
sdecreases.

Alongwiththeadvantagethereisasmal ldisadvant
ageforsubnetti
ngthatis,
beforesubnett
ingtofindtheIPaddr essfi
rstnetworki
disfoundt henhostid
fol
lowedbypr ocessi d,butaftersubnett
ingf ir
stnet
workidi sf oundthen
subnetidthenhostidandf i
nal
lyprocessidbyt hi
sthecomputati
oni ncr
eases.

Example1.An organi
zati
on i
s assi
gned a class C net
work addr
ess of
201.35.
2.0.I
tusesanet maskof255.255.255.
192t odiv
idethi
sintosub-
networks.Whi
chofthefol
l
owingi
s/ar
ev al
i
dhostI Paddr
esses?

A.201.
35.
2.129

B.201.
35.
2.191

C.201.
35.
2.255

D.Bot
h(A)and(
C)
Sol
uti
on:

Conver
ti
ng t he last oct
et of t
he net
mask i
nto t
he bi
nar
y f
orm:
255.
255.255.
11000000

Conv
ert
ingt
hel
astoct
etofopt
ionAi
ntot
hebi
nar
yfor
m:201.
35.
2.10000001

Conv
ert
ingt
hel
astoct
etofopt
ionBi
ntot
hebi
nar
yfor
m:201.
35.
2.10111111

Conv
ert
ingt
hel
astoct
etofopt
ionCi
ntot
hebi
nar
yfor
m:201.
35.
2.11111111

From t
heabove,weseet hatOpt
ionBandCisnotav
ali
dhostI
Paddr
ess(
as
theyar
ebroadcastaddr
essofasubnet
work)

andOPTI
ONAi
snotabr
oadcastaddr
essandi
tcanbeassi
gnedt
oahostI
P.

Example2.Anor gani
zati
onhasaclassCnetwor
kaddressof201.
32.
64.
0.I
t
usesasubnetmaskof255. 255.
255.
248.Whi
choft
hefoll
owi
ngisNOTavali
d
broadcastaddr
essforanysubnet
works?

A.201.
32.
64.
135

B.201.
32.
64.
240

C.201.
32.
64.
207

D.201.
32.
64.
231

Sol
uti
on:

Conver
ti
ng t he last oct
et of t
he net
mask i
nto t
he bi
nar
y f
orm:
255.
255.255.
11111000

Conver
ting the last oct
et of opt
ion A i
nto t
he bi
nar
y f
orm:
201.
32.64.
10000111

Conv
ert
ingt
hel
astoct
etofopt
ionBi
ntot
hebi
nar
yfor
m:201.
32.
64.
11110000

Conv
ert
ing t
he l
ast oct
et of opt
ion C i
nto t
he bi
nar
y f
orm:
201.
32.
64.
11001111

Conver
ting the last oct
et of opt
ion D i
nto t
he bi
nar
y f
orm:
201.
32.64.
11100111

From t
heabove,wecanseet hat
,inOPTI
ONA, C,
andDal
lthehostbi
tsar
e1
andgivet
hevali
dbroadcastaddr
essofsubnet
works.

andOPTI
ONBt helastt
hreebi
tsoft
heHostaddr
essar
enot1t
her
efor
eit
’s
notav
ali
dbr
oadcastaddr
ess.

Readnumer
ical
sofCl
assf
ull
andcl
assl
esssubnet
ti
ngf
rom cl
assnot
ebook.

Super
net
ti
ngi
stheopposi
teofSubnet
ti
ng.I
nsubnet
ti
ng,asi
ngl
ebi
g
net
workisdi
vi
dedi
ntomul
ti
plesmal
lersubnet
works.I
nSuper
net
ti
ng,mul
ti
ple
net
worksarecombi
nedi
ntoabiggernetworkter
medasaSuper net
wor
kor
Super
net
.

Supernet t
ingismai nlyusedinRout eSummar i
zat
ion,wher eroutestomul ti
ple
networ kswi t
hsi milarnetworkpr efi
xesarecombi nedi nt
oasi nglerouti
ng
entr
y, withtheroutingentrypoint
ingtoaSupernet work,encompassi ngallt
he
networ ks.Thi
sint urnsignif
icant
lyreducesthesi
zeofr outingtablesandalso
thesizeofr outi
ngupdat esexchangedbyr outi
ngprotocols.

Mor
especi
fi
cal
l
y,

Whenmul t
ipl
enet
wor
ksar
ecombi
nedt
ofor
m abi
ggernet
wor
k,i
tist
ermed
super
-net
ti
ng

Supernett
ingisusedi
nrout
eaggr
egat
iont
oreducet
hesi
zeofr
out
ingt
abl
es
androut
ingtabl
eupdat
es

Ther
ear
esomepoi
ntswhi
chshoul
dbekepti
nmi
ndwhi
l
esuper
net
ti
ng:

Al
ltheNet
wor
ksshoul
dbecont
iguous.

Thebl
ocksi
zeofev
erynet
wor
kshoul
dbeequal
andmustbei
nfor
m of2n.

Fi
rstNet
wor
kidshoul
dbeexact
lydi
vi
sibl
ebywhol
esi
zeofsuper
net
.

You might also like