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

  • 相关阅读:
    行坐标HDU1175:连连看(DFS)
    hibernatesqlHibernate中createQuery与createSQLQuery两者的区别
    代码窗口九种方式实现 javascripts 弹出对话框窗口代码
    函数线程VC++多线程函数调用
    错误classspring错误汇总
    android下载手动下载Android SDK
    节点node[算法导论]二叉排序树(Binary Search Tree)
    共享访问失败解决(无法访问 您可能没有权限使用网络资源)
    DnsTester(DNS 服务器性能测试工具)
    vc 花指令 防破解
  • 原文地址:https://www.cnblogs.com/qq952693358/p/5961854.html
Copyright © 2011-2022 走看看