Link State Routing - OS3 State Routing In particular OSPF Karst Koymans ... OSPF packet details OSPF...

110
. . Link State Routing In particular OSPF Karst Koymans Informatics Institute University of Amsterdam (version 15.2, 2016/02/29 09:41:51) Tuesday, March 1, 2016 Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 1 / 85

Transcript of Link State Routing - OS3 State Routing In particular OSPF Karst Koymans ... OSPF packet details OSPF...

.

......

Link State RoutingIn particular OSPF

Karst Koymans

Informatics InstituteUniversity of Amsterdam

(version 15.2, 2016/02/29 09:41:51)

Tuesday, March 1, 2016

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 1 / 85

...1 Link State ProtocolsBasic ideasProblems and pitfalls

...2 OSPFRationaleParametersDatabasesNetwork representation and architecture

...3 OSPF packet detailsOSPF packet headerThe different types of OSPF packetsLink State Advertisement packets

...4 OSPF for IPv6

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 2 / 85

Link State Protocols

Outline

...1 Link State ProtocolsBasic ideasProblems and pitfalls

...2 OSPFRationaleParametersDatabasesNetwork representation and architecture

...3 OSPF packet detailsOSPF packet headerThe different types of OSPF packetsLink State Advertisement packets

...4 OSPF for IPv6

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 3 / 85

Link State Protocols Basic ideas

Outline

...1 Link State ProtocolsBasic ideasProblems and pitfalls

...2 OSPFRationaleParametersDatabasesNetwork representation and architecture

...3 OSPF packet detailsOSPF packet headerThe different types of OSPF packetsLink State Advertisement packets

...4 OSPF for IPv6

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 4 / 85

Link State Protocols Basic ideas

Link State Protocol

A Link State ProtocolBuilds on complete information about the network topologyUses Dijkstra’s Single Source Shortest Path Tree algorithmReplaces a distance vector protocolin the case of more complex topologiesHas a faster convergence time than distance vector protocols

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 5 / 85

Link State Protocols Basic ideas

Link State Packets

Link State Packets (LSPs) represent the state of a router

and its links to the rest of the network

This representation would suffice for point to point links

Broadcast networks (LANs) and NBMA networks are representedby virtual nodes inside the topology

Designated routers (DRs) speak on their behalf

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 6 / 85

Link State Protocols Basic ideas

Non-broadcast networks

NBMANon-Broadcast Multiple AccessFull mesh of connectivity, but not all at onceTopological connectivity via elected DR

Point-to-MultipointA subset of the collection of all point-to-point linksNo full mesh of connectivityConsidered as multiple instances of point-to-point linksHence no DR is elected

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 7 / 85

Link State Protocols Basic ideas

Learn to know your neighbours

Easy on point to point linksJust send out greetings (hello packets)Both ends will become adjacent

A little more advanced on broadcast networksSend out hello packets using multicastNot all neighbours will become adjacent

Only those that are neighbors in the virtual topologyOne of the adjacent routers is always a DR

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 8 / 85

Link State Protocols Basic ideas

LSP generation

Periodic announcements with a long period (like 30 minutes)Very much different from RIP (30 seconds)

Triggered updates are sent as soon as there are changesDetection of a new neighbour (link or node coming up)Detection of a link or node failureChange of link cost

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 9 / 85

Link State Protocols Basic ideas

LSP distribution

LSPs are distributed throughout the network

Distribution can’t use the routing database for distant nodes

Why? What is the difference with RIP here?

Ordinary flooding is problematic. . . , why?

It would need a “TTL” to prevent loopsIt could cause exponential multiplication of packets

Smart flooding recognizes identical LSPs

Causing propagation to be tree-like

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 10 / 85

Link State Protocols Basic ideas

LSP distribution

LSPs are distributed throughout the networkDistribution can’t use the routing database for distant nodes

Why? What is the difference with RIP here?

Ordinary flooding is problematic. . . , why?

It would need a “TTL” to prevent loopsIt could cause exponential multiplication of packets

Smart flooding recognizes identical LSPs

Causing propagation to be tree-like

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 10 / 85

Link State Protocols Basic ideas

LSP distribution

LSPs are distributed throughout the networkDistribution can’t use the routing database for distant nodes

Why? What is the difference with RIP here?

Ordinary flooding is problematic. . . , why?

It would need a “TTL” to prevent loopsIt could cause exponential multiplication of packets

Smart flooding recognizes identical LSPs

Causing propagation to be tree-like

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 10 / 85

Link State Protocols Basic ideas

LSP distribution

LSPs are distributed throughout the networkDistribution can’t use the routing database for distant nodes

Why? What is the difference with RIP here?

Ordinary flooding is problematic. . . , why?

It would need a “TTL” to prevent loopsIt could cause exponential multiplication of packets

Smart flooding recognizes identical LSPs

Causing propagation to be tree-like

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 10 / 85

Link State Protocols Basic ideas

LSP distribution

LSPs are distributed throughout the networkDistribution can’t use the routing database for distant nodes

Why? What is the difference with RIP here?

Ordinary flooding is problematic. . . , why?

It would need a “TTL” to prevent loops

It could cause exponential multiplication of packets

Smart flooding recognizes identical LSPs

Causing propagation to be tree-like

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 10 / 85

Link State Protocols Basic ideas

LSP distribution

LSPs are distributed throughout the networkDistribution can’t use the routing database for distant nodes

Why? What is the difference with RIP here?

Ordinary flooding is problematic. . . , why?

It would need a “TTL” to prevent loopsIt could cause exponential multiplication of packets

Smart flooding recognizes identical LSPs

Causing propagation to be tree-like

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 10 / 85

Link State Protocols Basic ideas

LSP distribution

LSPs are distributed throughout the networkDistribution can’t use the routing database for distant nodes

Why? What is the difference with RIP here?

Ordinary flooding is problematic. . . , why?

It would need a “TTL” to prevent loopsIt could cause exponential multiplication of packets

Smart flooding recognizes identical LSPs

Causing propagation to be tree-like

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 10 / 85

Link State Protocols Basic ideas

LSP distribution

LSPs are distributed throughout the networkDistribution can’t use the routing database for distant nodes

Why? What is the difference with RIP here?

Ordinary flooding is problematic. . . , why?

It would need a “TTL” to prevent loopsIt could cause exponential multiplication of packets

Smart flooding recognizes identical LSPs

Causing propagation to be tree-like

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 10 / 85

Link State Protocols Problems and pitfalls

Outline

...1 Link State ProtocolsBasic ideasProblems and pitfalls

...2 OSPFRationaleParametersDatabasesNetwork representation and architecture

...3 OSPF packet detailsOSPF packet headerThe different types of OSPF packetsLink State Advertisement packets

...4 OSPF for IPv6

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 11 / 85

Link State Protocols Problems and pitfalls

Most recent LSP problem

LSPs may arrive out of order

Therefore we need a mechanism to recognize older packetsWhat mechanisms are available for this recognition?

What about using timestamps?

Timestamps cause trouble if clocksare not synchronised or out of order!

What about using sequence numbers?

Sequence numbers need an ageing procedureto protect from stale informationfor instance when a router rebootsand starts from scratch

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 12 / 85

Link State Protocols Problems and pitfalls

Most recent LSP problem

LSPs may arrive out of order

Therefore we need a mechanism to recognize older packetsWhat mechanisms are available for this recognition?

What about using timestamps?

Timestamps cause trouble if clocksare not synchronised or out of order!

What about using sequence numbers?

Sequence numbers need an ageing procedureto protect from stale informationfor instance when a router rebootsand starts from scratch

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 12 / 85

Link State Protocols Problems and pitfalls

Most recent LSP problem

LSPs may arrive out of order

Therefore we need a mechanism to recognize older packets

What mechanisms are available for this recognition?

What about using timestamps?

Timestamps cause trouble if clocksare not synchronised or out of order!

What about using sequence numbers?

Sequence numbers need an ageing procedureto protect from stale informationfor instance when a router rebootsand starts from scratch

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 12 / 85

Link State Protocols Problems and pitfalls

Most recent LSP problem

LSPs may arrive out of order

Therefore we need a mechanism to recognize older packetsWhat mechanisms are available for this recognition?

What about using timestamps?

Timestamps cause trouble if clocksare not synchronised or out of order!

What about using sequence numbers?

Sequence numbers need an ageing procedureto protect from stale informationfor instance when a router rebootsand starts from scratch

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 12 / 85

Link State Protocols Problems and pitfalls

Most recent LSP problem

LSPs may arrive out of order

Therefore we need a mechanism to recognize older packetsWhat mechanisms are available for this recognition?

What about using timestamps?

Timestamps cause trouble if clocksare not synchronised or out of order!

What about using sequence numbers?

Sequence numbers need an ageing procedureto protect from stale informationfor instance when a router rebootsand starts from scratch

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 12 / 85

Link State Protocols Problems and pitfalls

Most recent LSP problem

LSPs may arrive out of order

Therefore we need a mechanism to recognize older packetsWhat mechanisms are available for this recognition?

What about using timestamps?Timestamps cause trouble if clocksare not synchronised or out of order!

What about using sequence numbers?

Sequence numbers need an ageing procedureto protect from stale informationfor instance when a router rebootsand starts from scratch

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 12 / 85

Link State Protocols Problems and pitfalls

Most recent LSP problem

LSPs may arrive out of order

Therefore we need a mechanism to recognize older packetsWhat mechanisms are available for this recognition?

What about using timestamps?Timestamps cause trouble if clocksare not synchronised or out of order!

What about using sequence numbers?

Sequence numbers need an ageing procedureto protect from stale informationfor instance when a router rebootsand starts from scratch

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 12 / 85

Link State Protocols Problems and pitfalls

Most recent LSP problem

LSPs may arrive out of order

Therefore we need a mechanism to recognize older packetsWhat mechanisms are available for this recognition?

What about using timestamps?Timestamps cause trouble if clocksare not synchronised or out of order!

What about using sequence numbers?Sequence numbers need an ageing procedureto protect from stale informationfor instance when a router rebootsand starts from scratch

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 12 / 85

Pitfalls

Sequence numbers may wrap

Sequence number ordering is not a total ordering,

not even a partial ordering

a < b < c < d < e < f < g < h < a

Link State Protocols Problems and pitfalls

Intermezzo

The devilish dice

There are three dice, A, B and C such thatA is better than BB is better than CC is better than A

A:114444 B:333333 C:222255

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 14 / 85

Link State Protocols Problems and pitfalls

Intermezzo

The devilish dice

There are three dice, A, B and C such thatA is better than BB is better than CC is better than A

A:114444

B:333333 C:222255

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 14 / 85

Link State Protocols Problems and pitfalls

Intermezzo

The devilish dice

There are three dice, A, B and C such thatA is better than BB is better than CC is better than A

A:114444 B:333333

C:222255

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 14 / 85

Link State Protocols Problems and pitfalls

Intermezzo

The devilish dice

There are three dice, A, B and C such thatA is better than BB is better than CC is better than A

A:114444 B:333333 C:222255

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 14 / 85

ARPANET lockup (real historic event)

Suppose we have sequence numbers a, b, c with a < b < c < a

Why didn’t ageing do its job?

Link State Protocols Problems and pitfalls

Lockup solution

Use an age (or ttl) field

which will be increased (or decreased) periodicallyand always increase the age (decrease the ttl)by at least one when passing the LSP on

Forgetting this was the main problemin the total ARPANET lockup

Use a very large sequence number space

and wait for timeouts after overflowwhile reflooding LSPs with maximum age

Causing those to time out prematurely

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 16 / 85

Link State Protocols Problems and pitfalls

Lockup solution

Use an age (or ttl) field

which will be increased (or decreased) periodicallyand always increase the age (decrease the ttl)by at least one when passing the LSP on

Forgetting this was the main problemin the total ARPANET lockup

Use a very large sequence number space

and wait for timeouts after overflowwhile reflooding LSPs with maximum age

Causing those to time out prematurely

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 16 / 85

Link State Protocols Problems and pitfalls

Lockup solution

Use an age (or ttl) fieldwhich will be increased (or decreased) periodically

and always increase the age (decrease the ttl)by at least one when passing the LSP on

Forgetting this was the main problemin the total ARPANET lockup

Use a very large sequence number space

and wait for timeouts after overflowwhile reflooding LSPs with maximum age

Causing those to time out prematurely

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 16 / 85

Link State Protocols Problems and pitfalls

Lockup solution

Use an age (or ttl) fieldwhich will be increased (or decreased) periodicallyand always increase the age (decrease the ttl)by at least one when passing the LSP on

Forgetting this was the main problemin the total ARPANET lockup

Use a very large sequence number space

and wait for timeouts after overflowwhile reflooding LSPs with maximum age

Causing those to time out prematurely

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 16 / 85

Link State Protocols Problems and pitfalls

Lockup solution

Use an age (or ttl) fieldwhich will be increased (or decreased) periodicallyand always increase the age (decrease the ttl)by at least one when passing the LSP on

Forgetting this was the main problemin the total ARPANET lockup

Use a very large sequence number space

and wait for timeouts after overflowwhile reflooding LSPs with maximum age

Causing those to time out prematurely

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 16 / 85

Link State Protocols Problems and pitfalls

Lockup solution

Use an age (or ttl) fieldwhich will be increased (or decreased) periodicallyand always increase the age (decrease the ttl)by at least one when passing the LSP on

Forgetting this was the main problemin the total ARPANET lockup

Use a very large sequence number space

and wait for timeouts after overflowwhile reflooding LSPs with maximum age

Causing those to time out prematurely

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 16 / 85

Link State Protocols Problems and pitfalls

Lockup solution

Use an age (or ttl) fieldwhich will be increased (or decreased) periodicallyand always increase the age (decrease the ttl)by at least one when passing the LSP on

Forgetting this was the main problemin the total ARPANET lockup

Use a very large sequence number spaceand wait for timeouts after overflow

while reflooding LSPs with maximum age

Causing those to time out prematurely

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 16 / 85

Link State Protocols Problems and pitfalls

Lockup solution

Use an age (or ttl) fieldwhich will be increased (or decreased) periodicallyand always increase the age (decrease the ttl)by at least one when passing the LSP on

Forgetting this was the main problemin the total ARPANET lockup

Use a very large sequence number spaceand wait for timeouts after overflowwhile reflooding LSPs with maximum age

Causing those to time out prematurely

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 16 / 85

Link State Protocols Problems and pitfalls

Lockup solution

Use an age (or ttl) fieldwhich will be increased (or decreased) periodicallyand always increase the age (decrease the ttl)by at least one when passing the LSP on

Forgetting this was the main problemin the total ARPANET lockup

Use a very large sequence number spaceand wait for timeouts after overflowwhile reflooding LSPs with maximum age

Causing those to time out prematurely

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 16 / 85

OSPF

Outline

...1 Link State ProtocolsBasic ideasProblems and pitfalls

...2 OSPFRationaleParametersDatabasesNetwork representation and architecture

...3 OSPF packet detailsOSPF packet headerThe different types of OSPF packetsLink State Advertisement packets

...4 OSPF for IPv6

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 17 / 85

OSPF Rationale

Outline

...1 Link State ProtocolsBasic ideasProblems and pitfalls

...2 OSPFRationaleParametersDatabasesNetwork representation and architecture

...3 OSPF packet detailsOSPF packet headerThe different types of OSPF packetsLink State Advertisement packets

...4 OSPF for IPv6

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 18 / 85

OSPF Rationale

OSPF advantages (1)

OSPFIntroduces hierarchical routingSupports subnetsUses efficient multicast for floodingSupports point-to-point, broadcast, NBMAand point-to-multipoint networksUses metrics built on cost, per interface

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 19 / 85

OSPF Rationale

OSPF advantages (2)

OSPFSupports virtual links for backbone connectivitySupports load balancingSupports unnumbered interfaces/networksHas built in authentication

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 20 / 85

OSPF Rationale

OSPF fun :)

IETF T-shirtIS − IS = 0The old time IETF versus ISO controversy

But OSPF in fact really builds onBBN’s research on SPFEarly versions of OSI’s IS-IS

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 21 / 85

OSPF Rationale

Some OSPF facts

OSPF builds directly upon IP (not on UDP)OSPF uses protocol type 89

Current OSPF version is 2RFC 2328 (Moy, 1998)RFC 2740 (OSPF for IPv6, 1999) ⇒ version 3

Obsoleted by RFC 5340 (2008)

OSPF uses LSA (Link State Advertisement)

terminology instead of LSP (Link State Packet)

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 22 / 85

OSPF Parameters

Outline

...1 Link State ProtocolsBasic ideasProblems and pitfalls

...2 OSPFRationaleParametersDatabasesNetwork representation and architecture

...3 OSPF packet detailsOSPF packet headerThe different types of OSPF packetsLink State Advertisement packets

...4 OSPF for IPv6

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 23 / 85

OSPF Parameters

Timers and Overflow

These must be the same for all OSPF neighboursOtherwise the neighbours won’t talk at allHelloInterval (default 10 sec)RouterDeadInterval (default 40 sec)

In the case of a database overflow

external routing information is dropped first

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 24 / 85

OSPF Databases

Outline

...1 Link State ProtocolsBasic ideasProblems and pitfalls

...2 OSPFRationaleParametersDatabasesNetwork representation and architecture

...3 OSPF packet detailsOSPF packet headerThe different types of OSPF packetsLink State Advertisement packets

...4 OSPF for IPv6

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 25 / 85

OSPF Databases

Consistent LSA Databases

LSAs must be acknowledged

LSAs (and their acks) are queued/flagged for transmission

LSAs must time out at about the same timeby using triggered (re)distribution of age MaxAge packets

for LSAs with an existing sequence numberwhich must be honored. . .. . . only if there is already an LSAfor this node in the local database

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 26 / 85

OSPF Network representation and architecture

Outline

...1 Link State ProtocolsBasic ideasProblems and pitfalls

...2 OSPFRationaleParametersDatabasesNetwork representation and architecture

...3 OSPF packet detailsOSPF packet headerThe different types of OSPF packetsLink State Advertisement packets

...4 OSPF for IPv6

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 27 / 85

OSPF Network representation and architecture

(Backup) Designated Router

A Designated Router (DR) and

a Backup Designated Router (BDR)

is elected on every multi-access network using Hello packets

The (B)DR represents the network as a virtual node

in the graph and acts on the network’s behalf

The DR/BDR election process is stickyThis is one of the main differences with IS-IS

The priority of routers can be configured

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 28 / 85

Multicast usage

On LANs every router becomes “adjacent” to the Designated Router

Multicast1 to AllDRouters (224.0.0.6)

Multicast1 to AllSPFRouters (224.0.0.5)

There is also a unicast Ack from the DR back to R1OSPFv3 for IPv6 uses FF02::6 and FF02::5

Hierarchical routing

Area 0 is the backbone area

“Limbs” (non-backbone) are all other areas, not equal to 0

Virtual Links

Area 5 is not physically connected to the backbone

A virtual link extends the backbone to the new ABR

and behaves as an unnumbered point to point link

OSPF Network representation and architecture

Inter Area Summary (IAS)

IASs are injected by ABRs

IASs make use of a hub and spoke topology

Summary information is spread “RIP-like”

There are no loops or slow convergence

Virtual links maintain the hub and spoke topologyThese virtual spokes are in fact paths through their“transit area” treated as unnumbered links in the backbone

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 32 / 85

OSPF Network representation and architecture

Router roles

Backbone routerHas at least one interface inside area 0

Internal routerAll interfaces are completely within a single area(backbone or otherwise)

Area Border Router (ABR)Has an interface inside area 0 and one or more other areas

Autonomous System Boundary Router (ASBR)Participates in another (external) routing protocol

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 33 / 85

OSPF Network representation and architecture

Area Border Router (ABR)

Attaches to multiple areas

Runs multiple copies of the basic algorithmOne copy for each area

Summarizes area data (destination networks) towards the backbone

Receives summarized data from the backbone about other areas

including the backbone itself

Can aggregate summary data

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 34 / 85

OSPF Network representation and architecture

Autonomous System Boundary Router (ASBR)

Can be part of any area

Interfaces with other routing protocolsBGP, RIP, IS-IS, OSPF, . . .

Injects external routes into OSPF

ASBR notion is independent of backbone, internal or ABR router

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 35 / 85

OSPF Network representation and architecture

Stub(by) area

A stub(by) area is an area into which no external

routing information is injected by the ABRs

It uses a default route for all external destinations

The default route is injected by all ABRs

A totally stubby area is a stubby area into which

not even inter-area summaries are injected

A not so stubby area is a stubby area inside which certain

external information is originated and flooded locally

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 36 / 85

OSPF packet details

Outline

...1 Link State ProtocolsBasic ideasProblems and pitfalls

...2 OSPFRationaleParametersDatabasesNetwork representation and architecture

...3 OSPF packet detailsOSPF packet headerThe different types of OSPF packetsLink State Advertisement packets

...4 OSPF for IPv6

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 37 / 85

OSPF packet details OSPF packet header

Outline

...1 Link State ProtocolsBasic ideasProblems and pitfalls

...2 OSPFRationaleParametersDatabasesNetwork representation and architecture

...3 OSPF packet detailsOSPF packet headerThe different types of OSPF packetsLink State Advertisement packets

...4 OSPF for IPv6

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 38 / 85

OSPF packet details OSPF packet header

OSPF packet header (24 bytes)

0 7 8 15 16 31

Version Type Packet lengthRouter IDArea ID

Checksum AuType

Authentication

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 39 / 85

OSPF packet details OSPF packet header

OSPF packet header fields.OSPF packet header fields..

......

Version 2

Type 1–5 (see next slide)

Packet length Total length, including this header

Router ID ID of packet sending router

Area ID The area a packet belongs to (is destined for)

Checksum One’s complement checksum

AuType Null, Simple or Crypto

Authentication “Pointer to message digest” (Crypto)

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 40 / 85

OSPF packet details OSPF packet header

OSPF packet types

.OSPF packet types..

......

Type Meaning

1 Hello

2 Database Description

3 Link State Request

4 Link State Updatea

5 Link State Acknowledgementb

aThese contain the Link State AdvertisementsbDon’t confuse these with LSAs

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 41 / 85

OSPF packet details The different types of OSPF packets

Outline

...1 Link State ProtocolsBasic ideasProblems and pitfalls

...2 OSPFRationaleParametersDatabasesNetwork representation and architecture

...3 OSPF packet detailsOSPF packet headerThe different types of OSPF packetsLink State Advertisement packets

...4 OSPF for IPv6

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 42 / 85

OSPF packet details The different types of OSPF packets

OSPF Hello packet (20 + N ∗ 4 bytes)

0 15 16 23 24 31

Network MaskHelloInterval Options Rtr Pri

RouterDeadIntervalDesignated Router

Backup Designated RouterNeighbor #1

...Neighbor #N

Repeated foreach neighborthat is alive

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 43 / 85

OSPF packet details The different types of OSPF packets

OSPF Hello packet fields.Hello fields..

......

Network Mask Subnet mask of link

HelloInterval Interval in seconds between hello packets

Options Multiple metrics (Ta); no stub area (E)

Rtr Pri Router priority, used for DR election

RouterDeadInterval Interval to consider a silent neighbor dead

Designated Router IP address of designated router

Backup Designated Router IP address of backup designated router

Neighbor Living neighbor IDs

aDeprecated because of lack of experience with TOSKarst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 44 / 85

OSPF packet details The different types of OSPF packets

OSPF DD packet (8 + N ∗ 20 bytes)

0 15 16 23 24 31

Interface MTU Options 00000 I MMS

DD sequence numberLSA header #1

...LSA header #N

Fragment ofdatabase withonly headers

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 45 / 85

OSPF packet details The different types of OSPF packets

OSPF DD packet fields.DD fields..

......

Interface MTU Detection of MTU mismatch

Options Same as for Hello packets

I Init bit (first packet)

M More bit (more packets follow)

MS Master/Slave bit

DD sequence number Used for ordering DD packets

LSA header Link state database LSA instance identitya

aSpecific LSA instance, including age and sequence number

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 46 / 85

OSPF packet details The different types of OSPF packets

OSPF LS request packet (N ∗ 12 bytes)

0 31

LS typeLink State ID

Advertising Router

Multipleoccurrences

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 47 / 85

OSPF packet details The different types of OSPF packets

OSPF LS request packet fields

.LS request fields..

......

LS type Link type of the LSA

Link State ID ID of (link type specific part of) the LSA

Advertising Router Router ID of originating router

These three fields are part of the LSA header.Note that these request packets do not include an age or sequence number.Together these entries uniquely identify an LSA, but not an LSA instance.The Database Description packets refer to a specific LSA instance,but still without actual data.

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 48 / 85

OSPF packet details The different types of OSPF packets

OSPF LS Update packet

0 31

# LSAs (N)LSA #1

hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

LSA #N

N occurrences

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 49 / 85

OSPF packet details The different types of OSPF packets

OSPF LS Update packet fields

.LS Update fields..

......

# LSAs Number of LSAs inside the update packet

LSA #i A complete Link State Advertisement

Link State Updates contain complete and specific instances ofLink State Advertisements (LSAs) with all relevant data.The LSAs have a variable size, depending on LS type.

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 50 / 85

OSPF packet details The different types of OSPF packets

OSPF LS Acknowledgement packet (N ∗ 20 bytes)

0 31

LSA header #1hhhhhhhhhhhhhhhhhhhhhhhh

hhhhhhhhhhhhhhhhhhhhhhhh

LSA header #N

N occurrences

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 51 / 85

OSPF packet details The different types of OSPF packets

OSPF LS Acknowledgement packet fields

.LS Acknowledgement fields..

...... LSA header #i A complete Link State Advertisement header

Link State Acknowledgements again refer to specific instances,but contain no actual data.

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 52 / 85

OSPF packet details Link State Advertisement packets

Outline

...1 Link State ProtocolsBasic ideasProblems and pitfalls

...2 OSPFRationaleParametersDatabasesNetwork representation and architecture

...3 OSPF packet detailsOSPF packet headerThe different types of OSPF packetsLink State Advertisement packets

...4 OSPF for IPv6

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 53 / 85

OSPF packet details Link State Advertisement packets

Link State Advertisements

Multiple LSAs may be found inside a Link State Update packet

Every LSA consists ofLSA header (20 bytes)LS(A) type specific content

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 54 / 85

OSPF packet details Link State Advertisement packets

LSA header (20 bytes)

0 15 16 23 24 31

LS age Options LS typeLink State ID

Advertising RouterLS sequence number

LS Checksum Length

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 55 / 85

OSPF packet details Link State Advertisement packets

LSA header fields.LSA header fields..

......

LS age Time in seconds since the LSA was originated

Options Same as for Hello packets

LS type Link type of the LSA (see next slide)

Link State ID ID of (link type specific part of) the LSA

Advertising Router Router ID of originating router

LS sequence number Used for most recent check of LSA packets

LS Checksum The Fletcher checksum of the LSA (without age)

Length Length in bytes of the LSA, including the header

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 56 / 85

OSPF packet details Link State Advertisement packets

LS types

.LS types..

......

LS Type Meaning

1 Router LSA

2 Network LSA

3 Network Summary LSA

4 AS Boundary Router Summary LSA

5 AS External LSA

7 NSSA LSA (see next slide)

Topological (1,2), prefix (3,5,7) and mixed (4) informationKarst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 57 / 85

OSPF packet details Link State Advertisement packets

NSSA

NSSA stands for “Not So Stubby Area”

Support for certain external routes throughout the area itself

NSSA uses its own special type (7)

These LSAs are translated at the ABR into ordinary

external LSAs (type 5) for the rest of the OSPF domain

It is common to inject a type 7 default route from the

NSSA boundary router(s) into the NSSA

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 58 / 85

OSPF packet details Link State Advertisement packets

Link State IDs.Link State IDs..

......

LS Type Link State ID meaning

1 ID of originating router

2 IP address of the network’s DR

3 The destination network’s address

4 ID of described ASBR

5 The destination network’s address

7 The destination network’s address

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 59 / 85

Representation of routers and networks

Source: RFC 2328

Representation of point to multipoint networks

Source: RFC 2328

Example OSPF network from RFC 2328

Source: RFC 2328

The directed graph for the example network

Source: RFC 2328

The shortest path tree from router RT6

Source: RFC 2328

Router (RT12) and network (N9) LSAs

Source: RFC 2328

OSPF packet details Link State Advertisement packets

Link State IDs

.Link State IDs..

......

LS Type Link State ID meaning1 ID of originating router2 IP address of the network’s DR3 The destination network’s address4 ID of described ASBR5 The destination network’s address7 The destination network’s address

Router LSA Link State ID

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 66 / 85

OSPF packet details Link State Advertisement packets

Router LSA (LS type = 1) without header

0 7 8 1516 31

0 V E B 0 # LinksLink ID

Link DataType # TOS MetricTOS 0 TOS metric

repeated# Linkstimes

}# TOS times2

Originated by every routerFlooded throughout the area(s) the router belongs to

2For backward compatibility (but never really implemented or used)Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 67 / 85

OSPF packet details Link State Advertisement packets

Router LSA fields

.Router LSA fields..

......

V Router is virtual link endpointE Router is AS Boundary RouterB Router is Area Border Router

# Links Number of router links describedLink ID ID of the connected “network”

Link Data Extra information on “network”Type Type of connected “network”

# TOS Number of extra TOSs (usually 0)Metric Cost of link

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 68 / 85

OSPF packet details Link State Advertisement packets

Router LSA type field

.Router LSA type field..

......

Type Meaning

1 Point-to-point link

2 Transit network

3 Stub network

4 Virtual link

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 69 / 85

OSPF packet details Link State Advertisement packets

Router LSA Link ID field

.Router LSA Link ID field..

......

Type Meaning

1 ID of neighbor router

2 IP address of designated router

3 IP (sub)network numbera

4 ID of neighbor router

aThis can also be a host (with a /32 mask in the link data)

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 70 / 85

OSPF packet details Link State Advertisement packets

Router LSA Link Data field

.Router LSA Link Data field..

......

Type Meaning

1 Originating router’s interface IP address

2 Originating router’s interface IP address

3 Connected (sub)network mask

4 Originating router’s interface IP address

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 71 / 85

OSPF packet details Link State Advertisement packets

Link State IDs.Link State IDs..

......

LS Type Link State ID meaning

1 ID of originating router

2 IP address of the network’s DR

3 The destination network’s address

4 ID of described ASBR

5 The destination network’s address

7 The destination network’s address

Network LSA Link State IDKarst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 72 / 85

OSPF packet details Link State Advertisement packets

Network LSA (LS type = 2) without header

4 + N ∗ 4 bytes

0 31

Network MaskAttached Router

}Repeated for each attached router

Originated by Designated Router

Flooded throughout the area

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 73 / 85

OSPF packet details Link State Advertisement packets

Network LSA fields

.Network LSA fields..

......

Network Mask (Sub)network maska

Attached Router Router ID of router(s) on network

aWhere is the network itself defined?

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 74 / 85

OSPF packet details Link State Advertisement packets

Link State IDs.Link State IDs..

......

LS Type Link State ID meaning

1 ID of originating router

2 IP address of the network’s DR

3 The destination network’s address

4 ID of described ASBR

5 The destination network’s address

7 The destination network’s address

Summary LSA Link State IDKarst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 75 / 85

OSPF packet details Link State Advertisement packets

Summary LSA (type = 3, 4) without header

0 7 8 31

Network Mask3

0 MetricTOS TOS metric

}for each desired TOS

Originated by Area Border Router

Flooded throughout the area(s)

3Only relevant for type 3Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 76 / 85

OSPF packet details Link State Advertisement packets

Summary LSA fields

.Summary LSA fields..

......

Network Maska Address mask for the advertised destination

Metric Cost to advertised destination

aOnly relevant for type 3

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 77 / 85

OSPF packet details Link State Advertisement packets

Link State IDs

.Link State IDs..

......

LS Type Link State ID meaning1 ID of originating router2 IP address of the network’s DR3 The destination network’s address4 ID of described ASBR5 The destination network’s address7 The destination network’s address

External LSA Link State ID

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 78 / 85

OSPF packet details Link State Advertisement packets

AS External LSA (LS type 5) without header

0 7 8 31

Network MaskE 0 Metric

Forwarding addressExternal Route Tag

E TOS TOS metricForwarding addressExternal Route Tag

for each desired TOS

Originated by AS Boundary RouterFlooded throughout the whole AS

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 79 / 85

OSPF packet details Link State Advertisement packets

AS External LSA fields

.AS External LSA fields..

......

Network Mask Address mask for the advertised destination

E External cost is higher than internal cost

Metric Cost to advertised destination

Forwarding address Comparable to Next Hop in RIP

External Route Tag Comparable to Route Tag in RIP

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 80 / 85

OSPF for IPv6

Outline

...1 Link State ProtocolsBasic ideasProblems and pitfalls

...2 OSPFRationaleParametersDatabasesNetwork representation and architecture

...3 OSPF packet detailsOSPF packet headerThe different types of OSPF packetsLink State Advertisement packets

...4 OSPF for IPv6

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 81 / 85

OSPF for IPv6

OSPF for IP version 6

Also referred to as OSPFv3

Published as RFC 5340

Extensive, incompatible modification of OSPFv2Therefore needs a new version number (3)

Basic functionality is the sameFlooding, areas, SPT, DRs, . . .

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 82 / 85

OSPF for IPv6

Important changes

All addressing semantics moved to LSA payload

Works per-link instead of per-subnetIntroduces a new link-LSA

Introduces explicit flooding scopeLink scope, Area scope and AS scope

Removes authentication from packet headerAuthentication uses AH and ESP headers

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 83 / 85

OSPF for IPv6

Router and network LSAs

Do not contain address information any moreOnly topological connectivityNo IPv6 prefix informationNetwork protocol independent

Prefix information on transit and stub networks is inside a newintra-area-prefix-LSA

Link-LSAs now distributeLink local addresses of routersIPv6 prefixes used on the linkOption announcements for network LSAs

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 84 / 85

OSPF for IPv6

LSA renamings

Type-3 summary-LSAs are now calledinter-area-prefix-LSAs

Type-4 summary LSAs are now calledinter-area-router-LSAs

Karst Koymans (UvA) Link State Routing Tuesday, March 1, 2016 85 / 85