Top Banner
Understanding Networked Applications: A First Course Chapter 11 by David G. Messerschmitt
22

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

Dec 22, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Understanding Networked Applications: A First Course Chapter 11 by David G. Messerschmitt.

Understanding Networked Applications:A First Course

Chapter 11

by

David G. Messerschmitt

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

Understanding Networked Applications:A First Course

Algorithms and protocols

by

David G. Messerschmitt

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

Understanding Networked Applications A First Course3

Algorithm

• Specified sequence of steps that– accomplish a designated task– in a finite number of steps

• Representation:– simple algorithm: flowchart– complicated algorithm: program

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

Understanding Networked Applications A First Course4

Startturn

Throwdice

Move token numberof squares indicated

on dice

Land on “goto jail”?

Move to“jail” square

Do not move;follow policies

for square(like “pay rent”)

Finishturn

Yes

No

Example: one turn at monopoly

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

Understanding Networked Applications A First Course5

Start

Action

Action

Action

Finish

Decision

Finish

ActionAction

Start

Finish

Test

Action

Start

Sequence Selection Loop

Algorithm building blocks

Programming languages support these three building blocks

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

Understanding Networked Applications A First Course6

Protocol

• Distributed algorithm realized by two or more modules to coordinate their actions or accomplish some shared task

• Module interoperability requires a protocol– Prescribed order of method invocations– Part of interface documentation

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

Understanding Networked Applications A First Course7

Player 1 Player 2

Time

One-turnalgorithm

Monopoly players protocol

This is a protocol interaction diagram

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

Understanding Networked Applications A First Course8

Application and infrastructure

Internally, the networkuses protocolsto implement the services it provides

The application defines its ownapplication-level protocols

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

Understanding Networked Applications A First Course9

Three simple protocols

• One-way message: send-receive

• Two-way interaction: request-response

• Push: publish-subscribe

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

Understanding Networked Applications A First Course10

Client Server

Time

sendreceive

request

response

subscribe

responses

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

Understanding Networked Applications A First Course11

HTTP serverHTTP client

(browser)

HTML documents

User activates URL HTTP request

HTTP response(embedded document)

Browser displaysdocument (if HTML)or invokes “helper application”

Example: HTTP

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

Understanding Networked Applications A First Course12

Example: Stock trading

What is application protocol?

StockTraderCustomer

Customer wants to purchase 10 shares of MSFT if price is below $90

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

Understanding Networked Applications:A First Course

Locating things

by

David G. Messerschmitt

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

Understanding Networked Applications A First Course14

Three ways of locating things

• Name– “Joe Bloe”

• Address– “1299 Hearst St, Berkeley, CA”

• Reference– “Postmaster of Berkeley CA”

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

Understanding Networked Applications A First Course15

Name

• Symbolic (character string) representation

• Easy for people to remember or guess

• Identifies but does not locate directly– Distinction important for mobile entities

• Not unique: entities can have more than one name (called aliases)

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

Understanding Networked Applications A First Course16

Hierarchical names

• Hierarchy makes names easier to remember or guess

• Host domain names:– “info.sims.berkeley.edu”– designates administrative hierarchy

• File names:– “c:\My Documents\Docs\Resume.doc”– designates folder hierarchy

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

Understanding Networked Applications A First Course17

Address

• Route or path to entity– is directly specified, or– can be inferred

• Independent of who or what is locating entity

• Topological specification

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

Understanding Networked Applications A First Course18

Example

1

2

3

4

Path from to is (1,2,2,2,1,1,1,1)

Not an address, because it depends on starting point

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

Understanding Networked Applications A First Course19

Example

Address of is (2,5)

(1,1) (1,2) (1,3) (1,4) (1,4)

(2,1)

(2,2)

(2,3)

(2,4)

(2,5)

Route from can be inferred

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

Understanding Networked Applications A First Course20

Reference

• Abstract representation of an entity

• Interaction is with representation– infrastructure arranges redirection to actual

entity– especially appropriate for things that move

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

Understanding Networked Applications A First Course21

Client Server

address

Reference

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

Understanding Networked Applications A First Course22

Name services

Nameservice

1. name

2. address or reference

3. interaction