chapter 4: network layer

74
1 Chapter 4: Network Layer Chapter goals: Chapter goals: understand understand principles behind principles behind network layer network layer services: services: routing (path routing (path selection) selection) dealing with scale dealing with scale how a router works how a router works advanced topics: advanced topics: IPv6, multicast IPv6, multicast instantiation and instantiation and implementation in implementation in the Internet the Internet Overview: Overview: network layer services network layer services routing principle: path routing principle: path selection selection hierarchical routing hierarchical routing IP IP Internet routing protocols Internet routing protocols reliable transfer reliable transfer intra-domain intra-domain inter-domain inter-domain what’s inside a router? what’s inside a router? IPv6 IPv6 multicast routing multicast routing

Upload: morgan-durham

Post on 30-Dec-2015

54 views

Category:

Documents


1 download

DESCRIPTION

Chapter goals: understand principles behind network layer services: routing (path selection) dealing with scale how a router works advanced topics: IPv6, multicast instantiation and implementation in the Internet. Overview: network layer services routing principle: path selection - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Chapter 4: Network Layer

1

Chapter 4: Network Layer

Chapter goals:Chapter goals: understand principles understand principles behind network layer behind network layer services:services:• routing (path selection)routing (path selection)

• dealing with scaledealing with scale

• how a router workshow a router works

• advanced topics: IPv6, advanced topics: IPv6, multicastmulticast

instantiation and instantiation and implementation in the implementation in the InternetInternet

Overview:Overview:network layer servicesnetwork layer services

routing principle: path routing principle: path selectionselection

hierarchical routinghierarchical routing

IPIP

Internet routing protocols Internet routing protocols reliable transferreliable transfer• intra-domainintra-domain

• inter-domaininter-domain

what’s inside a router?what’s inside a router?

IPv6IPv6

multicast routingmulticast routing

Page 2: Chapter 4: Network Layer

2

Network layer functions

transport packet from transport packet from sending to receiving hosts sending to receiving hosts network layer protocols in network layer protocols in everyevery host, router host, router

three important functions:three important functions:path determination:path determination: route route taken by packets from taken by packets from source to dest. source to dest. Routing Routing algorithmsalgorithmsswitching:switching: move packets move packets from router’s input to from router’s input to appropriate router outputappropriate router outputcall setup:call setup: some network some network architectures require router architectures require router call setup along path before call setup along path before data flowsdata flows

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

network data link

physical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

applicationtransportnetworkdata linkphysical

applicationtransportnetworkdata linkphysical

Page 3: Chapter 4: Network Layer

3

Network service model

Q:Q: What What service modelservice model for for “channel” transporting “channel” transporting packets from sender to packets from sender to receiver?receiver?guaranteed bandwidth?guaranteed bandwidth?

preservation of inter-packet preservation of inter-packet timing (no jitter)?timing (no jitter)?

loss-free delivery?loss-free delivery?

in-order delivery?in-order delivery?

congestion feedback to congestion feedback to sender?sender?

? ??virtual circuit

or datagram?

The most important abstraction provided

by network layer:

serv

ice a

bst

ract

ion

Page 4: Chapter 4: Network Layer

4

Virtual circuits

call setup, teardown for each call call setup, teardown for each call beforebefore data can flow data can floweach packet carries VC identifier (not destination host OD)each packet carries VC identifier (not destination host OD)everyevery router on source-dest path s maintain “state” for each passing router on source-dest path s maintain “state” for each passing connectionconnection• transport-layer connection only involved two end systemstransport-layer connection only involved two end systems

link, router resources (bandwidth, buffers) may be link, router resources (bandwidth, buffers) may be allocated allocated to VCto VC• to get circuit-like perf.to get circuit-like perf.

““source-to-dest path behaves much like telephone source-to-dest path behaves much like telephone circuit”circuit”• performance-wiseperformance-wise• network actions along source-to-dest pathnetwork actions along source-to-dest path

Page 5: Chapter 4: Network Layer

5

Virtual circuits: signaling protocols

used to setup, maintain teardown VCused to setup, maintain teardown VCused in ATM, frame-relay, X.25used in ATM, frame-relay, X.25not used in today’s Internetnot used in today’s Internet

applicationtransportnetworkdata linkphysical

applicationtransportnetworkdata linkphysical

1. Initiate call 2. incoming call

3. Accept call4. Call connected5. Data flow begins 6. Receive data

Page 6: Chapter 4: Network Layer

6

Datagram networks: the Internet model

no call setup at network layerno call setup at network layerrouters: no state about end-to-end connectionsrouters: no state about end-to-end connections• no network-level concept of “connection”no network-level concept of “connection”

packets typically routed using destination host IDpackets typically routed using destination host ID• packets between same source-dest pair may take different packets between same source-dest pair may take different

pathspaths

applicationtransportnetworkdata linkphysical

applicationtransportnetworkdata linkphysical

1. Send data 2. Receive data

Page 7: Chapter 4: Network Layer

7

Datagram or VC network: why?

InternetInternetdata exchange among data exchange among computerscomputers• ““elastic” service, no strict elastic” service, no strict

timing req. timing req. ““smart” end systems smart” end systems (computers)(computers)• can adapt, perform control, can adapt, perform control,

error recoveryerror recovery• simple inside network, simple inside network,

complexity at “edge”complexity at “edge”many link types many link types • different characteristicsdifferent characteristics• uniform service difficultuniform service difficult

ATMATMevolved from telephonyevolved from telephony

human conversation: human conversation: • strict timing, reliability strict timing, reliability

requirementsrequirements• need for guaranteed need for guaranteed

serviceservice

““dumb” end systemsdumb” end systems• telephonestelephones• complexity inside complexity inside

networknetwork

Page 8: Chapter 4: Network Layer

8

Routing

Graph abstraction for Graph abstraction for routing algorithms:routing algorithms:

graph nodes are graph nodes are routersrouters

graph edges are graph edges are physical linksphysical links• link cost: delay, $ cost, or link cost: delay, $ cost, or

congestion levelcongestion level

Goal: determine “good” path

(sequence of routers) thru network from source to

dest.

Routing protocol

A

ED

CB

F

2

2

13

1

1

2

53

5

“good” path:typically means minimum cost pathother def’s possible

Page 9: Chapter 4: Network Layer

9

Routing Algorithm classification

Global or decentralized Global or decentralized information?information?

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

Decentralized:Decentralized: router knows physically-router knows physically-connected neighbors, link connected neighbors, link costs to neighborscosts to neighborsiterative process of iterative process of computation, exchange of computation, exchange of info with neighborsinfo with neighbors““distance vector” distance vector” algorithmsalgorithms

Static or dynamic?Static or dynamic?Static:Static:

route selection based on route selection based on static metrics (hop count)static metrics (hop count)

Dynamic:Dynamic:

Route selection based on Route selection based on performance metrics performance metrics (traffic load, delay, queue (traffic load, delay, queue size)size)• periodic updateperiodic update• in response to link cost in response to link cost

changeschanges

Page 10: Chapter 4: Network Layer

10

Two fundamental routing approaches

Link State:Link State:• Each node knows the whole graphEach node knows the whole graph• Advertise each link to everybodyAdvertise each link to everybody• Find path by running the same algorithmFind path by running the same algorithm

Distance Vector:Distance Vector:• Each node has a vector of distances to all others nodesEach node has a vector of distances to all others nodes• Advertise only your vector of distances to Advertise only your vector of distances to neighborsneighbors

Forward info only if your vector of distance changedForward info only if your vector of distance changed• Determine next hop according to distanceDetermine next hop according to distance

Each node only is aware of the next hopEach node only is aware of the next hop

Page 11: Chapter 4: Network Layer

11

Distance Vector Routing Algorithm

iterative:iterative:continues until no continues until no nodes exchange info.nodes exchange info.self-terminatingself-terminating: no : no “signal” to stop“signal” to stop

asynchronous:asynchronous:nodes need nodes need notnot exchange info/iterate exchange info/iterate in lock step!in lock step!

distributed:distributed:each node each node communicates communicates onlyonly with directly-attached with directly-attached neighborsneighbors

Distance Table data structureDistance Table data structure each node has its owneach node has its ownrow for each possible row for each possible destinationdestinationcolumn for each directly-column for each directly-attached neighbor to nodeattached neighbor to nodeexample: in node X, for dest. Y example: in node X, for dest. Y via neighbor Z:via neighbor Z:

D (Y,Z)X

distance from X toY, via Z as next hop

c(X,Z) + min {D (Y,w)}Z

w

=

=

Page 12: Chapter 4: Network Layer

12

Main Idea

My shortest path thru each neighbor to XMy shortest path thru each neighbor to X• Shortest path from a neighbor to XShortest path from a neighbor to X• Plus my cost to reach the neighborPlus my cost to reach the neighbor

My shortest path overall My shortest path overall • minimum among shortest path from each neighborminimum among shortest path from each neighbor

A

Edge + Shortest Path

Page 13: Chapter 4: Network Layer

13

Distance Table: example

A

E D

CB7

8

1

2

1

2D ()

A

B

C

D

A

1

7

6

4

B

14

8

9

11

D

5

5

4

2

EVia

dest

inat

ion

D (C,D)E

c(E,D) + min {D (C,w)}D

w== 2+2 = 4

From node E: to go to CWhat is the cost thru D?

Page 14: Chapter 4: Network Layer

14

Distance table gives routing table

D ()

A

B

C

D

A

1

7

6

4

B

14

8

9

11

D

5

5

4

2

Ecost to destination via

dest

inat

ion

A

B

C

D

A,1

D,5

D,4

D,2

Outgoing link to use, cost

dest

inat

ion

Distance table Routing table

Page 15: Chapter 4: Network Layer

15

Distance Vector Routing: overview

Iterative, asynchronous: Iterative, asynchronous: each local iteration caused each local iteration caused by: by: local link cost change local link cost change message from neighbor: message from neighbor: its least cost path change its least cost path change from neighborfrom neighbor

Distributed:Distributed:each node notifies each node notifies neighbors neighbors onlyonly when its when its least cost path to any least cost path to any destination changesdestination changes• neighbors then notify their neighbors then notify their

neighbors if necessaryneighbors if necessary

wait for (change in local link cost or msg from neighbor)

recompute distance table

if least cost path to any dest

has changed, notify neighbors

Each node:

Page 16: Chapter 4: Network Layer

16

Distance Vector: link cost changes

Link cost changes:1. node detects local link cost change updates distance table (line 15)2. if cost change in least cost path, notify neighbors (lines 23,24)

X Z14

50

Y1

algorithmterminates“good

news travelfast”

Y

Z

Page 17: Chapter 4: Network Layer

17

Distance Vector: link cost changes

Link cost changes:bad news travels slow - “count to infinity” problem X Z

14

50

Y60

algorithmcontinues

on!

Page 18: Chapter 4: Network Layer

18

Distance Vector: poisoned reverse

Poison Reverse:Poison Reverse: If Z routes through Y to get to X :Z tells Y its distance to X is infinite (so Y won’t route to X via Z)

Split Horizon:Split Horizon: don’t advertise at all distance to next hop neighbor (for path)

X Z14

50

Y60

algorithmterminates

Page 19: Chapter 4: Network Layer

19

Link-State Routing Algorithm

Net topology, link costs known to all nodesNet topology, link costs known to all nodes• accomplished via “link state broadcast” accomplished via “link state broadcast” • all nodes have same infoall nodes have same info

Each node computes locally: cost paths from Each node computes locally: cost paths from to all other nodesto all other nodes• gives gives routing tablerouting table for that node for that node

Page 20: Chapter 4: Network Layer

20

Dijkstra’s algorithm, discussion

Algorithm complexity: Algorithm complexity: n nodesn nodes

each iteration: need to check all nodes, w, not in Neach iteration: need to check all nodes, w, not in N

n*(n+1)/2 comparisons: O(n**2)n*(n+1)/2 comparisons: O(n**2)

more efficient implementations possible: O(nlogn)more efficient implementations possible: O(nlogn)

Oscillations possible:Oscillations possible:

if link cost = amount of carried trafficif link cost = amount of carried traffic

Page 21: Chapter 4: Network Layer

21

Link State Routing

Initial state : similar to distance vector i.e., state of link Initial state : similar to distance vector i.e., state of link to neighbors known (up/down).to neighbors known (up/down).Goal: To find the path of least cost to destination.Goal: To find the path of least cost to destination.Basic Idea -- Basic Idea -- • Every node knows how to reach its neighbors.Every node knows how to reach its neighbors.• Disseminate the info is disseminated to every node, Disseminate the info is disseminated to every node, • every node has the complete map of the networkevery node has the complete map of the network• All nodes execute the same algorithm for pathsAll nodes execute the same algorithm for paths

Page 22: Chapter 4: Network Layer

22

Two Mechanisms

Reliable dissemination of link state Reliable dissemination of link state information information • The process is called reliable flooding.The process is called reliable flooding.

Calculation of routes using the collected Calculation of routes using the collected information information • The computation is based on Dijkstra’s algorithm.The computation is based on Dijkstra’s algorithm.

Page 23: Chapter 4: Network Layer

23

Reliable Flooding

Process of making sure that all the nodes Process of making sure that all the nodes participating in the link state routing protocol get a participating in the link state routing protocol get a copy of the link-state info. from all other nodes.copy of the link-state info. from all other nodes.Each node sends out link-state info. on its directly Each node sends out link-state info. on its directly connected links.connected links.Each node that receives this, forwards it to all links Each node that receives this, forwards it to all links • except the incoming one.except the incoming one.

Page 24: Chapter 4: Network Layer

24

Link State Information

Each node creates a link-state packet (LSP) Each node creates a link-state packet (LSP) that contains:that contains:• ID of the node that created LSPID of the node that created LSP• a list of directly connected nodes and the cost to a list of directly connected nodes and the cost to

each node.each node.• sequence numbersequence number• TTL TTL } for

reliability

Page 25: Chapter 4: Network Layer

25

An Example

X receives info from node X receives info from node Y.Y.X checks to see if it already X checks to see if it already has an update for that link. has an update for that link. If it does, it compares the If it does, it compares the sequence number in the sequence number in the new LSP to the one stored.new LSP to the one stored.If New seq no < Old If New seq no < Old sequence number, then, sequence number, then, discard LSP.discard LSP.Else -- store LSP and send Else -- store LSP and send the LSP to all neighbors the LSP to all neighbors except the one that sent the except the one that sent the LSP.LSP.

(a)

X A

C B D

(b)

X A

C B D

(c)

X A

C B D

(d)

X A

C B D

Page 26: Chapter 4: Network Layer

26

Dissemination of LSPs

LSPs are sent LSPs are sent • periodically (upon the expiry of a timer order of hours)periodically (upon the expiry of a timer order of hours)• Or may be triggered due to a change in topology (as in RIP).Or may be triggered due to a change in topology (as in RIP).

Topology change in a directly connected linkTopology change in a directly connected link• Failures detected by link layer protocol by using what are known Failures detected by link layer protocol by using what are known

as “HELLO” packets -- probes to determine if neighbor is alive.as “HELLO” packets -- probes to determine if neighbor is alive.

Sequence numbers help in identifying new info and Sequence numbers help in identifying new info and TTL helps in ensuring that packets don’t percolate in TTL helps in ensuring that packets don’t percolate in the network indefinitely.the network indefinitely.

Page 27: Chapter 4: Network Layer

27

Graph abstraction

Used for computation of shortest path using Dijkstra’s.Used for computation of shortest path using Dijkstra’s.

Let N denote the set of nodes in the graph.Let N denote the set of nodes in the graph.

l(i,j) denotes the non-negative cost or weight associated with l(i,j) denotes the non-negative cost or weight associated with the edge between nodes i and j.the edge between nodes i and j.

l(i,j) = ∞ if there is no edge between i and j.l(i,j) = ∞ if there is no edge between i and j.

Remember -- each node has entire map of network.Remember -- each node has entire map of network.

Page 28: Chapter 4: Network Layer

28

The Dijkstra’s Algorithm

Let “s” the node that executes the algorithm.Let “s” the node that executes the algorithm.

Algorithm maintains M --> set of nodes whose shorter path I foundAlgorithm maintains M --> set of nodes whose shorter path I found

C(n) -- cost of the path from s to n.C(n) -- cost of the path from s to n.

L(v,w) cost of link from v to wL(v,w) cost of link from v to w

Reminder of Dijkstra algorithmReminder of Dijkstra algorithm

M = {s} M = {s}

for each node n in N- {s}, C(n) = L(s,n);for each node n in N- {s}, C(n) = L(s,n);

while (N ≠M), while (N ≠M),

find node w in N - M, with cost C(w)find node w in N - M, with cost C(w)

M = M U {w}M = M U {w}

for each n in (N-M)for each n in (N-M)

C(n) = min( C(n), C(w) + L(w,n) )C(n) = min( C(n), C(w) + L(w,n) )

Found

Candidates

Not Reached

Page 29: Chapter 4: Network Layer

29

An Example

D

A

B

C

5 3

211

10

• Let s = A.

• Initially M = A.

• Now, minimum cost node is B (note that only two nodes can be considered). So add B to M.• At next step, look at

neighbors of A and B (we have C and D). We add C (via B).

•Then, we consider D, (note that we consider the link via C as well -- finally that is added.

• Finally, the tree with links AB, BC and CD is created.

Page 30: Chapter 4: Network Layer

30

Routing Oscillations with dynamic weights

If link weight is dynamic (function of load)If link weight is dynamic (function of load)

Paths can change after we routePaths can change after we route• Example: D,C,B send traffic to A continuouslyExample: D,C,B send traffic to A continuously• Once we route, best path changes!Once we route, best path changes!

A

D

C

B1 1+e

e0

e

1 1

0 0

A

D

C

B2+e 0

001+e1

A

D

C

B0 2+e

1+e10 0

InitiallyD,C,B send traffic to A

… recomputeRouting

Cost of links changes

… recompute

Page 31: Chapter 4: Network Layer

31

Two fundamental routing approaches

Link State:Link State:• Each node knows the whole graphEach node knows the whole graph• Advertise each link to everybodyAdvertise each link to everybody• Find path by running the same algorithmFind path by running the same algorithm

Distance Vector:Distance Vector:• Each node has a vector of distances to all othersEach node has a vector of distances to all others• Advertise only your vector of distances to Advertise only your vector of distances to neighborsneighbors

Forward info only if your vector of distance changedForward info only if your vector of distance changed• Determine next hop according to distanceDetermine next hop according to distance

Each node only is aware of the next hopEach node only is aware of the next hop

Page 32: Chapter 4: Network Layer

32

Topology information is Topology information is floodedflooded within the routing within the routing domaindomainBest end-to-end paths are Best end-to-end paths are computed locally at each computed locally at each router. router. Best end-to-end paths Best end-to-end paths determine next-hops.determine next-hops.Advertises: link infoAdvertises: link infoWorks only if policy is Works only if policy is sharedshared and and uniformuniformExamples: OSPF, IS-ISExamples: OSPF, IS-IS

Each router knows little Each router knows little about network topologyabout network topologyOnly best next-hops are Only best next-hops are chosen by each router for chosen by each router for each destination network. each destination network. Best end-to-end paths Best end-to-end paths result from composition of result from composition of all next-hop choicesall next-hop choicesAdvertises: path info, Advertises: path info, distancedistanceDoes not require uniform Does not require uniform policies at all routerspolicies at all routersExamples: RIP, BGPExamples: RIP, BGP

Link State Vectoring

Summary: Distributed Routing Techniques

Page 33: Chapter 4: Network Layer

33

Routing in the Global Internet

Page 34: Chapter 4: Network Layer

34

Hierarchical Routing

scale:scale: with 50 million with 50 million destinations:destinations:can’t store all dest’s in can’t store all dest’s in routing tables!routing tables!

routing table exchange routing table exchange would swamp links!would swamp links!

administrative autonomyadministrative autonomyinternet = network of internet = network of networksnetworks

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

Our routing study thus far - idealization all routers identicalnetwork “flat”… not true in practice

Page 35: Chapter 4: Network Layer

35

Hierarchical Routing

Aggregate routers into Aggregate routers into regions,regions, “autonomous “autonomous systems” (AS)systems” (AS)

Routers in same AS run Routers in same AS run same routing protocolsame routing protocol• ““intra-AS” routingintra-AS” routing protocol protocol• different AS can run different AS can run

different intra-AS protocoldifferent intra-AS protocol

Aggregatable addressesAggregatable addresses

special routers in ASspecial routers in AS

run intra-AS routing run intra-AS routing protocol with all other protocol with all other routers in ASrouters in AS

alsoalso responsible for responsible for routing to destinations routing to destinations outside ASoutside AS• run run inter-AS routinginter-AS routing

protocol with other protocol with other gateway routersgateway routers

gateway routers

Page 36: Chapter 4: Network Layer

36

IP Addressing: introduction

IP address:IP address: 32-bit 32-bit identifier for host, identifier for host, router router interfaceinterface interface:interface: connection connection between host, router between host, router and physical linkand physical link• router’s typically have router’s typically have

multiple interfacesmultiple interfaces• host may have multiple host may have multiple

interfacesinterfaces• IP addresses IP addresses

associated with associated with interface, not host, interface, not host, routerrouter

223.1.1.1

223.1.1.2

223.1.1.3

223.1.1.4 223.1.2.9

223.1.2.2

223.1.2.1

223.1.3.2223.1.3.1

223.1.3.27

223.1.1.1 = 11011111 00000001 00000001 00000001

223 1 11

Page 37: Chapter 4: Network Layer

37

IP Addressing

IP address:IP address: • network part (high order network part (high order

bits)bits)• host part (low order bits) host part (low order bits)

What’s a network ? What’s a network ? ((from IP address from IP address perspective)perspective)• device interfaces with device interfaces with

same network part of IP same network part of IP addressaddress

• can physically reach can physically reach each other without each other without intervening routerintervening router

223.1.1.1

223.1.1.2

223.1.1.3

223.1.1.4 223.1.2.9

223.1.2.2

223.1.2.1

223.1.3.2223.1.3.1

223.1.3.27

network consisting of 3 IP networks(for IP addresses starting with 223, first 24 bits are network address)

LAN

Page 38: Chapter 4: Network Layer

38

IP Addressing

How to find the How to find the networks?networks?

Detach each interface Detach each interface from router, hostfrom router, host

create “islands of create “islands of isolated networksisolated networks

223.1.1.1

223.1.1.3

223.1.1.4

223.1.2.2223.1.2.1

223.1.2.6

223.1.3.2223.1.3.1

223.1.3.27

223.1.1.2

223.1.7.0

223.1.7.1223.1.8.0

223.1.8.1

223.1.9.1

223.1.9.2

Interconnected system consisting

of six networks

Page 39: Chapter 4: Network Layer

39

IP Addresses

0network host

10 network host

110 network host

1110 multicast address

A

B

C

D

class1.0.0.0 to127.255.255.255

128.0.0.0 to191.255.255.255

192.0.0.0 to223.255.255.255

224.0.0.0 to239.255.255.255

32 bits

given notion of “network”, let’s re-examine IP addresses:given notion of “network”, let’s re-examine IP addresses:

““class-full” class-full” addressing:addressing:

Page 40: Chapter 4: Network Layer

40

IP addressing: need for change

Problems with classful addressing: Problems with classful addressing: • inefficient use of address space, address space inefficient use of address space, address space

exhaustionexhaustion• e.g., class B net allocated enough addresses for 65K e.g., class B net allocated enough addresses for 65K

hosts, even if only 2K hosts in that networkhosts, even if only 2K hosts in that network

Page 41: Chapter 4: Network Layer

41

IP addressing: CIDR

CIDR:CIDR: CClassless lassless IInternterDDomain omain RRoutingoutingnetwork portion of address of arbitrary network portion of address of arbitrary lengthlength

address format: address format: a.b.c.d/xa.b.c.d/x, where x is # bits in , where x is # bits in network portion of addressnetwork portion of address

11001000 00010111 00010000 00000000

networkpart

hostpart

200.23.16.0/23

Page 42: Chapter 4: Network Layer

42

IP Addresses and Prefixes

IP addresses have 32 bits: 4 octets of bits IP addresses have 32 bits: 4 octets of bits (IPv4)(IPv4)

A prefix is a group of IP addressesA prefix is a group of IP addresses

128.32.101.5 is an IP address (32 bits)128.32.101.5 is an IP address (32 bits)

128.32.0.0/16 is a prefix of the 16 first bits:128.32.0.0/16 is a prefix of the 16 first bits:• 128.32.0.0 – 128.32.255.255 (2^16 addresses)128.32.0.0 – 128.32.255.255 (2^16 addresses)

128.32.4.0/24 is a prefix of the 24 first bits - 128.32.4.0/24 is a prefix of the 24 first bits - longerlonger

Page 43: Chapter 4: Network Layer

43

IP addresses: how to get one?

Hosts (host portion):Hosts (host portion):

hard-coded by system admin in a filehard-coded by system admin in a file

DHCP:DHCP: DDynamic ynamic HHost ost CConfiguration onfiguration PProtocol: rotocol: dynamically get address: “plug-and-play”dynamically get address: “plug-and-play”• host broadcasts “host broadcasts “DHCP discoverDHCP discover” msg” msg• DHCP server responds with “DHCP server responds with “DHCP offerDHCP offer” msg” msg• host requests IP address: “host requests IP address: “DHCP requestDHCP request” msg” msg• DHCP server sends address: “DHCP server sends address: “DHCP ackDHCP ack” msg ” msg

Page 44: Chapter 4: Network Layer

44

IP addresses: how to get one?

Network (network portion):Network (network portion):

get allocated portion of ISP’s address get allocated portion of ISP’s address space: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

Organization 2 11001000 00010111 00010100 00000000 200.23.20.0/23 ... ….. …. ….

Organization 7 11001000 00010111 00011110 00000000 200.23.30.0/23

Page 45: Chapter 4: Network Layer

45

Hierarchical addressing: route aggregation

“Send me anythingwith addresses beginning 200.23.16.0/20”

200.23.16.0/23

200.23.18.0/23

200.23.30.0/23

Fly-By-Night-ISP

Organization 0

Organization 7

Internet

Organization 1

ISPs-R-Us“Send me anythingwith addresses beginning 199.31.0.0/16”

200.23.20.0/23Organization 2

...

...

Hierarchical addressing allows efficient advertisement of routing information:

Page 46: Chapter 4: Network Layer

46

Hierarchical addressing: more specific routes

ISPs-R-Us has a more specific route to Organization 1

“Send me anythingwith addresses beginning 200.23.16.0/20”

200.23.16.0/23

200.23.18.0/23

200.23.30.0/23

Fly-By-Night-ISP

Organization 0

Organization 7

Internet

Organization 1

ISPs-R-Us“Send me anythingwith addresses beginning 199.31.0.0/16or 200.23.18.0/23”

200.23.20.0/23Organization 2

...

...

Page 47: Chapter 4: Network Layer

47

Routing is Based on Prefixes

A BGP Routing table has prefixes for entriesA BGP Routing table has prefixes for entries

For a IP address of a packet, find For a IP address of a packet, find longest matchlongest match

Example: packet IP 128.32.101.1Example: packet IP 128.32.101.1

Matching:Matching:

128.1.1.4 matches the first 8 bits – no match!128.1.1.4 matches the first 8 bits – no match!

128.32.0.0/16 match for 16 bits128.32.0.0/16 match for 16 bits

128.32.101.0/24 is a longer match 128.32.101.0/24 is a longer match

Page 48: Chapter 4: Network Layer

48

Prefix Matching in More Detail

For a IP address of a packet, find For a IP address of a packet, find longest matchlongest matchExample: Compare Example: Compare • packet IP 128.32.101.1packet IP 128.32.101.1• With 128.32.0.0/16With 128.32.0.0/16• IP : 01000000. 001000000. 01100101 .00000001IP : 01000000. 001000000. 01100101 .00000001• Mask : 11111111. 111111111. 00000000 .00000000Mask : 11111111. 111111111. 00000000 .00000000• AND : 01000000. 001000000. 00000000 .00000000AND : 01000000. 001000000. 00000000 .00000000• Prefix : 01000000. 001000000. 00000000. 00000000Prefix : 01000000. 001000000. 00000000. 00000000• Equal? YesEqual? Yes• We have a match of length 16We have a match of length 16

Page 49: Chapter 4: Network Layer

49

IP addressing: the last word...

Q:Q: How does an ISP get block of addresses? How does an ISP get block of addresses?

A:A: ICANN ICANN: : IInternet nternet CCorporation for orporation for AAssigned ssigned

NNames and ames and NNumbersumbers• allocates addressesallocates addresses• manages DNSmanages DNS• assigns domain names, resolves disputesassigns domain names, resolves disputes

Page 50: Chapter 4: Network Layer

50

ICMP: Reporting errors

What happens if things cannot proceed as What happens if things cannot proceed as expected?expected?ICMP: Internet Control Message ProtocolICMP: Internet Control Message ProtocolUsed by hosts, routers, gateways to Used by hosts, routers, gateways to communication network-level informationcommunication network-level information• error reporting: unreachable host, network, error reporting: unreachable host, network,

port, protocolport, protocol• echo request/reply (used by ping)echo request/reply (used by ping)

Page 51: Chapter 4: Network Layer

51

ICMP: Internet Control Message Protocol

Network-layer “above” Network-layer “above” IP:IP:• ICMP msgs carried in ICMP msgs carried in

IP datagramsIP datagramsICMP message:ICMP message: type, type, code plus first 8 bytes code plus first 8 bytes of IP datagram causing of IP datagram causing errorerror

Type Code description0 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)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header

Page 52: Chapter 4: Network Layer

52

Let’s see how things work in practice

Page 53: Chapter 4: Network Layer

53

Getting a datagram from source to dest.

IP datagram:IP datagram:

223.1.1.1

223.1.1.2

223.1.1.3

223.1.1.4 223.1.2.9

223.1.2.2

223.1.2.1

223.1.3.2223.1.3.1

223.1.3.27

A

BE

miscfields

sourceIP addr

destIP addr data

datagram remains unchanged, as it travels source to destinationaddr fields of interest here

Dest. Net. next router Nhops

223.1.1 1223.1.2 223.1.1.4 2223.1.3 223.1.1.4 2

routing table in A

Page 54: Chapter 4: Network Layer

54

Getting a datagram from source to dest.

Starting at A, given IP datagram addressed to B:look up net. address of Bfind B is on same net. as Alink layer will send datagram directly to B inside link-layer frame

B and A are directly connected

Dest. Net. next router Nhops

223.1.1 1223.1.2 223.1.1.4 2223.1.3 223.1.1.4 2

miscfields223.1.1.1223.1.1.3data

223.1.1.1

223.1.1.2

223.1.1.3

223.1.1.4 223.1.2.9

223.1.2.2

223.1.2.1

223.1.3.2223.1.3.1

223.1.3.27

A

BE

Page 55: Chapter 4: Network Layer

55

Getting a datagram from source to dest.

223.1.1.1

223.1.1.2

223.1.1.3

223.1.1.4 223.1.2.9

223.1.2.2

223.1.2.1

223.1.3.2223.1.3.1

223.1.3.27

A

BE

Dest. Net. next router Nhops

223.1.1 1223.1.2 223.1.1.4 2223.1.3 223.1.1.4 2

Starting at A, dest. E:look up network address of EE on different network

A, E not directly attachedrouting table: next hop router to E is 223.1.1.4 link layer sends datagram to router 223.1.1.4 inside link-layer framedatagram arrives at 223.1.1.4 continued…..

miscfields223.1.1.1223.1.2.2 data

Page 56: Chapter 4: Network Layer

56

Getting a datagram from source to dest.

223.1.1.1

223.1.1.2

223.1.1.3

223.1.1.4 223.1.2.9

223.1.2.2

223.1.2.1

223.1.3.2223.1.3.1

223.1.3.27

A

BE

Arriving at 223.1.4, destined for 223.1.2.2look up network address of EE on same network as router’s

interface 223.1.2.9 router, E directly attached

link layer sends datagram to 223.1.2.2 inside link-layer frame via interface

223.1.2.9 datagram arrives at 223.1.2.2!!! (hooray!)

miscfields223.1.1.1223.1.2.2 data network router Nhops interface

223.1.1 - 1 223.1.1.4 223.1.2 - 1 223.1.2.9

223.1.3 - 1 223.1.3.27

Dest. next

Page 57: Chapter 4: Network Layer

57

Intra-AS and Inter-AS routingGateways:

•perform inter-AS routing amongst themselves•perform intra-AS routers with other routers in their AS

inter-AS, intra-AS routing in

gateway A.c

network layer

link layer

physical layer

a

b

b

aaC

A

Bd

A.a

A.c

C.bB.a

cb

c

Page 58: Chapter 4: Network Layer

58

Intra-AS and Inter-AS routing

Host h2a

b

b

aaC

A

Bd c

A.a

A.c

C.bB.a

cb

Hosth1

Intra-AS routingwithin AS A

Inter-AS routingbetween A and B

Intra-AS routingwithin AS B

We’ll examine specific inter-AS and intra-AS Internet routing protocols shortly

Page 59: Chapter 4: Network Layer

59

The Internet Network layer

routingtable

Host, router network layer functions:Host, router network layer functions:

Routing protocols•path selection•RIP, OSPF, BGP

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

ICMP protocol•error reporting•router “signaling”

Transport layer: TCP, UDP

Link layer

physical layer

Networklayer

Page 60: Chapter 4: Network Layer

60

Measurements in the Internet

Difficulties in measuringDifficulties in measuring

Measuring tools (traceroute)Measuring tools (traceroute)

Misc issuesMisc issues

Page 61: Chapter 4: Network Layer

61

Measuring and Modeling Is not Easy

Constantly changing environmentConstantly changing environment

How much data is enoughHow much data is enough• Recently: we need to measure more than 24h!Recently: we need to measure more than 24h!

How frequently should I be measuring?How frequently should I be measuring?

Are the measurements representative?Are the measurements representative?

Page 62: Chapter 4: Network Layer

62

Operation versus Measurements

Operators do not care about Operators do not care about • MeasurementsMeasurements• Academic ResearchAcademic Research

Why?Why?• Takes away resourcesTakes away resources• Can create problemsCan create problems• Complicates their livesComplicates their lives

Luckily, there are measurement centersLuckily, there are measurement centers• CAIDA, NLANR, routeviews, RIPECAIDA, NLANR, routeviews, RIPE

Page 63: Chapter 4: Network Layer

63

Types of Measurement Tools

Application level:Application level:• Install application agents at two measuring entriesInstall application agents at two measuring entries• REALITI tool from UCRREALITI tool from UCR• More control over processMore control over process

Network level: Network level: • Use the Internet control functionality (ICMP)Use the Internet control functionality (ICMP)• Trick the network to provide informationTrick the network to provide information

Page 64: Chapter 4: Network Layer

64

Ping: the tool

Uses ICMP ECHO_REQUEST datagram to Uses ICMP ECHO_REQUEST datagram to elicit an ICMP ECHO_RESPONSE from a elicit an ICMP ECHO_RESPONSE from a host or gatewayhost or gatewayReportsReports• Round trip timeRound trip time• Packets lossPackets loss

Many available options: packet type, size etcMany available options: packet type, size etcLimitation: >1sec measurement frequencyLimitation: >1sec measurement frequencyRead manual: man pingRead manual: man ping

Page 65: Chapter 4: Network Layer

65

Traceroute: the tool

Traceroute measures Traceroute measures • the path and the round trip timethe path and the round trip time

Traceroute: ingenious (ab)use of the network Traceroute: ingenious (ab)use of the network layer by Van Jacobsonlayer by Van JacobsonMain ideas: Main ideas: • send “bad” packets to receive ICMP: “packet died”send “bad” packets to receive ICMP: “packet died”• Recursive probing to identify the pathRecursive probing to identify the path• Send three packets at a timeSend three packets at a time

Read manual: man tracerouteRead manual: man traceroute

Page 66: Chapter 4: Network Layer

66

The ingenuity of traceroute

Send a packet for every hop of the pathSend a packet for every hop of the path

Set TTL = 1, packet expires, ICMP returnsSet TTL = 1, packet expires, ICMP returns

Increase TTL by one, and repeatIncrease TTL by one, and repeat

At the destination, port number is wrong: At the destination, port number is wrong: return an ICMP packet, port not foundreturn an ICMP packet, port not found

Page 67: Chapter 4: Network Layer

67

Traceroute: Some Limitations

In traceroute, you may be exploring multiple paths In traceroute, you may be exploring multiple paths without knowing itwithout knowing it

Delays for each part of the path correspond to Delays for each part of the path correspond to different measurements: ie they don’t sum updifferent measurements: ie they don’t sum up

Page 68: Chapter 4: Network Layer

68

Identifying The Router Topology

Several efforts rely on multiple tracerouteSeveral efforts rely on multiple traceroute• Govindan et al INFOCOM 2000Govindan et al INFOCOM 2000• Cheswick and Burch Internet Mapping ProjectCheswick and Burch Internet Mapping Project

Main idea:Main idea:• Do thousands of traceroutesDo thousands of traceroutes• Collect all adjacent nodes Collect all adjacent nodes • Generate a graphGenerate a graph

Page 69: Chapter 4: Network Layer

69

Router Graphs: A Complication

Routers have multiple IP addressesRouters have multiple IP addresses• One for each interfaceOne for each interface

How do we resolve this?How do we resolve this?Only heuristics exist [Govindan]Only heuristics exist [Govindan]Heuristic: Send packets to one interface and Heuristic: Send packets to one interface and hope that they will respond with the other hope that they will respond with the other interfaceinterface• Typically, router responds with IP of interface the Typically, router responds with IP of interface the

packet came onpacket came on

Page 70: Chapter 4: Network Layer

70

End

Page 71: Chapter 4: Network Layer

71

Proposals

Overall: decentOverall: decent

Not enough motivation/backgroundNot enough motivation/background• All related papersAll related papers

Not enough thought on what you will doNot enough thought on what you will do• Spend an evening thinking what you will do and howSpend an evening thinking what you will do and how

Try to clarify goals early and talk to meTry to clarify goals early and talk to me

Photocopy them, and give me the originalPhotocopy them, and give me the original• It’s the contractIt’s the contract

Page 72: Chapter 4: Network Layer

72

Practical Tips

The earlier, the betterThe earlier, the better

Talk to me earlyTalk to me early

Look for tools, data, previous workLook for tools, data, previous work• It can save you a lot of time in the long runIt can save you a lot of time in the long run

Try to focus on a topicTry to focus on a topic

Page 73: Chapter 4: Network Layer

73

Side Note

Important things in research:Important things in research:• Asking the right questionsAsking the right questions• Identifying the right topicIdentifying the right topic• Context of researchContext of research

MotivationMotivation Previous and related workPrevious and related work Importance of problemImportance of problem

• Thoroughness of workThoroughness of work

Page 74: Chapter 4: Network Layer

74

Quiz

What is the main role of routing?What is the main role of routing?Describe a centralized routing protocol Describe a centralized routing protocol • Main operation functionsMain operation functions• Comment on complexity, robustnessComment on complexity, robustness

Describe a table driven routing protocolDescribe a table driven routing protocol• Main functionsMain functions• Comment on complexityComment on complexity

How can the Internet routing scale?How can the Internet routing scale?• Describe the elements that make it workDescribe the elements that make it work• What does a router need to keep in its memoryWhat does a router need to keep in its memory• Describe a routing tableDescribe a routing table

What happens to a packet when it arrives at a router?What happens to a packet when it arrives at a router?• What kind of “hardware” does it go through?What kind of “hardware” does it go through?• Where does the delay and loss come into play?Where does the delay and loss come into play?