Last lesson Moving beyond individual computers Networks Layer - - PDF document
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
11/21/2009 2
This week
Application Protocols Email SMTP, POP, IMAP The Web HTTP
The Layer Model
11/21/2009 3
Application protocols
Protocol: set of rules for
communication
Messages over Internet via application
layer
Examples...
Message headers From, To, Subject, Date, ... Message body Actual text, plus attachments
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
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)
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
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)
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
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
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
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)
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 ....