Sie sind auf Seite 1von 29

Lecture

Data Communication & Networks 15


Application Layer
(DNS, HTTP)

Muhammad Yousaf
Where we are in Protocol Stack:

myousaf@ymail.com 2
Application Layer:
Top most layer of protocol stack
In contrast to lower layer protocols, application
layer protocols are not implemented as kernel
modules of operating system
Rather they are implemented as OS utilities/Server
Either user itself or user-applications can interact
with these application layer protocols
Hence application layer provides the interface
between user/applications & network protocol stack

myousaf@ymail.com 3
Application Layer Protocols:
Most famous application layer protocols are:
DNS (Domain Name System)
SNMP (Simple Network Management Protocol)
HTTP (Hyper Text Transfer Protocol)
FTP (File Transfer Protocol)
SMTP (Simple Mail Transfer Protocol)
MIME (Multipurpose Internet Mail Exchange)
When to use which protocol obviously depends
upon user requirements

myousaf@ymail.com 4
Domain Name System

myousaf@ymail.com 5
Domain Name System:
You might be unaware of DNS
But whenever you use Internet, you use DNS
Machines (computers, routers, etc) use numbers to
identify each other
e.g: IP= 172.16.0.153, MAC= 00-16-D3-03-0A-D4
But humans are comfortable to use names to
identify others
I can remember your names instead of your roll-numbers
Humans like to remember names of computer/
servers on Internet
e.g: www.mail.yahoo.com

myousaf@ymail.com 6
Domain Names:
FQDN is used for fully identifying a host on Internet
Fully Qualified Domain Names (FQDN)
It provides absolute path to access web pages
residing on the target host
http://www.mail.yahoo.com/index.html
http://www.groups.yahoo.com/index.html
Domain names must be registered with some
domain name registrar (Authority)
IANA delegated its responsibility to manage the
domain names to ICANN
Internet Corporation for Assigned Names & Numbers
(ICANN)
myousaf@ymail.com 7
Domain Names: cont…
http://www.mail.yahoo.com/index.html
File Name
Top Level Domain

Second Level: Company Name

Third Level: Division/Server Name

Accessible through Web Server

Protocol used to transfer data

myousaf@ymail.com 8
Top Level Domains:
Right most part of FQDN represents the top level domain
(TLD)
TLDs are very few in number
Domain names reside under these TLDs
Some of them are:
.com (for commercial business sites)
.net (for networking & telecomm sites)
.org (for non-profit organizations)
.edu (for educational institutes)
.gov (for government organizations)
.mil (for military sites only)
Besides these, there are country codes also

myousaf@ymail.com 9
Country Codes:
Special top level domains to identify geographical
regions i.e. countries
Represented as two letter codes
.au (Australia)
.ca (Canada)
.cn (China)
.in (India)
.jp (Japan)
.pk (Pakistan)
.uk (United Kingdom)

myousaf@ymail.com 10
Naming Hierarchy:
Hosts are arranged in hierarchical manner
Right-most part of FQDN represent Top Level
Domain & so on

org net com mil edu gov pk fr

mit edu
ietf ibm uiuc inria
yahoo
www ee cupidon
research cs case

myousaf@ymail.com 11
DNS: cont…
We need a mechanism that can translate names
into IP addresses
DNS performs this translation
There should be some DNS server (also known as
Name Server) on the network
There is a hierarchy of Name Servers
DNS server runs on port-53

myousaf@ymail.com 12
Name Resolution:
User computers are DNS clients
Clients query local DNS server with some domain
name and asks for the IP address
Local DNS server checks its cache for
corresponding translation entry
If found then return the IP address
Else forward the query to top level DNS server
Upper level name server traces the lower level
name server

myousaf@ymail.com 13
Name Resolution: (example)
www.ece.mit.edu .edu root
name
mit.edu; 131.126.10.23 server

www.ece.mit.edu
local www.ece.mit.edu MIT
client name name
131.126.150.25 server ece.mit.edu; 131.126.150.1 server

www.ece.mit.edu ECE
name
www.ece.mit.edu; 131.126.150.25 server

myousaf@ymail.com 14
Displaying DNS Cache:
C:\RIU>ipconfig/displaydns
Windows IP Configuration
1.0.0.127.in-addr.arpa
----------------------------------------
Record Name . . . . . : 1.0.0.127.in-addr.arpa.
Record Type . . . . . : 12
Time To Live . . . . : 603476
Data Length . . . . . : 4
Section . . . . . . . . . : Answer
PTR Record . . . . . : localhost

localhost
----------------------------------------
Record Name . . . . . : localhost
Record Type . . . . . : 1
Time To Live . . . . : 603476
Data Length . . . . . : 4
Section . . . . . . . : Answer
A (Host) Record . . . : 127.0.0.1
myousaf@ymail.com 15
Hyper Text Transfer Protocol

myousaf@ymail.com 16
Hyper Text Transfer Protocol:
World wide web is most successful application of
the Internet
Consists of a large set of clients & servers; all
speaking the same language (HTTP)
HTTP clients = web browser (Internet Explorer etc.)
HTTP servers = web server
HTTP web server runs on port-80
It is the protocol that defines how web browser
download information from web servers

myousaf@ymail.com 17
Evolution of HTTP:
First developed in 1990
Later standardized in 1996 as RFC-1945
Current version is HTTP/1.1 (RFC-2616)

Don’t confuse HTTP with HTML


HTML is the language for creating web pages
HTTP is the protocol that carry the HTML data from
one computer to other computer
HTTP can also carry text files, images, audio files,
video files, pdf files, etc
myousaf@ymail.com 18
Working of HTTP:
HTTP is a stateless request/response protocol
Clients make requests to the server
Server then responds to the clients
Stateless means that each request/response
session is independent from previous session

myousaf@ymail.com 19
HTTP request message:

myousaf@ymail.com 20
HTTP request line:
HTTP request message specifies the:
operation to be performed
web page on which the operation should be performed
the HTTP version
e.g: GET http://www.case.edu.pk HTTP/1.1

myousaf@ymail.com 21
HTTP response message:

myousaf@ymail.com 22
HTTP response status line:
Response message begins with the status line
specifying the:
Version of HTTP
3-digit code indicating success or not
Text string giving the reason
e.g: HTTP/1.1 202 Accepted

myousaf@ymail.com 23
HTTP example:

myousaf@ymail.com 24
Server Name resolution:
You can access web server using following type of
URLs (Universal Resource Locator)
http://207.200.83.29:80/index.html
http://www.netscape.com:80/index.html
http://www.netscape.com/index.html
Port-80 is default for web servers
Given the host name, IP address can be
determined using DNS
Now having Port-number & IP address of server,
client can easily establish the TCP connection with
the server
myousaf@ymail.com 25
Putting All Together:
See what web browser (client) is doing:
Extracts server's hostname from the URL
Converts server's hostname into server's IP address
using DNS
Extracts port number (if any) from the URL
Establishes a TCP connection with web server
Sends an HTTP request message to the server
Receives an HTTP response from the server
Connection is closed
Browser displays received web page

myousaf@ymail.com 26
Getting HTML page via HTTP:

myousaf@ymail.com 27
Last words:

This is not the END

This is not even the BEGINING OF END

This is just the END OF THE BEGINNING

myousaf@ymail.com 28
Thanks

myousaf@ymail.com 29

Das könnte Ihnen auch gefallen