You are on page 1of 39

Traditional Internet Applications

Asst. Prof. Chaiporn Jaikaeo, Ph.D.


chaiporn.j@ku.ac.th
http://www.cpe.ku.ac.th/~cpj
Computer Engineering Department
Kasetsart University, Bangkok, Thailand

Adapted from the notes by Lami Kaya, LKaya@ieee.org, and notes by J.F Kurose and K.W. Ross
1
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
Application-Layer Protocols
 Specs for network applications
 The syntax and semantics of messages
 Actions to be taken if an error arises
 How the two sides know when to terminate
communication
 There are two broad types of application-layer
protocols that depend on the intended use:
 Private communication—proprietary, limited scope
 Standardized service—standard, Internet-wide: Web
server, FTP, etc.
 Standards for the Internet are known as Request for Comments
(RFCs)

2
Representation And Transfer
 Application-layer protocols specify two
aspects of interaction:
 Representation
 Transfer

3
World Wide Web
Web Protocols
 The World Wide Web (WWW) is one of the
most widely used services in the Internet

5
Document Representation With HTML

 HyperText Markup Language (HTML)


 Specifies the syntax of a web page
 Uses a textual representation
 Describes pages that contain multimedia
 Provides markup specifications instead of
formatting
 Permits a hyperlink to be embedded in an
arbitrary object

6
Document Representation With HTML
<HTML>
<HEAD>
<TITLE>
Document Title
</TITLE>
</HEAD>
<BODY>
Hello
</BODY>
</HTML>

 Whitespaces do not matter


<HTML><HEAD><TITLE>Document Title</TITLE></HEAD>
<BODY>Hello</BODY></HTML>

7
Uniform Resource Locators
 URLs identify where resources can be found
and how they can be obtained
 The general form of a URL is:

 Example:

8
Uniform Resource Locators
 In a typical URL, a user can omit many of the parts
 E.g.,

 Which omits
 the protocol (http is assumed)
 the port (80 is assumed)
 the document name (index.html is assumed)
 and parameters (none are assumed)

9
Hypertext Transfer Protocol
 HyperText Transfer Protocol (HTTP)
 Primary transfer protocol between web server
and browser (client)
 A browser is a client that extracts a server
name from a URL and contacts the server
 Most URLs contain an explicit protocol
reference of http:// or omit the protocol
altogether (HTTP is assumed)

10
HTTP
 Once it establishes a connection
 a browser sends an HTTP request to the server

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 11
HTTP GET Requests/Responses
 The browser (client) sends a GET request to
request a resource (e.g., HTML doc, images)
 The server responds by sending a header, a
blank line, and the requested document
Sample GET request Sample response
GET /index.html HTTP/1.1 HTTP/1.0 200 OK
Server: Apache/1.3.37
Content-Length: 221
CRLF Content-Type: text/html
(\r\n)
<HTML>
:
</HTML>
12
Response Details
 The first line of a response header contains a status
code

 Additional lines of the header give further


information, such as
 its length
 when it was last modified
 and the content type
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 13
Web Browser Architecture
 A browser must understand HTTP (at least)
 A browser also provides support for other
protocols
 Knows how to interact with a server and how to
interpret responses
 E.g., a browser must know how to access the FTP
(File Transfer Protocol) service
 Knows what external program to launch for
particular protocol code

14
Electronic Mail
Electronic Mail
 One of the most widely used Internet applications
 Because it was conceived before personal computers and
hand-held PDAs were available,
 Email software is divided into two parts
 Email interface application
 A mechanism for a user to compose and edit outgoing messages
as well as read and process incoming email
 Email transfer program
 acts as a client to send a message to the mail server on the
destination computer; the mail server accepts incoming messages
and deposits each in the appropriate user's mailbox

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 21
Electronic Mail
 The specifications used for Internet email
can be divided into three broad categories

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 22
Simple Mail Transfer Protocol (SMTP)

 Standard protocol that a mail transfer


program uses
 SMTP has a restriction to send only textual
content
 MIME standard that allows email to include
attachments such as graphic images or binary
files
 SMTP can send a single message to multiple
recipients
23
Example SMTP Session

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 24
ISPs, Mail Servers, And Mail Access

 Most users do not know how to configure


and manage an email server
 ISPs began offering email services
 An ISP runs an email server and provides a
mailbox for each user
 Email access follows one of two forms:
 A special-purpose email interface application
 A web browser that accesses an email web page

25
ISPs, Mail Servers, And Mail Access

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 26
Web Browser as Mail Access
 ISP provides a special web page that displays
messages from a user's mailbox
 Advantages
 ability to read email from any computer
 a user does not need to run a special mail
interface application

27
Mail Access Protocols (POP, IMAP)

 Provide access to a user’s mailbox


 Permit a user to view headers, download,
delete, or send messages
 Client runs on user’s personal computer
 Server runs on a computer that stores user’s
mailbox

28
Email Representation Standards
 Two important email representation
standards exist:
 RFC (Request For Comments) 2822 Internet
Message Format
 Multi-purpose Internet Mail Extensions (MIME)

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 29
RFC 2822 Mail Message Format
 Takes its name from the IETF standards document
RFC 2822
 A mail message is represented as a text file and
consists of
 a header section
 a blank line
 and a body
 Header lines each have the form:
Keyword: information
 where the set of keywords is defined to include From:,
To:, Subject:, Cc:
Multi-purpose Internet Mail Extensions
(MIME)
 The MIME standard extends the functionality
of email to allow the transfer of non-text
data in a message
 MIME specifies how a binary file can be
encoded into printable characters, included in
a message, and decoded by the receiver
 The Base64 encoding standard is most
popular, but MIME does not restrict encoding
to a specific form
31
Domain Name System
Domain Name System (DNS)
 DNS provides a service that maps human-
readable symbolic names to computer
addresses
 Just like a phonebook of the Internet
 Browsers, mail software, and most other
Internet applications use the DNS

33
Domain Name System (DNS)
 Each name consists of a sequence of alpha-numeric
segments separated by periods
 For example, a computer in the Computer Engineering
Department at Kasetsart University has the domain
name:
garnet.cpe.ku.ac.th
 A computer at Cisco, Incorporated has the domain name:
anakin.cisco.com
 Domain names are hierarchical, with the most
significant part of the name on the right

34
Top-Level Domains (TLDs)
 The most significant segment of each domain name
is called a top-level domain (TLD)
 Controlled by the Internet Corporation for Assigned
Names and Numbers (ICANN)
 ICANN designates one or more domain registrars to
administer a given top-level domain and approve specific
names

35
Examples of TLDs

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 36
Examples of Country Code TLDs
ccTLD Country
at Austria
be Belgium
ca Canada
ch Switzerland
cn Mainland China
fm Federated States of Micronesia
jp Japan
th Thailand
to Tonga
tv Tuvalu
DNS Hierarchy And Server Model
 Each organization is free to choose the
details of its servers
 A small organization that only has a few
computers can contract with an ISP to run a DNS
server.
 An organization that runs its own server can
choose to place all names for the organization in
a single physical server, or it can choose to
divide its names among multiple servers

38
Possible Server Setups

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 39
Name Resolution
 Software (or library) to perform name-address
translation is known as a name resolver
 The resolver becomes a client of a DNS server
 DNS server returns an answer to the caller
 Each resolver is configured with the address of one
or more local domain name servers
 The resolver forms a DNS request message
 sends the message to the local server
 waits for the server to send a DNS reply message for the
answer

40
Example root DNS server

 Host at 2
cis.poly.edu wants 3
.edu DNS server
IP address for 4

gaia.cs.umass.edu 5

local DNS server


dns.poly.edu
7 6
1 8

authoritative DNS server


There are 13 root dns.cs.umass.edu
DNS servers around requesting host
cis.poly.edu
the world
gaia.cs.umass.edu
DNS Caching
 Once (any) name server learns mapping, it
caches mapping
 Cache entries timeout (disappear) after

some time
 TLD servers typically cached in local name

servers
 Thus root name servers not often visited
nslookup Command
 Tool for querying DNS
 Available for many operating systems
 Including Windows and Linux
$ nslookup
> www.sanook.com
Server: 158.108.32.3
Address: 158.108.32.3#53

Non-authoritative answer:
Name: www.sanook.com
Address: 203.107.165.221
>
Summary
 Common Internet applications and protocols
 World Wide Web
 Electronic Mail
 File Transfer
 Domain Name System

You might also like