Last lesson Moving beyond individual computers Networks Layer - - PDF document

last lesson
SMART_READER_LITE
LIVE PREVIEW

Last lesson Moving beyond individual computers Networks Layer - - PDF document

11/21/2009 Last lesson Moving beyond individual computers Networks Layer model The Internet IP addresses Domain names 1 11/21/2009 This week Application Protocols Email SMTP, POP, IMAP The Web HTTP


slide-1
SLIDE 1

11/21/2009 1

Last lesson

 Moving beyond individual computers  Networks  Layer model  The Internet  IP addresses  Domain names

slide-2
SLIDE 2

11/21/2009 2

This week

 Application Protocols  Email  SMTP, POP, IMAP  The Web  HTTP

The Layer Model

slide-3
SLIDE 3

11/21/2009 3

Application protocols

 Protocol: set of rules for

communication

 Messages over Internet via application

layer

 Examples...

Email

 Message headers  From, To, Subject, Date, ...  Message body  Actual text, plus attachments

slide-4
SLIDE 4

11/21/2009 4

MIME

Multipu tipurpose

  • se Internet

et Mail Exten ensio sions

 Emails encoded in ASCII  Non-ASCII character sets?  Non-text attachments? (e.g. images)  Non-ASCII data can be MIME encoded  Translated to ASCII  Transmitted as part of email header/body  Header gives decoding information

SMTP Simple e Mail Transf sfer er Prot

  • toc
  • col

 Used to send emails  Extended protocol ESMTP  Client-server communication  Client makes requests, server responds  1. User’s client to local server  2. Local server (as client) to destination

server

slide-5
SLIDE 5

11/21/2009 5

SMTP Finding ding the Destination tination

 account@domain  DNS: MX record for domain is mail

server

 mas02jg@gold.ac.uk  Domain: gold.ac.uk  MX record: mailhub.gold.ac.uk  Sends to destination server via SMTP

SMTP Request uests & Responses

  • nses

Client Requests Server Responses

 End: QUIT  Greeting: HELO,

(ESMTP: EHLO)

 Envelope: MAIL

FROM, RCPT TO

 Data: DATA  2xx (Accept)  3xx, 4xx (Temporary

Reject)

 5xx (Permanent Reject)

slide-6
SLIDE 6

11/21/2009 6

<C initiates connection> S: 220 mail.gold.ac.uk ESMTP Goldsmiths C: EHLO gmail.com S: 250 Hello gmail.com C: MAIL FROM andy@gmail.com S: 250 OK C: RCPT TO: bob@gold.ac.uk S: 250 Accepted C: DATA S: 354 Enter message, ending with “.” <C sends email headers and body> S: 250 OK id=1L4kge-0001ud-SC C: QUIT S: 221 mail.gold.ac.uk closing connection

POP Post st Office ce Prot

  • toc
  • col
  • l

 Used to receive emails  Mail server places emails into account’s

mailbox

 Email client accesses mailbox via POP  Typically move all messages to email client  Some servers allow mail to be left there  But no information kept about emails

slide-7
SLIDE 7

11/21/2009 7

POP Request uest & Responses

  • nses

Client Requests Server Responses

 Security: USER, PASS,

APOP

 Info: STAT, LIST, UIDL  Fetch: RETR, DELE  QUIT  Accept: +OK  Error: –ERR

<C initiates connection> S: +OK POP3 server ready pop.gold.ac.uk C: USER mas03jg S: +OK Name is a valid mailbox C: PASS mypassword S: +OK Mailbox locked and ready C: LIST S: +OK 1 message (321 octets) S: 1 321 S: . C: RETR 1 S: +OK Message follows <S sends message 1> C: DELE 1 S: +OK message 1 deleted C: QUIT S: +OK POP3 server signing off (maildrop empty)

slide-8
SLIDE 8

11/21/2009 8

IMAP Inter erne net t Message age Acces ess s Prot

  • tocol
  • col

 Used to receive emails (alternative to POP)  Emails remain on mail server

 Organised in IMAP mail folders  Knows which have been read or flagged

 Multiple email clients can access server  Can access all your email from different

locations

A sends an email to B and C

slide-9
SLIDE 9

11/21/2009 9

Hypermedia

 Interlinked documents  Text, images,

audio/video

 User chooses own

path by selecting links

 Since 1960s, e.g. NLS  Many single-machine

systems, e.g. Hypercard

The World Wide Web

 A distributed

collection of hypermedia documents

 accessed over the

Internet

 Invented in 1990 by

Tim Berners-Lee at CERN

 URLs, HTTP, HTML  Estimated 100 million

pages by 2008

slide-10
SLIDE 10

11/21/2009 10

URL Un Uniform

  • rm Resour

urce ce Locator

  • r

 Every web page has a URL (an

address)

 http://doc.gold.ac.uk/~mas02jg/fy04/labs/lab

s08.html

 Protocol: http  Domain name of web server: doc.gold.ac.uk  Directory path: ~mas02jg/fy04/labs/  Document file name: labs08.html  Web browser uses URL to fetch page

from server

HTTP Hyper erText xt Transf sfer er Prot

  • tocol
  • col

 Used to access documents over the

Web

 Stateless protocol  each request/response is independent  protocol does not remember previous

slide-11
SLIDE 11

11/21/2009 11

HTTP Client ent Requests uests (Meth ethods)

  • ds)

 GET (gets a resource)  HEAD (gets resource header only)  PUT (uploads a resource)  DELETE (deletes a resource)  POST (submits data)  TRACE (echoes request)  OPTIONS (displays server options)  CONNECT (used to make connection

secure)

HTTP Server r Responses

  • nses (Statu

tus s Codes)

 1xx (Informational)  2xx (Success): 200 OK  3xx (Redirect)  301 Moved Permanently  303 See Other 304 Not Modified  4xx (Client Error)  403 Forbidden  404 Not Found  5xx (Server Error)

slide-12
SLIDE 12

11/21/2009 12

HTTP Headers ers

Request headers Response headers

 Host: domain name of

server

 Referer: address of

linking page

 User-Agent: details of

browser, OS

 ....  Content-Type: e.g.

text/html, image/gif

 Location: for redirect  Date: when served  ETag: resource ID  ....

C: GET /~mas02jg/fy04/labs/lab08.html HTTP/1.1 C: Host: doc.gold.ac.uk S: HTTP/1.1 200 OK S: Content-Type: text/html S: Content-Length: 2339 <S sends rest of header and lab08.html text> C: GET /~mas02jg/fy04/labs/lab80.html HTTP/1.1 C: Host: doc.gold.ac.uk S: HTTP/1.1 404 Not Found S: Content-Type: text/html; charset=iso-8859-1 <S sends rest of header and 404 page text>

slide-13
SLIDE 13

11/21/2009 13

Summary

 Application protocols  Emails have headers, body; MIME  SMTP sends emails  POP, IMAP receive emails  HTTP transfers web pages  Client-server protocols  Reading: Brookshear 4.2, 4.3 (also

White 30)