51
Data and Computer Data and Computer Communications Communications Eighth Edition Eighth Edition by William Stallings by William Stallings Lecture slides by Lawrie Lecture slides by Lawrie Brown Brown Chapter 22 – Internet Chapter 22 – Internet Applications Applications Electronic Mail and Electronic Mail and Network Management Network Management

Data and Computer Communications

Embed Size (px)

DESCRIPTION

Data and Computer Communications. Chapter 22 – Internet Applications Electronic Mail and Network Management. Eighth Edition by William Stallings Lecture slides by Lawrie Brown. Internet Applications Electronic Mail and Network Management. - PowerPoint PPT Presentation

Citation preview

Page 1: Data and Computer Communications

Data and Computer Data and Computer CommunicationsCommunications

Eighth EditionEighth Edition

by William Stallingsby William Stallings

Lecture slides by Lawrie BrownLecture slides by Lawrie Brown

Chapter 22 – Internet ApplicationsChapter 22 – Internet ApplicationsElectronic Mail andElectronic Mail and

Network Management Network Management

Page 2: Data and Computer Communications

InternetInternet ApplicationsApplications Electronic Mail and Electronic Mail and

Network Management Network ManagementOne of the most exciting aspects of birds' lives is how they interact with others during such social activities as defending territories, courting mates, nesting, raising young, and flocking. Birds' level of sociability changes with the seasons; they may be gregarious at certain times of year yet highly territorial at others. Some of the most fascinating behavior occurs in spring and summer when birds are engaged in breeding. During a social interaction, an individual is coordinating its activities with those of another. This inevitably requires communication.—Secret Lives of Common Birds, Marie Read

Page 3: Data and Computer Communications

Electronic MailElectronic Mail

most heavily used application on any networkmost heavily used application on any network Simple Mail Transfer Protocol Simple Mail Transfer Protocol (SMTP)(SMTP)

TCP/IPTCP/IP delivery of simple text messagesdelivery of simple text messages

Multi-purpose Internet Mail Extension Multi-purpose Internet Mail Extension (MIME)(MIME) delivery of other types of datadelivery of other types of data

• voice, images, video clipsvoice, images, video clips

Page 4: Data and Computer Communications

SMTPSMTP

RFC 821RFC 821 not concerned with format of messages or datanot concerned with format of messages or data

covered in RFC 822 (see later)covered in RFC 822 (see later) SMTP uses info written on envelope of mail SMTP uses info written on envelope of mail

message headermessage header does not look at contents does not look at contents

message bodymessage body except:except:

standardize message character set to 7 bit ASCIIstandardize message character set to 7 bit ASCII add log info to start of message (path)add log info to start of message (path)

Page 5: Data and Computer Communications

Basic OperationBasic Operation

email message is created by user agent email message is created by user agent program (mail client), and consists of:program (mail client), and consists of: header with recipient’s address and other infoheader with recipient’s address and other info body containing user databody containing user data

messages queued and sent as input to messages queued and sent as input to SMTP sender programSMTP sender program typically a server process (daemon on UNIX)typically a server process (daemon on UNIX)

Page 6: Data and Computer Communications

SMTP Mail FlowSMTP Mail Flow

Page 7: Data and Computer Communications

(Mail Message Contents)(Mail Message Contents)

each queued message has two partseach queued message has two parts message textmessage text

RFC 822 header with envelope and list of recipientsRFC 822 header with envelope and list of recipients message body, composed by usermessage body, composed by user

list of mail destinationslist of mail destinations derived by user agent from headerderived by user agent from header may be listed in headermay be listed in header may require expansion of mailing listsmay require expansion of mailing lists may need replacement of mnemonic names with mailbox may need replacement of mnemonic names with mailbox

namesnames if BCCs indicated, user agent needs to prepare if BCCs indicated, user agent needs to prepare

correct message formatcorrect message format

Page 8: Data and Computer Communications

SMTP SenderSMTP Sender

takes message from queuetakes message from queue transmits to proper destination hosttransmits to proper destination host

via SMTP transactionvia SMTP transaction over one or more TCP connections to port 25over one or more TCP connections to port 25

host may have multiple senders activehost may have multiple senders active host must create receivers on demandhost must create receivers on demand when delivery complete, sender deletes when delivery complete, sender deletes

destination from list for that messagedestination from list for that message when all destinations processed, message is when all destinations processed, message is

deleteddeleted

Page 9: Data and Computer Communications

Sending OptimizationsSending Optimizations

if message destined for multiple if message destined for multiple users on users on a given hosta given host, , it is sent only onceit is sent only once delivery to users handled at destination hostdelivery to users handled at destination host

if multiple messages ready for given hostif multiple messages ready for given host, , a single TCP connection can be useda single TCP connection can be used saves overhead of setting up and dropping saves overhead of setting up and dropping

connectionconnection

Page 10: Data and Computer Communications

Possible ErrorsPossible Errors

host unreachablehost unreachable host out of operationhost out of operation TCP connection fail during transferTCP connection fail during transfer sender can re-queue mailsender can re-queue mail

give up after a periodgive up after a period faulty destination addressfaulty destination address

user erroruser error target user changed addresstarget user changed address redirect if possibleredirect if possible inform user if notinform user if not

Page 11: Data and Computer Communications

SMTP Protocol - Reliability SMTP Protocol - Reliability

used to transfer messages from sender to used to transfer messages from sender to receiver over TCP connectionreceiver over TCP connection

attempts to provide reliable serviceattempts to provide reliable service no guarantee to recover lost messagesno guarantee to recover lost messages no end to end acknowledgement to originatorno end to end acknowledgement to originator error indication delivery not guaranteederror indication delivery not guaranteed generally considered reliablegenerally considered reliable

Page 12: Data and Computer Communications

SMTP ReceiverSMTP Receiver

accepts arriving messageaccepts arriving message places in user mailbox or copies to outgoing places in user mailbox or copies to outgoing

queue for forwardingqueue for forwarding receiver must:receiver must:

verify local mail destinationsverify local mail destinations deal with errorsdeal with errors

sender responsible for message until receiver sender responsible for message until receiver confirms complete transferconfirms complete transfer indicates mail has arrived at host, indicates mail has arrived at host, not usernot user

Page 13: Data and Computer Communications

SMTP ForwardingSMTP Forwarding

mostly direct transfer from sender host to mostly direct transfer from sender host to receiver hostreceiver host How do we locate the STMP receiver ?How do we locate the STMP receiver ?

• https://www.exclamationsoft.com/exclamationsoft/https://www.exclamationsoft.com/exclamationsoft/netmailbot/help/website/netmailbot/help/website/HowToFindTheSMTPMailServerForAnEmailAddress.htmlHowToFindTheSMTPMailServerForAnEmailAddress.html

may go through intermediate machine via may go through intermediate machine via forwarding capabilityforwarding capability target user may have moved…target user may have moved… Also, sender can specify routeAlso, sender can specify route

Page 14: Data and Computer Communications

ConversationConversation

SMTP limited to conversation between SMTP limited to conversation between sender and receiversender and receiver

main function is to transfer messagesmain function is to transfer messages rest of mail handling beyond scope of rest of mail handling beyond scope of

SMTP and may differ between systemsSMTP and may differ between systems

Page 15: Data and Computer Communications

Connection SetupConnection Setup(ex: http://www.yuki-onna.co.uk/email/smtp.html)(ex: http://www.yuki-onna.co.uk/email/smtp.html)

sender opens TCP connection with receiversender opens TCP connection with receiver once connected, receiver identifies itselfonce connected, receiver identifies itself

220 <domain> service ready220 <domain> service ready

sender identifies itselfsender identifies itself HELO …..HELO …..

receiver accepts sender’s identificationreceiver accepts sender’s identification 250 ….. 250 …..

if mail service not available, step 2 returns:if mail service not available, step 2 returns: 421 service not available421 service not available

Page 16: Data and Computer Communications

Example SMTP TransferExample SMTP Transfer S: MAIL FROM:<[email protected]>S: MAIL FROM:<[email protected]> R: 250 OKR: 250 OK S: RCPT TO:<[email protected]>S: RCPT TO:<[email protected]> R: 250 OKR: 250 OK S: RCPT TO:<[email protected]>S: RCPT TO:<[email protected]> R: 550 No such user hereR: 550 No such user here S: RCPT TO:<[email protected]>S: RCPT TO:<[email protected]> R: 250 OKR: 250 OK S: DATAS: DATA R: 354 Start mail input; end with <CRLF>.<CRLF>R: 354 Start mail input; end with <CRLF>.<CRLF> S: Blah blah blah...S: Blah blah blah... S: ...etc. etc. etc.S: ...etc. etc. etc. S: <CRLF>.<CRLF> (only character on the line…)S: <CRLF>.<CRLF> (only character on the line…) R: 250 OKR: 250 OK

Page 17: Data and Computer Communications

SMTP System OverviewSMTP System Overview

commands and responses exchangedcommands and responses exchanged between sender and receiverbetween sender and receiver

initiative with senderinitiative with sender establishes TCP connectionestablishes TCP connection

sender sends a command to receiversender sends a command to receiver e.g. HELO<SP><domain><CRLF>e.g. HELO<SP><domain><CRLF>

generates exactly one replygenerates exactly one reply e.g. 250 requested mail action ok; completede.g. 250 requested mail action ok; completed

Page 18: Data and Computer Communications

SMTP CommandsSMTP Commands

Name Description

HELO Send identification

MAIL Identifies originator of mail

RCPT Identifies recipient of mail

DATA Transfer message text

RSET Abort current mail transaction

NOOP No operation

QUIT Close TCP connection

SEND Send mail to terminal

SOML Send mail to terminal if possible; otherwise to mailbox

SAML Send mail to terminal and mailbox

VRFY Confirm user name

EXPN Return membership of mailing list

HELP Send system-specific documentation

TURN Reverse role of sender and receiver

Page 19: Data and Computer Communications

SMTP RepliesSMTP Replies positive completion reply (2xx)positive completion reply (2xx)

e.g. 220 e.g. 220 <domain> Service ready e.g. 250 e.g. 250 Requested mail action okay, completed

positive intermediate reply (3xx)positive intermediate reply (3xx) e.g. 354 e.g. 354 Start mail input; end with <CRLF>.<CRLF>

transient negative completion reply (4xx)transient negative completion reply (4xx) e.g. 452 e.g. 452 Requested action not taken: insufficient system

storage permanent negative completion reply (5xx)permanent negative completion reply (5xx)

e.g. 500 e.g. 500 Syntax error, command unrecognized e.g. 550 e.g. 550 Requested action not taken: mailbox unavailable

(e.g., mailbox not found, no access)

Page 20: Data and Computer Communications

(Mail Transfer)(Mail Transfer)

sender may then send one or more messages sender may then send one or more messages MAIL command identifies originatorMAIL command identifies originator

gives reverse path to used for error reportinggives reverse path to used for error reporting receiver returns 250 OK or fail/error messagereceiver returns 250 OK or fail/error message

one or more RCPT commands identifies recipients for one or more RCPT commands identifies recipients for the messagethe message

DATA command transfers message textDATA command transfers message text end of message shown by line containing just period .end of message shown by line containing just period .

Page 21: Data and Computer Communications

Closing ConnectionClosing Connection

two stepstwo steps sender sends QUIT and waits for replysender sends QUIT and waits for reply then initiate TCP close operationthen initiate TCP close operation receiver initiates TCP close after sending receiver initiates TCP close after sending

reply to QUIT (221 …)reply to QUIT (221 …)

Page 22: Data and Computer Communications

RFC 882 Email FormatRFC 882 Email Format(see next slide)(see next slide)

message has envelope and contentsmessage has envelope and contents envelope contains information required to envelope contains information required to

transmit and deliver messagetransmit and deliver message content defined by RFC822content defined by RFC822 message is sequence of lines of textmessage is sequence of lines of text

uses general memo frameworkuses general memo framework• multiple header lines, rigid format, then arbitrary multiple header lines, rigid format, then arbitrary

text bodytext body each header line has form:each header line has form:

• keyword: argumentskeyword: arguments

Page 23: Data and Computer Communications

Example MessageExample Message

Date:Tue, 16 Jan 1996 10:37:17 (EST)Date:Tue, 16 Jan 1996 10:37:17 (EST)From: “William Stallings” <[email protected]>From: “William Stallings” <[email protected]>Subject:The syntax of RFC 822Subject:The syntax of RFC 822To: [email protected]: [email protected]: Jones@Yet-another_host.comCc: Jones@Yet-another_host.com

This is the main text, delimited from the header by This is the main text, delimited from the header by a blank line.a blank line.

Page 24: Data and Computer Communications

Multipurpose Internet Mail Multipurpose Internet Mail Extension (MIME)Extension (MIME)

extension to RFC822 to resolve issues like:extension to RFC822 to resolve issues like: SMTP can not transmit SMTP can not transmit executablesexecutables can not transmit text including can not transmit text including international characters international characters

(e.g. â, å, ä, è, é, ê, ë)(e.g. â, å, ä, è, é, ê, ë) servers may reject mail over certain sizeservers may reject mail over certain size ASCII to EBCDIC translation not standardASCII to EBCDIC translation not standard SMTP gateways to X.400 can not handle non-text SMTP gateways to X.400 can not handle non-text

data in X.400 messagesdata in X.400 messages some SMTP implementations do not adhere to some SMTP implementations do not adhere to

standardstandard

Page 25: Data and Computer Communications

Overview of MIMEOverview of MIME

five new message header fieldsfive new message header fields MIME versionMIME version Content typeContent type Content transfer encodingContent transfer encoding Content IdContent Id Content DescriptionContent Description

number of content formats definesnumber of content formats defines transfer encoding definedtransfer encoding defined

Page 26: Data and Computer Communications

Content Type/SubtypeContent Type/Subtype

Text body -Text body ->> in given character set in given character set Multipart -> body contains multiple partsMultipart -> body contains multiple parts MessageMessage ImageImage VideoVideo AudioAudio ApplicationApplication

Page 27: Data and Computer Communications

Multipart MIME Example 1Multipart MIME Example 1From: John Smith <[email protected]>From: John Smith <[email protected]>To: Ned Jones <[email protected]>To: Ned Jones <[email protected]>Subject: Sample messageSubject: Sample messageMIME-Version: 1.0MIME-Version: 1.0Content-type: multipart/mixed; boundary="simple boundary"Content-type: multipart/mixed; boundary="simple boundary"

This is the preambleThis is the preamble. It is to be ignored. It is to be ignored, though it is a handy place for mail composers , though it is a handy place for mail composers to include an explanatory note to non-MIME conformant readers.to include an explanatory note to non-MIME conformant readers.

--simple boundary--simple boundary

This is This is implicitlyimplicitly typed plain ASCII text. It does NOT end with a linebreak. typed plain ASCII text. It does NOT end with a linebreak.--simple boundary--simple boundaryContent-type: text/plain; charset=us-asciiContent-type: text/plain; charset=us-ascii

This is This is explicitlyexplicitly typed plain ASCII text. It DOES end with a linebreak. typed plain ASCII text. It DOES end with a linebreak.

--simple boundary----simple boundary--This is the epilogue. This is the epilogue. It is also to be ignored.It is also to be ignored.

Page 28: Data and Computer Communications

Multipart MIME Example 2Multipart MIME Example 2

http://en.wikipedia.org/wiki/MIME#Multipart_messageshttp://en.wikipedia.org/wiki/MIME#Multipart_messages

-see “Content-Transfer-Encoding: base64”-see “Content-Transfer-Encoding: base64”

Page 29: Data and Computer Communications

MIME Transfer MIME Transfer EncodingsEncodings

reliable delivery over range of environmentsreliable delivery over range of environments uses content transfer encoding fielduses content transfer encoding field

3 specify bit interpretation, other 3 encodings3 specify bit interpretation, other 3 encodings Quoted-printable encodingQuoted-printable encoding

data largely printable ASCII charactersdata largely printable ASCII characters non-printing characters represented by hex code (=##)non-printing characters represented by hex code (=##)

Base64 encodingBase64 encoding maps maps arbitrary binary input arbitrary binary input onto printable outputonto printable output

X-token encodingX-token encoding named nonstandard encodingnamed nonstandard encoding

Page 30: Data and Computer Communications

Network ManagementNetwork Management

Page 31: Data and Computer Communications

Network ManagementNetwork Management

networks are becoming indispensablenetworks are becoming indispensable more complexity makes failure more likelymore complexity makes failure more likely require automatic network management toolsrequire automatic network management tools standards required to allow multi-vendor networksstandards required to allow multi-vendor networks covering:covering:

servicesservices protocolsprotocols Management information base (MIB)Management information base (MIB)

Page 32: Data and Computer Communications

Network Management Network Management SystemsSystems

collection of tools for network managementcollection of tools for network management single operator interfacesingle operator interface powerful, user friendly command setpowerful, user friendly command set performing most or all management tasksperforming most or all management tasks minimal amount of separate equipmentminimal amount of separate equipment

i.e. use existing equipmenti.e. use existing equipment

view entire network as unified architectureview entire network as unified architecture active elements provide active elements provide regular feedbackregular feedback

Page 33: Data and Computer Communications

Simple Network Management Simple Network Management Protocol (SNMP)Protocol (SNMP)

SNMP v1 SNMP v1 developed for managing TCP/IP developed for managing TCP/IP (inter) networks(inter) networks

defines protocol, database, other conceptsdefines protocol, database, other concepts basic conceptsbasic concepts

management station or managermanagement station or manager agentagent (-> a software component) (-> a software component) management information basemanagement information base network management protocolnetwork management protocol

Page 34: Data and Computer Communications

Management StationManagement Station

stand alone system or part of shared systemstand alone system or part of shared system interface for human network managerinterface for human network manager set of management applicationsset of management applications

data analysisdata analysis fault recoveryfault recovery

interface to monitor and control networkinterface to monitor and control network translate manager’s requirements into translate manager’s requirements into

monitoring and control of remote elementsmonitoring and control of remote elements data base of network management information data base of network management information

extracted from managed entitiesextracted from managed entities

Page 35: Data and Computer Communications

Management Management AgentAgent

equip key platforms with agent softwareequip key platforms with agent software e.g. hosts, bridges, hubs, routers e.g. hosts, bridges, hubs, routers

allows their management by management allows their management by management stationstation respond to requests for informationrespond to requests for information respond to requests for actionrespond to requests for action asynchronously supply unsolicited informationasynchronously supply unsolicited information -> -> traptrap

Page 36: Data and Computer Communications

Management Information Management Information Base (MIB)Base (MIB)

representation of network resources as objectsrepresentation of network resources as objects each object a variable representing one aspect of each object a variable representing one aspect of

managed objectmanaged object

MIB is collection of access points at agent for MIB is collection of access points at agent for management of stationmanagement of station

objects standardized across class of systemobjects standardized across class of system bridge, router etc.bridge, router etc.

management station management station retrieves values of MIB objects to provide monitoringretrieves values of MIB objects to provide monitoring sets MIB object values to change configurationsets MIB object values to change configuration

Page 37: Data and Computer Communications

Network Management Network Management ProtocolProtocol

link between management station & agentlink between management station & agent TCP/IP uses SNMPTCP/IP uses SNMP OSI uses Common Management Information OSI uses Common Management Information

Protocol (CMIP)Protocol (CMIP) SNMPv2 SNMPv2 (enhanced SNMP) for OSI & TCP/IP(enhanced SNMP) for OSI & TCP/IP

key capabilitieskey capabilities get -get ->> management station retrieves value management station retrieves value set -> management station sets valueset -> management station sets value notify -> agent sends event notification (trap)notify -> agent sends event notification (trap)

Page 38: Data and Computer Communications

Management LayoutManagement Layout

may be centralizedmay be centralized in simple network in simple network may be distributed may be distributed in large, complex in large, complex

networknetwork multiplemultiple management servers management servers

• each manages pool of agentseach manages pool of agents• management may be management may be delegateddelegated to intermediate to intermediate

managermanager

Page 39: Data and Computer Communications

Distributed Network Distributed Network Management ExampleManagement Example

Page 40: Data and Computer Communications

Distributed Network Distributed Network Management ExampleManagement Example

http://en.wikipedia.org/wiki/File:SNMP_communication_principles_diagram.PNG

See “Trap”

Page 41: Data and Computer Communications

SNMP ArchitectureSNMP Architecture

Page 42: Data and Computer Communications

SNMP ArchitectureSNMP Architecture

Page 43: Data and Computer Communications

SNMP v1SNMP v1

August 1988 SNMP specification issuedAugust 1988 SNMP specification issued stand alone management stations and bridges, stand alone management stations and bridges,

routers workstations etc supplied with agentsrouters workstations etc supplied with agents defines limited, easily implemented MIB of scalar defines limited, easily implemented MIB of scalar

variables and two dimensional tablesvariables and two dimensional tables streamlined protocolstreamlined protocol limited functionalitylimited functionality lack of securitylack of security SNMP v2 1993, revised 1996SNMP v2 1993, revised 1996

RFC 1901-1908RFC 1901-1908

Page 44: Data and Computer Communications

(Network Management (Network Management Framework)Framework)

have framework on which network management have framework on which network management applications can be builtapplications can be built e.g fault management, performance monitoring, e.g fault management, performance monitoring,

accountingaccounting management protocol is used to exchange management protocol is used to exchange

management informationmanagement information e.g. SNMP v1 & v2e.g. SNMP v1 & v2

each player maintains local MIBeach player maintains local MIB at least one system responsible for managementat least one system responsible for management

houses management applicationshouses management applications

Page 45: Data and Computer Communications

Exmple Exmple SNMP v2 SNMP v2 Managed Managed

ConfigConfigEach agent maintains a local MIBEach agent maintains a local MIB

Page 46: Data and Computer Communications

SNMP v2SNMP v2

support central or distributed managementsupport central or distributed management in distributed system, some elements in distributed system, some elements

operate as manager and agentoperate as manager and agent exchanges use SNMP v2 protocolexchanges use SNMP v2 protocol

simple request/response protocolsimple request/response protocol typically uses UDPtypically uses UDP

• ongoing reliable connection not requiredongoing reliable connection not required• reduces management overheadreduces management overhead

Page 47: Data and Computer Communications

(Structure of (Structure of Management Information (SMI))Management Information (SMI)) defines general framework with which MIB defines general framework with which MIB

defined and constructeddefined and constructed identifies data typesidentifies data types how resources are represented and namedhow resources are represented and named

encourages simplicity and extensibilityencourages simplicity and extensibility has scalars and two dimensional arrays of has scalars and two dimensional arrays of

scalars (tables) onlyscalars (tables) only three key elements: three key elements:

data types, objects, object identifiersdata types, objects, object identifiers

Page 48: Data and Computer Communications

SNMP v2 PDU FormatsSNMP v2 PDU Formats

PDU type request-id 0 0 variable-bindings

(a) GetRequest, GetNextRequest, SetRequest, SNMPv2-Trap, InformRequest

PDU type request-id error-status error-index variable-bindings

(b) Response

PDU type request-id non-repeaters max-repetitions variable-bindings

(c) GetBulkRequest

name1 value1 name2 value2 • • • namen valuen

(d) variable-bindings

Page 49: Data and Computer Communications

SNMP v3SNMP v3

addresses security issues of SNMP v1/2addresses security issues of SNMP v1/2 RFC 2570-2575RFC 2570-2575 proposed standard January 1998proposed standard January 1998 defines overall architecture and security defines overall architecture and security

capabilitycapability to be used with SNMP v2to be used with SNMP v2 defines three security servicesdefines three security services

authenticationauthentication privacyprivacy access controlaccess control

Page 50: Data and Computer Communications

(SNMP v3 Services)(SNMP v3 Services)

authentication assures that message is:authentication assures that message is: from identified source, not altered, not delayed or from identified source, not altered, not delayed or

replayedreplayed includes HMAC message authentication codeincludes HMAC message authentication code

privacyprivacy encrypts messages using DESencrypts messages using DES

access controlaccess control pre configure agents to provide a number of levels of pre configure agents to provide a number of levels of

access to MIB for different managersaccess to MIB for different managers restricting access to informationrestricting access to information limit operationslimit operations

Page 51: Data and Computer Communications

SummarySummary

electronic mailelectronic mail SMTP (RFC821) mail exchangeSMTP (RFC821) mail exchange RFC822 & MIME mail content formats RFC822 & MIME mail content formats

network managementnetwork management elements and operation of SNMP v1, 2 & 3elements and operation of SNMP v1, 2 & 3