Upload
others
View
0
Download
0
Embed Size (px)
Citation preview
23/10/2011
1
Fundamentals of Data Communication and Networking
Chapter 4Network Layer
Computer Networking: A Top Down Approach F t i th I t t
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
Jim Kurose, Keith RossAddison-Wesley
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-2011J.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 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
23/10/2011
2
Chapter 4: Network Layer
4. 1 Introduction 4 2 Virtual circuit and
4.5 Routing algorithms Hierarchical routing 4.2 Virtual circuit and
datagram networks 4.3 What’s inside a
router 4.4 IP: Internet
ProtocolD t f t
Hierarchical routing 4.6 Routing in the
Internet RIP OSPF BGP
Network Layer 4-3
Datagram format IPv4 addressing ICMP IPv6
Network layer transport segment from
sending to receiving host on sending side network
d l k
applicationtransportnetworkdata linkphysical
encapsulates segments into datagrams
on rcving side, delivers segments to transport layer
network 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, router
Router examines header fields in all IP datagrams passing through it
data linkphysical
applicationtransportnetworkdata linkphysical
23/10/2011
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
23/10/2011
4
Network service modelQ: What service model for “channel” transporting datagrams from sender to rcvr?
Example services for individual datagrams:
guaranteed delivery Guaranteed delivery
with less than 40 msec d l
Example services for a flow of datagrams:
In-order datagram delivery
Guaranteed minimum b d idth t fl
Network Layer 4-7
delay bandwidth to flow Restrictions 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
23/10/2011
5
Chapter 4: Network Layer
4. 1 Introduction 4 2 Virtual circuit and
4.5 Routing algorithms Hierarchical routing 4.2 Virtual circuit and
datagram networks 4.3 What’s inside a
router 4.4 IP: Internet
ProtocolD t f t
Hierarchical routing 4.6 Routing in the
Internet RIP OSPF BGP
Network Layer 4-9
Datagram format IPv4 addressing ICMP IPv6
Network layer connection and connection-less serviceDatagram network provides network-layer
connectionless serviceconnectionless service VC 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 other Implementation: in the core
23/10/2011
6
Virtual circuits“source-to-dest path behaves much like telephone
circuit”
call setup, teardown for each call before data can flow each packet carries VC identifier (not destination host
address)
performance-wise network actions along source-to-dest path
Network Layer 4-11
every router on source-dest path maintains “state” for each passing connection
link, 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
path Packet 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
23/10/2011
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 VC d i ATM f l X 25 used 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
23/10/2011
8
Datagram networks no call setup at network layer routers: 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
23/10/2011
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?
Internet data exchange among
ATM evolved from telephony
computers “elastic” service, no strict
timing req. “smart” end systems
(computers) can adapt, perform
control, error recovery
f p y human conversation:
strict timing, reliability requirements
need for guaranteed service
“dumb” end systems t l ph n s
Network Layer 4-18
y simple inside network,
complexity at “edge” many link types
different characteristics uniform service difficult
telephones complexity inside
network
23/10/2011
10
Chapter 4: Network Layer
4. 1 Introduction 4 2 Virtual circuit and
4.5 Routing algorithms Hierarchical routing 4.2 Virtual circuit and
datagram networks 4.3 What’s inside a
router 4.4 IP: Internet
ProtocolD t f t
Hierarchical routing 4.6 Routing in the
Internet RIP OSPF BGP
Network Layer 4-19
Datagram format IPv4 addressing ICMP IPv6
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
23/10/2011
11
Chapter 4: Network Layer
4. 1 Introduction 4 2 Virtual circuit and
4.5 Routing algorithms Hierarchical routing 4.2 Virtual circuit and
datagram networks 4.3 What’s inside a
router 4.4 IP: Internet
ProtocolD t f t
Hierarchical routing 4.6 Routing in the
Internet RIP OSPF BGP
Network Layer 4-21
Datagram format IPv4 addressing ICMP IPv6
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 TCP 20 bytes of IP = 40 bytes + app
layer overhead
23/10/2011
12
IP Fragmentation & Reassembly network 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 datagram
MTU = 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
23/10/2011
13
Chapter 4: Network Layer
4. 1 Introduction 4 2 Virtual circuit and
4.5 Routing algorithms Hierarchical routing 4.2 Virtual circuit and
datagram networks 4.3 What’s inside a
router 4.4 IP: Internet
ProtocolD t f t
Hierarchical routing 4.6 Routing in the
Internet RIP OSPF BGP
Network Layer 4-25
Datagram format IPv4 addressing ICMP IPv6
IP Addressing: introduction IP address: 32-bit
identifier for host, router interface
223.1.1.1
223.1.1.2223.1.2.1
interface IP 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 link router’s typically have
multiple interfaces host typically has one
interface IP addresses associated with
each interface
223.1.1.1 = 11011111 00000001 00000001 00000001
223 1 11
23/10/2011
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->properties UNIX: /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
23/10/2011
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 Numbers allocates addressesmanages DNS assigns domain names, resolves disputes
Network Layer 4-29
Chapter 4: Network Layer
4. 1 Introduction 4 2 Virtual circuit and
4.5 Routing algorithms Hierarchical routing 4.2 Virtual circuit and
datagram networks 4.3 What’s inside a
router 4.4 IP: Internet
ProtocolD t f t
Hierarchical routing 4.6 Routing in the
Internet RIP OSPF BGP
Network Layer 4-30
Datagram format IPv4 addressing ICMP IPv6
23/10/2011
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, protocol
echo 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 =1 Second has TTL=2, etc. Unlikely port number
When nth datagram arrives to nth router: Router discards datagram And sends to source an
RTT Traceroute does this 3
timesStopping criterion UDP segment eventually
arrives at destination host Destination 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.
23/10/2011
17
Chapter 4: Network Layer
4. 1 Introduction 4 2 Virtual circuit and
4.5 Routing algorithms Hierarchical routing 4.2 Virtual circuit and
datagram networks 4.3 What’s inside a
router 4.4 IP: Internet
ProtocolD t f t
Hierarchical routing 4.6 Routing in the
Internet RIP OSPF BGP
Network Layer 4-33
Datagram format IPv4 addressing ICMP IPv6
IPv6 Initial motivation: 32-bit address space soon
to be completely allocated. p yAdditional motivation:
header format helps speed processing/forwarding header changes to facilitate QoS IPv6 datagram format: fixed-length 40 byte header
Network Layer 4-34
g y no fragmentation allowed
23/10/2011
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 hop
Options: allowed, but outside of header, indicated by “Next Header” field
ICMPv6: 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
23/10/2011
19
Chapter 4: Network Layer
4. 1 Introduction 4 2 Virtual circuit and
4.5 Routing algorithms Hierarchical routing 4.2 Virtual circuit and
datagram networks 4.3 What’s inside a
router 4.4 IP: Internet
ProtocolD t f t
Hierarchical routing 4.6 Routing in the
Internet RIP OSPF BGP
Network Layer 4-37
Datagram format IPv4 addressing ICMP IPv6
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
23/10/2011
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” algorithmsDecentralized: router knows physically-
connected neighbors, link
routes change slowly over time
Dynamic: routes change more
quickly periodic update
Network Layer 4-39
gcosts to neighbors
iterative process of computation, exchange of info with neighbors
“distance vector” algorithms
periodic update in response to link
cost changes
Chapter 4: Network Layer
4. 1 Introduction 4 2 Virtual circuit and
4.5 Routing algorithms Hierarchical routing 4.2 Virtual circuit and
datagram networks 4.3 What’s inside a
router 4.4 IP: Internet
ProtocolD t f t
Hierarchical routing 4.6 Routing in the
Internet RIP OSPF BGP
Network Layer 4-40
Datagram format IPv4 addressing ICMP IPv6
23/10/2011
21
Hierarchical RoutingOur routing study thus far - idealization all routers identical
scale: with 200 million destinations:
can’t store all dest’s in
administrative autonomy internet = 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 router Direct link to router in systems” (AS)
routers in same AS run same routing protocol “intra-AS” routing
protocol routers 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
23/10/2011
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 algorithm Intra-AS sets entries
for internal dests Inter-AS & Intra-As
sets entries for external dests
Inter-AS tasks Suppose 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
23/10/2011
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 ASes Now 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
23/10/2011
24
Chapter 4: Network Layer
4. 1 Introduction 4 2 Virtual circuit and
4.5 Routing algorithms Hierarchical routing 4.2 Virtual circuit and
datagram networks 4.3 What’s inside a
router 4.4 IP: Internet
ProtocolD t f t
Hierarchical routing 4.6 Routing in the
Internet RIP OSPF BGP
Network Layer 4-47
Datagram format IPv4 addressing ICMP IPv6
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)
23/10/2011
25
Chapter 4: Network Layer
4. 1 Introduction 4 2 Virtual circuit and
4.5 Routing algorithms Hierarchical routing 4.2 Virtual circuit and
datagram networks 4.3 What’s inside a
router 4.4 IP: Internet
ProtocolD t f t
Hierarchical routing 4.6 Routing in the
Internet RIP OSPF BGP
Network Layer 4-49
Datagram format IPv4 addressing ICMP IPv6
RIP ( Routing Information Protocol)
Distance vector algorithm Included in BSD-UNIX Distribution in 1982 Included in BSD-UNIX Distribution in 1982 Distance 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
23/10/2011
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
23/10/2011
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 d routes via neighbor invalidated
new advertisements sent to neighbors neighbors in turn send out new advertisements (if
tables changed) link failure info quickly propagates to entire net poison reverse used to prevent ping-pong loops
Network Layer 4-54
poison reverse used to prevent ping pong loops (infinite distance = 16 hops)
23/10/2011
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 Introduction 4 2 Virtual circuit and
4.5 Routing algorithms Hierarchical routing 4.2 Virtual circuit and
datagram networks 4.3 What’s inside a
router 4.4 IP: Internet
ProtocolD t f t
Hierarchical routing 4.6 Routing in the
Internet RIP OSPF BGP
Network Layer 4-56
Datagram format IPv4 addressing ICMP IPv6
23/10/2011
29
OSPF (Open Shortest Path First)
“open”: publicly available Uses Link State algorithm g
LS packet dissemination Topology map at each node Route 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.
23/10/2011
30
Hierarchical OSPF
Network Layer 4-59
Hierarchical OSPF
Two-level hierarchy: local area, backbone. Link-state advertisements only in area y each 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.
23/10/2011
31
Chapter 4: Network Layer
4. 1 Introduction 4 2 Virtual circuit and
4.5 Routing algorithms Hierarchical routing 4.2 Virtual circuit and
datagram networks 4.3 What’s inside a
router 4.4 IP: Internet
ProtocolD t f t
Hierarchical routing 4.6 Routing in the
Internet RIP OSPF BGP
Network Layer 4-61
Datagram format IPv4 addressing ICMP IPv6
Internet inter-AS routing: BGP
BGP (Border Gateway Protocol): the de facto standardfacto standard
BGP 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”
23/10/2011
32
BGP basics Pairs of routers (BGP peers) exchange routing info over semi-
permanent TCP conctns: BGP sessions Note 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 info With 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 AS1 1b 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 session When 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
23/10/2011
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
decision2. 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
23/10/2011
34
BGP messages
BGP messages exchanged using TCP. BGP messages: BGP messages
OPEN: opens TCP connection to peer and authenticates sender
UPDATE: 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 neededScale: hierarchical routing saves table size, reduced update
trafficP f
Network Layer 4-68
Performance: Intra-AS: can focus on performance Inter-AS: policy may dominate over performance