0% found this document useful (0 votes)
21 views

application layer

Details note on application layers
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

application layer

Details note on application layers
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

APPLICATION LAYER

DNS(DOMAIN NAME SYSTEM)

● Since ea ch com p ut er c onnec ted to Interne t h a s IP a ddre ss


● So w h e n Inte rnet w a s de ve lop ed th en w e nee d this a dd ress o f c om pu te r to a cce ss a ny inform a tio n
prese nt on it
● Bu t h u m a n brain ca n re m em be r na m es rat he r th a n nu m be rs
● So ea c h co m pu ter w a s give n a unique name a nd u se r u ses this na m e to a cc ess inform a tion
● Bu t interna lly th is na m e m u st be mapped to IP address a nd for th is m ap ping in e a rly d a ys of Internet
hosts.txt file w a s u sed w h ic h w a s h a v ing o nly tw o c olu m ns th a t is na m es a nd IP a d dresse s
● W e ca n im a g ine th a t this pro ce ss is sim ila r to phonebook of m ob ile .
● Th is file w a s store d o n ev ery h ost c onnec ted to Inte rne t a nd it w a s periodica lly u pda te d from m a ste r h ost
file w h ich w a s store d a t sp ec ific c om pu te r
● To da y h ow ev er it is im po ssible to h a ve one single h ost file t o re la te ev ery a d dress w ith na m e a nd v ice
ve rsa be ca u se o f tw o rea sons:
1. S iz e o f file w ill be ve ry la rg e
2. It is im possible to u pda te ch a nge s in th is file a s th is c h ang e m u st be broa dc a st to ea ch a nd ev ery
ho st
● Better solution is to div ide th is h u g e a m ou nt o f info rm a tion into sm a lle r pa rts a nd store e ac h pa rt on
diffe rent c om pu te r
● Sa m e pa rts a re store d on m u ltip le com p u ters to pro vide fault tolerance.
● H ost th at nee d m a pp ing c a n co nta c t closest computer h olding th a t inform a tion.
● Th is m eth od is kno w n a s DNS (Domain Name System)
● It u ses distributed database a pp roa ch
● It is a n application layer protocol a nd use s UDP a s tra nsport la yer proto co l a nd p ort nu m be r is 53.

NAMESPACE
● W e m ust a ssign a uniqu e na m e to ea ch IP a dd ress so th a t m a pp ing b ec om e possib le
● Se t of a ll th ese u niqu e na m es w h ich a re a ssig ne d to IP a ddre ss a re ca lled na m e spa ce

Types of name space


1. Flat namespace
● A s th e na m e su g gests th ere w a s no link betw ee n na m e s a nd this w a s u se d in h osts.txt file
● B u t it is v ery d iffic u lt to m a nag e in tod ay Inte rnet as w e nee d a central authority w h ic h w ill m a na ge a ll
th ese na m es a nd gu a ra ntee th ere u niqu e ness.
2. Hierarchal namespace
● Ea c h na m e is m a de of sev era l pa rts.
● T h e first p a rt ca n define natu re of orga niza tion, se cond ca n d efine th e na m e o f o rga nisa tio n a nd th ird
ca n d efine dep a rtm ents in orga niz a tion and so on.
● S o h e re C entra l a u th ority w ill be respo nsible for a ssig ning o nly na tu re a nd na m e o f orga nisa tio n a nd
th is o rga niz a tion itself c a n a ssign na m es to its de pa rtm ents and co m pu ter inside de pa rtm e nt
● S o C e ntra l a u th ority only assign part of name a nd not entire na m e for ex a m ple na tu re is co m m e rcia l
org a niza tio n (.c om ) and na m e is C isc o.
● N o w C isco w ill give na m e to de pa rtm ent like “ sa les” a nd give na m e to co m pu ter in sa le s
de pa rtm ent as “ a bc”
● D om a in nam e of “ a bc ” co m pu ter w ill be abc.sales.cisco.com.
● A lso note th a t oth e r org a nisa tions w ill a lso ha v e “ sa les” dep artm e nt a nd c a n h a ve co m pu ter nam e
“ a bc ” bu t a s a w h ole d om a in na m e w ill be u niqu e fo r ex a m ple abc.sales.cisco.com a nd
abc.sales.tcs.com.
● T h is h ie ra rch ic a l na m esp a ce is u se d in D N S
DOMAIN NAME SPACE
● T o h a v e h iera rch ica l na m e spa ce in D N S domain name space w a s de signe d.
● In th is d esig n th e na m e s a re defined in inverted tree stru ctu re w ith th e ro ot o n th e to p.

● T h e tre e ca n h a ve 12 8 lev el (0 to 1 27) e ac h nod e in a tree h a s a label w h ic h is a string o f u p to 63


characters
● T h e ro ot la bel is N u ll or e m pty string.
● D N S requ ires th a t c h ild ren o f a no de (sib ling s) h a v e different labels w h ic h gu a ra ntee u niqu e ness o f
do m ain na m es.
● A domain name is se qu ence o f lab els sep ara te d b y do ts.
● D om a in nam e s a re a lw a ys re a d from th e nod e u p to th e roo t a nd m a x im u m siz e ca n be 255
ch a ra c ters a nd th ese a re case insensitive.

D om a in nam e s a re of two types:


1. Fully Qualified Domain Name(FQDN)
● D om a in nam e w h ic h ends with null string i.e. d ot (.) is ca lled fully qualified domain name fo r e.g.
“ abc.sales.cisco.com.”
● A n FQ D N is a dom a in na m e th a t co nta ins th e fu ll na m e o f a h o st.
● It co nta ins a ll la be ls, from th e m ost sp ec ific to th e m ost g enera l, th a t u niqu e ly d efine th e na m e o f t he
h ost.

● For ex am p le, th e d om a in na m e

challenger.atc.fuda.edu.

is the FQ D N of a co m pu ter nam e d insta lle d a t the A d va nce d T e ch nolo gy C e nter (A T C ) a t


D e A nza C olle ge .

● A DNS server can only match an FQDN to an address.

● N o te t ha t th e na m e m ust end w ith a nu ll la b el, bu t be ca u se nu ll m e a ns noth ing, th e lab el ends w ith a dot (.
).

2. Partially Qualified Domain Name(PQDN)


● D om a in nam e w h ic h do es not end with null string is ca lled pa rtia lly q ua lified dom a in na m e .
● A P Q D N sta rts from a nod e, b u t it doe s not re a ch th e roo t.
● It is use d w h en th e na m e to be reso lv ed belongs to th e sa m e site a s the c lie nt .
● H e re th e re solv er(D N S c lie nt) c a n su pply th e m issing pa rt, c a lle d th e su ffix , to c rea te a n FQ D N .
● For ex a m ple , if a u ser a t th e fh da .ed u. site w a nts to get th e IP a ddre ss of th e ch a llenge r co m pu ter, h e o r
sh e
ca n d efine th e p art ia l na m e
challenger
● T h e D N S client ad ds th e su ffix a tc.fh d a .e du . be fore p assing th e a ddre ss to th e D N S serv er.
● T h e D N S client no rm a lly ho lds a list of su ffixe s. T he follow ing ca n b e th e list of su ffix es a t D e A nz a
C olleg e.

● T h e nu ll su ffix de fine s noth ing . Th is su ffix is a d ded w h e n th e u se r de fine s a n FQ D N .


● F ig ure b elo w sh o w s so m e FQ D N s a nd P Q D N s .
DNS IN INTERNET

In th e Inte rnet, th e do m a in na m e spa c e (tre e) is d ivided into th ree different sec tions:
1. Generic domains
2. Country domains
3. Inverse domain

NOTE:
H e re arpa , org , co m , in ... a ll th e se a re c alled a s top level domains.

Generic Domains
● T h e generic domains d efine registere d h osts a cco rding to the ir gene ric beh a v iou r.
● T h e first lev el in th e ge ne ric do m ains sec tion allow s14 p ossib le la be ls.
● T h ese la be ls d escribe th e o rga niz a tion ty pes a s liste d in T a ble be low .
Country Domains
● T h e c ou ntry d om a ins se ctio n u ses tw o-ch a ra cte r c ou ntry a bb rev ia tio ns (e .g ., in for India , us fo r U nite d
S ta tes). Se co nd la b els ca n be org a niza tiona l, or th ey ca n be m ore spe cific , na tiona l designa tions.
● T h e U nited Sta te s, for e xa m ple, u se s sta te ab bre via tions a s a su b div isio n of u s (e.g., ca .u s for
C a lifornia sta te in U S A ).
● Y e t a noth er ex a m ple ca n b e th e a dd ress w w w .a m a zon.in c a n be tra nsla ted to orga niz a tion a m a z on in
india .

Inverse Domain
● T h e inve rse d om a in is u sed to m a p a n a ddre ss to a na m e .
● T h is m a y h a pp en, for e xa m p le, w h en a se rv er h a s re ce iv ed a req ue st from a c lie nt to do a ta sk.
● A lth ou gh th e serv er h as a file th at co nta ins a list of a u th oriz ed clients, o nly th e IP ad dre ss of th e client
(e xt rac ted fro m th e rec eiv ed IP pa cke t) is listed.
● T h e se rve r a sks its reso lv er to send a qu e ry to th e D N S serv er to m a p a n a ddre ss to a na m e to de term ine
if th e client is on th e a u th oriz ed list .
● T h is typ e o f q u ery is c alled a n inv erse or pointe r (PT R) qu e ry.
● T o h a ndle a p ointe r qu e ry, w e h a ve only one top le ve l (first le ve l) dom a in kno w n a s arpa.
● It w a s t he first d om a in in D N S . O riginally it w a s c a lle d Advance Research Project Agency b ut now it is
ca lled Address and Routing Parameter Area.
● A t se co nd le ve l 2 do m ains a re u se d for inve rse m a p ping i.e. in-a ddr(fo r inv erse a dd ress) a nd ip 6.
● is u sed fo r IPV 4 a nd ip 6 is u sed fo r IPV 6.

DISTRIBUTION OF NAMESPACE
● It m ea ns th a t ho w th is h u ge am o u nt of inform a tion is distribu te d o ve r serv ers.
● P a rt of tree m a na ge d by serv er is c a lle d its zone and it is a lw a ys contiguous pa rt of tree .
● W e h a ve not stored th is entire inform a tion at one pla c e to a vo id single po int o f fa ilu re a nd re spond ing
req u est from a ll o ve r th e w orld plac es h ea vy loa d on syst em .

TYPES OF SERVERS
1. Non Authoritative
2. Authoritative

Non Authoritative
● It h a s no DNS database i.e . it h a s no entry for IP a dd ress and na m e for a ny orga niz a tion.
● It is also kno w n a s cache only servers b ec a use to serv ic e a ny q u ery the y u se s th eir ca c he o r a sk oth e r
serv ers th e sa m e qu e ry or refer th e D N S client to som e oth er serv er.
● Ex a m ple is root server a nd it is type of se rve r w h o's z one is e ntire D N S tre e. A c tu ally it do es no t store
a ny inform a tio n a bou t d om a in b u t it st ores th e IP a ddre ss of d iffere nt serv ers w h ose zo ne is top le ve l
do m ain. Th e re a re se ve ral roo t serv ers in th e Int ernet a nd a ll store s sa m e re du nda nt inform a tio n.

Authoritative
It h a s DNS database and it is of 2 types
1. Primary
2. Secondary

Primary
● It store s file fo r a z one for w h ic h it is resp onsib le.
● It is respo nsible for g enera ting m a inta ining a nd u pd a ting t his z one file .

Secondary
● It tra nsfe r th e co m p let e inform a tio n a bou t zone from a ny o the r se rve r(p rim a ry or sec onda ry) a nd sto re
th e file o n its d isk
● It neith er c rea te s nor u p da te the z one file.
● If u p da tio n is re qu ire d th e n it c a n be do ne only by prim a ry serv er a nd it se nt th e u pda te d file to all
sec onda ry serv ers.
● A lso note th a t w e ca n ha v e only o ne p rim a ry se rve r for z one a nd m a ny se conda ry serv ers for th e sa m e
z one.
● W h e n th e se co nda ry d ow nlo ad s inform a tio n fro m th e p rim a ry, it is c a lle d z one tra nsfe r a nd it is d one
by TC P.

WORKING OF DNS
● W h e n w e type U RL in a d dress ba r o f w eb brow ser like www.google.com it is pa rtia lly qu a lifie d d om a in
na m e (a s it doe s not end w ith a d ot).
● It pa sse s th is a d dress to p rogra m c a lle d resolver (D N S c lie nt) a nd it first conv ert it into FQ D N tha t is
www.google.com.
● N o w it w ill first c h ec k in D N S ca c he th a t is tem p ora ry m e m ory o r bu ffe r fo r th e m ap ping . If entry is
pre sent th e n co rresp onding IP a d dress is g ive n to w eb bro w ser. E ntry is pre sent if re ce ntly w e b
bro w ser h as ope ned th a t pa ge . T his entry is tim ed ou t a fter so m e tim e.
● If e ntry is a bsent th en th is resolve r w ill se nd th is qu e ry to loc a l D N S serv er (a ddre ss of th e serv er is
pre sent in T C P/IP setting s a nd is u pd ate d b y D H C P serv er w h en m /c is c onnec ted to internet)
● N ow th is se rve r w ill first ch ec k in its c a ch e if m ap ping is p rese nt th en it send s co rrespo nding a ddre ss to
resolve r a nd it send s to w eb bro w ser.
● Bu t if e ntry is not p rese nt th en it w ill se nd q ue ry to root server.
● Root serv er ha s IP a dd ress of all to p lev el dom a in se rve rs o nly so it d oes not h a v e IP a ddre ss of
w w w .go ogle.co m
● So it w ill send IP ad dre ss of serv er w h ose do m a in is .co m th a t is it partially solve the query.
● N ow loc a l D N S w ill se nd q ue ry to .com serv er a nd it w ill send IP a d dress of D N S se rve r of G oo gle
orga niz a tion bec a u se .co m serv er don't store IP a ddre sses of h osts of G o ogle orga nisa tion
● N ow a ga in loca l D N S se rve r se nd qu e ry to th is G o ogle D N S serv er w h ich ha s IP a dd ress of w w w , m a il,
plu s e tc ho sts of G oo gle a nd it w ill se nd IP a dd ress o f w w w .go ogle .com now it is fully solved.
● N ow qu e ry is resolve d a nd loc al D N S serv er se nd re ply to re solv er a nd th is resolve r re plie s to w eb
brow ser

DNS QUERY
W e h a ve 3 type s of D N S qu erie s
1. Reverse lookup query
● It is use d for rev erse pro cess i.e. IP to d om a in na m e
2. Recursive query
● W h e n client d o th is th en se rve r h a s to giv e definitive answer th a t is if na m e ex ists the n IP a ddre ss
oth e rw ise error m e ssag e m u st be giv en.
● D N S serv er c a n't re fe r c lie nt to a ny oth er D N S serve r
● G ene ra lly rec ursive qu e ries a re se nt by end dev ic es to lo ca l D N S serv er.
3. Iterative query
● D N S client a llow s t he D N S serv er to re turn best answer it m a y be definitive or not.
● S o no w D N S serv er c a n send IP o f ano th er D N S serv er a lso a nd client w ill req ue st th e sa m e q u ery t o it
● For ex am p le a s see n in w orking of D N S a ll 3 qu eries from loca l D N S se rve r a re ite rative qu e ries.
● T h is p roce ss is also c a lle d walking the tree.

DNS ANSWER TYPES


T h ere a re 4 types of a nsw ers g iv en b y D N S se rv er to D N S c lie nts.
1. Negative
● It is th e e rror m e ssa ge giv en b y se rve r if na m e d oes not e xists.
2. Authoritative
● If se rv er g ive de finitiv e a nsw e r a fter se a rch ing fro m its o w n d ata b a se.
● For e.g. a s se en in D N S w o rking, goog le serv er reply to ou r loca l D N S se rve r.
3. Non authoritative
● Re ply to q ue ry is give n by no t sea rc h ing its ow n da ta ba se.
● For e.g. a s se en in D N S w o rking, loc al D N S serv er re ply to re solve r.
4. Referral
● A nsw e r w h ic h give IP of oth er D N S se rve rs.
REGISTRARS
H o w a re new dom a ins a dde d to D N S ? Th is is d one thro u gh a re gistra r, a co m m e rcial org a niza tion a cc red ited
by ICANN. A registra r first v erifie s th a t th e requ e sted do m a in na m e is u niqu e a nd th en enters it into th e D N S
da ta ba se . A fee is c h a rged .
T oda y, th ere a re m a ny registra rs; th e ir na m es and a ddresses ca n be fou nd a t
h ttp ://w w w .inte nic.net
T o re giste r, th e org aniza tio n nee ds to giv e th e na m e of its se rve r a nd the IP a ddre ss of th e serv er. Fo r
ex a m ple , a ne w c om m erc ia l o rga niz a tion na m ed abc w ith a se rve r na m ed ws a nd IP a dd ress 2 00.20 0.200 .5
nee ds to give th e follow ing inform a tio n to o ne o f t he re gistra rs:
D om a in nam e : W S .w onderfu l.co m
IP a dd ress: 200 .2 00.20 0.5
DYNAMIC DOMAIN NAME SYSTEM (DDNS)
● W h e n th e D N S w a s d esig ned, no one pre dic ted th a t th ere w ou ld be so m a ny a d dress ch a nges.
● In D N S , w h en th ere is a ch a nge , su ch as a dding a new h ost, rem ov ing a h ost, or ch a nging a n IP
a dd ress, th e ch a nge m u st be m a de to th e D N S m a ster file .
● T h ese type s of c ha nge s inv olve a lo t of m a nu al u pda ting.
● T h e size of tod a y's Inte rne t d oes no t a llow for this kind of m a nua l op era tio n.
● T h e D N S m a ster file m u st b e u p da ted dyna m ic a lly.
● T h e D y na m ic D o m ain N a m e S ystem (D D N S ) th ere fo re w as de vise d to re spond to th is nee d.

REMOTE LOGGING
● In th e Inte rnet, u se rs m a y w a nt to ru n a pp lic a tion p rogra m s a t a rem o te site a nd cre a te re su lts th a t
ca n b e transferre d to th eir lo ca l site.
● For ex am p le, stu dents m a y w a nt to conne ct to th eir u niv ersity co m p u ter la b from th e ir h om e to
a cc ess a p plica tio n prog ra m s fo r do ing h o m e w ork a ssignm e nts or p rojec ts.
● O ne w a y to sa tisfy th a t de m a nd a nd o th ers is to crea te a c lie nt/se rve r a pp lic a tion p rogra m for ea ch
de sire d se rvic e.
● H o w ev er, it w ou ld be im po ssible to w rite a sp ec ific c lie nt/se rve r p rogra m for e a ch d em a nd.
● T h e b ette r solution is a general purpose client/server program th a t lets a u ser a c ce ss a ny a pp lic ation
pro gra m on a rem ot e c om pu te r; in oth er w ord s, a llo w th e u ser to lo g o n to a rem ote c om pu te r. A fte r
lo gging on, a use r c a n u se th e serv ic es a v a ila b le on th e rem ote c om pu ter a nd tra nsfe r th e resu lts
ba c k to the lo ca l com p u ter.
● P rotoc ol u sed for rem ote lo gin is T EL N ET .

TELNET
● T EL N ET is a n a bbre via tion for TErminaL NETwork
● It is th e sta nda rd T C P/IP prot oco l for v irtu a l term ina l serv ice a s p ropo sed by th e International
Organization for Standards (ISO).
● T EL N ET e nab le s th e e sta blish m e nt of a c onnec tion to a re m ote system in su ch a w a y th a t it a pp ea rs
to be a rem o te syste m th a t it th e loc al term inal of re m o te system .

Timesharing Environment
● T EL N ET w as designed a t a tim e w he n m ost ope ra ting sy stem s, su c h a s U N IX , w e re o perating in a
tim e sh aring e nviro nm ent.
● In su ch a n e nvironm ent, a la rge com p u ter su p ports m ultiple u se rs.
● T h e intera ction be tw e en a u se r a nd th e c om pu ter oc cu rs th rou g h a term inal, w h ic h is usu a lly a
co m bina tio n of keyb oa rd, m onitor, a nd m ou se .
● Ev en a m icro com p u ter c a n sim u la te a term inal w ith a term inal em u la to r.

Logging
● In a tim e sh aring e nviro nm ent, u se rs a re p a rt of th e system w ith so m e righ t to a cc ess re sou rce s.
● T o a c ce ss th e sy stem re sou rce s, th e u ser logs into th e syste m w ith a u ser id a nd pa ssw ord .

Types of logging
W e h a ve 2 type s of lo gging .
1. Local logging:
● W h e n a u ser log s into a loc a l tim esh a ring system , it is c a lle d loca l log -in.
● A s a use r typ es a t a term ina l or a t a w orksta tion ru nning a term ina l em u la to r, th e ke ystroke s a re
a cc ep ted by th e terminal driver.
● T h e te rm ina l d riv er p a sses th e ch a ra ct ers to th e ope ra ting syst em .
● T h e o pera ting syste m , in tu rn, interpre ts th e co m bina tio n of ch a ra cte rs a nd invo kes th e de sired
a pp lic ation p rogra m o r u tility. Figu re be low sh ow s th e logg ing p roce ss.

2. Remote logging
● W h e n a u ser w a nts to a cce ss a n a pp lic a tion p rogra m o r u tility loca te d o n a rem o te m a c h ine, sh e
pe rfo rm s rem o te log-in.
● H e re th e TELNET client and server p rogram s com e into u se.
● T h e u se r send s th e keystro kes to th e terminal driver, w h ere th e loc a l o pera ting syste m a cc epts th e
ch a ra c ters b u t does not interpret th em .
● T h e c h a rac ters a re se nt to th e TELNET client, w hich tra nsform s th e ch a ra cte rs to a u niv ersa l
ch a ra c ter se t
ca lled network virtual terminal (NVT) characters a nd de liv ers th em to th e loc al protocol stack.
● T h e c om m a nds o r tex t, in N V T fo rm , tra ve l th ro ug h th e Inte rnet a nd a rriv e a t th e T C P /IP sta ck a t th e
rem o te m a c h ine.
● H e re th e c h ara c ters are d elive red to th e op era ting system and pa sse d to th e TELNET server, w h ic h
changes th e ch a ra cte rs to th e c orre sponding c ha ra c ters und ersta nda ble b y th e rem ot e c om pu te r.
● H o w ev er, th e c h a rac ters cannot be passed dire ctly to t he op era ting syste m bec a u se th e re m o te
op era ting
syste m is not designed to receive ch a ra c ters from a TE LN E T serv er: It is designed to re ce iv e
ch a ra c ters from a term ina l driv er.
● T h e so lu tion is to a dd a pie ce of softw a re ca lled a pseudoterminal driver w h ich p rete nds th a t th e
ch a ra c ters a re co m ing from a term ina l.
● T h e o pera ting syste m th en p a sses th e ch a ra c ters to th e a ppro pria te a pplica tion pro gra m . B elo w
figu re ex pla ins th e c once pt.
Network Virtual Terminal
● T h e m e ch a nism to a cc ess a rem ote co m pu ter is c om plex .
● T h is is so b ec au se ev ery co m pu ter and its ope ra ting syst em a cc ep t a spe cia l c om bina tio n of
ch a ra c ters a s tokens. For ex a m ple , th e e nd-of-file toke n in a com p u ter ru nning th e D O S o pe rat ing
syste m is C trl+z , w h ile th e U N IX op era ting syste m rec ogniz es C trl+d .
● W e a re dea ling w ith h et erog eneo u s system s.
● If w e w a nt to a c ce ss a ny re m ote com p ut er in th e w orld , w e m u st first know w h a t typ e o f c om pu te r w e
w ill b e c onnec ted to, and w e m u st a lso insta ll th e sp ec ific te rm ina l e m u la tor u se d b y th a t c om pu te r.
● T EL N ET so lve s th is prob lem by d efining a unive rsa l inte rfa c e c a lle d th e network virtual terminal
(NVT) character set. V ia th is interfa ce, th e c lie nt T ELN ET tra nsla te s ch a ra c ters (da ta o r co m m a nd s)
th a t c om e from the lo ca l term ina l into N V T form a nd de liv ers th em to th e ne tw ork.
● A lso note th a t w e h a ve differe nt T ELN ET clients for diffe rent sy stem s w hich c h a ng es th e c om m a nd s
a nd d a ta into N V T ch a ra cte r set.
● T h e se rve r T EL N ET , o n th e oth er ha nd, tra nsla tes d a ta a nd c om m a nds from N VT form into th e fo rm
a cc ep tab le by t he re m ote com p ut er. B elo w figu re ex plains th e conc ept

NVT Character Set


● N V T u ses tw o sets o f c h a ra cters, one for da ta a nd the o the r for c ontrol.
● B oth a re 8-bit byte s. For d ata , N V T is a n 8 -b it c h ara c ter set in w h ic h th e 7 lo w est-ord er bits a re th e
sa m e as A S C II a nd th e h ig h est-ord er b it is 0.
● T o se nd c ontrol ch a ra cte rs b etw e en c om pu te rs (from client to serv er or v ic e v ersa ), N V T u ses an 8-bit
ch a ra c ter se t in w h ich th e h ig h est-orde r b it is set t o l.

● T EL N ET u se s only one TCP connection. T h e serv er u se s th e w ell-know n port 23, a nd t he c lie nt u ses
a n ephemeral port.
● T h e sa m e co nne ction is u sed for sending both data and control characters.
● T EL N ET a c com p lish es th is b y em b edd ing t he c ontrol ch a ra cte rs in the da ta strea m .
● H o w ev er, to d istingu ish da ta from c ontrol ch a ra cte rs, e ac h se qu ence o f c ontrol ch a ra cte rs is
pre ce ded by a spe cia l co nt rol c h a ra cter ca lled interpret as control (lAC).

Disadvantage of TELNET
It do es no t u ses any encryption technique a nd e ve n log in na m e a nd pa ssw o rd a re not e ncryp ted so for
sec u rity rea sons it is not used now a days.

ELECTRONIC MAIL
A t th e be ginning of th e Inte rnet e ra , th e m essa ge s sent by e lec tronic m a il w e re sh ort a nd c onsiste d o f te xt
only . To da y, e lec tronic m a il is m u c h m ore com p lex . It a llo w s a m e ssa ge to inclu d e te xt, au d io, a nd video . It
a lso a llo w s one m essa g e to be sent to o ne or m ore rec ipients.
Architecture
T o e xp la in th e a rch ite ctu re of e -m a il, w e giv e four scenarios. W e b egin w ith t he sim p lest situ a tion and a dd
co m ple xity a s w e proce ed. T h e fo u rth sce nario is th e m o st c om m on in th e e xc h ang e o f e m a il.
First Scenario
● In th e first sce na rio, th e sende r a nd the re ce ive r of th e e-m a il a re u se rs (o r a pp lic at ion p rogra m s) on
th e same system; th ey a re d irec tly conne cte d to a sh a red system .
● T h e a d m inistra tor ha s cre ate d o ne mailbox for e a ch u ser w h ere th e rec eiv ed m essa g es a re store d. A
is pa rt o f a local hard drive, a spe cia l file w ith p erm ission re strict ions.
● O nly the ow ner o f t he m a ilb ox h a s access t o it.
● W h e n A lic e, a u ser, ne eds to se nd a m e ssa ge to B ob , a noth er u ser, A lice ru ns a user agent (UA)
pro gra m to pre pa re the m e ssag e a nd UA itself w ill sto re it in B ob 's m a ilbox .
● T h e m e ssa ge h as th e se nder a nd re cip ient m a ilbo x a d dresse s (na m e s of file s).
● B ob ca n re triev e and read the contents of h is m a ilbox a t his co nve nienc e, using a user agent. Fig u re
be low sh ow s th e c once pt.

NOTE:
W h e n th e se nde r a nd th e rec eive r of a n e-m a il a re o n th e sam e syste m , w e nee d only tw o u ser ag ents.

Second Scenario
● In th e s ec o n d s c en a rio , th e s e n d er a n d th e rec eive r o f th e e -m a il a re u s ers (o r a p p lic a tio n
p ro g ra m s ) o n two different systems.
● S o th e m es s a g e n ee d s to b e s e n t o ve r th e In tern e t.
● H ere w e n e ed user agents (UAs) and message transferagents (MTAs), a s s h o w n in fig u re
b e lo w .
● A lice nee ds to u se a user agent p rogra m to send h er m e ssa ge to th e syste m at her own site.
● T h e c om pu te r (som etim e s c alled th e mail server) a t h e r site m a na ges a ll th e m essa g es re ce ive d and
m a kes a mail queue to sto re m e ssa ge s w a iting to be sent.
● M T A client kee ps on ch ec king th e q ue u e a nd w h en th ere is m e ssa ge the n it w ill try to e sta blish
co nnection w ith M T A serv er a nd w h e n co nne ction is esta blish ed th en it pick th e m essa ge s from
qu e u e a nd send the m ov er interne t to M TA serv er w h ich is ru nning at system from w h ich bob is
co nnecte d.
● M T A serve r a fte r rec eiving m essa g es w ill store th em a t m a il bo x of bob .
● Like m o st client/se rve r pro gra m s on the Interne t, th e serv er ne eds to ru n a ll th e tim e be ca u se it do es
not kno w w he n a c lie nt w ill a sk for a conne ctio n.
● B ob also ne eds a user agent prog ram to re trie ve m essa ge s stored in th e m ailbo x o f the syste m a t h is
site .
NOTE:
W h e n th e se nde r a nd th e rec eive r of a n e-m a il a re o n diffe rent system s, w e ne ed tw o U A s a nd a pa ir o f M T A s
(c lie nt a nd se rv er).

Third Scenario
● In th e third s c en a rio , B o b , a s in th e s ec o n d s c en a rio , is d irec tly c o n n ec te d to h is s ys te m .
● A lic e , h o w e ve r, is s ep a ra te d fro m h e r s ys tem .
● E ith er A lic e is c o n n ec te d to th e s ys tem v ia a p o in t-to -p o in t W A N , s u c h a s a d ia l-u p m o d em , a
D S L , o r a c a b le m o d em ; o r s h e is c o n n ec ted to a LA N in a n o rg a n iza tio n th a t u s es o n e m a il
s erv er fo r h a n d lin g e-m a ils -a ll u s ers n ee d to s en d th e ir m e s s a g e s to th is m a il s e rve r. F ig u re
b e lo w s h o w s th e s itu a tio n .
● A lice still nee ds a u se r a ge nt to prep a re h e r m essa g e. S h e th e n nee ds to send th e m e ssa ge th rou gh th e
LA N o r W A N . Th is ca n b e d one th rou gh a p a ir o f m e ssa ge tra nsfer a gents (client a nd serv er).
● W h e nev er A lice h a s a m e ssa ge to se nd, sh e ca lls th e use r a ge nt w h ic h , in tu m , ca lls th e M T A c lie nt. Th e
M T A client esta blish es a conne ctio n w ith th e M T A se rve r on th e syste m , w h ic h is ru nning a ll th e tim e.
● T h e m a il serv er co m p u ter a t A lic e's site m a na ges a ll m e ssa ges rec eiv ed a nd m a kes a m a il qu eu e . M T A
client kee ps on ch ec king this qu e u e a nd w h ene ve r th ere a re m essa ge s to send it e stab lish e s a
co nnection w ith M T A serv er a t B ob's site a nd se nds th e m essa g es. T h is se rve r re ceive s th e m essa ge s
a nd sto res it in Bob 's m ailbo x.
● A t h is co nv enience , B ob u ses h is u ser a g ent to retriev e th e m essa g e a nd rea ds it.
NOTE:
W h e n th e se nde r is c onnec ted to the m a il serv er via a LA N or a W A N , w e nee d tw o U A s and tw o pa irs of
M T A s (client a nd serv er).

Fourth Scenario
● In th e fou rth a nd most common scenario, B ob is a lso co nnecte d to h is m ail se rve r by a W A N or a LA N .
A fter th e m essa g e h a s a rrive d a t B ob 's m a il se rve r, Bo b ne eds to re trie ve it.
● W e c an’ t use s o f M T A c lie nt a t B ob com p u ter M T A se rve r a t m a il se rve r co m pu ter. T h is is be ca u se
M T A client is push program w h ic h pu sh es th e m e ssa ges to M T A se rve r, it ca n’ t p ull m e ssa ges from
M T A serve r.
● O th er option is u se M T A se ve r a t B ob co m p u ter w h ich is im p ossib le as now B ob ca n’ t shu t dow n
h er com p u ter b ec au se sh e doe sn’ t know w h en m e ssa ge w ill a rriv e.
● H e nce , w e nee d a noth e r set of client/serv er a gents, w h ich w e ca ll message access agents (M A A s).
● U nlike M T A c lie nt, M A A c lie nt is a pull program a nd it c a n pu ll m essa ge s from M A A serv er.
● S ee be low figu re
● S o B ob u ses an M A A client to re triev e h is m e ssag es. T h e client se nds a re qu est to th e M A A se rve r,
w h ic h is ru nning a ll th e tim e, a nd requ e sts th e tra nsfe r of th e m e ssa ge s. Figu re on nex t p a ge sho w s
th e situ a tion.

USER AGENT
T h e first c om po nent o f a n e le ctronic m a il syste m is th e u ser ag ent (U A ) It provide serv ice to th e u se r to m a ke
th e proc ess o f sending a nd re ce iv ing a m e ssa ge ea sie r. Be st know n ex a m ple is Microsoft outlook.

Services Provided by a User Agent


A u se r a ge nt is a softw a re p a cka ge (p rogra m ) th a t c om pose s, re ad s, rep lie s to, a nd forw a rds m essa ge s. It
a lso h a nd les m a ilbo xe s. Figu re be low sh ow s the se rvic es of a typica l use r a ge nt.
User Agent Types
T h ere a re two types o f use r a ge nts
1. Command-Driven
● C om m a nd-drive n u ser a g ents b elo ng to th e early days of electro nic m ail. T h ey are still p rese nt a s th e
u nde rlying u ser a g ents in serv ers.
● A c om m a nd-driv en use r a ge nt norm a lly a cc ep ts a one-character co m m a nd from th e keyb oa rd to
pe rfo rm its ta sk. Fo r ex a m ple , a u ser ca n typ e th e c ha ra c ter r, at th e c om m a nd p rom pt, to reply to th e
send er o f t he m essa g e, o r type th e ch a ra cte r R to re ply to th e se nd er a nd a ll recipie nts.
● S om e ex a m ple s of co m m and -d riv en u ser a gents are mail, pine, and elm.
2. GUI-Based
● M od em u se r a gents a re G U I-ba sed . T he y c onta in g rap h ica l-u se r inte rfa ce (G U I) c om pone nts th a t
a llo w th e u ser to inte ra ct w ith th e softw a re by u sing bo th th e keybo a rd a nd th e m o use .
● T h ey h a v e gra ph ic a l c om pone nts su ch a s ico ns, m enu ba rs, a nd w ind ow s th at m a ke th e serv ic es e a sy
to a cce ss.
● S om e ex a m ple s of G U I-b a sed u ser a ge nts a re Eudora, Microsoft's Outlook, and Netscape.

Addresses
T o d elive r m a il, a m a il h a ndling sy stem m u st u se a n a ddressing system w ith u niq u e a dd resse s. In the Interne t,
th e a ddre ss co nsists of tw o pa rts: a local part and a domain name, separated by an @ sign (se e Fig u re b elo w ).

MIME
● Elect ronic m a il h a s a sim ple stru c ture . Its sim plicity, h ow ev er, c om es a t a price . It ca n se nd m essa g es
only in 7-bit A S C II fo rm a t.
● In oth e r w ords, it h as som e limitations. For e xa m ple, it ca nnot be use d for languages th at a re no t
su pp orted by 7-bit A SC II c h arac ters (su ch as French , G erm a n, H e bre w , Ru ssia n, C hinese, a nd
J a pa nese ).
● A lso , it ca nnot b e u se d to send binary files or video or audio data.
● Multipurpose Internet Mail Extensions (MIME) is a su p ple m enta ry p rotoc ol th at allows non-ASCII
data to be se nt th rou gh e -m ail.
● M IM E tra nsfo rm s non-A S C II d a ta a t th e sende r site to A S C II d a ta a nd d elive rs th em to th e client M T A
to be sent th ro ug h th e Inte rnet. T h e m e ssa ge a t th e rece iv ing side is tra nsform ed ba c k to th e o rigina l
da ta .
● W e c an think of M IM E a s a se t o f so ftw a re func tions tha t transforms non-ASCII data (stream of bits)
to ASCII data and vice versa, a s sh ow n in Fig u re b elo w
● M IM E a llow s se ve n differe nt type s of da ta like a ud io, vid eo , im a ge etc .

Message Transfer Agent: SMTP


● T h e a c tu al m a il tra nsfer is d one throu gh message transfer agents. T o send m a il, a syste m m u st h a ve
th e client M T A , a nd to re ce ive m a il, a syste m m u st h a ve a se rve r M T A .
● T h e form a l proto col th a t de fine s th e M TA client a nd serv er in th e Inte rnet is ca lled th e Simple Mail
Transfer Protocol (SMTP). A s w e sa id be fore , tw o pa irs of M T A client/se rve r pro gra m s a re u sed in
th e m ost c om m on situa tion (fou rth scena rio). Fig u re b elo w sh o w s th e ra nge of th e S M T P proto col in
th is sc ena rio .
● S M TP is u sed two times, be tw e en th e send er a nd th e se nder's m a il serv er a nd be tw e en th e tw o m ail
serv ers.
● It is connection oriented protocol a nd u ses TCP with port number 25.
● S M TP sim ply defines h ow c om m a nds a nd resp onses m u st be sent b ac k a nd forth . M T A c lie nt se n d s
th e c o m m a n d a n d s e rv e r se n d s th e re s p on se s (s e e F ig u re b e low ).

SMTP COMMANDS
HELO. Th is co m m a nd is u se d b y th e client to ide ntify itse lf.
MAIL FROM. Th is co m m a nd is u se d b y th e client to ide ntify th e sende r of th e
m essa g e.
RCPT TO. T h is com m a nd is u sed by th e c lie nt to ide ntify th e intende d re cip ient of
th e m essa ge .
DATA. T his co m m and is u se d to send th e ac tu a l m e ssa ge.
QUIT. T his co m m a nd term inat es th e m essa ge .
RSET. T his co m m and a borts th e c u rrent m a il tra nsa ction.
VRFY. T h is c om m a nd is u sed to ve rify th e a d dress of th e re cipie nt .
NOOP. T h is com m a nd is u sed by th e c lie nt to ch ec k th e sta tu s of th e rec ipie nt
TURN. T h is c om m a nd lets th e send er a nd th e re cipie nt sw itc h po sitio ns, w h ere by
th e sende r be co m e s th e rec ipient a nd vic e ve rsa
EXPN. T h is c om m a nd ca n ve rify th e e xistence of o ne or m ore m a ilbo xe s on the syste m .
HELP. T h is c om m a nd a sks th e re cip ient to se nd inform a tio n a bou t th e co m m a nd
sent a s th e a rg u m e nt.
SEND FROM. T h is c om m a nd sp ecifies th a t th e m a il is to be de liv ere d to th e
term inal of th e rec ipient, a nd no t th e m ailbo x.
SMOL FROM. T h is c om m a nd sp ecifie s th a t th e m a il is to be de liv ere d to th e term ina l
or th e m a ilbox of th e rec ipient.
SMAL FROM. T h is c om m a nd sp ecifie s th a t th e m a il is to be de liv ere d to th e term ina l
a nd th e m a ilb ox of th e recipie nt.

Message Access Agent: POP and IMAP


● T h e first a nd th e se co nd sta ge s of m a il de liv ery use S M T P. H ow e ve r, S M TP is not involve d in th e th ird
sta ge be ca u se SM T P is a push protocol; it pu sh es th e m essa g e from th e client to th e serv er. In o th er
w o rds, th e dire ction of th e bu lk: da ta (m essa ge s) is from th e client to th e serv er.

● O n th e oth er h a nd , th e th ird sta g e ne eds a pull protocol; th e client m ust pu ll m essa ge s from th e serv er.
T h e d irec tio n of th e b u lk da ta is from th e serv er to th e client. The third stage uses a message access
agent.
● C u rrently tw o m essa g e a c cess proto co ls a re a va ila ble : P ost O ffice Pro toc ol, v ersion 3 (P O P 3) and
Internet M a il A c ce ss P rotoc ol, ve rsion 4 (IM A P 4). Figu re be low sh ow s the p ositio n of th ese tw o
pro toco ls in th e m o st co m m on situ a tio n (fou rth sc ena rio ).

POP3

● P ost O ffic e Pro toco l, v ersion 3 (P O P3 ) is sim p le and lim ited in fu nc tio na lity. T h e c lie nt P O P3 softw a re
is insta lle d o n th e re cipie nt co m p u ter; th e serv er P O P 3 softw a re is insta lle d on th e m a il serv er.
● M a il a cce ss sta rts w ith th e client w h en th e u ser ne ed s to d ow nloa d e -m a il from th e m a ilb ox on th e
m a il serv er.
● T h e c lie nt op ens a c onnec tion to th e serv er on TCP port 110.
● It th en sends its user name and password to a cc ess th e m a ilb ox. T h e u ser c a n th en list a nd retriev e
th e m ail m e ssa ges, one b y one . Figu re be low sh ow s an ex a m p le of dow nloa ding u sing PO P 3.
● P O P3 h a s two modes: the delete mode and the keep mode.
● In th e delete m ode , th e m ail is deleted from the mailbox a fter e a ch retrieval. In th e ke ep m ode , th e
m a il remains in the mailbox a fte r retriev a l.
● T h e d ele te m ode is no rm ally u se d w h en th e u ser is w o rking a t he r p erm a nent c om pu te r a nd c a n sa ve
a nd o rga niz e th e rec eive d m a il a fte r re ad ing o r re plying .
● T h e ke ep m ode is norm a lly u sed w h en th e u ser a cce sses he r m a il a w a y from h e r prim ary co m pu ter
(e .g., a la p top). Th e m a il is re a d b ut kep t in th e syste m fo r la ter retriev a l a nd o rga niz ing.

IMAP4
IM A P4 u ses TCP port number 143 a nd prov ide s th e fo llo w ing ex tra fu nct ions w hich a re not p rov ide d b y
P O P3
● A u se r ca n c h ec k th e e-mail header prior to do w nloa ding.
● A u se r ca n search the contents of th e e-m a il for a spec ific string of ch a ra cte rs prior to do w nloa ding.
● A u se r ca n partially download e-mail. T h is is esp ecia lly use fu l if ba ndw idth is lim ited a nd th e e-m a il
co nta ins m u ltim e dia w ith h ig h ba ndw idth re qu ire m ents.
● A u se r ca n create, delete, or rename m a ilb ox es o n th e m a il se rve r.
● A u se r ca n c rea te a hierarchy of mailboxes in a fo lde r fo r e-m a il stora ge .

FILE TRANSFER PROTOCOL


● T ra nsferring file s from one co m pu ter to a noth e r is one of th e m o st co m m o n ta sks e xpe cte d from a
netw orking or internetw orking env ironm e nt . A s a m a tter of fa c t, th e g rea te st v olu m e of da ta e xc ha ng e
in th e Interne t tod ay is d u e to file tra nsfer.
● File Transfer Protocol (FTP) is th e sta nda rd m ech a nism prov ide d b y for c opy ing a file from
one h ost to a noth e r.
● A lth o ug h tra nsfe rring files from o ne syste m to a no th er se em s sim ple a nd straigh tfo rw a rd, som e
pro ble m s m u st be de a lt w ith first. For e xa m p le, tw o sy stem s m a y u se differe nt file na m e co nve ntions.
T w o system s m a y h av e diffe rent w a ys to repre sent t ex t a nd d ata . T w o syste m s m a y h a ve different
direc tory stru c tu res. A ll th ese pro ble m s h a ve be en so lv ed by FT P in a ve ry sim ple a nd elega nt
a pp roa ch .
● FT P diffe rs fro m oth e r client/se rve r a pplica tions in tha t it e sta blish e s two connections between the
hosts. O ne c onnec tion is u sed fo r data transfer, th e o th er for control information (c om m a nds a nd
resp onses).
● S ep ara tion of c om m a nds a nd da ta tra nsfe r m a kes FT P m ore e fficie nt.
● T h e c ontrol co nne ction u ses ve ry sim p le ru les of com m u nic a tion. W e ne ed to tra nsfer only a line of
co m m and or a line of resp onse a t a tim e . T he da ta connec tio n, on th e oth er h a nd , nee ds more
complex ru le s du e to th e v ariety of da ta typ es tra nsferre d.
● H o w ev er, th e d iffere nce in c om plex ity is a t th e FTP level, not TCP. For T C P, b oth c onnec tions are
tre ate d t he sa m e.
● FT P use s tw o w e ll-know n TC P p orts: Port 21 is u sed fo r th e contro l c onnec tion, a nd port 20 is u sed
fo r th e da ta c onnec tion.
● F ig u re b e lo w s h o w s th e b a s ic m o d e l o f F T P . Th e c lien t ha s three components: user interface,
client control process, and the client data transfer process. T h e s e rv er h a s two components:
the server control process and the server data transfer process. T h e c o n tro l c o n n e c tio n is
m a d e b etw ee n th e c o n tro l p ro c e s s es . T h e d a ta c o n n e c tio n is m a d e b etw ee n th e d a ta
tra n s fe r p ro c e s s es .

● T h e control connection remains connected du ring th e e ntire interactive FTP session. T h e da ta


co nnection is opened and then closed for each file transferred . W h en a u se r sta rts a n FT P session,
th e contro l c onnec tion o pe ns. W h ile th e contro l c onnec tion is op en, th e da ta c onnec tion c a n be
op ened a nd c lose d m u ltiple tim e s if se ve ra l file s a re t ransferre d.

Communication over Control Connection


● FT P use s th e same approach as SMTP to c om m u nica te a cro ss th e c ontro l c onnect ion. It u ses th e
7-bit ASCII character set (se e Figu re below ).
● C om m u nic a tion is a ch ie ve d t hro u gh commands and responses
● T h is sim p le m eth od is a d equ a te fo r th e contro l c onnec tion bec a use w e se nd one command (or
response) at a time.
● Ea c h co m m a nd or re spo nse is only one sh o rt line , so w e nee d not w orry a bou t file form a t or file
stru ctu re .
● Ea c h line is term ina ted w ith a tw o -c h a rac ter (c a rria ge retu rn a nd line fe ed ) end-of-line token.
Communication over Data Connection
● File tra nsfe r o ccu rs ov er th e da ta c onnec tion und er th e co ntrol of th e c om m a nds se nt ov er the c ontrol
co nnection. H o w ev er, w e sh ou ld rem em b er th a t file tra nsfer in FTP m e a ns one of three things:
1. A file is to b e c opied fro m th e se rve r to th e client. T h is is ca lled retrieving a file It is d one u nd er th e
su pe rvision o f th e RETR co m m and ,
2. A file is to b e c opied fro m th e c lie nt to th e se rve r. T h is is ca lled storing a file It is do ne u nde r th e
su pe rvision o f th e STOR com m a nd.
3. A list of directory or file names is to be sent from th e serve r to t he c lie nt. T h is is d one u nd er th e
su pe rvision o f th e LIST com m a nd. N ote th a t FT P trea ts a list o f d irec tory or file na m es as a file. It is
sent over the data connection.
● S ince 2 system s c onnec ted m a y not be u sing sa m e file type s so th e c lie nt m u st de fine th e type of file
to be tra nsferred, the stru c ture o f th e da ta , a nd th e tra nsm ission m od e.
● B efore sending th e file th ro u gh th e da ta c onnec tion, w e p repa re for tra nsm issio n th rou gh th e c ontrol
co nnection. S ee figu re below :
File Type
● FT P ca n tra nsfe r one of th e fo llow ing file typ es a c ross th e da ta c onnec tion: an ASCII file, EBCDIC file,
or image file.
● T h e ASCII file is th e default format for transferring text files. Ea ch c h a rac ter is e ncod ed u sing 7 -b it
A S C II. T h e sende r tra nsfo rm s th e file from its ow n rep rese nta tion into A S C II ch a ra cte rs, a nd th e
rec eive r tra nsfo rm s th e A SC II c ha ra c ters t o its ow n repre senta tio n.
● If one or both ends of the connection use EBCDIC encoding (th e file fo rm at u sed by IB M ), th e file ca n
be tra nsfe rred u sing EB C D IC enc oding .
● T h e image file is the default format for transferring binary files. T h e file is sent as continuous
streams of bits without any interpretation or encoding. T h is is m ostly u sed to transfer bina ry file s
su ch a s compiled programs.

Data Structure
● FT P ca n tra nsfe r a file a cro ss th e da ta co nnection b y u sing one of th e follow ing inte rpreta tions a bo u t
th e stru ctu re of th e d a ta : file structure, record structure, and page structure.
● In th e file structure fo rm at, th e file is a continuous stream of bytes.
● In th e record structure, th e file is divided into records. Th is ca n b e used only with text files.
● In th e page structure, th e file is divided into pages, w ith ea c h pa ge h a v ing a p a ge num b er a nd a pa ge
h ea d er.
● T h e p a ges ca n be stored and a cc esse d ra ndo m ly o r seq ue ntia lly.

Transmission Mode
● FT P ca n tra nsfe r a file a cro ss th e da ta co nnection b y u sing one of th e follow ing th ree tra nsm issio n
m od es: stream mode, block mode, and compressed mode.
● T h e stream mode is the default mode. D a ta a re de liv ere d from FT P to T C P a s a continuous stream of
bytes. TC P is resp onsib le for c hopping data into segments of a pp ropriate siz e. If th e da ta a re sim ply
a stre a m of byte s (file stru c tu re), no end-of-file is needed. E nd-of-file in th is ca se is t he c losing of th e
da ta c onnec tion by th e send er. B u t if th e da ta a re div ide d into re cords (rec ord st ruc tu re), ea c h rec ord
w ill h a v e a 1-byte end of rec ord (E OR ) c h a ra cter a nd th e end of th e file w ill ha v e a 1-byte end -o f-file
(E O F) c h a ra cter.
● In blo ck m o de , da ta c an be deliv ered from FT P to T C P in blocks. In this ca se , ea c h block is pre ce de d
by a 3-byte header. T he first b yte is c alled th e block descriptor th e next 2 bytes de fine th e size of the
block in byte s.
● In th e compressed mode, if the file is b ig, th e d at a ca n be c om pre ssed. T h e co m p ression m eth o d
norm a lly u sed is run-length encoding. In th is m e th od, c onse cu tiv e a p pea ra nc es o f a d a ta u nit a re
rep la ce d b y one oc cu rre nce a nd th e num b er o f repe titio ns. In a tex t file , th is is u su ally sp a ces (b la nks).
In a binary file, nu ll c ha ra c ters are u su a lly co m p resse d.

ANONYMOUS FTP
● T o u se FT P, a u ser ne eds a n a cco u nt (u se r na m e) a nd a p a ssw ord on th e rem o te se rve r.
● S om e sites h a ve a set of files av a ila b le for pu blic ac ce ss, to ena ble a nonym ou s FTP .
● T o a c ce ss th ese files, a u ser d oe s not ne ed to h a v e a n a c cou nt or p assw ord. Instea d , th e use r c an u se
anonymous as the user name and guest as the password.
● U se r a cc ess to th e system is very limited. S om e site s a llow a no ny m o u s u sers only a sub set of
co m m and s. For e xa m ple, m o st site s a llo w th e u ser t o c opy som e files, b ut do not a llow na v iga tion
th rou gh th e d irec torie s.
FTP COMMANDS

You might also like