APPLICATION LAYER AND ELECTRONIC MAILnetgroup.polito.it/courses/Didattica/CN/AppLayer_e-mail.pdfIn...

Post on 11-Dec-2020

10 views 0 download

transcript

APPLICATION LAYER AND

ELECTRONIC MAIL

Outline à  Application layer à  Mail delivery architecture à  Mail transfer protocol à  Mail access protocols

APPLICATION LAYER

In the Protocol Architecture

RPC  

XDR  

NFS  

RTP  SNMP  

Telnet  FTP  SMTP  HTTP  

   

IP  

Data  link  

Network  

Trasport  

Session  

Presenta:on  

Applica:on  

ICMP  IGMP  

TCP   UDP  

ARP  

Rou:ng  protocols  

Client-Server Paradigm

à Server always in execution

à Waiting for requests à Client initiates communication

à Known IP address (name) and port à Static port à Standard port

à Traditional model on the Internet à FTP, WWW, e-mail

Peer-to-peer (P2P) Paradigm

à No pre-defined role à Each host can contact and be contacted à I.e., running both client and server

à Server (or super peer) might be needed to know others

à Newer model à VoIP, emule, Skype

Text-based Protocols

à Inefficient encoding à Easy to troubleshoot à No need for protocol analyzer support

MAIL DELIVERY ARCHITECTURE

Mail  Server  

Mail  Server  

SMTP  

SMTP  

POP  IMAP  HTTP  

MAIL TRANSFER PROTOCOL

SMTP: Simple Mail Transfer Protocol

à  Text based à  Client-server à  TCP - port 25

à  Opened by client à  Command-response

à  Status code

SMTP  Session  

HELO  zeit.polito.it  250  …  

220  polito.it  

MAIL  FROM:  baldi@polito.it  

250  baldi@polito.it  sender  OK  

RCPT  TO:  box@baldi.info  

250  box@baldi.info  recipient  OK  

Handshaking  

354  Enter  mail,    end  with  “.”  by  itself  

This  is  an  e-­‐mail  message.  It  contains  mul:ple  lines.  .    

250  message  accepted  QUIT  

221  polito.it  closing  connec:on  

SMTP  Session  Data  transfer  

Termina:on  

HELO  baldi.info  250  …  

220  polito.it  

MAIL  FROM:  box@baldi.info  

250  box@baldi.info  sender  OK  

RCPT  TO:  baldi@gmail.com  

571  baldi@gmail.com  prohibited.  We  do  not  relay  

An:-­‐spamming  Measures  

An:-­‐spamming  Measures  

HELO  baldi.info  250  …  

220  polito.it  

250  baldi@polito.it  recipient  OK  

MAIL  FROM:  box@baldi.info  

250  box@baldi.info  sender  OK  

RCPT  TO:  baldi@polito.it  

An:-­‐spamming  Measures  

HELO  zeit.polito.it  250  …  

220  polito.it  

MAIL  FROM:  baldi@polito.it  

250  baldi@polito.it  sender  OK  

RCPT  TO:  baldi@gmail.com  

250  baldi@gmail.com  recipient  OK  

An:-­‐spamming,  An:-­‐spoofing  Measures  

HELO  zeit.polito.it  250  …  

220  polito.it  

MAIL  FROM:  baldi@polito.it  

250  baldi@polito.it  sender  OK  

RCPT  TO:  baldi@gmail.com  473  baldi@gmail.com  relaying  prohibited.  You  should  authen:cate  first  

Check  Client  IP  

Message Format à ASCII character sequence à Possibly limited length lines

Body  

From:  <sender>  To:  <addresses>  CC:  <carbon  copied>  Subject:  <subject  line>  …    

How about images?

à Can be encoded as character sequence

à E.g. base64 à Recipient must know

Multipurpose Internet Mail Extensions: MIME

à

 Additional headers

MIME-­‐Version:  1.0  Content-­‐Type:  image/png;  name="image001.png"  Content-­‐Descrip:on:  image001.png  Content-­‐Transfer-­‐Encoding:  base64      

iVBORw0KGgoAAAANSUhEUgAAAKgAAABDCA  xAAADsQBlSsOGwAAABl0RVh0U29mdHdhcm  EEQXBBxR19URQF3OEzRo0rKvoeCYm4xJen  

Content-Type à text

à plain, html à image

à jpeg, gif, png à audio à video

Important  for  “rendering”  

MAIL ACCESS PROTOCOLS

Webmail

à Web server running on mail server host

à Providing access to messages through web interface

à Messages remain on server

Pros and Cons

à Ideal when not using own PC

à Available from everywhere à Available only with Internet connection

Post Office Protocol: POP

à Mono-PC users à Messages moved to client

à Available for off-line access

à Character-based à TCP on port 11O

POP  Session  

USER  baldi  +OK  

+OK  POP3  serv  ready  

PASS  whatever_it_is  

+OK  Congratula:ons!  

Authoriza:on  

+OK  2  messages  1  1495  2  1948  

RETR  1  +OK  1495  octets  Received:  from  …  

QUIT  +OK  Bye!  

DELE  2  +OK  Message  2  deleted  

SMTP  Session  Transac:on  

Termina:on  

Internet Message Access Protocol: IMAP

à Multi-PC users à E.g. 1 PC at work, 1 PC at home

à Character-based à TCP on port 143

Best of both worlds

à Available for off-line access

à Messages remain on server à In folder hierarchy

à Synchronize with local copy