Package: netsim-wrapper
Netsim Wrapperncs-netsim is a great tool, but it lack of following features which are developed as part of netsim-wrappernetsim-wrapper featuresdelete-devices <device-names>create-network-from [ yaml | json ] <filename>create-device-from [ yaml | json ] <filename>create-network-template [ yaml | json ]create-device-template [ yaml | json ]netsim-wrapper is a wrapper on top of ncs-netsim with added features. It's written in python and we opened the space to add more features to it.IntroductionPre-requisitesInstallationFeaturesHelpFAQBug Tracking and SupportLicense and CopyrightAuthor and ThanksContactIntroductionncs-netsim, It's a powerful tool to build a simulated network environment for Network Service Orchestrator (NSO) it's also called as NCS - NSO. In these network topologies we can test the network configurations based on the need as per the use case.netsim-wrapper, An open space to automate the ncs-netsim.Pre-requisitesncs-netsim command must be reconginsed by the terminal.netsim-wrapper supports both trains ofpython2.7+ and 3.1+, the OS should not matter.Installation and DownloadsThe best way to get netsim-wrapper is with setuptools or pip. If you already have setuptools, you can install as usual:python -m pip install netsim-wrapperpip install netsim-wrapperOtherwise download it from PyPi, extract it and run thesetup.pyscriptpython setup.py installIf you're Interested in the source, you can always pull from the github repo:From githubgit clone https://github.com/kirankotari/netsim-wrapper.gitFeaturesDelete a device(s) from topologyexisting device list⋊>~/k/i/netsim-wrapperonmaster◦netsim-wrapperlist
ncs-netsimlistfor/Users/kkotari/idea/netsim-wrapper/netsimname=xr0netconf=12022snmp=11022ipc=5010cli=10022dir=/Users/kkotari/idea/netsim-wrapper/netsim/xr/xr0name=xr1netconf=12023snmp=11023ipc=5011cli=10023dir=/Users/kkotari/idea/netsim-wrapper/netsim/xr/xr1name=xr2netconf=12024snmp=11024ipc=5012cli=10024dir=/Users/kkotari/idea/netsim-wrapper/netsim/xr/xr2name=xr3netconf=12025snmp=11025ipc=5013cli=10025dir=/Users/kkotari/idea/netsim-wrapper/netsim/xr/xr3
⋊>~/k/i/netsim-wrapperonmaster◦deleting devices⋊>~/k/i/netsim-wrapperonmaster◦netsim-wrapperdelete-devicesxr1xr3[INFO]::[ncs-netsim]::deletingdevice:xr1[INFO]::[ncs-netsim]::deletingdevice:xr3
⋊>~/k/i/netsim-wrapperonmaster◦latest device list⋊>~/k/i/netsim-wrapperonmaster◦netsim-wrapperlist
ncs-netsimlistfor/Users/kkotari/idea/netsim-wrapper/netsimname=xr0netconf=12022snmp=11022ipc=5010cli=10022dir=/Users/kkotari/idea/netsim-wrapper/netsim/xr/xr0name=xr2netconf=12024snmp=11024ipc=5012cli=10024dir=/Users/kkotari/idea/netsim-wrapper/netsim/xr/xr2
⋊>~/k/i/netsim-wrapperonmaster◦Create Network/Device TemplateTemplate to automate the Network/Device creation process.⋊>~/k/i/netsim-wrapperonmaster◦netsim-wrappercreate-network-template[yaml|json]⋊>~/k/i/netsim-wrapperonmaster◦netsim-wrappercreate-device-template[yaml|json]which givestemplate.json/yamlfile where you can update the files based on your need/requirement.Create Network/Device From TemplateWe are using the templates which are updated based on your requirement⋊>~/k/i/netsim-wrapperonmaster◦netsim-wrappercreate-network-from[yaml|json]<filename>
⋊>~/k/i/netsim-wrapperonmaster◦netsim-wrappercreate-device-from[yaml|json]<filename>How to choose the Templates and How they look (Template options)These templates follows the same process of ncs-netsim, format is your choiceprefix based creation -netsim-wrapper create-network-template yaml or json <file>name based creation -netsim-wrapper create-device-template yaml or json <file>Note:- If you need combinations of network/device template, we suggest to create 2 template files and run the command for each type.You can find the example all supported templates under it's folder.prefix-based template examplenso-packages-path:<path-to>/nso-local-lab/nso-run-5.2.1.2/packagescompile-neds:truestart-devices:trueadd-to-nso:trueadd-authgroup-to-nso:trueauthgroup:type:systemdevice-mode:prefix-based:cisco-ios-cli-6.56:count:2prefix:ios-56-cisco-ios-cli-6.55:count:2prefix:ios-55-load-day0-config:trueconfig-path:<path-to>/nso-local-lab/nso-run-5.2.1.2/preconfigconfig-files:-devices_ios_56.xml-devices_ios_55.xmlname-based template examplenso-packages-path:<path-to>/nso-local-lab/nso-run-5.2.1.2/packagescompile-neds:truestart-devices:trueadd-to-nso:trueadd-authgroup-to-nso:trueauthgroup:type:systemdevice-mode:name-based:cisco-ios-cli-6.56:-ios-56-name-100-ios-56-name-150cisco-ios-cli-6.55:-ios-55-name-200-ios-55-name-250load-day0-config:trueconfig-path:<path-to>/nso-local-lab/nso-run-5.2.1.2/preconfigconfig-files:-devices_ios_56.xml-devices_ios_55.xmlTemplate options in detailnso-packages-path:info:nso package pathcompile-neds:options:true or falseinfo:which run _make clean all_ for each nedstart-devices:options:true or falseinfo:starts devices using _ncs-netsim start_, it's intellegent enought to start only stopped devicesadd-to-nso:options:true or falseinfo:adds day0 devices config to nsoadd-authgroup-to-nso:options:type:local or system or custompath:authgroup config file path this option is only for custominfo:configuring authgroupdevice-mode:-prefix-based:ncs-netsim create-network/add-to-networkned-name:ned nameoptions:count:number of devicesprefix:prefix text for device names-name-based:ncs-netsim create-device/add-devicened-name:ned nameoptions:device namesload-day0-config:options:true or falseinfo:to add day0 config if the value is trueconfig-path:info:configuratin folder pathconfig-files:info:loads each configuration file from given config-pathHelp⋊>~/k/i/netsim-wrapperonmaster◦netsim-wrapper--help
Usagenetsim-wrapper[--dir<NetsimDir>]create-network-template[yaml|json]|create-network-from[yaml|json]<fileName>|create-network<NcsPackage><NumDevices><Prefix>|create-device-template[yaml|json]|create-device-from[yaml|json]<fileName>|create-device<NcsPackage><DeviceName>|add-to-network<NcsPackage><NumDevices><Prefix>|add-device<NcsPackage><DeviceName>|delete-devices<DeviceNames>|delete-network|[-a|--async]start[devname]|[-a|--async]stop[devname]|[-a|--async]reset[devname]|[-a|--async]restart[devname]|list|is-alive[devname]|status[devname]|whichdir|ncs-xml-init[devname]|ncs-xml-init-remote<RemoteNodeName>[devname]|[--force-generic]|packages|netconf-consoledevname[XpathFilter]|[-w|--window][cli|cli-c|cli-i]devname|get-portdevname[ipc|netconf|cli|snmp]|-v|--version|-h|--help

Seemanpageforncs-netsimformoreinfo.NetsimDirisoptional
anddefaultsto./netsim,anynetsimdirectoryaboveinthepath,
or$NETSIM_DIRifset.FAQQuestion:Do I need to install ncs-netsim too?Answer:Not really, ncs-netsim tool comes along with NSO. If you are working with NSO it's won't be a problem.Question:Is python mandatory for netsim-wrapper?Answer:Yes, the library is written in python and we wanted not to be dependend on NSO versions.Question:Is netsim-wrapper backword compatable?Answer:We recommend to use netsim-wrapper commands instead of ncs-netsim. However couple of commands are still backward compatable ie.ncs-netsim list, etc.Question:I am seeing following error ./env.sh: line 12: export: `Fusion.app/Contents/Public:/Applications/Wireshark.app/Contents/MacOS': not a valid identifierAnswer:We recommend to check your env path as recommended in followinglinkBug Tracker and SupportPlease report any suggestions, bug reports, or annoyances with netsim-wrapper through theGithub bug tracker.License and Copyrightnetsim-wrapper is licensedApache 2.02019-2020Authors and Thanksnetsim-wrapper was developed byKiran Kumar Kotari, For any suggestions or comments contactkkotari@cisco.comorkirankotari@live.com. If you find any bugs please fix them and send me a pull request.