Application Layer Protocols
Application Layer Protocols
Unit 3.0
Learning Outcomes
Learners will be able to:
Telnet
File Transfer Protocol (FTP)
Hyper Text Transfer Protocol (HTTP)
Simple Mail Transfer Protocol (SMTP), Post Office Protocol
3(POP3), Internet Message Access Protocol (IMAP)
Network News Transfer Protocol (NNTP)
Domain Name System (DNS)
Dynamic Host Configuration Protocol (DHCP)
Telnet
Provides terminal emulation
Comes with nearly all vendor implementations of
TCP/IP
Open standard
Supported by wide range of workstations
Not a secure protocol
Telnet Communications
Options
7- or 8-bit compatibility
Use of different terminal nodes
Character echoing at sending and receiving ends
Synchronized communications
Transmission of character streams or single
characters
Flow control
TELNET vs. telnet
TELNET is a protocol that provides “a general, bi-
directional, eight-bit byte oriented communications
facility”.
TCP connection
data and control over the same connection.
Server
Process
NVT NVT
TCP TCP
Negotiated
Options
All NVTs support a minimal set of capabilities.
Some terminals have more capabilities than the minimal
set.
The set of options is not part of the TELNET protocol,
new terminal features can be incorporated without
changing the TELNET protocol.
Two endpoints negotiate a set of mutually acceptable
options
Line mode vs. character mode
echo modes
character set (EBCDIC vs. ASCII)
Control Functions
TELNET includes support for a series of control
functions commonly supported by servers.
Interpret as Command
Playing with TELNET
You can use the telnet program to play with the
TELNET protocol.
telnet is a generic TCP client.
Sends whatever you type to the TCP socket.
Prints whatever comes back through the TCP socket
Useful for testing TCP servers (ASCII based protocols).
Transport Independence
The HTTP protocol generally takes place over a TCP
connection,
but the protocol itself is not dependent on a specific
transport layer.
Request - Response
HTTP has a simple structure:
client sends a request
server returns a reply.
Request-Line
Headers
.
.
.
blank line
Content...
Request Line
Method URI HTTP-Version\r\n
Absolute URI:
scheme://hostname[:port]/path
http://www.cse.unr.edu:80/~mgunes/cpe401
Relative URI:
/path
/blah/foo
No server mentioned
URI Usage
When dealing with a HTTP 1.1 server, only a path is
used (no scheme or hostname).
HTTP 1.1 servers are required to be capable of
handling an absolute URI, but there are still some out
there that won’t…
Host: www.cse.unr.edu
From: mgunes@cse.unr.edu
User-Agent: Mozilla/4.0
Referrer: http://www.unr.edu/
End of the Headers
Each header ends with a CRLF ( \r\n )
stuid=6660182722&item=test1&grade=99
Example GET Request
GET /~mgunes/cpe401/lab1.htm HTTP/1.1
Accept: */*
Host: www.cse.unr.edu
User-Agent: Internet Explorer
From: mgunes@cse.unr.edu
Referer: http://www.unr.edu/
There is a blank line here!
Status-Line
HTTP Response Headers
.
.
.
blank line
ASCII Status Line
Content...
Headers Section
Server: Apache/1.17
Content-Type: text/html
Content-Length: 1756
Content-Encoding: gzip
Content
Content can be anything (sequence of raw bytes).
HTTP
Browser Proxy
Server
Network Lab #2 HTTP Proxy
You need to write a proxy server.