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

Similar documents
COMPUTER NETWORKS AND COMMUNICATION PROTOCOLS. Web Access: HTTP Mehmet KORKMAZ

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

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

Application Level Protocols

Session 8. Reading and Reference. en.wikipedia.org/wiki/list_of_http_headers. en.wikipedia.org/wiki/http_status_codes

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

Session 9. Deployment Descriptor Http. Reading and Reference. en.wikipedia.org/wiki/http. en.wikipedia.org/wiki/list_of_http_headers

EE 122: HyperText Transfer Protocol (HTTP)

COSC 2206 Internet Tools. The HTTP Protocol

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

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

Applications & Application-Layer Protocols: The Web & HTTP

WEB TECHNOLOGIES CHAPTER 1

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

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

HTTP Review. Carey Williamson Department of Computer Science University of Calgary

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

HTTP Protocol and Server-Side Basics

Computer Networks. Wenzhong Li. Nanjing University

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer

How to work with HTTP requests and responses

Application Layer: OSI and TCP/IP Models

TCP/IP Networking Basics

INTERNET ENGINEERING. HTTP Protocol. Sadegh Aliakbary

Outline of Lecture 3 Protocols

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

CSCI-1680 WWW Rodrigo Fonseca

Hypertext Transport Protocol

HTTP, circa HTTP protocol. GET /foo/bar.html HTTP/1.1. Sviluppo App Web 2015/ Intro 3/3/2016. Marco Tarini, Uninsubria 1

The HTTP Protocol HTTP

WWW: the http protocol

ECE697AA Lecture 2. Today s lecture

OSI Session / presentation / application Layer. Dr. Luca Allodi - Network Security - University of Trento, DISI (AA 2015/2016)

Internet Protocols. Robin Sharp

COSC4377. Chapter 2: Outline

Developing Mobile Applications

CSCI-1680 WWW Rodrigo Fonseca

2. Introduction to Internet Applications

How the Internet Works

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

HyperText Transfer Protocol

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

Web, HTTP and Web Caching

Introduc)on to Computer Networks

Application Protocols and HTTP

C22: Browser & Web Server Communication

CMPE 151: Network Administration. Servers

EEC-682/782 Computer Networks I

Review of Previous Lecture

Layered Model. DoD Model. ISO/OSI Model

Application Layer Introduction; HTTP; FTP

Outline Computer Networking. HTTP Basics (Review) How to Mark End of Message? (Review)

Chapter 2. Application Layer

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

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

3. WWW and HTTP. Fig.3.1 Architecture of WWW

8/8/17. HTTP Overview. It s all about the network. If you want to really do Web programming right you will need to know the ins and outs of HTTP

CCNA 1 v3.11 Module 11 TCP/IP Transport and Application Layers

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

CS 43: Computer Networks. HTTP September 10, 2018

Application-layer Protocols and Internet Services

Web History. Systemprogrammering 2006 Föreläsning 9 Web Services. Internet Hosts. Web History (cont) 1945: 1989: Topics 1990:

Chapter 2 Application Layer

Jeff Offutt SWE 642 Software Engineering for the World Wide Web

Information Network Systems The application layer. Stephan Sigg

World Wide Web. Before WWW

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

The World Wide Web. Internet

TRANSMISSION CONTROL PROTOCOL. ETI 2506 TELECOMMUNICATION SYSTEMS Monday, 7 November 2016

Configuring Health Monitoring

Information Network I: The Application Layer. Doudou Fall Internet Engineering Laboratory Nara Institute of Science and Technique

REST over HTTP. Ambient intelligence. Fulvio Corno. Politecnico di Torino, 2015/2016

DATA COMMUNICATOIN NETWORKING

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

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

Compliance with RFC 3261

Applications & Application-Layer Protocols: The Web & HTTP

CMSC 332 Computer Networking Web and FTP

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

SCS3004 Networking Technologies Application Layer Protocols

Networks, WWW, HTTP. Web Technologies I. Zsolt Tóth. University of Miskolc. Zsolt Tóth (University of Miskolc) Networks, WWW, HTTP / 35

EECS 3214: Computer Network Protocols and Applications

Proxying. Why and How. Alon Altman. Haifa Linux Club. Proxying p.1/24

Web Programming 4) PHP and the Web

Internet Content Distribution

CSCE 463/612 Networks and Distributed Processing Spring 2018

Assignment, part 2. Statement and concepts INFO-0010

Giving credit where credit is due

Electronic Mail Paradigm

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

Unraveling the Mysteries of J2EE Web Application Communications

COMPUTER NETWORK. Homework #1. Due Date: March 29, 2017 in class

HP Load Balancing Module

TCP/IP Networking An Example

CSCD 330 Network Programming Spring 2018

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

CCNA Exploration Network Fundamentals. Chapter 03 Application Functionality and Protocols

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

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

s642 web security computer security adam everspaugh

Transcription:

Mobile Application Development Higher Diploma in Science in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie

OSI, the Internet & the HTTP Protocol

The Internet 3

Underlying nature of the Internet - Protocols & Standards The irony is that in all its various guises -- commerce, research, and surfing -- the Web is already so much a part of our lives that familiarity has clouded our perception of the Web itself. Tim Berners-Lee in Weaving the Web Email SMTP POP IMAP File Transfer FTP SFTP FTP over SSH Login Telnet SSH Web HTTP, HTML Messaging XMPP 4

OSI Model The OSI model divides the functions of a protocol into a series of layers - each layer only uses the functions of the layer below, and only exports functionality to the layer above. A system that implements protocol behavior consisting of a series of these layers is known as a 'protocol stack' or 'stack' The interface between layers dictates the specifications on how one layer interacts with another. These specifications are typically known as Requests for Comments or "RFC"s in the TCP/IP community. 5

OSI Analogy 6

OSI & TCP/IP The application-centric layers of the 7-layer model are condensed into a single application layer protocol in the TCP/IP stack the TCP/IP protocol stack defines a Network Interface instead of the Data-Link layer of the ISO model, and the Internet Layer of the TCP/IP mode is broadly equivalent to the Network Layer in the ISO model. 7

TCP/IP Protocol Suite Email SMTP POP IMAP File Transfer FTP SFTP FTP over SSH Login Telnet SSH Web HTTP, HTML Messaging XMPP 8

TCP/IP Protocol Suite Email SMTP POP IMAP File Transfer FTP SFTP FTP over SSH Login Telnet SSH Web HTTP, HTML Messaging XMPP 9

Lifecycle of a Hyperlink What happens when: click on a hyperlink page is completely rendered in a browser 10

Browser Web Server 11

client Browser server Web Server vle.wit.ie 12

client Browser server Web Server vle.wit.ie vle.wit.ie Browser cache/ hosts file/ DNS server 13

client Browser server Web Server vle.wit.ie 193.1.193.187 vle.wit.ie Browser cache/ hosts file/ DNS server 14

client Browser SYN server Web Server vle.wit.ie TCP: Are you there? 15

client Browser SYN SYN-ACK server Web Server vle.wit.ie TCP: I m here 16

client Browser SYN SYN-ACK server Web Server vle.wit.ie ACK TCP: Acknowledged 17

client Browser GET / server Web Server vle.wit.ie HTTP: Got this file? 18

client Browser GET / 200 OK index.html server Web Server vle.wit.ie HTTP: Yes, here you go 19

client Browser GET / 200 OK index.html GET /home.css GET /home.js server Web Server vle.wit.ie HTTP: And these as well? 20

client Browser GET / 200 OK index.html GET /home.css GET /home.js server Web Server vle.wit.ie more content HTTP: here you go 21

client Browser FIN server Web Server vle.wit.ie TCP: Finished 22

client Browser FIN FIN-ACK server Web Server vle.wit.ie TCP: Acknowledged 23

Client / Server Http Request Client Server Http Response Conventionally, client sends an HTTP request Server responds with an HTTP response AJAX & HTML5 has merged these roles somewhat 24

HTTP URLs HTTP is a request/response standard of a client and a server. Typically, an HTTP client initiates a request. Resources to be accessed by HTTP are identified using Uniform Resource Locaters (URLs). They contain four distinct parts: the protocol type, the machine name, the directory path and the file name. There are several kinds of URLs: file URLs, FTP URLs, and HTTP URLs. 25

HTTP Components HTTP Requests and Response are comprised of these components Request Methods Response Status Codes Request Headers Response Headers General Headers Entity Headers Content (MIME Media Types) 26

HTTP Request Methods HTTP defines eight methods (sometimes referred to as "verbs") indicating the desired action to be performed on the identified resource. Two types : Safe Methods -no side effects HEAD: Request for data on resource. GET: Request for resource. TRACE: Echoes back the request just as it was received on the receiver for debugging. OPTIONS: Used to check server capacity Unsafe - intended for actions that have side effects POST: Request for resource by passing parameters PUT: Creation or sending of resource DELETE: Deletion of resource CONNECT: Reserved for use on intermediate servers that can operate as tunnels. 27

Response Status Codes Indicate the server s disposition corresponding to a request Combination of a numerical code, and a short description Can be grouped in 5 categories: 1xx--Informational 2xx --Successful 3xx--Redirection 4xx--Client Error 5xx--Server Error 28

Request Headers Specific to an HTTP Request Carry information about the client, and the type of request Facilitates better understanding between client and server Host Accept-Language If-Modified-Since Referer User-Agent Authorization If-None-Match Expect Accept Proxy-Authorization If-Range From Accept-Charset Max-Forwards If-Unmodified-Since TE Accept-Encoding If-Match Range Response Headers Specific to an HTTP Response Carry information about the server, and the type of response Accept-Ranges ETag Retry-After WWW-Authenticate Age Location Server Proxy-Authenticate Vary 29

General Headers Carry information about the HTTP transaction Can be a part of request, as well as response Cache-Control Keep-Alive Pragma Via Connection Upgrade Trailer Warning Transfer-Encoding Date Entity Headers Carry information about the content Mainly a part of HTTP response Allow Content-Language Content-Location Content-Range Content-Encoding Content-Length Content-MD5 Content-Type Expires Last-Modified 30

Content IANA maintains a list of valid content types It is specified by the Content- TypeEntity header Categorized in 9 MIME Media types application audio example image message model multipart text 31

Statelessness Because of the Connect, Request, Response, Disconnect nature of HTTP it is said to be a stateless protocol i.e. from one web page to the next there is nothing in the protocol that allows a web program to maintain program state (like a desktop program). state can be maintained by various techniques E.g: Cookies: are text files stored by client browser maintain session by storing information are non-executable 32

GET Example GET /index.html HTTP/1.1 Host: www.example.com User-Agent: Mozilla/4.5 [en] Accept: image/gif, image/jpeg, text/html Accept-language: en Accept-Charset: iso-8859-1 33

Request Line Request line: contains the requested resource. Consists of 1.Method: name of HTTP method called (GET,POST,etc.). 2.Resource identifier: URL (Uniform Resource Locator) of the requested resource. GET /index.html HTTP/1.1 Host: www.example.com User-Agent: Mozilla/4.5 [en] Accept: image/gif, image/jpeg, text/html Accept-language: en Accept-Charset: iso-8859-1 3.Protocol version: protocol version requested for the response. 34

Request Header Contains additional information to help the server to process the request correctly. Examples: Host:name of requested server. User-Agent: name of browser or program used to access the resource. Accept: some text and image formats accepted by the client. Accept-Language: languages supported (preferred) by the client, useful for automatically personalising the response. GET /index.html HTTP/1.1 Host: www.example.com User-Agent: Mozilla/4.5 [en] Accept: image/gif, image/jpeg, text/html Accept-language: en Accept-Charset: iso-8859-1 35

Request Parameters (1) A HTTP request can also contain parameters. e.g: as a response to a registration form, the selection of a product in an online store, etc. These parameters can be passed in two ways: As part of the request chain encrypted as part of the URL As extra request data 36

Request Parameters: as part of request chain To encrypt parameters as part of the URL, they are added to the URL after the name of the resource, separated from the latter by the character?. The different parameters are separated from one another by the character &. Spaces are replaced by +. Special characters are represented by %xx where xx represents the hexadecimal ASCII code of the character url http://www.example.com/index.php?name=mr+nobody&ok=l request GET /index.php?name=mr+nobody&ok=l HTTP/1.0 Host: www.example.com User-Agent: Mozilla/4.5 [en] Accept: image/gif, image/jpeg, text/html Accept-language: en Accept-Charset: iso-8859-1 37

Extra Request Data To pass the parameters as the body of the request, the POST method rather than GET needs to be used. POST /index.php HTTP/1.0 Host: www.example.com User-Agent: Mozilla/4.5 [en] Accept: image/gif, image/jpeg, text/html Accept-language: en Accept-Charset: iso-8859-1 name=mr+nobody&ok=l 38

Response Response Code HTML HTTP/1.1 200 OK Date: Mon, 04 Aug 2011 15:19:10 GMT Server: Apache/2.0.40 (Red Hat Linux) Last-Modified: Tue, 25 Mar 2011 08:52:53 GMT Accept-Ranges: bytes Content-Length: 428 <html> <body> <h1>my Dvd List</h1> (more file contents)... </body> </html> 39

Except where otherwise noted, this content is licensed under a Creative Commons Attribution-NonCommercial 3.0 License. For more information, please see http:// creativecommons.org/licenses/by-nc/3.0/