25
LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

Embed Size (px)

Citation preview

Page 1: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

LIS508 lecture 9:important network applications

Thomas Krichel

2003-11-19

Page 2: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

Structure

• Email– Structure of mail– Transport

• Email lists

• http (only the verry basics)

Page 3: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

history• 1982: ARPANET issue email protocols

– RFC821 by a hippy– RFC822 revised by a grad student

• 1984: CCITT (Comité Consultatif International Télégraphique et Téléphonique, now the International Telecommunication Union) drafted X.400, backed by all major industry players. This standard is almost totally uninteroperable with the ARPANET standards.

Page 4: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

email

• Nowadays emails runs of top of DNS, all mails are sent to

user@hostname where hostname is a host name and user name on that host.

• To which machine mail is sent depends on the MX record for the name you are sending the mail to. See the mx record in the DNS example.

Page 5: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

RFC821

• Defines the original SMTP, the simple mail transfer protocol.

• By Jonathan B. Postel, who was the RFC editor.

• He worked at the IANA, the Internet Assigned Number Authority.

Page 6: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

smtp

• TCP connection to port 25 by a client, sending machine.

• It waits for a response from the receiving machine acting as a server to say– Who it is– Whether it ready to receive mail

• Senders says who the mail is from and where it goes to.

• Receiver checks this and give go-ahead

Page 7: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

Typical dialogR: 220 liu.edu SMTP service readyS: HELO openlib.orgR: 250 liu.edu says hello to abc.comS: MAIL from <[email protected]>R: 250 sender okS: RCPT TO [email protected]: 250 recipient okS: DATAR: 354 send mail, end with “.” on a line by itselfS: From ……. .R: 250 message receivedS: Quit

Page 8: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

RFC 822

• Is the one document that originally define email. It is the most famous RFC known to man.

• Specification is limited to US ASCII, 7 bit

• A mail message is defines as a text file. It has– Header fields (mandatory)– Body (optional)

Page 9: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

Email headers

• Email headers are composed of logical lines.

• These a physical lines (terminated by carriage-return/line-feed) not starting with a blank.

• They are of the form header-name:header-value

eg. To: Thomas Krichel <[email protected]>

Page 10: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

Header Fields• Return-Path: Added by the final delivery

host to give a back path to the originator.

• Received: Added each time another machine receives the mail. Note that the mail may be relayed by a number of machines.

• From: Person who wanted to send the mail.

• Reply-to: Where to send a reply to

Page 11: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

Email headers II

• To: Primary recipient

• CC: Secondary (informational) recipient

• BCC: Additional (hidden) recipient

• Message-Id: An identifier for the message

• Subject: has the subject

• Sender: whom to report problems to

Page 12: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

exampleReturn-path: <[email protected]>Envelope-to: [email protected]: from phoenix.liunet.edu ([148.4.5.3] helo=phoenix.liu.edu) by lists.repec.org with esmtp (Exim 3.36 #1 (Debian)) id 18GQaW-0005ad-00 for <[email protected]>; Mon, 25 Nov 2002 15:16:16 -0600Received: from webmail (webmail.liunet.edu [148.4.5.10]) by phoenix.liu.edu (Switch-2.0.3/Switch-2.0.3) with ESMTP id gAPLIDU13872 for <[email protected]>; Mon, 25 Nov 2002 16:18:13 -0500X-WebMail-UserID: [email protected]: Mon, 25 Nov 2002 16:29:02 -0500Sender: Alison Dickey <[email protected]>From: Alison Dickey <[email protected]>To: Thomas Krichel <[email protected]>X-EXP32-SerialNo: 00002866Subject: RE: courseMessage-ID: <3E120D84@webmail>Mime-Version: 1.0Content-Type: text/plain; charset="ISO-8859-1"Content-Transfer-Encoding: 7bitX-Mailer: WebMail (Hydra) SMTP v3.61Status: ROContent-Length: 1430Lines: 39

Page 13: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

Multipurpose Internet Mail Extensions MIME

• MIME allows to attach arbitrary files to emails. It is an Internet standard defined in RFC 2045 to 2049

• MIME provides a way for non-text information to be encoded as text. This encoding is known as base64

• The MIME format is also very similar to the format of information that is exchanged between a Web browser and the Web server it connects to. This related format is specified as part of the Hypertext Transfer Protocol (HTTP).

Page 14: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

Basic idea

• Continue to use RFC822 but give the body of the mail a richer structure

• Five new headers– MIME-version: shows the version– Content-description: human readable string– Content-id: Unique identifier– Content-transfer-encoding: how the body is

wrapped for transmission– Content-type: nature of the message

Page 15: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

Content-type

• The value of this header is known as the MIME type of the form type/subtype. Both type and subtype have to be specified.

• application/octet-stream is the catchall.

• The Internet Assigned Number Authority act as a registrar for these types.

• They provide some controlled vocabulary for file types. It is not perfect.

Page 16: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

Email lists

• An email list is a list of email addresses managed by a computer program..

• A list has an email address.

• When a person writes to the email address of the list, the message may be distributed to all addresses on the list.

Page 17: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

Concepts involved with lists

• The list owner is a person or group of person who has the power to add and remove addresses from the list. The owner may also have the following duties/powers– define charter and policy– answer technical questions

• A list is closed if a potential subscriber has to ask the list owner to be subscribed.

• A list is open if anyone can subscribe to a list.

Page 18: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

More concepts involved with lists

• A list is moderated if the moderator(s) are the only people allowed to send messages to the list. Messages sent to the list are forwarded to the moderator(s) by the list processing software.– The owner of the list is not necessarily the

moderator.– Usually, the owner has moderator powers too.

Page 19: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

Hypertext transfer protocol http• An application-level protocol for

distributed, collaborative, hypermedia information systems.

• HTTP is also used as a generic protocol for communication between user agents and proxies/gateways to other Internet systems, including those supported by the SMTP, NNTP, FTP, Gopher, and WAIS protocols. In this way, HTTP allows basic hypermedia access to resources available from diverse applications.

Page 20: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

http history

• 1990: version 0.9 allows for transfer of raw data.

• 1996: rfc1945 defines version 1.0. by adding attribute:value headers.

• 1999: rfc 2616 adds support for hierarchical proxies, caching, virtual hosts and some support for persistent connections, and is more stringent.

Page 21: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

request/response• Client sends

request – required items

• method• request URI• protocol version

– optional items • request modifiers• client information• body

• Server sends response– required items

• Status line– Protocol version– Success or error

code

– optional items • Server information• body

Page 22: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

General format of messages

• Start line

• Headers attribute:value form

• An empty line

• Body

• Just like in an email!

Page 23: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

Start line of the request

• Aka the resquest line, of the formmethod URI protocol-version

• method takes the values ``OPTIONS'', ``GET'', ``HEAD'', ``POST'', ``PUT'', ``DELETE'', ``TRACE'', ``CONNECT''.

• URI is a URL generally, though it can take more general form

• protocol-version is the version of the protocol• Example:

GET http://openlib.org/home/krichel HTTP/1.1

Page 24: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

Start line of the response

• Aka the status line, of the form• HTTP-Version Status-Code Reason-Phrase• Only the code is required. Famous codes are

– 404 Not Found– 403 Forbidden– 200 OK

• Example

HTTP/1.1 200 ok

Page 25: LIS508 lecture 9: important network applications Thomas Krichel 2003-11-19

http://openlib.org/home/krichel

Thank you for your attention!