understanding networked applications: a first course chapter 6 by david g. messerschmitt

53
Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Post on 19-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications:A First Course

Chapter 6

by

David G. Messerschmitt

Page 2: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course2

Goal

• Appreciate the importance of complexity management in networked computing

• Understand better the role of architecture in complexity management

• Examine infrastructure layering in more depth

Page 3: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course3

Complexity

• A system that cannot be understood in all its detail by a single person or small group of people is complex

• The intricacy of the logic embodied in software– suffers no physical limitations– complexity is a primary limitation– advances allow us to extend that complexity

Page 4: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course4

Some sources of complexity

• Problem domain is complex

• Top-down design (as opposed to independent actors in the economy)

• Software is not adaptable like people

• Large team efforts required

• Integration of heterogeneous suppliers

Page 5: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course5

Caution

• The applications considered in this course are relatively simple

• We have addressed– only the top of the hierarchy– ignored details– but this is the essence of hierarchical design:

make that which is complex appear simple

Page 6: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course6

Some solutions to complexity

• Modularity properties– separation of concerns– reuse

• Interoperability through interfaces– abstraction– encapsulation

Page 7: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course7

Modularity

• A system is modular when it is divided into subsystems (called modules) with good properties– Modules have distinct functional groupings– Hierarchy supports views at different

granularity and scale– Separation of concerns among modules– Reusability of some modules

Page 8: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course8

Software:

Allows a system to be understood at different granularity

Hierarchy

Organization:Allows a managerto focus on high-levelobjectives, delegatinglow-level detail

Page 9: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course9

Hierarchy in hardware architecture

Integrated circuit subsystem

Board subsystem

Computersubsystem

Page 10: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course10

Separation of concerns

• The assignment of functionality to different modules should allow them to be designed and implemented as independently as possible

• The level of interaction – may be internally high

– should be externally low

• They can then be assigned to different groups or companies for design– minimum coordination costs

Page 11: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course11

Physical-world example

Loan department

Customer serviceCredit checking

Physical plant

JanitorialFloor polishing

Customer service

Customer serviceJanitorial

Credit checking

Credit checkingFloor polishing

Poormodularity

Bettermodularity

Page 12: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course12

Infrastructure example

Host

ApplicationEnd-to-end network

Network

Switch-to-switch

Host

Application

Network

End-to-end networkSwitch-to-switch

Poormodularity

Bettermodularity

Level ofinteraction high

Page 13: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course13

Parts of a module

= +

Module Interface Implementation

What othermodules see

What only theimplementersees

Page 14: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course14

Interfaces

• Focus of module interaction and interoperability

• Two purposes:– Informs other modules how to interact– Informs implementer about what has been

promised to other modules

Page 15: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course15

Hardware interface

• Physical connection

• Electrical properties

• Formats of data passing through the interface (structure and interpretation)

Page 16: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course16

Possible software interface

action-1

action-2

action-3...

Menu ofactions

What are some other examplesof types of interaction at interfaces?

Page 17: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course17

Module interaction through interfaces

Client Server

action, parameters

returns

Both subsystems areaffected by the interaction

Data customizing an actionand disclosing its results

Page 18: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course18

Data types

• Data passing an interface is often specified in terms of a limited number of standard data types

• Data type = range of values and allowable manipulation

• Data type does not presume a specific representation, to allow heterogeneous platforms– Representation must be known when data passes a

sepecific module interface

Page 19: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course19

Example data types

• Integer– “natural number between -32,767 and +32,768”

– Could be represented (in many ways) by 16 bits• since 2n = 65,536

• Float– “number of the form m*10n/32768, where m is in the

range -32,767 to +32,768 and n is in the range -255 to +256”

– Could be represented by 16+8 = 24 bits

Page 20: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course20

More data types

• Character– “values assuming a-z and A-Z plus space and

punctuation marks”• could be represented by 7 or 8 bits

• Character string– “collection of n characters, where n is

customizable”• could be represented by 7*n bits

Page 21: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course21

Compound data types

• Programmer-defined composition of basic data types

• Example:Employee {

String name;

String address;

Integer year_of birth;

etc.

}

Page 22: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course22

Protocols

• A defined sequence of actions between/among two or more subsystems required to achieve some higher-level functionality

• Interface specification focuses on actions (including formats of parameters and returns) and protocols

Page 23: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course23

Example protocol: deposit

Bankaccount

get_balance

set_balance

adddepositamount

Page 24: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course24

Decides it needs to invoke an action of a server module

Invokes the action by name

Passes parameter data to the server

Processes parameters in accordance with the specified action; generates return values

Passes the return values back to the client

Process the return values to complete the interaction

Client module Server module

Anatomy of an action invocation

Page 25: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications:A First Course

More on layering

by

David G. Messerschmitt

Page 26: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course26

Goals

• Understand better – how layering is used in the infrastructure– how it contains complexity– how it coordinates suppliers– how it allows new capabilities to be added

incrementally

Page 27: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course27

Layer above is a client of thelayer below

Layer below as as a serverto the layer above

….by utilizing the services of the layer below and adding capability

Each layer provides services to the layer above….

Interaction of layers

Page 28: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course28

Application module Application module

Host A Host B

Middleware

Operating system Operating system

Network

Middleware

Page 29: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course29

Layering

Existing layers

Elaboration or specialization

Layering builds capability incrementally by adding to what exists

Page 30: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course30

Three types of software

Application

•Infrastructure:

Basic services (communication, storage, concurrency, presentation, etc.)

•Components and frameworks:

What is in common among applications

Page 31: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course31

Part of Microsoft vs. DOJ dispute

Application

Infrastructure

Components and frameworks

Microsoftposition

DOJposition

Page 32: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course32

Network

Operating system

Middleware

Application frameworks and components

Applications

Major layers

Page 33: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course33

Network

Operating system

Middleware

Application components

Applications

Ope

n in

terf

aces

Open layer interfaces

Page 34: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course34

Data and information

ApplicationDeals with information

InfrastructureDeals with data

Assumes structure and interpretation

Ignores structure and interpretation

Page 35: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course35

Data and information in layers

• The infrastructure should deal with data, or at most minimal structure and interpretation of data suitable for a wide range of applications

• The application adds additional structure and interpretation

• This yields a separation of concerns

Page 36: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course36

Package = file, message

• In the simplest case, the infrastructure deals with a package of data (non-standard terminology)– collection of bits

– specified number and ordering

• The objective of the infrastructure is to store and communicate packages while maintaining data integrity

• File for storage, message for communication

Page 37: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course37

Data integrity

• Retain the– values– order– number

of bits in a package

Page 38: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course38

Web browser

File system

Operatingsystem

File

Network

Message

Collection of packetsFragmentation Assembly

Message

HTML

Screen

Application

Web server

Example

Page 39: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course39

Information in the infrastructure

• Sometimes it is appropriate for the infrastructure to assume structure and interpretation for data– to add capabilities widely useful to applications– to help applications deal with heterogeneous

platforms, where representations differ

• At most, data types

Page 40: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course40

Data and information

ApplicationDeals with information

InfrastructureDeals with data types

Assumes structure and interpretation

Assumes standard data types

Page 41: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course41

Storage

ApplicationDeals with information

Database management system (DBMS)File system

Assumes standard data typesand SQL = structured query language

The infrastructure can provide data management functions

Page 42: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course42

Communication

ApplicationDeals with information

Distributed object managementNetwork

Assumes standard data typesand performs conversions

The infrastructure can transparently convert representations across platforms

Page 43: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course43

Client Server

invoke_action action

action_name, parameters

returns

Middleware layer

Idea behind remote action invocation

Page 44: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course44

MacOS

Windows

UNIX

Mainframe

MacOS

Windows

UNIX

Mainframe

MacOS

Windows

UNIX

Mainframe

MacOS

Windows

UNIX

Mainframe

Perform all conversions

Convert to/from commonrepresentation

Using a common intermediate form

Page 45: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course45

Data

Information

Data

Information

Structure andinterpretation

Representation Data processing

Page 46: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course46

Representation is a coding of information by data in a form that can be manipulated by a lower layer; the results remain meaningful at the higher layer

Information is data with known and consistent structure and interpretation in the context of the current layer

Information

Representationas data

Layer aboveLayer below

Page 47: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course47

Network

Operating system

Middleware

Application

Information appliancesIA

Page 48: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course48

Question

• What advantages and disadvantages do you see for the information appliance?

Page 49: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course49

Network 1 Network 2

TCP UDP

Windows NT

TCP UDP

UNIX

TCP UDP

Mac OS

Internet protocol Internet protocolInternet protocol

Application

Horizontal structure in layers

Page 50: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course50

Distributed object management

A spanning layer is ubiquitous and hides the layers below

Network 1 Network 2

TCP UDP

Windows NT

TCP UDP

UNIX

Application

TCP UDP

Mac OS

Internet protocol

Spanning layer

Page 51: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course51

Abstraction

• A property of well-designed interfaces to modules

• Hide detail, displaying only what is necessary

• Simplify, displaying only what is meaningful to the outside

• Important for complexity management

Page 52: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course52

Encapsulation

• Module implementation details (anything not explicit at interface) should be inaccessible from the outside– So other modules cannot become inadvertently

dependent on implementation– In the case of components, for proprietary or

security reasons

Page 53: Understanding Networked Applications: A First Course Chapter 6 by David G. Messerschmitt

Understanding Networked Applications A First Course53

Summary of modularity

• Divide and conquer: decomposition of the system into modules with well-defined functional groupings

• Separation of concerns: great dependency internally, little dependency externally

• Abstraction: hide detail and simplify• Encapsulation: make internal implementation

inaccessible• Reusability: meet generalized needs, configurable