Transcript
  • 1. UnderstandingOpenVNets flow!1

2. http://github.com/axsh/openvnet/wiki/FlowTableSorry for that the instruction is currently written in only Japanese.English version will come soon!2 3. Flows on OVS[root@dev1 ~]# ovs-ofctl -O Openflow13 dump-flows br0!!OFPST_FLOW reply (OF1.3) (xid=0x2):!cookie=0x900000000000000, duration=2414584.604s, table=0, n_packets=2, n_bytes=684,priority=1,tun_id=0 actions=drop!cookie=0x900000000000000, duration=2414584.604s, table=0, n_packets=7, n_bytes=590,priority=2,in_port=CONTROLLER actions=write_metadata:0x4040000000000/0x40c0000000000,goto_table:7cookie=0x500000000000003, duration=2414582.969s, table=0, n_packets=220, n_bytes=39634,priority=2,in_port=3 actions=write_metadata:0x700040000000005/0xff000c00ffffffff,goto_table:15!cookie=0x500000000000001, duration=2414583.972s, table=0, n_packets=1042, n_bytes=133986,priority=2,in_port=1 actions=write_metadata:0x700080000000001/0xff000c00ffffffff,goto_table:10!cookie=0x5000000fffffffe, duration=2414584.042s, table=0, n_packets=180, n_bytes=38718,priority=2,in_port=LOCAL actions=write_metadata:0x40000000000/0xc0000000000,goto_table:6!cookie=0x500000000000002, duration=2414582.705s, table=0, n_packets=957, n_bytes=111288,priority=2,in_port=2 actions=write_metadata:0x700040000000004/0xff000c00ffffffff,goto_table:15Bit unreadable. we created vnflows!3 4. Flows on OpenVNetvnflows outputs the flows in a nice format[root@dev1 ~]# ovs-ofctl -O Openflow13 dump-flows br0 | vnflows!!(0): TABLE_CLASSIFIER!0-00 174 0 =>actions=write_metadata:REMOTE(0x80000000000/0xc0000000000),goto_table:TABLE_TUNNEL_PORTS(3)!0-01 2 0 => tun_id=0 actions=drop!0-02 220 0 => in_port=3 actions=write_metadata:TYPE_INTERFACE|LOCAL(0x700040000000005/0xff000c00ffffffff),goto_table:TABLE_INTERFACE_EGRESS_CLASSIFIER(15)!0-02 310 0 => in_port=1 actions=write_metadata:TYPE_INTERFACE|REMOTE(0x700080000000001/0xff000c00ffffffff),goto_table:TABLE_INTERFACE_INGRESS_CLASSIFIER(10)!0-02 180 0 => in_port=LOCALactions=write_metadata:LOCAL(0x40000000000/0xc0000000000),goto_table:TABLE_LOCAL_PORT(6)!0-02 4 0 => in_port=CONTROLLER actions=write_metadata:LOCAL|NO_CONTROLLER(0x4040000000000/0x40c0000000000),goto_table:TABLE_CONTROLLER_PORT(7)Next : take one piece of flows to see how it is formed.!4 5. Flows on OpenVNetTable Num of packetsPriorityTimeout Match Action!0-02 220 0 => in_port=3 actions=write_metadata:TYPE_INTERFACE|LOCAL(0x700040000000005/0xff000c00ffffffff),goto_table:TABLE_INTERFACE_EGRESS_CLASSIFIER(15)!Metadata: a maskable register value that is used to carryinformation from one table to the next.OpenFlow Switch Specification Version 1.1.0!5 6. MetadataOpenVNet has its own usage of the metadata63 0metadata value field0 - 31 (32bits)56 55 40 31metadata flag field40 - 55 (16bits)metadata type field56 - 63 (8bits)!6 7. Metadata typeMETADATA_TYPE_SHIFT = 56!METADATA_TYPE_MASK = (0xff in_port=38actions=goto_table:TABLE_TUNNEL_NETWORK_IDS(4)!!4-30 174 0 => tun_id=0x80000002actions=write_metadata:TYPE_NETWORK(0x300000000000002/0xff000000ffffffff),goto_table:TABLE_NETWORK_SRC_CLASSIFIER(20)!!20-40 391 0 =>metadata=TYPE_NETWORK(0x300000000000002/0xff000000ffffffff)actions=goto_table:TABLE_VIRTUAL_SRC(21)0x300080000000002metadata = 0x000080000000002!18tun_id = 0x80000002 19. Mac learning21-81 5 0 => arp,metadata=TYPE_NETWORK|REMOTE(0x300080000000002/0xff000c00ffffffff)actions=learn(table=41,idle_timeout=36000,priority=35,cookie=0x400000000000002,metadata=0x300040000000002,NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],load:NXM_NX_TUN_ID[]->NXM_NX_TUN_ID[],output:NXM_OF_IN_PORT[]),goto_table:TABLE_ROUTE_INGRESS_INTERFACE(30)public linedatapatheth0MAC address02:00:00:00:00:01!IP address10.101.0.10eth12 3VM1vnaGRE tunnel L3 switchVM2datapatheth02 3VM5vnaVM6Learning MAC address!02:00:00:00:00:01!comes from eth0host1 host3!19 20. 30-00 1223 0 =>actions=goto_table:TABLE_NETWORK_DST_CLASSIFIER(40)!!!40-40 307 0 =>metadata=TYPE_NETWORK(0x300000000000002/0xff000000ffffffff)actions=goto_table:TABLE_VIRTUAL_DST(41)!!!41-30 11 0 => dl_dst=ff:ff:ff:ff:ff:ffactions=goto_table:TABLE_FLOOD_SIMULATED(50)metadata = 0x300080000000002!20 21. 50-00 7 0 =>actions=goto_table:TABLE_FLOOD_LOCAL(51)!51-01 3 0 =>metadata=TYPE_NETWORK(0x300000000000002/0xff000000ffffffff)actions=output:2,goto_table:TABLE_FLOOD_SEGMENT(52)!!52-10 6 0 =>metadata=REMOTE(0x80000000000/0xc0000000000) actions=dropPacket public lineis sent to port 2,which is associated with VM5datapatheth0It then drops the packetsince no more forwarding is needed.metadata = 0x300080000000002eth12 3VM1vnaL3 switchGRE tunnelVM2datapatheth02 3VM5vnaVM6host1 host3!21