ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of...

29
ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko, x6-3843 [email protected] Assistant: Sharon Cooper (“Shay”), x6-3546 Course webpage: www.whoopis.com/engs4
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    214
  • download

    0

Transcript of ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of...

Page 1: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

ENGS 4 - Lecture 7Technology of Cyberspace

Winter 2004Thayer School of Engineering

Dartmouth College

Instructor: George Cybenko, x6-3843

[email protected]

Assistant: Sharon Cooper (“Shay”), x6-3546

Course webpage: www.whoopis.com/engs4

Page 2: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

Today’s Class• Wrap-up routing basics from Lecture 6

• Sam’s’s mini-lecture

• Break

• State-based methods for “Predicting the Future”

Page 3: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

Circuit SwitchingReserve a “circuit” and that “guarantees” services for each user

Requires significant “setup time”

Good for telephones, bad for web browsing!!!!

Page 4: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

Packet Switching

Send “packets” into the network, routing each packet individually, like the post office. Packets are “routed”through the network, sorted at “switches”.Requires no setup time but no guarantee of service!!

Bad for telephones, good for web browsing!!!!

Page 5: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

Circuit vs Packet Switching

• Call setup time – s seconds• Bandwidth - b bits per second• Packet routing overhead – p seconds per hop• Message of B bits• Distance between end points - d• EG Circuit switching requires: s + B/b + d/c seconds• EG Packet switching requires: B/b + p*h + d/c seconds• Which is better depends on values of parameters!!!

Page 6: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

B=50,000 b=1,000,000 p=0.005 h=10

Circuit switching is better

Packet switching is better

Page 7: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

IP Packets and routing• IP is Internet Protocol (also Intellectual Property sometimes)• IP addresses consist of four numbers between 0 and 255 • How many possible IP addresses are there in total?• What is www.dartmouth.edu’s IP address?

Router

Network 1

Network 2

A router can be a dedicated piece of hardware or a computerwith several network interfaces. Cisco, 3Com, etc sell routers.

?

Page 8: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

Resolving internet addresses

Your computer LAN

DHCP Server

DNS Server

1. Can I get an IPaddress, etc?

2. Here is a temporaryaddress andother information.

3. What is the address ofwww.cnn.com?

4. www.cnn.com is207.25.71.82

Rest ofthe world

Bridge or gateway or router or switch

5. Send packetsto 207.25.71.82

Page 9: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

Page 10: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

Page 11: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

Page 12: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

Time vs Frequency Division Multiple Access (TDMA vs FDMA)

• TDMA – Divide a communications resource or channel using time slots. Users take turns using the same resource by using it only in their allotted slots.

• FDMA – Divide a communications resource or channel using frequency division. Users simultaneously use the channel but at different frequencies.

• Space Division Multiple Access (Cellular phone)• Code Division Multiple Access (Spread spectrum)• Examples?

Page 13: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

Network routingRouting table in a router looks like.....

Pattern Next node on path

129.170.*.* host 1125.*.*.* host 2105.121.5.21 host 3default host 4

Router

1

2

3

4

Page 14: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

Bellman-Ford Routing

A

E

C

D

B

F2

1

3

1

4

1

8

Computer/host

Distance/cost/delaybetween hosts

Page 15: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

A

E

C

D

B

F2

1

3

1

4

1

8

A 0B 1C *D 2E *F *

A 2B *C 1D 0E 4F *

A 1B 0C 3D *E *F *

A *B 3C 0D 1E *F 1

A *B *C 1D *E 8F 0

A *B *C *D 4E 0F 8

Initial table hasdistance to each host one hop awayand * otherwise.

Page 16: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

A

E

C

D

B

F2

1

3

1

4

1

8

A 0 0B 1 1C * 4D 2 2E * 6F * *

A 2 2B * 3C 1 1D 0 0E 4 4F * 2

A 1 1B 0 0C 3 3D * 3E * *F * 4

A * 3B 3 3C 0 0D 1 1E * 5F 1 1

A * *B * 4C 1 1D * 2E 8 8F 0 0

A * 6B * *C * 5D 4 4E 0 0F 8 8

newdistance to X = min( distance toneighbor + distancefrom neighbor to X)where min is over allneighbors

Page 17: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

A

E

C

D

B

F2

1

3

1

4

1

8

A 0 0 0B 1 1 1C * 4 3 D 2 2 2E * 6 6F * * 4

A 2 2 2B * 3 3C 1 1 1D 0 0 0E 4 4 4F * 2 2

A 1 1 1B 0 0 0C 3 3 3D * 3 3E * * 7F * 4 4

A * 3 3B 3 3 3C 0 0 0D 1 1 1E * 5 5F 1 1 1

A * * 4B * 4 4C 1 1 1D * 2 2E 8 8 6F 0 0 0

A * 6 6 B * * 7 C * 5 5 D 4 4 4 E 0 0 0 F 8 8 6

Repeat it!!!

Page 18: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

A

E

C

D

B

F2

1

3

1

4

1

8

A 0 0 0 0B 1 1 1 1C * 4 3 3D 2 2 2 2E * 6 6 6F * * 4 4

A 2 2 2 2B * 3 3 3C 1 1 1 1D 0 0 0 0E 4 4 4 4F * 2 2 2

A 1 1 1 1B 0 0 0 0C 3 3 3 3D * 3 3 3E * * 7 7F * 4 4 4

A * 3 3 3B 3 3 3 3C 0 0 0 0D 1 1 1 1E * 5 5 5F 1 1 1 1

A * * 4 4B * 4 4 4C 1 1 1 1D * 2 2 2E 8 8 6 6F 0 0 0 0

A * 6 6 6 B * * 7 7C * 5 5 5D 4 4 4 4E 0 0 0 0F 8 8 6 6

Repeat it...stopwhen the tabledoes not change.

Page 19: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

A

E

C

D

B

F2

1

3

1

4

1

8

A 0 0 0 0 AB 1 1 1 1 BC * 4 3 3 DD 2 2 2 2 DE * 6 6 6 DF * * 4 4 D

A 2 2 2 2 AB * 3 3 3 AC 1 1 1 1 CD 0 0 0 0 DE 4 4 4 4 EF * 2 2 2 C

A 1 1 1 1 AB 0 0 0 0 BC 3 3 3 3 CD * 3 3 3 AE * * 7 7 AF * 4 4 4 C

A * 3 3 3 DB 3 3 3 3 BC 0 0 0 0 CD 1 1 1 1 DE * 5 5 5 DF 1 1 1 1 F

A * * 4 4 CB * 4 4 4 CC 1 1 1 1 CD * 2 2 2 CE 8 8 6 6 CF 0 0 0 0 F

A * 6 6 6 D B * * 7 7 DC * 5 5 5 DD 4 4 4 4 DE 0 0 0 0 EF 8 8 6 6 D

The min neighbordetermines thepaths

Page 20: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

A

E

C

D

B

F2

1

3

1

4

1

8

A 0 AB 1 BC 3 DD 2 DE 6 DF 4 D

A 2 AB 3 AC 1 CD 0 DE 4 EF 2 C

A 1 AB 0 BC 3 CD 3 AE 7 AF 4 C

A 3 DB 3 BC 0 CD 1 DE 5 DF 1 F

A 4 CB 4 CC 1 CD 2 CE 6 CF 0 F

A 6 D B 7 DC 5 DD 4 DE 0 EF 6 D

Only need thetotal distancesand the next neighbor

Page 21: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

A

E

C

D

B

F2

1

3

1

4

1

8

A 0 AB 1 BC 3 DD 2 DE 6 DF 4 D

A 2 AB 3 AC 1 CD 0 DE 4 EF 2 C

A 1 AB 0 BC 3 CD 3 AE 7 AF 4 C

A 3 DB 3 BC 0 CD 1 DE 5 DF 1 F

A 4 CB 4 CC 1 CD 2 CE 6 CF 0 F

A 6 D B 7 DC 5 DD 4 DE 0 EF 6 D

Ooops...what if thenetwork changes??

2

Have enough informationto keep updating the tableuntil it stops changing

Page 22: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

Sam’s Mini-lecture

Page 23: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

Break

Page 24: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

“Predicting the Future”

• Newtonian revolution (late 1600’s) : F=ma

• Concept of “state” introduced

• The “state” of a system is all that is needed to predict it’s future states.

• Having additional information about the system’s past states does not help to predict it’s future.

• This defines the notion of “state”.

Page 25: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

Example

• A cannonball shot from a canon.

• Where will it fall?

??????

position +momentum of the canonballis the “state”

Page 26: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

States transition rules for a cannonball

Four state variables:

horizontal position at time i: x(i)

vertical position at time i: y(i)

horizontal momentum at time i: xm(i)

vertical momemtum at time i: ym(i)

Update rules to go from time i-1 to time i

x(i)=x(i-1)+dt*xm(i-1)

if (y(i-1) > 0 ) y(i)=y(i-1)+dt*ym(i-1)

xm(i)=xm(i-1)

ym(i)=ym(i-1)-dt*g

Page 27: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

Matlab demo

Page 28: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

Game of Life

http://www.math.com/students/wonders/life/life.html

Rules are very simple

Rules describe how to go from one “state” to the next

No simple mathematical theory for predicting what state

will exist in the future….must simulate in general.

Page 29: ENGS4 2004 Lecture 7 ENGS 4 - Lecture 7 Technology of Cyberspace Winter 2004 Thayer School of Engineering Dartmouth College Instructor: George Cybenko,

ENGS4 2004 Lecture 7

State-based Prediction• What are examples of state-based prediction?• Weather - http://www.ecmwf.int/• Astronomy - http://

science.nasa.gov/RealTime/jtrack/Spacecraft.html

• Chemistry - http://polymer.bu.edu/java/java/movie/index.html

• Biology - http://arieldolan.com/ofiles/JavaFloys.aspx

• Physics - http://otrc93.ce.utexas.edu/~waveroom/Applet/WaveKinematics/WaveKinematics.html

• Medicine - http://www.esg.montana.edu/meg/notebook/example1.html

• Others?