Computer Networks and Applications

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

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

Review of Previous Lecture

Chapter 2 Application Layer

Chapter 2 Application Layer

CSC 4900 Computer Networks:

Introduction to the Application Layer. Computer Networks Term B14

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

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

EECS 3214: Computer Network Protocols and Applications

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

Application Layer: HTTP

Chapter 2 Application Layer. Lecture 4: principles of network applications. Computer Networking: A Top Down Approach

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

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

Chapter 2 Application Layer

Goal and A sample Network App

CSC 401 Data and Computer Communications Networks

Foundations of Telematics

Web, HTTP and Web Caching

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

Chapter 2: Application layer

CMSC 322 Computer Networks Applications and End-To- End

CS 3516: Advanced Computer Networks

CSC 4900 Computer Networks: End-to-End Design

WWW: the http protocol

CMSC 332 Computer Networking Web and FTP

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

DATA COMMUNICATOIN NETWORKING

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

Lecture 6: Application Layer Web proxies, , and SMTP

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

HyperText Transfer Protocol

Layered Model. DoD Model. ISO/OSI Model

Computer Networks. Wenzhong Li. Nanjing University

Chapter 2 Application Layer

Protocol Layers, Security Sec: Application Layer: Sec 2.1 Prof Lina Battestilli Fall 2017

Chapter 2 Application Layer

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

Chapter 2 Application Layer

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

Chapter 1 Introduction

Lecture 11. Transport Layer (cont d) Transport Layer 1

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

SCS3004 Networking Technologies Application Layer Protocols

Chapter 1 Introduction

Application Layer Protocols

CSCE 463/612 Networks and Distributed Processing Spring 2018

1. What is a Computer Network? interconnected collection of autonomous computers connected by a communication technology

Internet and Intranet Protocols and Applications

CS 3516: Advanced Computer Networks

Different Layers Lecture 21

Chapter 2: Application Layer. Chapter 2: application layer. outline. Some network apps. Client-server architecture. Application architectures

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

Network Applications Principles of Network Applications

Review for Internet Introduction

Chapter II: Application Layer

Application Layer Chapter 2

Application Protocols and HTTP

CS 3516: Computer Networks

Internet Architecture & Performance. What s the Internet: nuts and bolts view

Client/Server Computing

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

Part 1: Introduction. Goal: Review of how the Internet works Overview

Client/Server Computing & Socket Programming

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

Computer Networking. Chapter #1. Dr. Abdulrhaman Alameer

Lecture 2 Communication services The Trasport Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

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

Chapter 2 Application Layer

Chapter 2 Application Layer

Module 2 Overview of Computer Networks

Module 2 Overview of. Computer Networks

Lecture 12. Application Layer. Application Layer 1

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

Internet communication

EECS 3214: Computer Network Protocols and Applications

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

Applications & Application-Layer Protocols: The Web & HTTP

Introduction to computer networking

The Application Layer: SMTP, FTP

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

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

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

Web Protocols and Practice

Chapter 2 Application Layer

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

Chapter 2: Application layer

Chapter 2 Application Layer

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

Chapter 2. Application Layer. 2: Application Layer 1

CS 43: Computer Networks. Layering & HTTP September 7, 2018

CS 204: Advanced Computer Networks

Chapter 1. Computer Networks and the Internet

Application layer. Some network apps. Client-server architecture. Hybrid of client-server and P2P. Pure P2P architecture. Creating a network app

Chapter 1: Introduction

Information Network Systems The application layer. Stephan Sigg

The Application Layer: & SMTP

CSC 257/457 Computer Networks. Fall 2017 MW 4:50 pm 6:05 pm CSB 601

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

Transcription:

COMP 3331/COMP 9331 Week 2 Introduction(Protocol Layering) & Application Layer (Principles, Web, E- mail) Reading Guide: Chapter 1, Sections 1.5 Chapter 2, Sections 2.1-2.4 Week2: Introduction & Application 1

One minute recap of course intro Web: http://www.cse.unsw.edu.au/~cs3331 Read course outline on the webpage E-mail: cs3331@cse.unsw.edu.au NOT personal e-mail Forum Register & Use It Want to exchange your lab time? - Post on the forum Labs begin Week 3 Please attend your allocated slot Exercise will be posted on the webpage (Lab Exercises) You MUST have a CSE account Yellow Form (Online: https://www.cse.unsw.edu.au/newacc.php) Week2: Introduction & Application 2

Timing Diagram of Packet Switching Host A Router 1 Router 2 Host B transmission time of Packet 1 at Host A Packet 1 Packet 2 Packet 3 propagation delay from Host A to Node 1 Packet 1 Packet 2 Packet 3 processing delay of Packet 1 at Node 2 Packet 1 Packet 2 time Packet 3 Introduction 3

Queuing Delay Depends on the nature of the arriving traffic Bursty Arrivals Assume link serves one packet in 1 second Buffer is empty before the 1 st packet arrives 1 pkt/sec 4 packets arrive back-to-back What is the queuing delay for the 4 packets? Periodic Arrivals Assume that packets arrive 1 second apart What is the queuing delay for the 4 packets? 1 pkt/sec Introduction 4

Queueing delay Depends on the arrival rate of traffic and also its nature: bursty or periodic R=link bandwidth (bps) L=packet length (bits) a=average packet arrival rate (pkts per second) traffic intensity = La/R La/R ~ 0: average queueing delay small La/R -> 1: delays become large La/R > 1: more work arriving than can be serviced, average delay infinite! Periodic arrival at L/R, no queuing Arrival in bursts: large delay for packets at the end Introduction 5

Notes Note that the previous slide assumes that the buffer is infinitely large. In practice, the buffer is finite and a high traffic intensity means longer delay as well as more packet loss. See the applet simulation at: http://wps.aw.com/ aw_kurose_network_4/0,13091,4173752-,00.html Please search on google for applets Kurose Ross if this link doesn t work. Week2: Introduction & Application 6

Introduction: roadmap 1.1 What is the Internet? 1.2 Network edge end systems, access networks, links 1.3 Network core circuit switching, packet switching, network structure 1.4 Delay, loss and throughput in packet-switched networks 1.5 Protocol layers, service models 1.7 History (self study) Week2: Introduction & Application 7

Protocol Layers Networks are complex! many pieces : hosts routers links of various media applications protocols hardware, software Question: Is there any hope of organising structure of network? Or at least our discussion of networks? Layering is one of the most important organising principles in computer networking Week2: Introduction & Application 8

Why layering? Dealing with complex systems: explicit structure allows identification, relationship of complex system s pieces layered reference model for discussion modularisation eases maintenance, updating of system change of implementation of layer s service transparent to rest of system layering considered harmful? duplication of functionality Information hiding can be a problem Week2: Introduction & Application 9

An Example: No Layering Application Telnet FTP HTTP Transmission Media Ethernet Fiber optic Wireless No layering: each new application has to be reimplemented for every network technology! Week2: Introduction & Application 10

An Example: Benefit of Layering Introducing an intermediate layer provides a common abstraction for various network technologies Application Telnet FTP HTTP Transport & Network Transmission Media Ethernet Fiber optic Wireless Week2: Introduction & Application 11

Internet protocol stack application: supporting network applications FTP, SMTP, HTTP transport: host-host data transfer TCP, UDP network: routing of datagrams from source to destination IP, routing protocols link: data transfer between neighboring network elements PPP, Ethernet physical: bits on the wire application transport network link physical Telnet Email TCP UDP IP WWW Ethernet WiFi PPP Week2: Introduction & Application 12

message segment datagram frame H l H n H n H t H t H t M M M M source application transport network link physical Encapsulation link physical H l H n H t M H l H n H t M switch H l H n H n H t H t H t M M M M destination application transport network link physical H l H n H n H t H t M M network link physical H l H n H n H t H t M M router Week2: Introduction & Application 13

Our roadmap 1.1 What is the Internet? 1.2 Network edge end systems, access networks, links 1.3 Network core circuit switching, packet switching, network structure 1.4 Delay, loss and throughput in packet-switched networks 1.5 Protocol layers, service models 1.7 History (Self study) Week2: Introduction & Application 14

Introduction: Summary Covered a ton of material! Internet overview what s a protocol? network edge, core, access network packet-switching versus circuitswitching Internet/ISP structure performance: loss, delay, throughput layering and service models History (self study) You now have: context, overview, feel of networking more depth, detail to follow! Sample Questions for Introduction have been uploaded. Solutions will be put up after 2 weeks Please attempt them on your own. This will be of immense help for exam preparation Discuss on forum Week2: Introduction & Application 15

Podcars the packets of vehicular transport Automatic driverless vehicles available on demand Connection to the Internet Know where the podcars are, hail them, Podcar systems bear some similarity to packet switching! Week2: Introduction & Application 16 http://www.arup.com/publications/slimcity.aspx

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 SMTP / POP3 / IMAP DNS P2P programming network applications (for Assignments) socket API Week2: Introduction & Application 17

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 Virtual words. Can you think of any new ones? You could make millions or change the world Week2: Introduction & Application 18

Application layer: Roadmap 2.1 Principles of network applications 2.2 Web and HTTP 2.4 Electronic Mail SMTP, POP3, IMAP 2.5 DNS 2.6 P2P file sharing 2.7 Socket programming with TCP 2.8 Socket programming with UDP Week2: Introduction & Application 19

Creating a network app Write programs that run on different end systems and communicate over a network e.g., Web server software communicates with browser software No software written for devices in network core Network core devices do not function at app layer This design allows for rapid app development application transport network data link physical application transport network data link physical application transport network data link physical Week2: Introduction & Application 20

Application architectures Client-server Peer-to-peer (P2P) Hybrid of client-server and P2P Week2: Introduction & Application 21

Client-server architecture server: always-on host permanent IP address server farms for scaling client/server clients: communicate with server may be intermittently connected may have dynamic IP addresses do not communicate directly with each other Week2: Introduction & Application 22

Pure P2P architecture no always on server arbitrary end systems directly communicate peers are intermittently connected and change IP addresses Example: Gnutella peer-peer Highly scalable But difficult to manage Week2: Introduction & Application 23

Hybrid of client-server and P2P 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 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 Week2: Introduction & Application 24

Processes communicating Process: program running within a host. within same host, two processes communicate using inter-process communication (defined by OS). processes in different hosts communicate by exchanging messages Client process: process that initiates communication Server process: process that waits to be contacted Note: applications with P2P architectures have client processes & server processes Week2: Introduction & Application 25

Sockets process sends/receives messages to/from its socket socket analogous to door sending process shoves message out door sending process relies on transport infrastructure on other side of door which brings message to socket at receiving process host or server process socket TCP with buffers, variables controlled by app developer controlled by OS Internet host or server process socket TCP with buffers, variables API: (1) choice of transport protocol; (2) ability to fix a few parameters (lots more on this later) Week2: Introduction & Application 26

Addressing processes For a process to receive messages, it must have an identifier A host has a unique 32-bit IP address (a.b.c.d) Q: does the IP address of the host on which the process runs suffice for identifying the process? Answer: No, many processes can be running on same host Identifier includes both the IP address and port numbers associated with the process on the host. Example port numbers: HTTP server: 80 Mail server: 25 http://www.iana.org to send HTTP message to CSE (albeniz.orchestra.cse.unsw.edu. au) web server: IP address: 129.94.242.51 Port number: 80 More on this later Week2: Introduction & Application 27

App-layer protocol defines Types of messages exchanged, e.g., request & response messages Syntax of message types: what fields in messages & how fields are delineated Semantics of the fields: 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., Skype Application-layer protocols one piece of an app define messages exchanged by apps and actions taken Implementing application services by using the service provided by the lower layer, i.e., the transport layer Week2: Introduction & Application 28

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 Security Encryption, data integrity, Week2: Introduction & Application 29

Transport service requirements of common apps Application Data loss Bandwidth Time Sensitive file transfer e-mail no loss no loss elastic elastic no no Web documents no loss elastic no real-time audio/video loss-tolerant audio: 5kbps-1Mbps yes, 100 s msec stored audio/video interactive games instant messaging video:10kbps-5mbps loss-tolerant same as above yes, few secs loss-tolerant few kbps up yes, 100 s msec no loss elastic yes but a bit relaxed Week2: Introduction & Application 30

Internet transport protocols services TCP service: connection-oriented: setup required between client and server processes reliable transport between sending and receiving process flow control: sender won t overwhelm receiver congestion control: throttle sender when network overloaded does not provide: timing, minimum throughput guarantees, security UDP service: unreliable data transfer between sending and receiving process does not provide: connection setup, reliability, flow control, congestion control, timing, throughput guarantee or security Q: why bother? Why is there a UDP? NOTE: More on transport in Weeks 4 and 5 Week2: Introduction & Application 31

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] HTTP (e.g. Youtube) RTP (RFC 1889) SIP, RTP, proprietary (e.g., Skype) Underlying transport protocol TCP TCP TCP TCP TCP or UDP typically UDP Week2: Introduction & Application 32

Internet applications If you compare the Internet enable media (e.g. YouTube) and the traditional medium (e.g. ABC TV), what new features do you find? Do you know of any new Internet applications? Week2: Introduction & Application 33

New application: Smart-grid Week2: Introduction & Application 34

Application layer: Roadmap 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 applications 2.7 Socket programming with TCP 2.8 Socket programming with UDP Some of the material here, e.g. descriptive details on the various protocols, is for self-study The lecture will focus on design issues Week2: Introduction & Application 35

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 Week2: Introduction & Application 36

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 Firefox Week2: Introduction & Application 37

HTTP overview (continued) Uses TCP: client initiates TCP connection (creates socket) to server, port 80 server accepts TCP connection from client HTTP messages (application-layer protocol messages) exchanged between browser (HTTP client) and Web server (HTTP server) TCP connection closed HTTP is stateless server maintains no information about past client requests Protocols that maintain state are complex! past history (state) must be maintained if server/client crashes, their views of state may be inconsistent, must be reconciled aside Week2: Introduction & Application 38

HTTP connections Nonpersistent HTTP At most one object is sent over a TCP connection. HTTP/1.0 uses nonpersistent HTTP Persistent HTTP Multiple objects can be sent over single TCP connection between client and server. HTTP/1.1 uses persistent connections in default mode Week2: Introduction & Application 39

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 2. HTTP client sends HTTP request message (containing URL) into TCP connection socket. Message indicates that client wants object somedepartment/home.index (contains text, references to 10 jpeg images) 1b. HTTP server at host www.someschool.edu waiting for TCP connection at port 80. accepts connection, notifying client 3. HTTP server receives request message, forms response message containing requested object, and sends message into its socket time Week2: Introduction & Application 40

Nonpersistent HTTP (cont.) 5. HTTP client receives response message containing html file, displays html. Parsing html file, finds 10 referenced jpeg objects 4. HTTP server closes TCP connection. time 6. Steps 1-4 repeated for each of 10 jpeg objects Q. How many TCP connections are involved? Week2: Introduction & Application 41

Response time modeling 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 initiate TCP connection RTT request file By drawing the timing diagrams for HTTP 1.0 and HTTP 1.1, you will understand why HTTP 1.1 is superior. Try this. It s also a sample problem to be discussed at the end of Week 4 s Lab RTT file received time time time to transmit file Week2: Introduction & Application 42

Persistent HTTP Nonpersistent HTTP issues: requires 2 RTTs per object OS must work and allocate host resources for each TCP connection but 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 are sent over 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.1 client sends requests as soon as it encounters a referenced object as little as one RTT for all the referenced objects Week2: Introduction & Application 43

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

HTTP response message (Self-Study) 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... Week2: Introduction & Application 45

HTTP response status codes (Self- Study) In first line in server->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 server 404 Not Found requested document not found on this server 505 HTTP Version Not Supported Week2: Introduction & Application 46

Web caches (proxy server) Goal: satisfy client request without involving origin server user sets browser: Web accesses via cache browser sends all HTTP requests to cache object in cache: cache returns object else cache requests object from origin server, then returns object to client client Proxy server origin server client origin server Week2: Introduction & Application 47

More about Web caching Cache acts as both client and server Typically cache is installed by ISP (university, company, residential ISP) Why Web caching? Reduce response time for client request Reduce traffic on an institution s access link Internet dense with caches: enables poor content providers to effectively deliver content (but so does P2P file sharing) Week2: Introduction & Application 48

Caching example: assumptions: v avg object size: 100K bits v avg request rate from browsers to origin servers:15/ sec v avg data rate to browsers: 1.50 Mbps v RTT from institutional router to any origin server: 2 sec v access link rate: 1.54 Mbps consequences: v LAN utilization: 15% v access link utilization = 99% v total delay = Internet delay + access delay + LAN delay = 2 sec + minutes + usecs problem! institutional network public Internet 1.54 Mbps access link origin servers 1 Gbps LAN Application Layer 2-49

Caching example: fatter access link assumptions: v avg object size: 100K bits v avg request rate from browsers to origin servers:15/ sec v avg data rate to browsers: 1.50 Mbps v RTT from institutional router to any origin server: 2 sec v access link rate: 1.54 Mbps consequences: v LAN utilization: 15% v access link utilization = 99% 9.9% v total delay = Internet delay + access delay + LAN delay = 2 sec + minutes + usecs msecs 154 Mbps institutional network public Internet Cost: increased access link speed (not cheap!) 1.54 Mbps access link origin servers 1 Gbps LAN Application Layer 154 Mbps 2-50

Caching example: install local cache assumptions: v avg object size: 100K bits v avg request rate from browsers to origin servers:15/ sec v avg data rate to browsers: 1.50 Mbps v RTT from institutional router to any origin server: 2 sec v access link rate: 1.54 Mbps Cost: web cache (cheap!) How to compute link utilization, delay? institutional network public Internet 1.54 Mbps access link origin servers 1 Gbps LAN local web cache Application Layer 2-51

Caching example: install local cache Calculating access link utilization, delay with cache: suppose cache hit rate is 0.4 40% requests satisfied at cache, 60% requests satisfied at origin v access link utilization: 60% of requests use access link v data rate to browsers over access link = 0.6*1.50 Mbps =.9 Mbps utilization = 0.9/1.54 =.58 v total delay = 0.6 * (delay from origin servers) +0.4 * (delay when satisfied at cache) = 0.6 (2.01) + 0.4 (~msecs) = ~ 1.2 secs less than with 154 Mbps link (and cheaper too!) institutional network public Internet 1.54 Mbps access link origin servers 1 Gbps LAN local web cache Application Layer 2-52

Conditional GET Goal: don t send object if cache has up-to-date cached version cache: specify date of cached copy in HTTP request If-modified-since: <date> server: response contains no object if cached copy is up-to-date: HTTP/1.0 304 Not Modified cache HTTP request msg If-modified-since: <date> HTTP response HTTP/1.0 304 Not Modified server object not modified HTTP request msg If-modified-since: <date> HTTP response HTTP/1.0 200 OK <data> object modified Week2: Introduction & Application 53

Web proxy in practice Your local ISP would typically have a Web proxy server (check your configuration at home) CSE has a proxy server Check settings of any browser on a cse machine www-proxy.cse.unsw.edu.au Port number 3128 Week2: Introduction & Application 54

Content distribution networks (CDN) A new type of industry Let us see what the problem is (next slide) CDN deploy caches all over the world Caches are connected via the Internet or dedicated networks If a website employs the service of a CDN, the CDN stores the popular content of the website in its caches A request is directed to the closest CDN caches Week2: Introduction & Application 55

Why CDN? Delay can be high for far away customers. What is possibly the dominating form of delay? Week2: Introduction & Application 56

Basic concepts of CDN Origin server CDN caches Week2: Introduction & Application 57

Application layer: Roadmap 2.1 Principles of network applications 2.2 Web and HTTP 2.4 Electronic Mail SMTP, POP3, IMAP 2.5 DNS 2.6 P2P Applications 2.7 Socket programming with TCP 2.8 Socket programming with UDP 2.4 Mostly self-study Week2: Introduction & Application 58

Application layer: Roadmap 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 Applications 2.7 Socket programming with TCP 2.8 Socket programming with UDP Week2: Introduction & Application 59

Hotmail General Information: Not on Exam Dec 1995: Sabeer Bhatia and Jack Smith developed the idea of free Webbased e-mail Formed HOTMAIL: 3 full-time and a few part-time staff (meager pay + stock options) July 1996: Launched Aug 1996: 100,000 subscribers Dec 1997: 12 million subscribers Acquired by Microsoft for 400$ million - Now MSN Why was Hotmail such a big success?? first-mover advantage Viral marketing Week2: Introduction & Application 60

Electronic Mail Three major components: user agents mail servers simple mail transfer protocol: SMTP User Agent a.k.a. mail reader composing, editing, reading mail messages e.g., Outlook, Thunderbird, Mail, pine outgoing, incoming messages stored on server mail server SMTP mail server user agent user agent SMTP SMTP user agent mail server outgoing message queue user mailbox user agent user agent user agent Week2: Introduction & Application 61

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 mail server SMTP user agent SMTP mail server user agent user agent server : receiving mail server mail server SMTP user agent user agent user agent Week2: Introduction & Application 62

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 Week2: Introduction & Application 63

Scenario: Alice sends message to Bob 1) Alice uses UA to compose message and addresses it to bob@unsw.edu.au 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 1 user agent mail mail server server 2 3 4 5 6 user agent Week2: Introduction & Application 64

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 Week2: Introduction & Application 65

Try SMTP interaction for yourself: telnet servername 25 see 220 reply from server enter HELO, MAIL FROM, RCPT TO, DATA, QUIT commands above lets you send email without using email client (aka user agent) You will do this as part of Lab 1 Week2: Introduction & Application 66

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 SMTP: message also 7-bit ASCII HTTP: No such restriction HTTP: each object encapsulated in its own response msg SMTP: multiple objects sent in multipart msg Week2: Introduction & Application 67

Mail message format SMTP (RFC5321): protocol for exchanging email msgs RFC 2822 (5322): standard for text message format: header lines, e.g., To: body From: Subject: different from SMTP commands! the message, ASCII characters only header body blank line Week2: Introduction & Application 68

Mail access protocols user agent SMTP SMTP access protocol The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again. user agent sender s mail server receiver s mail server SMTP: delivery/storage to receiver s server Mail access protocol: retrieval from server POP: Post Office Protocol [RFC 1939] authorization (agent <-->server) and download IMAP: Internet Mail Access Protocol [RFC 1730] more features (more complex) manipulation of stored msgs on server HTTP: gmail, Yahoo! Mail, MSN, etc. Week2: Introduction & Application 69

Quiz - E-mail SMTP is used to To transfer messages from one mail server to another To define the format of message headers To transfer messages from mail server to a user agent All of the above With SMTP it is possible to send multiple mail messages over the same TCP connection True or False Week2: Introduction & Application 70

Quiz - App Layer Internet telephony typically runs over TCP UDP HTTP None of the above Week2: Introduction & Application 71

Summary Completed Introduction (Read Chapter 1) Application Layer Principles of Network Applications HTTP E-mail Labs Begin Next Week (Week 3) Next Week: Application Layer (contd.) DNS P2P Socket Programming Week2: Introduction & Application 72