Skip to content

mixi-netops/tcam_usage_calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tcam_usage_calculator

tcam_usage_calculator is a tool to read Config of the router and predict TCAM usage.
However, the prediction of tcam_usage_calculator is not perfect and we do not guarantee the operation, so please use it at your own risk.
This tool is compatible with Junos OS, predict the usage mainly from the definition of Firewall.

Operating environment

  • Python 3.6 and higher

Setup

$ pip install git+https://github.com/xflagstudio/tcam_usage_calculator.git

Docker

$ docker build -t xflagstudio/tcam_usage_calculator:1.0 .

How to use

Confirm TCAM usage of whole Config

$ tcam_usage_calculator /path/to/config/RouterConfig
TotalCost: 225

Confirm TCAM usage of the whole Config and Filter

$ tcam_usage_calculator /path/to/config/RouterConfig -d
filterA: 30
filterB: 3
filterC: 32
TotalCost: 65

Confirm TCAM usage of specific Filter

$ tcam_usage_calculator /path/to/config/RouterConfig -f filterA
filterA: 30

$ tcam_usage_calculator /path/to/config/RouterConfig -f filterA filterC
filterA: 30
filterC: 32

Make output format JSON format

$ tcam_usage_calculator /path/to/config/RouterConfig -d -j
[{"filterA": 30}, {"filterB": 3}, {"filterC": 32}, {"TotalCost": 65}]

$ tcam_usage_calculator /path/to/config/RouterConfig -f filterA filterC -j
[{"filterA": 30}, {"filterC": 32}]

Docker

$ CONFIG_FROM="/path/to/config/RouterConfig"
$ CONFIG_TO="/tmp/config"
$ docker run -v "$CONFIG_FROM:$CONFIG_TO" -it xflagstudio/tcam_usage_calculator:1.0 /bin/bash -c "tcam_usage_calculator -d -j $CONFIG_TO"

Licence

MIT license

About

Predict TCAM usage of router.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages