# Mininet Integration for behavioral-model

**URL:** <https://forum.p4.org/t/mininet-integration-for-behavioral-model/753>\
**Category:** Getting Started with P4\
**Created:** [April 20, 2023, 5:13pm UTC](https://forum.p4.org/t/mininet-integration-for-behavioral-model/753 "2023-04-20T17:13:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SpecialGuest](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@SpecialGuest](https://forum.p4.org/u/SpecialGuest)\
**Post date:** [April 20, 2023, 5:13pm UTC](https://forum.p4.org/t/mininet-integration-for-behavioral-model/753/1 "2023-04-20T17:13:46Z")

</div>

Hello everyone,

I need help with the [Mininet integration](https://github.com/p4lang/behavioral-model#integrating-with-mininet) of the behavioral-model. We have a 1sw\_demo.py file provided that only builds a single switch topology. What would be the procedure if I wanted to create a topology with multiple switches? Can we, for example, use the similar Mininet building procedure as in the [Tutorials](https://github.com/p4lang/tutorials), which seems to be much more user-friendly?

Thank you very much in advance.

---

<div class="post-metadata">

**Author:** ![DavideS](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.p4.org/davides/32/120_2.png) [@DavideS](https://forum.p4.org/u/DavideS)\
**Post date:** [April 21, 2023, 8:04am UTC](https://forum.p4.org/t/mininet-integration-for-behavioral-model/753/2 "2023-04-21T08:04:23Z")

</div>

Hi @SpecialGuest

Depends wich kind of topology you whant to create, more in detail with mininet you can create your own topology in a python script but at the same time mininet provides to you 2,3 defautl topology tha are linear, tree and torous.  
You can take a look to this script to wirte you own mininet topology [tutorials/multi\_switch\_mininet.py at master · p4lang/tutorials · GitHub](https://github.com/p4lang/tutorials/blob/master/utils/mininet/multi_switch_mininet.py)

Best  
Davide

---

<div class="post-metadata">

**Author:** ![SpecialGuest](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@SpecialGuest](https://forum.p4.org/u/SpecialGuest)\
**Post date:** [April 22, 2023, 1:00am UTC](https://forum.p4.org/t/mininet-integration-for-behavioral-model/753/3 "2023-04-22T01:00:15Z")

</div>

Hello,

Thank you for your reply!

Can you please elaborate on the multi\_switch\_mininet.py arguments? I need clarification about which file corresponds to the specific function argument (especially _–manifest_ and _–target_ arguments).

Do these files somehow correspond to JSON files as in the Tutorials, for example:

- JSON file of our original P4 program (compiled as explained in the behavioral-model);
- JSON file of the topology;
- JSON file(s) of the specific switches.

Nevertheless, I am having trouble starting the script.

Thank you again.

P.S. I can run the original 1sw\_demo.py script just fine.

---

<div class="post-metadata">

**Author:** ![DavideS](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.p4.org/davides/32/120_2.png) [@DavideS](https://forum.p4.org/u/DavideS)\
**Post date:** [April 22, 2023, 11:36am UTC](https://forum.p4.org/t/mininet-integration-for-behavioral-model/753/4 "2023-04-22T11:36:43Z")

</div>

Hi @SpecialGuest

I never use it, but i think that you can do reverse engineer on this file that is the one that handel the command `make run` used in the various execises

> <https://github.com/p4lang/tutorials/blob/master/utils/Makefile>
