cmpe 80n winter 2004 lecture 12

25
1 CMPE 80N - Introduction to Networks and the Internet CMPE 80N Winter 2004 Lecture 12 Introduction to Networks and the Internet

Upload: stamos

Post on 23-Feb-2016

35 views

Category:

Documents


0 download

DESCRIPTION

CMPE 80N Winter 2004 Lecture 12. Introduction to Networks and the Internet. Announcements. Third quiz scheduled for 02.13. Library presentation on 03.03. Lecture notes “dilemma”. The Network Layer. TCP/IP. Application. Transport. Network. Data Link. Physical. Network Layer. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: CMPE 80N Winter 2004 Lecture 12

1CMPE 80N - Introduction to Networks and the Internet

CMPE 80N

Winter 2004

Lecture 12

Introduction to Networks and the Internet

Page 2: CMPE 80N Winter 2004 Lecture 12

2CMPE 80N - Introduction to Networks and the Internet

Announcements• Third quiz scheduled for 02.13.• Library presentation on 03.03.• Lecture notes “dilemma”.

Page 3: CMPE 80N Winter 2004 Lecture 12

3CMPE 80N - Introduction to Networks and the Internet

The Network Layer

Application

Transport

Data Link

Physical

Network

TCP/IP

Page 4: CMPE 80N Winter 2004 Lecture 12

4CMPE 80N - Introduction to Networks and the Internet

Network Layer• Main functions: routing and forwarding.

– What’s routing?– What’s forwarding?

Page 5: CMPE 80N Winter 2004 Lecture 12

5CMPE 80N - Introduction to Networks and the Internet

Routing• Find path (route) between source and

destination.• Analogy: air travel.

– To go from San Francisco to NY.• Go from SFO to Denver.• From Denver to Chicago.• From Chicago to NY.

• Main idea: at every hop, get closer to destination.

Page 6: CMPE 80N Winter 2004 Lecture 12

6CMPE 80N - Introduction to Networks and the Internet

Routing• Find path (route) between source and

destination.

Source

Destination

Page 7: CMPE 80N Winter 2004 Lecture 12

7CMPE 80N - Introduction to Networks and the Internet

Routing (cont’d)• Routing means finding a suitable path for a

packet from sender to destinationA possible route

Another possible route

Source

Destination

Page 8: CMPE 80N Winter 2004 Lecture 12

8CMPE 80N - Introduction to Networks and the Internet

Routing (cont’d)• A router may need to choose between two or more

paths that lead to destination.– Choosing the “shortest” path.

• Typically, there are multiple hops to make the journey.– Unless hosts are on the same network.

• The routing algorithm is the part of a network layer software responsiblefor deciding which output line data should be transmitted on

Page 9: CMPE 80N Winter 2004 Lecture 12

9CMPE 80N - Introduction to Networks and the Internet

Forwarding• When data is received, forward it in toward

the destination.

Page 10: CMPE 80N Winter 2004 Lecture 12

10CMPE 80N - Introduction to Networks and the Internet

Who? How?• Who performs network layer functions?

– Switches/routers.• How these functions are carried out?

– Later…

Page 11: CMPE 80N Winter 2004 Lecture 12

11CMPE 80N - Introduction to Networks and the Internet

Switches or Routers• Switches, or routers, receive data on one side

and forward it on the other side.• Like telephone switches.

Source

Destination

Switch

Page 12: CMPE 80N Winter 2004 Lecture 12

12CMPE 80N - Introduction to Networks and the Internet

Wide-Area Network• One possibility: connect every host using

dedicated line.– Problem?

Page 13: CMPE 80N Winter 2004 Lecture 12

13CMPE 80N - Introduction to Networks and the Internet

Wide-Area Network• One possibility: connect every host using

dedicated line.– Problem?

• Another possibility: use interconnected switches which are interconnected and connect to hosts.

Switch

Hosts/Switches

Hosts/ Switches

Incomingline/interface

Outgoing line/interface

Page 14: CMPE 80N Winter 2004 Lecture 12

14CMPE 80N - Introduction to Networks and the Internet

Switch Internals• Early WANs used general purpose machines

dedicated to the task of switching.• Modern WAN switches use special purpose

hardware optimized for the switching task.

Page 15: CMPE 80N Winter 2004 Lecture 12

15CMPE 80N - Introduction to Networks and the Internet

Store and Forward• How switches operate.• Shared LANs: only 1 pair of hosts can

exchange a frame at a time.• WANs: many hosts can send simultaneously.• Switch stores data they receive in memory;

next switch examines data, determines which interface to send it, and forwards data on.

Page 16: CMPE 80N Winter 2004 Lecture 12

16CMPE 80N - Introduction to Networks and the Internet

Queuing• If multiple data items arrive for the same

outgoing interface, they are queued waiting to be transmitted.

Switch

Page 17: CMPE 80N Winter 2004 Lecture 12

17CMPE 80N - Introduction to Networks and the Internet

Queuing (cont’d)• If multiple data items arrive for the same

outgoing interface, they are queued waiting to be transmitted.

Switch

Page 18: CMPE 80N Winter 2004 Lecture 12

18CMPE 80N - Introduction to Networks and the Internet

Queuing (cont’d)• If multiple data items arrive for the same

outgoing interface, they are queued waiting to be transmitted.

Switch

Page 19: CMPE 80N Winter 2004 Lecture 12

19CMPE 80N - Introduction to Networks and the Internet

Next-Hop Forwarding • Air travel analogy: SF ->NY

– You want to go from SF->NY.– Go to SF airport; go to airline ticketing; ask for

cheapest ticket from SF to NY.– Get ticket from SF -> Denver.– At Denver airport, get cheapest ticket to go to

NY.– Get ticket from Denver->Chicago, etc.

Page 20: CMPE 80N Winter 2004 Lecture 12

20CMPE 80N - Introduction to Networks and the Internet

Next-Hop Forwarding (cont’d)• If data not destined to directly connected

host, switch forwards it to the cheapest next hop toward destination.

• Next hop does not depend on source, not on the path traveled so far.

• Advantage: switch need only examine destination address.

Page 21: CMPE 80N Winter 2004 Lecture 12

21CMPE 80N - Introduction to Networks and the Internet

Routing Table• Switches need to know where to forward data

they receive.– Essentially, destination address -> next hop.

• Table containing destination and associated next-hop information.

Switch 2

Page 22: CMPE 80N Winter 2004 Lecture 12

22CMPE 80N - Introduction to Networks and the Internet

Routing Table• Air travel analogy:

– At each airport there is a table showing the cheapest next hop to every destination.

– The source does not matter!– Example: at Denver airport,

• NY go to Chicago• DC go to Chicago• Miami go to Houston• Houston go to Houston• Los Angeles go to Los Angeles• San Diego go to Los Angeles

Page 23: CMPE 80N Winter 2004 Lecture 12

23CMPE 80N - Introduction to Networks and the Internet

Routing Table: Example

Switch 1Switch 3

A

BC

D

E

F

1,1

1,3

2,5

2,6

3,6

3,8

:Destination Next hop A (1,1) Interface 1 B (1,3) Interface 1 C Interface 4 D Interface 4 E Interface 5 F Interface 6

Switch 2

1234

2,12,2 2,3

3,13,23,33,4

2,4

At switch 2:

Page 24: CMPE 80N Winter 2004 Lecture 12

24CMPE 80N - Introduction to Networks and the Internet

More Routing Table• Each router stores information about

forwarding in a routing table.– Initialized at system initialization.– Must be updated as network topology

changes.• Routing table contains a list of destination

and next hop for each destination.• Routing table is built by routing protocol.

Page 25: CMPE 80N Winter 2004 Lecture 12

25CMPE 80N - Introduction to Networks and the Internet

Routing and Hierarchical Addresses

• Hierarchical addresses allow routing tables to be smaller and more concise.

At switch 2:Destination Next hop Destination Next Hop 1,1 Interface 1 1, any Interface 1 1,3 Interface 1 3,6 Interface 4 3,8 Interface 4 3, any Interface 4 2,5 Interface 5 2, any Local 2,6 Interface 6