mecanismes d’echange d’informations chapter 4 network layer network layer.pdf · chapter 4:...

34
19/05/2008 1 Mecanismes d’Echange d’Informations Chapter 4 Network Layer Computer Networking: A Top Down Approach Featuring the Internet, A note on the use of these ppt slides: We’re making these slides freely available to all (faculty, students, readers). They’re in PowerPoint form so you can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously represent a lot of work on our part. In return for use, we only ask the following: Network Layer 4-1 Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross Addison-Wesley, July 2004. following: If you use these slides (e.g., in a class) in substantially unaltered form, that you mention their source (after all, we’d like people to use our book!) If you post any slides in substantially unaltered form on a www site, that you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this material. Thanks and enjoy! JFK/KWR All material copyright 1996-2004 J.F Kurose and K.W. Ross, All Rights Reserved Chapter 4: Network Layer Chapter goals: d d l bh d k l understand principles behind network layer services: routing (path selection) dealing with scale how a router works d d t i IP 6 bilit Network Layer 4-2 advanced topics: IPv6, mobility instantiation and implementation in the Internet

Upload: others

Post on 05-Jun-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

1

Mecanismes d’Echange d’InformationsChapter 4Network Layer

Computer Networking: A Top Down Approach Featuring the Internet,

A note on the use of these ppt slides:We’re making these slides freely available to all (faculty, students, readers). They’re in PowerPoint form so you can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously represent a lot of work on our part. In return for use, we only ask the following:

Network Layer 4-1

Featuring the Internet, 3rd edition. Jim Kurose, Keith RossAddison-Wesley, July 2004.

following:If you use these slides (e.g., in a class) in substantially unaltered form,

that you mention their source (after all, we’d like people to use our book!)If you post any slides in substantially unaltered form on a www site, that

you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this material.

Thanks and enjoy! JFK/KWR

All material copyright 1996-2004J.F Kurose and K.W. Ross, All Rights Reserved

Chapter 4: Network Layer

Chapter goals:d d l b h d k l understand principles behind network layer

services:routing (path selection)dealing with scalehow a router worksd d t i IP 6 bilit

Network Layer 4-2

advanced topics: IPv6, mobilityinstantiation and implementation in the Internet

Page 2: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

2

Chapter 4: Network Layer

4. 1 Introduction4 2 Virtual circuit and

4.5 Routing algorithmsHierarchical routing4.2 Virtual circuit and

datagram networks4.3 What’s inside a router4.4 IP: Internet Protocol

D t f t

Hierarchical routing4.6 Routing in the Internet

RIPOSPFBGP

Network Layer 4-3

Datagram formatIPv4 addressingICMPIPv6

Network layertransport segment from sending to receiving host on sending side network

d l k

applicationtransportnetworkdata linkphysical

encapsulates segments into datagramson rcving side, delivers segments to transport layernetwork layer protocols

networkdata linkphysical

networkdata linkphysical

data linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkd t li k

networkdata linkphysical

physical

application

Network Layer 4-4

y pin every host, routerRouter examines header fields in all IP datagrams passing through it

data linkphysical

applicationtransportnetworkdata linkphysical

Page 3: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

3

Key Network-Layer Functions

forwarding: move packets from router’s

analogy:packets from router s input to appropriate router output

routing: determine route taken by

routing: process of planning trip from source to dest

forwarding: process of getting through

Network Layer 4-5

packets from source to dest.

Routing algorithms

of getting through single interchange

routing algorithm

local forwarding table

Interplay between routing and forwarding

value in arrivingpacket’s header

local forwarding tableheader value output link

0100010101111001

3221

Network Layer 4-6

1

23

0111

Page 4: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

4

Network service modelQ: What service model for “channel” transporting datagrams from sender to rcvr?

Example services for individual datagrams:guaranteed deliveryGuaranteed delivery with less than 40 msec d l

Example services for a flow of datagrams:In-order datagram deliveryGuaranteed minimum b d idth t fl

Network Layer 4-7

delay bandwidth to flowRestrictions on changes in inter-packet spacing

Network layer service models:

NetworkArchitecture

ServiceModel Bandwidth Loss Order Timing

Congestionfeedback

Guarantees ?

Internet

ATM

ATM

ATM

best effort

CBR

VBR

ABR

none

constantrateguaranteedrateguaranteed

no

yes

yes

no

no

yes

yes

yes

no

yes

yes

no

no (inferredvia loss)nocongestionnocongestionyes

Network Layer 4-8

ATM UBR

gminimumnone no

y

yes no

y

no

Page 5: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

5

Chapter 4: Network Layer

4. 1 Introduction4 2 Virtual circuit and

4.5 Routing algorithmsHierarchical routing4.2 Virtual circuit and

datagram networks4.3 What’s inside a router4.4 IP: Internet Protocol

D t f t

Hierarchical routing4.6 Routing in the Internet

RIPOSPFBGP

Network Layer 4-9

Datagram formatIPv4 addressingICMPIPv6

Network layer connection and connection-less service

Datagram network provides network-layer connectionless serviceconnectionless serviceVC network provides network-layer connection serviceAnalogous to the transport-layer services, but:

S i : h st t h st

Network Layer 4-10

Service: host-to-hostNo choice: network provides one or the otherImplementation: in the core

Page 6: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

6

Virtual circuits“source-to-dest path behaves much like telephone

circuit”

call setup, teardown for each call before data can floweach packet carries VC identifier (not destination host address)

performance-wisenetwork actions along source-to-dest path

Network Layer 4-11

every router on source-dest path maintains “state” for each passing connectionlink, router resources (bandwidth, buffers) may be allocated to VC

VC implementation

A VC consists of:1 Path from source to destination1. Path from source to destination2. VC numbers, one number for each link along

path3. Entries in forwarding tables in routers along

pathPacket belonging to VC carries a VC

Network Layer 4-12

g gnumber.VC number must be changed on each link.

New VC number comes from forwarding table

Page 7: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

7

Forwarding table12 22 32

1 23

VC number

interfacenumber

Incoming interface Incoming VC # Outgoing interface Outgoing VC #

1 12 3 222 63 1 18 3 7 2 17

Forwarding table innorthwest router:

Network Layer 4-13

3 7 2 171 97 3 87… … … …

Routers maintain connection state information!

Virtual circuits: signaling protocols

used to setup, maintain teardown VCd i ATM f l X 25used in ATM, frame-relay, X.25

not used in today’s Internet

applicationtransport

t kapplicationtransport3 A t ll4 C ll t d

5. Data flow begins 6. Receive data

Network Layer 4-14

networkdata linkphysical

transportnetworkdata linkphysical

1. Initiate call 2. incoming call3. Accept call4. Call connected

Page 8: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

8

Datagram networksno call setup at network layerrouters: no state about end-to-end connections

no network-level concept of “connection”packets forwarded using destination host address

packets between same source-dest pair may take different paths

applicationt nsp t application

Network Layer 4-15

transportnetworkdata linkphysical

appl cat ontransportnetworkdata linkphysical

1. Send data 2. Receive data

Forwarding table

Destination Address Range Link Interface

4 billion possible entries

11001000 00010111 00010000 00000000through 0

11001000 00010111 00010111 11111111

11001000 00010111 00011000 00000000through 1

11001000 00010111 00011000 11111111

Network Layer 4-16

11001000 00010111 00011001 00000000through 2

11001000 00010111 00011111 11111111

otherwise 3

Page 9: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

9

Longest prefix matching

Prefix Match Link Interface11001000 00010111 00010 011001000 00010111 00010 011001000 00010111 00011000 111001000 00010111 00011 2

otherwise 3

Examples

DA: 11001000 00010111 00010110 10100001 Which interface?

Network Layer 4-17

DA: 11001000 00010111 00011000 10101010 Which interface?

Datagram or VC network: why?

Internetdata exchange among

ATMevolved from telephony

computers“elastic” service, no strict timing req.

“smart” end systems (computers)

can adapt, perform control, error recovery

f p yhuman conversation:

strict timing, reliability requirementsneed for guaranteed service

“dumb” end systemst l ph n s

Network Layer 4-18

ysimple inside network, complexity at “edge”

many link types different characteristicsuniform service difficult

telephonescomplexity inside network

Page 10: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

10

Chapter 4: Network Layer

4. 1 Introduction4 2 Virtual circuit and

4.5 Routing algorithmsHierarchical routing4.2 Virtual circuit and

datagram networks4.3 What’s inside a router4.4 IP: Internet Protocol

D t f t

Hierarchical routing4.6 Routing in the Internet

RIPOSPFBGP

Network Layer 4-19

Datagram formatIPv4 addressingICMPIPv6

The Internet Network layerHost, router network layer functions:

Transport layer: TCP, UDP

forwardingtable

Routing protocols•path selection•RIP, OSPF, BGP

IP protocol•addressing conventions•datagram format•packet handling conventions

ICMP protocol•error reporting

t “si li ”

p y ,

Networklayer

Network Layer 4-20

•router “signaling”

Link layer

physical layer

Page 11: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

11

Chapter 4: Network Layer

4. 1 Introduction4 2 Virtual circuit and

4.5 Routing algorithmsHierarchical routing4.2 Virtual circuit and

datagram networks4.3 What’s inside a router4.4 IP: Internet Protocol

D t f t

Hierarchical routing4.6 Routing in the Internet

RIPOSPFBGP

Network Layer 4-21

Datagram formatIPv4 addressingICMPIPv6

IP datagram format

ver length

32 bits

16 bit identifier

IP protocol versionnumber

header length(bytes) for

fragmentation/

total datagramlength (bytes)head.

lentype ofservice

“type” of data flgsfragment

d t

16-bit identifierInternetchecksum

time tolive

32 bit source IP address

max numberremaining hops

(decremented at each router)

fragmentation/reassembly

upper layer protocolto deliver payload to

flgs offsetupperlayer

32 bit destination IP address

Options (if any) E.g. timestamp,record route

h h h d

Network Layer 4-22

data (variable length,typically a TCP

or UDP segment)

taken, specifylist of routers to visit.

how much overhead with TCP?20 bytes of TCP20 bytes of IP= 40 bytes + app layer overhead

Page 12: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

12

IP Fragmentation & Reassemblynetwork links have MTU (max.transfer size) - largest possible link-level frame.

diff li k different link types, different MTUs

large IP datagram divided (“fragmented”) within net

one datagram becomes several datagrams“reassembled” only at final destination

fragmentation: in: one large datagramout: 3 smaller datagrams

reassembly

Network Layer 4-23

IP header bits used to identify, order related fragments

IP Fragmentation and ReassemblyID=x

offset=0

fragflag=0

length=4000Example

4000 b t

ID=x

offset=0

fragflag=1

length=1500

ID=x

offset=185

fragflag=1

length=1500

One large datagram becomesseveral smaller datagrams

4000 byte datagramMTU = 1500 bytes

1480 bytes in data field

Network Layer 4-24

x =185=11500

ID=x

offset=370

fragflag=0

length=1040

offset =1480/8

Page 13: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

13

Chapter 4: Network Layer

4. 1 Introduction4 2 Virtual circuit and

4.5 Routing algorithmsHierarchical routing4.2 Virtual circuit and

datagram networks4.3 What’s inside a router4.4 IP: Internet Protocol

D t f t

Hierarchical routing4.6 Routing in the Internet

RIPOSPFBGP

Network Layer 4-25

Datagram formatIPv4 addressingICMPIPv6

IP Addressing: introductionIP address: 32-bit identifier for host, router interface

223.1.1.1

223.1.1.2223.1.2.1

interfaceIP address:

subnet part (high order bits)host part (low order bits)

interface: connection between host/router and h si l li k

223.1.1.3

223.1.1.4 223.1.2.9

223.1.2.2

223.1.3.2223.1.3.1

223.1.3.27

Network Layer 4-26

physical linkrouter’s typically have multiple interfaceshost typically has one interfaceIP addresses associated with each interface

223.1.1.1 = 11011111 00000001 00000001 00000001

223 1 11

Page 14: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

14

IP addresses: how to get one?

Q: How does host get IP address?

hard-coded by system admin in a fileWintel: control-panel->network->configuration->tcp/ip->propertiesUNIX: /etc/rc.config

DHCP: Dynamic Host Configuration Protocol:

Network Layer 4-27

DHCP: Dynamic Host Configuration Protocol: dynamically get address from as server

“plug-and-play” (more in next chapter)

IP addresses: how to get one?Q: How does network get subnet part of IP

addr?A: gets allocated portion of its provider ISP’s

address space

ISP's block 11001000 00010111 00010000 00000000 200.23.16.0/20

Organization 0 11001000 00010111 00010000 00000000 200.23.16.0/23 Organization 1 11001000 00010111 00010010 00000000 200 23 18 0/23

Network Layer 4-28

Organization 1 11001000 00010111 00010010 00000000 200.23.18.0/23 Organization 2 11001000 00010111 00010100 00000000 200.23.20.0/23

... ….. …. ….Organization 7 11001000 00010111 00011110 00000000 200.23.30.0/23

Page 15: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

15

IP addressing: the last word...

Q: How does an ISP get block of addresses?A ICANN I C i f A i d A: ICANN: Internet Corporation for Assigned

Names and Numbersallocates addressesmanages DNSassigns domain names, resolves disputes

Network Layer 4-29

Chapter 4: Network Layer

4. 1 Introduction4 2 Virtual circuit and

4.5 Routing algorithmsHierarchical routing4.2 Virtual circuit and

datagram networks4.3 What’s inside a router4.4 IP: Internet Protocol

D t f t

Hierarchical routing4.6 Routing in the Internet

RIPOSPFBGP

Network Layer 4-30

Datagram formatIPv4 addressingICMPIPv6

Page 16: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

16

ICMP: Internet Control Message Protocol

used by hosts & routers to communicate network-level i f ti

Type Code description0 0 echo reply (ping)information

error reporting: unreachable host, network, port, protocolecho request/reply (used by ping)

network-layer “above” IP:ICMP msgs carried in IP

0 0 echo reply (ping)3 0 dest. network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion

control - not used)

Network Layer 4-31

gdatagrams

ICMP message: type, code plus first 8 bytes of IP datagram causing error

8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header

Traceroute and ICMP

Source sends series of UDP segments to dest

When ICMP message arrives, source calculates

First has TTL =1Second has TTL=2, etc.Unlikely port number

When nth datagram arrives to nth router:

Router discards datagramAnd sends to source an

RTTTraceroute does this 3 times

Stopping criterionUDP segment eventually arrives at destination hostDestination returns ICMP

Network Layer 4-32

ICMP message (type 11, code 0)Message includes name of router& IP address

Dest nat on returns I M “host unreachable” packet (type 3, code 3)When source gets this ICMP, stops.

Page 17: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

17

Chapter 4: Network Layer

4. 1 Introduction4 2 Virtual circuit and

4.5 Routing algorithmsHierarchical routing4.2 Virtual circuit and

datagram networks4.3 What’s inside a router4.4 IP: Internet Protocol

D t f t

Hierarchical routing4.6 Routing in the Internet

RIPOSPFBGP

Network Layer 4-33

Datagram formatIPv4 addressingICMPIPv6

IPv6Initial motivation: 32-bit address space soon to be completely allocated. p yAdditional motivation:

header format helps speed processing/forwardingheader changes to facilitate QoS

IPv6 datagram format:fixed-length 40 byte header

Network Layer 4-34

g yno fragmentation allowed

Page 18: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

18

IPv6 Header (Cont)Priority: identify priority among datagrams in flowFlow Label: identify datagrams in same “flow.”

(concept of“flow” not well defined)(concept of flow not well defined).Next header: identify upper layer protocol for data

Network Layer 4-35

Other Changes from IPv4

Checksum: removed entirely to reduce processing time at each hopprocessing time at each hopOptions: allowed, but outside of header, indicated by “Next Header” fieldICMPv6: new version of ICMP

additional message types, e.g. “Packet Too Big”lti t t f ti

Network Layer 4-36

multicast group management functions

Page 19: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

19

Chapter 4: Network Layer

4. 1 Introduction4 2 Virtual circuit and

4.5 Routing algorithmsHierarchical routing4.2 Virtual circuit and

datagram networks4.3 What’s inside a router4.4 IP: Internet Protocol

D t f t

Hierarchical routing4.6 Routing in the Internet

RIPOSPFBGP

Network Layer 4-37

Datagram formatIPv4 addressingICMPIPv6

routing algorithm

Interplay between routing and forwarding

value in arrivingpacket’s header

local forwarding tableheader value output link

0100010101111001

3221

Network Layer 4-38

1

23

0111

packet s header

Page 20: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

20

Routing Algorithm classificationGlobal or decentralized

information?Gl b l

Static or dynamic?Static:

Global:all routers have complete topology, link cost info“link state” algorithms

Decentralized:router knows physically-connected neighbors, link

routes change slowly over time

Dynamic:routes change more quickly

periodic update

Network Layer 4-39

gcosts to neighborsiterative process of computation, exchange of info with neighbors“distance vector” algorithms

periodic updatein response to link cost changes

Chapter 4: Network Layer

4. 1 Introduction4 2 Virtual circuit and

4.5 Routing algorithmsHierarchical routing4.2 Virtual circuit and

datagram networks4.3 What’s inside a router4.4 IP: Internet Protocol

D t f t

Hierarchical routing4.6 Routing in the Internet

RIPOSPFBGP

Network Layer 4-40

Datagram formatIPv4 addressingICMPIPv6

Page 21: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

21

Hierarchical RoutingOur routing study thus far - idealization

all routers identical

scale: with 200 million destinations:can’t store all dest’s in

administrative autonomyinternet = network of networks

network “flat”… not true in practice

Network Layer 4-41

routing tables!routing table exchange would swamp links!

each network admin may want to control routing in its own network

Hierarchical Routing

aggregate routers into regions, “autonomous

Gateway routerDirect link to router in systems” (AS)

routers in same AS run same routing protocol

“intra-AS” routingprotocolrouters in different AS

diff t i t

Direct link to router in another AS

Network Layer 4-42

can run different intra-AS routing protocol

Page 22: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

22

3a 2c3c

Interconnected ASes

3b

1d

3a

1c2aAS3

AS1AS2

1a

2c2b

1b

Intra-ASRouting

Inter-ASRouting

Forwarding table is configured by both intra- and inter-AS routing algorithm

Network Layer 4-43

Routing algorithm

Routing algorithm

Forwardingtable

routing algorithmIntra-AS sets entries for internal destsInter-AS & Intra-As sets entries for external dests

Inter-AS tasksSuppose router in AS1 receives datagram for which dest is outside of AS1

AS1 needs:1. to learn which dests

are reachable through AS2 and which thr u h AS3of AS1

Router should forward packet towards one of the gateway routers, but which one?

through AS32. to propagate this

reachability info to all routers in AS1

Job of inter-AS routing!

Network Layer 4-44

3b

1d

3a

1c2aAS3

AS1AS2

1a

2c2b

1b

3c

Page 23: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

23

Example: Setting forwarding table in router 1d

Suppose AS1 learns from the inter-AS protocol that subnet x is reachable from protocol that subnet x is reachable from AS3 (gateway 1c) but not from AS2.Inter-AS protocol propagates reachability info to all internal routers.Router 1d determines from intra-AS routing info that its interface I is on the

Network Layer 4-45

routing info that its interface I is on the least cost path to 1c.Puts in forwarding table entry (x,I).

Example: Choosing among multiple ASesNow suppose AS1 learns from the inter-AS protocol that subnet x is reachable from AS3 and from AS2.To configure forwarding table router 1d must To configure forwarding table, router 1d must determine towards which gateway it should forward packets for dest x. This is also the job on inter-AS routing protocol!Hot potato routing: send packet towards closest of two routers.

Network Layer 4-46

Learn from inter-AS protocol that subnet x is reachable via multiple gateways

Use routing infofrom intra-AS

protocol to determinecosts of least-cost

paths to eachof the gateways

Hot potato routing:Choose the gateway

that has the smallest least cost

Determine fromforwarding table the interface I that leads

to least-cost gateway. Enter (x,I) in

forwarding table

Page 24: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

24

Chapter 4: Network Layer

4. 1 Introduction4 2 Virtual circuit and

4.5 Routing algorithmsHierarchical routing4.2 Virtual circuit and

datagram networks4.3 What’s inside a router4.4 IP: Internet Protocol

D t f t

Hierarchical routing4.6 Routing in the Internet

RIPOSPFBGP

Network Layer 4-47

Datagram formatIPv4 addressingICMPIPv6

Intra-AS Routing

Also known as Interior Gateway Protocols (IGP)Most common Intra-AS routing protocols:Most common Intra-AS routing protocols:

RIP: Routing Information Protocol

OSPF: Open Shortest Path First

IGRP: Interior Gateway Routing Protocol (Cisco proprietary)

Network Layer 4-48

proprietary)

Page 25: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

25

Chapter 4: Network Layer

4. 1 Introduction4 2 Virtual circuit and

4.5 Routing algorithmsHierarchical routing4.2 Virtual circuit and

datagram networks4.3 What’s inside a router4.4 IP: Internet Protocol

D t f t

Hierarchical routing4.6 Routing in the Internet

RIPOSPFBGP

Network Layer 4-49

Datagram formatIPv4 addressingICMPIPv6

RIP ( Routing Information Protocol)

Distance vector algorithmIncluded in BSD-UNIX Distribution in 1982Included in BSD-UNIX Distribution in 1982Distance metric: # of hops (max = 15 hops)

BA

u vw

destination hopsu 1v 2

From router A to subsets:

Network Layer 4-50

DC

BA

x

yz

w 2x 3y 3z 2

Page 26: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

26

RIP advertisements

Distance vectors: exchanged among neighbors every 30 sec via Response neighbors every 30 sec via Response Message (also called advertisement)Each advertisement: list of up to 25 destination nets within AS

Network Layer 4-51

RIP: Example

w x y

z

Destination Network Next Router Num. of hops to dest.w A 2y B 2

x yA

C

D B

Network Layer 4-52

y B 2z B 7x -- 1…. …. ....

Routing table in D

Page 27: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

27

RIP: Example

z

Dest Next hopsw - 1x - 1z C 4…. … ...

Advertisementfrom A to D

Destination Network Next Router Num. of hops to dest.A 2

w x y

z

A

C

D B

Network Layer 4-53

w A 2y B 2z B A 7 5x -- 1…. …. ....

Routing table in D

RIP: Link Failure and RecoveryIf no advertisement heard after 180 sec -->

neighbor/link declared dead hb l d droutes via neighbor invalidated

new advertisements sent to neighborsneighbors in turn send out new advertisements (if tables changed)link failure info quickly propagates to entire netpoison reverse used to prevent ping-pong loops

Network Layer 4-54

poison reverse used to prevent ping pong loops (infinite distance = 16 hops)

Page 28: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

28

RIP Table processing

RIP routing tables managed by application-levelprocess called route-d (daemon)process called route d (daemon)advertisements sent in UDP packets, periodically repeated

Transprt(UDP)

routed

Transprt(UDP)

routed

Network Layer 4-55

physicallink

network forwarding(IP) table

(UDP)

physicallink

network(IP)

(UDP)forwarding

table

Chapter 4: Network Layer

4. 1 Introduction4 2 Virtual circuit and

4.5 Routing algorithmsHierarchical routing4.2 Virtual circuit and

datagram networks4.3 What’s inside a router4.4 IP: Internet Protocol

D t f t

Hierarchical routing4.6 Routing in the Internet

RIPOSPFBGP

Network Layer 4-56

Datagram formatIPv4 addressingICMPIPv6

Page 29: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

29

OSPF (Open Shortest Path First)

“open”: publicly availableUses Link State algorithm g

LS packet disseminationTopology map at each nodeRoute computation using Dijkstra’s algorithm

OSPF advertisement carries one entry per neighbor router

Network Layer 4-57

Advertisements disseminated to entire AS (via flooding)

Carried in OSPF messages directly over IP (rather than TCP or UDP

OSPF “advanced” features (not in RIP)

Security: all OSPF messages authenticated (to prevent malicious intrusion) prevent malicious intrusion) Multiple same-cost paths allowed (only one path in RIP)For each link, multiple cost metrics for different TOS (e.g., satellite link cost set “low” for best effort; high for real time)I d i d l i

Network Layer 4-58

Integrated uni- and multicast support: Multicast OSPF (MOSPF) uses same topology data base as OSPF

Hierarchical OSPF in large domains.

Page 30: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

30

Hierarchical OSPF

Network Layer 4-59

Hierarchical OSPF

Two-level hierarchy: local area, backbone.Link-state advertisements only in area yeach nodes has detailed area topology; only know direction (shortest path) to nets in other areas.

Area border routers: “summarize” distances to nets in own area, advertise to other Area Border routers.Backbone routers: run OSPF routing limited to backbone

Network Layer 4-60

backbone.Boundary routers: connect to other AS’s.

Page 31: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

31

Chapter 4: Network Layer

4. 1 Introduction4 2 Virtual circuit and

4.5 Routing algorithmsHierarchical routing4.2 Virtual circuit and

datagram networks4.3 What’s inside a router4.4 IP: Internet Protocol

D t f t

Hierarchical routing4.6 Routing in the Internet

RIPOSPFBGP

Network Layer 4-61

Datagram formatIPv4 addressingICMPIPv6

Internet inter-AS routing: BGP

BGP (Border Gateway Protocol): the de facto standardfacto standardBGP provides each AS a means to:1. Obtain subnet reachability information from

neighboring ASs.2. Propagate the reachability information to all

routers internal to the AS.3 Determine “good” routes to subnets based on

Network Layer 4-62

3. Determine good routes to subnets based on reachability information and policy.

Allows a subnet to advertise its existence to rest of the Internet: “I am here”

Page 32: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

32

BGP basicsPairs of routers (BGP peers) exchange routing info over semi-permanent TCP conctns: BGP sessionsNote that BGP sessions do not correspond to physical links.When AS2 advertises a prefix to AS1, AS2 is promising it will f d d d i d h fi d h forward any datagrams destined to that prefix towards the prefix.

AS2 can aggregate prefixes in its advertisement

3b3a

2a2c

3c

Network Layer 4-63

3b

1d

1c2aAS3

AS1

AS21a

2b

1b

eBGP session

iBGP session

Distributing reachability infoWith eBGP session between 3a and 1c, AS3 sends prefix reachability info to AS1.1c can then use iBGP do distribute this new prefix reach info to all routers in AS11b th d ti th h i f t AS2 th 1b can then re-advertise the new reach info to AS2 over the 1b-to-2a eBGP sessionWhen router learns about a new prefix, it creates an entry for the prefix in its forwarding table.

3b3a

22c

3c

Network Layer 4-64

3b

1d

1c2aAS3

AS1

AS21a

2b

1b

eBGP session

iBGP session

Page 33: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

33

Path attributes & BGP routes

When advertising a prefix, advert includes BGP attributes. attributes.

prefix + attributes = “route”Two important attributes:

AS-PATH: contains the ASs through which the advert for the prefix passed: AS 67 AS 17 NEXT-HOP: Indicates the specific internal-AS router to next-hop AS. (There may be multiple links from current

h )

Network Layer 4-65

AS to next-hop-AS.)When gateway router receives route advert, uses import policy to accept/decline.

BGP route selection

Router may learn about more than 1 route to some prefix Router must select routeto some prefix. Router must select route.Elimination rules:

1. Local preference value attribute: policy decision

2. Shortest AS-PATH 3 Closest NEXT-HOP router: hot potato routing

Network Layer 4-66

3. Closest NEXT HOP router: hot potato routing4. Additional criteria

Page 34: Mecanismes d’Echange d’Informations Chapter 4 Network Layer Network Layer.pdf · Chapter 4: Network Layer 4. 1 Introduction 42 Virtual circuit and 4.5 Routing algorithms 4.2 Virtual

19/05/2008

34

BGP messages

BGP messages exchanged using TCP.BGP messages:BGP messages

OPEN: opens TCP connection to peer and authenticates senderUPDATE: advertises new path (or withdraws old)KEEPALIVE keeps connection alive in absence of UPDATES; also ACKs OPEN requestNOTIFICATION i i

Network Layer 4-67

NOTIFICATION: reports errors in previous msg; also used to close connection

Why different Intra- and Inter-AS routing ?

Policy:Inter-AS: admin wants control over how its traffic routed, who routes through its net. Intra-AS: single admin, so no policy decisions needed

Scale:hierarchical routing saves table size, reduced update traffic

P f

Network Layer 4-68

Performance:Intra-AS: can focus on performanceInter-AS: policy may dominate over performance