{"action":"created","comment":{"url":"https://api.github.com/repos/sethfowler/p4app/pulls/comments/104101538","pull_request_review_id":24917407,"id":104101538,"diff_hunk":"@@ -172,6 +172,72 @@ The BMV2 debugger is especially handy; you can read up on how to use it\n \n This target also supports the configuration values for the `compile-bvm2` target.\n \n+multiswitch\n+-----------\n+\n+Like `mininet`, this target compiles a P4 program and runs it in a Mininet\n+environment. Moreover, this target allows you to run multiple switches with a\n+custom topology and execute arbitrary commands on the hosts. The switches are\n+automatically configured with l2 and l3 rules for routing traffic to all hosts\n+(this assumes that the P4 programs have the `ipv4_lpm`, `send_frame` and\n+`forward` tables). For example:\n+\n+```\n+\"multiswitch\": {\n+  \"links\": [\n+    [\"h1\", \"s1\"],\n+    [\"s1\", \"s2\"],\n+    [\"s2\", \"h2\", 50]\n+  ],\n+  \"hosts\": {\n+    \"h1\": {\n+        \"cmd\": \"python echo_server.py %port%\",\n+        \"startup_sleep\": 0.2,\n+        \"wait\": false\n+    },\n+    \"h2\": {\n+        \"cmd\": \"python echo_client.py h1 %port% %echo_msg%\",\n+        \"wait\": true\n+    }\n+  }\n+}\n+\n+...\n+\n+\"parameters\": {","path":"README.md","position":null,"original_position":36,"commit_id":"cd5d18aab33c8a238bde3a6c521f221c64564120","original_commit_id":"3fd468b71f2a36c0ecd349e6568ed76f92e6e5d7","user":{"login":"theojepsen","id":820556,"avatar_url":"https://avatars2.githubusercontent.com/u/820556?v=3","gravatar_id":"","url":"https://api.github.com/users/theojepsen","html_url":"https://github.com/theojepsen","followers_url":"https://api.github.com/users/theojepsen/followers","following_url":"https://api.github.com/users/theojepsen/following{/other_user}","gists_url":"https://api.github.com/users/theojepsen/gists{/gist_id}","starred_url":"https://api.github.com/users/theojepsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theojepsen/subscriptions","organizations_url":"https://api.github.com/users/theojepsen/orgs","repos_url":"https://api.github.com/users/theojepsen/repos","events_url":"https://api.github.com/users/theojepsen/events{/privacy}","received_events_url":"https://api.github.com/users/theojepsen/received_events","type":"User","site_admin":false},"body":"That seems like a good idea. I moved the params into the multiswitch target in the latest commit.","created_at":"2017-03-03T07:33:28Z","updated_at":"2017-03-03T07:33:28Z","html_url":"https://github.com/sethfowler/p4app/pull/2#discussion_r104101538","pull_request_url":"https://api.github.com/repos/sethfowler/p4app/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/sethfowler/p4app/pulls/comments/104101538"},"html":{"href":"https://github.com/sethfowler/p4app/pull/2#discussion_r104101538"},"pull_request":{"href":"https://api.github.com/repos/sethfowler/p4app/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/sethfowler/p4app/pulls/2","id":108340813,"html_url":"https://github.com/sethfowler/p4app/pull/2","diff_url":"https://github.com/sethfowler/p4app/pull/2.diff","patch_url":"https://github.com/sethfowler/p4app/pull/2.patch","issue_url":"https://api.github.com/repos/sethfowler/p4app/issues/2","number":2,"state":"open","locked":false,"title":"Run a multi-switch topo with automatically generated switch tables","user":{"login":"theojepsen","id":820556,"avatar_url":"https://avatars2.githubusercontent.com/u/820556?v=3","gravatar_id":"","url":"https://api.github.com/users/theojepsen","html_url":"https://github.com/theojepsen","followers_url":"https://api.github.com/users/theojepsen/followers","following_url":"https://api.github.com/users/theojepsen/following{/other_user}","gists_url":"https://api.github.com/users/theojepsen/gists{/gist_id}","starred_url":"https://api.github.com/users/theojepsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theojepsen/subscriptions","organizations_url":"https://api.github.com/users/theojepsen/orgs","repos_url":"https://api.github.com/users/theojepsen/repos","events_url":"https://api.github.com/users/theojepsen/events{/privacy}","received_events_url":"https://api.github.com/users/theojepsen/received_events","type":"User","site_admin":false},"body":"This adds a new target, \"mininet2\" (for lack of better name). This new target allows you to create a multi switch mininet topology and run arbitrary commands on the hosts.\r\n\r\nThis new target assumes that the switches have some l2 and l3 tables. The script automatically generates the l2 and l3 routing rules and populates the tables with them.\r\n\r\nFurthermore, it maps `/tmp/p4app_logs` to the container, so any files that are generated can be persisted.","created_at":"2017-02-28T14:28:39Z","updated_at":"2017-03-03T07:33:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"951415d5c4f43cc209d3769321a35ab52a0e28de","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sethfowler/p4app/pulls/2/commits","review_comments_url":"https://api.github.com/repos/sethfowler/p4app/pulls/2/comments","review_comment_url":"https://api.github.com/repos/sethfowler/p4app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sethfowler/p4app/issues/2/comments","statuses_url":"https://api.github.com/repos/sethfowler/p4app/statuses/cd5d18aab33c8a238bde3a6c521f221c64564120","head":{"label":"theojepsen:multi_switch","ref":"multi_switch","sha":"cd5d18aab33c8a238bde3a6c521f221c64564120","user":{"login":"theojepsen","id":820556,"avatar_url":"https://avatars2.githubusercontent.com/u/820556?v=3","gravatar_id":"","url":"https://api.github.com/users/theojepsen","html_url":"https://github.com/theojepsen","followers_url":"https://api.github.com/users/theojepsen/followers","following_url":"https://api.github.com/users/theojepsen/following{/other_user}","gists_url":"https://api.github.com/users/theojepsen/gists{/gist_id}","starred_url":"https://api.github.com/users/theojepsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theojepsen/subscriptions","organizations_url":"https://api.github.com/users/theojepsen/orgs","repos_url":"https://api.github.com/users/theojepsen/repos","events_url":"https://api.github.com/users/theojepsen/events{/privacy}","received_events_url":"https://api.github.com/users/theojepsen/received_events","type":"User","site_admin":false},"repo":{"id":83433525,"name":"p4app","full_name":"theojepsen/p4app","owner":{"login":"theojepsen","id":820556,"avatar_url":"https://avatars2.githubusercontent.com/u/820556?v=3","gravatar_id":"","url":"https://api.github.com/users/theojepsen","html_url":"https://github.com/theojepsen","followers_url":"https://api.github.com/users/theojepsen/followers","following_url":"https://api.github.com/users/theojepsen/following{/other_user}","gists_url":"https://api.github.com/users/theojepsen/gists{/gist_id}","starred_url":"https://api.github.com/users/theojepsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theojepsen/subscriptions","organizations_url":"https://api.github.com/users/theojepsen/orgs","repos_url":"https://api.github.com/users/theojepsen/repos","events_url":"https://api.github.com/users/theojepsen/events{/privacy}","received_events_url":"https://api.github.com/users/theojepsen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/theojepsen/p4app","description":"A tool that makes it easy to build, run, debug, and test P4 programs","fork":true,"url":"https://api.github.com/repos/theojepsen/p4app","forks_url":"https://api.github.com/repos/theojepsen/p4app/forks","keys_url":"https://api.github.com/repos/theojepsen/p4app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/theojepsen/p4app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/theojepsen/p4app/teams","hooks_url":"https://api.github.com/repos/theojepsen/p4app/hooks","issue_events_url":"https://api.github.com/repos/theojepsen/p4app/issues/events{/number}","events_url":"https://api.github.com/repos/theojepsen/p4app/events","assignees_url":"https://api.github.com/repos/theojepsen/p4app/assignees{/user}","branches_url":"https://api.github.com/repos/theojepsen/p4app/branches{/branch}","tags_url":"https://api.github.com/repos/theojepsen/p4app/tags","blobs_url":"https://api.github.com/repos/theojepsen/p4app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/theojepsen/p4app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/theojepsen/p4app/git/refs{/sha}","trees_url":"https://api.github.com/repos/theojepsen/p4app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/theojepsen/p4app/statuses/{sha}","languages_url":"https://api.github.com/repos/theojepsen/p4app/languages","stargazers_url":"https://api.github.com/repos/theojepsen/p4app/stargazers","contributors_url":"https://api.github.com/repos/theojepsen/p4app/contributors","subscribers_url":"https://api.github.com/repos/theojepsen/p4app/subscribers","subscription_url":"https://api.github.com/repos/theojepsen/p4app/subscription","commits_url":"https://api.github.com/repos/theojepsen/p4app/commits{/sha}","git_commits_url":"https://api.github.com/repos/theojepsen/p4app/git/commits{/sha}","comments_url":"https://api.github.com/repos/theojepsen/p4app/comments{/number}","issue_comment_url":"https://api.github.com/repos/theojepsen/p4app/issues/comments{/number}","contents_url":"https://api.github.com/repos/theojepsen/p4app/contents/{+path}","compare_url":"https://api.github.com/repos/theojepsen/p4app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/theojepsen/p4app/merges","archive_url":"https://api.github.com/repos/theojepsen/p4app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/theojepsen/p4app/downloads","issues_url":"https://api.github.com/repos/theojepsen/p4app/issues{/number}","pulls_url":"https://api.github.com/repos/theojepsen/p4app/pulls{/number}","milestones_url":"https://api.github.com/repos/theojepsen/p4app/milestones{/number}","notifications_url":"https://api.github.com/repos/theojepsen/p4app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/theojepsen/p4app/labels{/name}","releases_url":"https://api.github.com/repos/theojepsen/p4app/releases{/id}","deployments_url":"https://api.github.com/repos/theojepsen/p4app/deployments","created_at":"2017-02-28T13:07:28Z","updated_at":"2017-02-28T13:07:30Z","pushed_at":"2017-03-03T07:32:29Z","git_url":"git://github.com/theojepsen/p4app.git","ssh_url":"git@github.com:theojepsen/p4app.git","clone_url":"https://github.com/theojepsen/p4app.git","svn_url":"https://github.com/theojepsen/p4app","homepage":null,"size":53,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sethfowler:master","ref":"master","sha":"895c870f59cc1169a7efee83d84c72c8d8970052","user":{"login":"sethfowler","id":492593,"avatar_url":"https://avatars3.githubusercontent.com/u/492593?v=3","gravatar_id":"","url":"https://api.github.com/users/sethfowler","html_url":"https://github.com/sethfowler","followers_url":"https://api.github.com/users/sethfowler/followers","following_url":"https://api.github.com/users/sethfowler/following{/other_user}","gists_url":"https://api.github.com/users/sethfowler/gists{/gist_id}","starred_url":"https://api.github.com/users/sethfowler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethfowler/subscriptions","organizations_url":"https://api.github.com/users/sethfowler/orgs","repos_url":"https://api.github.com/users/sethfowler/repos","events_url":"https://api.github.com/users/sethfowler/events{/privacy}","received_events_url":"https://api.github.com/users/sethfowler/received_events","type":"User","site_admin":false},"repo":{"id":82906209,"name":"p4app","full_name":"sethfowler/p4app","owner":{"login":"sethfowler","id":492593,"avatar_url":"https://avatars3.githubusercontent.com/u/492593?v=3","gravatar_id":"","url":"https://api.github.com/users/sethfowler","html_url":"https://github.com/sethfowler","followers_url":"https://api.github.com/users/sethfowler/followers","following_url":"https://api.github.com/users/sethfowler/following{/other_user}","gists_url":"https://api.github.com/users/sethfowler/gists{/gist_id}","starred_url":"https://api.github.com/users/sethfowler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethfowler/subscriptions","organizations_url":"https://api.github.com/users/sethfowler/orgs","repos_url":"https://api.github.com/users/sethfowler/repos","events_url":"https://api.github.com/users/sethfowler/events{/privacy}","received_events_url":"https://api.github.com/users/sethfowler/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sethfowler/p4app","description":"A tool that makes it easy to build, run, debug, and test P4 programs","fork":false,"url":"https://api.github.com/repos/sethfowler/p4app","forks_url":"https://api.github.com/repos/sethfowler/p4app/forks","keys_url":"https://api.github.com/repos/sethfowler/p4app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sethfowler/p4app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sethfowler/p4app/teams","hooks_url":"https://api.github.com/repos/sethfowler/p4app/hooks","issue_events_url":"https://api.github.com/repos/sethfowler/p4app/issues/events{/number}","events_url":"https://api.github.com/repos/sethfowler/p4app/events","assignees_url":"https://api.github.com/repos/sethfowler/p4app/assignees{/user}","branches_url":"https://api.github.com/repos/sethfowler/p4app/branches{/branch}","tags_url":"https://api.github.com/repos/sethfowler/p4app/tags","blobs_url":"https://api.github.com/repos/sethfowler/p4app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sethfowler/p4app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sethfowler/p4app/git/refs{/sha}","trees_url":"https://api.github.com/repos/sethfowler/p4app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sethfowler/p4app/statuses/{sha}","languages_url":"https://api.github.com/repos/sethfowler/p4app/languages","stargazers_url":"https://api.github.com/repos/sethfowler/p4app/stargazers","contributors_url":"https://api.github.com/repos/sethfowler/p4app/contributors","subscribers_url":"https://api.github.com/repos/sethfowler/p4app/subscribers","subscription_url":"https://api.github.com/repos/sethfowler/p4app/subscription","commits_url":"https://api.github.com/repos/sethfowler/p4app/commits{/sha}","git_commits_url":"https://api.github.com/repos/sethfowler/p4app/git/commits{/sha}","comments_url":"https://api.github.com/repos/sethfowler/p4app/comments{/number}","issue_comment_url":"https://api.github.com/repos/sethfowler/p4app/issues/comments{/number}","contents_url":"https://api.github.com/repos/sethfowler/p4app/contents/{+path}","compare_url":"https://api.github.com/repos/sethfowler/p4app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sethfowler/p4app/merges","archive_url":"https://api.github.com/repos/sethfowler/p4app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sethfowler/p4app/downloads","issues_url":"https://api.github.com/repos/sethfowler/p4app/issues{/number}","pulls_url":"https://api.github.com/repos/sethfowler/p4app/pulls{/number}","milestones_url":"https://api.github.com/repos/sethfowler/p4app/milestones{/number}","notifications_url":"https://api.github.com/repos/sethfowler/p4app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sethfowler/p4app/labels{/name}","releases_url":"https://api.github.com/repos/sethfowler/p4app/releases{/id}","deployments_url":"https://api.github.com/repos/sethfowler/p4app/deployments","created_at":"2017-02-23T08:52:09Z","updated_at":"2017-02-23T08:53:02Z","pushed_at":"2017-03-03T07:32:30Z","git_url":"git://github.com/sethfowler/p4app.git","ssh_url":"git@github.com:sethfowler/p4app.git","clone_url":"https://github.com/sethfowler/p4app.git","svn_url":"https://github.com/sethfowler/p4app","homepage":null,"size":42,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sethfowler/p4app/pulls/2"},"html":{"href":"https://github.com/sethfowler/p4app/pull/2"},"issue":{"href":"https://api.github.com/repos/sethfowler/p4app/issues/2"},"comments":{"href":"https://api.github.com/repos/sethfowler/p4app/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/sethfowler/p4app/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/sethfowler/p4app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sethfowler/p4app/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/sethfowler/p4app/statuses/cd5d18aab33c8a238bde3a6c521f221c64564120"}}}}
{"actor":{"display_login":"theojepsen"}}