Sie sind auf Seite 1von 15

Jsim Usage

Phil Lacroute, May 2002


$Id: README,v 1.3 2003/03/24 19:32:11 lacroute Exp $
Copyright (c) 2002-2003, Juniper Networks, Inc.
All rights reserved.
Jsim is a software simulator that mimics the route lookup hardware in
the CF and R chips (and eventually I/J). It is part of the embedded
image and uses the same data structures as the hardware. There are
three general steps to use it:

Configure the router for the scenario you want to test.


Set the initial values in the simulated key buffer.
Call the simulator and examine the output, which includes the
actions taken and the final contents of the key buffer and result
buffer. Single-stepping is also available.
There are a few examples at the end of this document.

Simulation control and status:


jsim reset [full <jtree_instance>]
Reset the simulation state to start a new lookup. A full
reset also clears the key buffer and sets the jtree instance
to use.
jsim lookup [verbose, on-chip]
Perform an implicit reset followed by a complete lookup.
The verbose option produces more detailed output.
The on-chip option causes the simulator to read all data
from the hardware rather than using the in-memory copy
(warning: this option can crash the PFE if there is a nexthop
with an invalid address).
jsim step [<count>] [verbose, on-chip]
Perform the next <count> steps (default 1) of the current
lookup.
jsim where
Display the current simulation execution state.
Set commands:
set jsim protocol ip|inet6|tag|<n>

set jsim pktlen <bytes>


set jsim iif <ifl>
set jsim sample <bits[3:0]>
set jsim ttl-expired <bit>
set jsim tcp <bit>
set jsim ip-options <bit>
set jsim ipdst <ipaddr>
set jsim ipsrc <ipaddr>
set jsim ip6dst <ip6addr>
set jsim ip6src <ip6addr>
set jsim ip-protocol <n>
set jsim src-port <n>
set jsim dst-port <n>
set jsim mpls-tag <bits[31:0]> [index <0-4>]
set jsim mpls-tag label-only <n> [index <0-4>]
set jsim fabric-token <n>
Set the specified key buffer field.
set jsim key-buffer <byte_offset> byte|short|word <value> [mask
<mask>]
Set an 8-bit byte, a 16-bit short or a 32-bit word at a
specified offset in the key buffer, optionally with a bitwise
write mask.
set jsim policer-result
in-spec|out-of-spec|grace-pass|grace-fail|undef
[index <index>]
Set a "hint" indicating the result of a policer operation.
Index n specifies the result of the nth policer operation in
the lookup starting from index 0. If there are more policer
operations than results the simulator will wrap around to the
beginning of the result list, e.g. if only one result is
specified (for index 0) then it will be used for all policers.
If no results are specified then all policers pass by default.
Show commands:
show jsim keyb [raw]
Show the contents of the key buffer in decoded form or raw form.
show jsim result
Show the contents of the result buffer.
show jsim policer-result
Show the current policer result hints.

Example 1:
1. clear all state and specify jtree instance
SBR(bengal uart)# jsim reset full 0
1. set the ifl
SBR(bengal uart)# show interfaces
SBR(bengal uart)# set jsim iif 7
1. set the other packet fields in the key buffer
SBR(bengal uart)# set jsim ipdst 11.0.0.2
SBR(bengal uart)# set jsim ipsrc 5.0.0.2
1. perform the lookup
SBR(bengal uart)# jsim lookup verbose
Example 2 (mpls):
SBR(bengal uart)# set jsim iif 7
SBR(bengal uart)# set jsim protocol tag
SBR(bengal uart)# set jsim mpls-tag 0x000100ff
SBR(bengal uart)# jsim lookup verbose
Example 3 (ipv6):
SBR(bengal uart)# set jsim iif 7
SBR(bengal uart)# set jsim protocol inet6
SBR(bengal uart)# set jsim ip6dst 8000::ee46
SBR(bengal uart)# jsim lookup verbose
Example 4 (Gibson, packet crossing the fabric):
1. PFE0: wan->fabric
GFPC7(chicago uart)# jsim reset full 0
GFPC7(chicago uart)# set jsim iif 7
GFPC7(chicago uart)# set jsim ipdst 17.2.0.2
GFPC7(chicago uart)# jsim lookup verbose
Lookup terminated normally:
forward to fabric qid 15 (vqid=271)
lout_key=0x00002e (token=0x0000b8) plp=0 qos=0x00
1. PFE1: fabric->wan based on token from above lookup
GFPC7(chicago uart)# jsim reset full 1
GFPC7(chicago uart)# set jsim iif 7
GFPC7(chicago uart)# set jsim fabric-token 0xb8
NOTE: in JUNOS 5.x the fabric-token keyword does not exist so
do something like the following instead:
GFPC7(chicago uart)# set jsim key-buffer 11 byte 0xb8

GFPC7(chicago uart)# set jsim input-port fabric


GFPC7(chicago uart)# jsim lookup verbose
Lookup terminated normally:
forward to WAN qid 256 (vqid=1)
lout_key=0x00400b plp=0 qos=0x00

JSIM for IPv4


Setup
192.1.1.1/30
50.50.50.0/30
193.1.1.1/30
----------------- Nemesis --------------- R2 -------------ge-2/2/2 (DUT) ge-6/3/0
With the above setup, we try to simulate a route lookup on Nemesis for the prefix 193.1.1.2

On the ingress FPC (FPC2 here), enter the keybuffer parameters


FFPC2(Nemesis-re0 vty)# jsim reset full 1

<---- Clear previous keybuffer values

FFPC2(Nemesis-re0 vty)# set jsim iif 64

<---- Pick any valid IFL

FFPC2(Nemesis-re0 vty)# set jsim ipdst 193.1.1.2


FFPC2(Nemesis-re0 vty)# set jsim ipsrc 192.1.1.2
FFPC2(Nemesis-re0 vty)# set jsim pktlen 1500

Check if the keybuffer was programmed correctly


FFPC2(Nemesis-re0 vty)# show jsim keyb
Ucode protocol: 0 (IPv4)
Source port: wan
Key Buffer:
rewrite1: 0x00
rewrite0: 0x00
pktlen: 1500
sample mask: 0x00
qos: 0x00
flags: none
iif: 0x00040
token: 0x000000
dst_addr: 193.1.1.2
src_addr: 192.1.1.2
ip_proto: 0
src_port: 0
dst_port: 0
tos: 0x00
fragment: 0x0000
tcp_flags: 0x00
color: green

Perform JSIM lookup


FFPC2(Nemesis-re0 vty)# jsim lookup verbose
Step Kp Address
Data
Description
---- -- ----------- -------- ----------key_mask=0xff80000000000000, iif_mask=0x0, token_mask=0x0
hash_bytes=0xc1010102c0010102
[ 1] 12 reg 000000 0001df40 nh: itable itid=0 offset=-5

itid 000000 00041800 itable address


0200002f itable descriptor addr=0x000106 size=32768 idx_bits=15 bit_offset=1
lookup index=64
[ 2] 7 sram 000148 00002f00 nh: jtree tid=0 offset=5
using jump table
[ 3] 12 tid 000000 00023410 jtree_ptr child plen=16 addr=0x00008c
jtab 0000c1 1c89c200 initial jtree stack: jtree_ptr attached btt=0 addr=0x072270
comparing key 0xc1010000/16 against prefix 0xc1010000: match
[ 4] 12 sram 00008c 0010690d nh: final vqid=269 lout_key=0x00020d
Lookup terminated normally:
forward to fabric qid 13 (vqid=269)
lout_key=0x00020d (token=0x000834) plp=0 qos=0x00

<--- Sending towards the fabric

Some math..
Outgoing FPC = (VQID - 256) / 2
= (269 - 256) / 2

<--- Use vqid from previous o/p

= FPC 6

Outgoing PFE = VQID % 2


= 269 % 2
= PFE 1

If the destination is out of the same PFE, Lout_key is the hardware L2 descriptor, VQID is the stream id
If the destination is out of a different PFE (as in this case), Lout_key is the software nh index, VQID is the
destination PFE

Now do the same on the output PFE


sid@Nemesis-re0> start shell pfe network fpc6
FFPC platform (300Mhz MPC 755 processor, 1024MB memory, 512KB flash)

FFPC6(Nemesis-re0 vty)# jsim reset full 1


FFPC6(Nemesis-re0 vty)# set jsim iif 64

<--- Same iif as for input PFE

FFPC6(Nemesis-re0 vty)# set jsim fabric-token 0x000834 <--- From the lout_key above
FFPC6(Nemesis-re0 vty)# set jsim input-port fabric

FFPC6(Nemesis-re0 vty)# show jsim keyb


Ucode protocol: 0 (IPv4)
Source port: fabric
Key Buffer:
rewrite1: 0x00
rewrite0: 0x00
pktlen: 0
sample mask: 0x00
qos: 0x00
flags: none
iif: 0x00040
token: 0x000834
dst_addr: 0.0.0.0
src_addr: 0.0.0.0
ip_proto: 0

<<<<<

<<<<<
<<<<<

<--- input is fabric

src_port: 0
dst_port: 0
tos: 0x00
fragment: 0x0000
tcp_flags: 0x00
color: green

FFPC6(Nemesis-re0 vty)# jsim lookup verbose


Step Kp Address
Data
Description
---- -- ----------- -------- ----------key_mask=0xff80000000000000, iif_mask=0x0, token_mask=0x0
hash_bytes=0x0
[ 1] 12 reg 000000 0001ef45 nh: itable itid=5 offset=-3
itid 000005 08241800 itable address
08000054 itable descriptor addr=0x020906 size=131072 idx_bits=20 bit_offset=2
lookup index=525
[ 2] 9 sram 020b15 02013851 nh: final vqid=81 lout_key=0x004027
Lookup terminated normally:
forward to WAN qid 64 (vqid=81)
lout_key=0x004027 plp=0 qos=0x00

<---

So final lout_key is 0x004027

Verify if the lookup happened correctly


FFPC6(Nemesis-re0 vty)# show nhdb id 525 extensive
ID
Type
Interface
Next Hop Addr
Protocol
----- -------- ------------- --------------- ---------525
Unicast ge-6/3/0.0
50.50.50.2
IPv4

Encap
-----------Ethernet

MTU
---1516

Nexthop Status:
Index: 16423 (0x4027), Slot: 6
^^^^^^

So the L2 descriptor provided by JSIM points to the correct output interface, indicating that the
route lookup happened correctly.

JSIM when ingress is I-chip based FPC and egress is R-chip based FPC
After performing JSIM on the ingress PFE, left shift the token obtained by 2.
==============================================================================
Lookup terminated normally:
forward to sid 71,
lout_key=0x00013680 (Fabric) proto 0
dp=0 qn=7

0x13680 = 00000001 00110110 10000000


00000100 11011010 00000000

<<< After 2 left shifts

= 0x4DA00

Perform JSIM on the egress PFE with adjusted token


===================================================
FFPC3(Nemesis-re0 vty)# jsim reset full 1

FFPC3(Nemesis-re0 vty)# set jsim input-port fabric


FFPC3(Nemesis-re0 vty)# set jsim fabric-token 0x4da00
FFPC3(Nemesis-re0 vty)# jsim lookup verbose
Lookup terminated normally:
forward to WAN qid 0 (vqid=65)
lout_key=0x0041b4 plp=0 qos=0x00

JSIM for MPLS


Setup
+--------------+
+--------------+
+--------------+
|
|
|
|
|
|
Panthers
|--------|
Nemesis
|--------|
Ravens
|
|
|
|
|
+--------------+
+--------------+
+--------------+

| 193.193.1.0/30
|-------|

With the setup as above, we perform jsim on nemesis for an mpls packet received from panthers on interface ge6/2/0

sid@panthers> show route 193.193.1.0/30


inet.0: 107 destinations, 107 routes (107 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
193.193.1.0/30

*[BGP/170] 00:01:02, localpref 100, from 192.1.1.3


AS path: I
> to 9.9.9.2 via ge-0/1/2.0, Push 413647

sid@Nemesis-re0> show route table mpls.0 label 413647


mpls.0: 2614 destinations, 2614 routes (2614 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
413647
413647(S=0)

*[LDP/9] 00:02:40, metric 1


> to 10.10.10.2 via ge-6/2/1.0, Pop
*[LDP/9] 00:02:40, metric 1
> to 10.10.10.2 via ge-6/2/1.0, Pop

On the ingress FPC (FPC6 here), enter the keybuffer parameters


SFPC6(Nemesis-re0 vty)# jsim reset full 1
SFPC6(Nemesis-re0 vty)# set jsim protocol tag
SFPC6(Nemesis-re0 vty)# set jsim mpls-tag label-only 0x64FCF

SFPC6(Nemesis-re0 vty)# sh jsim keyb


Ucode protocol: 2 (tag)
Source port: wan

<<<<< label in hex

Key Buffer:
rewrite0: 0x00
rewrite1: 0x00
rewrite2: 0x00
rewrite3: 0x00
pktlen: 0
sample mask: 0x00
l3rw: 0x00, l3n: 0
Qn: 0x07, dp: 0x0
PolRes: 0x00
flags:
iif: 0x000000
token: 0x000000
label0: 0x64fcf
exp0: 0x0
S0: 0
label1: 0x00000
exp1: 0x0
S1: 0
label2: 0x00000
exp2: 0x0
S2: 0
exp0: 0x0
src_addr: 0.0.0.0
dst_addr: 0.0.0.0
src_port: 0
dst_port: 0
ip_proto: 0

Perform JSIM lookup


SFPC6(Nemesis-re0 vty)# jsim
Step Kp Address
Data
---- -- ----------- -------[ 1] 16 reg 000000 0000c679
itid 00000c 021e1000
0200002f
[ 2]

9 sram 008786 00016648


itid 000016 02081000
00040088

[ 3] 17 sram 0082d5 0219847f


[ 4] 16 sram 008660 ad38e214
[ 5] 16 sram 2b4e38 4b7d5418
[ 6] 16 sram 12df54 d4ab4728
sram 352ad0 98400ecb
[ 7] 16 sram 352ad1 00082020

lookup verbose
Description
----------nh: TID itable tid=12 offset=-7
itable address (seg 0)
itable descriptor addr=0x008784 size=32768 idx_bits=15 bit_offset=1
lookup index=0
nh: TID itable tid=22 offset=8
itable address (seg 0)
itable descriptor addr=0x008204 size=256 idx_bits=8 bit_offset=4
lookup index=207
nh: jtree attached offset=-1 addr=0x008660
jtree_ptr attached btt=20 addr=0x2b4e38
jtree_ptr child plen=24 addr=0x12df54
comparing key 0x64fcf000/24 against prefix 0x64fcf000: match
nh: extended buff-modify intermediate-nh addr=0x352ad0
Buffer Translate: write kb(8), off 44, bits 3, data 0x7fff8
nh: final sid=32 lout_key=0x000104

Lookup terminated normally:


forward to sid 32,
lout_key=0x00000104 (Wan) proto 2
dp=0 qn=7

So the final lout key is 0x104 since in this case the output interface is on the same PFE.

Verify if the lookup happened correctly

SFPC6(Nemesis-re0 vty)# show route mpls


MPLS Route Table 0, MPLS.0, 0x0:
Destination
Type
ID NhRef
----------------------- -------- ----- ----413647
Unicast 20345
1 ge-6/2/1.0
413647(S=0)
Unicast 20346
1 ge-6/2/1.0

sid@Nemesis-re0> show route forwarding-table family mpls label 413647


Routing table: default.mpls
MPLS:
Destination
Type RtRef Next hop
Type Index NhRef Netif
413647
user
0 10.10.10.2
Pop
20345
2 ge-6/2/1.0
413647(S=0)
user
0 10.10.10.2
Pop
20346
2 ge-6/2/1.0

SFPC6(Nemesis-re0 vty)# show nhdb id 20346 extensive


ID
Type
Interface
Next Hop Addr
Protocol
----- -------- ------------- --------------- ---------20346
Unicast ge-6/2/1.0
MPLS->Any

Encap
-----------Ethernet

<<<<<<

MTU
---1516

Nexthop Status:
Index: 260 (0x104), Slot: 6
^^^

JSIM for VPLS


For VPLS, you have to populate the notification buffer for bridged packets correctly to perform JSIM. The
keybuffer offset to be modified starts at byte 16 since the first 16 bytes are fixed.
Keybuffer format for bridged packet
* _________________________________________________________________
* | 3
2
1
0|
* |1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0|
* |---------------------------------------------------------------|
* |
rewrite 0
|
rewrite 1
|
rewrite 2
|
rewrite 3
|[0-31]
* |---------------------------------------------------------------|
* |
|pol|
|
|L|
|E|C|
|T|O|rewr |
* |sample sn[7:0] |res| DP| QS |3|
L3OW
|C|E| PT |E|P| ite |[32-63]
* |
|1:0|1:0|[2:0]|N|
[5:0]
|T| |[2:0]| | | X
|
* |---------------------------------------------------------------|
* |
0
|
iif[19:0]
| pkt_len[15:8] |
* |---------------------------------------------------------------|
* | pkt_len[7:0] | 0
|
fabric token/Lin packet hash
|
* |---------------------------------------------------------------|
* |
variable length key from Lin
|
* |
(up to 48 bytes)
|
* |
. . .
|

*
*
*

0
1
2
3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*

|
L2Token
| L2-Token|
Info Byte
|
|
| extn
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
BridgeDomain-id (bd-id)
| reserved
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
Destination MAC
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
Destination MAC
|
Source MAC
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
Source MAC
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Control Byte |
Unused
|
Ethernet Type
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
IP Destination Address
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
IP Source Address
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 12-bit service vlan |1p bits|
Customer Vlan ID
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
IP TOS
| IP Protocol |
TCP Flags
|
Unused
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
TCP Source Port
|
TCP Destination Port
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

16 - 19

20 - 23
24 - 27
28 - 31
32 - 35
36 - 39
40 - 43
44 - 47
48 - 51

Setup

+----------+
ge-3/1/1.1|
---------|

Obelix |
|
+----------+

ae11
|-------------|
|-------------|
ae12

+-----------+
|
| Automatix |-----|
+-----------+

We perform JSIM lookup for a packet recieved on the CE interface (ge-3/1/1.1) on Obelix destined for a MAC
learned from the remote PE.

sid@obelix-re0> show vpls mac-table instance jsim-vpls


Routing instance : jsim-vpls
Bridging domain : __jsim-vpls__, VLAN : NA
MAC
MAC
Logical
address
flags
interface
00:05:85:fe:20:db
D
ge-3/1/1.1
<--- Src MAC
00:12:1e:c5:e0:db
D
lsi.1050424 <--- Dest MAC

We can get the l2token and BD id as below

ADPC3(obelix-re0 vty)# show npez 2 da-mac bridge mac 00:12:1e:c5:e0:db


bd
lvlan
mac
ctrl cond tok-bkt-idx l2iif epoch stp l2tok pfe
<--------------Key-------------> <---------------Result------------------------------>
0x0773 0x0000 00:12:1e:c5:e0:db 0x0302 0x00 0x00c002 0x002751 0x00 0x00 0x0f09 0x3f

L2token = 0x0F09
BD
= 0x0773

Adjusting the 1st 4 bytes of the keybuffer so that the l2token takes 19 bits
------------------------------------------------------------------------------00000001 11100001 00100000 00000000
01
E1
20
00

On the ingress FPC (FPC3 here), enter the keybuffer parameters


ADPC3(obelix-re0 vty)# set jsim protocol 3
ADPC3(obelix-re0 vty)# set jsim iif 8216
ADPC3(obelix-re0 vty)# set jsim key-buffer 16 word 0x01E12000
offset 16

<--- First 4 bytes with l2token starting at

ADPC3(obelix-re0 vty)# set jsim key-buffer 20 word 0x07730000

<--- 4 bytes with bridge domain

ADPC3(obelix-re0 vty)# set jsim key-buffer 24 word 0x00121ec5

<--- First 4 bytes of DA MAC

ADPC3(obelix-re0 vty)# set jsim key-buffer 28 word 0xE0DB0005

<--- 2 bytes DA MAC + 2 bytes SA MAC

ADPC3(obelix-re0 vty)# set jsim key-buffer 32 word 0x85fe20db

<--- Last 4 bytes of SA MAC

ADPC3(obelix-re0 vty)# set jsim key-buffer 50 short 0x0001

<--- Vlan ID 1

Check if the keybuffer was programmed correctly


ADPC3(obelix-re0 vty)# sh jsim
Ucode protocol: 3 (unknown)
Source port: wan
Key Buffer:
rewrite0: 0x00
rewrite1: 0x00
rewrite2: 0x00
rewrite3: 0x00
pktlen: 0
sample mask: 0x00
l3rw: 0x00, l3n: 0
Qn: 0x00, dp: 0x0
PolRes: 0x00
flags:
iif: 0x002018
token: 0x000000
Variable key:
01e12000 07730000 00121ec5
85fe20db 00000000 00000000
00000001 00000000 00000000

keyb

e0db0005
00000000
00000000

Perform JSIM lookup


ADPC3(obelix-re0 vty)# jsim look verbose
Step Kp Address
Data
Description
---- -- ----------- -------- ----------[ 1] 16 reg 000000 00010679 nh: TID itable tid=16 offset=-7
itid 000010 0c221000 itable address (seg 0)
04000010 itable descriptor addr=0x030884 size=65536 idx_bits=16 bit_offset=0
lookup index=8216
[ 2] 9 sram 03289e 22043d5b nh: itable offset=27 addr=0x08810e
sram 08810e 00001002 itable descriptor addr=0x08810e size=4 idx_bits=2 bit_offset=0
lookup index=0
[ 3] 36 sram 088110 2317b730 nh: extended attached-cnt intermediate-nh addr=0x08c5ec
increment attached counter addr=0x08c5ec
[ 4] 36 sram 08c5ef 47e68b61 nh: multiple SER(no SE) hops=1 addr=0x11f9a2
segment extended reference
[ 5] 36 sram 51f9a2 47e68f20 nh: extended intermediate-nh addr=0x11f9a2
[ 6] 36 sram 51f9a2 47e78728 nh: extended buff-modify intermediate-nh addr=0x11f9e0
sram 51f9e0 01002008 Buffer write: write kb(8), off 0, bits 8, data 0x1
[ 7] 36 sram 51f9e1 0001c670 nh: TID itable tid=28 offset=-16
itid 40001c 00001000 itable address (seg 1)
02000010 itable descriptor addr=0x000004 size=32768 idx_bits=16 bit_offset=0
lookup index=1907
[ 8] 20 sram 400779 4785453c nh: firewall offset=-4 addr=0x11e150
[ 9] 16 sram 51e150 00000208 fw: extended addr=0x51e151 indirect-nh
[10] 16 sram 51e151 47880580 nh: firewall offset=0 addr=0x11e200
STACK PUSH (0): key-ptr 16, addr 0011e152, seg 1, se 0,
[11] 16 sram 51e200 00001607 fw: match key_data[95:64] & 0xffffff00 != 0x0180c200 -> 0x51e204 fw_data_ptr=24
51e201 0180c200
51e202 000000ff
key=0x121ec5 result=branch
[12] 16 sram 51e204 00000044 fw: return
STACK POP (0) Context: Extended_NH
[13] 16 sram 51e152 0001a640 nh: TID itable tid=26 offset=0
itid 00001a 10241000 itable address (seg 0)
04000010 itable descriptor addr=0x040904 size=65536 idx_bits=16 bit_offset=0
lookup index=481
[14] 16 sram 040ae7 2f84c270 nh: t_and_b n_bits=3, bit_off=16 addr=0x0be130
[15] 16 sram 0be131 2f9c8302 nh: multiple bal-hash hops=2 addr=0x0be720
hash_bytes key bytes 0
hash=0x0000 lookup_index=0
[16] 16 sram 0be720 2f9d8301 nh: multiple bal-hash hops=1 addr=0x0be760
hash_bytes key bytes 0
hash=0x0000 lookup_index=0
[17] 16 sram 0be760 2f9daf28 nh: extended buff-modify intermediate-nh addr=0x0be76a
sram 0be76a d8400ecb Buffer Translate: write kb(8), off 44, bits 3, data 0x7fff8
[18] 16 sram 0be76b 0e62605d nh: final sid=93 lout_key=0x01cc4c
Lookup terminated normally:
forward to sid 93,
lout_key=0x0001cc4c (Fabric) proto 3
dp=0 qn=7

Determine outgoing PFE from table below

SID

FPC0

SID

FPC1

64
66
65
67

I-Chip0
I-Chip2
I-Chip1
I-Chip3

ge-0/0/0..9
ge-0/1/0..9
ge-0/2/0..9
ge-0/3/0..9

68
70
69
71

I-Chip0
I-Chip2
I-Chip1
I-Chip3

ge-1/0/0..9
ge-1/1/0..9
ge-1/2/0..9
ge-1/3/0..9

SID
72
74
73
75

FPC2
I-Chip0
I-Chip2
I-Chip1
I-Chip3

ge-2/0/0..9
ge-2/1/0..9
ge-2/2/0..9
ge-2/3/0..9

SID
76
78
77
79

FPC3
I-Chip0
I-Chip2
I-Chip1
I-Chip3

ge-3/0/0..9
ge-3/1/0..9
ge-3/2/0..9
ge-3/3/0..9

SID
80
82
81
83

FPC4
I-Chip0
I-Chip2
I-Chip1
I-Chip3

ge-4/0/0..9
ge-4/1/0..9
ge-4/2/0..9
ge-4/3/0..9

SID
84
86
85
87

FPC5
I-Chip0
I-Chip2
I-Chip1
I-Chip3

ge-5/0/0..9
ge-5/1/0..9
ge-5/2/0..9
ge-5/3/0..9

SID
88
90
89
91

FPC6
I-Chip0
I-Chip2
I-Chip1
I-Chip3

ge-6/0/0..9
ge-6/1/0..9
ge-6/2/0..9
ge-6/3/0..9

SID
92
94
93
95

FPC7
I-Chip0
I-Chip2
I-Chip1
I-Chip3

ge-7/0/0..9
ge-7/1/0..9
ge-7/2/0..9
ge-7/3/0..9

SID
96
98
97
99

FPC8
I-Chip0
I-Chip2
I-Chip1
I-Chip3

ge-8/0/0..9
ge-8/1/0..9
ge-8/2/0..9
ge-8/3/0..9

SID
100
102
101
103

SID
104
106
105
107

FPC10
I-Chip0
I-Chip2
I-Chip1
I-Chip3

ge-10/0/0..9
ge-11/1/0..9
ge-12/2/0..9
ge-13/3/0..9

SID
108
110
109
111

FPC9
I-Chip0
I-Chip2
I-Chip1
I-Chip3
FPC11
I-Chip0
I-Chip2
I-Chip1
I-Chip3

ge-9/0/0..9
ge-9/1/0..9
ge-9/2/0..9
ge-9/3/0..9

ge-11/0/0..9
ge-11/1/0..9
ge-11/2/0..9
ge-11/3/0..9

<--- So sid 93 in jsim output corresponds to DPC 7 - PFE 1

Now do the same on the output PFE


ADPC7(obelix-re0 vty)# jsim reset full 1
ADPC7(obelix-re0 vty)# set jsim protocol 3
ADPC7(obelix-re0 vty)# set jsim input-port fabric
ADPC7(obelix-re0 vty)# set jsim fabric-token 0x0001cc4c

ADPC7(obelix-re0 vty)# jsim look verbose


Step Kp Address
Data
Description
---- -- ----------- -------- ----------[ 1] 16 reg 400000 00012679 nh: TID itable tid=18 offset=-7
itid 400012 42061800 itable address (seg 1)
04000010 itable descriptor addr=0x108186 size=65536 idx_bits=16 bit_offset=0
lookup index=0
[ 2] 9 sram 508188 00014644 nh: TID itable tid=20 offset=4
itid 400014 02040000 itable address (seg 1)

40000094 itable descriptor addr=0x008100 size=1048576 idx_bits=20 bit_offset=4


lookup index=117836
[ 3] 13 sram 424d4e 49fb2f28 nh: extended buff-modify intermediate-nh addr=0x127eca
sram 527eca d8400ecb Buffer Translate: write kb(8), off 44, bits 3, data 0x7fff8
[ 4] 13 sram 527ecb 009c6820 nh: final sid=32 lout_key=0x00138d
Lookup terminated normally:
forward to sid 32,
lout_key=0x0000138d (Wan) proto 3
dp=0 qn=7

Final Lout key is 0x0000138d

Verify if the lookup happened correctly


sid@obelix-re0> show route forwarding-table family vpls table jsim-vpls
Routing table: jsim-vpls.vpls
VPLS:
Destination
Type RtRef Next hop
Type Index NhRef Netif
default
perm
0
dscd 83516
1
00:05:85:fe:20:db/48
user
0
ucst 85101
4 ge-3/1/1.1
00:12:1e:c5:e0:db/48
user
0
indr 1051981
5
ulst 1051980
2
10.192.16.6
Push 461001 117835
1 ae12.0
10.192.16.2
Push 461001 117837
1 ae11.0
lsi.1050424
intf
0
indr 1051981
5
ulst 1051980
2
10.192.16.6
Push 461001 117835
1 ae12.0
10.192.16.2
Push 461001 117837
1 ae11.0

<-----

ADPC7(obelix-re0 vty)# show nhdb id 117835 extensive


ID
Type
Interface
Next Hop Addr
Protocol
Encap
MTU
----- -------- ------------- --------------- ---------- ------------ ---117835
Aggreg. ae12.0
VPLS->MPLS
Ethernet
0
Nexthop Status:
Index: 0 (0x0), Slot: Unspecified
Destination (0x100): RE Chip8
Topo link: 0x00000000:0x2d43cb01 0x00000000:0x2d8c3b01 0x00000000:0x2d511301 0x00000000:0x2d5d6b01
Refcount: 2, Interface: 67, Nexthop Flags: 0x0
[Allocated entries (jtree memory): 1]
Aggreg. Table (1 entries):
ID
Type
Interface
----- -------- ------------117836
Unicast xe-7/1/0.0

Next Hop Addr


---------------

Protocol
Encap
MTU
---------- ------------ ---VPLS->MPLS
Ethernet 9186

ADPC7(obelix-re0 vty)# show nhdb id 117836 extensive


ID
Type
Interface
Next Hop Addr
Protocol
----- -------- ------------- --------------- ----------

Encap
------------

MTU
----

117836

Unicast

xe-7/1/0.0

VPLS->MPLS

Ethernet

9186

Nexthop Status:
Index: 5005 (0x138d), Slot: 7
^^^^^

So the L2 descriptor provided by JSIM is the same as that for the actual output interface which indicates
the VPLS lookup happened correctly

Das könnte Ihnen auch gefallen