9/15/2015© 2008 raymond p. jefferis iiilect 10 - 1 application layer
TRANSCRIPT
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 1
Application Layer
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 2
Application Tasks
• To supply services to the user– file transfer– World Wide Web browsing– mail– network management– network name services
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 3
Application Layer Protocols
• FTP/TFTP Port 21/69
• Telnet Port 23
• HTTP Port 80
• SMTP Port 25
• SNMP Port 161
• DNS Port 53
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 4
FTP/TFTP
• FTP (File Transfer Protocol)– uses TCP for transfer of files and data– additional parameters must be supplied– user shielded from file system properties– can be used by terminal or program
• TFTP (Trivial File Transfer Protocol)– similar to FTP but uses UDP
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 5
FTP Commands
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 6
FTP – Login (Two types)
• Supply server name
• Supply account (if not “anonymous”)
• Supply Password (user name if anonymous)
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 7
FTP - Directory Operations
• Change Directory (cd)
• List directory (ls)
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 8
FTP - File Transfer
• Set binary mode
• Put local file to server ftp directory
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 9
Telnet• Telnet is a remote terminal protocol
• Remote logon permitted
• User gets virtual terminal (emulation)
• Uses a TCP connection protocol
• Requires two arguments– name of server– protocol port number of server (commercial
software will use default)
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 10
Telnet - Terminal Setup
• Define terminal
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 11
Telnet - Connect from Prompt
• Type Telnet serverName
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 12
Telnet - Connect via Program
• Type Telnet
• Specify server and terminal type
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 13
HTTP
• Hypertext Transfer Protocol– used for World Wide Web (WWW) to retrieve
hypertext documents– client/server mode– transaction-oriented (connection broken after
document transmission is complete)– uses TCP to connect client and server
(virtual “connection”)
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 14
HTTP Message Format
• Request– message type– requested source
• Response– response information
• General– additional information
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 15
HTTP Header Information
• Connection (header field names)
• Date (date and time stamp)
• Keep-alive (sender connection timeout)
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 16
HTTP Request Methods
• Get (from specified URL)
• Put (post to URL)
• Patch (post differences to URL)
• Copy, Move, Delete (URL info)
• Link/Unlink (add or delete link in URL)
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 17
HTTP Response Messages
• Status line– HTTP Version– Status Code– Reason Phrase
• General response
• Entity body (optional)– text, binary data, audio, images, video
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 18
SNMP/SNMPv2
• Simple Network Management Protocol– network monitoring– network management
• Basic actions– Get (request named objects - various datatypes)– Set (request alteration of named objects)– Notify (inform request)– Uses UDP for communications
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 19
SNMP Network Components
• Management stations– restricted access– inspect, display, and alter network data
• Managed nodes– routers, gateways, bridges, switches, hubs, etc.– computers, printers, etc.
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 20
SNMP Management Objectives
• Fault detection
• Equipment configuration
• Gathering statistics– for accounting purposes– for diagnostic purposes
• Network security
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 21
SNMP Model
• Objects– written in ASN.1 syntax– defined in Management Information Base
(MIB) - many types of objects pre-defined
• Agents– programs in managed nodes– supply requested information– alter information when requested
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 22
ASN.1 Data types in SNMP
• INTEGER Type code = 2
• BIT STRING Type code = 3
• OCTET STRING Type code = 4
• NULL Type code = 5
• OBJECT IDENTIFIER Type code = 6Syntax in use:
identifier type ::= value or (range) or {idn(valn), ...}
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 23
SNMP Data Transfer Format
• Header byte– tag (2 bits)– tag extension (1 bit)– type code (5 bits)
• Length [bytes]
• Data bytes
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 24
Basic SNMP Objects
• System - equipment description
• Interfaces - with logged traffic
• AT - address translation
• IP - packet statistics
• ICMP - message statistics
Basic SNMP Objects (Cont’d)
• TCP - methods, parameters, statistics
• UDP - statistics
• EGP - gateway protocol statistics
• Transmission - media-specific
• SNMP - management traffic statistics
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 25
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 26
SNMP Message Types
(0) GetRequest - get variables
(1) GetNextRequest - get next variable
(2) GetResponse- get data
(3) SetRequest - modify variable
(4) Trap - agent trap message
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 27
SMTP
• Simple Mail Transfer Protocol
• Sent and received via Port 25 using TCP
• Envelope– list of recipients
• Body– message to be sent (7-bit ASCII)
• Outgoing messages are queued
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 28
SMTP Header
• TO: address
• FROM: (REPLY TO:) address
• CC: address
• SUBJECT: text
• DATE: date
• ENCRYPTED: pointer
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 29
Some SMTP Commands
• HELO (send ID - sent by client)
• MAIL FROM (identify originator)
• RCPT TO (identify recipient)
• DATA (transfer message text)
• QUIT (close TCP connection)
(See text, p660 for example)
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 30
Some SMTP Replies
• 220 “ready” - returned by server
• 221 “destination closing”
• 250 “okay” - transfer complete
• 345 “ready for mail” - start
• 421 “mail service unavailable”
• 550 “mailbox not found”
• 554 “mail transaction failed”
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 31
DNS• To locate addresses in network domains
• Each host has resource records of format:– DomainName– TimeToLive [seconds]– Class (IN for internet)– Type (see table)– Value (data type depends on Type field)
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 32
DNS (continued)
• Database is distributed and hierarchical
• Names that cannot be resolved in the host are referred up the hierarchy of name servers
Name Servers (Continued)
• There is usually a specified name server for a network configuration
• A backup (second) name server is usually specified
• UDP protocol is used for name server queries and responses
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 33
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 34
DNS Record Types
TYPE MEANING VALUE SOA Start of authority ParametersA IP address of host 4 octetsMX Mail exchange Accepts mailNS Name server Server nameCNAME Canonical name Domain namePTR Pointer IP address aliasHINFO Host description ASCII CPU and OSTXT Text ASCII text
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 35
Example
dcs.engr.widener.edu,147.31.252.126,A,IN
End
04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 36