You are on page 1of 10

Download PNETLab Platform

PNETLAB Store
PNETLab.com

SEGMENT ROUTING BASIC IGP (OSPF)

Lab Topology:
Please use the following topology to complete this lab exercise:

https://user.pnetlab.com/store/labs/detail?id=16025164534227

Lab Objective:
The objective of this lab exercise is for you to learn and understand how can you configure
Segment Routing in IGP (OSPF)

Task list:
Task 1: Configure the hostname and IP address for the interface for Routers as topo.
Task 2: Config Segment Routing Global Block for each Router as following table :

Router Segment Routing Global Block


R1 16000 – 23999
R2 24000 – 31999
R3 32000 – 39999
R4 40000 - 47999

Task 3: Config OSPF Routing in 4 Routers and enable Segment Routing on the area of OSPF.
Task 4: Check the reachability between R1 and R4 and analyze the OSPF Database in one of
each Router.

1
Download PNETLab Platform
PNETLAB Store
PNETLab.com

SOLUTION:
Task 1: Configure the hostname and IP address for the interface for Routers as topo.
On R1
!
hostname R1
interface Loopback0
ipv4 address 1.1.1.1 255.255.255.255
!
interface GigabitEthernet0/0/0/0
ipv4 address 10.1.12.1 255.255.255.0
!
On R2
!
hostname R2
interface Loopback0
ipv4 address 2.2.2.2 255.255.255.255
!
interface GigabitEthernet0/0/0/0
ipv4 address 10.1.12.2 255.255.255.0
!
interface GigabitEthernet0/0/0/1
ipv4 address 10.1.23.2 255.255.255.0
!
On R3
!
hostname R3
interface Loopback0
ipv4 address 3.3.3.3 255.255.255.255
!
interface GigabitEthernet0/0/0/1
ipv4 address 10.1.23.3 255.255.255.0
!
interface GigabitEthernet0/0/0/2
ipv4 address 10.1.34.3 255.255.255.0
!
On R4
!
hostname R4
interface Loopback0
ipv4 address 4.4.4.4 255.255.255.255
!
interface GigabitEthernet0/0/0/2
ipv4 address 10.1.34.4 255.255.255.0
!

2
Download PNETLab Platform
PNETLAB Store
PNETLab.com

Task 2: Config Segment Routing Global Block for each Router as following table :
On R1
!
segment-routing
global-block 16000 23999
!
On R2
!
segment-routing
global-block 24000 31999
!
On R3
!
segment-routing
global-block 32000 39999
!
On R4
!
segment-routing
global-block 40000 47999
!
Task 3: Config OSPF Routing in 4 Routers and enable Segment Routing on the area of OSPF.
On R1
!
router ospf 1
router-id 1.1.1.1
segment-routing mpls
segment-routing forwarding mpls
area 0
interface Loopback0
passive enable
prefix-sid index 1
!
interface GigabitEthernet0/0/0/0
network point-to-point
!
!
!
On R2
!
router ospf 1
segment-routing mpls
segment-routing forwarding mpls
area 0
interface Loopback0
3
Download PNETLab Platform
PNETLAB Store
PNETLab.com

passive enable
prefix-sid index 2
!
interface GigabitEthernet0/0/0/0
network point-to-point
!
interface GigabitEthernet0/0/0/1
network point-to-point
!
!
!
On R3
!
router ospf 1
segment-routing mpls
segment-routing forwarding mpls
area 0
interface Loopback0
passive enable
prefix-sid index 3
!
interface GigabitEthernet0/0/0/1
network point-to-point
!
interface GigabitEthernet0/0/0/2
network point-to-point
!
!
!
On R4
!
router ospf 1
segment-routing mpls
segment-routing forwarding mpls
area 0
interface Loopback0
passive enable
prefix-sid index 4
!
interface GigabitEthernet0/0/0/2
network point-to-point
!
!
!

4
Download PNETLab Platform
PNETLAB Store
PNETLab.com

Task 4: Check the reachability between R1 and R4 and analyze the OSPF Database in one of
each Router.

On R1
RP/0/0/CPU0:R1#ping 4.4.4.4 source loopback0
Sat Oct 10 09:00:10.182 UTC
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 9/27/69 ms

// Okay, R1 could reach to R4 normally.

RP/0/0/CPU0:R1#traceroute 4.4.4.4 source 1.1.1.1


Sat Oct 10 09:00:45.939 UTC

Type escape sequence to abort.


Tracing the route to 4.4.4.4

1 10.1.12.2 [MPLS: Label 24004 Exp 0] 89 msec 19 msec 19 msec


2 10.1.23.3 [MPLS: Label 32004 Exp 0] 9 msec 9 msec 9 msec
3 10.1.34.4 29 msec * 9 msec

// Oh… Seems we have MPLS Labels, but actually we haven’t configured LDP.

RP/0/0/CPU0:R1#show mpls forwarding


Sat Oct 10 09:01:38.236 UTC
Local Outgoing Prefix Outgoing Next Hop
Bytes
Label Label or ID Interface
Switched
------ ----------- ------------------ ------------ --------------- ---
---------
16002 Pop SR Pfx (idx 2) Gi0/0/0/0 10.1.12.2 0
16003 24003 SR Pfx (idx 3) Gi0/0/0/0 10.1.12.2 0
16004 24004 SR Pfx (idx 4) Gi0/0/0/0 10.1.12.2
253440
24000 Pop SR Adj (idx 0) Gi0/0/0/0 10.1.12.2 0
24001 Pop SR Adj (idx 0) Gi0/0/0/0 10.1.12.2 0

// We have 1 MPLS Forwarding table on Router ???

5
Download PNETLab Platform
PNETLAB Store
PNETLab.com

//Okay, Let’s check the OSPF Database and see what’s going on :

RP/0/0/CPU0:R1#show ospf database


Sat Oct 10 09:07:21.462 UTC

OSPF Router with ID (1.1.1.1) (Process ID 1)

Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link


count
1.1.1.1 1.1.1.1 283 0x80000003 0x00b11b 3
2.2.2.2 2.2.2.2 75 0x80000004 0x0067e8 5
3.3.3.3 3.3.3.3 1906 0x80000003 0x00a36b 5
4.4.4.4 4.4.4.4 1906 0x80000002 0x00d69f 3

Type-10 Opaque Link Area Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Opaque


ID
4.0.0.0 1.1.1.1 283 0x80000002 0x000c65
0
4.0.0.0 2.2.2.2 75 0x80000002 0x001af3
0
4.0.0.0 3.3.3.3 2008 0x80000001 0x002982
0
4.0.0.0 4.4.4.4 1907 0x80000001 0x003711
0
7.0.0.1 1.1.1.1 283 0x80000002 0x00e3b1
1
7.0.0.1 2.2.2.2 75 0x80000002 0x00127a
1
7.0.0.1 3.3.3.3 2008 0x80000001 0x004242
1
7.0.0.1 4.4.4.4 1907 0x80000001 0x00700b
1
8.0.0.4 1.1.1.1 283 0x80000003 0x00e799
4
8.0.0.4 2.2.2.2 75 0x80000003 0x004b77
4
8.0.0.4 3.3.3.3 2008 0x80000002 0x00aab7
4
8.0.0.5 2.2.2.2 75 0x80000003 0x006f2e
5

6
Download PNETLab Platform
PNETLAB Store
PNETLab.com

8.0.0.5 3.3.3.3 1905 0x80000002 0x00ce6e


5
8.0.0.5 4.4.4.4 1906 0x80000002 0x00d16f
5

//Router Link States is normal, so we could ignore them. The special thing is OSPF Database has
a new LSA type : LSA Type 10. This LSA Type is generated by Router to make the others Router
to know exactly the capabilities of Router about Segment Routing, the prefix-SID index of
Router in Segment Routing domain, the range Global Block of Router… Every information about
Segment Routing will be transport via LSA Type 10.

RP/0/0/CPU0:R1#show ospf database opaque-area 4.0.0.0 self-originate


Sat Oct 10 09:14:35.472 UTC

OSPF Router with ID (1.1.1.1) (Process ID 1)

Type-10 Opaque Link Area Link States (Area 0)

LS age: 717
Options: (No TOS-capability, DC)
LS Type: Opaque Area Link
Link State ID: 4.0.0.0
Opaque Type: 4
Opaque ID: 0
Advertising Router: 1.1.1.1
LS Seq Number: 80000002
Checksum: 0xc65
Length: 52

Router Information TLV: Length: 4


Capabilities:
Graceful Restart Helper Capable
Stub Router Capable
All capability bits: 0x60000000

Segment Routing Algorithm TLV: Length: 1


Algorithm: 0

Segment Routing Range TLV: Length: 12


Range Size: 8000

SID sub-TLV: Length 3


Label: 16000

7
Download PNETLab Platform
PNETLAB Store
PNETLab.com

// Router 1 informs to the other Router that the Range Size of Global Block is 8000 and the
started label is 16000. We could check the capabilities of other Router via the same command,
but need to specify the adv-router. That is easy!
Let’s check the other LSA.

RP/0/0/CPU0:R1#show ospf database opaque-area 7.0.0.1 self-originate


Sat Oct 10 09:18:43.815 UTC

OSPF Router with ID (1.1.1.1) (Process ID 1)

Type-10 Opaque Link Area Link States (Area 0)

LS age: 965
Options: (No TOS-capability, DC)
LS Type: Opaque Area Link
Link State ID: 7.0.0.1
Opaque Type: 7
Opaque ID: 1
Advertising Router: 1.1.1.1
LS Seq Number: 80000002
Checksum: 0xe3b1
Length: 44

Extended Prefix TLV: Length: 20


Route-type: 1
AF : 0
Flags : 0x40
Prefix : 1.1.1.1/32

SID sub-TLV: Length: 8


Flags : 0x0
MTID : 0
Algo : 0
SID Index : 1

RP/0/0/CPU0:R1#show ospf database opaque-area 7.0.0.1 adv-router


4.4.4.4
Sat Oct 10 09:19:49.801 UTC

OSPF Router with ID (1.1.1.1) (Process ID 1)

Type-10 Opaque Link Area Link States (Area 0)

8
Download PNETLab Platform
PNETLAB Store
PNETLab.com

LS age: 643
Options: (No TOS-capability, DC)
LS Type: Opaque Area Link
Link State ID: 7.0.0.1
Opaque Type: 7
Opaque ID: 1
Advertising Router: 4.4.4.4
LS Seq Number: 80000002
Checksum: 0x6e0c
Length: 44

Extended Prefix TLV: Length: 20


Route-type: 1
AF : 0
Flags : 0x40
Prefix : 4.4.4.4/32

SID sub-TLV: Length: 8


Flags : 0x0
MTID : 0
Algo : 0
SID Index : 4

//We could now understand the meaning of command “prefix-sid index” was configured
before. The Router will inform the SID Index of them to other Router know. This information
will be used to caculate the MPLS Label. Let’s analyze it :

Router R4 will inform to other Router that it has the SID Index = 4 in Segment Routing Domain.
So the others Router wanna reach to R4, it will combine 2 things :
- SID Index of Router R4.
- Global Block Range of Adjacency Router (Because we are analyzing R1, so in this case,
the Adjacency of R1 is R2). R2 is using Global block range is 24000 – 31999.

R1 will use the label 24000 + 4 = 24004 to reach to SID Index 4 (R4). This thing will be proved in
MPLS Table of R1.

RP/0/0/CPU0:R1#show mpls forwarding


Sat Oct 10 09:01:38.236 UTC
Local Outgoing Prefix Outgoing Next Hop
Bytes
Label Label or ID Interface
Switched
------ ----------- ------------------ ------------ --------------- ---
---------
16002 Pop SR Pfx (idx 2) Gi0/0/0/0 10.1.12.2 0
9
Download PNETLab Platform
PNETLAB Store
PNETLab.com

16003 24003 SR Pfx (idx 3) Gi0/0/0/0 10.1.12.2 0


16004 24004 SR Pfx (idx 4) Gi0/0/0/0 10.1.12.2
253440
24000 Pop SR Adj (idx 0) Gi0/0/0/0 10.1.12.2 0
24001 Pop SR Adj (idx 0) Gi0/0/0/0 10.1.12.2 0

The similar thing will happen on R2,R3 and R4 (LSA transfer, caculate label to reach other
Router via Global Block Range of Adjacency Router and SID Index, create MPLS forwarding
table). So now, the function similar to MPLS LDP will be created but we don’t need to use the
signalling protocol as LDP, just need to use the extend LSA type on link-state Routing Protocol.

RP/0/0/CPU0:R2#show mpls forwarding


Sat Oct 10 09:33:43.474 UTC
Local Outgoing Prefix Outgoing Next Hop
Bytes
Label Label or ID Interface
Switched
------ ----------- ------------------ ------------ --------------- ---
---------
24001 Pop SR Pfx (idx 1) Gi0/0/0/0 10.1.12.1
3292
24003 Pop SR Pfx (idx 3) Gi0/0/0/1 10.1.23.3 0
24004 32004 SR Pfx (idx 4) Gi0/0/0/1 10.1.23.3
295020
32000 Pop SR Adj (idx 0) Gi0/0/0/0 10.1.12.1 0
32001 Pop SR Adj (idx 0) Gi0/0/0/0 10.1.12.1 0
32002 Pop SR Adj (idx 0) Gi0/0/0/1 10.1.23.3 0
32003 Pop SR Adj (idx 0) Gi0/0/0/1 10.1.23.3 0

//R2 will swap label 24004 to 32004. Why ? You could have your own answer if look the Global
Block Range of R3 (Adjacency of R2).

10

You might also like