4. Command Line Interface

KNet CLI is a primary interface for the user to Create/delete/manipulate the Topology. Currently it supports the following commands.

Help
Version
Cleanup
CreateTopology
DeleteTopology
GetTopology
PingAll
Ping
TcpTest
TcpTest_Detach
Exec
UdpTest
UdpTest_Detach
DeleteNode
DeleteSwitch
AdminDownLink
AdminUpLink
Exit

4.1. Start the CLI

knet-cli
_images/knet_cli_start_s.png

4.2. Help commands

Help Command, lists the available commands.

Help <command name> gives the detailed help for a given command

Help
Help <command name>

Screeshot:

_images/cli_help_s.png

4.3. Version

Shows the version of KNet.

4.4. CreateTopology

CreateTopology command creates a Topology. The Topology input file is defined in YAML format. User can easily define any complex topology by writing the YAML file.(Refer: Topology_file section)

There are few example topologies availale in https://github.com/knetsolutions/knet-example-topologies in the repository.

CreateTopology <Topology file>

Note: Topology file needs to be specified in absolute path. Example; /home/ubuntu/mytopology.yaml

_images/cli2_s.png

Note: If the Topology file name or Path is not correct, you will see “I/O operation failed” Error.

4.5. GetTopology

GetTopology command gives the detailed information of the Topology, such as Node details(Name, IP, Mac, ID), Switch details(name, datapathid), Link Details(Interface name, Src, Destination).

GetTopology
_images/cli_gettopo_s.png

4.6. PingAll

PingAll command, generates 2 ping packets from each node to all other nodes.

_images/cli_pingall_s.png

4.7. Ping

Ping command, generates 2 ping packets from source node to destination node.

Ping <source node>  <destination node>

Screenshot:

_images/cli_ping_s.png

4.8. Exec

Exec command, helps to execute the system command in the node.

Syntax:

Exec  < node>  <command>

For example, you want to know the arp entries of the host

Exec  a1 arp -a
Exec  a1 ifconfig
Exec  a1 ip route
Exec  a1 traceroute 10.1.1.2

4.9. TcpTest

Helps to perform the Iperf TCP traffic test between two nodes

Refer: Traffic Test session for mode details

4.10. UdpTest

Helps to perform the Iperf UDP traffic test between two nodes

Refer: Traffic Test session for mode details

4.11. DeleteTopology

DeleteTopology command deletes the entier topology(nodes, switches, links)

DeleteTopology

Screenshot:

_images/cli_deletetopo_s.png