9992952aa7ed2996a96d799b8b456681.ppt
- Количество слайдов: 76
William Stallings Data and Computer Communications Chapter 19 Distributed Applications
Abstract Syntax Notation One ASN. 1 z Used to define format of PDUs z Representation of distributed information z Representation of operations performed on transmitted data
Terms Relevant to ANS. 1 z Abstract Syntax y. Describes generic structure of data z Data Type y. Named set of values z Encoding y. Sequence of octets used to represent data value z Encoding Rules y. Mapping from one syntax to another z Transfer Syntax y. Way data represented in bit patterns while in transit
Use of Abstract and Transfer Syntaxes
ASN. 1 Concepts z Module definition y. Structured definition of a data structure using ASN. 1 y. Name of module used as abstract syntax name
Form of Modules z
Lexical Conventions z Layout not significant z Comments delimited by pair of hyphens (--) at start and pair of hyphens or end of line end of comment z Identifiers, type references and module names consist of upper and lower case letters, digits and hyphens z Identifier starts with lower case letter z Type reference or module name begins with upper case letter z Built in type consists of all upper case letters
Abstract Data Types z Collection of values z Simple y. Atomic y. No components z Structured y. Has components z Tagged y. Derived from other types z Other y. Include CHOICE and ANY types (see later)
Tag Classes (1) z Every data type (except CHOICE and ANY) has associated tag z Universal y. Generally useful y. Application independent y. Defined in standard ye. g. Boolean, Integer, Real
Tag Classes (2) z Application wide y. Relevant to particular application z Context specific y. Relevant to particular application y. Applicable in limited context z Private y. User defined
CHOICE and ANY z Data types without tags y. When value assigned, type also assigned y. Type assigned at run time z CHOICE y. List of alternative known types y. Only one type used to create value z ANY y. Arbitrary value y. Arbitrary type
Subtypes (1) z Derived from parent type z Restricted subset of values z May be nested z Single value subtype y. Explicit listing of all valid values z Contained subtype y. Used to form new subtype from existing subtypes y. Includes all values of subtypes it contains z Value range subtype y. Real and Integer only y. Specify endpoints of range
Subtypes (2) z Permitted alphabet constraint y. Only character string y. All values that can be constructed using sub-alphabet z Size constrained y. Limits number of items in type ye. g. number of bits in bit type z Inner type constraint y. Applied to SEQUENCE, SEQUENCE OF, SET OF, CHOICE y. Only values from parent that satisfy one or more contraints
PDU Example (part 1)
PDU Example (part 2)
PDU Example (part 3)
Network Management - SNMP z Simple Network Management Protocol z Networks are becoming indispensable z More complexity makes failure more likely z Require automatic network management tools z Standards required to allow multi-vendor networks z Covering: y. Services y. Protocols y. Management information base (MIB)
Network Management Systems z Collection of tools for network management z Single operator interface z Powerful, user friendly command set z Performing most or all management tasks z Minimal amount of separate equipment yi. e. use existing equipment z View entire network as unified architecture z Active elements provide regular feedback
Key Elements z Management station or manager z Agent z Management information base z Network management protocol
Management Station z Stand alone system or part of shared system z Interface for human network manager z Set of management applications y. Data analysis y. Fault recovery z Interface to monitor and control network z Translate manager’s requirements into monitoring and control of remote elements z Data base of network management information extracted from managed entities
Agent z Hosts, bridges, hubs, routers equipped with agent software z Allow them to be managed from management station z Respond to requests for information z Respond to requests for action z Asynchronously supply unsolicited information
Management Information Base z MIB z Representation of network resources as objects z Each object a variable representing one aspect of managed object z MIB is collection of access points at agent for management of station z Objects standardized across class of system y. Bridge, router etc.
Network Management Protocol z Link between management station and agent z TCP/IP uses SNMP z OSI uses Common Management Information Protocol (CMIP) z SNMPv 2 (enhanced SNMP) for OSI and TCP/IP
Protocol Capabilities z Get z Set z Notify
Management Layout z May be centralized in simple network z May be distributed in large, complex network y. Multiple management servers y. Each manages pool of agents y. Management may be delegated to intermediate manager
Example of Distributed Network Management Configuration
SNMP v 1 z August 1988 SNMP specification issued z Stand alone management stations and bridges, routers workstations etc supplied with agents z Defines limited, easily implemented MIB of scalar variables and two dimensional tables z Streamlined protocol z Limited functionality z Lack of security z SNMP v 2 1993, revised 1996 y. RFC 1901 -1908
SNMP v 2 (1) z Framework on which network management applications can be built ye. g fault management, performance monitoring, accounting z Protocol used to exchange management information z Each player maintains local MIB y. Structure defined in standard z At least one system responsible for management y. Houses management applications
SNPM v 2 (2) z Support central or distributed management z In distributes system, some elements operate as manager and agent z Exchanges use SNMP v 2 protocol y. Simple request/response protocol y. Typically uses UDP x. Ongoing reliable connection not required x. Reduces management overhead
SNMP v 2 Managed Configuration
Structure of Management Information z SMI z Defines general framework with which MIB defined and constructed z Identifies data types z How resources are represented and named z Encourages simplicity and extensibility z Scalars and two dimensional arrays of scalars (tables) only
Protocol Operation z Exchange of messages z Outer message header deals with security z Seven types of PDU
SNMP v 2 PDU Formats
SNMP v 3 z Addresses security issues of SNMP v 1/2 z RFC 2570 -2575 z Proposed standard January 1998 z Defines overall architecture and security capability z To be used with SNMP v 2
SNMP v 3 Services z Authentication y. Part of User-Based Security (UBS) y. Assures that message: x. Came from identified source x. Has not been altered x. Has not been delayed or replayed z Privacy y. Encrypted messages using DES z Access control y. Can configure agents to provide a number of levels of access to MIB y. Access to information y. Limit operations
Electronic Mail z Most heavily used application on any network z Simple Mail Transfer Protocol (SMTP) y. TCP/IP y. Delivery of simple text messages z Multi-purpose Internet Mail Extension (MIME) y. Delivery of other types of data y. Voice, images, video clips
SMTP z RFC 821 z Not concerned with format of messages or data y. Covered in RFC 822 (see later) z SMTP uses info written on envelope of mail y. Message header z Does not look at contents y. Message body z Except: y. Standardize message character set to 7 bit ASCII y. Add log info to start of message x. Shows path taken
Basic Operation z Mail created by user agent program (mail client) y. Message consists of: x. Header containing recipient’s address and other info x. Body containing user data z Messages queued and sent as input to SMTP sender program y. Typically a server process (daemon on UNIX)
Mail Message Contents z Each queued message has: y. Message text x. RFC 822 header with message envelope and list of recipients x. Message body, composed by user y. A list of mail destinations x. Derived by user agent from header x. May be listed in header x. May require expansion of mailing lists x. May need replacement of mnemonic names with mailbox names z If BCCs indicated, user agent needs to prepare correct message format
SMTP Sender z Takes message from queue z Transmits to proper destination host y. Via SMTP transaction y. Over one or more TCP connections to port 25 z Host may have multiple senders active z Host should be able to create receivers on demand z When delivery complete, sender deletes destination from list for that message z When all destinations processed, message is deleted
Optimization z If message destined for multiple users on a given host, it is sent only once y. Delivery to users handled at destination host z If multiple messages ready for given host, a single TCP connection can be used y. Saves overhead of setting up and dropping connection
Possible Errors z Host unreachable z Host out of operation z TCP connection fail during transfer z Sender can re-queue mail y. Give up after a period z Faulty destination address y. User error y. Target user changed address y. Redirect if possible y. Inform user if not
SMTP Protocol - Reliability z Used to transfer messages from sender to receiver over TCP connection z Attempts to provide reliable service z No guarantee to recover lost messages z No end to end acknowledgement to originator z Error indication delivery not guaranteed z Generally considered reliable
SMTP Receiver z Accepts arriving message z Places in user mailbox or copies to outgoing queue forwarding z Receiver must: y. Verify local mail destinations y. Deal with errors x. Transmission x. Lack of disk space z Sender responsible for message until receiver confirm complete transfer y. Indicates mail has arrived at host, not user
SMTP Forwarding z Mostly direct transfer from sender host to receiver host z May go through intermediate machine via forwarding capability y. Sender can specify route y. Target user may have moved
Conversation z SMTP limited to conversation between sender and receiver z Main function is to transfer messages z Rest of mail handling beyond scope of SMTP y. May differ between systems
SMTP Mail Flow
SMTP System Overview z Commands and responses between sender and receiver z Initiative with sender y. Establishes TCP connection z Sender sends commands to receiver z e. g. HELO
SMTP Replies z Leading digit indicates category y. Positive completion reply (2 xx) y. Positive intermediate reply (3 xx) y. Transient negative completion reply (4 xx) y. Permanent negative completion reply (5 xx)
Operation Phases z Connection setup z Exchange of command-response pairs z Connection termination
Connection Setup z Sender opens TCP connection with receiver z Once connected, receiver identifies itself y 220
Mail Transfer z Sender may send one or more messages to receiver z MAIL command identifies originator y. Gives reverse path to used for error reporting y. Receiver returns 250 OK or appropriate fail/error message z One or more RCPT commands identifies recipients for the message y. Separate reply for each recipient z DATA command transfers message text y. End of message indicated by line containing just period (. )
Closing Connection z Two steps z Sender sends QUIT and waits for reply z Then initiate TCP close operation z Receiver initiates TCP close after sending reply to QUIT
Format for Text Messages RFC 882 z Message viewed as having envelope and contents z Envelope contains information required to transmit and deliver message z Message is sequence of lines of text y. Uses general memo framework y. Header usually keyword followed by colon followed by arguments
Example Message Date: Tue, 16 Jan 1996 10: 37: 17 (EST) From: “William Stallings”
Multipurpose Internet Mail Extension (MIME) z Extension to RFC 822 z SMTP can not transmit executables y Uuencode and other schemes are available x. Not standardized z Can not transmit text including international characters (e. g. â, å, ä, è, é, ê, ë) y Need 8 bit ASCII z Servers may reject mail over certain size z Translation between ASCII and EBCDIC not standard z SMTP gateways to X. 400 can not handle none text data in X. 400 messages z Some SMTP implementations do not adhere to standard y CRLF, truncate or wrap long lines, removal of white space, etc.
Overview of MIME z Five new message header fields y. MIME version y. Content type y. Content transfer encoding y. Content Id y. Content Description z Number of content formats defines z Transfer encoding defined
Content Types z Text body z Multipart y Mixed, Parallel, Alternative, Digest z Message y RFC 822, Partial, External-body z Image y jpeg, gif z Video y mpeg z Audio y Basic z Application y Postscript y octet stream
MIME Transfer Encodings z Reliable delivery across wide largest range of environments z Content transfer encoding field y Six values y Three (7 bit, 8 bit, binary) no encoding done x. Provide info about nature of data z Quoted-printable y Data largely printable ASCII characters y Non-printing characters represented by hex code z Base 64 y Maps arbitrary binary input onto printable output z X-token y Named nonstandard encoding
Base 64 Encoding
Hypertext Transfer Protocol HTTP z Underlying protocol of the World Wide Web z Not a protocol for transferring hypertext y. For transmitting information with efficiency necessary for hypertext jumps z Can transfer plain text, hypertext, audio, images, and Internet accessible information
HTTP Overview z Transaction oriented client/server protocol z Usually between Web browser (clinet) and Web server z Uses TCP connections z Stateless y. Each transaction treated independently y. Each new TCP connection for each transaction y. Terminate connection when transaction complete
Key Terms z Cache z Client z Connection z Entity z Gateway z Message z Origin server z Proxy z Resource z Server z Tunnel z User agent
Examples of HTTP Operation
Intermediate HTTP Systems
HTTP Messages z Requests y. Client to server z Responses y. Server to client z Request line z Response line z General header z Request header z Response header z Entity body
HTTP Message Structure
General Header Fields z Cache control z Connection z Data z Forwarded z Keep alive z MIME version z Pragma z Upgrade
Request Methods z Request-Line = Method
Request Header Field z Accept charset z Accept encoding z Accept language z Authorization z From z Host z If modified since z Proxy authentication z Range z Referrer z Unless z User agent
Response Messages z Status line followed by one or more general, response and entity headers, followed by optional entity body z Status-Line = HTTP-Version
Status Codes z Informational z Successful z Redirection z Client error z Server error
Response Header Fields z Location z Proxy authentication z Public z Retry after z Server z WWW-Authenticate
Entity Header Fields z Allow z Content encoding z Content language z Content length z Content MD 5 z Content range z Content type z Content version z Derived from z Expires z Last modified z Link z Title z Transfer encoding z URL header z Extension header
Entity Body z Arbitrary sequence of octets z HTTP transfers any type of data including: ytext ybinary data yaudio yimages yvideo z Interpretation of data determined by header fields y. Content encoding, content type, transfer encoding
Required Reading z Stallings chapter 19 z WWW Consortium z ASN. 1 Web site