App Layer Protocols: SMTP, POP3, IMAP, HTTP, FTP, Email, DNS, P2P File Sharing, Study notes of Electrical and Electronics Engineering

An overview of various application layer protocols, including smtp, pop3, imap, http, ftp, electronic mail, dns, and p2p file sharing. It covers their principles, architectures, requirements, and specific applications. The document also discusses the differences between client-server and peer-to-peer paradigms and examines popular application-level protocols such as http, smtp, and dns.

Typology: Study notes

Pre 2010

Uploaded on 08/30/2009

koofers-user-dkg-1
koofers-user-dkg-1 🇺🇸

10 documents

1 / 34

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
2: Application Layer 1
Chapter 2
Application Layer
Computer Networking:
A Top Down Approach
Featuring the Internet
,
3rd edition.
Jim Kurose, Keith Ross
Addison-Wesley, July
2004.
2: Application Layer 2
Chapter 2: Application layer
2.1 Principles of
network applications
2.2 Web and HTTP
2.3 FTP
2.4 Electronic Mail
SMTP, POP3, IMAP
2.5 DNS
2.6 P2P file sharing
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22

Partial preview of the text

Download App Layer Protocols: SMTP, POP3, IMAP, HTTP, FTP, Email, DNS, P2P File Sharing and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

2: Application Layer 1

Chapter 2

Application Layer

Computer Networking: A Top Down Approach Featuring the Internet, 3 rd^ edition. Jim Kurose, Keith Ross Addison-Wesley, July

2: Application Layer 2

Chapter 2: Application layer

❒ 2.1 Principles of

network applications

❒ 2.2 Web and HTTP

❒ 2.3 FTP

❒ 2.4 Electronic Mail

 SMTP, POP3, IMAP

❒ 2.5 DNS

❒ 2.6 P2P file sharing

2: Application Layer 3

Chapter 2: Application Layer

Our goals:

❒ conceptual,

implementation

aspects of network

application protocols

 transport-layer

service models

 client-server

paradigm

 peer-to-peer paradigm

❒ learn about protocols

by examining popular

application-level

protocols

 HTTP

 FTP

 SMTP / POP3 / IMAP

 DNS

2: Application Layer 4

Some network apps

❒ E-mail

❒ Web

❒ Instant messaging

❒ Remote login

❒ P2P file sharing

❒ Multi-user network

games

❒ Streaming stored

video clips

❒ Internet telephone

❒ Real-time video

conference

❒ Massive parallel

computing

2: Application Layer 7

Application architectures

❒ Client-server

❒ Peer-to-peer (P2P)

❒ Hybrid of client-server and P2P

2: Application Layer 8

Client-server architecture

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

2: Application Layer 9

Pure P2P architecture

❒ no always-on server

❒ arbitrary end systems

directly communicate

❒ peers are intermittently

connected and change IP

addresses

❒ example: Gnutella

Highly scalable but

difficult to manage

2: Application Layer 10

Hybrid of client-server and P2P

Skype

 Internet telephony app  Finding address of remote party: centralized server(s)  Client-client connection is direct (not through server)

Instant messaging

 Chatting between two users is P2P  Presence detection/location centralized:

  • User registers its IP address with central server when it comes online
  • User contacts central server to find IP addresses of buddies

2: Application Layer 13 Addressing processes

❒ to receive messages,

process must have

identifier

❒ host device has

unique32-bit IP

address

❒ Q: does IP address of

host on which process

runs suffice for

identifying the

process?

2: Application Layer 14 Addressing processes

❒ to receive messages,

process must have

identifier

❒ host device has

unique32-bit IP

address

❒ Q: does IP address of

host on which process

runs suffice for

identifying the

process?

 Answer: NO, many processes can be running on same host

❒ identifier includes both

IP address and port

numbers associated with

process on host.

❒ Example port numbers:

 HTTP server: 80  Mail server: 25

❒ to send HTTP message

to gaia.cs.umass.edu web

server:

 IP address: 128.119.245.  Port number: 80

❒ more shortly…

2: Application Layer 15

App-layer protocol defines

❒ Types of messages

exchanged,

 e.g., request, response

❒ Message syntax:

 what fields in messages & how fields are delineated

❒ Message semantics

 meaning of information in fields

❒ Rules for when and how

processes send &

respond to messages

Public-domain protocols:

❒ defined in RFCs

❒ allows for

interoperability

❒ e.g., HTTP, SMTP

Proprietary protocols:

❒ e.g., KaZaA

2: Application Layer 16

What transport service does an app need?

Data loss

❒ some apps (e.g., audio) can

tolerate some loss

❒ other apps (e.g., file

transfer, telnet) require

100% reliable data

transfer

Timing

❒ some apps (e.g.,

Internet telephony,

interactive games)

require low delay to be

“effective”

Bandwidth

❒ some apps (e.g.,

multimedia) require

minimum amount of

bandwidth to be

“effective”

❒ other apps (“elastic

apps”) make use of

whatever bandwidth

they get

2: Application Layer 19

Internet apps: application, transport protocols

Application e-mail remote terminal access Web file transfer streaming multimedia Internet telephony Application layer protocol SMTP [RFC 2821] Telnet [RFC 854] HTTP [RFC 2616] FTP [RFC 959] proprietary (e.g. RealNetworks) proprietary (e.g., Vonage,Dialpad) Underlying transport protocol TCP TCP TCP TCP TCP or UDP typically UDP 2: Application Layer 20

Chapter 2: Application layer

❒ 2.1 Principles of

network applications

 app architectures  app requirements

❒ 2.2 Web and HTTP

❒ 2.4 Electronic Mail

 SMTP, POP3, IMAP

❒ 2.5 DNS

❒ 2.6 P2P file sharing

2: Application Layer 21

Web and HTTP

First some jargon

❒ Web page consists of objects

❒ Object can be HTML file, JPEG image, Java

applet, audio file,…

❒ Web page consists of base HTML-file which

includes several referenced objects

❒ Each object is addressable by a URL

❒ Example URL:

www.someschool.edu/someDept/pic.gif

host name path name

2: Application Layer 22

HTTP overview

HTTP: hypertext

transfer protocol

❒ Web’s application layer protocol ❒ client/server model  client: browser that requests, receives, “displays” Web objects  server: Web server sends objects in response to requests ❒ HTTP 1.0: RFC 1945 ❒ HTTP 1.1: RFC 2068 PC running Explorer Server running Apache Web server Mac running Safari HTTP request HTTP request HTTP response HTTP response

2: Application Layer 25 Nonpersistent HTTP

Suppose user enters URL

www.someSchool.edu/someDepartment/home.index 1a. HTTP client initiates TCP connection to HTTP server (process) at www.someSchool.edu on port 80

  1. HTTP client sends HTTP request message (containing URL) into TCP connection socket. Message indicates that client wants object someDepartment/home.index 1b. HTTP server at host www.someSchool.edu waiting for TCP connection at port 80. “accepts” connection, notifying client
  2. HTTP server receives request message, forms response message containing requested object, and sends message into its socket

time

(contains text, references to 10 jpeg images) 2: Application Layer 26 Nonpersistent HTTP (cont.)

  1. HTTP client receives response message containing html file, displays html. Parsing html file, finds 10 referenced jpeg objects

  2. Steps 1-5 repeated for each of 10 jpeg objects 4. HTTP server closes TCP connection.

time

2: Application Layer 27 Non-Persistent HTTP: Response time

Definition of RTT: time to

send a small packet to

travel from client to

server and back.

Response time:

❒ one RTT to initiate TCP

connection

❒ one RTT for HTTP

request and first few

bytes of HTTP response

to return

❒ file transmission time

total = 2RTT+transmit time

time to transmit file initiate TCP connection RTT request file RTT file received time time 2: Application Layer 28 Persistent HTTP Nonpersistent HTTP issues: ❒ requires 2 RTTs per object ❒ OS overhead for each TCP connection ❒ browsers often open parallel TCP connections to fetch referenced objects Persistent HTTP ❒ server leaves connection open after sending response ❒ subsequent HTTP messages between same client/server sent over open connection Persistent without pipelining: ❒ client issues new request only when previous response has been received ❒ one RTT for each referenced object Persistent with pipelining: ❒ default in HTTP/1. ❒ client sends requests as soon as it encounters a referenced object ❒ as little as one RTT for all the referenced objects

2: Application Layer 31

Chapter 2: Application layer

❒ 2.1 Principles of

network applications

❒ 2.2 Web and HTTP

❒ 2.3 FTP

❒ 2.4 Electronic Mail

 SMTP, POP3, IMAP

❒ 2.5 DNS

❒ 2.6 P2P file sharing

2: Application Layer 32

FTP: the file transfer protocol

❒ transfer file to/from remote host ❒ client/server model  client: side that initiates transfer (either to/from remote)  server: remote host ❒ ftp: RFC 959 ❒ ftp server: port 21 file transfer (^) FTP server FTP user interface FTP client local file system remote file system user at host

2: Application Layer 33 FTP: separate control, data connections ❒ FTP client contacts FTP server at port 21, specifying TCP as transport protocol ❒ Client obtains authorization over control connection ❒ Client browses remote directory by sending commands over control connection. ❒ When server receives file transfer command, server opens 2 nd^ TCP connection (for file) to client ❒ After transferring one file, server closes data connection.

FTP

client

FTP

server TCP control connection port 21 TCP data connection port 20 ❒ Server opens another TCP data connection to transfer another file. ❒ Control connection: “out of band” ❒ FTP server maintains “state”: current directory, earlier authentication 2: Application Layer 34 FTP commands, responses

Sample commands:

❒ sent as ASCII text over control channel ❒ USER usernamePASS passwordLIST return list of file in current directory ❒ RETR filename retrieves (gets) file ❒ STOR filename stores (puts) file onto remote host

Sample return codes

❒ status code and phrase (as in HTTP) ❒ 331 Username OK, password required125 data connection already open; transfer starting425 Can’t open data connection452 Error writing file

2: Application Layer 37 Electronic Mail: mail servers

Mail Servers

❒ mailbox contains incoming messages for user ❒ message queue of outgoing (to be sent) mail messages ❒ SMTP protocol between mail servers to send email messages  client: sending mail server  “server”: receiving mail server mail server user agent user agent user agent mail server user agent user agent mail server user agent

SMTP

SMTP

SMTP

2: Application Layer 38 Electronic Mail: SMTP [RFC 2821] ❒ uses TCP to reliably transfer email message from client to server, port 25 ❒ direct transfer: sending server to receiving server ❒ three phases of transfer  handshaking (greeting)  transfer of messages  closure ❒ command/response interaction  commands: ASCII text  response: status code and phrase

❒ messages must be in 7-bit ASCII

2: Application Layer 39

Scenario: Alice sends message to Bob

  1. Alice uses UA to compose message and “to” [email protected]
  2. Alice’s UA sends message to her mail server; message placed in message queue
  3. Client side of SMTP opens TCP connection with Bob’s mail server
  4. SMTP client sends Alice’s message over the TCP connection
  5. Bob’s mail server places the message in Bob’s mailbox
  6. Bob invokes his user agent to read message user agent mail server mail server user agent 1 (^2 ) 4 5 6 2: Application Layer 40

SMTP: final words

❒ SMTP uses persistent connections ❒ SMTP requires message (header & body) to be in 7- bit ASCII ❒ SMTP server uses CRLF.CRLF to determine end of message

Comparison with HTTP:

❒ HTTP: pull ❒ SMTP: push ❒ both have ASCII command/response interaction, status codes ❒ HTTP: each object encapsulated in its own response msg ❒ SMTP: multiple objects sent in multipart msg