What directory does the Ryu controller install on arch Linux?
/usr/lib/python3.6/site-packages/ryu/
How do I display the help command for MININETCLI?
Mininet> Help
How do i show the mininet node?
Mininet> nodes
How do I display the mininet connection?
mininet> netmininet>links
How do I create a simple HTTP server in a virtual middle, and access it from another terminal?
&mininetwget -O-h1...mininetkill %python
How do I run a recursive test? sudo mn--TestPingpair (testing)sudo mn--test iperf (test bandwidth)
How do I outline the topology and type of the network?
sudo mn--test pingall--topo single,3sudo mn--test pingall--topo Linear,4
How do I set properties for a connection, including loans and delays?
sudo mn--link tc,bw=, delay=10ms
How do I set debug mode?
sudo mn-v debug
How to customize a topology, please attach the relevant Python file notation?
The following statements apply:
sudo mn--custom ~/mininet/custom/topo-2sw-2host.py--topo mytopo--test pingall
The corresponding script is as follows:
topo-2sw-2host.py:
"""Custom topology Exampletwo directly connected switches plus a host for each switch:host---switch---switch---host Adding the ' topos ' dict with a key/value pair to generate we newly definedtopology enables one to pass in '--topo=mytopo ' from the command line.""" fromMininet.topoImportTopoclassMytopo (Topo):"Simple topology example."def __init__(self):"Create Custom topo."#Initialize TopologyTopo.__init__(self)#ADD hosts and switchesLefthost = Self.addhost ('H1') Righthost= Self.addhost ('H2') Leftswitch= Self.addswitch ('S3') Rightswitch= Self.addswitch ('S4' )#Add LinksSelf.addlink (Lefthost, Leftswitch) Self.addlink (Leftswitch, Rightswitch) Self.addlink (RightSwitch, RightHost) Topos= {'Mytopo': (Lambda: Mytopo ())}
How do I change the corresponding MAC address?
sudo mn--mac
How do I open a terminal directly?
sudo mn-x
How do I use Dpctl to view the flow table for a switch?
The format of the Dpctl dump-flows is as follows:
[-M |--more] dump-flows [DP] [Filter=filter]
Mininet?
How do I use other types of switches?
sudo mn--switch Ovsk--test iperf
How do I set everything to have its own namespace?
sudo mn--innamespace--switch user
How do I set the properties of a link? Open and close, for example.
mininet> link S1 h1 downmininet> link S1 h1 up
How do I display a host within a network?
Mininet> xterm H1 H2
How do I set up a remote controller?
sudo mn--controller=remote,ip=[controller ip],port=[controller listening port]sudo mn-- controller=remote,ip=192.168. 1.150, port=6633
How do I use the other OpenFlow protocol?
--switch ovsk,protocols=openflow13
Reference pages:
http://fishcried.com/2016-02-09/openvswitch-ops-guide/
To understand OvS's operations well, you must understand the basic concepts:
Packet
The smallest data unit forwarded by the network, each packet from a port, will eventually be sent to one or more destination ports, the process of forwarding packets is the only function of the network.
Bridge
The Network bridge in the Openvswitch corresponds to a physical switch, and its function is to forward packets received from the port to another port or ports according to a certain flow rule.
Port
A port is a unit that is sending and receiving packets. Openvswitch, each port belongs to a specific network bridge. The packets received by the port are processed by the stream rules and sent to other ports, and the data from the other ports is packets. Mainly
type |
Description |
Normal |
The user can bind the network card in the operating system to the OvS, and OvS will generate a normal port to handle the packets in and out of the NIC. |
Internal |
When the port type is internal, OvS creates a virtual network card, and all packets received by the port are handed over to the network card, which is sent to OvS through the port. When OvS creates a new bridge, a internal Port with the same name as the Network Bridge is created by default. |
Patch |
When there are multiple OvS bridges in the machine, you can use patch port to connect the two bridges together. Patch ports are always paired, connected on two bridges, exchanging data between two bridges. |
Tunnel |
A tunnel port is a virtual port that supports the use of tunneling techniques such as GRE or Vxlan to communicate with remote ports located in other locations on the network. |
Interface
An interface is a component that OvS and externally switches packets. An interface is a network card of the operating system, the network card may be OvS generated virtual network card, or the physical network card may be mounted on the OvS, or the operating system may be the virtual network card (TUN/TAP) mounted on the OvS.
Flowtable
A stream defines the exchange rules for packets between ports. Flowtable is described in detail below.
Structure of the OvS command:
Ovs-dpctl |
DataPath Controller, can create delete DP, control DP in Flowtables, most often use show commands, other rarely manual operation |
Ovs-ofctl |
Flow table controller, control the flow table on bridge, view port statistics, etc. |
Ovsdb-tool |
Dedicated to managing OVSDB's client |
Ovs-vsctl |
The most commonly used command, by manipulating Ovsdb to manage related bridge,ports or something. |
Ovs-appctl |
This can be directly interacted with Openvswitch Daemon, which is not listed, so the command is less used |
A summary record of the following commands:
- ovs-dpctl
show-s
- ovs-ofctl
show, Dump-ports, Dump-flows, Add-flow, Mod-flows, del-flows
- ovsdb-tools < Code class= "Highlighter-rouge" >show-log-m
- ovs-vsctl
- Show Database contents
- about the operation of the bridge < Code class= "Highlighter-rouge" >add-br, LIST-BR, DEL-BR, br-exists .
- operations on port
list-ports, Add-port, Del-port, Add-bond, Port-to-br
.
- operations on Interface
list-ifaces, IFACE-TO-BR
-
ovs-vsctl List/set/get/add/remove/clear/destroy table record column [value]
, the common table has bridge, Controller,interface,mirror,netflow,open_vswitch,port,qos,queue,ssl,sflow.
- ovs-appctl
list-commands, Fdb/show, qos/show
How do I show bridge, showing its relationship to the concept of port?
# Ovs-vsctl Show
How to see which bridge, which ports, and which interface?
[Email protected]1: ~# ovs-vsctl list-BRBR-EXBR-intBR-Tun[email protected]-network-1: ~# ovs-vsctl list-ports br-TunPatch-intVxlan-Ac1c0509vxlan-Ac1c050dvxlan-Ac1c051cvxlan-Ac1c053f[email protected]-network-1: ~# ovs-vsctl list-ifaces br-TunPatch-intVxlan-Ac1c0509vxlan-Ac1c050dvxlan-Ac1c051cvxlan-ac1c053f# Iface has the same name as ports.
How do I see which port,interface belongs to which bridge?
[Email protected] 1: ~# ovs-vsctl port-to-br vxlan-ac1c0509br-tun[email protected]-network-1: ~# Ovs-vsctl iface-to-br vxlan-ac1c0509br-tun
How to view a bridge's flow table, if it is not the default of the protocol, then how to display?
[Email protected] 1: # ovs-ofctl Dump-flows Br-ex
sudo ovs-ofctl-o Openflow13 dump-flows <switch>
How do i show the flow table for a bridge?
# Ovs-ofctl Show Br-ex
How do i show hidden flow table rules?
# Ovs-appctl Bridge/dump-flows Br-ex
How do I view DataPath's statistical rules?
# ovs-dpctl show# ovs-dpctl show-s
# # View statistics for a port ovs-ofctl dump-ports br [port]# OvS1
How do I view a forwarding post?
# Ovs-appctl Fdb/show Br-ex
Related Settings for OvS
Set Sflow, related pages:
http://docs.openvswitch.org/en/latest/howto/sflow/
Http://www.sdnlab.com/3760.html
sudo ovs-vsctl----ID[email protected]_1 create sflow agent=s4 target=\"10.0.0.2:6343\ " \header= sampling= polling= -- set Bridge S4 [email protected]_1
How do I set QoS?
Reference pages:
http://docs.openvswitch.org/en/latest/howto/qos/
http://fishcried.com/2016-02-09/openvswitch-ops-guide/
Ovs-vsctl set Interface tap0 ingress_policing_rate=100000OvS-vsctl set intervace tap Ingress_ policing_burst=10000OvS-appctl qos/show <iface>
How do I see the matching of flow rules?
1 " sudo ovs-ofctl dump-flows <bridge> "
How to use tcpdump to grab a bag?
You need to set the mirroring of the ports.
IP link Add name SNOOPER0 type Dummyip link set dev Snooper0 upovs-vsctl Add-port br-intsnooper0# OvS-vsctl--Set Bridge br-int[email protected]----ID=@snooper0 get Port Snooper0-- --ID[email protected] get PortPatch-Tun-- --ID[Email protected] Create Mirror Name=mymirrorSelect[Email protected]TunSelect[Email protected] [Email protected] select_all=1tcpdump-I Snooper0ovs-vsctlClearBridge br-intMirrorsovs-vsctl Del-port br-intsnooper0ip link Delete Dev Snooper0
How do I view OvS's logs?
cat /var/log/openvswitch/*log# ovsdb-tool show-log-m
How do I send a package to test a match?
# ovs-appctl Ofproto/trace br-ex in_port=, dl_src=:4e:cc: ae:4d: +,dl_dst= F8:8a: +:dd:generatebridge:br-ex
Change record:
Change Notes |
Change Person |
Time |
Organize mininet notes and some OvS records |
Andrew |
2016-04-18 |
Organize the OvS portion of fishcired notes and add them to my own OvS section |
Andrew |
2016-05-12 |
|
|
|
Mininet and OvS Summary