Top Banner
4/17/19 1 Based on slides © 2009--2019 DeHon Additional Material © 2014 Farmer 1 ESE 150 D IGITAL A UDIO B ASICS Lecture #11 – Networking T ODAY S S EATING ( FOR INCLASS EXERCISE ) 2 Student Student Student Student Student Student Student Student Student Student Student Screen First Row (empty) (empty) (empty) (empty) L ECTURE T OPICS Ò Where are we on course map? Ò Networks É Communicating Between Machines É Bandwidth Requirements É Technology Costs É Network Layering Ð Transport Ð Network – Routing – what can go wrong? Ð Physical (physical layer independence) Ð By end: seen TCP/IP basics Ò Next Lab 3 C OURSE M AP 4 NIC 10101001101 EULA -------- -------- click OK NIC CPU A/D sample domain conversion MP3 Player / iPhone / Droid 10101001101 compress freq pyscho- acoustics D/A MIC speaker 2,5 4 6 3 7,8,9 10 11 13 12 Music Numbers correspond to course weeks 1 OS/File- System C OURSE M AP W EEK 12 5 A/D sample domain conversion MP3 Player / iPhone / Droid compress freq D/A MIC speaker 2,5 4 3 Music Numbers correspond to course weeks 1 pyscho- acoustics 6 CPU 7,8,9 10101001101 OS/File- System 10 NIC NIC 10101001101 compress 3 11 W HAT W E LL C OVER T ODAY Ò Established can É represent things (sound, computations, images, movies, 3D objects…) as bits É Store and reconstruct from bits Ò If we can send bits between machines… É Communicate (from MP3 player to Cell Phone) É Transport (from scanner and 3D printer to a transporter?) 6 NIC NIC Device A Device B
15

Lecture11-Networkingese150/spring2019/lectures/Session24_6up.pdfÉAbstract different functions of a network into layers Ð Each layer only knows about layer above and below (at the

Mar 15, 2020

Download

Documents

dariahiddleston
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: Lecture11-Networkingese150/spring2019/lectures/Session24_6up.pdfÉAbstract different functions of a network into layers Ð Each layer only knows about layer above and below (at the

4/17/19

1

Based on slides © 2009--2019 DeHonAdditional Material © 2014 Farmer

1

ESE 150 –DIGITAL AUDIO BASICS

Lecture #11 – Networking

TODAY’S SEATING (FOR INCLASS EXERCISE)

2

Student Student

Student Student

Student Student Student

Student

Student

Student

Student

Screen

First Row (empty)

(empty)

(empty)

(empty)

LECTURE TOPICSÒ Where are we on course map?Ò Networks

É Communicating Between MachinesÉ Bandwidth RequirementsÉ Technology CostsÉ Network Layering

Ð TransportÐ Network – Routing – what can go wrong?Ð Physical (physical layer independence)Ð By end: seen TCP/IP basics

Ò Next Lab

3

COURSE MAP

4

NIC

10101001101

EULA----------------clickOK

NIC

CPU

A/D

sample

domain conversion

MP3 Player / iPhone / Droid

10101001101

compressfreq pyscho-

acoustics

D/A

MIC

speaker

2,5 4

6

3

7,8,9

10

1113

12

Music

Numbers correspond to course weeks

1

OS/File-System

COURSE MAP – WEEK 12

5

A/D

sample

domain conversion

MP3 Player / iPhone / Droid

compressfreq

D/A

MIC

speaker

2,5 4 3

Music

Numbers correspond to course weeks

1

pyscho-

acoustics

6

CPU

7,8,9 10101001101

OS/File-

System

10

NIC

NIC

10101001101

compress

3

11

WHAT WE’LL COVER TODAY…

Ò Established can É represent things (sound, computations, images, movies, 3D objects…) as bitsÉ Store and reconstruct from bits

Ò If we can send bits between machines…É Communicate (from MP3 player to Cell Phone)É Transport (from scanner and 3D printer to a transporter?)

6

NIC NICDevice A Device B

Page 2: Lecture11-Networkingese150/spring2019/lectures/Session24_6up.pdfÉAbstract different functions of a network into layers Ð Each layer only knows about layer above and below (at the

4/17/19

2

Fundamentals of Networks

7

COMMUNICATING BETWEEN MACHINES

8

NETWORKED SYSTEMS

Ò TodayÉ We expect our computers to be networked

Ð Google, wikipedia, Email, IM, …É Can work stand alone

Ð Airplane mode?

É But, are crippled when not connectedÉ Phone isn’t a phone unless its networked

9

MINIMAL SETUP

Ò Have two computersÉ think raw processors for the moment

Ò Want them to communicateÉ Send an mp3 file from A to B

.MP3

PHYSICAL CONNECTION

Ò Place an I/O datapath in each computerÒ String wire between computer’s IO peripheral

É E.g. one wire from AàB, another BàA

10

PHYSICAL CONNECTION

Ò Place an I/O datapath in each computerÒ String wire between computer’s IO peripheral

É E.g. one wire from AàB, another BàA

11

SIGNALING

Ò Communicate with Voltage pulsesÉ A pulls line low (0)É B senses low (0) line

Ò Data encoded as series of pulses/voltages on line

12

Oscilloscope/Logic Analyzer

Page 3: Lecture11-Networkingese150/spring2019/lectures/Session24_6up.pdfÉAbstract different functions of a network into layers Ð Each layer only knows about layer above and below (at the

4/17/19

3

COMMUNICATION BASIC STEPS

1. Start program on B to receive data (file)2. Start program on A to send data (file)3. B waits for valid symbols4. A sends data5. B receives6. A sends out-of-band signal to end transmission

13

(as we did to communicatebetween Windows PCand Arduino)

PRECLASS 1

Ò How many computers does your laptop communicate with?É E-mail É WeatherÉ Canvas, PiazzaÉ Source code repositories (svn, git, …)É eniacÉ Web servers

Ð Seas, news, facebook, youtube, wikipedia, google, ….

É iTunes, Windows Update

14

MULTIPLE TASKS – MULTIPLE WIRES?Ò Back to wired connectionsÒ E.g. download song and browse

É Could have a separate interface/wire for each applicationÉ Process allocates hardware when needs to communicateÉ Holds exclusive access during transfer

15 16

CONNECT TO MULTIPLE MACHINES

Ò Add interface/wire for every machine want to talk toÉ Talk to machine through its dedicated wire

SCALABILITY

Ò Do we like where this is going?

Ò Hosts on Internet

Ò How many things are connected to Internet?É Estimate as of 8 Billion connected devices!É Growing to 50—100 Billion in next few years…

17

[Source: Kopiesperre CC Share-alike 3.0https://wikivisually.com/wiki/File:Internet_Hosts_Count_log.svg]

18

HOW MANY CONNECTIONS?

Ò Conclusion: need to look at capacity as well as scalability of a network solution

Page 4: Lecture11-Networkingese150/spring2019/lectures/Session24_6up.pdfÉAbstract different functions of a network into layers Ð Each layer only knows about layer above and below (at the

4/17/19

4

19

BANDWIDTH REQUIREMENTS AND COSTS

20

WIRES

Ò How fast can I send data over a wire?Ò Consider a Category-5 Ethernet cable

É Bandwidth (bits/s)Ð 1Gbit/s – 1000Base-T (Gigabit ethernet)

É Latency/transit time (distance/time)Ð 0.64 c [c=speed of light = 3×108 m/s]Ð 0.192 m/ns or roughly 5ns/m

[image: http://en.wikipedia.org/wiki/File:Cat_5.jpg]

21

COMPARISON: AUDIO (PRECLASS 3)

Ò Real-Time stereo (2-channel) MP3É 128Kbits/sÉ How many can share 1Gbit/s link?

Ò How long to download 3 minute song at full rate?

Ò How long for first bit to travel across 4000km wire at 0.6 × speed-of-light?

22

COMPARISON: VIDEO (PRECLASS 3)

Ò HDTV compressedÉ Around 36Mbits/sÉ How many can share 1 Gbit/s link?

23

COSTS (PRECLASS 4)

Ò Cat 5e per foot ~ $0.20/footÉ Say $0.60/mÉ Raw wire

Ð Ignoring handling to runÐ Ignoring rent/lease/buy land to run

É Philly à San Francisco: ~4,000kmÉ Wire cost?

24

IMPLICATIONS?

Ò Today’s wire bandwidth exceeds the throughput needs of any real-time single-stream dataÉ Can afford to share the wire

Ò Wires are not cheapÉ Cannot afford not to share the wire

Page 5: Lecture11-Networkingese150/spring2019/lectures/Session24_6up.pdfÉAbstract different functions of a network into layers Ð Each layer only knows about layer above and below (at the

4/17/19

5

25

SHARING (VIRTUALIZING) CONNECTIONS

SHARING LINK

Ò Idea: Tag data with targetÉ “this is for process 34”É “this is for process 45”

Ò Have transport layer deal with…É Mixing data from separate streamsÉ Separating data out into individual streamsÉ Delivering to individual processes

26

PACKET

Ò Begin to form a packetÉ Header: says where to goÉ Payload: the data to send

Ò Header: É Added, consumed by network handling in routing

Ò Payload:É Only thing seen by the application processes

27 28

PACKETS

29

TRANSPORT LAYER

Ò Call this the “Transport” LayerÉ responsible for delivering data to the individual

application process on the computer

OSI MODEL OF A NETWORK

Ò OSI – Open Systems Interconnection Reference ModelÉ Developed in 1980’s; maintained by ISOÉ Abstract different functions of a network into layers

Ð Each layer only knows about layer above and below (at the interface level)É Think of it like this: your “Application” doesn’t know if its on a wired or

wireless network (physical layer)…but it knows it needs a network!

30

Layer we just discussed

Page 6: Lecture11-Networkingese150/spring2019/lectures/Session24_6up.pdfÉAbstract different functions of a network into layers Ð Each layer only knows about layer above and below (at the

4/17/19

6

POSSIBLE ROLE ASSIGNMENT

31

SA1 SA2 SA3 SA4

T1 T3

N1 N3

W1/R2 R1 R3

T2

N2

N4

T4

CA1 CA2 CA3 CA4

SIMULATION 1

Ò Send 4 verses or digits from eachÉ from song-server-app, p-

server-appÉ to song-listener-app, p-

consumerÒ All go through one wire

W1Ò T1 – Transport taggingÒ T2 – Transport sorting

33

SA1 SA2

T1

T2

CA1 CA2

W1

Host

Host

Server

Client

34

VIRTUALIZE PHYSICAL WIRES

START SIMPLE

Ò Add more computers to same pair of wires

Ò All computers on wire see all the data on the wireÉ How do computers know who the message is for?

35

EXTENDED PACKET

Ò Extend our packet header:É Destination computerÉ Process on destination computerÉ Sending computerÉ Process on sending computer

36 37

NETWORK LAYER

Ò responsible for end-to-end (source to destination) packet delivery

Page 7: Lecture11-Networkingese150/spring2019/lectures/Session24_6up.pdfÉAbstract different functions of a network into layers Ð Each layer only knows about layer above and below (at the

4/17/19

7

38

VIRTUALIZATION EFFECT

Ò Each pair of processes on different computers É Has the view of a point-to-point connectionÉ Each process, thinks it “owns the network” and has a

dedicated connection to the other node

39

[Device Driver]

SIMULATION 2

Ò Send 4 verses or digits from eachÉ from song-server serving 2 songsÉ And digit-server serving 2 fundamental constantsÉ To two clients

40 41

SIMULATION 2

SA3 SA4

T3

T4

CA3 CA4

SA1 SA2

T1

T2

CA1 CA2

W1

N1 N3

N2 N4Host

HostHost

Host

ServerServer

ClientClient

42

SIMULATION 2

SA3 SA4

T3

T4

CA3 CA4

SA1 SA2

T1

T2

CA1 CA2

W1

N1 N3

N2 N4Host

Host Host

Host

Server Server

ClientClient

SIMULATION 2

Ò N1, N3 É Add network-layer source/destination packet headers

Ò W1 – WireÉ Duplicate packets to both destinationsÉ Simulate shared wire

Ò N2, N4É Look at network-layer source/destination headerÉ Discard packets not destined for this computer

43

Page 8: Lecture11-Networkingese150/spring2019/lectures/Session24_6up.pdfÉAbstract different functions of a network into layers Ð Each layer only knows about layer above and below (at the

4/17/19

8

44

SIMULATION 2

SA3 SA4

T3

T4

CA3 CA4

SA1 SA2

T1

T2

CA1 CA2

W1

N1 N3

N2 N4Host

HostHost

Host

Server Server

ClientClient 45

EXTENDING THE VIRTUAL LINK

46

INDIRECT CONNECTIONS

Ò A and B are connectedÒ B and C are connectedÒ How get message from A to C?

É We could add a wire between A and C…É But with 8+ billion nodes on network…

INDIRECT CONNECTIONS

Ò Run program/process on B to forward messages from A to CÉ Call it a “routing” program! Routes messages on network

47

ROUTING

Ò B runs a general programÉ If packet destined for B, takes itÉ Otherwise, sends on to (toward) destination

Ò Extension of the network handling process that is sorting data to processes

48 49

ROUTING

Page 9: Lecture11-Networkingese150/spring2019/lectures/Session24_6up.pdfÉAbstract different functions of a network into layers Ð Each layer only knows about layer above and below (at the

4/17/19

9

50

REACHABILITY

Ò If everyone plays alongÉ We can communicate with any computer reachable transitively from my computer

Ò Don’t need direct connections

ROUTING à ROUTE TABLES

Ò To make efficientÉ Each computer should route close to destinationÉ …and not route in circles

Ò E.g. compute all-pairs shortest paths (CIS160,121)É Store result, each machine knows where to send packet nextÉ How much storage?

Ð Cleverness to compress/summarize

É Additional cleverness to compute incremental updatesÐ When add a computer or a link breaks

51

NETWORK LAYER

Ò Responsible for end-to-end packet deliveryÉ Source to DestinationÉ This includes routing packets through intermediate hosts

52

SIMULATION 3

Ò Send 4 verses or digits from eachÉ from song-server serving 2 songsÉ And digit-server serving 2 fundamental constantsÉ To two clients

Ò R1 – pass along packets to R2 (for now)Ò R2 – look at address and send to N2 or N4

53

54

SIM3

T4

CA3 CA4

T2

CA1 CA2

N2 N4

SA3 SA4

T3

N3

SA1 SA2

T1

N1

R1

R2

Host

Host Host

Host

Server Server

ClientClient

Simulation 3

SIMULATION 4

Ò Send 4 verses or digits from eachÉ from song-server serving 2 songsÉ And digit-server serving 2 fundamental constantsÉ To two clients

Ò Roles: É 4 server appsÉ Network Interface, 2 serversÉ 3 routers

Ð R1 – flip a coin and send to R2 or R3Ð R2, R3 – send to N2, N4 based on address

É Network Interface for each of 2 clientsÉ 4 client apps

55

R1

R2 R3

Page 10: Lecture11-Networkingese150/spring2019/lectures/Session24_6up.pdfÉAbstract different functions of a network into layers Ð Each layer only knows about layer above and below (at the

4/17/19

10

56

SIM4

T4

CA3 CA4

T2

CA1 CA2

N2 N4

SA3 SA4

T3

N3

SA1 SA2

T1

N1

R1

R2 R3

Host

HostHost

Host

Server Server

ClientClient

Simulation 4

57

WHERE ARE WE NOW?

Ò Can communicateÉ From one process on a computerÉ to any other process on any other computer É if the two are transitively connected

Ð By a set of participating computers which route data

Ò Layers have provided “Abstraction”É Processes just see streams of data between the

endpoints

58

LAYERS

Application

Transport

Network

Link

Physical

Application

Transport

Network

Link

Physical

(abstraction)

59

PROTOCOLS

Ò So far, we’ve discussed a protocol called IP:É IP = Internet Protocol

Ò Delivery to processes (rather than hosts): UDPÉ UDP = Unreliable Datagram Protocol

SIMULATION 5

Ò Send 4 verses or digits from eachÉ from song-server serving 2 songsÉ And digit-server serving 2 fundamental constantsÉ To two clients

Ò Deliberately delay data through R3É Model non-determinism in route timing

60 61

SIM5

T4

CA3 CA4

T2

CA1 CA2

N2 N4

SA3 SA4

T3

N3

SA1 SA2

T1

N1

R1

R2 R3 R3 delayed

Host Host

HostHost

Server Server

ClientClient

Simulation 5

Page 11: Lecture11-Networkingese150/spring2019/lectures/Session24_6up.pdfÉAbstract different functions of a network into layers Ð Each layer only knows about layer above and below (at the

4/17/19

11

62

WHAT CAN GO WRONG?

Ò Packets arrive out of orderÒ Solution?

É Add a sequence number

SIMULATION 6

Ò Send 4 verses or digits from eachÉ from song-server serving 2 songsÉ And digit-server serving 2 fundamental constantsÉ To two clients

Ò T1/T3 – add sequence number to packetÒ T2/T4 – hold packets, reorder, and deliver in order

of sequence numberÒ R3 – still delaying packets

63

64

SIM6

T4

CA3 CA4

T2

CA1 CA2

N2 N4

SA3 SA4

T3

N3

SA1 SA2

T1

N1

R1

R2 R3 R3 delayed

Host Host

Host Host

Server Server

ClientClient

Simulation 6

ABSTRACTING PHYSICAL LAYER

Ò Application, transport, networkÉ Don’t really care how the

bits are moved from machine-to-machine

Ò What are other ways we send bits?É Beyond wiresÉ OpticallyÉ RF/wirelessÉ Pneumatic tubes,

passing paper notes, SMS Text messages…

65

Application

Transport

Network

Link

Physical

Application

Transport

Network

Link

Physical

66

SIMULATION 7

Ò Send 4 verses or digits from eachÉ from song-server serving 2 songsÉ And digit-server serving 2 fundamental constantsÉ To two clients

Ò Roles: É 4 server appsÉ Network Interface for each of 2 serversÉ 3 routers, connect to both servers and endpoints

Ð One link is via text messagingÉ Network Interface for each of 2 clientsÉ 4 client apps

67

SIM7

T4

CA3 CA4

T2

CA1 CA2

N2 N4

SA3 SA4

T3

N3

SA1 SA2

T1

N1

R1

R2 R3

wireless

HostHost

Host Host

Server Server

ClientClient

Simulation 7

Page 12: Lecture11-Networkingese150/spring2019/lectures/Session24_6up.pdfÉAbstract different functions of a network into layers Ð Each layer only knows about layer above and below (at the

4/17/19

12

68

WHAT ELSE CAN GO WRONG?

Ò Bits get corruptedÒ Intermediate machines holding messages can

crashÒ Messages can get misrouted

69

70

DATA CORRUPTION

Ò How do we deal with data corruption?É Use redundancy

Ò Two strategies:É Use enough redundancy to correctÉ Use just enough redundancy to detect it

Ð Have the sender resend

71

DATA CORRUPTION

Ò Relatively uncommonÉ Most packets are fine

Ò We have efficient (low overhead) ways to detectÉ Compute a hash of the message dataÉ Highly unlikely one (few) message bit errors will result in

same hashÉ à checksum

REVISED PACKET

Ò HeaderÒ Data payloadÒ Checksum

72

LOST PACKET

Ò How can we deal with lost packets?

73

Page 13: Lecture11-Networkingese150/spring2019/lectures/Session24_6up.pdfÉAbstract different functions of a network into layers Ð Each layer only knows about layer above and below (at the

4/17/19

13

LOST PACKET STRATEGY

Ò Sender sends packetÉ But keeps a copy

Ò Receiver gets packetÉ Checks checksumÉ OK, uses packet and sends ACK

Ð “got your last packet in tact”

É Not ok, discard packetÒ Sender

É Receives ACK, can discard packet and send nextÉ No ACK (after timeout), resend packet

74

RETRANSMISSION DISCIPLINE

Ò Don’t depend on receiver to request retransmissionÉ Why?

Ò Header may be corruptedÉ Not deliver to receiver

Ò Only know receiver got it when it says it got it

75

CORRUPTED ACK

Ò What if the ack is lost?É Sender resends

Ò Receiver receives a second copyÉ Oops, don’t want that to be interpreted as new dataÉ i.e. send: “rm *; cd ..\n”

Ð Receive: “rm *; cd ..\n rm *; cd ..\n”

76

AVOID DUPLICATION

Ò How can we avoid duplication?

77

78

ACCOMMODATING DUPLICATION

Ò Use packet sequence numberÉ Keep track of last packet receivedÉ If receive packet again,

Ð Discard the packet

SEQUENCE NUMBERS

79

Page 14: Lecture11-Networkingese150/spring2019/lectures/Session24_6up.pdfÉAbstract different functions of a network into layers Ð Each layer only knows about layer above and below (at the

4/17/19

14

80

TCP

Ò TCP = Transmission Control ProtocolÉ Provides Reliable deliveryÉ Deals with

Ð RetransmissionÐ DuplicationÐ Out of sequence / resequence / reconstruction

81

TRANSPORT LAYER

Ò Call this the “Transport” LayerÉ responsible for reliably delivering data to the individual

application process on the computer

82

LAYERS

Application

Transport

Network

Link

Physical

Application

Transport

Network

Link

Physical

(abstraction)

LAYERS AND THE PACKET

83

84

BIG IDEAS

Ò Sharing – Network interface, wiresÉ Previously gates, processor, memory

Ò Virtualization – datastream abstracts physical point-to-point link

Ò Layering É Divide-and-conquer functionalityÉ Implementation hiding/technology independenceÉ Reliable communication link from unreliable elements

THIS WEEK IN LAB

Ò Lab 11:É Look at naming, addressing, network diagnostics, …É Including a packet sniffer!

Ð …see all the bits on the network you aren’t supposed to see!Ð Get an appreciation for what is going on, on the lower network

layers

c85

Page 15: Lecture11-Networkingese150/spring2019/lectures/Session24_6up.pdfÉAbstract different functions of a network into layers Ð Each layer only knows about layer above and below (at the

4/17/19

15

86

LEARN MORE @ PENN

Ò CoursesÉ ESE407 – Intro Networks and ProtocolsÉ CIS553 – Networked SystemsÉ CIS549 – Wireless Mobile Communications

ESE407

CIS553

CIS549