You are on page 1of 74

Computer Networks Lab

Dept. Of C.S.E

1. SYLLABUS
JAWAHARLAL NEHRU ECHNOLO!"CAL UN"#ERS" Y ANAN A$UR
""" Year B. e%&. CSE '" Sem ( $ ) C *

CO+$U ER NE RWOR,S LAB Ob-e%t./e0 To Understand the functionalities of various layers of OSI model S1stem2 Software Re3u.reme4t Intel based desktop PCs LAN CONN CT ! "ith minimum of #$$ %&' or faster processor "ith at least $( %) *A% and #++ %) free disk space $art ' A 1. "mp5eme4t t&e 6ata 5.4k 5a1er fram.47 met&o6s su%& as %&ara%ter8 %&ara%ter stuff.47 a46 b.t stuff.47. *. "mp5eme4t o4 a 6ata set of %&ara%ters t&e t&ree CRC po514om.a5s 9 CRC 1*8 CRC 1: a46 CRC CC"$. ). "mp5eme4t D.-kstra ;s a57or.t&m to %ompute t&e S&ortest pat& t&ru a 7rap&. <. ake a4 e=amp5e sub4et 7rap& w.t& we.7&ts .46.%at.47 6e5a1 betwee4 4o6es. Now obta.4 Rout.47 tab5e art ea%& 4o6e us.47 6.sta4%e /e%tor rout.47 a57or.t&m >. ake a4 e=amp5e sub4et of &osts. Obta.4 broa6%ast tree for .t. :. ake a :< b.t p5a.4 te=t a46 e4%r1pt t&e same us.47 DES a57or.t&m. ?. Wr.te a pro7ram to break t&e abo/e DES %o6.47 @. Us.47 RSA a57or.t&m E4%r1pt a te=t 6ata a46 De%r1pt t&e same.

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 #34(

Computer Networks Lab

Dept. Of C.S.E

*. CO+$U ER NE WOR,S
"4tro6u%t.o40
A %omputer 4etwork is a 5roup of computers that are connected to each other for the purpose of communication2 Net"orks may be classified accordin5 to a "ide variety of characteristics2

Network %5ass.f.%at.o40
The follo"in5 list presents cate5ories used for classifyin5 net"orks2 Co44e%t.o4 met&o60 Computer net"orks can be classified accordin5 to the hard"are and soft"are technolo5y that is used to interconnect the individual devices in the net"ork0 such as Optical fiber0 thernet0 /ireless LAN0 &omePNA0 Po"er line communication or -2hn67ne8t 5eneration7 home net"ork technolo5y92 thernet uses physical "irin5 to connect devices2 .re:uently deployed devices include hubs0 s"itches0 brid5es and;or routers2 /ireless LAN technolo5y is desi5ned to connect devices "ithout "irin52 These devices use radio "aves or infrared si5nals as a transmission medium2 W.re6 e%&4o5o7.es0 Twisted-Pair Wire ' This is the most "idely used medium for telecommunication2 T"isted3pair "ires are ordinary telephone "ires "hich consist of t"o insulated copper "ires t"isted into pairs and are used for both voice and data transmission2 The use of t"o "ires t"isted to5ether helps to reduce crosstalk and electroma5netic induction2 The transmission speed ran5es from < million bits per second to #++ million bits per second2 Coaxial Cable 9 These cables are "idely used for cable television systems0 office buildin5s0 and other "orksites for local area net"orks2 The cables consist of copper or aluminum "ire "rapped "ith insulatin5 layer typically of a fle8ible material "ith a hi5h dielectric constant0 all of "hich are surrounded by a conductive layer2 The layers of insulation help minimi=e interference and distortion2 Transmission speed ran5e from <++ million to more than >++ million bits per second2 Fiber Optics ? These cables consist of one or more thin filaments of 5lass fiber "rapped in a protective layer2 It transmits li5ht "hich can travel over lon5 distance and hi5her band"idths2 .iber3optic cables are not affected by electroma5netic radiation2 Transmission speed could 5o up to as hi5h as trillions of bits per second2 The speed of fiber optics is hundreds of times faster than coa8ial cables and thousands of times faster than t"isted3pair "ire2 W.re5ess e%&4o5o7.es0 Terrestrial Microwave ? Terrestrial micro"aves use arth3based transmitter and receiver2 The e:uipment looks similar to satellite dishes2 Terrestrial micro"aves use lo"35i5ahert= ran5e0 "hich limits all communications to line3of3si5ht2 Path bet"een *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 <34(

Computer Networks Lab

Dept. Of C.S.E

relay stations spaced appro82 @+ miles apart2 %icro"ave antennas are usually placed on top of buildin5s0 to"ers0 hills0 and mountain peaks2 Communications Satellites ? The satellites use micro"ave radio as their telecommunications medium "hich are not deflected by the arthAs atmosphere2 The satellites are stationed in space0 typically <<0+++ miles above the e:uator2 These arth3 orbitin5 systems are capable of receivin5 and relayin5 voice0 data0 and T, si5nals2 Wireless LANs ? /ireless local area net"ork use a hi5h3fre:uency radio technolo5y similar to di5ital cellular and a lo"3fre:uency radio technolo5y2 /ireless LANS use spread spectrum technolo5y to enable communication bet"een multiple devices in a limited area2 8ample of open3standard "ireless radio3"ave technolo5y is I B+<2##b2 luetoot! ? A short ran5e "ireless technolo5y2 Operate at appro82 #%bps "ith ran5e from #+ to #++ meters2 )luetooth is an open "ireless protocol for data e8chan5e over short distances2 T!e Wireless Web ? The "ireless "eb refers to the use of the /orld /ide /eb throu5h e:uipments like cellular phones0 pa5ers0 P!As0 and other portable communications devices2 The "ireless "eb service offers anytime;any"here connection2

S%a5e
Net"orks are often classified as Local Area Net"ork 6LAN90 /ide Area Net"ork 6/AN90 %etropolitan Area Net"ork 6%AN90 Personal Area Net"ork 6PAN90 ,irtual Private Net"ork 6,PN90 Campus Area Net"ork 6CAN90 Stora5e Area Net"ork 6SAN90 etc2 dependin5 on their scale0 scope and purpose2

Network topo5o71
Computer net"orks may be classified accordin5 to the net"ork topolo5y upon "hich the net"ork is based0 such as bus net"ork0 star net"ork0 rin5 net"ork0 mesh net"ork0 hybrid net"ork0 tree or hierarchical topolo5y net"ork2 Net"ork topolo5y si5nifies the "ay in "hich devices in the net"ork see their lo5ical relations to one another2 The use of the term 7lo5ical7 here is si5nificant2 That is0 net"ork topolo5y is independent of the 7physical7 layout of the net"ork2

1pes of 4etworks
)elo" is a list of the most common types of computer net"orks in order of scale2 $erso4a5 area 4etwork A personal area net"ork 6PAN9 is a computer net"ork used for communication amon5 computer devices close to one person2 Some e8amples of devices that are used in a PAN are personal computers0 printers0 fa8 machines0 telephones0 P!As0 scanners0 and even video 5ame consoles2 Lo%a5 area 4etwork

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 @34(

Computer Networks Lab

Dept. Of C.S.E

A local Area Net"ork 6LAN9 is a computer net"ork coverin5 a small physical area0 like a home0 office0 or small 5roup of buildin5s0 such as a school0 or an airport2 Current "ired LANs are most likely to be based on thernet technolo5y2

Campus area 4etwork A campus area net"ork 6CAN9 is a computer net"ork made up of an interconnection of local area net"orks 6LANs9 "ithin a limited 5eo5raphical area2 It can be considered one form of a metropolitan area net"ork0 specific to an academic settin52 +etropo5.ta4 area 4etwork A metropolitan area net"ork 6%AN9 is a net"ork that connects t"o or more local area net"orks or campus area net"orks to5ether but does not e8tend beyond the boundaries of the immediate to"n;city2 *outers0 s"itches and hubs are connected to create a metropolitan area net"ork2 W.6e area 4etwork A "ide area net"ork 6/AN9 is a computer net"ork that covers a broad area 6i2e2 any net"ork "hose communications links cross metropolitan0 re5ional0 or national boundaries92 Less formally0 a /AN is a net"ork that uses routers and public communications links2 The lar5est and most "ell3kno"n e8ample of a /AN is the Internet2 A /AN is a data communications net"ork that covers a relatively broad 5eo5raphic area 6i2e2 one city to another and one country to another country9 and that often uses transmission facilities provided by common carriers0 such as telephone companies2 /AN technolo5ies 5enerally function at the lo"er three layers of the OSI reference modelC the physical layer0 the data link layer0 and the net"ork layer2 !5oba5 area 4etwork A 5lobal area net"orks 6-AN9 specification is in development by several 5roups0 and there is no common definition2 In 5eneral0 ho"ever0 a -AN is a model for supportin5 mobile communications across an arbitrary number of "ireless LANs0 satellite covera5e areas0 etc2 #.rtua5 pr./ate 4etwork A virtual private net"ork 6,PN9 is a computer net"ork in "hich some of the links bet"een nodes are carried by open connections or virtual circuits in some lar5er net"ork 6e2520 the Internet9 instead of by physical "ires2 The data link layer protocols of the virtual net"ork are said to be tunneled throu5h the lar5er net"ork "hen this is the case2 One common application is secure communications throu5h the public Internet0 but a ,PN need not have e8plicit security features0 such as authentication or content encryption2 ,PNs0 for e8ample0 can be used to separate the traffic of different user communities over an underlyin5 net"ork "ith stron5 security features2 "4ter4etwork An Internet"ork is the connection of t"o or more distinct computer net"orks or net"ork se5ments via a common routin5 technolo5y2 The result is called an internet"ork 6often *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 (34(

Computer Networks Lab

Dept. Of C.S.E

shortened to internet92 T"o or more net"orks or net"ork se5ments connect usin5 devices that operate at layer @ 6the Anet"orkA layer9 of the OSI )asic *eference %odel0 such as a router2 Any interconnection amon5 or bet"een public0 private0 commercial0 industrial0 or 5overnmental net"orks may also be defined as an internet"ork2 In modern practice0 interconnected net"orks use the Internet Protocol2 There are at least three variants of internet"orks0 dependin5 on "ho administers and "ho participates in themC

Intranet 8tranet Internet

"4tra4et An intranet is a set of net"orks0 usin5 the Internet Protocol and IP3based tools such as "eb bro"sers and file transfer applications that are under the control of a sin5le administrative entity2 That administrative entity closes the intranet to all but specific0 authori=ed users2 %ost commonly0 an intranet is the internal net"ork of an or5ani=ation2 A lar5e intranet "ill typically have at least one "eb server to provide users "ith or5ani=ational information2

E=tra4et An e8tranet is a net"ork or internet"ork that is limited in scope to a sin5le or5ani=ation or entity and also has limited connections to the net"orks of one or more other usually0 but not necessarily0 trusted or5ani=ations or entities 6e2520 a companyAs customers may be 5iven access to some part of its intranet creatin5 in this "ay an e8tranet0 "hile at the same time the customers may not be considered AtrustedA from a security standpoint92 Technically0 an e8tranet may also be cate5ori=ed as a CAN0 %AN0 /AN0 or other type of net"ork0 althou5h0 by definition0 an e8tranet cannot consist of a sin5le LAND it must have at least one connection "ith an e8ternal net"ork2 "4ter4et The Internet consists of a "orld"ide interconnection of 5overnmental0 academic0 public0 and private net"orks based upon the net"orkin5 technolo5ies of the Internet Protocol Suite2 It is the successor of the Advanced *esearch ProEects A5ency Net"ork 6A*PAN T9 developed by !A*PA of the U2S2 !epartment of !efense2 The Internet is also the communications backbone underlyin5 the /orld /ide /eb 6///92 The AInternetA is most commonly spelled "ith a capital AIA as a proper noun0 for historical reasons and to distin5uish it from other 5eneric internet"orks2

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 >34(

Computer Networks Lab

Dept. Of C.S.E

). LAB EAERC"SES
$AR A0 $ro7ram 10 Implement the data link layer framin5 methods such as character stuffin5 and bit stuffin52 A"+0 To "rite pro5ram that implements character stuffin5 F bit stuffin52 Des%r.pt.o40 !ata Link Layer 6!LL9 is concerned "ith the transmission of 7frames7 bet"een t"o directly connected I%PAs2 I%P G interface messa5e processor 6node or station9

In order for the !LL to 5roup bits into frames it uses the techni:ues of Character Countin5 startin5 and endin5 characters0 "ith Character Stuffin5 startin5 and endin5 fla5s0 "ith )it Stuffin5 Physical layer codin5 violations C&ara%ter Cou4t.47 uses a field in the header to indicate the number of characters in a frame2 Problem" Transmission error chan5es the char count2 A checksum error "ill not indicate "here the ne8t frame be5ins and so Character countin5 is not usually used2 *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 $34(

Computer Networks Lab

Dept. Of C.S.E

Startin5 and endin5 characters "ith C&ara%ter Stuff.47 is a framin5 method that 5ets around the resynchroni=ation problem2 ach frame starts "ith the ASCII !L STH and ends "ith !L TH 6!L G!ata Link scape0 STHG Start of te8t0 THG nd Of STH or TH Te8t92 The problem "ith this is that binary data may contain a !L %&ara%ter stuff.472 Problem" The problem "ith character stuffin5 is that it is B3bit ASCII code tied2 B.t Stuff.47 allo"s n3bit per character2 ach frame be5ins "ith startin5 delimiter

se:uence in it2 A solution is to send each !L in the binary data t"ice2 This is called

+######+ and ends "ith endin5 delimiter +######+2 If the data contains > consecutive #As the sender stuffs in a + bit2 The receiver removes the + follo"in5 > consecutive #As2 $&1s.%a5 5a1er %o6.47 /.o5at.o4s "orks "hen the physical layer uses redundancy in the codin5 6i2e2 %anchester encodes a # as a hi5h3lo" pair and a + as a lo"3hi5h pair92 Since hi5h3hi5h and lo"3lo" are not used for data they can be used for framin5 and so no stuffin5 is needed2 This is a part of the B+< standard 6 thernet92 %any data link protocols use some combination of physical layer codin50 countin50 character stuffin5 and bit stuffin52 $ro%e6ure0 Character stuffin5 is used to achieve data transparency2 !ata transparency is the mechanism of sendin5 any arbitrary bit patterns "ithout any restrictions2 /henever STH is found in the input strin50 stuff a !L output strin5 results in !L STH2 If a !L appears in the data0 stuff one more !L 2 /henever TH is found in the input strin50 stuff a !L TH2 before TH so that the before STH so that the

output strin5 results in !L NOT#"

!L is the control character used for chn5in5 the predefined meanin5 of a

character2 Since it is not possible to chan5e the meanin5 of a character t"ice0 there is no chance of the input data consistin5 !L !L 2 *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 434(

Computer Networks Lab

Dept. Of C.S.E

Co6e0 2B $RO!RA+ COR CHARAC ER S UCC"N! B2 D.4%5u6eEst6.o.&F D.4%5u6eE%o4.o.&F D.4%5u6eEstr.47.&F D.4%5u6eEpro%ess.&F /o.6 ma.4GH I .4t .J(8-J(848posK %&ar aL*(M8bL>(M8%&K %5rs%rGHK pr.4tfGNe4ter str.47O4NHK s%a4fGNPsN8QaHK 4Jstr5e4GaHK pr.4tfGNe4ter pos.t.o4O4NHK s%a4fGNP6N8QposHK .fGposF4H I pr.4tfGN.4/a5.6 pos.t.o48 E4ter a7a.4 0NHK s%a4fGNP6N8QposHK R pr.4tfGNe4ter t&e %&ara%terO4NHK %&J7et%&eGHK bL(MJS6SK bL1MJS5SK bL*MJSeSK bL)MJSsSK bL<MJStSK bL>MJS=SK -J:K w&.5eG.E4H I .fG.JJpos'1H I bL-MJS6SK bL-T1MJS5SK bL-T*MJSeSK bL-T)MJ%&K *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 B34(

Computer Networks Lab bL-T<MJS6SK bL-T>MJS5SK bL-T:MJSeSK -J-T?K R .fGaL.MJJS6S QQ aL.T1MJJS5S QQ aL.T*MJJSeSH I bL-MJS6SK bL-T1MJS5SK bL-T*MJSeSK -J-T)K R bL-MJaL.MK .TTK -TTK R bL-MJS6SK bL-T1MJS5SK bL-T*MJSeSK bL-T)MJSeSK bL-T<MJStSK bL-T>MJS=SK bL-T:MJSO(SK pr.4tfGNO4frame after stuff.470O4NHK pr.4tfGNPsN8bHK 7et%&GHK R "N$U 0 nter strin5C computer net"orks nter positionC > nter the characterC k OU $U 0 .rame after stuffin5C !lest8compdlekdleuternet"orksdleet8

Dept. Of C.S.E

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 I34(

Computer Networks Lab

Dept. Of C.S.E

JJJJJJJJJJJJJJJ 2B "+$E+EN S UCC"N!.B2 HE DA AL"N, LAYER CRA+"N! +E HODS SUCH AS B"

Des%r.pt.o40 The bit se:uence 7+######+7 containin5 si8 adEacent # bits is commonly used as a 7.la5 byte7 or .SS2 !ata Link Layer 6!LL9 is concerned "ith the transmission of 7frames7 bet"een t"o directly connected I%PAs2 I%P G interface messa5e processor 6node or station9

In order for the !LL to 5roup bits into frames it uses the techni:ues of Character Countin5 startin5 and endin5 characters0 "ith Character Stuffin5 startin5 and endin5 fla5s0 "ith )it Stuffin5 Physical layer codin5 violations C&ara%ter Cou4t.47 uses a field in the header to indicate the number of characters in a frame2 Problem" Transmission error chan5es the char count2 A checksum error "ill not indicate "here the ne8t frame be5ins and so Character countin5 is not usually used2 *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 #+34(

Computer Networks Lab

Dept. Of C.S.E

Startin5 and endin5 characters "ith C&ara%ter Stuff.47 is a framin5 method that 5ets around the resynchroni=ation problem2 ach frame starts "ith the ASCII !L STH and ends "ith !L TH 6!L G!ata Link scape0 STHG Start of te8t0 THG nd Of STH or TH Te8t92 The problem "ith this is that binary data may contain a !L %&ara%ter stuff.472 Problem" The problem "ith character stuffin5 is that it is B3bit ASCII code tied2 B.t Stuff.47 allo"s n3bit per character2 ach frame be5ins "ith startin5 delimiter

se:uence in it2 A solution is to send each !L in the binary data t"ice2 This is called

+######+ and ends "ith endin5 delimiter +######+2 If the data contains > consecutive #As the sender stuffs in a + bit2 The receiver removes the + follo"in5 > consecutive #As2 $&1s.%a5 5a1er %o6.47 /.o5at.o4s "orks "hen the physical layer uses redundancy in the codin5 6i2e2 %anchester encodes a # as a hi5h3lo" pair and a + as a lo"3hi5h pair92 Since hi5h3hi5h and lo"3lo" are not used for data they can be used for framin5 and so no stuffin5 is needed2 This is a part of the B+< standard 6 thernet92 %any data link protocols use some combination of physical layer codin50 countin50 character stuffin5 and bit stuffin52 $ro%e6ure0 )it stuffin5 is used to achieve data transparency2 !ata transparency is the mechanism of sendin5 any arbitrary bit patterns "ithout any restrictions2 The input data frame should start "ith startin5 delimiter +######+ and end "ith endin5 delimiter +######+2 A + bit is stuffed after every > consecutive #Ks in the input data2 Co6e0 LincludeMstdio2hN LincludeMconio2hN LincludeMstrin52hN void main69 O char c#P<++QG770c<P<++QG770cP#++Q0d#P>+QG7+######+70d<P>+QG7+######+7D int m#G+0i0EG+0lG+0i#0m0n0kG+D *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 ##34(

Computer Networks Lab

Dept. Of C.S.E

clrscr69D printf67enter the binary value79D 5ets6c9D mGstrlen6d#9D strcat6d#0c9D strcat6d#0d<9D printf67Rn appendin5 delimitersC79D puts6d#9D for6iG+DiMstrlen6d#9DiSS9 O c#PlQGd#PiQD if6lNG(9 O if6c#PlQGGA#A FF c#Pl3#QGGA#A FF c#Pl3<QGGA#A FF c#Pl3@Q GGA#A FF c#Pl3(QGGA#A9 O strcat6c#07+79D lSSD T T lSSD T printf67Rn after stuffim579D puts6c#9D printf67Rndestuffin579D for6iG+DiMstrlen6c#9DiSS9 O printf67Uc70c#PiQ9D c<PkQGc#PiQD kSSD if6c#PiQGGA#A9 ESSD else EG+D if6EGG>9 O "hile6c#PES#QVG+9 breakD iSSD EG+D T T for6iG+DiMmDiSS9 continueD printf67Rn79D for6iGmDiMstrlen6c<9DiSS9 O *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 #<34(

Computer Networks Lab printf67Uc70c<PiQ9D m#SSD if6m#GGstrlen6c99 breakD T 5etch69D T

Dept. Of C.S.E

"N$U C enter the binary value############# OU $U 0 appendin5 delimitersC+######+#############+######+ after stuffim5+#####+#+#####+#####+###+#####+#+ destuffin5+######+#############+######+ ############# 2B"+$LE+EN A "ON OC B" S UCC"N! AND CHARAC ER S UCC"N!B2 LincludeMstdio2hN LincludeMconio2hN LincludeMmath2hN main69 O int chD clrscr69D do O printf67RnJJJJJJJJJJJJJJJJJJJJC79D printf67Rn#2)IT STU..IN-C79D printf67Rn<2C&A*ACT * STU..IN-C79D printf67Rn@2 HITC79D printf67RnJJJJJJJJJJJJJJJJJJJJJ79D printf67Rn nter your choiceC79D scanf67Ud70Fch9D s"itch6ch9 O case #Cbit69D breakD case <Ccharacter69D breakD case @Ce8it6+9D T *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 #@34(

Computer Networks Lab T"hile6chVG@9D 5etch69D T bit69 O .IL Jfp0Jfp#D char chD int iD if66fpGfopen67source2t8t707"799GGNULL9 O printf67Rn rror in openin5 the file79D e8it6+9D T printf67Rn nter data to send press AeA to end CRn79D iG+D "hile6#9 O scanf67Uc70Fch9D if6chGGAeA9 breakD if6chGGA#A9 iSSD else iG+D putc6ch0fp9D if6iGG>9 O putc6A+A0fp9D iG+D T T fclose6fp9D iG+D fpGfopen67source2t8t707r79D fp#Gfopen67dest2t8t707"79D printf67Rn!ATA A.T * STU..IN-Rn79D "hile66chG5etc6fp99VG O.9 O putc6ch0stdout9D T fseek6fp0+L0+9D printf67Rn!ATA A.T * UNSTU..IN-Rn79D "hile66chG5etc6fp99VG O.9 O if6chGGA#A9 iSSD *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 #(34(

Dept. Of C.S.E

Computer Networks Lab else iG+D if6iGG>9 O putc6ch0stdout9D putc6ch0fp#9D chG5etc6fp9D iG+D T else O putc6ch0stdout9D putc6ch0fp#9D T T fclose6fp9D fclose6fp#9D T character69 O .IL Jfp0Jfp#D char ch0cP<Q0kP(Q0EPIQD lon5 be50endD if66fpGfopen67Input2t8t707"799GGNULL9 O printf67Rn Input2t8t file openin5 problem22279D e8it6+9D T printf67Rn nter data to send at end put ATAC RnRn79D "hile6#9 O scanf67Uc70Fch9D if6chGGATA9 breakD putc6ch0fp9D T fclose6fp9D if66fpGfopen67Input2t8t707r799GGNULL9 O printf67RnInput2t8t file openin5 problem22279D e8it6+9D T if66fp#Gfopen67csource2t8t707"799GGNULL9 O printf67Rncsource2t8t file openin5 problem22279D e8it6+9D *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 #>34(

Dept. Of C.S.E

Computer Networks Lab T fputs67 !L STH 70fp#9D "hile66chG5etc6fp99VG O.9 O if6chGGA!A9 O cP+QG5etc6fp9D cP#QG5etc6fp9D if6cP+QGGALAFFcP#QGGA A9 fputs67!L 70fp#9D putc6ch0fp#9D putc6cP+Q0fp#9D putc6cP#Q0fp#9D T else putc6ch0fp#9D T fputs67 !L TH 70fp#9D fclose6fp9D fclose6fp#9D if66fpGfopen67csource2t8t707r799GGNULL9 O printf67Rncsource2t8t file openin5 problem22279D e8it6+9D T if66fp#Gfopen67cdest2t8t707"799GGNULL9 O printf67Rncdest2t8t file openin5 problem22279D e8it6+9D T be5Gftell6fp9D be5SGID fseek6fp03+L0<9D endGftell6fp9D end3GID fclose6fp9D printf67Rn!ata after stuffin5 79D fpGfopen67csource2t8t707r79D "hile66chG5etc6fp99VG O.9 putc6ch0stdout9D fclose6fp9D printf67Rn79D printf67RnThe data after destuffin579D fpGfopen67csource2t8t707r79D f5ets6E0I0fp9D "hile6be5MGend9 *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 #$34(

Dept. Of C.S.E

Computer Networks Lab O chG5etc6fp9D if6chGGA!A9 O cP+QG5etc6fp9D cP#QG5etc6fp9D if6cP+QGGALAFFcP#QGGA A9 O f5ets6k0(0fp9D be5SG(D T else O putc6ch0fp#9D putc6cP+Q0fp#9D putc6cP#Q0fp#9D putc6ch0stdout9D putc6cP+Q0stdout9D putc6cP#Q0stdout9D T T else O putc6ch0fp#9D putc6ch0stdout9D T be5SSD T fclose6fp9D fclose6fp#9D T

Dept. Of C.S.E

OU $U JJJJJJJJJJJJJJJJJJJJC #2)IT STU..IN-C <2C&A*ACT * STU..IN-C @2 HITC JJJJJJJJJJJJJJJJJJJJJ

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 #434(

Computer Networks Lab nter your choiceC# nter data to send press AeA to end C ###+++++##########+#e !ATA A.T * STU..IN###+++++#####+#####++# !ATA A.T * UNSTU..IN###+++++##########+# JJJJJJJJJJJJJJJJJJJJC #2)IT STU..IN-C <2C&A*ACT * STU..IN-C @2 HITC JJJJJJJJJJJJJJJJJJJJJ nter your choiceC< nter data to send at end put ATAC This is !L idle !L pro5ramT !ata after stuffin5 !L STH This is !L !L idle !L !L pro5ram !L The data after destuffin5 This is idle pro5ram JJJJJJJJJJJJJJJJJJJJC #2)IT STU..IN-C <2C&A*ACT * STU..IN-C @2 HITC JJJJJJJJJJJJJJJJJJJJJ *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 #B34( TH

Dept. Of C.S.E

Computer Networks Lab

Dept. Of C.S.E

nter your choiceC@

$ro7ram *0 Implement on a data set of characters the three C*C polynomials3 C*C #<0 C*C #$ and C*C CCIP2 A.m0 To "rite a pro5ram to implement C*C Polynomials2 Des%r.pt.o40 A cyclic redundancy check 6C*C9 is a type of hash function2 A C*C is computed and appended before transmission or stora5e0 and verified after"ards by recipient to confirm that no chan5es occurred on transit2 2 C*Cs are popular because they are simple to implement in binary hard"are0 are easy to analy=e mathematically0 and are particularly 5ood at detectin5 common errors caused by noise in transmission channels2 C*Cs are based on division in a commutative rin50 namely the rin5 of polynomials over the inte5ers modulo <2 Any strin5 of bits can be interpreted as the coefficients of a polynomial0 and to find the C*C0 "e divide by another fi8ed polynomial2 The coefficients of the remainder polynomial are the C*C8 and there are simple0 efficient al5orithms for computin5 this remainder2 The specific C*C is defined by the polynomial used2 To produce an n3bit C*C re:uires a de5ree3n polynomial0 of the form xn S W S #2 This is naturally e8pressed as an nS#3bit strin50 but the leadin5 6xn9 term is normally implicit0 leavin5 an n3bit strin5 Thus0 dependin5 on the bit3order convention used0 the standard C*C3#$0 x#$Sx#>Sx<S#0 "ill be represented as the he8adecimal number +8B++> or as +8a++#2One of the most commonly encountered is kno"n as C*C3@<2 Its polynomial can be "ritten +8+(C##!)4 or +8 !)BB@<+2 There are many more C*C types CRC'1* CRC'CC" CRC'1: x1* T x11 T x) T x T 1 Luse6 .4 te5e%om s1stemsM x1: T x1* T x> T 1 x1> Tx1< T x1( T x@ T x1 T 1

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 #I34(

Computer Networks Lab

Dept. Of C.S.E

/hile useful for error detection0 C*Cs cannot be safely relied upon to verify data inte5rity 6that no chan5es "hatsoever have occurred90 since0 because of the linear structure of C*C polynomials0 it is e8tremely easy to intentionally chan5e data "ithout modifyin5 its C*C2 $ro%e6ure0 Let r be the de5ree of G(x)2 Append r =ero bits to the lo"3order end of the frame so it no" contains m + r bits and corresponds to the polynomial xr M(x)2 !ivide the bit strin5 correspondin5 to G(x) into the bit strin5 correspondin5 to xr M(x)0 usin5 modulo3< division2 Subtract the remainder from the bit strin5 correspondin5 to xr M(x) usin5 modulo3< subtraction2The result is the checksummed frame to be transmitted2 Call its polynomial T(x). The main portion of the al5orithm can be e8pressed in pseudocode as follo"sC fu4%t.o4 crc6bit array bitStrin5P#22lenQ0 int polynomial9 O shift*e5ister CG initial value // commonly all 0 bits or all 1 bits for i from # to len O .f most si5nificant bit of shift*e5ister 8or bitStrin5PiQ G # O shift*e5ister CG 6shift*e5ister left shift #9 8or polynomial least si5nificant bit of shift*e5ister G # T e5se shift*e5ister CG 6shift*e5ister left shift #9 T retur4 shift*e5ister T NOT#" /hile useful for error detection0 C*Cs cannot be safely relied upon to verify

data inte5rity 6that no chan5es "hatsoever have occurred90 since0 because of the linear structure of C*C polynomials0 it is e8tremely easy to intentionally chan5e data "ithout modifyin5 its C*C2 *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 <+34(

Computer Networks Lab

Dept. Of C.S.E

8ample .rame C ##+#+##+## -eneratorC #++## %essa5e after ( =ero bits are appendedC ##++++#+#+ #++## ##+#+ ##+##++++ #++## #++# # #++# # +++ +# +++ ++ +++#+ +++++ + + # +# + + + ++ + # + ## + + + ++ # + # #+ # + + ## + # +# + + + ++ + # +# + + # ++ # # +# # # + ++ + + + ###+

##+#+##+##++++

*emainder C*C

Transmitted frameC # # + # + # # + # # # # # +

Co6e0 *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 <#34(

Computer Networks Lab

Dept. Of C.S.E

2B "+$LE+EN ON A DA A SE OC CHAREC ERS HE CRC $OLYNO+"ALS' CRC1*8 CRC1: AND CC"$. B2 LincludeMstdio2hN LincludeMconio2hN LincludeMstrin52hN void main69 O char frmP>+QG7705en#P>+QG7705en<P>+QG770actfrmP>+QG77D char crc#<P@+QG7##+++++++####70crc#$P@+QG7##++++++++++++#+#70crcipP@+QG7#+++#+++++ +#++++#7D int cG+D int i0E0k0p0frm#len0frm<len05en#len05en<len0chD clrscr69D do O printf67- N *ATO* C&OIC SRn79D printf67#2C*C3#< <2C*C3#$ @2C*C3CCIPRn79D printf67enter your choiceC79D scanf67Ud70Fch9D s"itch6ch9 O case #Cstrcpy65en#0crc#<9D printf67Rn 5enerator is crc3#<CUs70crc#<9D breakD case <C strcpy65en#0crc#$9D printf67Rn 5enerator is crc3#$CUs70crc#$9D breakD case @C strcpy65en#0crcip9D printf67Rn 5enerator is crc3crcipCUs70crcip9D breakD T printf67Rnenter messa5e79D scanf67Us70Ffrm9D frm#lenGstrlen6frm9D printf67frm#lenC Ud70 frm#len9D 5en#lenGstrlen65en#9D printf675en#lenC Ud70 5en#len9D for6iG+DiM5en#lenDiSS9 5en<PiQGA+AD 5en<lenGstrlen65en<9D printf67Ud705en<len9D for6iG+DiM5en#len3#DiSS9 O *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 <<34(

Computer Networks Lab frmPfrm#lenSiQGA+AD T frm<lenGstrlen6frm9D puts6frm9D for6iG+DiMfrm#lenDiSS9 O if6frmPiQGGA#A9 O for6pG+DpMiDpSS9 O printf67 79D T printf67Us705en#9D for6pGiDpMfrm#len3#DpSS9 printf67X79D printf67Rn79D for6pG+DpMGfrm<lenDpSS9 printf67379D printf67Rn79D for6kGi0EG+DkMfrm<len FF EM5en#lenDkSS0ESS9 O if6frmPkQGG5en#PEQ9 frmPkQGA+AD else frmPkQGA#AD T for6pG+DpMGiDpSS9 O printf67 79D T for6pGiS#DpMG65en#lenS#9DpSS9 O printf67Uc70frmPpQ9D T for6pGiDpMfrm#len3<DpSS9 printf67X79D printf67Rn79D T else O for6pG+DpMiDpSS9 O printf67 79D T printf67Us705en<9D *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 <@34(

Dept. Of C.S.E

Computer Networks Lab for6pGiDpMfrm#len3#DpSS9 printf67X79D printf67Rn79D for6pG+DpMGfrm<lenDpSS9 printf67379D printf67Rn79D for6kGi0EG+DkMfrm<len FF EM5en<lenDkSS0ESS9 O if6frmPkQGG5en<PiQ9 frmPkQGA+AD else frmPkQGA#AD T for6pG+DpMGiDpSS9 O printf67 79D T for6pGiS#DpMG65en<lenSi9DpSS9 O printf67Uc70frmPpQ9D T for6pGiDpMfrm#len3<DpSS9 printf67X79D printf67Rn79D T T iG+D for6pGfrm#lenDpMfrm<lenDpSS9 O actfrmPiQGfrmPpQD iSSD T printf67RnC*C CO! ISC79D puts6actfrm9D printf67press # to continue or < to e8it79D scanf67Ud70Fc9D T "hile6cGG#9D 5etch69D T

Dept. Of C.S.E

"N$U 0 - N *ATO* C&OIC SC #2crc3#< <2crc3#$ @2crc3ccip enter your choice# *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 <(34(

Computer Networks Lab 5enerator is crc3#<C##+++++++#### enter messa5e#+++#+ OU $U 0 frm#lenC$ 5en#lenC#@#@#+++#+++++++++++++ ##+++++++####XXXXX 3333333333333333333 #++#++++####++XXXX ##+++++++####XXXX 3333333333333333333 #+#++++#+++#+XXX ##+++++++####XXX 3333333333333333333 ##++++#+##+#XX ##+++++++####XX 3333333333333333333 +++++#+#+#+X +++++++++++++X YYYYYYYYYYYYYYYYYYY ++++#+#+#+#++ +++++++++++++X YYYYYYYYYYYYYYYYYYY +++#+#+#+#++ C*C CO! IS+++#+#+#+#++ press # to continue or < to e8itC# - N *ATO* C&OIC SC #2crc3#< <2crc3#$ @2crc3ccip enter your choice< 5enerator is crc3#$C##++++++++++++#+# enter messa5e#+++#+ 5en#lenC#4#4#+++#+++++++++++++++++ ##++++++++++++#+#XXXXX 33333333333333333333333 #++#+++++++++#+#++XXXX ##++++++++++++#+#XXXX 33333333333333333333333 #+#+++++++++####+XXX ##++++++++++++#+#XXX 33333333333333333333333 ##+++++++++##+##XX ##++++++++++++#+#XX 33333333333333333333333 ++++++++++##++#X +++++++++++++++++X *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 <>34(

Dept. Of C.S.E

Computer Networks Lab YYYYYYYYYYYYYYYYYYYYYYY +++++++++##++##++ +++++++++++++++++X YYYYYYYYYYYYYYYYYYYYYYY ++++++++##++##++ C*C CO! IS++++++++##++##++ press # to continue or < to e8itC# - N *ATO* C&OIC SC #2crc3#< <2crc3#$ @2crc3ccip enter your choice@ 5enerator is crc3crcipC#+++#++++++#++++# enter messa5e#+++#+ frm#lenC$ 5en#lenC#4#4#+++#+++++++++++++++++ #+++#++++++#++++#XXXXX 33333333333333333333333 ++++++++++#++++#++XXXX +++++++++++++++++X YYYYYYYYYYYYYYYYYYYYYYY +++++++++#++++#++XXX +++++++++++++++++X YYYYYYYYYYYYYYYYYYYYYYY ++++++++#++++#+++XX +++++++++++++++++X YYYYYYYYYYYYYYYYYYYYYYY +++++++#++++#++++X +++++++++++++++++X YYYYYYYYYYYYYYYYYYYYYYY ++++++#++++#+++++ +++++++++++++++++X YYYYYYYYYYYYYYYYYYYYYYY +++++#++++#+++++ C*C CO! IS+++++#++++#+++++ press # to continue or < to e8itC<

Dept. Of C.S.E

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 <$34(

Computer Networks Lab

Dept. Of C.S.E

$ro7ram )0 Implement !iEkstraKs al5orithm to compute the shortest path throu5h a 5raph A.m0 To "rite a pro5ram to implement !iEkstraKs al5orithm to find shortest path throu5h a 5raph Des%r.pt.o40 This is one of the static routin5 al5orithms0 also kno"n as non3adaptive routin5 al5orithm in "hich the routin5 decision do not depend on measurements or estimates of the current traffic and topolo5y2 Instead0 the route is computed in advance0 off3time and do"nloaded to the routers "hen the net"ork is booted2 A 5raph of the subnet is built "ith each node of the 5raph representin5 a router and each arc of the 5raph representin5 a link2 To choose a route bet"een a 5iven pair of routers0 the al5orithm Eust finds the shortest path bet"een them on the 5raph2 One of the best kno"n al5orithms for computin5 the shortest path bet"een t"o nodes of a 5raph is !iEkstraKs al5orithm in "hich each node is labeled "ith its distance from the source node alon5 the best kno"n path2 Initially0 no paths are kno"n2 So all the nodes are labeled "ith infinity2 As the al5orithm proceeds and paths are found0 the label may chan5e reflectin5 better paths2 A label may be either tentative or permanent2 Initially all labels are tentative2 /hen it is discovered that a label represents the shortest possible path from the source to that node0 it is made permanent and is never chan5ed thereafter2 $ro%e6ure0

ach machine is kno"n as a node2 ach node has a #2 Cost value <2 A pointer to the node that is before it in the path bein5 taken2 @2 A state Ppermanent or tentativeQ2 Initially each node if 5iven a state of tentative0 a pointer to null and0 a cost value of infinity2 The source node is marked as permanent and itKs cost value as + and pointer still to null2 The source node then calculates the cost values to the nodes that it can reach and assi5ns the cost

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 <434(

Computer Networks Lab

Dept. Of C.S.E

values of these nodes to the values calculated0 the pointer of these nodes no" points to the source node2

After this is done the tentative node "ith the lo"est no3infinity cost value 6re5ardless of "hat itAs pointer points to9 is marked permanent and the "hole process is performed a5ain "ith this ne"ly marked3permanent node2 /hen the 5oal is reached0 the total cost of the path is the cost value in the cost value field in the node2 To find the route taken to achieve this shortest path simply "ork back from the pointers in the nodes startin5 "ith the 5oal node2

E=amp5e0

Co6e0 2B $RO!RA+ COR D"J",S RASS AL!OR" H+ B2 L includeMconio2hN L includeMstdio2hN void sort69D static int dspP#+QP#+Q0nodesD *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 <B34(

Computer Networks Lab struct O char srcD char destD int len5thD Tstemp0permanentP#+QGOA A0A A0+T0tempP#+QGOA A0A A03#TD static int perm0temD void main69 O int i0E0k0l0m0nG+0pointD char initial0dest0pathP#+QGOA ATD clrscr69D printf67RtRt shortest path diEkstraAs al5othrim79D printf67Rn JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ79D printf67Rnenter the number of nodesC79D scanf67Ud70Fnodes9D printf67Rnenter the adEacency matri8Rn79D for6iG+DiMnodesDiSS9 O for6EG+DEMnodesDESS9 scanf67Ud70FdspPiQPEQ9D T fflush6stdin9D printf67Rn enter the source nodeC79D scanf67Uc70Finitial9D fflush6stdin9D printf67Rn enter the destination nodeC79D scanf67Uc70Fdest9D permanentPpermQ2srcGinitialD permanentPpermQ2destGinitialD permanentPpermSSQ2len5thG+D iGpermanentPperm3#Q2dest3I4D for6EG+DEMnodesDESS9 O if6iVGE9 O if6dspPiQPEQN+9 O tempPtemQ2srcGpermanentPperm3#Q2srcD tempPtemQ2destGESI4D tempPtemSSQ2len5thGdspPiQPEQD T T T sort69D *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 <I34(

Dept. Of C.S.E

Computer Networks Lab "hile6temNG+9 O EGpermanentPperm3#Q2dest3I4D for6iG+DiMnodesDiSS9 O if6iVGinitial3I49 O if6dspPEQPiQN+9 O lG3#D for6kG+DkMpermDkSS9 O if6permanentPkQ2destGG6iSI499 lGkD T for6kG+DkMGtemDkSS9 O if6tempPkQ2destGG6iSI499 lGkD T if6lM+9 O tempPtemQ2srcGESI4D tempPtemQ2destGiSI4D for6mG+DmMpermDmSS9 O if6permanentPmQ2destGGtempPtemQ2src9 nGpermanentPmQ2len5thD T tempPtemSSQ2len5thGdspPEQPiQSnD T else O for6mG+DmMpermDmSS9 O if6permanentPmQ2destGGESI49 O nGpermanentPmQ2len5thSdspPEQPiQD breakD T else nGdspPEQPiQD T if66nMtempPlQ2len5th99 O tempPlQ2len5thGnD *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 @+34(

Dept. Of C.S.E

Computer Networks Lab tempPlQ2srcGESI4D tempPlQ2destGiSI4D T T T T T sort69D T printf67Rn shorted path CRn79D printf67from Uc to Uc isC70initial0dest9D for6iG+DiMperm3#DiSS9 O if6permanentPiQ2destGGdest9 O pointGiD nGiD breakD T T iG+D for6EGpermDEN+DE339 O if6permanentPE3#Q2destGGpermanentPpointQ2src9 O pathPiSSQGpermanentPpointQ2destD pointGE3#D T T pathPiQGinitialD for6EGiDENG+DE339 printf67Uc 70pathPEQ9D printf67Rn len5thGUd70permanentPmQ2len5th9D 5etch69D T void sort69 O int i0E0kD for6iG+DiMGtemDiSS9 O kG#D for6EG+DEMGtemDESS9 O if66tempPEQ2len5thMGtempPES#Q2len5th99 O *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 @#34(

Dept. Of C.S.E

Computer Networks Lab stempGtempPEQD tempPEQGtempPES#QD tempPES#QGstempD kG+D T T if6k9 breakD T permanentPpermSSQGtempPtem3#QD tempPtem3#Q2srcGA AD tempPtem3#Q2destGA AD tempPtem3#Q2len5thG3#D tem33D T

Dept. Of C.S.E

"N$U 0 shortest path diEkstraAs al5othrim JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ enter the number of nodesC$ enter the adEacency matri8 + # 3# < 3# 3# # + # 3# 3# 3# 3# # + # # 3# < 3# # + < 3# 3# 3# # < + @ 3# 3# 3# 3# @ + enter the source nodeCa enter the destination nodeCf

OU $U 0 shorted path C from a to f isCa b c e f len5thG$

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 @<34(

Computer Networks Lab

Dept. Of C.S.E

$ro7ram <0 Take an e8ample subnet 5raph "ith "ei5hts indicatin5 delay bet"een nodes2 No" obtain routin5 table art each node usin5 distance vector routin5 al5orithm A.m0 To "rite a pro5ram to obtain routin5 table art usin5 distance vector routin5 al5orithm2 Des%r.pt.o40 In distance vector routin50 each router maintains a routin5 table inde8ed by0 and containin5 one entry for0 each router in the subnet2 This entry contains t"o partsC the preferred out5oin5 line to use for that destination and an estimate of the time or distance to that destination2 The metric used mi5ht be number of hops0 time delay in milliseconds0 and total number of packets :ueued alon5 the path or somethin5 similar2 The router is assumed to kno" the Zdistance[ to each of its nei5hbors2 If the metric is hops0 the distance is Eust one hop2 If the metric is :ueue len5th0 the router simply e8amines each :ueue2 If the metric is delay the router can measure it directly "ith special C&O packets that the receiver Eust timestamps and sends back as fast as it can2 Assume that delay is used as a metric and that the router kno"s the delay to each of its nei5hbors2 Once every T msec each router sends to each nei5hbor a list of its estimated delays to each destination2 It also receives a similar list from each nei5hbor2 Ima5ine that one of these tables has Eust come in from nei5hbor0 H0 "ith H i bein5 HKs estimate of ho" lon5 it takes to 5et to router i2 If the router kno"s that the delay to H is m msec0 it also kno"s that it can reach router I via H in H i S m msec2 )y performin5 this calculation for each nei5hbor0 a router can find out "hich estimate seems the best and use that estimate and the correspondin5 line in its ne" routin5 table2 $ro%e6ure0 Take the old routin5 table entries !etermine the ne" delays to the nei5hbors Compare the delays by addin5 to them to the old routin5 table entries The nei5hbors "ith the least delay is taken in the ne" routin5 table *epeat the steps for all the nodes in the subnet E=amp5e0 Consider a subnet as shown below. *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 @@34(

Computer Networks Lab

Dept. Of C.S.E

The first four columns of the table sho" the delay vectors received from the nei5hbors of router \2 A claims to have #<3msec delay to )0 <>3msec delay to C0 (+3 msec delay to !0 etc2 Suppose that \ has measured or estimated its delay to its nei5hbors0 A0 I0 &0 and 1 as B0 #+0 #<0 and $ msec0 respectively2 Consider ho" \ computes its ne" route -2 It kno"s that it can 5et to A in B msec0 and A claims to be able to 5et to - in #B msec0 so \ kno"s it can count on a delay of <$ msec to - if it for"ards packets bound for - to A2 similarly0 it computes the delay to - via I0 &0 and 1 as (#G 6@# S #+90 #B ? 6$ S #<90 and @4 G 6@# S $9 msec0 respectively2 The best of these values is #B0 so it makes an entry in its routin5 table that the delay to - is #B msec and that the route to use is via &2 The same calculation is performed for all the other destinations0 "ith the ne" routin5 table2 To A ) C ! . & I \ 1 L A + #< <> (+ #( <@ #B #4 <# I <( <I I <( @$ #B <4 4 <+ @# <+ + ## << @@ & <+ @# #I B @+ #I $ + #( 4 << I 1 <# <B @$ <( << (+ @# #I << #+ + I \1 !elay Is $ Ne" routin5 table !elay Line B <+ <B <+ #4 @+ #B <+ #+ + $ #> A A I & I I & & I 3 1 1

\A \I \& !elay !elay !elay Is B Is #+ Is #<

Co6e0 *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 @(34(

Computer Networks Lab 2B $RO!RA+ COR SUBNE B2 LincludeMstdio2hN int AP#<QGO+0#<0<>0(+0#(0<@0#B0#40<#0I0<(0<ITD int IP#<QGO<(0@$0#B0<4040<+0@#0<+0+0##0<<0@@TD int &P#<QGO<+0@#0#I0B0@+0#I0$0+0#(040<#0ITD int 1P#<QGO<#0<B0@$0<(0<<0(+0@#0#I0<<0#+0+0ITD char sP#<QGOAAA0A)A0ACA0A!A0A A0A.A0A-A0A&A0AIA0A\A0A1A0ALATD char s#P(QGOAAA0AIA0A&A0A1ATD int eEdP(QGOB0#+0#<0$T0i0E0k0l0temp0bP(Q0aP(Q0fD ;Je8pected E delaysJ; void main69 O clrscr69D printf67Rn The estimated hops for the nodes A0I0&01 areC79D for6iG+DiM#<DiSS9 printf67RnUdRtUdRtUdRtUd70APiQ0IPiQ0&PiQ01PiQ9D printf67RnThe delays from E are C79D for6iG+DiM(DiSS9 printf67Rt Ud70eEdPiQ9D printf67RnThe ne" routin5 table for E isC79D for6iG+DiM#<DiSS9 O if6iGGI9;J \ position J; printf67RnE33NERt+Rt379D else O kG+D EG+D bPESSQGAPiQSeEdPkQD bPESSQGIPiQSeEdPkS#QD bPESSQG&PiQSeEdPkS<QD bPEQG1PiQSeEdPkS@QD for6EG+DEM(DESS9 aPEQGbPEQD for6kG+DkM(DkSS9 for6EGkS#DEM(DESS9 O if6bPkQMbPEQ9 fG+D else O tempGbPEQD bPEQGbPkQD bPkQGtempD T T *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 @>34(

Dept. Of C.S.E

Computer Networks Lab printf67Rn79D for6EG+DEM(DESS9 if6bP+QGGaPEQ9 printf67\33NUcRtUdRtUc70sPiQ0bP+Q0s#PEQ9D T T 5etch69D T Output0 + #< <> (+ #( <@ #B #4 <# I <( <I <( @$ #B <4 4 <+ @# <+ + ## << @@ <+ @# #I B @+ #I $ + #( 4 << I <# <B @$ <( << (+ @# #I << #+ + I #+ A A I & & I & & I 3 1 1 #< $

Dept. Of C.S.E

The delays areC B \A \) \C \ ! \ \. \ \ & \I \\ \1 \L B <+ <B <+ #4 @+ #B #< #+ + $ #>

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 @$34(

Computer Networks Lab

Dept. Of C.S.E

$ro7ram >0 Take an e8ample subnet of hosts 2Obtain broadcast tree for it2 A.m0 To "rite a pro5ram to obtain broadcast tree for a subnet of hosts Des%r.pt.o40 Send a separate packet to each destination Use floodin5 Use multidestination routin5 ? ? ach packet contains a list of destinations *outers duplicate packet for all matchin5 out5oin5 lines

Use spannin5 tree routin5 ? A subset of the subnet that includes all routers but contains no loops2 ? ? Uses the minimum number of packets necessary *outers must be able to compute spannin5 tree

Co6e0 2B $RO!RA+ COR BROAD CAS ROU "N! B2 ROU "N! GORH D"S ANCE #EC OR

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 @434(

Computer Networks Lab ;JJJJJJJJJJJJJJ )*OA! CASTIN- P*O-*A% JJJJJJJJJJJJ; LincludeMstdio2hN LincludeMmath2hN int ma869D int distanceP<+QD int nD void main69 O int adEP<+QP<+Q0adE#P<+QP<+Q0fla5P@+QD int i0E0root08D int source0countG#0yG+D printf67enter no of nodes79D scanf67Ud70Fn9D printf67enter the adEacency matri8C79D for6iG+DiMnDiSS9 O for6EG+DEMnDESS9 O scanf67Ud70FadEPiQPEQ9D T T printf67enter the source for broadcastin579D scanf67Ud70Fsource9D for6iG+DiMnDiSS9 O fla5PiQG+D T for6rootG+DrootMnDrootSS9 O for6iG+DiMnDiSS9 *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 @B34(

Dept. Of C.S.E

Computer Networks Lab O distancePiQGadEProotQPiQD T 8Gmin69D for6iG+DiMnDiSS9 O if6distancePiQGG89 O adE#ProotQPiQG8D adE#PiQProotQG8D T else O adE#ProotQPiQG+D T T T for6iG+DiMnDiSS9 O for6EG+DEMnDESS9 O if6adE#PiQPEQVG+9 O adE#PEQPiQGadEPiQPEQD T T T printf675iven adEacency matri8 is79D for6iG+DiMnDiSS9 O for6EG+DEMnDESS9 *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 @I34(

Dept. Of C.S.E

Computer Networks Lab O printf67Ud70adEPiQPEQ9D T printf67Rn79D T printf67minimal spannin5 tree79D for6iG+DiMnDiSS9 O for6EG+DEMnDESS9 O printf67Ud 70adE#PiQPEQ9D T printf67Rn79D T rootGsourceD fla5ProotQG#D "hile6countVGy9 O for6iG+DiMnDiSS9 O if6adE#ProotQPiQVG+ FF fla5ProotQGG# FF fla5PiQVG#9 O printf67Ud sends messa5e to Ud Rn70root0i9D fla5PiQG#D T T if6rootMn3#9 O rootSSD T else *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 (+34(

Dept. Of C.S.E

Computer Networks Lab O rootG+D T for6iG+DiMnDiSS9 O if6fla5PiQGG+9 O breakD T T if6iGGn9 O countGyD T T T int min69 O int i0EG+D int miniD int distance#P#+QD for6iG+DiMnDiSS9 O if6distancePiQVG+9 O distance#PEQGdistancePiQD ESSD T T miniGdistance#P+QD

Dept. Of C.S.E

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 (#34(

Computer Networks Lab for6iG#DiMEDiSS9 O if6distance#PiQMmini9 O miniGdistance#PiQD T T return6mini9D T BROAD CAS "N! OU $U enter no of nodes< enter the adEacency matri8 +< <+ enter the source for broadcastin5# 5iven adEacency matri8 is +< <+ minimal spannin5 tree is +< <+ # sends messa5e to + enter no of nodes@ enter the adEacency matri8 +#< #+> <>+ enter the source for broadcastin5< 5iven adEacency matri8 is +#< #+> <>+ # <> minimal spannin5 tree is +#< #++ <++ # < *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 (<34(

Dept. Of C.S.E

Computer Networks Lab < sends messa5e to + + sends messa5e to #

Dept. Of C.S.E

;J P*O-*A% TO I%PL % NT )*OA!CAST *OUTIN- AL-O*IT&%J; LincludeMstdio2hN int aP#+QP#+Q0nD main69 O int i0E0rootD clrscr69D printf67 nter no2of nodesC79D scanf67Ud70Fn9D printf67 nter adEacent matri8Rn79D for6iG#DiMGnDiSS9 for6EG#DEMGnDESS9 O printf67 nter connectin5 of Ud33NUdCC70i0E9D scanf67Ud70FaPiQPEQ9D T printf67 nter root nodeC79D scanf67Ud70Froot9D adE6root9D T adE6int k9 O int i0ED printf67AdEacent node of root nodeCCRn79D printf67UdRnRn70k9D for6EG#DEMGnDESS9 O if6aPkQPEQGG# XX aPEQPkQGG#9 printf67UdRt70E9D T printf67Rn79D for6iG#DiMGnDiSS9 O *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 (@34(

Computer Networks Lab if66aPkQPEQGG+9 FF 6aPiQPkQGG+9 FF 6iVGk99 printf67Ud70i9D T T

Dept. Of C.S.E

OU $U 0 nter no2of nodesC> nter adEacent matri8 nter connectin5 of #33N#CC+ nter connectin5 of #33N<CC# nter connectin5 of #33N@CC# nter connectin5 of #33N(CC+ nter connectin5 of #33N>CC+ nter connectin5 of <33N#CC# nter connectin5 of <33N<CC+ nter connectin5 of <33N@CC# nter connectin5 of <33N(CC# nter connectin5 of <33N>CC+ nter connectin5 of @33N#CC# nter connectin5 of @33N<CC# nter connectin5 of @33N@CC+ nter connectin5 of @33N(CC+

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 ((34(

Computer Networks Lab nter connectin5 of @33N>CC+ nter connectin5 of (33N#CC+ nter connectin5 of (33N<CC# nter connectin5 of (33N@CC+ nter connectin5 of (33N(CC+ nter connectin5 of (33N>CC# nter connectin5 of >33N#CC+ nter connectin5 of >33N<CC+ nter connectin5 of >33N@CC+ nter connectin5 of >33N(CC# nter connectin5 of >33N>CC+ nter root nodeC< AdEacent node of root nodeCC < #@( >

Dept. Of C.S.E

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 (>34(

Computer Networks Lab

Dept. Of C.S.E

$ro7ram :0 Take a plain te8t and encrypt the same usin5 ! S al5orithm2 A.m0 To "rite a pro5ram that takes B bit plainte8t and encrypt usin5 ! S al5orithm Des%r.pt.o40 The idea of crypto5raphy is to protect data by transformin5 into a representation from "hich the ori5inal is hard to recover2 These days many net"orkin5 technolo5ies 6internet0 "ireless9 allo" many a5ents to see a piece of data as it moves from its source to its destination2 Those a5ents can capture the data in the representation sent across the net"ork0 and use it for their o"n purposes2 Increasin5ly0 people send data of 5reat value 6e252 credit card numbers0 secrets9 throu5h net"orks0 so there is plenty of need for crypto5raphy2 There are t"o common types of crypto5raphyC $ub5.%',e1 s1stems0 In a public3key system0 the messa5e % is encrypted usin5 a key "hich is public and decrypted usin5 a key "hich is private2 That is0 encryption and decryption are performed usin5 t"o separate keys2 The point of public3key systems is that kno"in5 the encryption key doesnKt help a spy
e

6intruder9 to discover the decryption key2 The most "idely used public3key system is *SA al5orithm2 $r./ate',e1 s1stems In a private3key system0 the messa5e % is encrypted usin5 a sin5le key is kno"n only to the sender and receiver2 In a private3key system0
"hich

there is usually a simple relationship bet"een the encryption and decryption keys0 so kno"in5 the key
"ould

make it easy for a spy 6intruder9 to intercept and

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 ($34(

Computer Networks Lab

Dept. Of C.S.E

decrypt a messa5e2 Probably the most "idely used secret3key system is ! S 6the !ata ncryption Standard92 The most "idely used encryption scheme is based on the data encryption standard adopted in #I44 by NIST for ! S0 data is encrypted in $(3bit blocks usin5 a >$3bit key2 The $(3bit PT passes throu5h an IP that rearran5es the bits to produce the permuted input2 This is follo"ed by the phase consistin5 of #$ rounds of the same function "hich involves both permutation and substitutions functions2 The output of the last round consists of $(3bits that are a function of the input PT and the key2 The left and ri5ht halves of the output are s"apped to produce the preoutput2 .inally the preoutput is passed throu5h IP3# that is inverse of the IP to produce the A(3bit cipher te8t2 The ri5ht hand portion of the transformation is the >$3bit key2 The key is passed throu5h a permutation function2 Thus for each of the #$ rounds a subkey6k#9 is produced by the combination of left3circular shift and a permutation2 The permutation function is same for each round0 but a different subkey is produced because of the repeated iteration of the keybits2 The ! S 6!ata ncryption Standard9 al5orithm is the most "idely used encryption al5orithm in the "orld2 ! S "orks on bits0 or binary numbers33the +s and #s common to di5ital computers2 ach 5roup of four bits makes up a he8adecimal0 or base #$0 number2 )inary 7+++#7 is e:ual to the he8adecimal number 7#70 binary 7#+++7 is e:ual to the he8adecimal number 7B70 7#++#7 is e:ual to the he8adecimal number 7I70 7#+#+7 is e:ual to the he8adecimal number 7A70 and 7####7 is e:ual to the he8adecimal number 7.72 ! S encrypts and decrypts data in $(3bit blocks0 usin5 a >$3bit key2 It takes a $(3 bit block of plainte8t as input and outputs a $(3bit block of cipherte8t2 Since it al"ays operates on blocks of e:ual si=e and it uses both permutations and substitutions in the al5orithm2 ! S has #$ rounds0 meanin5 the main al5orithm is repeated #$ times to produce the cipherte8t2 It has been found that the number of rounds is e8ponentially proportional to the amount of time re:uired to find a key usin5 a brute3force attack2 So as the number of rounds increases0 the security of the al5orithm increases e8ponentially2

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 (434(

Computer Networks Lab

Dept. Of C.S.E

The permuted block is split into t"o e:ually si=ed blocks 6L+0 *+90 "hich become the input for the first round2 The round manipulates these t"o blocks and the output becomes t"o ne" blocks 6L#0 *#92 L# G *+ *# G L+ f6*+0 1#9 The subkey 1# is chosen by a key schedulin5 al5orithm0 "hich 5enerates subkeys from a >$3bit lon5 key2 The ! S contains #$ rounds and each round can be described asC Ln G *n3# *n G Ln3# f 6*n3#0 1n9 8cept in the last round0 "here the s"ap at the end of the round is skipped2 *#$ G *#> L#$ G L#> f6*#>0 1#$9 The t"o blocks are finally subEect to a final permutation0 denoted .P0 "hich is0 in fact0 the inverse of the Initial Permutation2

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 (B34(

Computer Networks Lab

Dept. Of C.S.E

Co6e0 2B ake a :< b.t p5a1.47 te=t a46 e4%r1pt t&e same us.47 DES a57or.t&m B2 D.4%5u6eEst6.o.&F D.4%5u6eE%o4.o.&F D.4%5u6eEst65.b.&F D.4%5u6eEstr.47.&F /o.6 ma.4GH I .4t .8%&85pK *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 (I34(

Computer Networks Lab %&ar %.p&erL>(M8p5a.4L>(MK %&ar ke1L>(MK %5rs%rGHK w&.5eG1H I pr.4tfGNO4'''''+ENU'''''O4NHK pr.4tfGNO410Data E4%r1pt.o4OtO4O4*0Data De%r1pt.o4OtO4O4)0E=.tNHK pr.4tfGNO4O4E4ter 1our %&o.%e0NHK s%a4fGNP6N8Q%&HK sw.t%&G%&H I %ase 10 pr.4tfGNO4Data E4%r1pt.o4NHK pr.4tfGNO4E4ter t&e p5a.4 te=t0NHK ff5us&Gst6.4HK 7etsGp5a.4HK pr.4tfGNO4E4ter t&e e4%r1pt.o4 ke10NHK 7etsGke1HK 5pJstr5e4Gke1HK forG.J(Kp5a.4L.MUJSO(SK.TTH %.p&erL.MJp5a.4L.MV5pK %.p&erL.MJSO(SK pr.4tfGNO4 &e e4%r1pte6 te=t .s0NHK putsG%.p&erHK breakK %ase *0 pr.4tfGNO4Data 6e%r1pt.o4NHK forG.J(K%.p&erL.MUJSO(SK.TTH p5a.4L.MJ%.p&erL.MV5pK pr.4tfGNO4De%r1pte6 te=t .s0NHK putsGp5a.4HK breakK %ase )0 e=.tG(HK R R 7et%&GHK R

Dept. Of C.S.E

Output00 '''''''''+ENU'''''
10 Data E4%r1pt.o4 *0 Data De%r1pt.o4
*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 >+34(

Computer Networks Lab

Dept. Of C.S.E

)0 E=.t E4ter 1our %&o.%e0 1 Data E4%r1pt.o4 E4ter t&e p5a.4 te=t0&e55o E4ter t&e e4%r1pt.o4 ke101*)We &e e4%r1pte6 te=t .s0 mX..''''''''''+ENU''''''' 10 Data E4%r1pt.o4 *0 Data De%r1pt.o4 )0 E=.t E4ter 1our %&o.%e0 * Data 6e%r1pt.o4 De%r1pte6 te=t .s0 &e55o ''''''''''+ENU''''''' 10 Data E4%r1pt.o4 *0 Data De%r1pt.o4 )0 E=.t E4ter 1our %&o.%e0 )

$ro7ram ?0 /rite a pro5ram to break the above ! S Codin56decryption92 A.m0 *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 >#34(

Computer Networks Lab To implement a pro5ram that breaks ! S codin5 Des%r.pt.o40

Dept. Of C.S.E

The idea of crypto5raphy is to protect data by transformin5 into a representation from "hich the ori5inal is hard to recover2 These days many net"orkin5 technolo5ies 6internet0 "ireless9 allo" many a5ents to see a piece of data as it moves from its source to its destination2 Those a5ents can capture the data in the representation sent across the net"ork0 and use it for their o"n purposes2 Increasin5ly0 people send data of 5reat value 6e252 credit card numbers0 secrets9 throu5h net"orks0 so there is plenty of need for crypto5raphy2 There are t"o common types of crypto5raphyC $ub5.%',e1 s1stems0 In a public3key system0 the messa5e % is encrypted usin5 a key "hich is public and decrypted usin5 a key "hich is private2 That is0 encryption and decryption are performed usin5 t"o separate keys2 The point of public3key systems is that kno"in5 the encryption key doesnKt help a spy
e

6intruder9 to discover the decryption key2 The most "idely used public3key system is *SA al5orithm2 $r./ate',e1 s1stems In a private3key system0 the messa5e % is encrypted usin5 a sin5le key is kno"n only to the sender and receiver2 In a private3key system0
"hich

there is usually a simple relationship bet"een the encryption and decryption keys0 so kno"in5 the key !ata ncryption Standard92 The ! S 6!ata ncryption Standard9 al5orithm is the most "idely used encryption
"ould

make it easy for a spy 6intruder9 to intercept and

decrypt a messa5e2 Probably the most "idely used secret3key system is ! S 6the

al5orithm in the "orld2 ! S "orks on bits0 or binary numbers33the +s and #s common to di5ital computers2 ach 5roup of four bits makes up a he8adecimal0 or base #$0 number2 )inary 7+++#7 is e:ual to the he8adecimal number 7#70 binary 7#+++7 is e:ual to the he8adecimal number 7B70 7#++#7 is e:ual to the he8adecimal number 7I70 7#+#+7 is e:ual to the he8adecimal number 7A70 and 7####7 is e:ual to the he8adecimal number 7.72 *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 ><34(

Computer Networks Lab

Dept. Of C.S.E

Co6e0 2B $RO!RA+ HA BREA,S DES COD"N! B2

The !ecryption process is reverse process of


#include<stdio.h> #include<conio.h> #include<string.h> #include<ctype.h> void main() { char pwd[20] char alpha[2!]"#a$cde%ghi&'lmnop(rstuvw)y*# int num[20]+i+n+'ey clrscr() print%(#,n-nter the password.#) scan%(#/s#+0pwd) n"strlen(pwd) %or(i"0 i<n i11) num[i]"toascii(tolower(pwd[i]))23a3 print%(#,n-nter the 'ey.#) scan%(#/d#+0'ey) %or(i"0 i<n i11) num[i]"(num[i]1'ey)/2! %or(i"0 i<n i11) pwd[i]"alpha[num[i]] print%(#,n4he 'ey is./d#+'ey) print%(#,n-ncrypted te)t is./s#+pwd) %or(i"0 i<n i11) { num[i]"(num[i]2'ey)/2! i%(num[i]<0) num[i]"2!1num[i] pwd[i]"alpha[num[i]] 5 print%(#,n6ecrypted te)t is./s#+pwd) getch() 5

ncryption2

Output00
nter the pass"ordCasdf5hE nter the keyC#+#+
*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 >@34(

Computer Networks Lab

Dept. Of C.S.E

The key isC #+#+ ncrypted te8t isC "o=babc !ecrypted te8t isC asdf5hE

$ro7ram @0 Usin5 *SA al5orithm encrypt a te8t data and decrypt the same2 A.m0 To "rite a pro5ram to encrypt F decrypt a te8t data usin5 *SA al5orithm *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 >(34(

Computer Networks Lab Des%r.pt.o40

Dept. Of C.S.E

The idea of crypto5raphy is to protect data by transformin5 into a representation from "hich the ori5inal is hard to recover2 These days many net"orkin5 technolo5ies 6internet0 "ireless9 allo" many a5ents to see a piece of data as it moves from its source to its destination2 Those a5ents can capture the data in the representation sent across the net"ork0 and use it for their o"n purposes2 Increasin5ly0 people send data of 5reat value 6e252 credit card numbers0 secrets9 throu5h net"orks0 so there is plenty of need for crypto5raphy2 There are t"o common types of crypto5raphyC $ub5.%',e1 s1stems0 In a public3key system0 the messa5e % is encrypted usin5 a key "hich is public and decrypted usin5 a key "hich is private2 That is0 encryption and decryption are performed usin5 t"o separate keys2 The point of public3key systems is that kno"in5 the encryption key doesnKt help a spy 6intruder9 to discover the decryption key2 The most "idely used public3key system is *SA al5orithm2 $r./ate',e1 s1stems In a private3key system0 the messa5e % is encrypted usin5 a sin5le key "hich is kno"n only to the sender and receiver2 In a private3key system0 there is usually a simple relationship bet"een the encryption and decryption keys0 so kno"in5 the key "ould make it easy for a spy6intruder9 to intercept and decrypt a messa5e2 Probably the most "idely used secret3key system is ! S 6the !ata ncryption Standard92
e

The most famous public3key system is called *SA after its inventors *ivest0 Shamir and Adleman2The *SA method is based on some principles from number theory2 Step $" Choose t"o lar5e primes0 p and : Step %" Compute n G p ] : and = G 6 p ? # 9 ] 6 : ? # 9 Step &" Choose a number relatively prime to = and call it d Step '" .ind e such that e ] d G # mod = $ro%e6ure0 Choose t"o lar5e primes0 p and : Compute n G p ] : and = G 6 p ? # 9 ] 6 : ? # 9 Choose a number relatively prime to = and call it d .ind e such that e ] d G # mod = To encrypt a messa5e0 P0 compute C G Pe 6 mod n 9 To decrypt C0 compute P G Cd 6 mod n 9 Co6e0 2B $RO!RA+ COR RSA ENCRY$ "ON AND DECRY$ "ON AL!OR" H+ B2

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 >>34(

Computer Networks Lab ;J C Pro5ram .or The Implementation Of *SAJ;

Dept. Of C.S.E

LincludeMstdio2hN LincludeMconio2hN LincludeMctype2hN LincludeMmath2hN LincludeMstrin52hN void main69 O int a0b0i0E0t080n0kG+0fla5G+0primeP#++QD char mP<+Q0ppP<+QD float pP<+Q0cP<+QD double e0dD clrscr69D for6iG+DiM>+DiSS9 O fla5G+D for6EG<DEMi;<DESS9 if6iUEGG+9 O fla5G#D breakD T if6fla5GG+9 primePkSSQGiD T aGprimePk3#QD bGprimePk3<QD nGaJbD tG6a3#9J6b3#9D eG6double9primeP<QD dG#;6float9eD printf67Rn1ey of encryption isCUlfRn70d9D printf67Rn nter plain the te8tC79D scanf67Us70Fm9D 8Gstrlen6m9D printf67Rn!ecryption status .rom Source to !estinationCRn79D printf67RnSourceRt3N3333333333333333333333333333333333M3destinationRn79D printf67RnCharRtnumericRtcipherRtRtnumericRtRtchar Rn79D printf67RnJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJRn79D printf67Rn79D for6iG+DiM8DiSS9 O printf67Uc70mPiQ9D printf67RtUd70mPiQ3I49D cPiQGpo"6mPiQ3I406float9e9D *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 >$34(

Computer Networks Lab

Dept. Of C.S.E

cPiQGfmod6cPiQ06float9n9D printf67RtUf70cPiQ9D pPiQGpo"6cPiQ06float9d9D pPiQGfmod6pPiQ06float9n9D printf67RtUf70pPiQ9D ppPiQGpPiQSI4D printf67RtUcRn70ppPiQ9D printf67RnJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJRn79D printf67Rn79D T 5etch69D T

;JJJJJJJJJJJJJJJJJJJJJ OUTPUT JJJJJJJJJJJJJJJJJJJJJJJ

<. #"#A #OCE

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 >434(

Computer Networks Lab 1. W&at are t&e two t1pes of tra4sm.ss.o4 te%&4o5o71 a/a.5ab5eY 6i9 )roadcast and 6ii9 point3to3point

Dept. Of C.S.E

*. W&at .s sub4etY A 5eneric term for section of a lar5e net"orks usually separated by a brid5e or router2 ). D.ffere4%e betwee4 t&e %ommu4.%at.o4 a46 tra4sm.ss.o4. Transmission is a physical movement of information and concern issues like bit polarity0 synchroni=ation0 clock etc2 Communication means the meanin5 full e8chan5e of information bet"een t"o communication media2 <. W&at are t&e poss.b5e wa1s of 6ata e=%&a47eY 6i9 Simple8 6ii9 &alf3duple8 6iii9 .ull3duple82 >. W&at .s SA$Y Series of interface points that allo" other computers to communicate "ith the other layers of net"ork protocol stack2 :. W&at 6o 1ou mea4t b1 Ntr.p5e AN .4 NetworksY The function of PA! 6Packet Assembler !isassembler9 is described in a document kno"n as H2@2 The standard protocol has been defined bet"een the terminal and the PA!0 called H2<BD another standard protocol e8ists bet"een the PA! and the net"ork0 called H2<I2 To5ether0 these three recommendations are often called 7triple H7 ?. W&at .s frame re5a18 .4 w&.%& 5a1er .t %omesY .rame relay is a packet s"itchin5 technolo5y2 It "ill operate in the data link layer2 @. W&at .s term.4a5 emu5at.o48 .4 w&.%& 5a1er .t %omesY Telnet is also called as terminal emulation2 It belon5s to application layer2 Z. W&at .s Bea%o4.47Y The process that allo"s a net"ork to self3repair net"orks problems2 The stations on the net"ork notify the other stations on the rin5 "hen they are not receivin5 the transmissions2 )eaconin5 is used in Token rin5 and .!!I net"orks2 1(. W&at .s re6.re%torY *edirector is soft"are that intercepts file or prints I;O re:uests and translates them into net"ork re:uests2 This comes under presentation layer2 11. W&at .s NE B"OS a46 NE BEU"Y N T)IOS is a pro5rammin5 interface that allo"s I;O re:uests to be sent to and received from a remote computer and it hides the net"orkin5 hard"are from applications2 N T) UI is Net)IOS e8tended user interface2 A transport protocol desi5ned by microsoft and I)% for the use on small subnets2 *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 >B34(

Computer Networks Lab

Dept. Of C.S.E

1*. W&at .s RA"DY A method for providin5 fault tolerance by usin5 multiple hard disk drives2 1). W&at .s pass./e topo5o71Y /hen the computers on the net"ork simply listen and receive the si5nal0 they are referred to as passive because they donKt amplify the si5nal in any "ay2 8ample for passive topolo5y 3 linear bus2 1<. W&at .s BrouterY &ybrid devices that combine the features of both brid5es and routers2 1>. W&at .s %5a66.47Y A layer of a 5lass surroundin5 the center fiber of 5lass inside a fiber3optic cable2 1:. W&at .s po.4t'to'po.4t proto%o5Y A communications protocol used to connect computers to remote net"orkin5 services includin5 Internet service providers2 1?. How !atewa1 .s 6.ffere4t from RoutersY A 5ate"ay operates at the upper levels of the OSI model and translates information bet"een t"o completely different net"ork architectures or data formats 1@. W&at .s atte4uat.o4Y The de5eneration of a si5nal over distance on a net"ork cable is called attenuation2 1Z. W&at .s +AC a66ressY The address for a device as it is identified at the %edia Access Control 6%AC9 layer in the net"ork architecture2 %AC address is usually stored in *O% on the net"ork adapter card and is uni:ue2 *(. D.ffere4%e betwee4 b.t rate a46 bau6 rateY )it rate is the number of bits transmitted durin5 one second "hereas baud rate refers to the number of si5nal units per second that are re:uired to represent those bits2 baud rate G bit rate ; N "here N is no3of3bits represented by each si5nal shift2 *1. W&at .s Ba46w.6t&Y very line has an upper limit and a lo"er limit on the fre:uency of si5nals it can carry2 This limited ran5e is called the band"idth2 **. W&at are t&e t1pes of ra4sm.ss.o4 me6.aY Si5nals are usually transmitted over some transmission media that are broadly classified in to t"o cate5ories2 a9 -uided %ediaC These are those that provide a conduit from one device to another that include t"isted3 *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 >I34(

Computer Networks Lab

Dept. Of C.S.E

pair0 coa8ial cable and fiber3optic cable2 A si5nal travelin5 alon5 any of these media is directed and is contained by the physical limits of the medium2 T"isted3pair and coa8ial cable use metallic that accept and transport si5nals in the form of electrical current2 Optical fiber is a 5lass or plastic cable that accepts and transports si5nals in the form of li5ht2 b9 Un5uided %ediaC This is the "ireless media that transport electroma5netic "aves "ithout usin5 a physical conductor2 Si5nals are broadcast either throu5h air2 This is done throu5h radio communication0 satellite communication and cellular telephony2 *). W&at .s $ro-e%t @(*Y It is a proEect started by I to set standards to enable intercommunication bet"een e:uipment from a variety of manufacturers2 It is a "ay for specifyin5 functions of the physical layer0 the data link layer and to some e8tent the net"ork layer to allo" for interconnectivity of maEor LAN protocols2 It consists of the follo"in5C B+<2# is an internet"orkin5 standard for compatibility of different LANs and %ANs across protocols2 B+<2< Lo5ical link control 6LLC9 is the upper sublayer of the data link layer "hich is non3architecture3specific0 that is remains the same for all I 3defined LANs2 %edia access control 6%AC9 is the lo"er sublayer of the data link layer that contains some distinct modules each carryin5 proprietary information specific to the LAN product bein5 used2 The modules are thernet LAN 6B+<2@90 Token rin5 LAN 6B+<2(90 Token bus LAN 6B+<2>92 B+<2$ is distributed :ueue dual bus 6!^!)9 desi5ned to be used in %ANs2 *<. W&at .s $roto%o5 Data U4.tY The data unit in the LLC level is called the protocol data unit 6P!U92 The P!U contains of four fields a destination service access point 6!SAP90 a source service access point 6SSAP90 a control field and an information field2 !SAP0 SSAP are addresses used by the LLC to identify the protocol stacks on the receivin5 and sendin5 machines that are 5eneratin5 and usin5 the data2 The control field specifies "hether the P!U frame is a information frame 6I 3 frame9 or a supervisory frame 6S 3 frame9 or a unnumbered frame 6U 3 frame92 *>. W&at are t&e 6.ffere4t t1pes of 4etwork.47 2 .4ter4etwork.47 6e/.%esY *epeaterC Also called a re5enerator0 it is an electronic device that operates only at physical layer2 It receives the si5nal in the net"ork before it becomes "eak0 re5enerates the ori5inal bit pattern and puts the refreshed copy back in to the link2 )rid5esC These operate both in the physical and data link layers of LANs of same type2 They divide a lar5er net"ork in to smaller se5ments2 They contain lo5ic that allo" them to keep the traffic for each se5ment separate and thus are repeaters that relay a frame only the side of the se5ment containin5 the intended recipent and control con5estion2 *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 $+34(

Computer Networks Lab

Dept. Of C.S.E

*outersC They relay packets amon5 multiple interconnected net"orks 6i2e2 LANs of different type92 They operate in the physical0 data link and net"ork layers2 They contain soft"are that enable them to determine "hich of the several possible paths is the best for a particular transmission2 -ate"aysC They relay packets amon5 net"orks that have different protocols 6e252 bet"een a LAN and a /AN92 They accept a packet formatted for one protocol and convert it to a packet formatted for another protocol before for"ardin5 it2 They operate in all seven layers of the OSI model2 *:. W&at .s "C+$Y IC%P is Internet Control %essa5e Protocol0 a net"ork layer protocol of the TCP;IP suite used by hosts and 5ate"ays to send notification of data5ram problems back to the sender2 It uses the echo test ; reply to test "hether a destination is reachable and respondin52 It also handles both control and error messa5es2 *?. W&at are t&e 6ata u4.ts at 6.ffere4t 5a1ers of t&e C$ 2 "$ proto%o5 su.teY The data unit created at the application layer is called a messa5e0 at the transport layer the data unit created is called either a se5ment or an user data5ram0 at the net"ork layer the data unit created is called the data5ram0 at the data link layer the data5ram is encapsulated in to a frame and finally transmitted as si5nals alon5 the transmission media2 *@. W&at .s 6.ffere4%e betwee4 AR$ a46 RAR$Y The address resolution protocol 6A*P9 is used to associate the @< bit IP address "ith the (B bit physical address0 used by a host or a router to find the physical address of another host on its net"ork by sendin5 a A*P :uery packet that includes the IP address of the receiver2 The reverse address resolution protocol 6*A*P9 allo"s a host to discover its Internet address "hen it kno"s only its physical address2 *Z. W&at .s t&e m.4.mum a46 ma=.mum 5e47t& of t&e &ea6er .4 t&e C$ se7me4t a46 "$ 6ata7ramY The header should have a minimum len5th of <+ bytes and can have a ma8imum len5th of $+ bytes2 )(. W&at .s t&e ra47e of a66resses .4 t&e %5asses of .4ter4et a66ressesY Class A +2+2+2+ 3 #<42<>>2<>>2<>> Class ) #<B2+2+2+ 3 #I#2<>>2<>>2<>> Class C #I<2+2+2+ 3 <<@2<>>2<>>2<>> Class ! <<(2+2+2+ 3 <@I2<>>2<>>2<>> Class <(+2+2+2+ 3 <(42<>>2<>>2<>> )1. W&at .s t&e 6.ffere4%e betwee4 C $ a46 C $ app5.%at.o4 5a1er proto%o5sY *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 $#34(

Computer Networks Lab

Dept. Of C.S.E

The Trivial .ile Transfer Protocol 6T.TP9 allo"s a local host to obtain files from a remote host but does not provide reliability or security2 It uses the fundamental packet delivery services offered by U!P2 The .ile Transfer Protocol 6.TP9 is the standard mechanism provided by TCP ; IP for copyin5 a file from one host to another2 It uses the services offer by TCP and so is reliable and secure2 It establishes t"o connections 6virtual circuits9 bet"een the hosts0 one for data transfer and another for control information2 )*. W&at are ma-or t1pes of 4etworks a46 e=p5a.4Y Server3based net"ork Peer3to3peer net"ork Peer3to3peer net"ork0 computers can act as both servers sharin5 resources and as clients usin5 the resources2 Server3based net"orks provide centrali=ed control of net"ork resources and rely on server computers to provide security and net"ork administration )). W&at are t&e .mporta4t topo5o7.es for 4etworksY (S topolo)*0 In this each computer is directly connected to primary net"ork cable in a sin5le line2 Advanta5esC Ine8pensive0 easy to install0 simple to understand0 easy to e8tend2 STA+ topolo)*0 In this all computers are connected usin5 a central hub2 Advanta5esC Can be ine8pensive0 easy to install and reconfi5ure and easy to trouble shoot physical problems2 +,N- topolo)*0 In this all computers are connected in loop2 Advanta5esC All computers have e:ual access to net"ork media0 installation can be simple0 and si5nal does not de5rade as much as in other topolo5ies because each computer re5enerates it2 )<. W&at .s mes& 4etworkY A net"ork in "hich there are multiple net"ork links bet"een computers to provide multiple paths for data to travel2 )>. W&at .s 6.ffere4%e betwee4 baseba46 a46 broa6ba46 tra4sm.ss.o4Y In a baseband transmission0 the entire band"idth of the cable is consumed by a sin5le si5nal2 In broadband transmission0 si5nals are sent on multiple fre:uencies0 allo"in5 multiple si5nals to be sent simultaneously2 ):. E=p5a.4 >'<') ru5eY In a thernet net"ork0 bet"een any t"o points on the net"ork0 there can be no more than five net"ork se5ments or four repeaters0 and of those five se5ments only three of *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 $<34(

Computer Networks Lab se5ments can be populated2 )?. W&at +AUY In token *in5 0 hub is called %ultistation Access Unit6%AU92

Dept. Of C.S.E

)@. W&at .s t&e 6.ffere4%e betwee4 routab5e a46 4o4' routab5e proto%o5sY *outable protocols can "ork "ith a router and can be used to build lar5e net"orks2 Non3 *outable protocols are desi5ned to "ork on small0 local net"orks and cannot be used "ith a router )Z. W&1 s&ou56 1ou %are about t&e OS" Refere4%e +o6e5Y It provides a frame"ork for discussin5 net"ork operations and desi5n2 <(. W&at .s 5o7.%a5 5.4k %o4tro5Y One of t"o sublayers of the data link layer of OSI reference model0 as defined by the I B+< standard2 This sublayer is responsible for maintainin5 the link bet"een computers "hen they are sendin5 data across the physical net"ork connection2 <1. W&at .s /.rtua5 %&a44e5Y ,irtual channel is normally a connection from one source to one destination0 althou5h multicast connections are also permitted2 The other name for virtual channel is virtual circuit2 <*. W&at .s /.rtua5 pat&Y Alon5 any transmission path from a 5iven source to a 5iven destination0 a 5roup of virtual circuits can be 5rouped to5ether into "hat is called path2 <). W&at .s pa%ket f.5terY Packet filter is a standard router e:uipped "ith some e8tra functionality2 The e8tra functionality allo"s every incomin5 or out5oin5 packet to be inspected2 Packets meetin5 some criterion are for"arded normally2 Those that fail the test are dropped2 <<. W&at .s traff.% s&ap.47Y One of the main causes of con5estion is that traffic is often busy2 If hosts could be made to transmit at a uniform rate0 con5estion "ould be less common2 Another open loop method to help mana5e con5estion is forcin5 the packet to be transmitted at a more predictable rate2 This is called traffic shapin52 <>. W&at .s mu5t.%ast rout.47Y Sendin5 a messa5e to a 5roup is called multicastin50 and its routin5 al5orithm is called multicast routin52 <:. W&at .s re7.o4Y /hen hierarchical routin5 is used0 the routers are divided into "hat "e "ill call re5ions0 "ith each router kno"in5 all the details about ho" to route packets to destinations "ithin its o"n re5ion0 but kno"in5 nothin5 about the internal structure of other re5ions2 *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 $@34(

Computer Networks Lab

Dept. Of C.S.E

<?. W&at .s s.551 w.46ow s146romeY It is a problem that can ruin TCP performance2 This problem occurs "hen data are passed to the sendin5 TCP entity in lar5e blocks0 but an interactive application on the receivin5 side reads # byte at a time2 <@. W&at are D.7rams a46 r.7ramsY The most common t"o letter combinations are called as di5rams2 252 th0 in0 er0 re and an2 The most common three letter combinations are called as tri5rams2 252 the0 in50 and0 and ion2 <Z. E=pa46 "DEAY I! A stands for International !ata ncryption Al5orithm2 >(. W&at .s w.6e'mout& fro7Y /ide3mouth fro5 is the simplest kno"n key distribution center 61!C9 authentication protocol2 >1. W&at .s +a.5 !atewa1Y It is a system that performs a protocol translation bet"een different electronic mail delivery protocols2 >*. W&at .s "!$ G"4ter.or !atewa1 $roto%o5HY It is any routin5 protocol used "ithin an autonomous system2 >). W&at .s E!$ GE=ter.or !atewa1 $roto%o5HY It is the protocol the routers in nei5hborin5 autonomous systems use to identify the set of net"orks that can be reached "ithin or via each autonomous system2 ><. W&at .s auto4omous s1stemY It is a collection of routers under the control of a sin5le administrative authority and that uses a common Interior -ate"ay Protocol2 >>. W&at .s B!$ GBor6er !atewa1 $roto%o5HY It is a protocol used to advertise the set of net"orks that can be reached "ith in an autonomous system2 )-P enables this information to be shared "ith the autonomous system2 This is ne"er than -P 6 8terior -ate"ay Protocol92 >:. W&at .s !atewa1'to'!atewa1 proto%o5Y It is a protocol formerly used to e8chan5e routin5 information bet"een Internet core routers2 >?. W&at .s N# GNetwork #.rtua5 erm.4a5HY It is a set of rules definin5 a very simple virtual terminal interaction2 The N,T is used in the start of a Telnet session2

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 $(34(

Computer Networks Lab

Dept. Of C.S.E

>@. W&at .s a +u5t.'&ome6 HostY It is a host that has a multiple net"ork interfaces and that re:uires multiple IP addresses is called as a %ulti3homed &ost2 >Z. W&at .s ,erberosY It is an authentication service developed at the %assachusetts Institute of Technolo5y2 1erberos uses encryption to prevent intruders from discoverin5 pass"ords and 5ainin5 unauthori=ed access to files2 :(. W&at .s OS$CY It is an Internet routin5 protocol that scales "ell0 can route traffic alon5 multiple paths0 and uses kno"led5e of an InternetAs topolo5y to make accurate routin5 decisions2 :1. W&at .s $ro=1 AR$Y It is usin5 a router to ans"er A*P re:uests2 This "ill be done "hen the ori5inatin5 host believes that a destination is local0 "hen in fact is lies beyond router2 :*. W&at .s SL"$ GSer.a5 L.4e "4terfa%e $roto%o5HY It is a very simple protocol used for transmission of IP data5rams across a serial line2 :). W&at .s R"$ GRout.47 "4format.o4 $roto%o5HY It is a simple protocol used to e8chan5e information bet"een the routers2 :<. W&at .s sour%e routeY It is a se:uence of IP addresses identifyin5 the route a data5ram must follo"2 A source route may optionally be included in an IP data5ram header2

>. EAERC"SES2$RAC "CES


*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 $>34(

Computer Networks Lab

Dept. Of C.S.E

#2 #$3bit messa5es are transmitted usin5 a &ammin5 code2 &o" many check bits are needed to ensure that the receiver can detect and correct sin5le bit errors Sho" the bit pattern transmitted for the messa5e ##+#++##++##+#+#2 Assume that even parity is used in &ammin5 code2 <2 To provide more reliability than a sin5le parity bit can 5ive0 an error3detectin5 codin5 scheme uses one parity bit for checkin5 all the odd3numbered bits and a second parity bit for all the even3numbered bits2 /hat is the &ammin5 distance of this code @2 An B3bit byte "ith binary value #+#+#### is to be encoded usin5 an even3parity &ammin5 code2 /hat is the binary value after encodin5 (2 .ind the &ammin5 distance for the follo"in5 dataC ##++##++ #+##+##++ ####++++ +#+##+#+ #+#+#+#+ >2 .ind the &ammin5 distance for the 5iven code "ordsC ####### +++###++ #+##++## $2 Implement the checksum method of detectin5 the errors for the follo"in5 dataC ++++#+++ +#+#+#+# #####+++ +##+#++# #+###+## 42 ,erify "hether +##++#+ is the suitable checksum for the data +#+##+## +##+##++ ++++++## B2 The input data alon5 "ith checksum is 5iven belo"2 #+#+##++ +#+#++## #+#+++++ +#####++ #+++##+# ,erify "hether it is correct I2 /hat is the remainder obtained by dividin5 84 S 8> S # by the 5enerator polynomial 8@ S # _ #+2 A bit stream #++###+# is transmitted usin5 the standard C*C method2 The 5enerator polynomial is 8@ S #2 Sho" the actual bit strin5 transmitted2 Suppose the third bit from the left is inverted durin5 transmission2 Sho" that this error is detected at the receiverKs end _ ##2 Implement the C*C method usin5 C*C3#< as the 5enerator polynomial2 #<2 Implement the C*C method usin5 C*C3#$ as the 5enerator polynomial2 #@2 Implement the C*C method usin5 C*C3 CCITT as the 5enerator polynomial2 *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 $$34(

Computer Networks Lab

Dept. Of C.S.E

#(2 -ive the output strin5 for the data !L A ) !L C ! after character stuffin52 #>2 /hat is the character stuffed data for A !L ) C ! #$2 /hat is the output strin5 for the data A ) C ! after character stuffin5

#42 -ive the output data for the input A !L !L ) C after stuffin5 the data #B2 If the 5iven strin5 is A ) C ! !L receiver #I2 A bit strin50 +####+#####+######+0 needs to be transmitted at the data link layer2 /hat is the strin5 actually transmitted after bit stuffin5 <+2 The follo"in5 character encodin5 is used in a data link protocolC AC +#+++###D )C ###+++##D .LA-C +######+D SCC ###+++++ Sho" the bit se:uence transmitted 6in binary9 for the (3character frameC A ) SC .LA- "hen bit stuffin5 is used2 <#2 /hat is the output for the strin5 +######+ after bit stuffin5 <<2 -ive the bit stuffed strin5 for the data +++###+++### <@2 /hat is the strin5 received at the receiver end "hen the strin5 +######++######+ is bit stuffed <(2 Implement the distance vector routin5 al5orithm for the follo"in5 subnet2 0 "hat is the strin5 that is received at the

<>2 ncrypt the te8t ZCO%PUT *N T/O*1S[ usin5 the key value of #+ <$2 !ecrypt the te8t Z!//!.N[ "ith key value of @ <42 ncrypt the te8t Zmonoalphabetic[ usin5 the key value of B <B2 !ecrypt the te8t Zsuccess[ "ith key value of $ <I2 ncrypt the te8t ZCO%PUT *N T/O*1S[ *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 $434(

Computer Networks Lab @+2 !ecrypt the te8t Z!//!.N[ @#2 ncrypt the te8t Zmonoalphabetic[ @<2 !ecrypt the te8t Zsuccess[

Dept. Of C.S.E

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 $B34(

Computer Networks Lab

Dept. Of C.S.E

:. !LOSSARY
Address Mask ADS API ARP (Address Resolution Protocol) 7 $it mas' used to select $its %rom an 8nternet address %or su$net addressing 7ctive 6irectory 9ervice. 7 service that can $e used as an in%ormation service as well as administrative service. 7pplication :rogramming 8nter%ace 4he 8nternet protocol used to dynamically map 8nternet addresses to physical (hardware) addresses on ;7<s.

:rocedures used to govern the appropriate usage o% a AUP (Acceptable networ' or service Use Policy) Authentication 4he process $y which a user=s identity is chec'ed within the networ' to ensure that the user has access to the re(uested resources :rotocol that allows an 8nternet node to discover certain startup in%ormation+ such as its 8: address

BOOTP (Bootstrap Protocol) !AP ( hallen"e !andshake Authori#ation Protocol) ookie

7 protocol used %or identi%ying and authenticating a user and his or her password. 4he password used challenge response methods to identi%y clients.

7 piece o% in%ormation sent $y a >e$ server to a >e$ $rowser. 4he $rowser so%tware is then e)pected to save the data and send it $ac' to the server whenever the $rowser ma'es additional re(uests %rom the server. 6istri$uted ?ile 9ystem 4he services that support the creation and maintenance o% distri$uted applications.

D$S D % (Distributed o&putin"

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 $I34(

Computer Networks Lab

Dept. Of C.S.E

%n'iron&ent) D%S (Data %ncryption Standard) D! P (Dyna&ic !ost on(i"uration Protocol) D)S (Do&ain )a&in" Syste&) Do&ain Do&ain )a&e %ncryption 7 standard cryptographic algorithm developed $y the @.9. <ational Aureau o% 9tandards.

7 protocol used to retrieve startup in%ormation such as a su$net mas' and 8: address %rom a 6BC: server.

7 system used $y the 8nternet %or translating names o% host computers into addresses. 7n element o% the naming hierarchy on the 8nternet. 4he uni(ue name that identi%ies an 8nternet site. 7 type o% networ' security in which in%ormation sent over the networ' is encoded so that only the intended users can access the in%ormation. Bardware andDor so%tware used to divide a ;7< into two or more parts %or security reasons. 7ny hardware or so%tware that is used %or the purpose o% providing access %rom one system to another. 4erm used to descri$e the data lin' $etween two gateways or routers that a pac'et must travel to reach its destination. 4erm used in the 8nternet community to descri$e any device attached to the networ' that provides application2 level service.

$ire*all +ate*ay !op !ost

@sed to communicate 8: status and error messages $etween hosts and routers. I MP (Internet ontrol Messa"e Protocol)

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 4+34(

Computer Networks Lab

Dept. Of C.S.E

IP (Internet Protocol) ,DAP

4he 8: contains addressing in%ormation and some control in%ormation that allows pac'ets to $e routed. 7n 8: address is the speci%ic address assigned to a computer connected to the 8nternet. ;ight weight directory access protocol. 9erves as %ramewor' under which di%%erent <E9 and application2 speci%ic directories may $e incorporated and managed. 7 collection o% o$&ects that can $e accessed via a networ' management protocol such as 9<F:.

MIB-II (Mana"e&ent In(or&ation Base II) MM

Ficroso%t Fanagement Console. 7 container utility that ta'es di%%erent management tools called #9nap28ns#. 7 driver+ developed $y Ficroso%t and GCom+ %or ;7<s that support 4o'en2Hing and -thernet networ' types.

)DIS ()et*ork De'ice Inter(ace Speci(ication) )etB%UI ()etBIOS %.tended User Inter(ace) )etBIOS ()et*ork Basic Input Output Syste&) ODSI

7 transport protocol that supports >indows %or >or'groups.

4he standard inter%ace to networ's on 8AF :C and compati$le systems using Ficroso%t and 8AF networ' so%tware.

Epen 6irectory 9ervices 8nter%ace. 7 set o% >E97 7:8=s+ %or a single set o% inter%aces %or $uilding applications that access+ register with+ and manage multiple directory services. Epen 9ystems 8nterconnection 7 protocol used %or identi%ying and authenticating a user and his or her password.

OSI PAP (Pass*ord Authentication

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 4#34(

Computer Networks Lab

Dept. Of C.S.E

Protocol) RARP (Re'erse Address Resolution Protocol) RIP (Routin" In(or&ation Protocol) S)MP (Si&ple )et*ork Mana"e&ent Protocol) Source Route 7 protocol used $y a host to o$tain an 8: address $ased on the address o% the host=s adapter card. 4his protocol is typically used when 8: addresses are scarce.

7 protocol+ limited to a small num$er o% machines attached to ;7<s+ used to e)change 8nternet routing in%ormation across networ's. 7 set o% standards %or communication with devices connected to a 4C:D8: networ'. -)amples o% these devices include routers+ hu$s and switches.

4he route that a pac'et ta'es to reach its destination. 4he route is determined prior to the start o% the transmission o% the pac'et. 4he part o% the address mas' that identi%ies an individual networ' within a larger networ'. 4he suite o% protocols that de%ines the 8nternet. Eriginally designed %or the @ni) operating system+ 4C:D8: so%tware is now availa$le %or every ma&or operating system.

Subnet Mask

T P/IP (Trans&ission ontrol Protocol/Internet Protocol) UDP (User Data"ra& Protocol) U)

7 transport protocol in the 8nternet suite o% protocols. @6:+ li'e 4C:+ uses 8: %or deliver however+ unli'e 4C:+ @6: provides %or the e)change o% datagrams without ac'nowledgment or guaranteed delivery. @niversal <aming Convention. 7ddresses currently used in >indows <4 9erver networ's to point to shared volumes+ %iles+ and printers. @niversal Hesource ;ocator

UR,

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 4<34(

Computer Networks Lab

Dept. Of C.S.E

0I)S 0OSA

>indows 8nternet <aming 9ervice >indows Epen 9ervices 7rchitecture

?. RECERENCES2 B"BL"O!RA$HY
#2 Ne" 5lobal standard for fully net"orked home0 ITU3T Press *elease <2 I PB+<2@ba (+-b;s and #++-b;s thernet Task .orce

@2 %obile )roadband /ireless connections 6%)/A9 (2 Pountain0 !ick 6<++#92 The New en!uin "ictionary o# Com$utin!2 Ne" `orkC Pen5uin )ooks2 IS)N +3#(3+>#3(@4$2 >2 7)asic Components of a Local Area Net"ork 6LAN972 Net"ork)its2net2 $2 Computer Net"orks a Andre" S Tanenbaum0 (th dition2 Pearson ducation;P&I 42 !ata Communications and Net"orkin5 B2 )ehrou= A2 .orou=an2Third dition T%&2 *A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 4@34(

Computer Networks Lab

Dept. Of C.S.E

B2 An n5ineerin5 Approach to Computer Net"orks3S21eshav0 <nd dition0 Pearson ducation I2 Understandin5 communications and Net"orks0 @rd dition0 /2A2 Shay0 Thomson

*A,IN!*A COLL - O. N-- .O* /O% N0 1U*NOOL2 4(34(

You might also like