SlideShare a Scribd company logo
1 of 35
Download to read offline
Darshan Institute of Engineering & Technology, Rajkot
Unit-2:
Application
Layer
maulik.trivedi@darshan.ac.in
+91-9998265805
Computer Engineering Department
Computer Networks (CN)
GTU #3150710
Looping
Outline
• Principles of Computer Applications
• Web
• HTTP
• E-mail
• DNS
• Socket programming with TCP and UDP
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 4
Network Applications
A Network application is an application running on one host and provides a
communication to another application running on a different host.
A network application development is writing programs that run on different end
systems and communicate with each other over the network.
In the Web application there are two different programs that communicate with each
other:
Browser program running in the user's host.
Web server program running in the Web server host.
Host Host
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 5
Network Applications - Examples
Email
Web
Remote Login
P2P File Sharing
Multi-user Network Games
Streaming Stored Video (YouTube)
Voice Over IP (Skype)
Real-time Video Conference
Social Networking
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 6
Network Application Architecture
Client-Server architecture
P2P (Peer to Peer) architecture
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 7
Client-Server Architecture
Server:
Its always-on host.
It has a fixed IP address.
Large cluster of host – Data Centers.
E.g. Web Server
Client:
It communicate with server.
Its not like continuously connected.
May have dynamic IP addresses.
Do not communicate directly with each other.
E.g. PCs, Mobiles
Server
Client
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 8
2. P2P Architecture
Peers (end systems) directly communicate.
Get peers request service from other peers, provide
service to other peers.
Self Scalability – New peers bring new service capacity,
as well as new service demands.
Peers are alternatingly connected and change IP
addresses.
Complex management
Peer
Peer
Peer
Prof. Maulik Trivedi 9
#3150710(CN)  Unit 2 – Application Layer
Process P2
Process P1
Process Communicating
What is Process?
A process is an instance of a program running in a computer.
We can say that process is program under execution.
Within same host, two processes communicate using inter-process communication
(IPC).
Process in different hosts communicate by exchanging messages.
Client process: A process that initiates communication.
Server process: A process that waits to be contacted.
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 10
transport
application
physical
link
network
transport
application
physical
link
network
Socket
A process sends messages into and receives messages from; the network through a
software interface called a socket.
A process is like a house and its socket is like its door.
Sending process passes message outdoor.
Sending process relies on transport infrastructure on other side of door to deliver message to
socket at receiving process.
Internet
controlled by
app developer
process process
controlled
by OS
socket
Process
Socket
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 11
Transport Services to Applications
Recall that a socket is the interface between the application process and the
transport layer protocol.
For develop an application, choose available transport layer protocol.
Pick the protocol with the services that best match the needs of your application.
Example: Choose either Train or Airplane transport for travel between two cities.
Classify services with four parameters:
Reliable Data
Transfer
Throughput Timing Security
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 12
Transport Services to Applications
Reliable Data Transfer:
Many applications (e.g., email, file transfer, financial applications) require 100% reliable data
transfer
Required guarantee that data sent by one end of application is delivered correctly and completely
to the other end of application.
This guaranteed data delivery service is called Reliable Data Transfer.
When it will fail to deliver reliable data transfer, it is acceptable for loss-tolerant applications.
Loss-tolerant Applications (e.g., audio/video) can tolerate some loss.
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 13
Transport Services to Applications
Throughput
Some apps (e.g., multimedia) require at least amount of throughput to be “effective”
Bandwidth sensitive application, specific throughput required.
Elastic application can use of as much, or as little, throughput as happens to be available.
Timing
some apps (e.g., Internet telephony, interactive games) require low delay to be “effective”
Security
In the sending host, encrypt all data transmitted by the sending process.
In the receiving host, decrypt the data before delivering the data to the receiving process.
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 14
Internet Transport Protocols Services
TCP Service:
Connection-Oriented: A setup required
between client and server processes
Reliable data transfer between sending and
receiving process without error and proper
order
Congestion control: To control sender when
network overloaded
It does not provide, Timing, at least
throughput guarantee (not preferred in real-
time application)
UDP Services:
Connectionless: No connection before
two processes start to communicate.
Unreliable data transfer between sending
and receiving process
It does not provide congestion control.
It Does not provide. Reliability, flow
control, throughput guarantee, security.
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 15
Internet Applications
Popular internet applications with their application layer and their underlying
transport protocol.
Applications
Application-Layer
Protocol
Underlying
Transport Protocol
(Service)
Email SMTP TCP
Remote Terminal
Access
Telnet TCP
Web HTTP TCP
File Transfer FTP TCP
Streaming Media HTTP(YouTube), RTP TCP or UDP
Internet Telephony SIP, RTP(Skype) Typically UDP
No loss,
Elastic
Bandwidth
Loss-tolerant
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 17
Web
Early 1990, Internet was used only by researchers, academics, and university students.
New application WWW arrived in 1994 by Tim Berners-Lee.
World Wide Web - is an information where documents and other web resources are
identified by URL, interlinked by hypertext links, and can be accessed via the Internet.
On demand available, What they want, When they want it.
Unlike TV and Radio.
Navigate through Websites.
17
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 18
Web and HTTP
Web page consists of objects.
Object can be HTML file, JPEG image, Java applet, audio file etc.…
Web page consists of base HTML-file which includes several referenced objects.
Each object is addressable by a Uniform Resource Locator (URL), like;
www.someschool.edu/someDept/pic.gif
host name path name
Web Page (e.g Total five objects)
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 19
HTTP
HyperText Transfer Protocol – Application layer protocol
It is implemented in two programs.
Client Program
Server Program
Exchanging HTTP message each others.
HTTP defines the structure of these messages and how web client – web server
exchange messages.
HTTP
Request
HTTP
Response
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 20
HTTP – Cont…
HTTP
Hyper-Text Transfer Protocol
It is Application layer protocol
Client: A browser that requests, receives,
(using HTTP protocol) and “displays” Web
objects.
E.g. PC, Mobile
Server: Web server sends (using HTTP
protocol) objects in response to requests.
E.g. Apache Web Server
PC
(Web Browser)
Server
(Apache Web
Server)
Mobile
(Web Browser)
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 21
HTTP - Cont...
A client initiates TCP connection (creates socket) to server using port 80.
A server accepts TCP connection from client.
HTTP messages (application-layer protocol messages) exchanged between browser
(HTTP client) and Web server (HTTP server).
HTTP is “stateless protocol”, server maintains no information about past client
requests.
HTTP connection types are:
Non-persistent HTTP
Persistent HTTP
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 23
Non-persistent & Persistent Connection
In Client-Server communication, Client making a series of requests to server, Server
responding to each of the requests.
Series of requests may be made back-to-back or periodically at regular time interval.
So, Application developer need to make an important decision;
Should each request/response pair be sent over a separate TCP connection.
OR should all the requests and corresponding responses be sent over same TCP connection?
23
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 24
Non-persistent HTTP
A non-persistent connection is closed after the server sends the requested object to
the client.
The connection is used exactly for one request and one response.
For downloading multiple objects, it required multiple connections.
Non-persistent connections are the default mode for HTTP/1.0.
Example:
Transferring a webpage from server to client, webpage consists of a base HTML file and 10
JPEG images.
Total 11 object are residing on server.
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 25
Non-persistent HTTP – Cont.…
URL:www.someSchool.edu/someDepartment/home.index
1a. HTTP client initiates TCP connection
to HTTP server (process) at
www.someSchool.edu on port 80
1b. HTTP server at host
www.someSchool.edu waiting for TCP
connection at port 80. “accepts”
connection, notifying client
2. HTTP client sends HTTP request
message (containing URL) into
TCP connection socket. Message
indicates that client wants object
someDepartment/home.index
3. HTTP server receives request
message, forms response
message containing requested
object, and sends message into
its socket
4. HTTP server closes TCP connection.
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
Time
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 26
Non-persistent HTTP: Response time
RTT(round-trip time): A time for a small packet to travel from client to server and vice
versa.
HTTP 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
time to
transmit
file
initiate TCP
connection
RTT
request
file
RTT
file
received
time time
Non-persistent HTTP response
time =
2RTT
+
file transmission time
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 27
Persistent HTTP
Server leaves the TCP connection open after sending responses.
Subsequent HTTP messages between same client and server sent over open
connection.
The server closes the connection only when it is not used for a certain configurable
amount of time.
It requires as little as one round-trip time (RTT) for all the referenced objects.
With persistent connections, the performance is improved by 20%.
Persistent connections are the default mode for HTTP/1.1.
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 28
HTTP Message Format
Two types:
1. Request Message
2. Response Message
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 29
HTTP Request Message
It is in ASCII format which means that human-readable format.
HTTP request message consist three part:
Request line
Header line
Carriage return
request line
(GET, POST,
HEAD commands)
header
lines
carriage return
(line feed at start
of line indicates
end of header lines)
GET /index.html HTTP/1.1rn
Host: www-net.cs.umass.edurn
User-Agent: Firefox/3.6.10rn
Accept: text/html,application/xhtml+xmlrn
Accept-Language: en-us,en;q=0.5rn
Accept-Encoding: gzip,deflatern
Accept-Charset: ISO-8859-1,utf-8;q=0.7rn
Keep-Alive: 115rn
Connection: keep-alivern
rn
carriage return character
line-feed character
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 30
HTTP Request Message - Format
The request line has three fields: Method field, URL field, and HTTP version field.
The method field can take on several different values, including GET, POST, HEAD,
PUT, and DELETE.
In above message, browser is requesting the object /somedir/page.html and version
is self-explanatory; browser implements version HTTP/1.1.
The header line Host: www-net.cs.umass.edu specifies the host on which the object
resides.
User agent indicate browser name and version.
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 31
HTTP Response Message
HTTP response message consist of three part:
1. Status line
2. Header line
3. Data (Entity body)
status line
(protocol
status code
status
phrase)
header
lines
data, e.g.,
requested
HTML file
HTTP/1.1 200 OKrn
Date: Sun, 26 Sep 2010 20:09:20 GMTrn
Server: Apache/2.0.52 (CentOS)rn
Last-Modified: Tue, 30 Oct 2007 17:00:02
GMTrn
ETag: "17dc6-a5c-bf716880"rn
Accept-Ranges: bytesrn
Content-Length: 2652rn
Keep-Alive: timeout=10, max=100rn
Connection: Keep-Alivern
Content-Type: text/html; charset=ISO-8859-
1rn
rn
data data data data data ...
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 32
HTTP Response Message - Format
The status line has three fields: protocol version field, status code and corresponding
status message.
In below example, the status line indicates that the server is using HTTP/1.1 and that
everything is OK.
HTTP/1.1 200 OKrn
Date: Sun, 26 Sep 2010 20:09:20 GMTrn
Server: Apache/2.0.52 (CentOS)rn
Last-Modified: Tue, 30 Oct 2007 17:00:02 GMTrn
ETag: "17dc6-a5c-bf716880"rn
Accept-Ranges: bytesrn
Content-Length: 2652rn
Keep-Alive: timeout=10, max=100rn
Connection: Keep-Alivern
Content-Type: text/html; charset=ISO-8859-1rn rn
data data data data data ...
Date: header line indicates the time and date when the
HTTP response was created and sent by the server.
Server: header line indicates that the message was
generated by an Apache Web server.
Last-Modified: header line indicates the time and date
when the object was created or last modified.
Content-Length: header line indicates the number of
bytes in the object being sent.
Content-Type: header line indicates that the object in
the entity body is HTML text.
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 33
HTTP Response Status Codes
A status code appears in 1st line in server-to-client response message.
Some 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
 Requested http version not support
Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 34
Outline - Summary
Principles of Computer Applications
Browser, Web Server, Email, P2P Applications etc…
Application Layer (TCP – UDP Services)
Web (Web Pages – Objects like html, jpeg, mp3, etc…)
HTTP (TCP connection, port-80, persistent & non-persistent conn.), Request &
Response Message format, Cookies, Web caches, FTP, Port-21
E-mail (User agent, Mail Server, SMTP port - 25), POP3, IMAP
DNS (Domain names to IP Address), hierarchy structure
Socket programming with TCP and UDP (TCP – Sock_Stream, UDP – Sock_DGram)
Darshan Institute of Engineering & Technology, Rajkot
Thank
You
maulik.trivedi@darshan.ac.in
9998265805
Computer Engineering Department
Computer Networks (CN)
GTU #3150710

More Related Content

Similar to 3150710_CN_GTU_Study_Material_Presentations_Unit-2_14082021085712PM.pdf

Introduction to Computer Networking
Introduction to Computer NetworkingIntroduction to Computer Networking
Introduction to Computer Networkingshankars73
 
applicationapplicationapplicationapplication.ppt
applicationapplicationapplicationapplication.pptapplicationapplicationapplicationapplication.ppt
applicationapplicationapplicationapplication.pptDEEPAK948083
 
02_Chapter_2_V6_LV.pptx
02_Chapter_2_V6_LV.pptx02_Chapter_2_V6_LV.pptx
02_Chapter_2_V6_LV.pptxALI2H
 
Hasanain_Application Layer_Chapter_2_Version 7.1.ppt
Hasanain_Application Layer_Chapter_2_Version 7.1.pptHasanain_Application Layer_Chapter_2_Version 7.1.ppt
Hasanain_Application Layer_Chapter_2_Version 7.1.pptnadeemrana0257
 
App for peer-to-peer file transfer
App for peer-to-peer file transferApp for peer-to-peer file transfer
App for peer-to-peer file transferIRJET Journal
 
Chapter2 application layer
Chapter2 application layerChapter2 application layer
Chapter2 application layerKhánh Ghẻ
 
Published on IST 554 (httpsonline.ist.psu.eduist554).docx
Published on IST 554 (httpsonline.ist.psu.eduist554).docxPublished on IST 554 (httpsonline.ist.psu.eduist554).docx
Published on IST 554 (httpsonline.ist.psu.eduist554).docxamrit47
 
Socket programming assignment
Socket programming assignmentSocket programming assignment
Socket programming assignmentRavi Gupta
 
Building Intranet Assignment 2009 03 14 roshan basnet (1)
Building Intranet Assignment 2009 03 14 roshan basnet (1)Building Intranet Assignment 2009 03 14 roshan basnet (1)
Building Intranet Assignment 2009 03 14 roshan basnet (1)rosu555
 
UDP Pervasive Protocol Implementation for Smart Home Environment on MyRIO usi...
UDP Pervasive Protocol Implementation for Smart Home Environment on MyRIO usi...UDP Pervasive Protocol Implementation for Smart Home Environment on MyRIO usi...
UDP Pervasive Protocol Implementation for Smart Home Environment on MyRIO usi...IJECEIAES
 
CS3001_Computer_Networks_Chapter_2_v8.1(1).pptx
CS3001_Computer_Networks_Chapter_2_v8.1(1).pptxCS3001_Computer_Networks_Chapter_2_v8.1(1).pptx
CS3001_Computer_Networks_Chapter_2_v8.1(1).pptxfarhanali32014
 
Communication middleware
Communication middlewareCommunication middleware
Communication middlewarePeter R. Egli
 
E-Commerce Chapter3a
E-Commerce Chapter3aE-Commerce Chapter3a
E-Commerce Chapter3aIshfaq Chohan
 
A comprehensive survey on security issues in cloud computing and data privacy...
A comprehensive survey on security issues in cloud computing and data privacy...A comprehensive survey on security issues in cloud computing and data privacy...
A comprehensive survey on security issues in cloud computing and data privacy...eSAT Journals
 
A comprehensive survey on security issues in cloud computing and data privacy...
A comprehensive survey on security issues in cloud computing and data privacy...A comprehensive survey on security issues in cloud computing and data privacy...
A comprehensive survey on security issues in cloud computing and data privacy...eSAT Publishing House
 
A comprehensive survey on security issues in cloud computing and data privacy...
A comprehensive survey on security issues in cloud computing and data privacy...A comprehensive survey on security issues in cloud computing and data privacy...
A comprehensive survey on security issues in cloud computing and data privacy...eSAT Journals
 
Module1 Mobile Computing Architecture
Module1 Mobile Computing ArchitectureModule1 Mobile Computing Architecture
Module1 Mobile Computing Architectureraksharao
 

Similar to 3150710_CN_GTU_Study_Material_Presentations_Unit-2_14082021085712PM.pdf (20)

Introduction to Computer Networking
Introduction to Computer NetworkingIntroduction to Computer Networking
Introduction to Computer Networking
 
applicationapplicationapplicationapplication.ppt
applicationapplicationapplicationapplication.pptapplicationapplicationapplicationapplication.ppt
applicationapplicationapplicationapplication.ppt
 
02_Chapter_2_V6_LV.pptx
02_Chapter_2_V6_LV.pptx02_Chapter_2_V6_LV.pptx
02_Chapter_2_V6_LV.pptx
 
20CS2008 Computer Networks
20CS2008 Computer Networks 20CS2008 Computer Networks
20CS2008 Computer Networks
 
Hasanain_Application Layer_Chapter_2_Version 7.1.ppt
Hasanain_Application Layer_Chapter_2_Version 7.1.pptHasanain_Application Layer_Chapter_2_Version 7.1.ppt
Hasanain_Application Layer_Chapter_2_Version 7.1.ppt
 
App for peer-to-peer file transfer
App for peer-to-peer file transferApp for peer-to-peer file transfer
App for peer-to-peer file transfer
 
Chapter2 application layer
Chapter2 application layerChapter2 application layer
Chapter2 application layer
 
Published on IST 554 (httpsonline.ist.psu.eduist554).docx
Published on IST 554 (httpsonline.ist.psu.eduist554).docxPublished on IST 554 (httpsonline.ist.psu.eduist554).docx
Published on IST 554 (httpsonline.ist.psu.eduist554).docx
 
Socket programming assignment
Socket programming assignmentSocket programming assignment
Socket programming assignment
 
Building Intranet Assignment 2009 03 14 roshan basnet (1)
Building Intranet Assignment 2009 03 14 roshan basnet (1)Building Intranet Assignment 2009 03 14 roshan basnet (1)
Building Intranet Assignment 2009 03 14 roshan basnet (1)
 
UDP Pervasive Protocol Implementation for Smart Home Environment on MyRIO usi...
UDP Pervasive Protocol Implementation for Smart Home Environment on MyRIO usi...UDP Pervasive Protocol Implementation for Smart Home Environment on MyRIO usi...
UDP Pervasive Protocol Implementation for Smart Home Environment on MyRIO usi...
 
Basics of Computer Networks
Basics of Computer NetworksBasics of Computer Networks
Basics of Computer Networks
 
Chapter2_L2.ppt
Chapter2_L2.pptChapter2_L2.ppt
Chapter2_L2.ppt
 
CS3001_Computer_Networks_Chapter_2_v8.1(1).pptx
CS3001_Computer_Networks_Chapter_2_v8.1(1).pptxCS3001_Computer_Networks_Chapter_2_v8.1(1).pptx
CS3001_Computer_Networks_Chapter_2_v8.1(1).pptx
 
Communication middleware
Communication middlewareCommunication middleware
Communication middleware
 
E-Commerce Chapter3a
E-Commerce Chapter3aE-Commerce Chapter3a
E-Commerce Chapter3a
 
A comprehensive survey on security issues in cloud computing and data privacy...
A comprehensive survey on security issues in cloud computing and data privacy...A comprehensive survey on security issues in cloud computing and data privacy...
A comprehensive survey on security issues in cloud computing and data privacy...
 
A comprehensive survey on security issues in cloud computing and data privacy...
A comprehensive survey on security issues in cloud computing and data privacy...A comprehensive survey on security issues in cloud computing and data privacy...
A comprehensive survey on security issues in cloud computing and data privacy...
 
A comprehensive survey on security issues in cloud computing and data privacy...
A comprehensive survey on security issues in cloud computing and data privacy...A comprehensive survey on security issues in cloud computing and data privacy...
A comprehensive survey on security issues in cloud computing and data privacy...
 
Module1 Mobile Computing Architecture
Module1 Mobile Computing ArchitectureModule1 Mobile Computing Architecture
Module1 Mobile Computing Architecture
 

Recently uploaded

Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsNbelano25
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonhttgc7rh9c
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...EADTU
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17Celine George
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfstareducators107
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of PlayPooky Knightsmith
 

Recently uploaded (20)

Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Our Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdfOur Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdf
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of Play
 

3150710_CN_GTU_Study_Material_Presentations_Unit-2_14082021085712PM.pdf

  • 1. Darshan Institute of Engineering & Technology, Rajkot Unit-2: Application Layer maulik.trivedi@darshan.ac.in +91-9998265805 Computer Engineering Department Computer Networks (CN) GTU #3150710
  • 2. Looping Outline • Principles of Computer Applications • Web • HTTP • E-mail • DNS • Socket programming with TCP and UDP
  • 3.
  • 4. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 4 Network Applications A Network application is an application running on one host and provides a communication to another application running on a different host. A network application development is writing programs that run on different end systems and communicate with each other over the network. In the Web application there are two different programs that communicate with each other: Browser program running in the user's host. Web server program running in the Web server host. Host Host
  • 5. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 5 Network Applications - Examples Email Web Remote Login P2P File Sharing Multi-user Network Games Streaming Stored Video (YouTube) Voice Over IP (Skype) Real-time Video Conference Social Networking
  • 6. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 6 Network Application Architecture Client-Server architecture P2P (Peer to Peer) architecture
  • 7. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 7 Client-Server Architecture Server: Its always-on host. It has a fixed IP address. Large cluster of host – Data Centers. E.g. Web Server Client: It communicate with server. Its not like continuously connected. May have dynamic IP addresses. Do not communicate directly with each other. E.g. PCs, Mobiles Server Client
  • 8. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 8 2. P2P Architecture Peers (end systems) directly communicate. Get peers request service from other peers, provide service to other peers. Self Scalability – New peers bring new service capacity, as well as new service demands. Peers are alternatingly connected and change IP addresses. Complex management Peer Peer Peer
  • 9. Prof. Maulik Trivedi 9 #3150710(CN)  Unit 2 – Application Layer Process P2 Process P1 Process Communicating What is Process? A process is an instance of a program running in a computer. We can say that process is program under execution. Within same host, two processes communicate using inter-process communication (IPC). Process in different hosts communicate by exchanging messages. Client process: A process that initiates communication. Server process: A process that waits to be contacted.
  • 10. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 10 transport application physical link network transport application physical link network Socket A process sends messages into and receives messages from; the network through a software interface called a socket. A process is like a house and its socket is like its door. Sending process passes message outdoor. Sending process relies on transport infrastructure on other side of door to deliver message to socket at receiving process. Internet controlled by app developer process process controlled by OS socket Process Socket
  • 11. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 11 Transport Services to Applications Recall that a socket is the interface between the application process and the transport layer protocol. For develop an application, choose available transport layer protocol. Pick the protocol with the services that best match the needs of your application. Example: Choose either Train or Airplane transport for travel between two cities. Classify services with four parameters: Reliable Data Transfer Throughput Timing Security
  • 12. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 12 Transport Services to Applications Reliable Data Transfer: Many applications (e.g., email, file transfer, financial applications) require 100% reliable data transfer Required guarantee that data sent by one end of application is delivered correctly and completely to the other end of application. This guaranteed data delivery service is called Reliable Data Transfer. When it will fail to deliver reliable data transfer, it is acceptable for loss-tolerant applications. Loss-tolerant Applications (e.g., audio/video) can tolerate some loss.
  • 13. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 13 Transport Services to Applications Throughput Some apps (e.g., multimedia) require at least amount of throughput to be “effective” Bandwidth sensitive application, specific throughput required. Elastic application can use of as much, or as little, throughput as happens to be available. Timing some apps (e.g., Internet telephony, interactive games) require low delay to be “effective” Security In the sending host, encrypt all data transmitted by the sending process. In the receiving host, decrypt the data before delivering the data to the receiving process.
  • 14. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 14 Internet Transport Protocols Services TCP Service: Connection-Oriented: A setup required between client and server processes Reliable data transfer between sending and receiving process without error and proper order Congestion control: To control sender when network overloaded It does not provide, Timing, at least throughput guarantee (not preferred in real- time application) UDP Services: Connectionless: No connection before two processes start to communicate. Unreliable data transfer between sending and receiving process It does not provide congestion control. It Does not provide. Reliability, flow control, throughput guarantee, security.
  • 15. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 15 Internet Applications Popular internet applications with their application layer and their underlying transport protocol. Applications Application-Layer Protocol Underlying Transport Protocol (Service) Email SMTP TCP Remote Terminal Access Telnet TCP Web HTTP TCP File Transfer FTP TCP Streaming Media HTTP(YouTube), RTP TCP or UDP Internet Telephony SIP, RTP(Skype) Typically UDP No loss, Elastic Bandwidth Loss-tolerant
  • 16.
  • 17. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 17 Web Early 1990, Internet was used only by researchers, academics, and university students. New application WWW arrived in 1994 by Tim Berners-Lee. World Wide Web - is an information where documents and other web resources are identified by URL, interlinked by hypertext links, and can be accessed via the Internet. On demand available, What they want, When they want it. Unlike TV and Radio. Navigate through Websites. 17
  • 18. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 18 Web and HTTP Web page consists of objects. Object can be HTML file, JPEG image, Java applet, audio file etc.… Web page consists of base HTML-file which includes several referenced objects. Each object is addressable by a Uniform Resource Locator (URL), like; www.someschool.edu/someDept/pic.gif host name path name Web Page (e.g Total five objects)
  • 19. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 19 HTTP HyperText Transfer Protocol – Application layer protocol It is implemented in two programs. Client Program Server Program Exchanging HTTP message each others. HTTP defines the structure of these messages and how web client – web server exchange messages. HTTP Request HTTP Response
  • 20. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 20 HTTP – Cont… HTTP Hyper-Text Transfer Protocol It is Application layer protocol Client: A browser that requests, receives, (using HTTP protocol) and “displays” Web objects. E.g. PC, Mobile Server: Web server sends (using HTTP protocol) objects in response to requests. E.g. Apache Web Server PC (Web Browser) Server (Apache Web Server) Mobile (Web Browser)
  • 21. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 21 HTTP - Cont... A client initiates TCP connection (creates socket) to server using port 80. A server accepts TCP connection from client. HTTP messages (application-layer protocol messages) exchanged between browser (HTTP client) and Web server (HTTP server). HTTP is “stateless protocol”, server maintains no information about past client requests. HTTP connection types are: Non-persistent HTTP Persistent HTTP
  • 22.
  • 23. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 23 Non-persistent & Persistent Connection In Client-Server communication, Client making a series of requests to server, Server responding to each of the requests. Series of requests may be made back-to-back or periodically at regular time interval. So, Application developer need to make an important decision; Should each request/response pair be sent over a separate TCP connection. OR should all the requests and corresponding responses be sent over same TCP connection? 23
  • 24. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 24 Non-persistent HTTP A non-persistent connection is closed after the server sends the requested object to the client. The connection is used exactly for one request and one response. For downloading multiple objects, it required multiple connections. Non-persistent connections are the default mode for HTTP/1.0. Example: Transferring a webpage from server to client, webpage consists of a base HTML file and 10 JPEG images. Total 11 object are residing on server.
  • 25. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 25 Non-persistent HTTP – Cont.… URL:www.someSchool.edu/someDepartment/home.index 1a. HTTP client initiates TCP connection to HTTP server (process) at www.someSchool.edu on port 80 1b. HTTP server at host www.someSchool.edu waiting for TCP connection at port 80. “accepts” connection, notifying client 2. HTTP client sends HTTP request message (containing URL) into TCP connection socket. Message indicates that client wants object someDepartment/home.index 3. HTTP server receives request message, forms response message containing requested object, and sends message into its socket 4. HTTP server closes TCP connection. 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 Time
  • 26. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 26 Non-persistent HTTP: Response time RTT(round-trip time): A time for a small packet to travel from client to server and vice versa. HTTP 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 time to transmit file initiate TCP connection RTT request file RTT file received time time Non-persistent HTTP response time = 2RTT + file transmission time
  • 27. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 27 Persistent HTTP Server leaves the TCP connection open after sending responses. Subsequent HTTP messages between same client and server sent over open connection. The server closes the connection only when it is not used for a certain configurable amount of time. It requires as little as one round-trip time (RTT) for all the referenced objects. With persistent connections, the performance is improved by 20%. Persistent connections are the default mode for HTTP/1.1.
  • 28. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 28 HTTP Message Format Two types: 1. Request Message 2. Response Message
  • 29. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 29 HTTP Request Message It is in ASCII format which means that human-readable format. HTTP request message consist three part: Request line Header line Carriage return request line (GET, POST, HEAD commands) header lines carriage return (line feed at start of line indicates end of header lines) GET /index.html HTTP/1.1rn Host: www-net.cs.umass.edurn User-Agent: Firefox/3.6.10rn Accept: text/html,application/xhtml+xmlrn Accept-Language: en-us,en;q=0.5rn Accept-Encoding: gzip,deflatern Accept-Charset: ISO-8859-1,utf-8;q=0.7rn Keep-Alive: 115rn Connection: keep-alivern rn carriage return character line-feed character
  • 30. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 30 HTTP Request Message - Format The request line has three fields: Method field, URL field, and HTTP version field. The method field can take on several different values, including GET, POST, HEAD, PUT, and DELETE. In above message, browser is requesting the object /somedir/page.html and version is self-explanatory; browser implements version HTTP/1.1. The header line Host: www-net.cs.umass.edu specifies the host on which the object resides. User agent indicate browser name and version.
  • 31. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 31 HTTP Response Message HTTP response message consist of three part: 1. Status line 2. Header line 3. Data (Entity body) status line (protocol status code status phrase) header lines data, e.g., requested HTML file HTTP/1.1 200 OKrn Date: Sun, 26 Sep 2010 20:09:20 GMTrn Server: Apache/2.0.52 (CentOS)rn Last-Modified: Tue, 30 Oct 2007 17:00:02 GMTrn ETag: "17dc6-a5c-bf716880"rn Accept-Ranges: bytesrn Content-Length: 2652rn Keep-Alive: timeout=10, max=100rn Connection: Keep-Alivern Content-Type: text/html; charset=ISO-8859- 1rn rn data data data data data ...
  • 32. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 32 HTTP Response Message - Format The status line has three fields: protocol version field, status code and corresponding status message. In below example, the status line indicates that the server is using HTTP/1.1 and that everything is OK. HTTP/1.1 200 OKrn Date: Sun, 26 Sep 2010 20:09:20 GMTrn Server: Apache/2.0.52 (CentOS)rn Last-Modified: Tue, 30 Oct 2007 17:00:02 GMTrn ETag: "17dc6-a5c-bf716880"rn Accept-Ranges: bytesrn Content-Length: 2652rn Keep-Alive: timeout=10, max=100rn Connection: Keep-Alivern Content-Type: text/html; charset=ISO-8859-1rn rn data data data data data ... Date: header line indicates the time and date when the HTTP response was created and sent by the server. Server: header line indicates that the message was generated by an Apache Web server. Last-Modified: header line indicates the time and date when the object was created or last modified. Content-Length: header line indicates the number of bytes in the object being sent. Content-Type: header line indicates that the object in the entity body is HTML text.
  • 33. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 33 HTTP Response Status Codes A status code appears in 1st line in server-to-client response message. Some 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  Requested http version not support
  • 34. Prof. Maulik D. Trivedi #3150710(CN)  Unit 2 – Application Layer 34 Outline - Summary Principles of Computer Applications Browser, Web Server, Email, P2P Applications etc… Application Layer (TCP – UDP Services) Web (Web Pages – Objects like html, jpeg, mp3, etc…) HTTP (TCP connection, port-80, persistent & non-persistent conn.), Request & Response Message format, Cookies, Web caches, FTP, Port-21 E-mail (User agent, Mail Server, SMTP port - 25), POP3, IMAP DNS (Domain names to IP Address), hierarchy structure Socket programming with TCP and UDP (TCP – Sock_Stream, UDP – Sock_DGram)
  • 35. Darshan Institute of Engineering & Technology, Rajkot Thank You maulik.trivedi@darshan.ac.in 9998265805 Computer Engineering Department Computer Networks (CN) GTU #3150710