Internet Technology 2/10/2016

Similar documents
Internet Technology. 03r. Application layer protocols: . Paul Krzyzanowski. Rutgers University. Spring 2016

Chapter 2 Application Layer

Applications & Application-Layer Protocols: FTP and (SMTP & POP)

The Application Layer: & SMTP

The Application Layer: SMTP, FTP

CSCE 463/612 Networks and Distributed Processing Spring 2018

CSC 4900 Computer Networks:

CS 43: Computer Networks. 12: and SMTP September 28, 2018

CS 3516: Computer Networks

Lecture 6: Application Layer Web proxies, , and SMTP

Internet and Intranet Protocols and Applications

WWW: the http protocol

SMTP. George Porter CSE 124 February 12, 2015

Electronic Mail. Three Components: SMTP SMTP. SMTP mail server. 1. User Agents. 2. Mail Servers. 3. SMTP protocol

CSC 401 Data and Computer Communications Networks

Electronic Mail. Prof. Indranil Sen Gupta. Professor, Dept. of Computer Science & Engineering Indian Institute of Technology Kharagpur

Chapter 2: outline. 2.6 P2P applications 2.7 socket programming with UDP and TCP

Chapter 2 part B: outline

Electronic Mail. Electronic Mailboxes

Chapter 2: Application layer

Electronic Mail Paradigm

CompSci 356: Computer Network Architectures. Lecture 23: Application Layer Protocols Chapter 9.1. Xiaowei Yang

Electronic Mail (SMTP)

System: Basic Functionality

Application: Electronic Mail

Electronic Mail

Network Applications Electronic Mail

CS348: Computer Networks (SMTP, POP3, IMAP4); FTP

Chapter 2 Application Layer

Application Layer: , DNS

Computer Networking. Chapter #1. Dr. Abdulrhaman Alameer

is still the most used Internet app. According to some studies around 85% of Internet users still use for communication.

Networking. Layered Model. DoD Model. Application Layer. ISO/OSI Model

Internet Protocol Stack! Principles of Network Applications! Some Network Apps" (and Their Protocols)! Application-Layer Protocols! Our goals:!

Electronic mail, usually called , consists of simple text messages a piece of text sent to a recipient via the internet.

Layered Model. DoD Model. ISO/OSI Model

Fig (1) sending and receiving s

Internet Electronic Mail

Computer Networking Introduction

Simple Network Management Protocol (SNMP)

Application Layer Services Omer F. Rana. Networks and Data Communications 1

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

Lecture 7 Application Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Lecture 25. Tuesday, November 21 CS 475 Networks - Lecture 25 1

INTERNET & WORLD WIDE WEB (UNIT-1) MECHANISM OF INTERNET

Network concepts introduction & wireshark

FTP. Mail. File Transfer Protocol (FTP) FTP commands, responses. Electronic Mail. TDTS06: Computer Networks

What is ? TCP/IP Standard Applications for Electronic Mail. Agenda. History

COSC 301 Network Management. Lecture 14: Electronic Mail

Socket Programming. Dr. -Ing. Abdalkarim Awad. Informatik 7 Rechnernetze und Kommunikationssysteme

Motivation For Networking. Information access Interaction among cooperative application programs Resource sharing

CIT 470: Advanced Network and System Administration. Topics. Mail Policies.

CCNA Exploration1 Chapter 3: Application Layer Functionality and Protocols

13. Internet Applications 최양희서울대학교컴퓨터공학부

Simple Network Management Protocol (SNMP)

Additional laboratory

Applications & Application-Layer Protocols: (SMTP) and DNS

Information Network Systems The application layer. Stephan Sigg

APPLICATION LAYER APPLICATION LAYER : DNS, HTTP, , SMTP, Telnet, FTP, Security-PGP-SSH.

Network Applications Principles of Network Applications

CN Assignment I. 1. With an example explain how cookies are used in e-commerce application to improve the performance.

CS 417 9/18/17. Paul Krzyzanowski 1. Socket-based communication. Distributed Systems 03. Remote Procedure Calls. Sample SMTP Interaction

How Internet Works

ECE697AA Lecture 2. Today s lecture

Operating Systems. 16. Networking. Paul Krzyzanowski. Rutgers University. Spring /6/ Paul Krzyzanowski

SCS3004 Networking Technologies Application Layer Protocols

Distributed Systems. 03. Remote Procedure Calls. Paul Krzyzanowski. Rutgers University. Fall 2017

TCP/IP Transport Layer Protocols, TCP and UDP

FTP. FTP offers many facilities :

Computer Network 1 1

Chapter 20 SMTP. Slides from TCP/IP - Forouzan. User Agent (UA) Addressing Delayed Delivery Aliases Mail Transfer Agent (MTA) MIME POP.

Ethernet / TCP-IP - Training Suite Application level protocols

. indigoo.com INTRODUCTION TO MAIL TRANSFER PROTOCOLS FOR THE INTERNET. Peter R. Egli INDIGOO.COM. 1/35 Rev Peter R.

Application Level Protocols

Overview. Electronic mail. History Format of . Sending . Retrieving . RFC 822, MIME, addresses SMTP, DNS. POP, IMAP, Web-based

CCNA 1 v3.11 Module 11 TCP/IP Transport and Application Layers

Application-layer Protocols and Internet Services

Computer Networks. Wenzhong Li. Nanjing University

CS321: Computer Networks ELECTRONIC MAIL

Agenda. What is ? Brief Introduction To . History Of . Components Of System. Basics

CIS 505: Software Systems

Objectives CINS/F1-01

Network concepts introduction & wireshark. workshop

CC451 Computer Networks

Telemetry Data Sharing Using S/MIME

CCNA Exploration Network Fundamentals. Chapter 03 Application Functionality and Protocols

Protocols. Networking CS 3470, Section 1 Sarah Diesburg

FTP,HTTP. By Nidhi Jindal

Different Layers Lecture 21

CSCI 466 Midterm Networks Fall 2013

Application Layer Protocols

Internet and Intranet Protocols and Applications

Outline. EEC-484/584 Computer Networks. Slow Start Algorithm. Internet Congestion Control Algorithm

Network Encryption Methods

Internet Technology 2/18/2016

Chapter 10: Application Layer

Appendix. Web Command Error Codes. Web Command Error Codes

Chapter 10: Application Layer CCENT Routing and Switching Introduction to Networks v6.0

Application Protocol Examples

Lab 3.4.3: Services and Protocols

Transcription:

Internet Technology 03r. Application layer protocols: email Email: (Simple Mail Transfer Protocol) Paul Krzyzanowski Rutgers University Spring 2016 1 2 Simple Mail Transfer Protocol () Protocol defined in RFC 2821 (April 2001) Original definition in RFC 821 (August 1982) Designed for: Direct transfer of email from the sender to the receiver (rather then go through a set of relays) Destination system is always up and connected Use TCP to transfer email from client to destination server Original model: Alice sends message to Bob In the early days of email, users were logged into one system. A mail application would send a message to a local mail server. The local mail server would maintain a queue and send messages to their destinations. Receiving users would run a mail application on the server that would open the mail file their queue of received messages. 1. Alice uses a mail application (User Agent, UA) to compose a message to Bob 2. Alice s UA sends the message to her local mail server message is in the outbound queue 3. The local server (acting as an client) uses DNS to look up the MX record (Mail Exchanger) for Bob s domain; opens TCP connection with Bob s mail server 4. Alice s local mail server (acting as a client) sends Alice s message over the TCP connection using 5. Bob s mail server receives it and places the message in Bob s mailbox 6. Bob runs his UA, which can access his mailbox (by opening the file) Alice Bob Note: There are a lot of variations on email delivery, transmission, and routing. We ll look at a basic model here. Our interest is the app-layer protocol and we ll avoid the terminology of mail submission agents, mail transfer agents, mail exchangers, and mail delivery agents. In most cases one program serves the role all of these. local system Client machine Local client/ server Server machine 3 4 Small enhancements to the model Mail delivery Alice will usually not be on the same machine as the local server Alice s UA is a email app running on her phone or laptop. It sends the message to her email provider s server using The email provider uses to talk to the destination server Alice Mail receipt Bob is usually not on the same machine as his mail server His mail program cannot access his mailbox directly Bob s UA needs to use a network mailbox access protocol such as IMAP or POP to get the message Bob Simple Mail Transfer Protocol () Three phases: 1. Handshake (greeting) 2. Transfer of message 3. Close Command/response interaction The protocol is conversational text A sequence of one-line messages & one-line responses Then the message followed by a single line containing a period (.) Finally, a QUIT command All transactions in 7-bit ASCII text Responses contain a status code & phrase (like HTTP and FTP) Alice s Mac Alice s email provider Bob s email provider Bob s iphone 5 6 Paul Krzyzanowski 1

The basic protocol Sample Interaction The following sequence of commands are used to send email HELO cs.rutgers.edu MAIL FROM: <pxk@cs.rutgers.edu> RCPT TO: <testuser@pk.org> RCPT TO: <anotheruser@pk.org> DATA QUIT The client identifies itself as cs.rutgers.edu. This is often ignored now since the server may do a reverse DNS lookup on the IP address. Identify the address of the mail sender. Note that the domain here may be different from that in the HELO message. Identify the destination(s) for this message. You can have a list of these one line per destination. Now give the server the mail message. All the lines after this are the message. A line containing a single period ends it. We re done! This is a sample interaction with me connecting to a $ telnet cs.rutgers.edu 25 Rutgers server via the telnet program and Trying 128.6.4.2... typing in commands. My typing is in blue. Connected to cs.rutgers.edu. 220 aramis.rutgers.edu E Sendmail 8.11.7p3+Sun/8.8.8; Tue, 9 Feb 2016 14:45:04-0500 (EST) HELO cs.rutgers.edu 250 aramis.rutgers.edu Hello aramis.rutgers.edu [128.6.4.2], pleased to meet you MAIL FROM: <pxk@cs.rutgers.edu> 250 2.1.0 <pxk@cs.rutgers.edu>... Sender ok RCPT TO: <testuser@pk.org> 250 2.1.5 <testuser@pk.org>... Recipient ok DATA 354 Enter mail, end with "." on a line by itself From: Paul Krzyzanowski <pxk@cs.rutgers.edu> Subject: test message Date: Tue, 9 Feb 2016 14:46:14-0500 To: Whomever <testuser@pk.org> Hi, This is a test. 250 2.0.0 r1blxln29829 Message accepted for delivery quit 221 2.0.0 aramis.rutgers.edu closing connection This is the message body. Headers may define the structure of the message but are ignored for delivery. 7 8 Comparison with HTTP HTTP Pull: you request content ASCII command/response interaction Including status codes & messages Multiple objects Each object (HTML, CSS, JavaScript, image files) is requested separately and encapsulated in its own message Push: you provide content ASCII command/response interaction Including status codes & messages Multiple objects Multiple objects (attachments) are sent in one multipart message Mail message format RFC 822 defines the basic format for text messages Header lines: To: From: Subject: Each line contains field_name: field_value Terminated by a blank line Body The actual message All this is treated as the message by It s up to the user agents to interpret those headers Header fields Message body See RFC 822 for details 9 10 Mail headers versus data is interested in delivering the message The crucial data is in the RCPT TO: commands All mail headers are ignored by the protocol From:, To:, Subject:, Cc:, Bcc:, etc. These are strictly for the mail apps (user agents) to use Mail is delivered exactly the same way whether a recipient is specified as a To, Cc, or Bcc: they will always end up as RCPT TO: commands in The User Agent can determine what to display Problem: We want to send more than text Originally we used email to just send plain text (ASCII) Later we wanted to send: Rich text or HTML text (formatted) One or more Images One or more attached files 11 12 Paul Krzyzanowski 2

Multimedia extensions: MIME Multimedia extensions: multipart MIME MIME: multimedia mail extensions (RFC 2045, 2056) Lines in the message header define the content type Type of data Method used to encode the data Version of the format Other stuff, such as how to present the data and what the filename is Base64 encoded data (allows us to send arbitrary binary data using 7-bit ascii Fr om: Paul Kr zy zanowsk i <p@pk. or g> Cont ent - Type: i mage/ j pg Cont ent - Tr ans f er - Enc odi ng: bas e64 Subj ect : t est mi me Dat e: Tue, 9 Feb 2016 13: 09: 50-0500 To: Paul Kr zy zanowsk i <p@pk. or g> Mi me- Ver s i on: 1. 0 Cont ent - Di s posi t i on: i nl i ne; f i l ename =t es t - phot o. j pg / 9j / 4RZpRXhpZgAATU0AKgAAAAgADAEAAAMAAAABAcI AA AEBAAMAAAABAUEAAAECAAMAAAADAAAA ngegaamaaaabaai AAAESAAMAAAABAAEAAAEVAAMAAAABA AMAAAEaAAUAAAABAAAApAEbAAUAAAAB Support multiple items in one message Boundary definition Start of content 1 Start of content 2 Fr om: Paul Kr zy zanowsk i <p@pk. or g> Cont ent - Type: mul t i par t / mi xed; boundar y - 96E43D94-57D4" Subj ect : mul t i par t mi me demo Dat e: Tue, 9 Feb 2016 13: 09: 50-0500 To: Paul Kr zy zanowsk i <p@pk. or g> Mi me- Ver s i on: 1. 0 - - Spl i t - 96E43D94-57D4 Cont ent - Di s posi t i on: I NLI NE; f i l ename=t est _i mage. j pg Cont ent - Type: I MAGE/ JPG; name=t est _i mage. j pg; x - uni x - mode=0644 Cont ent - Tr ans f er - Enc odi ng: BASE64 / 9j / 4RZpRXhpZgAAT.... <r est of cont ent > --Spl i t - 96E43D94-57D4 Cont ent - Di s posi t i on: ATTACHMENT; f i l ename=t est. s kp Cont ent - Type: APPLI CATI ON/ OCTET- STREAM; name=t est. s kp; x - uni x - mode=0644 Cont ent - Tr ans f er - Enc odi ng: BASE64 / / 7/ Dl MAawBl... <r est of cont ent > 13 14 Mail access deals with mail delivery (sending) Sending messages to their destination Mail access protocols: POP & IMAP When people ran mail apps on machines other than the mail server: The app didn t have direct (file system) access to the mailbox A protocol was needed to interact with the user s mailbox on the server Two protocols were developed POP3: Post Office Protocol version 3 (RFC 1939) IMAP: Internet Mail Access Protocol (RFC 1730) 15 16 POP3 Client (mail application) connects to TCP port 110 Three phases: 1. Identification & authentication Send user name and password 2. Transaction Mail access commands 3. Update & exit POP3: Authentication User login commands user username pass password All commands are sent in plain text This is not secure since internet traffic can be intercepted $ t el net pk. or g 110 Tr yi ng 192. 168. 60. 130... Connect ed t o pk. or g. +OK Dov ecot r eady. user paul +OK pass my passwor d +OK Logged i n. It is a fundamental weakness here and with other protocols (HTTP, telnet, ftp) POP3 is usually run over an encrypted session 17 18 Paul Krzyzanowski 3

POP3: Transaction After authentication, the mail app (user agent) sends a series of commands to fetch or delete mail messages stat show the number of messages in the mailbox and total size st at +OK 3 5467 POP3: Transaction After authentication, the mail app (user agent) sends a series of commands to fetch or delete mail messages dele delete a specific message Del e 1 +OK Mes sage del et ed list show a list of messages with the size of each message. A line containing a period indicates end of data l i st +OK Mai l box scan l i st i ng f ol l ows 1 1823 2 1825 3 1819 rset reset the session: undo all deletes r set +OK Res et st at e retr retrieve a specific message r et r 2 +OK 1823 oct et s --- al l mess age header s and message message cont ent, i ncl udi ng header s. 19 20 POP3: Update & exit When done with the session, make changes permanent quit commit changes and exit qui t +OK Goodbye POP3 behaviors download-and-delete behavior A mail client connects to a server Download messages into its local mailbox Delete them from the server This isn t useful when you access mail from multiple devices Once a message goes to a device, it s no longer on the server download-and-keep behavior A mail client client connects to a server Downloads messages but does not delete them User may delete specific messages A user can access messages from another device But POP3 does not keep session state It does not know if a user marked a message for deletion during a previous session 21 22 IMAP: Internet Message Access Protocol With POP3 Folders, moving messages, & search are all handled at the client with client downloads of the messages IMAP was created for users who access mail from multiple clients IMAP keeps all messages on the server User can organize messages in folders State is stored on the server & available across sessions Names of folders Message ID mappings Mark for deletion Messages reside in folders Commands allow users to Create/delete folders, move messages between folders, search for specific messages, mark messages for deletion, delete messages, fetch headers only IMAP Commands We won t cover the IMAP protocol It s a lot uglier and a lot more verbose See RFC 3501 TCP connection All commands are sent as lines of ASCII text Commands are more verbose spelled out, not abbreviated Each command is prefixed with a unique tag (unique per session) A sequence of commands can be sent without waiting for a response before sending the next one 23 24 Paul Krzyzanowski 4

IMAP Protocol Example Login a01 l ogi n paul my passwor d RESPONSE: a01 OK User l ogged in List folders a02 l i s t " Mai l " " * LI ST ( \ NoSel ect ) " / " Mai l * LI ST ( \ NoI nf er i or s \ Mar ked) " / " Mai l / Tr as h * LI ST ( \ NoI nf er i or s \ Mar ked) " / " Mai l / Sent * LI ST ( \ NoI nf er i or s \ UnMar k ed) " / " Mai l / Dr af t s * LI ST ( \ NoSel ect ) " / " Mai l / i nbox <st uf f del et ed> a02 OK LI ST compl et e The end Fetch message 1 with full headers a03 f et ch 1 f ul l * 1 FETCH ( FLAGS ( \ Seen) I NTERNALDATE - Feb- 2013 14: 46: 22-0500" RFC822. SI ZE 1 553 ENVELOPE ( " Wed, 13 Feb 2013 14: 46: 22 - <st uf f del et ed> a03 OK FETCH compl et ed 25 26 Paul Krzyzanowski 5