23
6.033 Spring 2018 Lecture #1 Complexity Modularity and abstraction Enforced modularity via client/server models 6.033 | spring 2018 | Katrina LaCurts 1

Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

6.033 Spring 2018Lecture #1

• Complexity• Modularity and abstraction• Enforced modularity via client/server models

6.033 | spring 2018 | Katrina LaCurts 1

Page 2: Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

what is a system? a set of interconnected components that has an

expected behavior observed at the interface with its environment

what makes building systemsdifficult?

complexity

6.033 | spring 2018 | Katrina LaCurts 2

Page 3: Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

source: http://www.informationisbeautiful.net/visualizations/million-lines-of-code/

Today’s Systems are Incredibly Complex

© source unknown. All rights reserved. This content is excluded from our Creative Commons license. For more information, see https://ocw.mit.edu/help/faq-fair-use.

6.033 | spring 2018 | Katrina LaCurts 3

Page 4: Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

complexity limits what we can build and causes a number of unforeseen issues

6.033 | spring 2018 | Katrina LaCurts 4

Page 5: Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

how do we mitigate complexity?

with design principles such as modularity and abstraction

6.033 | spring 2018 | Katrina LaCurts 5

Page 6: Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

how do we enforce modularity?

one way is to use the client/server model

6.033 | spring 2018 | Katrina LaCurts 6

Page 7: Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

7

Class Server(on machine 2) Class Browser

(on machine 1)

requestdef main(): def server_load_url(): html = browser_load_url(URL) ...

... return html

reply

6.033 | spring 2018 | Katrina LaCurts

Page 8: Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

8

Stub Clients and RPCs Class Browser

(on machine 1)

def main(): def server_load_url(): html = browser_load_url(URL) ...

... return html

Class Server(on machine 2)

def browser_load_url(url): msg = url # could reformat send request wait for reply html = reply # could reformat

stub

return html

request

reply

def handle_server_load_url(url): wait for request url = request html = server_load_url(URL) reply = htmlsend reply stub

6.033 | spring 2018 | Katrina LaCurts

Page 9: Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

Challenges with RPCs

Client Server

6.033 | spring 2018 | Katrina LaCurts 9

Page 10: Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

Challenges with RPCs

Client Serverinternet

6.033 | spring 2018 | Katrina LaCurts 10

Page 11: Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

Challenges with RPCs

Client Serverinternet

load(“view.html?item”)

X

6.033 | spring 2018 | Katrina LaCurts 11

Page 12: Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

Challenges with RPCs

Client Serverinternet

load(“view.html?item”)

Xload(“view.html?item”)

6.033 | spring 2018 | Katrina LaCurts 12

Page 13: Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

Challenges with RPCs

Client Serverinternet

load(“buy.html?item&ccNo=xxx”)

X

6.033 | spring 2018 | Katrina LaCurts 13

Page 14: Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

Challenges with RPCs

Client Serverinternet

load(“buy.html?item&ccNo=xxx”)

Xload(“buy.html?item&ccNo=xxx”)

6.033 | spring 2018 | Katrina LaCurts 14

Page 15: Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

Challenges with RPCs

Client Serverinternet

load(“buy.html?item&ccNo=xxx”)

Xload(“buy.html?item&ccNo=xxx”)

problem: just bought the same thing twice6.033 | spring 2018 | Katrina LaCurts

15

Page 16: Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

Challenges with RPCs

Client Serverinternet

load(“buy.html?UID”)

Xload(“buy.html?UID”)

client | UID | reply

state on server

replay results from table instead of reprocessing

order

problem: server can still fail

6.033 | spring 2018 | Katrina LaCurts 16

Page 17: Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

What else might we want?

Client Serverinternet

6.033 | spring 2018 | Katrina LaCurts 17

Page 18: Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

What else might we want?

Serverinternet

scalability

6.033 | spring 2018 | Katrina LaCurts 18

Page 19: Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

What else might we want?

internet

scalability fault-tolerance/reliability

6.033 | spring 2018 | Katrina LaCurts 19

Page 20: Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

What else might we want?

internet

scalability fault-tolerance/reliability

!

!!

6.033 | spring 2018 | Katrina LaCurts 20

Page 21: Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

What else might we want?

internet

scalability fault-tolerance/reliability

!

"

""

security

"

6.033 | spring 2018 | Katrina LaCurts 21

Page 22: Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

• Complexity limits what we can build, but can bemitigated with modularity and abstraction

• One way to enforce modularity is with a client/servermodel, where the two modules reside on differentmachines and communicate with RPCs; network/serverfailures are still an issue

next lecture: naming, which allows modules to communicate

coming up: operating systems, which enforce modularity on a single machine

6.033 | spring 2018 | Katrina LaCurts 22

Page 23: Computer System Engineering, Lecture 1 Coping with ... · Class Browser (on machine 1) def main(): def server_load_url(): ... Computer System Engineering, Lecture 1 Coping with Complexity:

MIT OpenCourseWare https://ocw.mit.edu

6.033 Computer System EngineeringSpring 2018

For information about citing these materials or our Terms of Use, visit: https://ocw.mit.edu/terms.

23