Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] sonic-utilities: Create SONiC ISIS show commands #2685

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

cchoate54
Copy link
Contributor

@cchoate54 cchoate54 commented Feb 17, 2023

  • Update show/main.py Include "isis" as a cli group option for show commands
  • Create show/isis_frr.py Add "isis" as a cli group option for show commands and add support for "show isis neighbors"

Signed-off-by: cchoate54@gmail.com

What I did

Implemented new show isis commands.

Command Description CLI Command
Show state information for all ISIS neighbors or a specified neighbor show isis neighbors [system_id] {--verbose}
Command Description CLI Command
Show the ISIS database globally or for a specific LSP show isis database [lsp_id] {--verbose}
Command Description CLI Command
Show information about an ISIS node show isis hostname
Command Description CLI Command
Show state and configuration of ISIS for all interfaces or a specified interface show isis interface [interface] {--verbose} {--display}
Command Description CLI Command
Show topology IS-IS paths globally or for level-1 or level-2 specifically show isis topology {--level-1} {--level-2}
Command Description CLI Command
Show summary of ISIS information show isis summary
Command Description CLI Command
Show ISIS running configuration show run isis {--verbose} {--config_db} {--namespace}

How I did it

Added a new file for isis show commands called show/isis_frr.py and added the new file as an import to show/main/py

How to verify it

Included unittests for each show command and the different show command argument options.
Tested the code on a VS image.

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

sonic:~$ show isis neighbors
Area 1:
 System Id           Interface   L  State        Holdtime SNPA
sonic1         PortChannel01202  Up            25       2020.2020.2020
sonic2         PortChannel01212  Up            25       2020.2020.2020
sonic:~$ show isis database
Area 1:
IS-IS Level-2 link-state database:
LSP ID                  PduLen  SeqNumber   Chksum  Holdtime  ATT/P/OL
sonic1.00-00             1284   0x0000020e  0x3d7e   48072    0/0/0
sonic1.00-01             197   0x00000136  0x4474   64797    0/0/0
sonic2.00-00             1192   0x000001ae  0xd970   47837    0/0/0
sonic2.00-01             367   0x00000136  0xe315   31986    0/0/0
sonic3.00-00             1319   0x000001a9  0x3349   47881    0/0/0
sonic3.00-00             1115   0x000002e7  0x1b38   54629    0/0/0
    6 LSPs 
sonic:~$ show isis hostname
vrf     : default
Level  System ID      Dynamic Hostname
2      1000.2000.4000 sonic2    
     * 1000.2000.3000 sonic
sonic:~$ show isis interface
Area 1:
  Interface   CircId   State    Type     Level
  PortChannel01200x0      Up       p2p      L2 
  
sonic:~$ show isis interface --display 
[INTERFACE] options: ['Loopback0', 'Ethernet0', 'Ethernet4', 'Ethernet8', 'Ethernet12', 'Ethernet16', 'Ethernet20', 'Ethernet24', 'Ethernet28', 'Ethernet32', 'Ethernet36', 'Ethernet40', 'Ethernet44', 'Ethernet48', 'Ethernet52', 'Ethernet56', 'Ethernet60', 'Ethernet64', 'Ethernet68', 'Ethernet72', 'Ethernet76', 'Ethernet80', 'Ethernet84', 'Ethernet88', 'Ethernet92', 'Ethernet96', 'Ethernet100', 'Ethernet104', 'Ethernet108', 'Ethernet112', 'Ethernet116', 'Ethernet120', 'Ethernet124', 'PortChannel0002', 'PortChannel0003', 'PortChannel0120']
Area 1:
  Interface   CircId   State    Type     Level
  PortChannel01200x0      Up       p2p      L2 
sonic:~$ show isis topology
Area 1:
IS-IS paths to level-2 routers that speak IP
Vertex               Type         Metric Next-Hop             Interface Parent
sonic1                                                          
172.20.53.0/31       IP internal  0                           sonic1(4)
172.20.52.0/31       IP internal  0                           sonic1(4)
sonic2               TE-IS        10     sonic2               PortChannel0121 sonic1(4)
10.3.159.80/32       IP TE        10     sonic2               PortChannel0121 sonic2(4)
10.3.159.81/32       IP TE        10     sonic2               PortChannel0121 sonic2(4)
......
sonic:~$ show isis summary
vrf             : default
Process Id      : 4663
System Id       : 0000.0000.0000
Up time         : 00:04:31 ago
Number of areas : 1
Area 1:
  Net: 10.0000.0000.0000.0000.0000.0000.0000.0000.0000.00
  TX counters per PDU type:
     L2 IIH: 144
     L2 LSP: 4
    L2 CSNP: 29
   LSP RXMT: 0
  RX counters per PDU type:
     L2 IIH: 143
     L2 LSP: 4
  Drop counters per PDU type:
     L2 IIH: 1
  Advertise high metrics: Disabled
  Level-1:
    LSP0 regenerated: 3
         LSPs purged: 0
    SPF:
      minimum interval  : 1
    IPv4 route computation:
      last run elapsed  : 00:04:25 ago
      last run duration : 111 usec
      run count         : 3
    IPv6 route computation:
      last run elapsed  : 00:04:25 ago
      last run duration : 23 usec
      run count         : 3
  Level-2:
    LSP0 regenerated: 4
         LSPs purged: 0
    SPF:
      minimum interval  : 1
    IPv4 route computation:
      last run elapsed  : 00:04:21 ago
      last run duration : 45 usec
      run count         : 9
    IPv6 route computation:
      last run elapsed  : 00:04:21 ago
      last run duration : 14 usec
      run count         : 9
......
sonic:~$ show run isis
"""Building configuration...
Current configuration:
!
frr version 8.2.2
frr defaults traditional
hostname vlab-01
log syslog informational
log facility local4
no service integrated-vtysh-config
!
password zebra
enable password zebra
!
interface PortChannel101
 ip router isis 1
 ipv6 router isis 1
 isis network point-to-point
exit
!
router isis 1
 is-type level-2-only
 net 49.0001.1720.1700.0002.00
 lsp-mtu 1383
 lsp-timers level-1 gen-interval 30 refresh-interval 900 max-lifetime 1200
 lsp-timers level-2 gen-interval 30 refresh-interval 305 max-lifetime 900
 log-adjacency-changes
exit
!
end
  
sonic:~$ show run isis  --config_db 
{ 
  "ISIS_GLOBAL": { 
    "1": { 
      "net": "49.0001.1720.1700.0002.00", 
      "lsp_mtu_size": "1383",   
      "spf_time_to_learn": "25"  
    } 
  }, 
	"ISIS_LEVEL": { 	
    "1|level-2": { 
      "lsp_refresh_interval": "305", 
      "lsp_maximum_lifetime": "900"
    } 
  }, 
	"ISIS_INTERFACE": { 
    "1|PortChannel0101": { 
      "instance":"1", 
      "ifname": "PortChannel0120", 
      "network_type": "point-to-point", 
      "ipv4_routing_instance": "1", 
      "ipv6_routing_instance": "1", 
    } 
  } 
} 
`

@cchoate54 cchoate54 force-pushed the sonic_isis_base_show_command branch 2 times, most recently from 2da799a to b473dd5 Compare February 17, 2023 21:43
* Update show/main.py Include "isis" as a cli group option for show commands
* Create show/isis_frr.py Add "isis" as a cli group option for show commands and add support for "show isis neighbors", "show isis database", "show isis hostname", and "show isis interface"

Signed-off-by: cchoate54@gmail.com
@cchoate54 cchoate54 force-pushed the sonic_isis_base_show_command branch from b473dd5 to 7497c3f Compare February 22, 2023 23:11
Signed-off-by: ideleon@microsoft.com
isabelladeleon12 and others added 7 commits April 12, 2023 14:50
Signed-off-by: ideleon@microsoft.com
Signed-off-by: ideleon@microsoft.com
[show/tests] Add support for "show run isis"
Signed-off-by: cchoate <cchoate@microsoft.com>
…_json

[show/tests] Add support for "show isis summary"
@cchoate54 cchoate54 force-pushed the sonic_isis_base_show_command branch 9 times, most recently from fc89b29 to 2d5d1d7 Compare April 24, 2023 18:53
@lguohan
Copy link
Contributor

lguohan commented Apr 24, 2023

is there a design doc for is-is feature in sonic? we need to review the design doc before proceeding with any PR related.

@cchoate54 cchoate54 force-pushed the sonic_isis_base_show_command branch from 2d5d1d7 to e2a8c58 Compare April 24, 2023 19:18
[show/tests] Add support for "show isis topology"
@cchoate54 cchoate54 force-pushed the sonic_isis_base_show_command branch from e2a8c58 to 59ed4cb Compare April 24, 2023 20:12
@cchoate54 cchoate54 marked this pull request as ready for review April 24, 2023 20:55
@cchoate54
Copy link
Contributor Author

cchoate54 commented Apr 24, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants