computernetworksandcommunications_2011_lectures10111213x

Download Report

Transcript computernetworksandcommunications_2011_lectures10111213x

Computer Networks and
Communications
[Δίκτυα Υπολογιστών και Επικοινωνίες]
Lectures 10-13: Back to applications… The
e-mail app.
Univ. of the Aegean
Financial and Management Engineering Dpt
Petros KAVASSALIS
1
What you will learn in this course

A set of fundamental concepts for understanding Data
Networks and the Internet






What is the Internet?
Internet architecture and layers
Internet applications and services
New concepts in the evolution of the Internet
The Internet goes Wireless…
Familiarization with the structure and organization of Digital
Networks


Business and Social Networks
Electronic Markets and Online Feedback Mechanisms
<[email protected]>
2
Who am I?

PhD in Economics and Management (Univ. Paris Dauphine
& Ecole polytechnique)

Research experience



Ecole polytechnique, Paris
MIT Center of Technology Policy and Industrial Development, MIT
CTPID (MIT Internet Telecommunications Convergence Consortium)
Current positions


Univ. of the Aegean (FME): Assoc. Professor
RACTI: Director of ATLANTIS Group
<[email protected]>
3
Communication tools


e-mail: pkavassalis [at] atlantis-group.gr
Course web site: see fme website
<[email protected]>
4
Course Textbook
[http://books.google.gr/books?id=Pdz64SJRBAC&dq=tanenbaum+networks&printsec=frontcover&source=bn&hl=el&ei=mldSfH9L4S2jAeJ5L3ZBQ&sa=X&oi=book_result&resnum=4&ct=result]
<[email protected]>
5
Supplementary Texts & References


William Stallings, Computer Networking with Internet
Protocols, Prentice Hall, 2004
James F. Kurose and Keith W. Ross, Computer Networking:
A Top-Down Approach, Addison-Wesley, 2008
<[email protected]>
6
Students evaluation

Class Participation (20%)
+

Assignments (20%)
+

Final Exam (60%)
<[email protected]>
7
Reminder (1): Overview of the Internet
The structure of the Internet is roughly hierarchical
Petros KAVASSALIS <[email protected]>
8
Reminder (2): A network architecture
Petros KAVASSALIS <[email protected]>
9
Reminder (3): TCP/IP in practice
Petros KAVASSALIS <[email protected]>
10
Create a network app
application
transport
network
data link
physical
Write programs that



Run on (different) end systems
Communicate over network
Think about that: Server software
communicates with browser
software
No need to write software for
network-core devices


Network-core devices do not run
user applications
Applications on end systems
allows for rapid app development,
propagation
application
transport
network
data link
physical
application
transport
network
data link
physical
11
Petros KAVASSALIS <[email protected]>
Application architectures

Client-server

Peer-to-peer (P2P)

Hybrid of client-server and P2P
Petros KAVASSALIS <[email protected]>
12
Client-server
Server:
 Always-on host
 Permanent IP address
 Server farms for scaling
Clients:




Communicate with server
May be intermittently
connected
May have dynamic IP
addresses
Do not communicate directly
with each other
Petros KAVASSALIS <[email protected]>
client/server
13
P2P



No always-on server
Arbitrary end systems
directly communicate
peers are intermittently
connected and change
IP addresse

peer-peer
**** Highly scalable but
difficult to manage
Petros KAVASSALIS <[email protected]>
14
Hybrid
Skype



voice-over-IP P2P application
centralized server: finding address of remote party:
client-client connection: direct (not through server)
Instant messaging


chatting between two users is P2P
centralized service: client presence detection/location
o
o
user registers its IP address with central server when it
comes online
user contacts central server to find IP addresses of
buddies
Petros KAVASSALIS <[email protected]>
15
An Internet application example: e-mail

Most heavily used application on any network

Protocols

Simple Mail Transfer Protocol (SMTP)
o
o

TCP/IP
Delivery of simple text messages
Multi-purpose Internet Mail Extension (MIME)
o
o
Delivery of other types of data
Voice, images, video clips
Petros KAVASSALIS <[email protected]>
16
SMTP


RFC 821 (please locate the document!)
Not concerned with format of messages or data


SMTP uses info written on envelope of mail


Message body
Mail created by user agent program (mail client): Message consists of:



Message header
Does not look at contents


Covered in RFC 822 (see later)
Header containing recipient’s address and other info
Body containing user data
Messages queued and sent as input to SMTP sender program

Typically a server process (daemon on UNIX)
Petros KAVASSALIS <[email protected]>
17
Mail message content

Each queued message has:

Message text
o
o

RFC 822 header with message envelope and list of
recipients
Message body, composed by user
A list of mail destinations
o
o
o
o
Derived by user agent from header
May be listed in header
May require expansion of mailing lists
May need replacement of mnemonic names with
mailbox names
Petros KAVASSALIS <[email protected]>
18
Mail example
Date: Tue 19 May 2008 10:37:17 (EST)
From: “Petros Kavassalis” <[email protected]>
Subject: Xronia Polla
To: el……@gmail.com
Cc: [email protected]
Follows the main text, delimited from the header by a blank line



Message viewed as having envelope and contents
Envelope contains information required to transmit and deliver
message
Message is sequence of lines of text
Petros KAVASSALIS <[email protected]>
19
Mail structure
SMTP: protocol for exchanging
email msgs
RFC 821+822: standard for text
message format:
 header lines, e.g.,




To:
From:
Subject:
header
blank
line
body
body

the “message”, ASCII characters
only
Petros KAVASSALIS <[email protected]>
20
SMTP operation architecture
Petros KAVASSALIS <[email protected]>
21
SMTP Sender


Takes message from queue
Transmits to proper destination host






Via SMTP transaction
Over one or more TCP connections to port 25
Host may have multiple senders active
Host should be able to create receivers on demand
When delivery complete, sender deletes destination from list
for that message
When all destinations processed, message is deleted
Petros KAVASSALIS <[email protected]>
22
Room for optimization

If message destined for multiple users on a given host



It is sent only once
= Delivery to users handled at destination host
If multiple messages ready for given host


a single TCP connection can be used
= Saves overhead of setting up and dropping connection
Petros KAVASSALIS <[email protected]>
23
SMTP reliability






Used to transfer messages from sender to receiver over TCP
connection
Attempts to provide reliable service
No guarantee to recover lost messages
No end to end acknowledgement to originator
Error indication delivery not guaranteed
Generally considered reliable
Petros KAVASSALIS <[email protected]>
24
SMTP Receiver



Accepts arriving message
Places in user mailbox or copies to outgoing queue for
forwarding
Receiver must:


Verify local mail destinations
Deal with errors
Transmission
o Lack of disk space
Sender responsible for message until receiver confirm
complete transfer
o


Indicates mail has arrived at host, not user
Petros KAVASSALIS <[email protected]>
25
SMTP Forwarding and Conversation


Mostly direct transfer from sender host to receiver host
May go through intermediate machine via forwarding
capability





Sender can specify route
Target user may have moved
SMTP limited to conversation between sender and receiver
Main function is to transfer messages
Rest of mail handling beyond scope of SMTP

May differ between systems
Petros KAVASSALIS <[email protected]>
26
Main operations (1)

Connection setup
Exchange of command-response pairs
Connection termination

Connection setup







Sender opens TCP connection with receiver
Once connected, receiver identifies itself
Sender identifies itself
Receiver accepts sender’s identification
(If mail service not available, step 2 above becomes: service not
available)
Petros KAVASSALIS <[email protected]>
27
Main operations (2)




Connection setup
Exchange of command-response pairs
Connection termination
Exchange of command-response pairs








Sender may send one or more messages to receiver
MAIL command identifies originator
Gives reverse path to used for error reporting
Receiver returns 250 OK or appropriate fail/error message
One or more RCPT commands identifies recipients for the message
Separate reply for each recipient
DATA command transfers message text
End of message indicated by line containing just period (.)
Petros KAVASSALIS <[email protected]>
28
Main operations (3)

Connection setup
Exchange of command-response pairs
Connection termination

Connection termination





Sender sends QUIT and waits for reply
Then initiate TCP close operation
Receiver initiates TCP close after sending reply to QUIT
Petros KAVASSALIS <[email protected]>
29
Mail access protocols


SMTP: delivery/storage to receiver’s server
Mail access protocol: retrieval from server
 POP: Post Office Protocol [RFC 1939]
o

IMAP: Internet Mail Access Protocol [RFC 1730]
o
o

authorization (agent <-->server) and download
more features (more complex)
manipulation of stored msgs on server
HTTP: gmail, Hotmail, Yahoo! Mail, etc.
SMTP
SMTP
user
agent
sender’s mail
server
Petros KAVASSALIS <[email protected]>
access
protocol
user
agent
receiver’s mail
server
30
MIME


Extension to RFC822
SMTP can not transmit executables

Uuencode and other schemes are available
o

Can not transmit text including international characters (e.g.
â, å, ä, è, é, ê, ë)




Not standardized
Need 8 bit ASCII
Servers may reject mail over certain size
Translation between ASCII and EBCDIC not standard
Some SMTP implementations do not adhere to standard

CRLF, truncate or wrap long lines, removal of white space, etc.
Petros KAVASSALIS <[email protected]>
31
MIME in a nutshell

Five new message
header fields







MIME version
Content type
Content transfer encoding
Content Id
Content Description
Number of content
formats defines
Transfer encoding
defined
Petros KAVASSALIS <[email protected]>
From: [email protected]
To: [email protected]
Subject: Picture of yummy crepe.
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Type: image/jpeg
base64 encoded data .....
.........................
......base64 encoded data
32
Content types


Text body
Multipart


Message


mpeg
Audio


jpeg, gif
Video


RFC 822, Partial, External-body
Image


Mixed, Parallel, Alternative, Digest
Basic
Application


Postscript
octet stream
Petros KAVASSALIS <[email protected]>
33