CMPE 80N Winter 2004 Lecture 13

23
1 CMPE 80N - Introduction to Networks and the Internet CMPE 80N Winter 2004 Lecture 13 Introduction to Networks and the Internet

description

CMPE 80N Winter 2004 Lecture 13. Introduction to Networks and the Internet. Announcements. The Network Layer. TCP/IP. Application. Transport. Network. Data Link. Physical. Main Functions. Routing. Find path (route) between source and destination. Forwarding. - PowerPoint PPT Presentation

Transcript of CMPE 80N Winter 2004 Lecture 13

Page 1: CMPE 80N Winter 2004 Lecture 13

1CMPE 80N - Introduction to Networks and the Internet

CMPE 80N

Winter 2004

Lecture 13

Introduction to Networks and the Internet

Page 2: CMPE 80N Winter 2004 Lecture 13

2CMPE 80N - Introduction to Networks and the Internet

Announcements

Page 3: CMPE 80N Winter 2004 Lecture 13

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 13

4CMPE 80N - Introduction to Networks and the Internet

Main Functions• Routing. – Find path (route) between source and

destination.• Forwarding.– When data is received, forward it toward the

destination based on routing information. • Who performs these function?– Routers/switches.

Page 5: CMPE 80N Winter 2004 Lecture 13

5CMPE 80N - Introduction to Networks and the Internet

How routers operate?• Store and forward.– Switch stores data they receive in memory;

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

• Next-hop forwarding.– 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.

Page 6: CMPE 80N Winter 2004 Lecture 13

6CMPE 80N - Introduction to Networks and the Internet

Routing Table

Page 7: CMPE 80N Winter 2004 Lecture 13

7CMPE 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.

Page 8: CMPE 80N Winter 2004 Lecture 13

8CMPE 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 9: CMPE 80N Winter 2004 Lecture 13

9CMPE 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 10: CMPE 80N Winter 2004 Lecture 13

10CMPE 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 11: CMPE 80N Winter 2004 Lecture 13

11CMPE 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

Page 12: CMPE 80N Winter 2004 Lecture 13

12CMPE 80N - Introduction to Networks and the Internet

Network Layer: Implementation and Services

Page 13: CMPE 80N Winter 2004 Lecture 13

13CMPE 80N - Introduction to Networks and the Internet

Network Layer: Implementation and Services

• Circuit switching versus packet switching.

Page 14: CMPE 80N Winter 2004 Lecture 13

14CMPE 80N - Introduction to Networks and the Internet

Circuit Switching

• Old telephone technology• For each connection, physical switches

are set in the telephone network to create a physical “circuit”– That’s the job of the switching office

Page 15: CMPE 80N Winter 2004 Lecture 13

15CMPE 80N - Introduction to Networks and the Internet

Circuit Switching - Example

Physical copperconnection set upwhen call is made

Switching offices

Page 16: CMPE 80N Winter 2004 Lecture 13

16CMPE 80N - Introduction to Networks and the Internet

Circuit Switching (cont’d)• Switches are set up at the beginning of the

connection and maintained throughout the connection

• Network resources reserved and dedicated from sender to receiver

• Not a very efficient strategy– A connection “holds” a physical line even

during “silence” periods (when there is nothing to transmit)

Page 17: CMPE 80N Winter 2004 Lecture 13

17CMPE 80N - Introduction to Networks and the Internet

Packet Switching• Sharing by taking turns.

– Analogy: conveyor belt in a warehouse.– Items are picked from the storage room and placed on the

conveyor belt every time a customer makes an order.– Different customers may request a different number of

items.– Different users’ items may be interspersed on the conveyor

belt (they are “multiplexed”).• Networks use a similar idea– Packet Switching• Packetize data to transfer.• Multiplex it onto the wire.

– Packets from different connections share the same link.

Page 18: CMPE 80N Winter 2004 Lecture 13

18CMPE 80N - Introduction to Networks and the Internet

C D D DDC C

A

DB

C

Packet Switching Example

PayloadHeader

Page 19: CMPE 80N Winter 2004 Lecture 13

19CMPE 80N - Introduction to Networks and the Internet

Packet Switching• Each packet is composed by the payload

(the data we want to transmit) and a header.– The header contains information useful for

network layer functions.– Contains:• Source (sender’s) address• Destination (recipient’s) address• Packet size• Sequence number• Error checking information

Page 20: CMPE 80N Winter 2004 Lecture 13

20CMPE 80N - Introduction to Networks and the Internet

Packet Switching (cont’d)– The header introduces overhead, that is,

additional bits to be sent.• Therefore, it is not wise to have packets that

are too small.– What happens if the payload is just 1 bit?

– Addresses• Each computer attached to a network is

assigned a unique number (called address). • A packet contains the address of the sender

and the receiver.

Page 21: CMPE 80N Winter 2004 Lecture 13

21CMPE 80N - Introduction to Networks and the Internet

Packet Switching (cont’d)• In general, packets need not be of the same size– Maximum transmission unit (MTU)– No minimum size• But, header size is fixed (e.g., 20 bytes for TCP/IP).

• Original data chopped up into packets.– The application (e.g., email) does not know that the

data to be transmitted is packetized.– When packets are received, they are put together

before the application accesses the data

Page 22: CMPE 80N Winter 2004 Lecture 13

22CMPE 80N - Introduction to Networks and the Internet

Packet Switching (cont’d)• What kind of delay should we expect?– Time-division multiplexing: constant delay.– Packet switching multiplexing: variable delay (it

depends on the traffic on the line).• Conveyor belt example: if there are many

customers before you, you may have to wait more.

Page 23: CMPE 80N Winter 2004 Lecture 13

23CMPE 80N - Introduction to Networks and the Internet

Circuit Switching vs Packet Switching

Circuit switching• Must set up a connection

(initial delay)• Connection is reliable• Resources are dedicated

– Therefore they are used inefficiently!

Packet switching• Very small set-up delay• Efficient shared use of

resources• Possible congestion and

consequent packet dropping