9/15/2015© 2008 raymond p. jefferis iiilect 10 - 1 application layer

36
06/18/22 © 2008 Raymond P. Jefferis III Lect 10 - 1 Application Layer

Upload: camilla-maxwell

Post on 27-Dec-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 1

Application Layer

Page 2: 9/15/2015© 2008 Raymond P. Jefferis IIILect 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

Page 3: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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

Page 4: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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

Page 5: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 5

FTP Commands

Page 6: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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)

Page 7: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 7

FTP - Directory Operations

• Change Directory (cd)

• List directory (ls)

Page 8: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 8

FTP - File Transfer

• Set binary mode

• Put local file to server ftp directory

Page 9: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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)

Page 10: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 10

Telnet - Terminal Setup

• Define terminal

Page 11: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 11

Telnet - Connect from Prompt

• Type Telnet serverName

Page 12: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 12

Telnet - Connect via Program

• Type Telnet

• Specify server and terminal type

Page 13: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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”)

Page 14: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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

Page 15: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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)

Page 16: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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)

Page 17: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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

Page 18: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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

Page 19: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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.

Page 20: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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

Page 21: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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

Page 22: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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), ...}

Page 23: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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

Page 24: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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

Page 25: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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

Page 26: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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

Page 27: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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

Page 28: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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

Page 29: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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)

Page 30: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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”

Page 31: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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)

Page 32: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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

Page 33: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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

Page 34: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

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

Page 35: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 35

Example

dcs.engr.widener.edu,147.31.252.126,A,IN

Page 36: 9/15/2015© 2008 Raymond P. Jefferis IIILect 10 - 1 Application Layer

End

04/19/23 © 2008 Raymond P. Jefferis III Lect 10 - 36