Sunteți pe pagina 1din 52

Data Communication & Computer Networks Lab Manual

By Dhananjay yadav A !"#!$$""% )&C-N*L*./

Under the guidance of Mr Rana Majumdar D&'A()M&N) *+ ,N+*(MA),*N AM,)/ 0C-**L *+ &N.,N&&(,N. AND )&C-N*L*./ AM,)/ UN,1&(0,)/ U))A(

'(AD&0N*,DA 2U3'34

Amity Uni5ersity

INDEX

S.NO $3 3 !3 <3 #3 =3 %3 >3 ?3 $"3 $$3 $ 3

LIST OF EXPERIMENTS Network Commands on Linu6 7 Uni6 8rite a C99 program to perform bit stuffing and de: stuffing3 8rite a C99 program to determine if the ,' address is in Class A; B; C; D; or &3 8rite a C99 program to determine if the ,' address is in Class A; B; or C3 8rite a C99 program to translate dotted decimal ,' address into ! bit address3 )o establish straight configuration for LAN3 )o establish straight configuration for LAN3 )o establish crosso5er configuration for LAN3 )o generate hamming code3 8rite a C99 program to implement the Di@kstra Algorithm to find shortest path3 LAN )rainer Ait )o implement a routing protocol and check its connecti5ity in a 5ariable length subnet masked network

Amity Uni5ersity

&B'&(,M&N) N*3:$ Network Command on L!nu" # $n!" Some %a !& &ommand CCDDocuments and 0ettingsDstudentE!'&on(!) 8indows ,' Configuration &thernet adapter Local Area ConnectionC Connection:specific DN0 0uffi6 3 C ,' Address3 3 3 3 3 3 3 3 3 3 3 3 C $? 3$=>3$3$$ 0ubnet Mask 3 3 3 3 3 3 3 3 3 3 3 C ##3 ##3 ##3" Default .ateway 3 3 3 3 3 3 3 3 3 C CCDDocuments and 0ettingsDstudentEho tname F$NCTION* )he hostname command is used to show or set a computerFs host name and domain name i3e3 displays system identity name3 ,t is one of the most basic of the network administrati5e utilities3 O$TP$T &$:C0LAB>:$ CCDDocuments and 0ettingsDstudentE'!n) +,-.+./.+.+F$NCTION* )he ',N. command is used to test the connection and latency between two network connections3 )hese connections can be either in a local area network or a wide area network or the internet as a whole3 )he ',N. command sends packets of information to a specified ,' Address and then measures the time it takes to get a response from the specified computer or de5ice3 O$TP$T 'inging $? 3$=>3$3$ with ! bytes of dataC (eply from $? (eply from $? (eply from $? (eply from $? 3$=>3$3$ 3$=>3$3$ 3$=>3$3$ 3$=>3$3$ C bytesG! C bytesG! C bytesG! C bytesG! timeH$ms ))LG$ timeH$ms ))LG$ timeH$ms ))LG$ timeH$ms ))LG$ > > > >

'ing statistics for $? 3$=>3$3$ C 'acketsC 0ent G <; (ecei5ed G <; Lost G " 2"I loss4; Appro6imate round trip times in milli:secondsC

Amity Uni5ersity

Minimum G "ms; Ma6imum G "ms; A5erage G "ms

CCDDocuments and 0ettingsDstudentEtra&ert +,-.+./.+.+F$NCTION* )raceroute; also called tracepath; tracert or trace route; is a network tool used to determine the JpathJ packets take from one ,' address to another3 ,t pro5ides the hostname; ,' address; and the response time to a ping3 *ur 5isual traceroute also includes a map displaying each of the hops3 O$TP$T )racing route to $? 3$=>3$3$ o5er a ma6imum of !" hops $ H$ ms H$ ms H$ ms $? 3$=>3$3$ )race complete3

CCDDocuments and 0ettingsDstudentE'ath'!n) +,-.+./.+.+F$NCTION* ,t combines the functionality of 'ing with that of )raceroute; by pro5iding details of the path between two hosts and 'ing:like statistics for each node in the path based on samples taken o5er a time period; depending on how many nodes are between the start and end host3 O$TP$T )racing route to $? 3$=>3$3$ o5er a ma6imum of !" hops " $? 3$=>3$3$$ $ $? 3$=>3$3$ Computing statistics for # seconds333 0ource to -ere )his Node7Link -op ()) Lost70ent G 'ct Lost70ent G 'ct Address " $? 3$=>3$3$$ "7 $"" G "I K $ "ms "7 $"" G "I "7 $"" G "I $? 3$=>3$3$ )race complete3

CCDDocuments and 0ettingsDstudentEar' *a F$NCTION* A(' is used to perform ,' address resolution which is the linking of ,' addresses to MAC 2Media Access Control4 hardware addresses3 A(' uses a broadcast to do this by asking the host that has the gi5en ,' address to respond to the broadcast with its MAC address3 O$TP$T ,nterfaceC $? 3$=>3$3$$ ::: "6
Amity Uni5ersity <

,nternet Address $? 3$=>3$3$ $? 3$=>3$3$!$

'hysical Address )ype "":$=:e=:$a:aa:df dynamic "":$=:e=:$?:c<: % dynamic

CCDDocuments and 0ettingsDstudentEnet tat +,-.+./.+.+F$NCTION* ,t is a command:line tool that displays network connections 2both incoming and outgoing4; routing tables; and a number of network interface statistics3,t is used for finding problems in the network and to determine the amount of traffic on the network as a performance measurement3 O$TP$T Acti5e Connections 'roto Local Address +oreign Address 0tate Acti5e Connections 'roto Local Address +oreign Address 0tate

CCDDocuments and 0ettingsDstudentE'!n) $ a)e0 ping L:tM L:aM L:n countM L:l siNeM L:fM L:i ))LM L:5 )*0M L:r countM L:s countM LL:@ host:listM K L:k host:listMM L:w timeoutM targetOname O't!on 0 :t

'ing the specified host until stopped3 )o see statistics and continue : type Control:BreakP )o stop : type Control:C3 :a (esol5e addresses to hostnames3 :n count Number of echo reQuests to send3 :l siNe 0end buffer siNe3 :f 0et DonFt +ragment flag in packet3 :i ))L )ime )o Li5e3 :5 )*0 )ype *f 0er5ice3 :r count (ecord route for count hops3 :s count )imestamp for count hops3 :@ host:list Loose source route along host:list3 :k host:list 0trict source route along host:list3 :w timeout )imeout in milliseconds to wait for each reply3

CCDDocuments and 0ettingsDstudentE'!n) *a +,-.+./.+.+'inging $? 3$=>3$3$ with ! bytes of dataC


Amity Uni5ersity #

(eply from $? (eply from $? (eply from $? (eply from $?

3$=>3$3$ 3$=>3$3$ 3$=>3$3$ 3$=>3$3$

C bytesG! C bytesG! C bytesG! C bytesG!

timeH$ms ))LG$ timeH$ms ))LG$ timeH$ms ))LG$ timeH$ms ))LG$

> > > >

'ing statistics for $? 3$=>3$3$ C 'acketsC 0ent G <; (ecei5ed G <; Lost G " 2"I loss4; Appro6imate round trip times in milli:secondsC Minimum G "ms; Ma6imum G "ms; A5erage G "ms CCDDocuments and 0ettingsDstudentE'!n) 12 !3e +,-.+./.+.+'inging $? 3$=>3$3$ with " bytes of dataC (eply from $? (eply from $? (eply from $? (eply from $? 3$=>3$3$ 3$=>3$3$ 3$=>3$3$ 3$=>3$3$ C bytesG" timeH$ms ))LG$ C bytesG" timeH$ms ))LG$ C bytesG" timeH$ms ))LG$ C bytesG" timeH$ms ))LG$ > > > >

'ing statistics for $? 3$=>3$3$ C 'acketsC 0ent G <; (ecei5ed G <; Lost G " 2"I loss4; Appro6imate round trip times in milli:secondsC Minimum G "ms; Ma6imum G "ms; A5erage G "ms

CCDDocuments and 0ettingsDstudentE(!n)er Displays information about a user on a specified system running the +inger ser5ice3 *utput 5aries based on the remote system3 +,N.&( L:lM LuserMRhost L333M :l Displays information in long list format3 user 0pecifies the user you want information about3 *mit the user parameter to display information about all users on the specifed host3 Rhost 0pecifies the ser5er on the remote system whose users you want information about3 S (!n)er
Amity Uni5ersity =

O$TP$T Login Name root 0uperuser root 0uperuser student student student student student student student student student student student student student student student student student student student

)ty ,dle Login )ime 8here T" !<<d )hu 0ep ! $"C < p" $ d )hu 0ep ! $"C < Tp$ )ue 0ep $# $$C## $"3"3$!3 <$ Tp )ue 0ep $# $ C! $"3"3$ 3=# Tp! )ue 0ep $# $ C!> $"3"3$!3$< Tp< $ )ue 0ep $# $$C## $"3"3$!3$%? Tp# )ue 0ep $# $ C!% $"3"3$ 3$# Tp= )ue 0ep $# $ C ? $"3"3$ 3$ Tp% )ue 0ep $# $ C % $"3"3$!3 > Tp> $ )ue 0ep $# $ C < $"3"3$!3 <> Tp? % )ue 0ep $# $ C % $"3"3$!3 "= Tp$$ )ue 0ep $# $$C#= $"3"3$!3$?? Tp$ $! )ue 0ep $# $ C"# $"3"3$!3$#% Tp$! ! )ue 0ep $# $ C # $"3"3$!3$#$ Tp$< $ )ue 0ep $# $$C## $"3"3$ 3?= Tp$# )ue 0ep $# $ C!! $"3"3$ 3 <" Tp$= $ )ue 0ep $# $ C = $"3"3$!3 !$ Tp$% > )ue 0ep $# $$C#= $"3"3$ 3> Tp$> )ue 0ep $# $ C"> $"3"3$!3#< Tp$? )ue 0ep $# $ C!< $"3"3$ 3>$ Tp " )ue 0ep $# $ C # $"3"3$!3 <?

S who am ! F$NCTION* ,t is a command found on most Uni6:like operating systems3 ,t prints the effecti5e userid 2username4 of the current user when in5oked3 O$TP$T student ttyp ! 0ep $# $ C!>

S who F$NCTION* displays information about all the users currently logged onto the system3 )he user name; terminal number and the date and time that each user logged onto the system3 O$TP$T root tty" 0ep ! $"C < root ttyp" 0ep ! $"C < student ttyp$ 0ep $# $$C## student ttyp 0ep $# $ C! student ttyp! 0ep $# $ C!?
Amity Uni5ersity %

student student student student student student student student student student

ttyp< ttyp# ttyp% ttyp> ttyp? ttyp$" ttyp$$ ttyp$! ttyp$< ttyp$#

0ep $# $$C## 0ep $# $ C!% 0ep $# $ C % 0ep $# $ C < 0ep $# $ C % 0ep $# $ C!? 0ep $# $$C#= 0ep $# $ C # 0ep $# $$C## 0ep $# $ C!!

&B'&(,M&N) N*3: '(*BL&MC 8rite a C99 program to perform bit stuffing and de:stuffing3 *BU&C),1&C )o perform bit stuffing and de:stuffing3 0*+)8A(& U0&DC )urbo C993 )-&*(/C ,n data transmission and telecommunication; %!t tu((!n) 2also knownV uncommonlyVas positi5e @ustification4 is the insertion of non information bits into data3 0tuffed bits should not be confused with o5erhead bits3 De:stuffing is opposite of bit: stuffing3 0*LU),*NC WincludeHiostream3hE WincludeHconio3hE

Amity Uni5ersity

>

WincludeHstdio3hE 5oid main24 X clrscr24P int aL "M;iG";kG";countG"P 77count is a 5ariable to count the number of $Fs3 coutHHJ&nter the elements of the array2in $Fs and "Fs form4JP for2iG"PiH$"Pi994 cinEEaLiMP coutHHJDn )he array entered isJP for2iG"PiH$"Pi994 coutHHaLiMP iG"P while2iYG?4 77 'erforming Bit:0tuffing3 X if2aLiMGG$4 X i99P count99P if2countGG#4 X for2kG$$PkEiPk::4 aLkMGaLk:$MP aLiMG"P Z Z else X

Amity Uni5ersity

i99P countG"P Z Z coutHHJDnJHHJ)he array after stuffing isC JP

for2iG"PiHG$"Pi994 coutHHaLiMP coutHHJDnJHHJ)he array after destuffing isC JP iG"P while 2iH$"4 X if2aLiMGG$4 X i99P count99P if2countGG#4 X for2kGiPkH$$Pk994 aLkMGaLk9$MP Z Z else X i99P countG"P Z 77 'erforming Destuffing3

Amity Uni5ersity

$"

Z for2iG"PiH$"Pi994 coutHHaLiMP getch24P Z *U)'U)C: &nter the elements of the array2in $[s and "[s form4$ $ $ $ $ $ " " $ " )he array entered is $$$$$$""$"

)he array after stuffing isC $$$$$"$""$"

)he array after destuffing isC $$$$$$""$"

Amity Uni5ersity

$$

&B'&(,M&N) N*3:!

'(*BL&MC 8rite a C99 program to determine if the ,' address is in Class A; B; C; D; or &3 *BU&C),1&C )o determine if the ,' address is in Class A; B; C; D; or &3 0*+)8A(& U0&DC )urbo C993 )-&*(/C An ,nternet 'rotocol address 2,' address4 is a numerical label assigned to each de5ice 2e3g3; computer; printer4 participating in a computer network that uses the ,nternet 'rotocol for communication3 An ,' address ser5es two principal functionsC host or network interface identification and location addressing3 ,ts role has been characteriNed as followsC JA name indicates what we seek. An address indicates where it is. A route indicates how to get there.J )he designers of the ,nternet 'rotocol defined an ,' address as a ! :bit number and this system; known as ,nternet 'rotocol 1ersion < 2,'5<4; is still in use today3 -owe5er; due to the enormous growth of the ,nternet and the predicted depletion of a5ailable addresses; a new addressing system 2,'5=4; using $ > bits for the address; was de5eloped in $??#3

Amity Uni5ersity

0*LU),*NC 77 )o determine if the ,' address is in Class A; B; C; D or &3 WincludeHiostream3hE WincludeHconio3hE WincludeHstdio3hE 5oid main24 X clrscr24P int aL<M;iG"P coutHHJ&nter )he ,' addressJP for2iG"PiH<Pi994 cinEEaLiMP coutHHJDn ,' ADD(&00CJHHaL"MHHJ3JHHaL$MHHJ3JHHaL MHHJ3JHHaL!MHHJDnJP coutHHJ)he ,' address is in ClassC JP if2aL"MEG" && aL"MHG$ %4 coutHHJClass AJP if2aL"ME$ % && aL"MH$?$4 coutHHJClass BJP if2aL"ME$?$ && aL"MH coutHHJClass CJP if2aL"ME < && aL"MHG !?4 <4

coutHHJClass DJP if2aL"ME !?4 coutHHJClass &JP getch24P Z *U)'U)C

Amity Uni5ersity

$!

&nter )he ,' address$ > =# ?= $# ,' ADD(&00C $ >3=#3?=3 $# )he ,' address is in ClassC Class B

Amity Uni5ersity

$<

&B'&(,M&N) N*3:<

'(*BL&MC 8rite a C99 program to determine if the ,' address is in Class A; B; or C3 *BU&C),1&C )o determine if the ,' address is in Class A; B; or C3 0*+)8A(& U0&DC )urbo C993 )-&*(/C An ,nternet 'rotocol address 2,' address4 is a numerical label assigned to each de5ice 2e3g3; computer; printer4 participating in a computer network that uses the ,nternet 'rotocol for communication3 An ,' address ser5es two principal functionsC host or network interface identification and location addressing3 0*LU),*NC 77 )o determine if the ,' adress is in Class A; B; or C3 WincludeHiostream3hE WincludeHconio3hE WincludeHstdio3hE 5oid main24 X clrscr24P int aL<M;iG"P coutHHJ&nter )he ,' adressJP for2iG"PiH<Pi994 cinEEaLiMP if2aL"MEG" && aL"MHG$ %4 coutHHJClass AJP if2aL"ME$ % && aL"MH$?$4 coutHHJClass BJP if2aL"ME$?$4 coutHHJClass CJP

Amity Uni5ersity

$#

coutHHJDn,' AD(&00CJHHaL"MHHJ3JHHaL$MHHJ3JHHaL MHHJ3JHHaL!MP getch24P Z *U)'U)C &nter )he ,' address$ =# ?= $# ,' ADD(&00C $ 3=#3?=3 $# )he ,' address is in ClassC Class A

Amity Uni5ersity

$=

&B'&(,M&N) N*3:#

'(*BL&MC 8rite a C99 program to translate dotted decimal ,' address into ! bit address3 *BU&C),1&C )o translate dotted decimal ,' address into ! bit address3 0*+)8A(& U0&DC )urbo C993 )-&*(/C An ,nternet 'rotocol address 2,' address4 is a numerical label assigned to each de5ice 2e3g3; computer; printer4 participating in a computer network that uses the ,nternet 'rotocol for communication3 An ,' address ser5es two principal functionsC host or network interface identification and location addressing3 )he designers of the ,nternet 'rotocol defined an ,' address as a ! :bit number and this system; known as ,nternet 'rotocol 1ersion < 2,'5<4; is still in use today3 -owe5er; due to the enormous growth of the ,nternet and the predicted depletion of a5ailable addresses; a new addressing system 2,'5=4; using $ > bits for the address; was de5eloped in $??#3 0*LU),*NC 778rite a program to translate dotted decimal ,' address into ! bit address WincludeHiostream3hE WincludeHconio3hE 5oid main24 X clrscr24P int i;@;aL<M;binL>MGX$ >;=<;! ;$=;>;<; ;$ZP coutHHJ&nter the ip addressJP for2iG"PiH<Pi994 cinEEaLiMP coutHHJ)he ip address isC:JHHaL"MHHJ3JHHaL$MHHJ3JHHaL MHHJ3JHHaL!MHHendlP for2iG"PiH<Pi994 X for2@G"P@H>P@994

Amity Uni5ersity

$%

X if 2aLiM&binL@M4 coutHH$P else coutHH"P Z coutHHJ3JP Z getch24P Z *U)'U)C &nter the ip address$ ! ! => % )he ip address isC:$ !3! 3=>3% )he ,' address in binary form isC: "$$$$"$$3""$"""""3"$"""$""3"""""$$$3

Amity Uni5ersity

$>

&B'&(,M&N) N*3:=

'(*BL&MC )o establish straight configuration for LAN3 *BU&C),1&C )o establish straight configuration for LAN3 &\U,'M&N)0 (&\U,(&DC: $4 (U :<# connectors

4 )wisted pair cable !4 .ripping or Crimping tool <4 0L):)ool Colour CodingC: $3 *range white 3 *range !3 .reen white <3 Blue #3 Blue white =3 .reen %3 Brown white >3 Brown 0traight ConfigurationC: $:::::::::::::::::::::::::::::::::::::::::::::$ ::::::::::::::::::::::::::::::::::::::::::::: !:::::::::::::::::::::::::::::::::::::::::::::! <:::::::::::::::::::::::::::::::::::::::::::::< #:::::::::::::::::::::::::::::::::::::::::::::# =:::::::::::::::::::::::::::::::::::::::::::::= %:::::::::::::::::::::::::::::::::::::::::::::% >:::::::::::::::::::::::::::::::::::::::::::::>

Amity Uni5ersity

$?

)-&*(/C A 2o&a2 area network 4L5N6 is a computer network that connects computers and de5ices in a limited geographical area such as home; school; computer laboratory or office building3 )he defining characteristics of LANs; in contrast to wide area networks 28ANs4; include their usually higher data:transfer rates; smaller geographic area; and lack of a need for leased telecommunication lines3 A(CN&); )oken (ing and other technology standards ha5e been used in the past; but &thernet o5er twisted pair cabling; and 8i:+i are the two most common technologies currently in use3 '(*C&DU(&C: )he outer co5ering of the wire is peeled off and according to reQuirement the wires are inserted in (U:<# connector and punched with the help of punching tool after punching the wire is tested with 0L)2 0ide locator tool43 (&0UL)C: )he straight wiring for the LAN has been established and tested using 0L) tool3 U0&C: )his type of wiring is used for connecting to 'C or -ub3

Amity Uni5ersity

"

&B'&(,M&N) N*3:%

'(*BL&MC )o establish rollo5er configuration for LAN3 *BU&C),1&C )o establish rollo5er configuration for LAN3 &\U,'M&N)0 (&\U,(&DC: $4 (U :<# connectors

4 )wisted pair cable !4 .ripping or Crimping tool <4 0L):)ool Colour CodingC: $3 *range white 3 *range !3 .reen white <3 Blue #3 Blue white =3 .reen %3 Brown white >3 Brown (ollo5er ConfigurationC: $:::::::::::::::::::::::::::::::::::::::::::::> :::::::::::::::::::::::::::::::::::::::::::::% !:::::::::::::::::::::::::::::::::::::::::::::= <:::::::::::::::::::::::::::::::::::::::::::::# #:::::::::::::::::::::::::::::::::::::::::::::< =:::::::::::::::::::::::::::::::::::::::::::::! %::::::::::::::::::::::::::::::::::::::::::::: >:::::::::::::::::::::::::::::::::::::::::::::$

Amity Uni5ersity

)-&*(/C A 2o&a2 area network 4L5N6 is a computer network that connects computers and de5ices in a limited geographical area such as home; school; computer laboratory or office building3 )he defining characteristics of LANs; in contrast to wide area networks 28ANs4; include their usually higher data:transfer rates; smaller geographic area; and lack of a need for leased telecommunication lines3 A(CN&); )oken (ing and other technology standards ha5e been used in the past; but &thernet o5er twisted pair cabling; and 8i:+i are the two most common technologies currently in use3 '(*C&DU(&C: )he outer co5ering of the wire is peeled off and according to reQuirement the wires are inserted in (U:<# connector and punched with the help of punching tool after punching the wire is tested with 0L)2 0ide locator tool43 (&0UL)C: )he rollo5er wiring for the LAN has been established and tested using 0L) tool3 U0&C: )his type of wiring is used for configuration of the router3

Amity Uni5ersity

&B'&(,M&N) N*3:>

'(*BL&MC )o establish crosso5er configuration for LAN3 *BU&C),1&C )o establish crosso5er configuration for LAN3 &\U,'M&N)0 (&\U,(&DC: $4 (U :<# connectors

4 )wisted pair cable !4 .ripping or Crimping tool <4 0L):)ool Colour CodingC: $3 *range white 3 *range !3 .reen white <3 Blue #3 Blue white =3 .reen %3 Brown white >3 Brown Crosso5er ConfigurationC: $:::::::::::::::::::::::::::::::::::::::::::::! :::::::::::::::::::::::::::::::::::::::::::::= !:::::::::::::::::::::::::::::::::::::::::::::$ <:::::::::::::::::::::::::::::::::::::::::::::< #:::::::::::::::::::::::::::::::::::::::::::::# =::::::::::::::::::::::::::::::::::::::::::::: %:::::::::::::::::::::::::::::::::::::::::::::% >:::::::::::::::::::::::::::::::::::::::::::::>

Amity Uni5ersity

)-&*(/C A 2o&a2 area network 4L5N6 is a computer network that connects computers and de5ices in a limited geographical area such as home; school; computer laboratory or office building3 )he defining characteristics of LANs; in contrast to wide area networks 28ANs4; include their usually higher data:transfer rates; smaller geographic area; and lack of a need for leased telecommunication lines3 A(CN&); )oken (ing and other technology standards ha5e been used in the past; but &thernet o5er twisted pair cabling; and 8i:+i are the two most common technologies currently in use3 '(*C&DU(&C: )he outer co5ering of the wire is peeled off and according to reQuirement the wires are inserted in (U:<# connector and punched with the help of punching tool after punching the wire is tested with 0L) 20ide locator tool43 (&0UL)C: )he crosso5er wiring for the LAN has been established and tested using 0L) tool3 U0&0C )his type of wiring is used for connecting 'C to another 'C3

Amity Uni5ersity

<

&B'&(,M&N) N*3:?

'(*BL&MC )o generate hamming code3 *BU&C),1&C )o generate hamming code3 0*+)8A(& U0&DC )urbo C993 )-&*(/C ,n telecommunication; a 7amm!n) &ode is a linear error:correcting code named after its in5entor; (ichard -amming3 -amming codes can detect up to two simultaneous bit errors; and correct single:bit errorsP thus; reliable communication is possible when the -amming distance between the transmitted and recei5ed bit patterns is less than or eQual to one3 By contrast; the simple parity code cannot correct errors; and can only detect an odd number of errors3 ,n mathematical terms; -amming codes are a class of binary linear codes3 +or each integer there is a code with m parity bits and m ] m ] $ data bits3 )he parity: check matri6 of a -amming code is constructed by listing all columns of length m that are pairwise independent3 -amming codes are an e6ample of perfect codes; codes that e6actly match the theoretical upper bound on the number of distinct code words for a gi5en number of bits and ability to correct errors3 Because of the simplicity of -amming codes; they are widely used in computer memory 2(AM43 ,n particular; a single:error:correcting and double:error:detecting 5ariant commonly referred to as 0&CD&D3 0*LU),*NC Winclude Hiostream3hE WincludeHconio3hE 5oid main 2 4 X int a"; a$; a ; a!; b"; b$; b ; b!; r"; r$; r ; s"; s$; s ; Q"; Q$; Q ; Q!P coutHH J&nter the wordDnJP cinEEa!EEa EEa$EEa"P r"G 2a"9a$9a 4 I P r$G 2a$9a 9a!4 I P r G 2a"9a$9a!4 I P

Amity Uni5ersity

cout HHJ)he code at sender isC JHHa!HHa HHa$HHa"HHr HHr$HHr"P coutHHJDn &nter the code at recei5erCDnJP cinEEb!EEb EEb$EEb"EEQ EEQ$EEQ"P coutHHJb!GJHHb!HHJ;b GJHHb HHJ;b$GJHHb$HHJ;b"GJHHb"HHJ;Q GJHHQ HHJ;Q$GJHHQ$H HJ;Q"GJHHQ"P s"G 2b 9b$9b"9Q"4 I P s$G 2b!9b 9b$9Q$4 I P s G 2b$9b"9b!9Q 4 I P coutHHJDnJHHJs GJHHs HHJ;s$GJHHs$HHJ;s"GJHHs"P if 2 s GG" && s$GG" && s"GG" 4 cout HH JDn No &rrorJP else if 2 s GG" && s$GG" && s"GG$ 4 cout HH JDn &rror at Q"JP else if 2 s GG" && s$GG$ && s"GG" 4 cout HH JDn &rror at Q$JP else if 2 s GG" && s$GG$ && s"GG$ 4 cout HH JDn &rror at b JP else if 2 s GG$ && s$GG" && s"GG" 4 cout HH JDn &rror at Q JP else if 2 s GG$ && s$GG" && s"GG$ 4 cout HH JDn &rror at b"JP else if 2 s GG$ && s$GG$ && s"GG" 4 cout HH JDn &rror at b!JP else if 2 s GG$ && s$GG$ && s"GG$ 4 cout HH JDn &rror at b$JP getch24P clrscr24P Z
Amity Uni5ersity =

*U)'U)C &nter the word $ $ " $ )he code at sender isC $$"$""" &nter the code at recei5erC$ " $ $ " $ " b!G$;b G";b$G$;b"G$;Q G";Q$G$;Q"G" s G$;s$G$;s"G" &rror at b!

&B'&(,M&N) N*3:$"

'(*BL&MC 8rite a C99 program to implement the Di@kstra Algorithm to find shortest path3
Amity Uni5ersity %

*BU&C),1&C )o implement the Di@kstra Algorithm to find shortest path3 0*+)8A(& U0&DC )urbo C993 )-&*(/C D!jk tra8 a2)or!thm; concei5ed by Dutch computer scientist &dsger Di@kstra in $?#= and published in $?#?; L$ML M is a graph search algorithm that sol5es the single: source shortest path problem for a graph with nonnegati5e edge path costs; producing a shortest path tree3 )his algorithm is often used in routing and as a subroutine in other graph algorithms3 +or a gi5en source 5erte6 2node4 in the graph; the algorithm finds the path with lowest cost 2i3e3 the shortest path4 between that 5erte6 and e5ery other 5erte63 ,t can also be used for finding costs of shortest paths from a single 5erte6 to a single destination 5erte6 by stopping the algorithm once the shortest path to the destination 5erte6 has been determined3 +or e6ample; if the 5ertices of the graph represent cities and edge path costs represent dri5ing distances between pairs of cities connected by a direct road; Di@kstraFs algorithm can be used to find the shortest route between one city and all other cities3 As a result; the shortest path first is widely used in network routing protocols; most notably ,0:,0 and *0'+ 2*pen 0hortest 'ath +irst43 0*LU),*NC 77 )o implement Di@kstra[s Algorithm3 WincludeHstdio3hE WincludeHconio3hE WincludeHprocess3hE WincludeHstring3hE WincludeHmath3hE Wdefine ,N ?? Wdefine N = int di@kstra2int costLMLNM;int source;int target4P 5oid main24 X int costLNMLNM;i;@;w;ch;coP int source;target;6;yP clrscr24P
Amity Uni5ersity >

printf2J0hortest path algorithm D,UA0)(AF0 AL.*(,)-M DnDnJ4P for2iG$PiHNPi994 X for2@G$P@HNP@994 X costLiML@MG,NP Z Z for26G$P6HNP6994 X for2yG69$PyHNPy994 X printf2J&nter the weight of the path between node Id and IdCJ;6;y4P scanf2JIdJ;&w4P costL6MLyMGcostLyML6MGwP Z printf2JDnJ4P Z printf2JDn &nter the sourceCJ4P scanf2JIdJ;&source4P printf2JDn &nter the targetJ4P scanf2JIdJ;&target4P coGdi@sktra2cost;source;target4P printf2JDn shortest pathCIdJ;co4P getch24P Z int di@sktra2int costLMLNM;int source;int target4

Amity Uni5ersity

X int distLNM;pre5LNM;selectedLNMGX"Z;i;m;min;start;d;@P char pathLNMP for2iG$PiHNPi994 X distLiMG,NP pre5LiMG:$P Z startGsourceP selectedLstartMG$P distLstartMG"P while2selectedLtargetMGG"4 X minG,NPmG"P for2iG$PiHNPi994 X dGdistLstartM9costLstartMLiMP if2dHdistLiM && selectedLiMGG"4 X distLiMGdP pre5LiMGstartP Z if2minEdistLiM && selectedLiMGG"4 X minGdistLiMP mGiP Z

Amity Uni5ersity

!"

Z startGmP selectedLstartMG$P Z startGtargetP @G"P while2startYG:$4 X pathL@99MGstart9=#P startGpre5LstartMP Z pathL@MGFD"FP strre52path4P printf2JIsJ;path4P return distLtargetMP Z *U)'U)C 0hortest path algorithm D,UA0)(AF0 AL.*(,)-M &nter weight of the path between node $ and C &nter weight of the path between node $ and !C$ &nter weight of the path between node $ and <C< &nter weight of the path between node $ and #C# &nter weight of the path between node &nter weight of the path between node &nter weight of the path between node and !C# and <C and #C!

&nter weight of the path between node ! and <C$ &nter weight of the path between node ! and <C<

Amity Uni5ersity

!$

&nter weight of the path between node < and #C# &nter the sourceC &nter the targetC< C& 0hortest pathC

&B'&(,M&N) N*3:$$ L5N TR5INER 9IT

Amity Uni5ersity

+ig $C,nterface of LAN )A,)

+ig C Configuration ,nterface of LAN )A,)

Sy tem Re:u!rement ; Pa&k!n) L! t Sy tem Re:u!rement

Amity Uni5ersity

!!

'C C

'entium ,, or higher *ne 'C, slot 2! :bit4 reQuired3 2+or 0tar related e6periments that may be de5eloped by user; slots are reQuired in one of the 'Cs4 Minimum (AM as recommended by *0 or by 1C99 if installed 8indows ?> nd &dition; 8indows """ 'rofessional of ^!

*perating 0ystem C Number 'Cs C

1C99 compiler C 1ersion =3" or abo5e 2*ptional ^ for programming7modifying e6periments; to do suggested e6ercises etc3;4

Pa&k!n) L! t

De &r!'t!on Network &mulator Unit Network ,nterface Unit LAN:) 'ower 0upply #:pin D,N cable N,U:N&U ,nterface cable 2D!% ^ D!% flat cable4 'atch chords Manuals 2,nstallation manual; 'rogrammer[s manual; User manual4 0oftware CD 2W ??$#""!4 2N&U4 2N,U4 2LAN:) '04 2W ??$#""$4 2W ??$#"" 4

<ty $ No ! Nos $ No $ No ! Nos

$ 0et $ 0et

$ No

Amity Uni5ersity

!<

)he LAN:) CD contains self:installable software3 ,t also contains de5ice dri5er files for the N,U card that reQuired while installing them3 A setup screen appears when the CD is inserted in the CD (*M dri5e3 +ollow the instructions and complete the installation3 ,f the setup screen does not appear; try one of the followingC $4 Double click _My Computer` icon in the desktop and double click on the CD dri5e icon3 4 )ype _DCD0etup` in the (un command3 0ubstitute the actual CD dri5e letter in place of D3 )he installation dri5e and path is defined to be CCDLantrain by default3 Lea5e this as such and proceed with the installation3 )his installation creates Lantrain directory under C dri5e and copies all the software and necessary DLLs3 ,t also creates LAN:) folder and shortcuts under 0tart:'rograms menu and on the desktop3 )he Lantrain directory contains all of the sub:directories and the files as gi5en in the user manual 2,ntroduction chapter43 )he B,N sub:directory contains some of the e6ecutable e6periments that can be used to start those e6periments3 All other sub: directories and files are used while using with 1C993 )he complete installation will take about $<"MB of hard disk space3 )his includes the intermediate files generated by 1C99 in _Debug` directory under each pro@ect 2e6periment43 )hese intermediate files are created while compiling the source code in 1C993 ,f the 1C99 is not used then these intermediate files may be remo5ed to sa5e hard disk space3 +ollowing e6periment and diagnostics shortcuts are created on the desktop for easy accessing after installationC P9T M5C Token =u Token R!n) Sto' >a!t S2!d!n) >!ndow FTP

Amity Uni5ersity

!#

D!a)no t!& 0oftcopy of LAN:) manual in C-M format is a5ailable under the 0tart:'rograms:LAN:) menu3 All the LAN:) manuals are gi5en here3 NI$ &ard In ta22at!on *ne ! :bit 'C, slot is reQuired in the 'C to install each N,U card3 0witch off the 'C and plug:in the N,U card in a free 'C, slot3 Connect one end of the N,U:N&U interface cable 2'artW ??$#"" 4 to the N,U card3 )he other end has to be connected to the N&U either at _Node$ & ` or _Node & !` or _Node ! & <` connector 2at the rear of the N&U4 0witch on the 'C3 ,t will detect the card automatically and initiates dri5er installation wiNard3 +ollow the steps and complete the installation3 LAN:) CD contains the N,U de5ice dri5er files3 Aeep this CD in the C(:(*M dri5e while installing the dri5er3 +ollowing are the steps that the wiNard passes through and the recommended selections to install N,U successfullyC 0tep $C )he system detects the N,U 'C, card as 'C, Bridge3 Click JNe6tJ3 0tep C 0elect the *ption J0earch for the best dri5er for your de5ice 2recommended4J and click JNe6tJ3 0tep !C select CD:(*M check bo6 and click JNe6tJ3 8iNard will look for the T3inf file and the dri5er files in the LAN:) CD 0tep <C JBenchmark LAN)ON,UC De5ice Dri5erJ will be displayed along with the location of the ,N+ file3 Click JNe6tJ3 0tep #C Click J+inishJ to complete the de5ice dri5er installation3 After installing the software as gi5en in chapter ; run _Acti5ate N,U` from the LAN:) program folder created under the 0tart:'rogram menu3 )his acti5ates the N,U by adding and registering the dri5er files to the list of dri5ers that 8indows ?> or 8indows """ loads when it starts3 (eboot the system when this program prompts to do so3 ,nstall other N,Us in other 'Cs and connect to the N&U as said abo5e3

NE$ In ta22at!on $3 Connect the power supply to the N&U using the #:pin D,N cable 2partW ??$#""$4 pro5ided with the )rainer3 Connect the power supply to the AC outlet using a

Amity Uni5ersity

!=

standard power cord3 LAN:) power supply has an ,&C type power socket for AC input and accepts uni5ersal supply 5oltages3 0witch on the power supply3 3 Connect the N,Us to the N&U through the N,U:N&U flat ,nterface cable 2partW ??$#"" 43 !3 0witch on the power to the N&U3 )he switch is at the rear panel of N&U3 L&Ds will glow as followsC Data (ate G >Abps )opology G BU0 B&( G " +&( G " Delay G " bit )his is the default N&U condition while power:on or while reset3 <3 )o &mulate BU07(,N.70)A( topology; press the )opology switch until the corresponding L&D glows3 During 'ower:on; the N&U emulates BU0 topology3 #3 )o introduce Bit &rrors; press the B&( switch until the corresponding L&D glows3 0imilarly press : : : +&( switch to introduce +rame errors; Delay switch to introduce bit delays 2" to $# bits4 between the nodes and Data (ate switch to set the data rate between >Abps and $Mbps3 & ! only3 Delay can be

Bit errors and +rame errors are introduced between nodes

introduced between the nodes and it depends on how the nodes are interconnected3 =3 Use patch cords 2partW ??$#""!4 to interconnect 5arious elements like nodes; delay blocks; error generating blocks etc3; in the N&U3 &ach node 2with transcei5er4 in N&U has an ,nput; an *utput; a )6 port and (6 port3 &ach delay has an input and output port3 'atch cord connections to setup a BU0 networkC

Amity Uni5ersity

!%

)o connect nodes to the medium 2BU04C Connect posts N$ to )$$; N ^ ) $; N! ^ )!$; N< ^ )<$; N# ^ )#$; N= ^ )=$ )o connect node output to its ne6t delay inputC Connect posts )$! ^ D$$; ) ! ^ D $; )!! ^ D!$; )<! ^ D<$; )#! ^ D#$; )=! ^ D=$ )o connect delay output to the its ne6t node inputC Connect posts D$ ^ ) ;D ^ )! ; D! ^ )< ; D< ^ )# ; D# ^ )=

Pat&h &ord &onne&t!on to etu' a RIN? network0 Connect posts to emulate BU0 network3 Connect D= ^ )$ 3 )his closes the loop and forms a (ing network3 'atch cord connections to setup a 0)A( networkC )o connect nodes to the medium 2BU04C Connect posts N$ to )$$; N ^ ) $; N! ^ )!$; N< ^ )<$; N# ^ )#$; N= ^ )=$ )o connect node output to its ne6t delay inputC Connect posts )$! ^ D$$; ) ! ^ D $; )!! ^ D!$; )<! ^ D<$; )#! ^ D#$; )=! ^ D=$ )o connect delay output to the 0tar masterC Connect posts D$ ^ 0$; D ^ 0 ; D! ^ 0!; D< ^ 0<

+ig !CCheck LAN )A,)

Amity Uni5ersity

!>

Introdu&t!on )he Benchmark LAN:) LAN )rainer consists of a Network &mulator Unit 2N&U4; 'C 'lug:in Network ,nterface Units 2N,U4 and 8in?# based e6periment software3 )he software contains a series of e6periments in the form of stand:alone applicationsP aC[ source code for the e6periments; and a N,U Library3 )he N&U emulates = nodes; which can be configured to Bus; (ing or 0tar topologies3 ,t also has error generators and delay generators between nodes3 &ach N,U card emulates two independent network nodes supporting 5arious MAC layers; on a single 'C3 )he N,U library pro5ides a programming interface similar to that pro5ided by typical &thernet and other network adapters3 )his is register based; with command; data and status registers3 )hese can be accessed 5ia a set of C functionsC N,UOData24; N,UO0tatistics etc3; Frame Format )he format of the data frames used in the LAN:) is shown in +igure $3$ $ Byte $ Byte DA 0A ":??> Bytes DA)A Bytes Checksum Bytes Delimiter

F!)ure @0 L5N Tra!ner Frame Format DA 0A DA)A Checksum Destination Address 0ource Address Data portion can be from " : ??> bytes Checksum field is generated internally by the N,U library3 )he Library interface will generate the checksum while transmission; and also strip the checksum on reception3 As far as the student is concerned this field is insignificant3 Used internally for detecting the end of frame3

Delimiter

?u!de to the L5N Tra!ner )o successfully use the LAN )rainer; a number of hardware and software components must be properly used together 2see +ig3 $3$43 &ach 'C acts as two nodes in the

Amity Uni5ersity

!?

network3 Both are connected to the Network &mulator Unit 5ia the same cable3 )hus; with ! 'Cs; you can e6periment with a =:node network3 *n the software side; the screen is di5ided into windows; one for each node3 )his is accomplished using the LAN )rainer control panel running under 8indows : ?# 3NI$ Card &ach 'C that is part of the LAN )rainer setup must ha5e an N,U Card plugged into it3 )his card has two independent full:duple6 serial channels each of which can operate at data rates between > Ab7s and $ Mb7s3 )he card supports DMA as well as programmed ,7* data transfers3 8ith one such card; a 'C acts as two independent network nodes3 *nce it is properly installed; the 0erial Card should not reQuire further attention3 )he data rate is set from the Network &mulator Unit; and all other parameters can be set by software3 Network Emu2ator $n!t )he Network &mulator Unit acts as a network interconnecting upto = network nodes 2! N,U Cards in ! 'Cs43 &ach card is connected to the Network &mulator Unit 5ia a cable with DB:!% connectors3 *nce properly installed; these should not normally be disturbed3 )he Network &mulator Unit has a number of @umpers that must be properly wired:up depending on the type of network one wants : a bus; a ring; or a star3 )his must correspond to the setting of the )opology selector switch3 )he Network &mulator Unit also has selector switches for Data (ate; Bit Delay; &rror (ate and +rame &rror (ate3 )hese should be set in accordance with the instructions of each e6periment3 ,n addition; there is a (eset switch which should be used before e5ery e6periment; and in case of trouble3 NI$ L!%rary Abo5e the hardware is a library of C functions that pro5ides a programming interface to the LAN )rainer; similar to that pro5ided by typical &thernet and other network adapters3 )his emulated N,U is register:based; with command; data and status registers3 )hese can be accessed 5ia a set of C functionsC N,UOCmd24; N,UOData24 and N,UO0tatus243 )he N,U library also pro5ides a comprehensi5e set of interrupts3 5''2!&at!on So(tware )he final component in any e6periment is the application software3 )his uses the facilities of the N,U library to accomplish some communication task; such as transferring a message from one node to another3 &ach of the two nodes on each 'C can ha5e its independent application software3 /our programs will be at this le5el3 The Phy !&a2 L!nk )he simplest network connecting two computers A and B is an electrical link directly from one to the other3 &ach computer has a network interface unit (NIU) with a transmitter and a recei5er3 A packet is transmitted by one computer as a seQuence of bits and recei5ed by the other in the same order3 Depending on the time it takes to transmit one bit; the link has a capacity or bandwidth of C b7s 2bits per second43

Amity Uni5ersity

<"

8e can e6tend this network to accommodate a third computer; C; by adding a second N,U in each computer and two more links 2+ig3 3< b43 &ach computer can send a packet to either of the others at any time by transmitting it on the appropriate link3 )his type of interconnection; referred to as a complete mesh topology; can be e6tended to connect N computers3 &5ery computer must ha5e 2 N:$4 N,Us and the total number of links is N2N:$47 2+ig3 3# a43 )hus; the benefit of ne5er ha5ing to wait to transmit is outweighed by the large number of N,Us and links e6cept when the number of computers; N; is small; say ! or <3 )o reduce the number of links; e5ery node is connected to one central node in the star topology 2+ig3 3# b43 A packet between any two nodes may need two hops 5ia the central node3 ,f the central node is the source or the destination; only one hop is reQuired3 )he central node is a single point whose failure renders the entire network inoperati5e3 ,n cases where most communication is between one ser5er and its clients; the star topology is especially useful3 )he single point of failure can be a5oided by using the ring or bus topology 2+ig3 3# c and d43 ,n the ring; e5ery computer is attached to a circular cable3 As a packet circulates around the ring; it can be recei5ed by e5ery node3 )o a5oid the packet circulating indefinitely; it is remo5ed by the transmitting node after one round3 ,n order to handle these functions; the attachment is 5ia an electronic circuit called a transceiver3 )he transcei5er is a comple6 de5ice and may fail unless carefully designed3 ,n the bus topology; the network is a single cable; with no acti5e de5ices3 &ach node is connected to it 5ia a simple tap3 )his can be 5ery reliable and ine6pensi5e3 *wing to its simplicity and reliability; the bus is the most popular topology for local area networks3 &thernet; the most widely used LAN uses the bus topology3 Like the ring; the bus also has the broadcast property; i3e3; as a packet propagates down the bus to its ends it can be recei5ed by e5ery node3 ,n the mesh and star topologies; sending the same packet to e5ery node reQuires that N:$ copies of the packet be separately transmitted3 Mak!n) Sen e A network allows one computer to send electrical signals to another computer3 )hese signals ha5e to be somehow interpreted as a stream of bits3 )he stream of bits has different meanings depending on the application3 ,f one computer sends a binary file; and the other e6pects to recei5e an e:mail message; clearly proper communication will not take place3 )his is analogous to a Central .o5ernment official speaking in -indi to a 5illager who knows only )amil3 ,n order for communication to take place; both parties; be they human or computer; must agree on a set of con5entions such as what signals constitute a $ and a "; where are the byte:boundaries in a stream of bits; how is a binary file differentiated from an e: mail message3 0uch a set of con5entions is a protocol3 A network may include computers manufactured by different 5endors with software from 5arious sources3 +or these to be able to communicate; the protocols used must be agreed upon by all the manufacturers; i3e3; standards are reQuired3 +or e6ample; !"
Amity Uni5ersity <$

#$#C is a standard protocol for transmission of a stream of bytes that is widely used for sending data between computers and peripherals such as printers and modems3 %C& is a standard protocol used for reliable transmission of arbitrary data between computers in the ,nternet3

&B'&(,M&N) N*3:$ )o implement a routing protocol and check its connecti5ity in a 5ariable length subnet masked network O%je&t!ve0 )o be able to implement (,'2(outing ,nformation 'rotocol4 in the 1L0M21ariable Length 0ubnet Masking4 network so as to know about subnetting and dynamic configuration protocol and implement it in a real time scenario3 So(tware u ed0 C,0C* 'acket )racer 1ersion #3!3"3"">> To'o2o)y0 < (outers connecting different networks connected through serial cables

Amity Uni5ersity

<

! &nd de5ices 2'3C4 or workstations to check the connecti5ity between different networks3

+ig #C'acket )racer

RouterA0

SeA#A#A*+B-.+.+.C#DA FA#A*+,-.+./.+.+#-C

Router+0 SeA#A#A*+B-.+.+..#DA SeA#+#A*+B-.+.+.+#DA FA#A*+B-.+.+.,#DA

Router-0

SeA#A#A* +B-.+.+.-#DA FA#A*+,-.+./.+.+-,#-C

RouterD0

FA#A*+B-.+.+.+A#DA

FA#+*+B-.+..+.+#+.

PC+0 IP 5dd +,-.+./.+.De(au2t ?ateway +,-.+./.+.+ PC-0 IP 5dd +B-.+..+.De(au2t ?ateway +B-.+..+.+

Amity Uni5ersity

<!

PCD0 IP 5dd +,-.+./.+.+DA De(au2t ?ateway +,-.+./.+.+-, Theory ; Im'2ementat!on on the a%ove taken To'o2o)y IP 5ddre 0 5n ,' address consists of ! bits of information3 )hese bits are di5ided into four sections; referred to as octets or bytes; each containing $ byte 2> bits43 /ou can depict an ,' address using one of three methodsC Dotted:decimal; as in $% 3$=3!"3#= Binary; as in $"$"$$""3"""$""""3"""$$$$"3""$$$""" -e6adecimal; as in AC3$"3$&3!> 0ummary of the three classes of networks / %!t C2a C2a C2a C2a C2a C2a 50 =0 C0 D0 E0 (u22 IP addre Network Network Network Multicast (eser5ed for future -ost Network Network / %!t -ost -ost Network / %!t -ost -ost -ost / %!t

,s di5ided into # ma@or groups Class A Class B Class C Class D Class & Class A; B and C are used in networking Class D is used for broadcasting Class & is reser5ed for the future )he following table shows the range of ,'5< addresses for all classfull type Class A 2":$ %432": ##432": ##432": ##4

Amity Uni5ersity

<<

Class B Class C Class D Class &

2$ >:$?$432": ##432": ##432": ##4 2$? : 2 !432": ##432": ##432": ##4

<: !?432": ##432": ##432": ##4

2 <": ##432": ##432": ##432": ##4

Note C $ %3"3"3" is reser5ed for loopback testing3 IMPORTANT NOTE: Subnetting :0ubnetting is essentially the modification of a single ,' network to create two or more logically 5isible sub:sections3 ,t entails changing the subnet mask of the local network number to produce an e5en number of smaller network numbers; each with a corresponding range of ,' addresses3 0ubnetting is reQuired when one network number needs to be distributed across multiple LAN segments3 )his may be the case in instances whenC )wo network segments are restricted by distance limitations 2for e6ample; remote offices linked 5ia point:to:point circuit43 0egments need to be localiNed for network management reasons 2accounting segment; sales segment; etc343 -osts which dominate most of the LAN bandwidth need to be isolated3

RIP 4Rout!n) In(ormat!on Proto&o26 )he key characteristics of (,' include the followingC (,' is a distance 5ector routing protocol3 -op count is used as the metric for path selection3 )he ma6imum allowable hop count is $#3 (outing updates are broadcast e5ery !" seconds by default3 (,' is capable of load:balancing o5er as many as si6teen eQual:cost paths3 2+our paths is the default34 To ena%2e a dynam!& rout!n) 'roto&o2E you mu t &om'2ete the (o22ow!n) te' 0 Ste' + 0elect a routing protocolC (,'; &,.('; or *0'+3 Ste' - Assign ,' network numbers without specifying subnet 5alues 2e6cept for *0'+43 IMPORTANT NOTE: You must also assign network or subnet addresses and the appropriate subnet mask to the inter a!es"
Amity Uni5ersity <#

RIP Con(!)urat!on )he router r!' command selects (,' as the routing protocol3 b ""% Cisco 0ystems; ,nc3 All rights reser5ed3 ,CND$ 5$3"V#:$! RouterX4&on(!)6F router r!' 0tarts the (,' routing process

RouterX4&on(!)*router6F ver !on &nables (,' 5ersion

RouterX4&on(!)*router6F network network#number 0elects participating attached networks (eQuires a ma@or classful network number

)he network command assigns a ma@or network number that the router is directly connected to3 )he (,' routing process associates interface addresses with the ad5ertised network number and will begin (,' packet processing on the specified interfaces3

Amity Uni5ersity

<=

+ig =C,nterface Ger!(y!n) the RIP Con(!)urat!on )he how !' 'roto&o2 command displays 5alues about routing protocols and the routing protocol timer information that is associated with the router3 )he table describes the significant fields shown in the display3 F!e2d (outing 'rotocol is JripJ used De &r!'t!on 0pecifies the routing protocol

0ending updates e5ery !" updates seconds

0pecifies the time between sending

Amity Uni5ersity

<%

ne6t due in = seconds be sent

0pecifies when the ne6t update is due to

,n5alid after $>" seconds parameter

0pecifies the 5alue of the in5alid

hold down $>" flushed after <"

0pecifies the current 5alue of the hold:down parameter 0pecifies the time 2in seconds4 after which the indi5idual routing information will be thrown 2flushed4 out

*utgoing update

0pecifies whether the outgoing filtering list has been set

,ncoming update

0pecifies whether the incoming filtering list has been set

(edistributing redistributed

Lists the protocol that is being

Default 5ersion control

0pecifies the 5ersion of (,' packets that are sent and recei5ed

(outing

0pecifies the networks for which the routing process is currently in@ecting routes

Amity Uni5ersity

<>

(outing ,nformation 0ources

Lists all the routing sources that the Cisco ,*0 0oftware is using to build its routing table3 +or each source; you will see the following displayedC ,' address Administrati5e distance )ime the last update was recei5ed from this source

+ig %C,nterface D! '2ay!n) the IP Rout!n) Ta%2e


Amity Uni5ersity <?

)he how !' route command displays the contents of the ,' routing table3 )he routing table contains entries for all known networks and subnetworks; and a code that indicates how that information was learned3 )he output and function of key fields from the how !' route command are e6plained in the table3 Out'ut ( or C De &r!'t!on ,dentifies the source of the route3 +or e6ample; a _C` indicates that the route came from a direct connection of the route to a router interface3 An _(` indicates that (,' is the protocol that determined the route3

$? 3$3$3" $% 3$3$3> $? 3$=>3$3$ > $ "7$

,ndicates the address of the remote network3

)he first number in the brackets is the administrati5e distance of the information sourceP the second number is the metric for the route 2here; $ hop43

5ia $"3$3$3

0pecifies the address of the ne6t:hop router to the remote network3

""C""C"%

0pecifies the amount of time since the route was updated 2here; % seconds43

0erial"7"7

0pecifies the interface through which the specified network can be reached3

,f routing information is not being e6changed 2that is; if the output of the how !' route

Amity Uni5ersity

#"

command shows no entries that were learned from a routing protocol4; use the how runn!n)&on(!) or how !' 'roto&o2 pri5ileged &B&C commands on the router to check for a possible misconfigured routing protocol3

RIP Con(!)urat!on Trou%2e hoot!n) Use the de%u) !' r!' command to display (,' routing updates as they are sent and recei5ed3 )he no de%u) a22 command turns off all debugging3 )he following output indicates the source address from which updates were recei5edC (,'C recei5ed 5$ update from $"3$3$3 on 0erial"7"7 )he following output indicates the destination addresses to which updates were sentC (,'C sending 5$ update to ##3 ##3 ##3 ## 5ia +ast&thernet"7" 2$% 3$=3$3$4 (,'C sending 5$ update to ##3 ##3 ##3 ## 5ia 0erial"7"7 2$"3$3$3$4

Amity Uni5ersity

#$

Amity Uni5ersity

S-ar putea să vă placă și