zoukankan      html  css  js  c++  java
  • P4factory <Towards a better behavioral model: bmv2>

    尝试使用bmv2行为模型来跑p4实例。

    原文说明:

    We have released a new version of the behavioral model, written in C++. Some targets already support this new model -in addition to the original version, p4c-behavioral. If you see a target with a bmv2 directory, it means the new model is supported and you can try it out!
    The new model splits the switch logic and the auto-generated PD API (drivers) into 2 different processes.

    执行

    打开三个终端,A,B,C。

    A终端进入p4factory/targets/l2_switch/bmv2,模拟数据平面,执行如下命令:

    make bm
    
    ./run_bm.sh  #to start the data plane 
    

    结果:

    Adding interface veth0 as port 0
    Adding interface veth2 as port 1
    Adding interface veth4 as port 2
    Adding interface veth6 as port 3
    Adding interface veth8 as port 4
    Adding interface veth10 as port 5
    Adding interface veth12 as port 6
    Adding interface veth14 as port 7
    Adding interface veth16 as port 8
    Thrift server was started
    

    B终端进入p4factory/targets/l2_switch/bmv2,打开PD APIs(RPC服务器),执行如下命令:

    sudo ./drivers  #in a second terminal, to start the PD APIs (RPC server)
    

    结果:

    Starting RPC server on port 9090
    

    C终端进入l2_switch目录,跑实例:

    sudo python run_tests.py --test-dir tests/ptf-tests/
    

    结果:

    WARNING: No route found for IPv6 destination :: (no default route?)
    l2_switch.SimpleReplicationTest ... ok
    
    ----------------------------------------------------------------------
    Ran 1 test in 0.813s
    
    OK
    

    返回终端B,得到结果:

    Adding Thrift service for P4 program l2_switch to server
    In client_init
    In clean_all
    In smac_set_default_action_mac_learn
    In dmac_set_default_action_broadcast
    In mcast_src_pruning_set_default_action__nop
    In mc_mgrp_create
    In mc_node_create
    In mc_associate_node
    In mcast_src_pruning_table_add_with__drop
    Received learning notification
    I received 1 samples
    

    2016/10/14

  • 相关阅读:
    HNCU 1746: 算法4-1,4-3:定位子串
    HNCU 1330: 算法3-1:八进制数
    HNCU 1741: 算法3-2:行编辑程序
    51NOD 1073 约瑟夫环
    约瑟夫问题
    HNCU1325: 算法2-3~2-6:Big Bang(静态链表)
    指针知识复习
    html----学完总结
    html7---转载---为何img,input等内联元素可以设置高度与宽度
    html6---转载---块级元素与行内元素
  • 原文地址:https://www.cnblogs.com/qq952693358/p/5961854.html
Copyright © 2011-2022 走看看