Tải bản đầy đủ - 0 (trang)
Chapter 12. Painting the Road Signs on Your Interstate (Internetwork)

Chapter 12. Painting the Road Signs on Your Interstate (Internetwork)

Tải bản đầy đủ - 0trang

packetdownthenextnetworkroadwaytogettoitsdestination.

(Notethattherouterforwardsthepacketandmakesthe

decisionofwheretosendthepacket,whichisaslight

departurefromtheanalogywithdriving,inwhichthedriverof

thecardecideswheretoturn.)

Inshort,IPpacketsrelyontheroutershavinggood,complete

routinginformationintheirroutingtables.Thisbriefchapter

coversthemostbasicconceptsofhowaroutercreatesandfills

itsroutingtable.



RoutingtoNearbyPlaces

Imagineasleepylittletownwithacoupleoffellowssitting

aroundattheonlygasstation.BecauseIgrewupinatownlike

that,I'llcallthetownSnellville,aftermyhometown.These

guysarejusttalking,waitingaroundforthenextcustomer.

Astrangerdrivesup,rollsdownhiswindow,andasks,"Excuse

me.CanyoutellmehowtogettoSnellville?"I'msureadozen

funnyorsarcasticanswerswouldprobablyleaptomind,butthe

fellowsatthegasstationwouldeventuallytellthestrangerthat

hehadjustmissedthesignthattoldhimhewasalreadyin

Snellville.Noneedtodriveanyfurther!

Interestingly,routersfirstfilltheirroutingtablesbasedona

similarconcept.Eachrouterknowswhichofitsphysical

interfacesareupandworking.ItknowstheIPaddressesused

oneachinterface.EachrouteralsoknowswhatIPnetworksor

subnetsexistonthephysicalnetworksthatareconnectedto

thoseinterfaces.Theroutercanaddaroutetothesubnetthat

existsonthephysicalnetworkstowhichitisattached.

Beforearoutercanaddroutestothesesubnets,itmusthave

anIPaddressassignedtoeachnetworkinterface.Whenyou

buyabrandnewrouter,itdoesn'tknowwhichIPaddressesyou

wantittouse.Anetworkengineerneedstosomehowtellthe

routerwhichIPaddressestouse;todoso,theengineer

configurestherouter.

Configuringaroutermeansthattheengineerconnectstothe

routerandtypesinsomeinformationaboutwhattherouter

shoulddo.Forinstance,inFigure12-1,R1needstoknowitsIP

addressesforinterfacesEthernet1andEthernet2.Whenthe

engineerconfigurestheIPaddressforeachinterface,healso

(coincidentally)tellstherouterwhichsubnetsornetworksare

attachedtothosetwointerfaces.Figure12-1showsthebasic



concepts.



Figure12-1.ConfiguringaRouterwithItsIP

AddressesandAttachedSubnets



[Viewfullsizeimage]



BeforealltheroutinginChapter11couldwork,therouters

neededtoknowwhattheirinterfaces'IPaddresseswere.Inthis

figure,youseethattheengineertoldR1thatitsIPaddresses

were150.1.1.250(Ethernet1)and150.1.2.1(Ethernet2).

Basedonwhattheengineertoldtherouter,theroutercan

deducethesubnetnumbersconnectedtothosetwointerfaces

andtherangeofvalidIPaddresses.(Althoughthisbookdoesn't

coverthedetails,forthoseofyouwhohavesomerouter

configurationexperience,theengineerconfiguresanIPaddress

andsubnetmaskforeachinterface.Therouterusesthosetwo

numberstofigureouttherangeofvalidIPaddressesineach

subnet.)

AfterR1'stwointerfacesareupandworking,R1knowsafew

importantfacts:

Thesubnetnumbersofthesubnetsthatareconnectedto



thesetwointerfaces.

Theoutgoinginterfaceitshouldusetoforwardpacketsto

thosesubnets.

Itdoesnotneedtosendpacketstoanotherroutersothatit

canreachthesesubnets.

Asaresult,R1simplyaddsarouteforeachdirectlyconnected

subnettoitsroutingtable.Adirectlyconnectedsubnetisa

subnetthatis,well,connecteddirectlytoarouter.Backin

Chapter10,"DeliveringtheGoodstotheRightStreet(IP)

Address,"youlearnedhowalltheIPhostsinthesameIP

subnetwereattachedtothesamephysicalnetwork.InFigure

12-1,R1'sEthernet1interfaceisattachedtothesamephysical

EthernetasHannah;therefore,R1'sEthernet1interfaceis

connecteddirectlytothesamesubnetasHannah.Byaddinga

routeforthatsubnettoitsroutingtable,R1canthenforward

packetstoHannahandotherhostsinthatsubnet.

Likewise,R2canaddtworoutestoitsroutingtableafterthe

networkengineerhasconfiguredR2andthetwointerfacesare

working.Figure12-2showstheroutingtablesonR1andR2,

thistimewiththenewlyaddeddirectlyconnectedroutes

shown.



Figure12-2.You'reAlreadyThere:Directly

ConnectedRoutesinR1'sandR2'sRoutingTables



[Viewfullsizeimage]



Routersalwaysaddroutesfordirectlyconnectedsubnetsand

networks,aslongastheinterfaceisbothconfiguredand

working.Althoughitisimportantthattheroutersincludethe

directlyconnectedsubnetsintheirroutingtables,ifthat'sallR1

andR2knowabout,thentheydonotknowenoughroutesin

theirroutingtable.Forinstance,ifHannahtriestosenda

packettothewebserver(150.1.3.3),thenR1willnothavea

routethatmatchesthepacket'sdestinationaddress,andR1will

simplydiscardthepacket.







PaintingRoadSignsandOtherLong-Lasting

Directions

Ittakesalongtimetobuildahighwayandevenlongertobuild

anewtownorcity.Butwheneveranewroadisfinallyfinished,

someoldroadsignsmightneedtobeupdatedbecausethere

mightbeabetterwaytodrivetosomenearbytown.

Thankfully,becauseittakesalongtimetobuildaroad,the

roadsignsdonothavetoberepaintedveryoften.

Withrouters,thenetworkengineercandotheequivalentof

paintingtheroadsigns.Todoso,theengineercanconfigurea

staticIProute,whichisconfigurationforarouterthattells

theroutertoaddaparticularentrytoitsroutingtable.For

instance,inFigure12-2,R1didn'thavearoutetosubnet

150.1.3.0,meaningitcouldn'tforwardapacketthatwas

destinedforIPaddress150.1.3.3.InFigure12-3,theengineer

solvedtheproblembyconfiguringastaticrouteonR1for

subnet150.1.3.0,withoutgoinginterfaceEthernet2,andnexthoprouterof150.1.2.2.



Figure12-3.PaintingaRoutingTablewitha

StaticRoute



[Viewfullsizeimage]



Beforeaddingthestaticroute,R1didnotknowhowtoforward

packetswhosedestinationswereinsubnet150.1.3.0.NowR1

knowstoforwardthosepacketstoR2next.

Staticrouteswork,buttheycanbeapainintheneckto

maintain.Networktopologiestendtochangealotmore

frequentlythanroadsdo,andstaticroutesmakeitdifficultto

useallthepossibleroutestothesamepartofthenetwork

whenyouhavemultiplepossiblephysicalpaths.Asaresult,

mostcompaniesdonotusestaticroutesthroughouttheir

networks;instead,theyuseroutingprotocols,asdescribedin

thenextsection.







DynamicallyLearningandChangingRouting

Tables

Inmostcities,therearemultiplewaystodrivetosomeother

partoftown.Duringrushhour,youmightlistentotheradiofor

trafficupdatesorwatchforelectronicsignsbytheroadthat

showthelatestinformationaboutroadcongestion.For

instance,areportermightbeflyingoverroadwaysina

helicopterorobservingtrafficthroughcamerasinstalledbeside

themajorroadways.Thereporterpassestheinformationonto

aradioannouncerortosomeonewhotypesinawarningto

appearonanelectronicsignbytheroad.Thenyoumightpass

thesignorhearontheradiothattheroadyou'reonisclosed8

milesaheadduetoanaccident,andyoudecidetotryan

alternateroad.

Asimilar(butnotidentical)concepthappensinnetworking.The

mosttypicalwayarouterlearnsalltherestoftheroutesinan

internetwork,beyondjustitsdirectlyconnectedroutes,isby

usingaroutingprotocol.Routingprotocolsdefinemessages

bywhichrouterscanexchangerouteinformationwithother

routers.Aroutercantellotherroutersabouttheroutesthatit

knows,andthatsameroutercanlistenformessagesfrom

neighboringroutersabouttheroutesthattheyknow.Ifallthe

routersparticipate,allroutersshouldhaveroutesforall

subnetsornetworksinanIPinternetwork.

InFigure12-2,R1andR2knewabouttheirdirectlyconnected

subnets,butnoothers.TheexampleshowninFigure12-4

beginslikeFigure12-2,butinthiscase,R1usesarouting

protocoltotellR2aboutitsroutes.



Figure12-4.R2LearningRoutesfromR1



[Viewfullsizeimage]



Figure12-4showsseveralstepsthatoccurovertime,as

follows:

1. Eachrouterknowsonlyitsrespective,directlyconnected

routes,asshownbytheroutingtablesatthetopofthe

figure.

2. R1sendsaroutingupdatetoR2.Thetermroutingupdate

referstoaroutingprotocolmessagethatcontains

informationaboutIPnetworksandsubnets.NoticethatR1's

routingupdatesimplyliststhesubnetsthatR1hasinits

routingtable.

3. Eachrouterstillhasaroutingtable,withR2'snowlarger

becauseitlearnedsomeroutes.R2decidedtoaddaroute

tosubnet150.1.1.0thesubnetwhereHannahresides.R2

didn'thavearoutetosubnet150.1.1.0before,butafterR2

learnedaboutthatsubnetfromtheroutingupdatethatR1



sent,itnowknowsaboutthisadditionalsubnet.



Alsonoticetheoutgoinginterfaceandnext-hoprouterofthis

newroute.R2usesitsownEthernet1interfaceastheoutgoing

interface.FromFigure12-4,itseemsthatR2woulduseits

interfaceE1toforwardpacketstosubnet150.1.1.0,butR2

choosestoputthatinterfaceintotheroutebecausethat'sthe

interfaceinwhichitreceivedtheroutingupdate.R2alsoputs

R1'sIPaddressof150.1.2.1asthenext-hoprouterbecause

that'stheIPaddressoftherouterthatsenttheroutingupdate.

FromFigure12-4,youcanseethatthisroute'snext-hoprouter

IPaddressshouldbeR1'sIPaddress150.1.2.1.

NoticethatalthoughR2learnedaroutebasedongettingthe

routingupdatefromR1,R1hasnotlearnedanyroutesyet.

Routerslearnrouteswithroutingprotocolswhentheyreceive

routingupdatesfromotherrouters;routerssendrouting

updatessothatotherrouterscanlearnfromthem.ForR1to

learnroutes,anotherrouterneedstotellitaboutotherroutes

witharoutingupdate.Figure12-5showsR2advertisingits

routes,withR1learningaroutetosubnet150.1.3.0.



Figure12-5.R1LearningbyListeningforRouting

Updates



[Viewfullsizeimage]



Figure12-5showsseveralstepsthatoccurovertime,withR1

learningroutesfromR2,asfollows:

1. Eachrouterknowsonlyitsrespective,directlyconnected

routes,asshownbytheroutingtablesatthetopofthe

figure.

2. R2sendsaroutingupdatetoR1.

3. R1'sroutingtablenowholdsaroutetosubnet150.1.3.0.

Also,noticethatR1'soutgoinginterfaceforthatrouteis

Ethernet2,whichistheinterfaceinwhichtheroutingupdate

wasreceived.Thenext-hoprouteris150.1.2.2,whichis

R2'sIPaddress.



NowbothR1andR2haveroutestoallthreesubnetsinthe

figure,withbothrouterslearningtherestoftheroutesby

receivingandprocessingincomingroutingupdates.



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Chapter 12. Painting the Road Signs on Your Interstate (Internetwork)

Tải bản đầy đủ ngay(0 tr)

×