It’s been a long time since Cisco announced Fog computing, and implemented somewhat of programmability on their network devices. However I had never really looked at those functionalities until very recently.
I’m working in telecom industry and there has been no single day I don’t see Cisco devices, but most (if not all) of deployment is legacy, which utilizes only network function of those devices. It’s good as it is what those devices are meant to do, but I took a look on these new capabilities and found it very useful, and fun!
As Cisco mentioned in their article, these function should be used for non-networking functions. But these will be new weapons for those who knows networking very well to add-on new features as they wish, and on the other hand these will also be a good entry point for those who didn’t take care network(i.e developer, application engineer) until now. One of the most reliable network vendor provides small app platform on their small routers and switches.
Enable IOX service
It’s not enabled on boot, so you need to enable services on IOS-XE. As this test is done on CSR1000v on AWS, it uses LXC.
usrt01#conf t Enter configuration commands, one per line. End with CNTL/Z. usrt01(config)#iox usrt01(config)#do sh iox-service Virtual Service Global State and Virtualization Limits: Infrastructure version : 1.7 Total virtual services installed : 0 Total virtual services activated : 0 Machine types supported : LXC Machine types disabled : KVM Maximum VCPUs per virtual service : 0 Resource virtualization limits: Name Quota Committed Available -------------------------------------------------------------- system CPU (%) 75 0 75 memory (MB) 1024 0 1024 bootflash (MB) 20000 0 6751 IOx Infrastructure Summary: --------------------------- IOx service (CAF) : Running IOx service (HA) : Not Running IOx service (IOxman) : Running Libvirtd : Running
The environment is almost ready.
- Create connection … VirtualPortGroup, which is the connection point between the IOS and the guest system.
- Allocate resource for application
- Start application
usrt01(config)# usrt01(config)#int virtualportGroup 0 usrt01(config-if)#ip addre 10.0.0.254 255.255.255.0 usrt01(config-if)#exit usrt01(config)# usrt01(config)#app-hosting appid guestshell usrt01(config-app-hosting)#vnic gateway1 virtualportgroup 0 guest-interface 0 guest-ipaddress 10.0.0.1 netmask 255.255.255.0 gateway 10.0.0.254 name-server 8.8.8.8 default usrt01(config-app-hosting)#resource profile custom cpu 1500 memory 512 usrt01(config-app-hosting)#end usrt01#guestshell enable Interface will be selected if configured in app-hosting Please wait for completion guestshell installed successfully Current state is: DEPLOYED guestshell activated successfully Current state is: ACTIVATED guestshell started successfully Current state is: RUNNING Guestshell enabled successfully usrt01#sh app-hosting list App id State ------------------------------------------------------ guestshell RUNNING usrt01#usrt01#guestshell [guestshell@guestshell ~]$ [guestshell@guestshell ~]$ hostname -I 10.0.0.1 [guestshell@guestshell ~]$ ping 10.0.0.254 PING 10.0.0.254 (10.0.0.254) 56(84) bytes of data. 64 bytes from 10.0.0.254: icmp_seq=2 ttl=255 time=0.525 ms 64 bytes from 10.0.0.254: icmp_seq=3 ttl=255 time=0.550 ms 64 bytes from 10.0.0.254: icmp_seq=4 ttl=255 time=0.580 ms ^C --- 10.0.0.254 ping statistics --- 4 packets transmitted, 3 received, 25% packet loss, time 2999ms rtt min/avg/max/mdev = 0.525/0.551/0.580/0.035 ms [guestshell@guestshell ~]$ [guestshell@guestshell ~]$ cat /flash/work/i_am_running.py #!/bin/bash/python import cli # you can execute IOS command from guestshell print "Hello, I\'m running on {}".format(cli.execute("show ver | inc Cisco IOS XE Software")) [guestshell@guestshell ~]$ python /flash/work/i_am_running.py Hello, I'm running on Cisco IOS XE Software, Version 16.07.01a [guestshell@guestshell ~]$