introduction to computer...

65
Introduction to Computer Science CSCI 109 Andrew Goodney Fall 2019 China – Tianhe-2 Lecture 9: Networks Nov. 9th, 2019

Upload: others

Post on 09-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Introduction to Computer ScienceCSCI 109

Andrew GoodneyFall 2019

China – Tianhe-2

Lecture 9: Networks Nov. 9th, 2019

Page 2: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Schedule

1

Page 3: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Computer Networks

u Computer networks everywhere!v Headed towards IoT (*everything* electronic on a network)

u How did we get here?

2

Page 4: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

1960’s

3

u 1960’sv ”Mainframe” computers = $$MMv Universities and Government facilities install at designated places

(UIUC, UCSD, etc.)v Allow remote access to researchers across the country to better utilizev Mainframes – 100% busy

Page 5: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

1960’s Remote Access

u Dumb Terminals and analog modems

4

Phone call

Page 6: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

1960’s Problems

u Any issues with this model?v Analog connections slow (300BPS)v Only so many phone linesv Long distance calls were expensive

5

Page 7: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Digital Circuits

u Mid to late 1960’s digital circuits improve thingsu Also, computer-to-computer communication

6

mainframe

(smaller) mainframe

64kbpsdigital circuit

(smaller) mainframe

(smaller) mainframe

Page 8: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Late 1960’s

u Terminals in office -> local main frameu Local mainframe -> digital circuit -> big main frame

u Key observations:v Multiple usersv Computer-to-computer

7

7

Page 9: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Late 1960’s

u Still not ideal…u Connections are “circuit switched” (dedicated) between

source and destination

u What happens when no one is using the circuit?u Really only one dumb-terminal can use connection at a time

u Do humans time share well?

u Digital circuits still expensive

u Also, computer-to-computer identified as key application

8

Page 10: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Design Goals

u Need a way to:v Connect users at terminals to remote computersv Connect many users at the same time (fairly)v Allow computer-to-computer communicationsv Maximize the utilization of expensive digital links

9

Page 11: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Solution: the packet

u What is a packet?u Chunks of user data

u And VERY IMPORTANTLY

u Meta-data (header) about where the packet is from, and where it needs to go

10

Page 12: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

How do packets solve the problem?

u Now we can build “packet-switched” networks

11

64kbpsdigital circuit

= packet switch

Page 13: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Packet Switching

u What do we have now?u Terminals connect to local computers

u Data is broken up into packets sent to switch

u Can go to other local computers

u Or, switch can ”forward” packet to remote switchu Remote switch sends packet to big, expensive main frame

u Main advantage: links are shared amongst all users, or computer-to-computer communication

u Nothing is dedicated to one connection12

Page 14: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Packet Switching Advantage

u Sharing and utilization is main advantage of packet switching

13

Nusers

1 Mbps link…..

example:§ 1 Mb/s link§ each user:

• 100 kb/s when “active”• active 10% of time

u circuit-switching:v 10 users

u packet switching:v with 35 users, probability > 10

active at same time is less than .0004

v with 50 users, P = 0.01

Page 15: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

A bit more history…

u How did we make the jump to packet switching?u Idea came about late 1960’s

u ARPA (Advanced Research Projects Agency)v US-DOD wanted packet switched computer-to-computer networksv Seen as crucial to Cold War effort

u This is queueing theory, packet switching is a lot like lines at amusement park/grocery store

14

Page 16: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Len Kleinrock/UCLA

u Len Kleinrock writes PhD thesis on queuing theory/packet switchingv All theoretical, didn’t exist yet

u ARAP contacts and says “Hey you seem like just the right guy, here’s a ton of money, invent the ARPANet…”

u Gets faculty position at UCLA (~1963), embarks on project

u With BBN, builds Interface Message Processor (IMP) (packet switch)

u 50 years ago (Oct. 29th), sends first message from UCLA to Stanford

15

Page 17: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Interface Message Processor

16

Internet Museum: https://la.curbed.com/2011/10/31/10429196/internet-invented-ucla-first-message-museum

Recreated lab as it was 50 years ago. You can go visit: 3420 Boelter Hall

Page 18: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Network Terminology

u Everything on the network is either:v Host

u sends or receives datav Packet switch

u receives packets on interfaces and forwards to other switches or hostsv Communication link

u Physical connection between two devices that carries data

u Store and forwardv Packet switches “store and forward”

u Receive a packetu Store it (store)u Figure out where to send it (forward)

17

Page 19: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Modern Networks

u How do we build modern networks?u The Internet is a network of

networks!

u Internet edge:v Access networks connects hosts to the

networkv Access networks connect to networks in

the core

u Internet Core:v Networks of networks (ISPs) connecting

together18

mobile network

global ISP

regional ISPhome network

institutionalnetwork

Page 20: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

More Terminology

u Access networks are Local Area Networks (LANs)v Host (desktops, laptops, servers)v Switchesv Routers

u Routers are special packet switches that bridge (connect) multiple LANs, or from LAN to WAN

u WAN = Wide Area Networkv Connects from LAN to network core

19

Page 21: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

More Terminology

u Network Corev LANs and WAN connections from access networks to ISPsv And between ISPs

20

Page 22: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

How do we build modern networks

u First look at access networksv How do we connect hosts (pc, laptop, server, phones) to the network

21

Page 23: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Ethernet LANs

u In 2018 (almost?) all LANs are built with Ethernet technologies

u Homes, businesses, university campus

u Built withv twisted pair (“Ethernet cable”)v Wifiv Optical fiberv Power lines

u Wide range of speedsv 10M, 100M, 1G, 10G, 40G, 100G

22

Page 24: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Home Network

23

to/from headend or central office

Cable, DSL modem, or fiber

router, firewall, NAT

wired Ethernet (100 Mbps or 1G)

wireless access point (100->1000

Mbps)

wirelessdevices

Page 25: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Institutional Network

24

Ethernet switch

institutional mail,web servers

institutional router

institutional link to ISP (Internet)

u typically used in companies, universities, etcv 10 Mbps, 100Mbps, 1Gbps, 10Gbps, 40G, 100G transmission ratesv today, end systems typically connect into Ethernet switch

Page 26: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Wireless Network

u Wireless access to phones, etcu Provided by cellular operators

u 2G (dead?), 3G, 4G, now 5G

u Speeds varyv 100’s kilobits/s (2G)v 5G 300Mbps+

25

to Internet

Page 27: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

WAN Links

u How to connect access networks to the core?

26

Page 28: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

DSL

u Digital Subscriber Line (DSL)v Uses existing phone linesv 10 - 100Mbpsv Homes and small businesses

27

central office

ISP

telephonenetwork

DSLAM

voice, data transmittedat different frequencies over

dedicated line to central office

DSLmodem

splitter

DSL access multiplexer

Page 29: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Cable Modem

28

data, TV transmitted at different frequencies over shared cable

distribution network

cablemodem

splitter

…cable headend

CMTS

ISP

cable modemtermination system

v HFC: hybrid fiber coax§ asymmetric: up to 1Gbps downstream transmission rate, <20 Mbps

upstream transmission ratev network of cable, fiber attaches homes to ISP router

§ homes share access network to cable headend § unlike DSL, which has dedicated access to central office

v Homes and small business

Page 30: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Fiber Optical WAN Links

u Institutional networks, ISP to ISPu Laser light on optical fiber

u Speeds 100M to 100G

u Some homes!v ATT Fiber, Google Home, other lucky people!

29

Page 31: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Physical Links

u Communication links can be made up of different physical media, with different properties

30

Page 32: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Twisted Pair

u Twisted Pair: two copper wires twisted around each otheru Examples: old phone lines, CAT5(6,7) Ethernet cables

u Bandwidth: 100M to 2.5G per pair

u Usually multiple pairs per cable

31

Page 33: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Coaxial cable

u Coaxial cable: center conductor surrounded by insulation then tubular shield

u Carries radio frequency signals

u “CableTV” (cable modem) wires in your house, DS3 other similar telco services

u 100M to 10G per cable

32

Page 34: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Fiber Optic Cable

u Extremely thin glass cables called strandsu Laser light used to transmit datau Can carry multiple wavelengths at once (i.e. multiple

”colors”)u Essentially unlimited bandwidth per strandu Typically 1G to 100G per wavelengthu 96 wavelengths per strandu Short distance: Ethernet on campusu Long distance, underseau Propagates at 60% speed of light

33

Page 35: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Wireless

u Also known as radio wavesu Connects through free space (no wires)

u Wi-fi, cellular, satellite, specialized microwave services

u Bandwidth depends on frequency, channel width, modulation, etc. (kilobits to gigabits)v 900MHz, 2.4GHz, 5GHz, 60GHz

u Propagation affected by walls, buildings, trees, ground, water, other transmission sources

u Some free-space laser links exist, not very common

34

Page 36: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Internet structure

u Keep saying “network of networks”u What do we mean?u Basic goal of Internet “end to end” communication

v Any host can talk to any host

u End systems connect to Internet via access ISPs (Internet Service Providers)v Residential, business and university ISPs

u Access ISPs in turn must be interconnected. v So that any two hosts can send packets to each other

u Resulting network of networks is very complexv Evolution was driven by economics and national policies

u Let’s take a stepwise approach to describe current Internet structure

35

Page 37: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Internet Structureu To enable end-to-end communication, all access nets (millions)

must interconnect… how?

36

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnetaccess

net

accessnet

………

Page 38: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Internet Structureu Naïve solution: direct connect every ISP together!

37

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnetaccess

net

accessnet

………

……

connecting each access ISP to each other directly doesn’t

scale: O(N2) connections.

Page 39: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Internet Structureu Solution: One global ISP connects access nets hierarchically

u Not possible, never happened…

38

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnetaccess

net

accessnet

………

globalISP

Page 40: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Internet Structure

39

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnetaccess

net

accessnet

………

ISP B

ISP A

ISP C

IXP

IXP

peering link

Internet exchange point

Page 41: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Internet Structure

u Regional ISPs arose to connect access nets (schools, businesses, homes) to the Internet

u Regional ISPs connected together at IXPs (Internet Exchange Points) for mutual economic benefit

u Specialized regional networks connect some access networks togetherv Educational: Los Nettos (socal .edu)v Metro area networks: City chartered networks to lower connection

costs for businesses

40

Page 42: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Network of Networks

41

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnet

accessnetaccess

net

accessnet

………

ISP B

ISP A

ISP C

IXP

IXP

regional net

Page 43: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Hierarchical View

u at center: small # of well-connected large networks

v “tier-1” commercial ISPs (e.g., Level 3, Sprint, AT&T, NTT), national & international coveragev content provider network (e.g, Google): private network that connects it data centers to Internet,

often bypassing tier-1, regional ISPs 42

accessISP

accessISP

accessISP

accessISP

accessISP

accessISP

accessISP

accessISP

Regional ISP Regional ISP

IXP IXP

Tier 1 ISP Tier 1 ISP Google

IXP

Page 44: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Communicating on the Internet

u Material so far is how we build packet switched networksu From another perspective: how does data get to the other

side?

43

Page 45: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Protocols

u All communication on networks is moderated by one or more protocols

u Human protocols:v ”What time is it?” “Excuse me, where is…”v Introductions, small talk, etc.

u Network Protocolsv Machine to machine

u Network protocols: define the format and order of messages sent and received between network devices, and the actions to be taken upon message transmission or receipt

44

Page 46: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Protocols

45

a human protocol and a computer network protocol:

Hi

Hi

Got thetime?2:00

TCP connectionresponse

<file>time

TCP connectionrequest

Get http://www.awl.com/kurose-ross

Page 47: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Getting Data Across the Internet

u From the programmers perspective, the network is a black-box

u A set of infrastructure components that provide an API to get data from app to server and back

46

GET http://www.usc.edu/

Page 48: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

How to provide that service?

u To get from device to server and backv Data must be packetizedv Traverse access network à ISP à ISP à ISP à access network à

server (and back)v Travel across heterogeneous network types, physical layers

u Does (should?) the programmer worry about any of this?

u No! It just works.u What is the solution?

u A series of abstractions!

47

Page 49: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Flying Analogy

u First an analogy

48

ticket (purchase)

baggage (check)

gates (load)

runway takeoff

airplane routing

ticket (complain)

baggage (claim)

gates (unload)

runway landing

airplane routing

airplane routing

Page 50: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Flying Analogy

u Goal: get from one city to the other

layers: each layer implements a servicev via its own internal-layer actionsv relying on services provided by layer below

49

ticket (purchase)

baggage (check)

gates (load)

runway (takeoff)

airplane routing

departureairport

arrivalairport

intermediate air-trafficcontrol centers

airplane routing airplane routing

ticket (complain)

baggage (claim

gates (unload)

runway (land)

airplane routing

ticket

baggage

gate

takeoff/landing

airplane routing

Page 51: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Why Layers

u Explicit structure eases system design in highly complex systemv Adds structure to the design process

u Modularityv Each layer provides a service to the layer above, essentially abstracting

the connection details awayv Layers can be updated and improved as long as services offered don’t

changev Each layer ABSTRACTS the connection between devices at that layer

u Ease for application programmersv Minimum amount to learnv Use the API provided by upper layers, let the rest sort it out 50

Page 52: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Data flow through layers

51

Pack

et fl

ow

abstract connection

Page 53: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Packet Headers

u Each layer adds a header as a packet flows down

u Header contains the information necessary for that layer to do its job

u Header is removed as data flows up

52

Page 54: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Closer look at the layers

53

Typically software layers

Typically hardware layers

Page 55: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

TCP/IP

u TCP/IP Most famous protocol suiteu TCP

v Layer 4 protocolv Guarantees in-order delivery of packets

u Either they get to the other side in orderu Or both hosts know a packet was lost

v Offers ”data stream” abstraction to layers above

u IP (Internet Protocol)v Layer 3 protocolv All “Internet” traffic is IP trafficv Handles addressing (IP addresses) and routing of packets across the

Internetv No guarantees, packets routed best effortv Offers host-to-host packet service to layers above

54

Page 56: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Network Performance

u Performance Metrics for Networksu Bandwidth - ”how fast is my network”

v How much data (bits) can I get to the other side per secondv Applies to communication links, as well as across the network

u Latency – “How slow is my network”v How long does it take for data to get from one side to the otherv Measured in time: s, ms, us

u Loss – “How bad is my network”v Fraction of packets that get dropped (don’t make it to the other side)v Needs to be <<1% for good network operation

u Throughput – “How good is my network”v Considering how bandwidth, latency, loss combine with a protocol to

measure how much data is actually delivered per unit timev This is what applications see 55

Page 57: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Original Internet Design Goals

u “the Internet” came out of (D)ARPA projects in the 1960’s, 70’s and 80

u Primary driver was to enable computer-to-computer communications, even under nuclear attack

56

Page 58: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Original Internet Design Goals

u Paper in 1988: “The Design Philosophy of the DARPA Internet Protocols” (David Clark, 1988).

u In PRIORITY orderu 1. Continue despite loss of network infrastructure (degrade, but still function

under attack)

u 2. Support multiple types of communication services (many different applications)

u 3. Accommodate a variety of networks (e.g. early networks were not all Ethernet, today’s networks use Ethernet at layer 2, layer 1 is very different)

u 4. Permit distributed management of Internet resources (no one entity is required for network to function)

u 5. Cost effective

u 6. Host attachment should be easy (only local changes required to add host)

u 7. Resource accountability (security) 57

Page 59: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

What about now?

u Many of these goals made the Internet as we know it possible.

u Especially the middle 4:u Support multiple types of communication services (many different

applications)

u Accommodate a variety of networks (e.g. early networks were not all Ethernet, today’s networks use Ethernet at layer 2, layer 1 is very different)

u Permit distributed management of Internet resources (no one entity is required for network to function)

u Cost effective

58

Page 60: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

What about now?

u However, some make things interestingu 4. Permit distributed management of Internet resources

u Originally indented to make the network resilient in a military scenario

u Now: basically no one is in charge

v 7. Resource accountabilityu If you read the paper, they basically never got to thisu This is why Internet security is such a disaster, it wasn’t designed

in originallyu Network agents implicitly trusted, this still causes problems, see

re: BGP attacks59

Page 61: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Back to Internet History

60

Page 62: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Growth of the Internet

61

Page 63: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Switch to TCP/IP (layer 4 protocol)

62

u ARPANet switches to TCP/IP – still in use!

Page 64: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

USC/ISIu Information Sciences Institute

v Part of USC under Viterbiv Researchers, grad students, undergradsv In beautiful MDR

u Became prominent in developing early Internet protocolsv IP

u “The internet protocol provides for transmitting blocks of data called datagrams from sources to destinations, where sources and destinations are hosts identified by fixed length addresses.”

v ICMPv Domain Name Systemv Simple Mail Transport Protocol

u ICANN nee IANAv Internet Assigned Numbers Authority -> ICANNv (USC basically ran the Internet) 63

Page 65: Introduction to Computer Sciencebytes.usc.edu/files/cs109/slides/CSCI109-Lecture9-Networks-New.pdf · 1 Mbps link. example: §1 Mb/s link §each user: • 100 kb/s when “active”

Takeaways

u Networks allow computers to communicate (exchange data)u Data is broken into packets (small chunks) and sent over shared circuits

(packet switching) by switches and routersu Internet is a network-of-networks – No one owner/regulatoru The Internet provides an API for a service (networking) that lets app

developers write software (abstraction)u Services are implemented with protocols that are stacked in layers (more

abstraction)u TCP/IP is the core protocol on which most internetworking is basedu Security was not an important design feature when the Internet was invented

– we’re still paying for this nowu Bandwidth, latency, loss, throughput are the important network performance

metricsu USC/ISI has been involved in inventing the modern Internet since (not quite)

the beginning (e.g DNS, IANA, ICANN)64