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

Similar documents
CS 43: Computer Networks. HTTP September 10, 2018

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

DATA COMMUNICATOIN NETWORKING

Chapter 2 Application Layer

Lecture 04: Application Layer (Part 01) Principles and the World Wide Web (HTTP) 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

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

EECS 3214: Computer Network Protocols and Applications

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

Chapter 2: Application layer

Chapter 2 Application Layer

Application Layer: HTTP

ECE697AA Lecture 2. Today s lecture

CMSC 332 Computer Networking Web and FTP

Application Protocols and HTTP

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

HyperText Transfer Protocol

Applications & Application-Layer Protocols: The Web & HTTP

COSC4377. Chapter 2: Outline

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

Review of Previous Lecture

Chapter 2 Application Layer

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

CS 3640: Introduction to Networks and Their Applications

Chapter 1 Introduction

Web, HTTP and Web Caching

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

Applications & Application-Layer Protocols: The Web & HTTP

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

Computer Systems and Networks

Layered Model. DoD Model. ISO/OSI Model

CS6421: Distributed Systems

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

The HTTP protocol. Fulvio Corno, Dario Bonino. 08/10/09 http 1

Introduction to Internet, Web, and TCP/IP Protocols SEEM

Computer Networks. Wenzhong Li. Nanjing University

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

Review for Internet Introduction

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar

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

Chapter II: Application Layer

Application Layer Introduction; HTTP; FTP

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

CS 43: Computer Networks The Link Layer. Kevin Webb Swarthmore College November 28, 2017

WWW: the http protocol

Chapter 2 Application Layer

TCP/IP Networking Basics

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

Foundations of Telematics

WEB TECHNOLOGIES CHAPTER 1

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

Chapter 27 WWW and HTTP Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

HTTP TRAFFIC CONSISTS OF REQUESTS AND RESPONSES. All HTTP traffic can be

Web Technology. COMP476 Networked Computer Systems. Hypertext and Hypermedia. Document Representation. Client-Server Paradigm.

World-Wide Web Protocols CS 571 Fall Kenneth L. Calvert All rights reserved

CS 455/555 Spring 2011 Weigle

Internet Architecture. Web Programming - 2 (Ref: Chapter 2) IP Software. IP Addressing. TCP/IP Basics. Client Server Basics. URL and MIME Types HTTP

SCS3004 Networking Technologies Application Layer Protocols

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

CSCD 330 Network Programming Spring 2018

Data Communication EDA344, DIT420 Description of Lab 1 and Optional Programming HTTP Assignment

Sirindhorn International Institute of Technology Thammasat University

Wire Shark Lab1. Intro

Application Level Protocols

162 HW2. David Culler, Arka Bhattacharya, William Liu. September 2014

Introduction to computer networking

Web Client And Server

Computer Networks - A Simple HTTP proxy -

CSC 4900 Computer Networks:

Networking Fundamentals

HTTP Reading: Section and COS 461: Computer Networks Spring 2013

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

CS 355. Computer Networking. Wei Lu, Ph.D., P.Eng.

Computer Networks. General Course Information. Addressing and Routing. Computer Networks 9/8/2009. Basic Building Blocks for Computer Networks

CSE 123A Computer Networks

Announcements Computer Networking. What is the Objective of the Internet? Today s Lecture

SC/CSE 3213 Winter Sebastian Magierowski York University CSE 3213, W13 L8: TCP/IP. Outline. Forwarding over network and data link layers

Notes beforehand... For more details: See the (online) presentation program.

Networking Fundamentals

CSc 450/550 Computer Networks Network Architectures & Client-Server Model

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

How the Internet Works

Discussion 1: Project 1, Networking Basics. CSE 123: Computer Networks Marti Motoyama & Chris Kanich

CSE 333 Lecture HTTP

Jeff Offutt SWE 642 Software Engineering for the World Wide Web

Lecture 3. HTTP v1.0 application layer protocol. into details. HTTP 1.0: RFC 1945, T. Berners-Lee HTTP 1.1: RFC 2068, 2616

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

CSCI-1680 WWW Rodrigo Fonseca

CSCI-1680 WWW Rodrigo Fonseca

Announcements Fawzi Emad, Computer Science Department, UMCP

Lecture 2-ter. 2. A communication example Managing a HTTP v1.0 connection. Managing a HTTP request. transport session. Step 1 - opening transport

Browser behavior can be quite complex, using more HTTP features than the basic exchange, this trace will show us how much gets transferred.

Lecture 12. Application Layer. Application Layer 1

CSE 333 Lecture HTTP

Lecture Overview : Computer Networking. Applications and Application-Layer Protocols. Client-Server Paradigm

Motivation For Networking. Information access Interaction among cooperative application programs Resource sharing

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

Project 1: Web Client and Server

CE 443: Computer Networks

Lecture (03) Network Model

Transcription:

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

Last Class: Five-layer Internet Model Application: the application (e.g., the Web, Email) Transport: end-to-end connections, reliability Network: routing Link (data-link): framing, error detection Physical: 1 s and 0 s/bits across a medium (copper, the air, fiber) Lecture 3 - Slide 2

Last Class: Five-layer Internet Model Physical layer (Cat 5, Coax, Air, Fiber Optics) Application Layer Link Layer (Ethernet, WIFI, Cable) Receiver Transport Layer -share capacity, ordering, error checking, congestion control, Network Layer (IP): Choose paths for data Lecture 3 - Slide 3

OSI Seven-Layer Model Application: the application (e.g., the Web, Email) Presentation: formatting, encoding, encryption Session: sockets, remote procedure call Transport: end-to-end connections, reliability Network: routing Link (data-link): framing, error detection Physical: 1 s and 0 s/bits across a medium (copper, the air, fiber) Lecture 3 - Slide 4

Because of our layering abstractions, we can use any technology we want at any layer. A. Always B. Usually C. Sometimes D. Never Lecture 3 - Slide 5

Internet Protocol Suite FTP HTTP VoIP TFTP Applications TCP UDP Transport IP Thin Waist NET 1 NET 2 NET n Data Link Physical The Hourglass Model Lecture 3 - Slide 6

Putting this all together ROUGHLY, what happens when I click on a Web page from Swarthmore? My computer www.google.com? Internet Lecture 3 - Slide 7

Web request (HTTP) Turn click into HTTP request GET http://www.google.com/ HTTP/1.1 Host: www.google.com Lecture 3 - Slide 8

Name resolution (DNS) Where is www.google.com? My computer (132.239.9.64) Address for www.google.com? Local DNS server (132.239.51.18) Oh, you can find it at 66.102.7.104 Lecture 3 - Slide 9

Data transport (TCP) Break message into packets (TCP segments) Should be delivered reliably & in-order GET http:// www.google.com HTTP/1.1 Host: www.google.com 3 google.c 2 p://www 1 GET htt Lecture 3 - Slide 10

Global Network Addressing Address each packet so it can traverse network and arrive at host My computer (132.239.9.64) www.google.com (66.102.7.104) Destination Source Data 66.102.7.104 132.239.9.64 GET request Lecture 3 - Slide 11

(IP) At Each Router Where do I send this to get it closer to Google? Which is the best route to take? Lecture 3 - Slide 12

Link & Physical Layers Forward to the next node! Share the physical medium. Detect errors. Lecture 3 - Slide 13

TCP/IP Protocol Stack host host HTTP Application Layer HTTP TCP Transport Layer TCP router router IP IP Network Layer IP IP Ethernet interface Ethernet interface SONET SONET interface Link Layer interface Ethernet interface Ethernet interface Lecture 3 - Slide 14

Today Application layer protocol: HTTP HTTP and the Web HTTP Requests: GET, POST HTTP Response message Cookies Slide 15

Which of these is NOT a component of a typical HTTP transaction? A. Request line B. Header line C. User name D. Object/Entity body Slide 16

Web services often use cookies, which are designed to A. Keep state for a user on a single website. B. Keep state for a user across all websites they visit. C. Ensure a user s privacy while web browsing. Slide 17

A Web cache A. Compresses web objects. B. Encrypts web objects. C. Saves downloaded objects closer to the user. Slide 18

Creating a network app write programs that: run on (different) end systems communicate over network e.g., web 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 application transport network data link physical Adapted from Kurose and Ross Lecture 3 - Slide 19

What IS A Web Browser? Lecture 3 - Slide 20

First, a review HTTP and the Web 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, e.g., www.someschool.edu/somedept/pic.gif host name path name Adapted from: Kurose & Ross Lecture 3 - Slide 21

HTTP: Hypertext transfer protocol client/server model client: browser that requests, receives, (using HTTP protocol) and displays Web objects server: Web server sends (using HTTP protocol) objects in response to requests PC running Firefox browser iphone running Safari browser Adapted from: Kurose and Ross server running Apache Web server Lecture 3 - Slide 22

HTTP Overview 1. User types in a URL. http://some.host.name.tld/directory/name/file.ext host name path name Lecture 3 - Slide 23

HTTP Overview 2. Browser establishes connection with server. Looks up some.host.name.tld Calls connect() Lecture 3 - Slide 24

HTTP Overview 3. Browser requests the corresponding data. GET /directory/name/file.ext HTTP/1.0 Host: some.host.name.tld [other optional fields, for example:] User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64) Accept-language: en Lecture 3 - Slide 25

HTTP Overview 4. Server responds with the requested data. HTTP/1.0 200 OK Content-Type: text/html Content-Length: 1299 Date: Sun, 01 Sep 2013 21:26:38 GMT [Blank line] (Data data data data ) Lecture 3 - Slide 26

HTTP Overview 5. Browser renders the response, fetches any additional objects, and closes the connection. Lecture 3 - Slide 27

HTTP Overview 1. User types in a URL. 2. Browser establishes connection with server. 3. Browser requests the corresponding data. 4. Server responds with the requested data. 5. Browser renders the response, fetches other objects, and closes the connection. It s a document retrieval system, where documents point to (link to) each other, forming a web. Lecture 3 - Slide 28

HTTP Overview (Lab 1) 1. User types in a URL. 2. Browser establishes connection with server. 3. Browser requests the corresponding data. 4. Server responds with the requested data. 5. Browser renders the response, fetches other objects, and closes the connection. It s a document retrieval system, where documents point to (link to) each other, forming a web. Lecture 3 - Slide 29

Trying out HTTP (client side) for yourself 1. Telnet to your favorite Web server: telnet demo.cs.swarthmore.edu 80 Opens TCP connection to port 80 (default HTTP server port) at example server. Anything typed is sent to server on port 80 at demo.cs.swarthmore.edu 2. Type in a GET HTTP request: GET / HTTP/1.1 Host: demo.cs.swarthmore.edu (blank line) (Hit carriage return twice) This is a minimal, but complete, GET request to the HTTP server. 3. Look at response message sent by HTTP server! Lecture 3 - Slide 30

$ telnet demo.cs.swarthmore.edu 80 Trying 130.58.68.26... Connected to demo.cs.swarthmore.edu. Escape character is '^]'. GET / HTTP/1.1 Host: demo.cs.swarthmore.edu HTTP/1.1 200 OK Vary: Accept-Encoding Content-Type: text/html Accept-Ranges: bytes ETag: "316912886" Last-Modified: Wed, 04 Jan 2017 17:47:31 GMT Content-Length: 1062 Date: Wed, 05 Sep 2018 17:27:34 GMT Server: lighttpd/1.4.35 Example <html><head><title>demo Server</title></head> <body>... </body> </html> Lecture 3 - Slide 31

Example $ telnet demo.cs.swarthmore.edu 80 Trying 130.58.68.26... Connected to demo.cs.swarthmore.edu. Escape character is '^]'. GET / HTTP/1.1 Host: demo.cs.swarthmore.edu HTTP/1.1 200 OK Vary: Accept-Encoding Content-Type: text/html Accept-Ranges: bytes Response ETag: "316912886" headers Last-Modified: Wed, 04 Jan 2017 17:47:31 GMT Content-Length: 1062 Date: Wed, 05 Sep 2018 17:27:34 GMT Lecture 3 - Slide 32 Server: lighttpd/1.4.35

Example $ telnet demo.cs.swarthmore.edu 80 Trying 130.58.68.26... Connected to demo.cs.swarthmore.edu. Escape character is '^]'. GET / HTTP/1.1 Host: demo.cs.swarthmore.edu Response headers <html><head><title>demo Server</title></head> <body>... Response </body> body </html> (This is what you should be saving in lab 1.) Lecture 3 - Slide 33

HTTP request message two types of HTTP messages: request, response HTTP request message: ASCII (human-readable format) request line (GET, POST, HEAD, etc. commands) carriage return, line feed header lines carriage return character line-feed character GET /index.html HTTP/1.1\r\n Host: web.cs.swarthmore.edu\r\n User-Agent: Firefox/3.6.10\r\n Accept: text/html,application/xhtml+xml\r\n Accept-Language: en-us,en;q=0.5\r\n Accept-Encoding: gzip,deflate\r\n Accept-Charset: ISO-8859-1,utf-8;q=0.7\r\n Keep-Alive: 115\r\n Connection: keep-alive\r\n Lecture 3 - Slide 34 \r\n

Why do we have these \r\n (CRLF) things all over the place? GET /index.html HTTP/1.1\r\n Host: web.cs.swarthmore.edu\r\n User-Agent: Firefox/3.6.10\r\n Accept: text/html,application/xhtml+xml\r\n Accept-Language: en-us,en;q=0.5\r\n Accept-Encoding: gzip,deflate\r\n Accept-Charset: ISO-8859-1,utf-8;q=0.7\r\n Keep-Alive: 115\r\n Connection: keep-alive\r\n \r\n A. They re generated when the user hits enter. B. They signal the end of a field or section. C. They re important for some other reason. D. They re an unnecessary protocol artifact. Lecture 3 - Slide 35

How else might we delineate messages? A. There s not much else we can do. B. Force all messages to be the same size. C. Send the message size prior to the message. D. Some other way (discuss). Lecture 3 - Slide 36

HTTP is all text Makes the protocol simple Easy to delineate message (\r\n) (Relatively) human-readable No worries about encoding or formatting data Variable length data Not the most efficient Many protocols use binary fields Sending 12345678 as a string is 8 bytes As an integer, 12345678 needs only 4 bytes The headers may come in any order Requires string parsing / processing Lecture 3 - Slide 37