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

Similar documents
Lecture 6 Application Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Application Layer Chapter 2

WWW: the http protocol

Application Layer. Applications and application-layer protocols. Goals:

CSC 4900 Computer Networks:

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

Chapter 2 Application Layer

Internet and Intranet Protocols and Applications

Chapter 2: Application Layer

Chapter 2: Application layer

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

Web, HTTP and Web Caching

Lecture 6: Application Layer Web proxies, , and SMTP

Review of Previous Lecture

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

Course on Computer Communication and

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

Layered Model. DoD Model. ISO/OSI Model

Chapter 2 Application Layer

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

Chapter 2 part B: outline

CS4/MSc Computer Networking. Lecture 3: The Application Layer

Application Layer. Goals: Service models. Conceptual aspects of network application protocols Client server paradigm

Computer Networking Introduction

CSC 401 Data and Computer Communications Networks

Application Layer: , DNS

Computer Networks 2 *+ # $ $!,( -. ( - ( - # ( / $!

CMSC 332 Computer Networking Web and FTP

Computer Networks. Wenzhong Li. Nanjing University

Application Layer Protocols

Chapter 2 Application Layer

CSCE 463/612 Networks and Distributed Processing Spring 2018

Lecture 7b: HTTP. Feb. 24, Internet and Intranet Protocols and Applications

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

Part I: Network protocols: HTTP and beyond

HyperText Transfer Protocol

1-1. Switching Networks (Fall 2010) EE 586 Communication and. September Lecture 10

The Application Layer: SMTP, FTP

Chapter 2: Application Layer last updated 22/09/03

Chapter 2: Application Layer. Chapter 2 Application Layer. Some network apps. Application architectures. Chapter 2: Application layer

Chapter 2 APPLICATIONS. Computer Networks Timothy Roscoe Summer 2007

CS 3516: Computer Networks

Chapter 2 Application Layer

Application Layer. Goals:

Application Layer. Applications and application-layer protocols. Goals:

Part 2: Application Layer

Chapter 2 Application Layer

CS 418 Web Programming Spring 2013 SENDING SCOTT G. AINSWORTH.

SMTP. George Porter CSE 124 February 12, 2015

Computer Networks and Applications

SCS3004 Networking Technologies Application Layer Protocols

EECS 3214: Computer Network Protocols and Applications

The Application Layer: & SMTP

Chapter P2P file sharing network applications 2.22 Web and HTTP 2.3 FTP DNS

Foundations of Telematics

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

Applications & Application-Layer Protocols: The Web & HTTP

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

Different Layers Lecture 21

Internet applications. 2: Application Layer 1

Chapter 2. Application Layer. Chapter 2: Application Layer. Application layer - Overview. Some network apps. Creating a network appication

Network Application. Topic. Principle of Network Application. Principle of Network Application

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

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

Chapter 2 outline. 2.1 Principles of app layer protocols

CSEN 404 Introduction to Networks. Mervat AbuElkheir Mohamed Abdelrazik. ** Slides are attributed to J. F. Kurose

Network Applications Principles of Network Applications

Operating Systems CS 571

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

Chapter 2 Application Layer

Application Layer: HTTP

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

DATA COMMUNICATOIN NETWORKING

Application Layer: The Web and HTTP Sec 2.2 Prof Lina Battestilli Fall 2017

CS457 Applications. Fall 2014

CC451 Computer Networks

Computer Network 1 1

Application Layer. Pure P2P architecture. Client-server architecture. Processes communicating. Hybrid of client-server and P2P. Creating a network app

Lecture 04: Application Layer (Part 01) Principles and the World Wide Web (HTTP) Dr. Anis Koubaa

Information Network Systems The application layer. Stephan Sigg

Chapter 2. Application Layer. 2: Application Layer 1

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 5

EECS 3214: Computer Network Protocols and Applications

Readings: Chapter 2: section

Chapter II: Application Layer

CS 716: Introduction to communication networks th class; 11 th Nov Instructor: Sridhar Iyer IIT Bombay

Lecture 05: Application Layer (Part 02) Domain Name System. Dr. Anis Koubaa

CSC358 Week 2. Adapted from slides by J.F. Kurose and K. W. Ross. All material copyright J.F Kurose and K.W. Ross, All Rights Reserved

Computer Networks Unit I Application layer (2012 pattern)

Chapter 1 Introduction

Chapter 2 Application Layer

Lecture 2 - Application Layer. Lecture 1 Review. Application Layer. Principles of network applications. Notes. Notes. Notes. Notes

Application Layer. Pure P2P architecture. Client-server architecture. Processes communicating. Hybrid of client-server and P2P. Creating a network app

Chapter 2: Application layer

Chapter 2 Application Layer

Review for Internet Introduction

Chapter 2: Application Layer

Web caches (proxy server)

Computer Networking. Chapter #1. Dr. Abdulrhaman Alameer

Application Layer. Application Layer 1. By Mikkel Christiansen for NA mm7 Spring 2004

Transcription:

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

Application-layer protocols Application: communicating, distributed processes running in network hosts in user space exchange messages to implement app e.g., email, file transfer, the Web Application-layer protocols one piece of an app define messages exchanged by apps and actions taken user services provided by lower layer protocols application transport network data link physical application transport network data link physical application transport network data link physical

Network applications A process is a program that is running within a host. Within the same host, two processes communicate with interprocess communication defined by the OS. Processes running in different hosts communicate with an application-layer protocol A user agent is an interface between the user and the network application. Web:browser E-mail: mail reader streaming audio/video: media player

Client- paradigm Client: Typical network app has two pieces: client and initiates contact with ( speaks first ) typically requests service from, for Web, client is implemented in browser; for e-mail, in mail reader Server: provides requested service to client e.g., Web sends requested Web page, mail delivers e- mail application transport network data link physical request reply application transport network data link physical

Application-layer protocols API: application programming interface defines interface between application and transport layer socket: Internet API two processes communicate by sending data into socket, reading data out of socket Q: how does a process identify the other process with which it wants to communicate? IP address of host running other process port number - allows receiving host to determine to which local process the message should be delivered

The World Wide Web Web page: consists of objects addressed by a URL Most Web pages consist of: base HTML page, and several referenced objects. Example: page and 5 images URL has two components: host name and path name: User agent for Web is called a browser: Chrome Internet Explorer Firefox Server for Web is called Web : Apache (public domain) MS Internet Information Server www.someschool.edu/somedept/pic.gif

The Web: the http protocol http: hypertext transfer protocol Web s application layer protocol client/ model client: browser that requests, receives, displays Web objects : Web sends objects in response to requests http1.0: RFC 1945 http1.1: RFC 2068 PC running Explorer Mac running Navigator Server running NCSA Web

The http protocol: more http: TCP transport service client initiates TCP connection (creates socket) to, port 80 accepts TCP connection from client http messages (applicationlayer protocol messages) exchanged between browser (http client) and Web (http ) TCP connection closed http is stateless maintains no information about past client requests Protocols that maintain state are complex! aside past history (state) must be maintained if /client crashes, their views of state may be inconsistent, must be reconciled

Non-persistent and persistent connections Non-persistent parses request, responds, and closes TCP connection 2 RTTs to fetch each object Each object transfer suffers from slow start Parallel TCP connections. Persistent on same TCP connection:, parses request, responds, parses new request,.. Client sends requests for all referenced objects as soon as it receives base HTML. Fewer RTTs and less slow start.

time http example Suppose user enters URL www.someschool.edu/somedepartment/home.index 1a. http client initiates TCP connection to http (process) at www.someschool.edu. Port 80 is default for http. 2. http client sends http request message (containing URL) into TCP connection socket (contains text, references to 10 jpeg images) 1b. http at host www.someschool.edu waiting for TCP connection at port 80. accepts connection, notifying client 3. http receives request message, forms response message containing requested object (somedepartment/home.index), sends message into socket

http example (cont.) time 5. http client receives response message containing html file, displays html. Parsing html file, finds 10 referenced jpeg objects 6. Steps 1-5 repeated for each of 10 jpeg objects 4. http closes TCP connection.

http message format: request two types of http messages: request, response http request message: ASCII (human-readable format) request line (GET, POST, HEAD commands) Carriage return, line feed indicates end of message header lines GET /somedir/page.html HTTP/1.1 Host: www.someschool.edu Connection: close User-agent: Mozilla/4.0 Accept: text/html, image/gif,image/jpeg Accept-language:fr (extra carriage return, line feed)

http request message: general format

http message format: respone status line (protocol status code status phrase) data, e.g., requested html file header lines HTTP/1.1 200 OK Connection: Close Date: Thu, 06 Aug 1998 12:00:15 GMT Server: Apache/1.3.0 (Unix) Last-Modified: Mon, 22 Jun 1998... Content-Length: 6821 Content-Type: text/html data data data data data...

http response status codes In first line in ->client response message. A few sample codes: 200 OK request succeeded, requested object later in this message 301 Moved Permanently requested object moved, new location specified later in this message (Location:) 400 Bad Request request message not understood by 404 Not Found requested document not found on this 505 HTTP Version Not Supported

User- interaction: authentication Authentication goal: control access to documents stateless: client must present authorization in each request authorization: typically name, password authorization: header line in request if no authorization presented, refuses access, sends WWW authenticate: header line in response client usual http request msg 401: authorization req. WWW authenticate: usual http request msg + Authorization:line usual http response msg usual http request msg + Authorization:line usual http response msg time Browser caches name & password so that user does not have to repeatedly enter it.

User- interaction: cookies sends cookie to client in response mst Set-cookie: 1678453 client presents cookie in later requests cookie: 1678453 matches presented-cookie with -stored info authentication remembering user preferences, previous choices client usual http request msg usual http response + Set-cookie: # usual http request msg cookie: # usual http response msg usual http request msg cookie: # usual http response msg cookiespectific action cookiespectific action

User- interaction: conditional GET Goal: don t send object if client has up-to-date stored (cached) version client: specify date of cached copy in http request If-modified-since: <date> : response contains no object if cached copy upto-date: HTTP/1.0 304 Not Modified client http request msg If-modified-since: <date> http response HTTP/1.0 304 Not Modified http request msg If-modified-since: <date> http response HTTP/1.1 200 OK <data> object not modified object modified

Web Caches (proxy ) Goal: satisfy client request without involving origin user sets browser: Web accesses via web cache client sends all http requests to web cache client Proxy origin if object at web cache, web cache immediately returns object in http response else requests object from origin, then returns http response to client client origin

Why Web Caching? Assume: cache is close to client (e.g., in same network) smaller response time: cache closer to client decrease traffic to distant s link out of institutional/local ISP network often bottleneck institutional network public Internet 1.5 Mbps access link 10 Mbps LAN origin s institutional cache

Electronic Mail Three major components: user agents mail s simple mail transfer protocol: smtp User Agent a.k.a. mail reader composing, editing, reading mail messages e.g., Thunderbird, Outlook outgoing, incoming messages stored on (it is possible to save copies in the user agent device) SMTP mail mail user agent user agent SMTP SMTP user agent mail outgoing message queue user mailbox user agent user agent user agent

Electronic Mail: mail s Mail Servers mailbox contains incoming messages (yet to be read) for user message queue of outgoing (to be sent) mail messages smtp protocol between mail s to send email messages client: sending mail : receiving mail SMTP mail mail user agent user agent SMTP SMTP user agent mail user agent user agent user agent

Electronic Mail: smtp [RFC 821] uses tcp to reliably transfer email msg from client to, port 25 direct transfer: sending to receiving 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

Sample smtp interaction S: 220 hamburger.edu C: HELO crepes.fr S: 250 Hello crepes.fr, pleased to meet you C: MAIL FROM: <alice@crepes.fr> S: 250 alice@crepes.fr... Sender ok C: RCPT TO: <bob@hamburger.edu> S: 250 bob@hamburger.edu... Recipient ok C: DATA S: 354 Enter mail, end with "." on a line by itself C: Do you like ketchup? C: How about pickles? C:. S: 250 Message accepted for delivery C: QUIT S: 221 hamburger.edu closing connection

Mail message format smtp: protocol for exchanging email msgs RFC 822: standard for text message format: header lines, e.g., To: From: body Subject: different from smtp commands! the message, ASCII characters only header body blank line

Message format: multimedia extensions MIME: multimedia mail extension, RFC 2045, 2056 additional lines in msg header declare MIME content type MIME version method used to encode data multimedia data type, subtype, parameter declaration encoded data From: alice@crepes.fr To: bob@hamburger.edu Subject: Picture of yummy crepe. MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Type: image/jpeg base64 encoded data.........base64 encoded data

MIME types Content-Type: type/subtype; parameters Text example subtypes: plain, html Video example subtypes: mpeg, quicktime Image example subtypes: jpeg, gif Audio exampe subtypes: basic (8-bit mu-law encoded), 32kadpcm (32 kbps coding) Application other data that must be processed by reader before viewable example subtypes: msword

Multipart Type From: alice@crepes.fr To: bob@hamburger.edu Subject: Picture of yummy crepe. MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=98766789 --98766789 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain Dear Bob, Please find a picture of a crepe. --98766789 Content-Transfer-Encoding: base64 Content-Type: image/jpeg base64 encoded data.........base64 encoded data --98766789--

Mail access protocols user agent SMTP SMTP POP3 or IMAP user agent sender s mail receiver s mail SMTP: delivery/storage to receiver s Mail access protocol: retrieval from POP: Post Office Protocol [RFC 1939] authorization (agent <-->) and download IMAP: Internet Mail Access Protocol [RFC 1730] more features (more complex) manipulation of stored msgs on HTTP: Hotmail, Yahoo! Mail, etc.

POP3 protocol authorization phase client commands: user: declare username pass: password responses +OK -ERR transaction phase, client: list: list message numbers retr: retrieve message by number dele: delete quit S: +OK POP3 ready C: user alice S: +OK C: pass hungry S: +OK user successfully logged on C: list S: 1 498 S: 2 912 S:. C: retr 1 S: <message 1 contents> S:. C: dele 1 C: retr 2 S: <message 1 contents> S:. C: dele 2 C: quit S: +OK POP3 signing off

DNS: Domain Name System People: many identifiers: SSN, name, Passport # Internet hosts, routers: IP address (32 bit) - used for addressing datagrams name, e.g., gaia.cs.umass.edu - used by humans Q: map between IP addresses and name? Domain Name System: distributed database implemented in hierarchy of many name s application-layer protocol host, routers, name s to communicate to resolve names (address/name translation) note: core Internet function implemented as application-layer protocol complexity at network s edge

DNS name s Why not centralize DNS? single point of failure traffic volume distant centralized database maintenance doesn t scale! no has all nameto-ip address mappings local name s: each ISP, company has local (default) name host DNS query first goes to local name authoritative name : for a host: stores that host s IP address, name can perform name/address translation for that host s name

DNS: Root name s contacted by local name that can not resolve name root name : contacts authoritative name if name mapping not known gets mapping returns mapping to local name ~ dozen root name s worldwide

Simple DNS example root name host surf.eurecom.fr wants IP address of gaia.cs.umass.edu 1. Contacts its local DNS, dns.eurecom.fr 2. dns.eurecom.fr contacts root name, if necessary 3. root name contacts authoritative name, dns.umass.edu, if necessary local name dns.eurecom.fr 1 2 6 requesting host surf.eurecom.fr 5 3 4 authorititive name dns.umass.edu gaia.cs.umass.edu

DNS example root name Root name : may not know authoratiative name may know intermediate name : who to contact to find authoritative name local name dns.eurecom.fr 1 2 8 7 3 6 intermediate name dns.umass.edu 4 5 requesting host surf.eurecom.fr authoritative name dns.cs.umass.edu gaia.cs.umass.edu

DNS: iterated queries root name recursive query: puts burden of name resolution on contacted name heavy load? 2 3 4 7 iterated query iterated query: contacted replies with name of to contact I don t know this name, but ask this local name dns.eurecom.fr 1 8 requesting host surf.eurecom.fr intermediate name dns.umass.edu 5 6 authoritative name dns.cs.umass.edu gaia.cs.umass.edu

DNS records DNS: distributed db storing resource records (RR) RR format: (name, value, type,ttl) Type=A name is hostname value is IP address Type=NS name is domain (e.g. foo.com) value is IP address of authoritative name for this domain Type=CNAME name is an alias name for some cannonical (the real) name value is cannonical name Type=MX value is hostname of mail associated with name

DNS protocol, messages DNS protocol : query and reply messages, both with same message format msg header identification: 16 bit # for query, reply to query uses same # flags: query or reply recursion desired recursion available reply is authoritative

DNS protocol, messages Name, type fields for a query RRs in reponse to query records for authoritative s additional helpful info that may be used