0% found this document useful (0 votes)
10 views

Chapter4 Tostudent

Chapter4-tostudent

Uploaded by

stevenrhinewlh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Chapter4 Tostudent

Chapter4-tostudent

Uploaded by

stevenrhinewlh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 71

Chapter 4

Network Layer

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: Computer Networking:
❑ If you use these slides (e.g., in a class) in substantially unaltered form, A Top Down Approach ,
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 6th edition.
you note that they are adapted from (or perhaps identical to) our slides, and Jim Kurose, Keith Ross
note our copyright of this material.

Thanks and enjoy! JFK/KWR

All material copyright 1996-2007


J.F Kurose and K.W. Ross, All Rights Reserved
Network Layer 4-1
Chapter 4: Network Layer
Chapter goals:
 understand principles behind network layer
services:
 network layer service models
 forwarding versus routing
 how a router works
 routing (path selection)
 dealing with scale
 instantiation, implementation in the Internet

Network Layer 4-2


Chapter 4: Network Layer
 4. 1 Introduction  4.5 Routing algorithms
 4.3 What’s inside a  Link state

router  Distance Vector


 Hierarchical routing
 4.4 IP: Internet
Protocol  4.6 Routing in the
 Datagram format Internet
 IPv4 addressing  OSPF
 BGP

Network Layer 4-3


Network layer
 transport segment from application
transport

sending to receiving host network


data link
physical

 on sending side network


data link
network
data link

encapsulates segments
network physical
physical
data link
physical
into datagrams
network network
data link data link
physical physical

 on rcving side, delivers network network


segments to transport data link
physical
network
data link
physical

layer data link


physical
application
 network layer protocols network
data link
transport
network

in every host, router


network
physical data link
network data link
physical
data link physical

router examines header


physical

fields in all IP datagrams
passing through it
Network Layer 4-4
Two Key Network-Layer Functions

 forwarding: move analogy:


packets from router’s
input to appropriate  routing: process of
router output planning trip from
source to dest
 routing: determine
route taken by  forwarding: process
packets from source of getting through
to dest. single interchange

 routing algorithms

Network Layer 4-5


Interplay between routing and forwarding

routing algorithm

local forwarding table


header value output link
0100 3
0101 2
0111 2
1001 1

value in arriving
packet’s header
0111 1

3 2

Network Layer 4-6


routing
forwarding
forwarding
4 billion
Forwarding table possible entries

Destination Address Range Link Interface

11001000 00010111 00010000 00000000


through 0
11001000 00010111 00010111 11111111

11001000 00010111 00011000 00000000


through 1
11001000 00010111 00011000 11111111

11001000 00010111 00011001 00000000


through 2
11001000 00010111 00011111 11111111

otherwise 3

Network Layer 4-9


Longest prefix matching

Prefix Match Link Interface


11001000 00010111 00010 0
11001000 00010111 00011000 1
11001000 00010111 00011 2
otherwise 3

Examples

DA: 11001000 00010111 00010110 10100001 Which interface?

DA: 11001000 00010111 00011000 10101010 Which interface?

Network Layer 4-10


Chapter 4: Network Layer
 4. 1 Introduction  4.5 Routing algorithms
 4.3 What’s inside a  Link state

router  Distance Vector


 Hierarchical routing
 4.4 IP: Internet
Protocol  4.6 Routing in the
 Datagram format Internet
 IPv4 addressing  OSPF
 BGP

Network Layer 4-11


Router Architecture Overview
Two key router functions:
 run routing algorithms/protocol (RIP, OSPF, BGP)
 forwarding datagrams from incoming to outgoing link

Network Layer 4-12


Three types of switching fabrics

Network Layer 4-13


Output port queueing

 buffering when arrival rate via switch exceeds


output line speed
 queueing (delay) and loss due to output port
buffer overflow!
Network Layer 4-14
How much buffering?
 RFC 3439 rule of thumb: average buffering
equal to “typical” RTT (say 250 msec) times
link capacity C
 e.g., C = 10 Gps link: 2.5 Gbit buffer
 Recent recommendation: with N flows,
buffering equal to RTT. C
N

Network Layer 4-15


Chapter 4: Network Layer
 4. 1 Introduction  4.5 Routing algorithms
 4.3 What’s inside a  Link state

router  Distance Vector


 Hierarchical routing
 4.4 IP: Internet
Protocol  4.6 Routing in the
 Datagram format Internet
 IPv4 addressing  OSPF
 BGP

Network Layer 4-16


The Internet Network layer
Host, router network layer functions:

Transport layer: TCP, UDP

Routing protocols IP protocol


•path selection •addressing conventions
•RIP, OSPF, BGP •datagram format
Network •packet handling conventions
layer forwarding
ICMP protocol
table
•error reporting
•router “signaling”

Link layer

physical layer

Network Layer 4-17


Chapter 4: Network Layer
 4. 1 Introduction  4.5 Routing algorithms
 4.3 What’s inside a  Link state

router  Distance Vector


 Hierarchical routing
 4.4 IP: Internet
Protocol  4.6 Routing in the
 Datagram format Internet
 IPv4 addressing  OSPF
 BGP

Network Layer 4-18


IP datagram format
IP protocol version 32 bits
number total datagram
header length type of length (bytes)
ver head. length
(bytes) len service for
“type” of data fragment fragmentation/
16-bit identifier flgs
offset reassembly
max number time to upper header
remaining hops live layer checksum
(decremented at
32 bit source IP address
each router)
32 bit destination IP address
upper layer protocol
to deliver payload to Options (if any) E.g. timestamp,
record route
how much overhead data taken, specify
with TCP? (variable length, list of routers
 20 bytes of TCP typically a TCP to visit.
or UDP segment)
 20 bytes of IP
 = 40 bytes + app
layer overhead
Network Layer 4-19
Chapter 4: Network Layer
 4. 1 Introduction  4.5 Routing algorithms
 4.3 What’s inside a  Link state

router  Distance Vector


 Hierarchical routing
 4.4 IP: Internet
Protocol  4.6 Routing in the
 Datagram format Internet
 IPv4 addressing  OSPF
 BGP

Network Layer 4-20


IP Addressing: introduction
 IP address: 32-bit 223.1.1.1

identifier for host, 223.1.2.1


223.1.1.2
router interface 223.1.1.4 223.1.2.9
 interface: connection
223.1.2.2
between host/router 223.1.1.3 223.1.3.27

and physical link


 router’s typically have
multiple interfaces 223.1.3.1 223.1.3.2
 host typically has one
interface
 IP addresses
associated with each 223.1.1.1 = 11011111 00000001 00000001 00000001
interface
223 1 1 1

Network Layer 4-21


Subnets
 IP address: 223.1.1.1

 subnet part (high 223.1.2.1


223.1.1.2
order bits) 223.1.1.4 223.1.2.9
 host part (low order
bits) 223.1.1.3
223.1.2.2
223.1.3.27
 What’s a subnet ?
subnet
 device interfaces with
same subnet part of IP 223.1.3.1 223.1.3.2
address
 can physically reach
each other without
intervening router network consisting of 3 subnets

Network Layer 4-22


Subnets 223.1.1.0/24
223.1.2.0/24

Recipe
 To determine the
subnets, detach each
interface from its
host or router,
creating islands of
isolated networks.
Each isolated network
is called a subnet. 223.1.3.0/24

Subnet mask: /24

Network Layer 4-23


Subnets 223.1.1.2

How many? 223.1.1.1 223.1.1.4

223.1.1.3

223.1.9.2 223.1.7.0

223.1.9.1 223.1.7.1
223.1.8.1 223.1.8.0

223.1.2.6 223.1.3.27

223.1.2.1 223.1.2.2 223.1.3.1 223.1.3.2

Network Layer 4-24


IP addresses: how to get one?

Q: How does host get IP address?

 hard-coded by system admin in a file


 Wintel: control-panel->network->configuration-
>tcp/ip->properties
 UNIX: /etc/rc.config
 DHCP: Dynamic Host Configuration Protocol:
dynamically get address from as server
 “plug-and-play”

Network Layer 4-25


DHCP: Dynamic Host Configuration Protocol

Goal: allow host to dynamically obtain its IP address


from network server when it joins network
Can renew its lease on address in use
Allows reuse of addresses (only hold address while connected
an “on”
Support for mobile users who want to join network (more
shortly)
DHCP overview:
 host broadcasts “DHCP discover” msg
 DHCP server responds with “DHCP offer” msg
 host requests IP address: “DHCP request” msg
 DHCP server sends address: “DHCP ack” msg
Network Layer 4-26
DHCP client-server scenario

A 223.1.1.1 DHCP 223.1.2.1


server
223.1.1.2
223.1.1.4 223.1.2.9
B
223.1.2.2 arriving DHCP
223.1.1.3 223.1.3.27 E client needs
address in this
223.1.3.1 223.1.3.2
network

Network Layer 4-27


DHCP client-server scenario
DHCP server: 223.1.2.5 arriving
DHCP discover
client
src : 0.0.0.0, 68
dest.: 255.255.255.255,67
yiaddr: 0.0.0.0
transaction ID: 654

DHCP offer
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 654
Lifetime: 3600 secs
DHCP request
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
yiaddrr: 223.1.2.4
transaction ID: 655
time Lifetime: 3600 secs

DHCP ACK
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 655
Lifetime: 3600 secs

Network Layer 4-28


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
Organization 2 11001000 00010111 00010100 00000000 200.23.20.0/23
... ….. …. ….
Organization 7 11001000 00010111 00011110 00000000 200.23.30.0/23

Network Layer 4-29


Hierarchical addressing: route aggregation
Hierarchical addressing allows efficient advertisement of routing
information:

Organization 0
200.23.16.0/23
Organization 1
“Send me anything
200.23.18.0/23 with addresses
Organization 2 beginning
200.23.20.0/23 . Fly-By-Night-ISP 200.23.16.0/20”
.
. . Internet
.
Organization 7 .
200.23.30.0/23
“Send me anything
ISPs-R-Us
with addresses
beginning
199.31.0.0/16”

Network Layer 4-30


Hierarchical addressing: more specific
routes
ISPs-R-Us has a more specific route to Organization 1
Organization 0
200.23.16.0/23

“Send me anything
with addresses
Organization 2 beginning
200.23.20.0/23 . Fly-By-Night-ISP 200.23.16.0/20”
.
. . Internet
.
Organization 7 .
200.23.30.0/23
“Send me anything
ISPs-R-Us
with addresses
Organization 1 beginning 199.31.0.0/16
or 200.23.18.0/23”
200.23.18.0/23

Network Layer 4-31


IP addressing: the last word...

Q: How does an ISP get block of addresses?


A: ICANN: Internet Corporation for Assigned
Names and Numbers
 allocates addresses
 manages DNS
 assigns domain names, resolves disputes

Network Layer 4-32


Chapter 4: Network Layer
 4. 1 Introduction  4.5 Routing algorithms
 4.3 What’s inside a  Link state

router  Distance Vector


 Hierarchical routing
 4.4 IP: Internet
Protocol  4.6 Routing in the
 Datagram format Internet
 IPv4 addressing  OSPF
 BGP

Network Layer 4-33


Interplay between routing, forwarding

routing algorithm

local forwarding table


header value output link
0100 3
0101 2
0111 2
1001 1

value in arriving
packet’s header
0111 1

3 2

Network Layer 4-34


Graph abstraction
5
3
v w 5
2
u 2 1 z
3
1 2
x 1
y
Graph: G = (N,E)

N = set of routers = { u, v, w, x, y, z }

E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }

Remark: Graph abstraction is useful in other network contexts

Network Layer 4-35


Graph abstraction: costs
5
• c(x,x’) = cost of link (x,x’)
3
v w 5
2 - e.g., c(w,z) = 5
u 2 1 z
3 • cost could always be 1, or
1 2 inversely related to bandwidth,
x 1
y
or inversely related to
congestion

Cost of path (x1, x2, x3,…, xp) = c(x1,x2) + c(x2,x3) + … + c(xp-1,xp)

Question: What’s the least-cost path between u and z ?

Routing algorithm: algorithm that finds least-cost path

Network Layer 4-36


Routing Algorithm classification
Global or decentralized Static or dynamic?
information? Static:
Global:
 routes change slowly
 all routers have complete
topology, link cost info over time
 “link state” algorithms Dynamic:
Decentralized:  routes change more
 router knows physically- quickly
connected neighbors, link
 periodic update
costs to neighbors
 iterative process of  in response to link
computation, exchange of cost changes
info with neighbors
 “distance vector” algorithms

Network Layer 4-37


Chapter 4: Network Layer
 4. 1 Introduction  4.5 Routing algorithms
 4.2 Virtual circuit and  Link state

datagram networks  Distance Vector


 Hierarchical routing
 4.3 What’s inside a
router  4.6 Routing in the
 4.4 IP: Internet
Internet
RIP
Protocol 
 OSPF
 Datagram format
 BGP
 IPv4 addressing

Network Layer 4-38


A Link-State Routing Algorithm

Dijkstra’s algorithm Notation:


 net topology, link costs  c(x,y): link cost from node
known to all nodes x to y; = ∞ if not direct
 accomplished via “link neighbors
state broadcast”
 D(v): current value of cost
 all nodes have same info of path from source to
 computes least cost paths dest. v
from one node (‘source”) to
 p(v): predecessor node
all other nodes
along path from source to v
 gives forwarding table
for that node  N': set of nodes whose
least cost path definitively
 iterative: after k
known
iterations, know least cost
path to k dest.’s
Network Layer 4-39
Dijsktra’s Algorithm
1 Initialization:
2 N' = {u}
3 for all nodes v
4 if v adjacent to u
5 then D(v) = c(u,v)
6 else D(v) = ∞
7
8 Loop
9 find w not in N' such that D(w) is a minimum
10 add w to N'
11 update D(v) for all v adjacent to w and not in N' :
12 D(v) = min( D(v), D(w) + c(w,v) )
13 /* new cost to v is either old cost to v or known
14 shortest path cost to w plus cost from w to v */
15 until all nodes in N'

Network Layer 4-40


Dijkstra’s algorithm: example
Step N' D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) D(z),p(z)
0 u 2,u 5,u 1,u ∞ ∞
1 ux 2,u 4,x 2,x ∞
2 uxy 2,u 3,y 4,y
3 uxyv 3,y 4,y
4 uxyvw 4,y
5 uxyvwz

5
3
v w 5
2
u 2 1 z
3
1 2
x 1
y

Network Layer 4-41


Dijkstra’s algorithm: example (2)
Resulting shortest-path tree from u:

v w
u z
x y

Resulting forwarding table in u:


destination link
v (u,v)
x (u,x)
y (u,x)
w (u,x)
z (u,x)
Network Layer 4-42
Dijkstra’s algorithm, discussion
Algorithm complexity: n nodes
 each iteration: need to check all nodes, w, not in N
 n(n+1)/2 comparisons: O(n2)

Network Layer 4-43


Chapter 4: Network Layer
 4. 1 Introduction  4.5 Routing algorithms
 4.3 What’s inside a  Link state

router  Distance Vector


 Hierarchical routing
 4.4 IP: Internet
Protocol  4.6 Routing in the
 Datagram format Internet
 IPv4 addressing  OSPF
 BGP

Network Layer 4-44


Distance Vector Algorithm
Bellman-Ford Equation (dynamic programming)
Define
dx(y) := cost of least-cost path from x to y

Then

dx(y) = min
v
{c(x,v) + dv(y) }

where min is taken over all neighbors v of x


Network Layer 4-45
Bellman-Ford example
5
3
Clearly, dv(z) = 5, dx(z) = 3, dw(z) = 3
v w 5
2
u 2 1 z B-F equation says:
3
1 2 du(z) = min { c(u,v) + dv(z),
x y
1 c(u,x) + dx(z),
c(u,w) + dw(z) }
= min {2 + 5,
1 + 3,
5 + 3} = 4
Node that achieves minimum is next
hop in shortest path ➜ forwarding table
Network Layer 4-46
Distance Vector Algorithm
 Dx(y) = estimate of least cost from x to y
 Node x knows cost to each neighbor v:
c(x,v)
 Node x maintains distance vector Dx =
[Dx(y): y є N ]
 Node x also maintains its neighbors’
distance vectors
 For each neighbor v, x maintains
Dv = [Dv(y): y є N ]

Network Layer 4-47


Distance vector algorithm (4)
Basic idea:
 Each node periodically sends its own distance
vector estimate to neighbors
 When a node x receives new DV estimate from
neighbor, it updates its own DV using B-F equation:

Dx(y) ← minv{c(x,v) + Dv(y)} for each node y ∊ N

 Under minor, natural conditions, the estimate


Dx(y) converge to the actual least cost dx(y)

Network Layer 4-48


Distance Vector Algorithm (5)
Iterative, asynchronous: Each node:
each local iteration caused
by:
 local link cost change wait for (change in local link
 DV update message from cost or msg from neighbor)
neighbor
Distributed:
recompute estimates
 each node notifies
neighbors only when its DV
changes if DV to any dest has
 neighbors then notify
changed, notify neighbors
their neighbors if
necessary

Network Layer 4-49


Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} Dx(z) = min{c(x,y) +
= min{2+0 , 7+1} = 2 Dy(z), c(x,z) + Dz(z)}
node x table = min{2+1 , 7+0} = 3
cost to cost to
x y z x y z
x 0 2 7 x 0 2 3
from

from
y ∞∞ ∞ y 2 0 1
z ∞∞ ∞ z 7 1 0
node y table
cost to
x y z y
2 1
x ∞ ∞ ∞
x z
y 2 0 1 7
from

z ∞∞ ∞
node z table
cost to
x y z
x ∞∞ ∞
from

y ∞∞ ∞
z 71 0
time
Network Layer 4-50
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} Dx(z) = min{c(x,y) +
= min{2+0 , 7+1} = 2 Dy(z), c(x,z) + Dz(z)}
node x table = min{2+1 , 7+0} = 3
cost to cost to cost to
x y z x y z x y z
x 0 2 7 x 0 2 3 x 0 2 3
from

from
y ∞∞ ∞ y 2 0 1

from
y 2 0 1
z ∞∞ ∞ z 7 1 0 z 3 1 0
node y table
cost to cost to cost to
x y z x y z x y z y
2 1
x ∞ ∞ ∞ x 0 2 7 x 0 2 3 x z
from

y 2 0 1 y 2 0 1 7
from

from
y 2 0 1
z ∞∞ ∞ z 7 1 0 z 3 1 0
node z table
cost to cost to cost to
x y z x y z x y z

x ∞∞ ∞ x 0 2 7 x 0 2 3
from

from

y 2 0 1 y 2 0 1
from

y ∞∞ ∞
z 71 0 z 3 1 0 z 3 1 0
time
Network Layer 4-51
Comparison of LS and DV algorithms
Message complexity Robustness: what happens
 LS: with n nodes, E links, if router malfunctions?
O(nE) msgs sent LS:
 DV: exchange between
 node can advertise
neighbors only
incorrect link cost
 convergence time varies
 each node computes only
Speed of Convergence its own table
 LS: O(n2) algorithm requires DV:
O(nE) msgs  DV node can advertise
 may have oscillations incorrect path cost
 DV: convergence time varies  each node’s table used by
 may be routing loops
others
• error propagate thru
 count-to-infinity problem
network
Network Layer 4-52
Chapter 4: Network Layer
 4. 1 Introduction  4.5 Routing algorithms
 4.3 What’s inside a  Link state

router  Distance Vector


 Hierarchical routing
 4.4 IP: Internet
Protocol  4.6 Routing in the
 Datagram format Internet
 IPv4 addressing  OSPF
 BGP

Network Layer 4-53


Hierarchical Routing
Our routing study thus far - idealization
 all routers identical
 network “flat”
… not true in practice

scale: with 200 million administrative autonomy


destinations:  internet = network of
 can’t store all dest’s in networks
routing tables!  each network admin may
 routing table exchange want to control routing in its
would swamp links! own network

Network Layer 4-54


Hierarchical Routing
 aggregate routers into Gateway router
regions, “autonomous
 Direct link to router in
systems” (AS)
another AS
 routers in same AS run
same routing protocol
 “intra-AS” routing
protocol
 routers in different AS
can run different intra-
AS routing protocol

Network Layer 4-55


Interconnected ASes

3c
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b
1d AS1
 forwarding table
configured by both
intra- and inter-AS
Intra-AS
Routing
Inter-AS
Routing routing algorithm
intra-AS sets entries
algorithm algorithm

Forwarding for internal dests
inter-AS & Intra-As
table

sets entries for
external dests
Network Layer 4-56
Inter-AS tasks AS1 must:
 suppose router in AS1 1. learn which dests
receives datagram reachable through
dest outside of AS1 AS2, which through
 router should AS3
forward packet to 2. propagate this
gateway router, but reachability info to all
which one? routers in AS1
Job of inter-AS routing!

3c
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b
1d AS1
Network Layer 4-57
Example: Setting forwarding table in router 1d

 suppose AS1 learns (via inter-AS protocol) that subnet


x reachable via AS3 (gateway 1c) but not via 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 least cost path to 1c.
 installs forwarding table entry (x,I)

x
3c
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b AS1
1d
Network Layer 4-58
Example: Choosing among multiple ASes
 now suppose AS1 learns from inter-AS protocol that
subnet x is reachable from AS3 and from AS2.
 to configure forwarding table, router 1d must
determine towards which gateway it should forward
packets for dest x.
 this is also job of inter-AS routing protocol!

x
3c
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b
1d AS1

Network Layer 4-59


Example: Choosing among multiple ASes
 now suppose AS1 learns from inter-AS protocol that
subnet x is reachable from AS3 and from AS2.
 to configure forwarding table, router 1d must
determine towards which gateway it should forward
packets for dest x.
 this is also job of inter-AS routing protocol!
 hot potato routing: send packet towards closest of
two routers.

Use routing info Determine from


Learn from inter-AS Hot potato routing: forwarding table the
from intra-AS
protocol that subnet Choose the gateway interface I that leads
protocol to determine
x is reachable via that has the to least-cost gateway.
costs of least-cost
multiple gateways smallest least cost Enter (x,I) in
paths to each
of the gateways forwarding table

Network Layer 4-60


Chapter 4: Network Layer
 4. 1 Introduction  4.5 Routing algorithms
 4.3 What’s inside a  Link state

router  Distance Vector


 Hierarchical routing
 4.4 IP: Internet
Protocol  4.6 Routing in the
 Datagram format Internet
 IPv4 addressing  OSPF
 BGP

Network Layer 4-61


OSPF (Open Shortest Path First)
 “open”: publicly available
 uses Link State algorithm
 LS packet dissemination
 topology map at each node
 route computation using Dijkstra’s algorithm

 OSPF advertisement carries one entry per neighbor


router
 advertisements disseminated to entire AS (via
flooding)
 carried in OSPF messages directly over IP (rather than TCP
or UDP

Network Layer 4-62


Chapter 4: Network Layer
 4. 1 Introduction  4.5 Routing algorithms
 4.3 What’s inside a  Link state

router  Distance Vector


 Hierarchical routing
 4.4 IP: Internet
Protocol  4.6 Routing in the
 Datagram format Internet
 IPv4 addressing  OSPF
 BGP

Network Layer 4-63


Internet inter-AS routing: BGP

 BGP (Border Gateway Protocol): the de


facto standard
 BGP provides each AS a means to:
1. Obtain subnet reachability information from
neighboring ASs.
2. Propagate reachability information to all AS-
internal routers.
3. Determine “good” routes to subnets based on
reachability information and policy.
 allows subnet to advertise its existence to
rest of Internet: “I am here”

Network Layer 4-64


BGP basics
 pairs of routers (BGP peers) exchange routing info
over semi-permanent TCP connections: BGP sessions
 BGP sessions need not correspond to physical
links.
 when AS2 advertises prefix to AS1:
 AS2 promises it will forward any addresses
datagrams towards that prefix.
 AS2 can aggregate prefixes in its advertisement

eBGP session
3c iBGP session
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b
AS1 1d
Network Layer 4-65
Distributing reachability info
 using eBGP session between 3a and 1c, AS3 sends
prefix reachability info to AS1.
 1c can then use iBGP do distribute new prefix
info to all routers in AS1
 1b can then re-advertise new reachability info
to AS2 over 1b-to-2a eBGP session
 when router learns of new prefix, creates entry
for prefix in its forwarding table.

eBGP session
3c iBGP session
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b
AS1 1d
Network Layer 4-66
BGP route selection
 router may learn about more than 1 route
to 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
4. additional criteria

Network Layer 4-67


BGP routing policy
legend: provider
B network
X
W A
customer
C network:

 A,B,C are provider networks


 X,W,Y are customer (of provider networks)
 X is dual-homed: attached to two networks
 X does not want to route from B via X to C
 .. so X will not advertise to B a route to C

Network Layer 4-68


BGP routing policy (2)
legend: provider
B network
X
W A
customer
C network:

 A advertises path AW to B
 B advertises path BAW to X
 Should B advertise path BAW to C?
 No way! B gets no “revenue” for routing CBAW
since neither W nor C are B’s customers
 B wants to force C to route to w via A
 B wants to route only to/from its customers!
Network Layer 4-69
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
Performance:
 Intra-AS: can focus on performance
 Inter-AS: policy may dominate over performance

Network Layer 4-70


Chapter 4: summary
 4. 1 Introduction  4.5 Routing algorithms
 4.3 What’s inside a  Link state

router  Distance Vector


 Hierarchical routing
 4.4 IP: Internet
Protocol  4.6 Routing in the
 Datagram format Internet
 IPv4 addressing  OSPF
 BGP

Network Layer 4-71

You might also like