Sunteți pe pagina 1din 32

7/29/2014

Unicast and Multicast Routing


An internet is a combination of networks connected by routers
Packets are routed through the network by routers.
This process is called routing
Routing

Routing
Kithsiri M. Liyanage
Dept. of Electrical and Electronic Engineering
University of Peradeniya

Unicast

Involved one source and one destination

A router forwards a received packet through only


one of its ports

Multicast

Metric
A metric is a cost assigned for passing through a network.
the total metric of a particular route is equal to the sum of the metrics of
networks that comprise the route.

Involved one source and many destination

A router may forwards a received packet through


several of its ports

Autonomous Systems and Intra and Inter Domain Routing


An internet can be very large. Therefore one routing protocol cannot
handle the task of updating routing tables of all routers.

the router chooses the route with the shortest (smallest) metric
Therefore an internet is divided into autonomous systems.
RIP (Routing Information Protocol): treating each network equals.
The cost of passing through each network is the same.
so if a packet passes through 10 networks to reach the destination, the
total cost is hop counts.
OSPF (Open Shortest Path First)
Allowing the administrator to assign a cost for passing through a
network based on the type of service required.
A route through a chosen. network can have different costs (metrics)

An autonomous system (AS) is a group of networks and routers under the


authority of a single administration.

Routing inside an autonomous system is called Intradomain routing

Routing between autonomous systems is called Interdomain routing

BGP (Border Router Protocol)


Criterion is the policy, which can be set by the administrator.
Policy defines what paths should be

7/29/2014

Autonomous Systems
Intra and Inter Domain Routing

Distance Vector Routing

Distance Vector Routing Tables

In distance vector routing, the least cost route between any two nodes is the
route with minimum distance. In this protocol each node maintains a vector
(table) of minimum distances to every node

Distance Vector Routing


Each router periodically shares its knowledge about the entire internet
with neighbors

The operational principles of this algorithm


Sharing knowledge about the entire autonomous system
Sharing only with neighbors
Sharing at regular intervals (ex, every 30 seconds)

7/29/2014

Initialization of Tables in Distance Vector Routing

Updating in Distance Vector Routing


In distance vector routing, each node shares its routing table with its
immediate neighbors periodically and when there is a change.

Two-Node Loop Instability

Distance Vector Routing - Some Remedies for Instability

Split Horizons

7/29/2014

Distance Vector Routing - Some Remedies for Instability

Three-Node Instability

Poison Reverse : a variation of split horizons

Routing Information Protocol - RIP

Routing Information Protocol - RIP


RIP adheres to the following Distance Vector characteristics:
RIP sends out periodic routing updates (every 30 seconds)

The Routing Information Protocol (RIP) is an intradomain


routing protocol used inside an autonomous system. It is a
very simple protocol based on distance vector routing.

RIP sends out the full routing table every periodic update
RIP uses a form of distance as its metric (in this case, hopcount)
RIP uses the Bellman-Ford Distance Vector algorithm to determine the
best path to a particular destination

The destination in a routing table is a network, which means


the first column defines a network address.

Other characteristics of RIP include:


RIP supports IP and IPX routing.

A metric in RIP is called a hop count; distance; defined as


the number of links (networks) that have to be used to reach
the destination.

RIP utilizes UDP port 520


RIP routes have an administrative distance of 120.(Administrative
distance defines the reliability of a routing protocol. Each routing protocol
is prioritized in order of most to least reliable (believable) with the help of
an administrative distance value.)
RIP has a maximum hopcount of 15 hops.

7/29/2014

Routing Information Protocol - RIP

Example of a Domain Using RIP

Any network that is 16 hops away or more is considered unreachable to


RIP, thus the maximum diameter of the network is 15 hops. A metric of 16
hops in RIP is considered a poison route or infinity metric.

If multiple paths exist to a particular destination, RIP will load balance


between those paths (by default, up to 4) only if the metric (hopcount) is
equal. RIP uses a round-robin system of load-balancing between equal
metric routes, which can lead to pinhole congestion.

For example, two paths might exist to a particular destination, one


going through a 9600 baud link, the other via a T1. If the metric
(hopcount) is equal, RIP will load-balance, sending an equal amount
of traffic down the 9600 baud link and the T1. This will (obviously)
cause the slower link to become congested.

RIP Message Format

RIP Version 2

Command : request (1) or response (2)


Version RIP 1 or RIP 2 (support classless routing)

Route Tag : carrying information such as the autonomous system number

Family : For TCP/IP the value is 2

Subnet mask : carrying the subnet mask

Address : destination network address

Next-hop address : showing the next hop

Distance : defining the hop count from the advertising router to the
destination network

In case that shares a network backbone by two ASes, the message can
define the router to which the packet should go next

* Part of the message (entry) is repeated for each

7/29/2014

Because the 10.3.0.0 network is in the same


major network as the 10.1.0.0 network, it will
not summarize the address.

RIP Version 1- Issue

RIP Messages . . .
Requests and Response
Request messages :
sent by a router that has just come up or by a router that has
some time-out entries.

as the 10.1.0.0 and 192.168.123.0 networks do


not belong to the same major network. Router A
will summarize the 10.1.0.0/16 network to its
classful boundary of 10.0.0.0/8

RIP Messages . . .

RIP Message Example

Response
solicited response is
sent only in answer to a request
containing information about the destination specified in the
corresponding request

unsolicited response is
sent periodically, every 30 seconds
containing information covering the whole routing table

7/29/2014

RIP Timers Update and Invalid Timers

RIP Timers

Update Timer (default 30 seconds)

RIP has four basic timers:

Indicates how often the router will send out a routing table update.

Update Timer
Invalid Timer

Invalid Timer (default 180 seconds)

Hold-down Timer

Indicates how long a route will remain in a routing table before being marked
as invalid, if no new updates are heard about this route.

Flush Timer

The invalid timer will be reset if an update is received for that particular route
before the timer expires.
A route marked as invalid is not immediately removed from the routing table.
Instead, the route is marked (and advertised) with a metric of 16, indicating it is
unreachable, and placed in a hold-down state.

RIP Timers Hold-down Timers


Hold-down Timer (default 180 seconds)
Indicates how long RIP will suppress a route that it has placed in a
hold-down state. RIP will not accept any new updates for routes in a
hold-down state, until the hold-down timer expires. A route will enter
a hold-down state for one of three reasons:
The invalid timer has expired.
An update has been received from another router, marking that
route with a metric of 16 (or unreachable).
An update has been received from another router, marking that
route with a higher metric than what is currently in the routing
table. This is to prevent loops.

RIP Timers Flush Timersc

Flush Timer (default 240 seconds)


Indicates how long a route can remain in a routing table
before being flushed, if no new updates are heard about this
route. The flush timer runs concurrently with the invalid timer,
and thus will flush out a route 60 seconds after it has been
marked invalid.

RIP timers must be identical on all routers on the RIP network,


otherwise massive instability will occur.

7/29/2014

RIP Authnetication
Example
A routing table has 20 entries. It does not receive
information about five routes for 200 seconds. How many
timers are running at this time?
The timers are listed below:
Update timer: 1
Invalid timer: 20 - 5 = 15
Hold down timer: 5
Flush timer: 20

Link State Routing

The presence of authentication is


indicated by setting the Address Family
Identifier field to all ones (0xFFFF).
The Authentication Type for simple
password authentication is two
(00002), and

the remaining 16 octets carry an


alphanumeric password of up to 16
characters.

The password is left-justified in the field,


and if the password is less than 16
octets, the unused bits of the field are
set to zero.

Concept of Link State Routing

In link state routing, if each node in the domain has


the entire topology of the domain, the node can use
Dijkstras algorithm
to build a routing table.
Example 2
A routing table has 20 entries. It does not
receive information about five routes for
200 seconds. How many timers are
running at this time?

7/29/2014

Link State Knowledge

Building Routing Tables


1. Creation of the states of the links by each node, called the
link state packet or LSP
2.

Dissemination of LSPs to every other router, called


flooding, in an efficient and reliable way

3.

Formation of a shortest path tree for each node

4.

Calculation of a routing table based on the shortest path


tree

Creation of LSP

Formation of Shortest Path Tree

When there is a change in the topology of the domain

On a periodic basis

Dijkstra Algorithm

60 minutes or 2 hours

7/29/2014

Example of formation of Shortest Path Tree

Calculating of Routing Table from Shortest Path Tree

Routing table for node A

OSPF (contd)
OSPF (Open Shortest Path First)

The Open Shortest Path First (OSPF) protocol is an intradomain


routing protocol based on link state routing. Its domain is also an
autonomous system

Dividing an AS into areas


to handle routing efficiently and in a timely manner

Areas
Is a collection of networks, hosts, and routers in AS
AS can be divided into many different areas.
All networks inside an area must be connected.
Routers inside an area flood the area with routing information.
Area Border Router
Summarizes the information about the area and sends it to other
areas
Backbone
All of the areas inside an AS must be connected to the backbone
Serving as a primary area
Consisting of backbone routers
Back bone routers can be an area border router

10

7/29/2014

OSPF (contd)

OSPF (contd)

Areas in an AS

Metric
OSPF protocol allows the administrator to assign a cost, called the
metric, to each route
Based on a type of service (minimum delay, maximum throughput,
and so on)
A router can have multiple routing tables, each based on a different
type of service.

Link State Routing


OSPF uses Link State Routing to update the routing tables in an
area
Each router shares its knowledge about its neighborhood with every
router in the area.

OSPF (contd)
1. Sharing knowledge about the neighborhood
2. Sharing with every other router by flooding

OSPF (contd)

Types of Links
In OSPF terminology, a connection is called a link.

3. Sharing when there is a change


cf. Distance Vector Routing : sending the information at regular intervals
regardless of change

So, every router can calculate the shortest path between itself and
each network

11

7/29/2014

OSPF (contd)

Point-to-point Link

OSPF (contd)

Transient Link

Routers are represented by nodes and the link is represented by a


bidirectional edge connecting the nodes.

is a network with several routers attached to transient Link

Each router has only one neighbor at the other side of the link.

(network)

OSPF (contd)

OSPF (contd)

Stub Link
is a network that is connected to only one router
is a special case of transient network
The link is only one-directional, from the router to the network.

Virtual Link
When the link between two routers is broken, the administration
may create a virtual link between them using a longer path

Graphical Representation
An internet with 5 networks and 6 routers

12

7/29/2014

AS and its Graphical Representation in OSPF

AS and its Graphical Representation in OSPF

Graphical Representation (contd)


N1 : transient, N2 : Stub
using square nodes for the routers and ovals for the networks

OSPF Packets

OSPF (contd)

Types of OSPF Packets

OSPF Common Header

or 64 bits

- authentication type : 0 for none, 1 for password


- packet type : five types

13

7/29/2014

Link State Update Packet

LSA General Header

Used by a router to advertise the states of its links

LS age: The time in seconds since the link state advertisement was originated.
E flag : 1 means that the area is a stub area
T flag : 1 means that the router can handle multiple types of service
Link state type : 1) router link, 2) network link, 3) summary link to network, 4) summary link
to AS boundary router 5) AS external link

Link State ID: This field identifies the portion of the internet environment that is being
described by the advertisement. The contents of this field depend on the advertisement's LS
type.
LS Type
Link State ID
.
1
The originating router's Router ID.
2
The IP interface address of the network's Designated Router.
3
The destination network's IP address.
4
The Router ID of the described AS boundary router.
5
The destination network's IP address.

Advertising Router: The Router ID of the router that originated the link state advertisement.
For example, in network links advertisements this field is set to the Router ID of the network's
Designated Router.

LS sequence number: Detects old or duplicate link state advertisements.

LSA

Router Link LSA

Link State Advertisements


to share information about neighbors, each router distributes link
state advertisements (LSAs)

Router Link
defining the links of a true router
A true router uses the advertisement to announce information about
all of its links and what is at the other side of the link (neighbors)

14

7/29/2014

Router Link LSA (contd)


Router Link LSA (contd)

Link types, link identification, and link data

Example

Example : Solution

Give the router link LSA sent by router 10.24.7.9 in the following Figure

15

7/29/2014

Network LINK LSA

Network LINK LSA

Network Link

Network Link Advertisement Format

defines the links of a network


A designated router distributes this type of LSA packet.
The packet announces the existence of all of the routers connected
to the network.

Example

Example : Solution

Give the network link LSA in the following Figure.

16

7/29/2014

Example

Example: Solution

In the following Figure, which router(s) sends out router link


LSAs?

All routers advertise router link LSAs.


a. R1 has two links, N1 and N2.
b. R2 has one link, N1.
c. R3 has two links, N2 and N3.

Example: Solution
All three network must advertise network links:
a. Advertisement for N1 is done by R1 because it is the only attached
router and therefore the designated router.
b. Advertisement for N2 can be done by either R1, R2, or R3,
depending on which one is chosen as the designated router.
c. Advertisement for N3 is done by R3 because it is the only
attached router and therefore the designated router.

Example: In the same Figure, which router (s) sends out


Network link LSAs?

Summary Link to Network LSA

Summary Link to Network LSA (contd)

An border router is active in more than one area and


creates routing table for each area.

Router R1 floods area 1 with information about how to reach a network


located in area 0.

17

7/29/2014

Summary Link to AS Boundary Router


providing the information of the route to an autonomous
boundary router

Summary Link to AS Boundary Router (contd)

used for a router that sends a packet outside the autonomous


system

External Link

External Link (contd)

used to know which networks are available outside the


autonomous system

18

7/29/2014

Other Packets

Network mask : The network mask associated with this interface.

Hello message
uses to create neighborhood relationships and to test the reachability of neighbors
is the first step in link state routing

HelloInterval: The number of seconds between this router's Hello packets.


Rtr Pri: This router's Router Priority. Used in (Backup) Designated Router election. If set
to 0, the router will be ineligible to become (Backup) Designated Router.

RouterDeadInterval: The number of seconds before declaring a silent router down.


Designated Router: The identity of the Designated Router for this network, in the view
of the advertising router. The Designated Router is identified here by its IP interface
address on the network. Set to 0.0.0.0 if there is no Designated Router.

Backup Designated Router: The identity of the Backup Designated Router for this
network, in the view of the advertising router. The Backup Designated Router is identified
here by its IP interface address on the network. Set to 0.0.0.0 if there is no Backup
Designated Router.

Neighbor: The Router IDs of each router from whom valid Hello packets have been seen
recently on the network. Recently means in the last RouterDeadInterval seconds.

Other Packets (contd)

Other Packets (contd)

Database description message


When router is connected to the system for the first time or after a
failure, it needs the complete link state database immediately
used when a router is connected to the system for the first time or
after a failure
After a router is connected to the system, the router sends hello packets to greet
its neighbor.
If it is first time that neighbors hear from the router, they send a database
description packet.

Link state acknowledgment packet


OSPF makes routing more reliable by forcing every router to
acknowledge the receipt of every link state update packet.

Link State Update Packet

The packet does not contain complete database information

Then, the router sends one or more link state request packets to get full
information about that particular link

used by a router to advertise the states of its links

Link State Request Packet


Is sent by a router that needs information about a specific route or
routes
It is answered with a link state update packet.

19

7/29/2014

Encapsulation of OSPF Packets

Interconnected ASes

Encapsulation
OSPF packets are encapsulated in IP datagram
3c
These packets contain the acknowledgment mechanism for flow
and error control

3b

3a
AS3
1a

Do not need a transport layer protocol to provide these services

2a

1c

AS2

1b

1d

2c

AS1

Intra-AS
Routing
algorithm

Inter-AS
Routing
algorithm

forwarding table
configured by both
intra- and inter-AS
routing algorithm

Forwarding
table

Inter-AS tasks

intra-AS sets entries for


internal dests
inter-AS & Intra-As sets
entries for external dests

Example: Setting forwarding table in router 1d


AS1 must:
1. learn which dests
reachable through
AS2, which through
AS3
2. propagate this
reachability info to all
routers in AS1
Job of inter-AS routing!

suppose router in AS1


receives datagram dest
outside of AS1
router should forward
packet to gateway
router, but which
one?

3c
3b

2b

3a
AS3
1a

2a

1c
1d

1b

2c
AS2

AS1

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

2b

3b

3a
AS3
1a

2a

1c
1d

1b AS1

2c

2b
AS2

20

7/29/2014

Example: Choosing among multiple ASes

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!

3c
3b

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.

3a
AS3
1a

2a

1c
1d

1b

2c
AS2

2b

AS1

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

Learn from inter-AS


protocol that subnet
x is reachable via
multiple gateways

Use routing info


from intra-AS
protocol to determine
costs of least-cost
paths to each
of the gateways

Hot potato routing:


Choose the gateway
that has the
smallest least cost

Determine from
forwarding table the
interface I that leads
to least-cost gateway.
Enter (x,I) in
forwarding table

Why path vector routing is needed?

Distance vector routing is subject to


instability if there is more than a few hops
in the domain of operation
Link state routing needs a huge amount of
resources to calculate routing tables. It
also creates heavy traffic because of
flooding
There is a need for a third protocol which
we call path vector routing

21

7/29/2014

Path Vector Routing

Initialization

The principle of path vector routing is similar to


distance vector routing
In path vector routing, we assume that there is
one node (in practice there can be more) in each
autonomous system that acts on behalf of the
entire autonomous system. Let us call it the
speaker node
The speaker node in an AS creates a routing
table and advertises it to speaker nodes in the
neighboring Ass
A speaker node advertises the path, not the
metric of the nodes, in its AS or other ASs

At the beginning, each speaker node can know


only the reachability of nodes inside its
autonomous system

Sharing

Updating

A speaker in an AS shares its table with


immediate neighbors

When a speaker node receives information from a


neighbor, it updates its own table by adding the nodes
that are not in its routing table and adding its own AS
and the AS that sent the table
After a while each speaker has a table and knows how to
reach each node in other ASs

22

7/29/2014

Loop Prevention

Aggregation

The instability of distance vector routing


and the creation of loops can be avoided
in path vector routing
When a router receives a message, it
checks to see if its AS is in the path list to
the destination
If it is, looping is involved and the
message is ignored

The path vector routing protocols normally support CIDR


notation and the aggregation of addresses
Note that a range may also include a block that may not
be in the corresponding AS
However, if this network exists in some other Ass, it
eventually becomes part of the routing table due to the
longest prefix principle

Policy Routing
For example, consider this IPv4 routing table (CIDR
notation is used):

192.168.20.16/28
192.168.0.0/16
When the address 192.168.20.19 needs to be looked up,
both entries in the routing table "match". That is, both
entries contain the looked up address. In this case, the
longest prefix of the candidate routes is 192.168.20.16/28,
since its subnet mask (/28) is higher than the other entry's
mask (/16), making the route more specific.

Policy routing can be easily implemented


through path vector routing
When a router receives a message, it can check
the path
If one of the AS listed in the path is against its
policy, it can ignore that path and that
destination
It does not update its routing table with this path,
and it does not send this message to its
neighbors

23

7/29/2014

Optimum Path

Internet inter-AS routing: BGP

We definitely cannot include metrics in a route because


each AS that is included in the path may use a different
criteria for the metric
One system may use, internally, RIP, which defines hop
count as the metric; another may use OSPF with
minimum delay defined as the metric
The optimum path is the path that fits the organization
In the example figure, each AS may have more than one
path to a destination. For the table, we chose the one
that had the smaller number of Ass, but this is not
always the case
Other criteria such as security and safety, and reliability
can also be applied

BGP (Border Gateway Protocol): the de facto


standard
BGP provides each AS a means to:

Types of Autonomous Systems

BGP Sessions

Stub AS. A stub AS has only one connection to


another AS
Multihomed AS. A multihomed AS has more
than one connection to other ASs, but it is still
only a source or sink for data traffic. It can
send/receive data traffic from more than one AS,
but there is no transient traffic
Transit AS. A transit AS is a multihomed AS
that also allows transient traffic

The exchange of routing information between 2


routers using BGP takes place in a session
A session is a connection that is established
between 2 BGP routers only for the sake of
exchange routing information
The create a reliable environment, BGP uses the
service of TCP. In other words, a session at the
BGP level, as an application program, is a
connection at the TCP level

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

24

7/29/2014

BGP Sessions (cont.)

External and Internal BGP

When a TCP connection is created for BGP, it


can last for a long time, until something unusual
happens.
For this reason, BGP sessions are sometimes
referred to as semi-permanent connections

BGP can have 2 types of session: external BGP (EBGP) and internal BGP (I-BGP) sessions
The E-BGP session is used to exchange information
between 2 speaker nodes belonging to 2 different Ass
The I-BGP session is used to exchange routing
information between 2 routers inside an AS

Note:
BGP uses the services of TCP
on port 179.

Distributing reachability info

Path Attributes

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
3b

3a
AS3
1a
AS1

iBGP session

2a

1c
1d

1b

2c
AS2

2b

The path presents in a list of ASs in the previous


example, in fact, it is a list of attributes
Each attribute gives some information about the
path. The list of attributes helps the receiving
router make a better decision when applying its
policy
Attributes are divided into 2 broad categories:
well-known and optional. A well known attribute
is one that every BGP router must recognize. An
optional attributes is one that needs not be
recognized by every router

25

7/29/2014

Path Attributes (cont.)

Why AS-PATH is needed?

Well-known attributes are themselves divided into 2


categories: mandatory and discretionary
A well-known mandatory attribute is one that must
appear in the description of a route
A well-known discretionary attribute is one that must be
recognized by each router, but is not required to be
included in every update message
Two important attributes:

AS1 and AS2 are connected by 2 peering links.


A router in AS1 could learn about 2 different
routes to the same prefix x. These 2 routes
could have the same AS-PATH to x, but could
have different NEXT-HOP values corresponding
to the different peering link. Using the AS-PATH
values and the intra-AS routing algorithm, the
router can determine the cost of the path to each
peering link, and then apply hot potato routing to
determine the appropriate interface

AS-PATH: contains ASs through which prefix advertisement has


passed
NEXT-HOP: is the router interface that begins the AS-PATH

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

26

7/29/2014

BGP routing policy

BGP routing policy (2)


legend:

B
W

provider
network
customer
network:

provider
network
customer
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

legend:

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 Bs customers
B wants to force C to route to w via A
B wants to route only to/from its customers!

Types of Packets

Packet Format

BGP uses 4 different type of messages: open, update,


keepalive, and notification

All BGP packets share the same common header. The


fields of this header are as follows:

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 request
NOTIFICATION: reports errors in previous msg; also used to
close connection

Marker. The 16-byte marker field is reserved for authentication


Length. The 2-byte field defines the length of the total message
including the header
Type. This 1-byte field defines the type of the packet

27

7/29/2014

Open Message

To create a neighborhood relationship, a


router running BGP opens a TCP
connection with a neighbor and sends an
open message
If the neighbor accepts the neighborhood
relationship, it responds with a keepalive
message, which means that a relationship
has been established between the 2
routers

Open Message (cont.)

My autonomous system. This defines the AS number


Hold time. This defines the maximum number of seconds
that can elapse until one of the parties receives a
keepalive or update message from the other. If a router
does not receive one of these message during the hold
time period, it considers the other party dead
BGP identifiers. This defines the IP address of the router
that sends the open message

Update Message

Update Message (cont.)

The update message is the heart of the BGP protocol. It is used by a


router to withdraw destination that have been advertised previously,
announce a route to a new destination, or both

The update message fields are listed below:


Unfeasible routes length. This defines the length of
the next field
Withdrawn routes. This fields lists all the routes that
must be deleted from the previously advertised list
Path attributes length. This defines the length of the
next field
Path attributes. This defines the attributes of the path
to the network whose reachability is being announced
in this message
Network layer reachability information (NLRI). This
defines the network that is actually advertised by this
message

28

7/29/2014

Keepalive Message

Notification Message

The routers (called peers in BGP parlance)


running the BGP protocols exchnage keepalive
messages regularly (before their hold time
expires) to tell each other that they are alive

A notification message is sent by a router


whenever an error condition is detected or a
router wants to close the connection

Notification Message (cont.)

The fields making up the notification message


follow:
Error code, Error subcode, and error data

29

7/29/2014

Path Vector Routing

Path Vector Routing (contd)

is similar to distance vector routing

Initialization
Each speaker node can know only the reach-ability of nodes inside
its AS

Assuming that there is one node in each AS that acts as on


behalf of the entire AS: Speaker Node

Speaker node creates a routing table and advertises it


speaker nodes in the neighboring ASs

advertising the path, not the metric of the nodes

30

7/29/2014

Path Vector Routing (contd)

14.7 BGP

Border Gateway Protocol is an interdomain routing protocol using path


vector routing

Distance vector routing and link state routing

Sharing and Updating

distance vector routing : just considering the number of hops

link state routing : requiring each router to have a huge link state database

Path Vector Routing

Each entry in the routing table contains the destination network, the next router, and
the path to reach the destination

The path is usually defined as an ordered list of autonomous systems that a packet
should travel through to reach the destination

BGP (contd)

BGP (contd)

Stub AS

has only one connection to another AS

Multihomed AS
has more than one connection to other AS

Path attributes
Well-known attributes
well-known mandatory : ORIGIN (RIP, OSPF, and so on), AS-PATH,
NEXT_HOP
well-known discretionary

Transit AS
is a multihomed AS that also allows transient traffic.
ex) national and international ISPs

Optional attributes
Optional transitive : must be passed to the next router by the router has
not implemented this attribute
Optional nontransitive : must be discarded if the receiving router has
not implemented this attribute

31

7/29/2014

BGP (contd)

BGP (contd)

BGP Session

Types of Packets

Use of services of TCP


Referred to as semi-permanent connections

External and Internal BGP


Packet Format (common header)
Reserved for authentication

Total message
including the header

BGP (contd)

BGP (contd)

Open message
To create a neighborhood relationship, a router running BGP
opens a TCP connection with a neighbor and sends an open
message

Encapsulation
BGP messages are encapsulated in TCP segments using the wellknown port 179

Update message
used by a router to withdraw destinations that have been
advertised previously, announce a route to a new destination,
or both

Keepalive message
exchange keepalive messages regularly (before their hold time
expires) to tell each other that routers are alive

Notification message
sent by a router whenever an error condition is detected or a
router wants to close the connection

32

S-ar putea să vă placă și