unit 2 Application Layer PDF

Title unit 2 Application Layer
Author Marwa Barbou
Course Redes De Comunicaciones I
Institution Universidad de Castilla La Mancha
Pages 82
File Size 3.6 MB
File Type PDF
Total Downloads 17
Total Views 130

Summary

The Application
Layer provides
services to the user
● Logical connection
between app layers
on both sides
● But physically,
connection takes
place through the
physical layer...


Description

Version 28/02/17

Computer Networks I

appl i cat i on

t r anspor t net wor k

Appl i cat i onLay er

l i nk physi cal

Most of this presentation was based on the official slides of the Kurose&Ross textbook

Presentation based on slides by Kurose and Ross, Computer Networking: A Top-Down Approach available at Pearson: http://www-net.cs.umass.edu/kurose-ross-ppt-6e/

Cont ent s ●

Appl i cat i onl ay erpar adi gms



Web/HTTP



POP3,I MAP( eMai l )



DNS



P2P

3

Logi cal connect i on ●





TheAppl i c at i on Lay erpr ov i des s er v i cest ot heus er Logi cal connec t i on bet weenappl ay er s onbot hsi des Butphy s i cal l y , connect i ont akes pl acet hr ought he phy si cal l ay er

Appl ay erpr ot ocol defi nes ●

Ty pesofmes s ages ex changed, ●



Mes sagesy nt ax : ●



e. g. ,r eques t ,r es pons e whatfi el dsi nmes s ages&how fi el dsar edel i neat ed

Publ i c domai npr ot ocol s : ● defi nedi nRFCs ● al l owsf ori nt er oper abi l i t y ● e. g. ,HTTP,SMTP,I MAP

Pr opr i et ar ypr ot ocol s : ● e. g. ,What s App,Sky pe meani ngofi nf or mat i oni nfi el ds Rul esf orwhenandhow pr oces sess end&r es pondt o mes s ages Mes sagesemant i cs ●



5

Cl i ent s er v erpar adi gm cl i ent s : ●

c ommuni c at ewi t hs er v er

s er v er : ●



maybei nt er mi t t ent l yc onnec t ed



mayhav edy nami cI Paddr es s es



donotc ommuni cat edi r ect l ywi t heachot her





al way s onhos t

per manentI Paddr es s , por tl i s t eni ng di ffic ul tt os c al e –

Ser v erf ar ms

6

Peer t opeerpar adi gm ● ● ● ●

noal way sonser v er ar bi t r ar yends y st emsdi r ect l ycommuni cat e peer sar ei nt er mi t t ent l yconnect edandchangeI Paddr es ses Hi ghl yscal abl ebutdi fficul tt omanage

7

Hy br i dofcl i ent s er v erandP2P Sky pe ● ● ●

I nt er nett el ephonyapp Fi ndi ngaddr es sofr emot epar t y : cent r al i z eds er v er ( s ) Cl i ent c l i entconnect i oni sdi r ect( nott hr oughs er v er )

I ns t antmes sagi ng ● ●

Chat t i ngbet weent wous er sc anbeP2P Pr es enc edet ec t i on/ l ocat i oncent r al i z ed: – –

Us err egi st er si t sI Paddr es swi t hcent r al s er v erwheni tcomesonl i ne Us ercont act scent r al s er v ert ofi ndI Paddr es s esofbuddi es

8

Whatt r anspor tser vi cedoesanapp need? Bandwi dt h Dat al oss ● s omeapps( e. g. ,audi o)can ● s omeapps( e. g. ,mul t i medi a) t ol er at es omel oss r equi r emi ni mum amountof ● ot herapps( e. g. ,fi l et r ansf er , bandwi dt ht obe“ eff ect i v e” t el net )r equi r e100% r el i abl e ● ot herapps( “ el ast i capps ” ) dat at r ansf er makeus eofwhat ever bandwi dt ht heyget Ti mi ng ● s omeapps( e. g. ,I nt er net t el ephony ,i nt er act i vegames) r equi r el owdel ayt obe “ eff ect i ve”

9

Tr ans por ts er v i cer equi r ement sofc ommonapps

Application

Data loss

Bandwidth

Time Sensitive

file transfer e-mail Web documents real-time audio/video

no loss no loss no loss loss-tolerant

no no no yes, 100’s msec

stored audio/video interactive games instant messaging

loss-tolerant loss-tolerant no loss

elastic elastic elastic audio: 5kbps-1Mbps video:10kbps-5Mbps same as above few kbps up elastic

yes, few secs yes, 100’s msec yes and no

10

I nt er nett r anspor tpr ot ocol ss er v i ces TCPs er vi ce: ●









UDPs er v i ce:

● con nec t i onor i ent ed:s et upr equi r ed unr el i abl edat at r ans f erbet ween bet weencl i entands er v erpr oces s es s endi ngandr ecei v i ngpr oces s ● r el i abl et r ans por tbet weens endi ng doesnotpr ov i de: connect i ons et up, andr ec ei v i ngpr oces s r el i abi l i t y ,fl owcont r ol ,conges t i on c ont r ol ,t i mi ng,orbandwi dt h fl owcont r ol :s enderwon’ tov er whel m guar ant ee r ecei v er conges t i oncont r ol :t hr ot t l es ender whennet wor kov er l oaded Q: whybot her ? Whyi st her eaUDP? doesnotpr ov i de:t i mi ng,mi ni mum bandwi dt hguar ant ees

11

I nt er netapps :appl i cat i on,t r anspor tpr ot ocol s

Application e-mail remote terminal access Web file transfer streaming multimedia Internet telephony

Application layer protocol

Underlying transport protocol

SMTP [RFC 2821] Telnet [RFC 854] HTTP [RFC 2616] FTP [RFC 959] proprietary (e.g. RealNetworks) proprietary (e.g., Vonage,Dialpad)

TCP TCP TCP TCP TCP or UDP

typically UDP

12

WebandHTTP

13

Wor l dWi deWeb

RFC 1946 2616



Dev el opedi nt heCERNbyTi m Ber ner s Leei n1989



TheWWW i sahugecl i ent s er v erdi s t r i but eds er v i ce



Defi ni t i ons: ●

Webpages : document sdi s t r i but edal l ov ert heI nt er net



Si t e: l oc at i onpr ov i di ngwebpages





Hy per medi a: l i nkedobj ect si ns i dewebpages( t ex t , audi o,v i deo,. . ) Br ows er : cl i entt ool t odi s pl aywebpages

14

Webbr ows er ●

Di s pl ay swebpages( webcl i ent )



Thr eecomponent s ● ● ●

Cont r ol l er Cl i entpr ot oc ol s I nt er pr et er s

15

Uni f or m Res our ceLocat or( URL) ●

Eachobj ecti nt henet wor ki suni quel yi dent i fi edby anURL ● ● ● ●

Met hod: cl i entpr ot oc ol us ed Host : I Porhos tname Por t : oft hewebs er v i c ei nt heser ver( 80bydef aul t ) Pat h: t ot heobj ec ti ns i det hewebser ver

http://www.someschool.edu/someDept/pic.gif host name Exampl es:

path name

http://localhost:631 ftp://ftp.rediris.es/mirror 16

Webdoc ument s ●

Gr oupedi nt o3cat egor i es ●

St at i c – – –

Document ss t or edi nt hes er ver Cl i entget sacopy Languagesused: ●

● ●

St at i cwebpager eques t

HTML,XML,XSL,XHTML

Dy nami c Act i ve

17

Webdoc ument s ●

Dy nami cdocument ●





Cr eat edbyt hes er ver uponr eques t Mayvar yf r om r eques tt o r eques t Pr ogr amsus ed: – – –

CommonGat eway I nt er f ace-CGI( obs ol et e) Jav aSer v erPages( JSP) Ac t i v eSer v erPages( ASP) Dy nami cwebpager eques t

18

Webdoc ument s ●

Act i v ewebpage ●



Pr ogr am r unsi nt he cl i ent Cl i entpr ogr ams – –

Jav aappl et s Jav aScr i pt

Ac t i v ewebpager eques t

19

HTTPov er v i ew ●

Us esTCPast r ans por tpr ot ocol : ●

c l i enti ni t i at esTCPconnect i ont os er v er ,por t80



s er v eraccept sTCPconnect i onf r om cl i ent







HTTPmes s agesex c hangedbet weenbr ows erandWeb s er v er TCPconnec t i oncl os ed

HTTPi sst at el ess ●

s er v ermai nt ai nsnoi nf or mat i onaboutpas tcl i ent r eques t s

20

HTTPconnect i ons ●

Nonper si st entHTTP ●





Atmos toneobj ec ti s s entoveraTCP connect i on Anewconnec t i onper eachobj ec ti nt heweb page HTTP/ 1. 0us es nonper s i s t entHTTP



Per si st entHTTP ●



Mul t i pl eobj ect scanbe s entov ers i ngl eTCP connect i onbet ween cl i entandser ver . HTTP/ 1. 1us es per si s t entconnect i onsi n def aul tmode

21

Nonper s i s t entHTTPconnect i on ●

Ex ampl e: ht ml fi l ewi t ha l i nkt oani mage ●





Eachconnect i on i mpl i es3TCPmsgs. Requestsenti nt he3rd one Newconnect i onf or ever yobj ect – –

1f ort heht ml 1f ort hei mage

22

Per s i s t entHTTPconnect i on ●

Sameex ampl e: ●

Onl yoneconnec t i on



I mager eques ts ents epar at el y

23

HTTPmes s agef or mat ● ●

Twot y pesofHTTPmes sages :r equest ,r esponse HTTPr eques tmess age: ●

ASCI I( humanr eadabl ef or mat )

4s ec t i ons

24

HTTPr eques tmes s age Met hod: ( GET,POST,HEADcommands )

GET /somedir/page.html HTTP/1.1 Host: www.someschool.edu User-agent: Mozilla/4.0 Connection: close Accept-language:fr (extra carriage return, line feed)

Car r i ager et ur n,l i nef eed i ndi c at esend ofmes s age 25

HTTPr eques tmes s age ●

Someoft hemet hodt y pes( notacompl et el i s t ) : ●

GET: r eques tar es our ce – –

Mostused. Empt ybody Mayupl oadi nf or mat i onus i ngt heURLpar amet er soft her equestl i ne ●



HEAD: r eques tonl yi nf oaboutt hedocument – –



Ex : l astmodi fi cat i ont i me Empt ybodyi nt her es pons e

PUT: s endsadocumentt ot hes er v er( onl yHTTP1. 1) –



http://www.somesite.com/animalsearch?monkeys&banana

I nver s eoft heGET

POST: sendsi nf or mat i ont ot hes er v er –

Sendsi nf or mat i ont obeaddedt ot hewebpage,ort omodi f yi t ● ●

Ex . : webpagewi t hani nputf or m I nputi supl oadedi nt hebody ,notaspar toft heURL 26

HTTPr eques tmes s age ●

Requestheader : ● ●

Opt i onal ,f r om 0t os ev er al l i nes Addi t i onal i nf or mat i onsentt ot hes er v er Header

Descr i pt i on

User agent

I dent i fi est hecl i entpr ogr am

Accept

Showst hemedi af or matt hecl i entcanaccept

Accept c har s et

Showst hechar ac t ersett hecl i entcanhandl e

Accept encodi ng

Showst heencodi ngs chemet hecl i entcanthandl e

Accept l anguage

Showst hel anguaget hecl i entcanaccept

Aut hor i z at i on

Showswhatper mi s si onst hecl i enthas

Host

Showst hehostandpor tnumberoft hecl i ent

Dat e

Showst hecur r entdat e

Upgr ade

Spec i fi est hepr ef er r edcommuni cat i onpr ot ocol

Cooki e

Ret ur nst hecooki et ot heser v er

I f Modi fi edSi nce

I ft hefi l ei smodi fi cedsi nceaspec i fi cdat e 27

HTTPr es pons emes s age

HTTP/1.1 200 OK Connection: close Date: Thu, 06 Aug 1998 12:00:15 GMT Server: Apache/1.3.0 (Unix) Last-Modified: Mon, 22 Jun 1998 …... Content-Length: 6821 Content-Type: text/html data data data data data ...

dat a, e. g. ,r eques t edHTMLfi l e

28

HTTPr es pons es t at uscodes ●

Af ews ampl ecodes: ●

200 OK –



301 Moved Permanently –



r eques tmes s agenotunder s t oodbys er v er

404 Not Found –



r eques t edobj ectmov ed,newl ocat i ons pec i fi edl at eri nt hi smes s age ( Loc at i on: )

400 Bad Request –



r eques ts ucceeded,r eques t edobj ectl at eri nt hi smes s age

r eques t eddoc umentnotf oundont hi ss er v er

505 HTTP Version Not Supported

29

HTTPr eques tmes s age ●

Res pons eheader : ● ●

Opt i onal ,f r om 0t os ev er al l i nes Addi t i onal i nf or mat i onsentf r om t heser v er Header

Descr i pt i on

Dat e

Showst hecur r entdat e

Upgr ade

Spec i fi est hepr ef er r edcommuni cat i onpr ot ocol

Ser ver

Gi v esi nf or mat i onaboutt heser ver

Set Cooki e

Theser v eras kst hecl i entt os aveacooki e

Cont ent Encodi ng

Spec i fi est heencodi ngscheme

Cont ent Language

Spec i fi est hel anguage

Cont ent Lengt h

Showst hel engt hoft hedoc ument

Cont ent Ty pe

Spec i fi est hemedi at y pe

Locat i on

Toaskt hecl i entt os endt her eques tt oanot hersi t e

Accept Ranges

Theser v erwi l l acceptt her equest edby t er anges

Last modi fi ed

Gi v est hedat eandt i meoft hel astchange 30

HTTPGETr eques tex ampl e ●

Thecl i entr et r i ev esani mage ●



Mayacc eptgi f&j pegf or mat s

Thes er verpr ov i dest hei mageencoded( MI ME)

31

HTTPGETr eques t Regul arGET

DIY

$ ncat example.org 80 GET / HTTP/1.1 Host: example.org HTTP/1.1 200 OK Cache-Control: max-age=604800 Content-Type: text/html Date: Tue, 21 Feb 2017 10:13:07 GMT Etag: "359670651+ident" Expires: Tue, 28 Feb 2017 10:13:07 GMT Last-Modified: Fri, 09 Aug 2013 23:54:35 GMT Server: ECS (iad/182A) Vary: Accept-Encoding X-Cache: HIT Content-Length: 1270

Example Domain […]

Confi abi l i dadyc ont r ol defl uj o

32

DIY

301Mov edper manent l y $ curl -Lvs -o /dev/null google.es > GET / HTTP/1.1 > Host: google.es > User-Agent: curl/7.52.1 > Accept: */* > < HTTP/1.1 301 Moved Permanently < Location: http://www.google.es/ < Content-Type: text/html; charset=UTF-8 < Date: Tue, 21 Feb 2017 11:50:24 GMT < Expires: Thu, 23 Mar 2017 11:50:24 GMT < Cache-Control: public, max-age=2592000 < Server: gws < Content-Length: 218 GET / HTTP/1.1 > Host: www.google.es > User-Agent: curl/7.52.1 > Accept: */* > < HTTP/1.1 200 OK < Date: Tue, 21 Feb 2017 11:50:24 GMT < Cache-Control: private, max-age=0...


Similar Free PDFs