1.09k likes | 1.24k Views
Top Three Layers. Session Layer Presentation Layer Application Layer. Session Layer Design. Marks the division between “upper layers and lower layers” lower layers:= end to end communications upper layers:= user-oriented services Invented by ISO Can support transport layer QoS
E N D
Top Three Layers • Session Layer • Presentation Layer • Application Layer
Session Layer Design • Marks the division between “upper layers and lower layers” • lower layers:= end to end communications • upper layers:= user-oriented services • Invented by ISO • Can support transport layer QoS • Not explicitly used by TCP/IP • “Generally connection-oriented”
Session Layer & Transport Layer • Usually a transport connection is required to establish a session • Session Layer provides Control. It says what to do, not necessarily how to do it. • Can provide redundancy and multiplexing of transport layer resources • Administrative control point
Dialog Management • In principle, all OSI connections are full duplex • Some upper layer software is structured to be half-duplex • This is to simplify the software and has nothing to do with hardware limitations • The session layer supports data token schemes to support half-duplex transmissions
Synchronization • Transport layer provides error recovery only from communication errors • Synchronization in the transport layer provides for returning the session entries back to the last known correct state. • Example: Session established and large file transmitted; receiving end has no storage and directly prints the incoming data. The printer dies and data is lost. • Session users could split the text into pages and insert a synchronization point between each page.
Activity Management • Users split the message stream into activities • delimiters are added in the session to separate activities First File Sent Second File Sent Session Stop Start Start Stop
Remote Procedure Calls • Based on the connectionless model • Generally outside the OSI model • Can be implemented in the application layer • Multiple Flavors • {Sun} ONC RPC • {OSF} DCE RPC
“RPC School of Thought” • Clients sending messages are viewed as procedure calls with the reply being the return from the procedure • Contrast this to the more “conventional” school which views I/O with primitives such as X-DATA.request and X-DATA.return as I/O and interrupts respectively.
RPC Invocation Client Client Stub Network {Portmapper} Server Stub Server 1 2 3 4 5 6 7
RPC Semantics and Orphans • Operations • exactly once • at most once • at least once • Handling crashes: • 1. Hang forever, waiting for reply that never comes • 2. Time out and raise an exception • 3. Time out and retransmit • Orphans • extermination • expiration • reincarnation (kill & restart) • gentle reincarnation (selectively kill and restart)
Presentation Layer Information Transformation Network Format Local Format “few standards, but a lot of ideas”
Presentation Functions These are examples! • Syntax (format) conversion • Compression • Encryption • Sub-issue: Does it belong here?
Presentation Layer, cont. • Providing a way to specify complex data structures • Managing the set of data structures required • Converting data between internal and external form
Data Representation • ASCII vs. EBCDIC • two’s complement vs. one’s complement • FFF0 hex is -15 1’s complement; -16 2’s complement • byte order right left vs. left right • Text File formats
Abstract Syntax Notation 1 (ASN.1) • Data Structures • Abstract Syntax • Transfer Syntax • International Standard 8825 • Notation used to encode, transfer and decode data structures across a wide range of applications • Both connection-oriented and connectionless primitives
Data Compression • Encoding a Finite Set of Equally Likely Symbols • Finiteness of the set of symbols. • Frequency Dependent Coding • The relative frequencies with which the symbols are used. • Context Dependent Encoding • The context in which a symbol appears.
Compression • Elimination of Redundancy • (increased susceptibility to error) • Examples • Run Length Encoding • Predictive Codes • Huffman • LZW
Frequency Dependent Coding • In English, “E” occurs ~100 times more than the letter “Q” • So give common symbols short codes and longer symbols longer codes. • Theoretical minimum encoding often requires fractional bits, but close approximations available.
Huffman Coding • 1. Write down all symbols and associated probability of each. Eventually a binary tree is built on these nodes, with the symbols representing terminal nodes. • 2. Find the two smallest nodes and mark them. Add a new node with arcs to each of the nodes just marked. Set the probability of the new node to the sum of the probabilities of the two nodes connected to the new node. • 3. Repeat until all symbols are marked except one. The probability of the unmarked node will always be 1.0. • 4. The encoding for each symbol is found by tracing the path from the unmarked symbol to that symbol, recording the sequence of left and right branches taken. The code is the path, left = 0, right = 1.
Context Dependent Encoding • Uses conditional probability instead of independent probability. • What is P(u|q)? • So determine the conditional probability for each possible predecessor and store in a table. • For k symbols this requires k2 entries.
Compression (Summary) • Problem Domain determines the “best” compression scheme • Lossy vs Loss-less schemes • One-pass vs multi-pass schemes
Network Security and Privacy • Protecting data from being read by unauthorized persons. • Preventing unauthorized persons from inserting and deleting messages. • Verifying the sender of each message. • Allowing electronic signatures on documents.
Cryptography • Traditional Cryptography • Substitution Ciphers • Codes • Transposition Ciphers • Data Encryption Standard • Key Distribution • Public Key Crytography • MIT Algorithm • Authentication & Digital Signatures • Federal Standards
Cryptography Users • Military • Diplomatic • Diarists • Lovers • Curmugdeons
Cyptography Terms • Ciphertext or Cryptogram -- encrypted message • Cryptanalysis -- breaking ciphers • Cryptography -- devising ciphers • Cryptology := Cryptanalysis and Cryptography
Encryption Model Passive Listener Plaintext Ciphertext Plaintext Key-1 Key-2 Active Intruder
Keys • If Key-1 is the same as Key-2, then it has to be a secret key process. They can differ, making it a Public Key Process. • Big Problems: key distribution and key security
Fundamental Truths of Cryptology • Potential intruders know the general encryption method. • Message contents may be guessed. • Cryptographic systems may be changed, but rarely are. • Non-technical compromises always outnumber successful cryptanalysis.
Ciphers • Substitution (preserve order, disquise) • Caesar code = “shift 4” • Alphabet shifted by k letters --”enigma” • Exhaustive search infeasible • Words and phrases may be guessed • Codes • Purple code, Japanese translated into Latin • Navajo talkers • Transposition Ciphers (reorder, do not disguise) • Game is up when key length is guessed • Once close, easy to guess
Data Encryption Standard • Developed by IBM in 1977 • Implemented in hardware • Widely used • 128 bit key proposed, 56 bit key specifiedAny guesses why? • Now, study AES.
Public Key Encryption • Applying the decryption key to an encrypted message must return the plaintext message. • The decryption key can’t be guessed from an encyption key. • The encryption key cannot be broken by a plaintext attack. • Key Point: the decryption key must be privately held.
Digital Signatures • A’s secret key must remain secret • B has A’s public key and A has B’s public key • B received a encypted message from A that he decypts with A’s public key • B can later show that lacking A’s private key that he could not have produced the encrypted message
Politics of Cryptography • Software as Munition • “Clipper” Chip • Digital Telephony Bill • Digital Signature Standard • Other Countries • Current Legislation
Application Layer • File Transfer, Access and Management • virtual file store • file servers and requesting clients • Electronic Mail • process to process traffic expected to dominate Internet • actually email dominates the Internet • Virtual Terminals • representing the abstract state of the real terminal • Remote Job Execution • JTM: Job Transfer and Manipulation
ISO Applications • FTAM ~ FTP File Transfer, Access & Manipulation • VTS ~ TELNET Virtual Terminal Service • JTM ~ ??? Job Transfer & Manipulation {maybe rsh, RPC?} • MHS ~ SMTP Message Handling System (X.400)
“applications” SASE SASE CASE ISO Terminology [Specific|Common] Application Service Elements “think of them as programming libraries or APIs”
Electronic Mail • Motis and X.400CCITT has aligned them for compatibilityWon’t replace SMTP! • The user agentuser interface • Message transfer agentpost office
Virtual Terminals • Scroll mode terminalsno local resources; dumb display and transmission • Page mode terminals25 x 80 character displayscreen editing via termcap • Form mode terminalslocal processing enabled • Bitmapped terminals like X stations • Browsers?
File Transfer Protocol • FTP recognizes four file types: • 1. Image • bit by bit transfer • 2. ASCII • 3. EBCDIC • 4. Logical Byte files • binary files which use byte size other than 8 bits
Electronic Mail • Pioneered by ARPANET • RFC 822 (widely used) • Simple Mail Transfer Protocol (SMTP) • Supports only ASCII text(see MIME) • name@domain addressing
Virtual Terminals - TELNET • Designed for scroll mode terminals • Hit a key , 8-bit bytes are sent • 95 ASCII and 7 control characters legal
The Web • “the” killer application for the Internet • Two components for popularity • http combines multiple access (gopher, ftp, etc) methods • hypertext interface supports point-and-click interface • Who will organize the information? • No one... • Database experts • Librarians (!)
Web Future Directions • HTML Enhancements • Secure Transactions • Uniform Naming • Librarians & Brokers • Information “push” or “pull”
Layer 7 Summary • Service Element Model • Not all Apps belong here... • Common Network Services
What is a Distributed System? Just insert a network? Mass Storage Computing (CPU) User Interface
Distributed System Services Servers (Storage, Compute) Network User Interfaces Users Users
D.S. Design Issues • Transparency • Flexibility • Reliability • Performance • Scalability
More Design Issues • Global Clocks? • Causality • Information Consistency
Distributed Control • Master/Slave (Issue: Response Time) • Polled • Command -> <-Response • Schedule under control of server • Client/Server (Issue: Server Size) • Interrupt, or Event, Driven • Aperiodic Scheduling • Peer-to-Peer (Issue: Coordination) • No single critical node • Hard to describe or predict
Distributed System:Why or Why not? • Performance • Economics • Reliability • Security