From db2700c20ad78b37cf946f780370b822b2c7184b Mon Sep 17 00:00:00 2001 From: Nick Giannarakis Date: Fri, 10 Feb 2023 18:39:54 +0000 Subject: [PATCH 1/2] Update Routing Policies notebook to line up with changes to counterexample generation in SRP. --- .../Analyzing Routing Policies.ipynb | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/jupyter_notebooks/Analyzing Routing Policies.ipynb b/jupyter_notebooks/Analyzing Routing Policies.ipynb index df7040de..72da5b1b 100644 --- a/jupyter_notebooks/Analyzing Routing Policies.ipynb +++ b/jupyter_notebooks/Analyzing Routing Policies.ipynb @@ -188,10 +188,10 @@ " 0\n", " border2\n", " from_customer\n", - " Network: 192.168.0.0/32
AS Path: []
Communities: []
Local Preference: 0
Metric: 0
Next Hop IP: 0.0.0.1
Originator IP: 0.0.0.0
Origin Type: igp
Protocol: bgp
Source Protocol: None
Tag: 0
Weight: 0\n", + " Network: 192.168.0.0/32
AS Path: []
Communities: []
Local Preference: 100
Metric: 0
Next Hop IP: 0.0.0.1
Originator IP: 0.0.0.0
Origin Type: igp
Protocol: bgp
Source Protocol: None
Tag: 0
Weight: 0\n", " PERMIT\n", " Network: 192.168.0.0/32
AS Path: []
Communities: [20:30]
Local Preference: 300
Metric: 0
Next Hop IP: 0.0.0.1
Originator IP: 0.0.0.0
Origin Type: igp
Protocol: bgp
Source Protocol: None
Tag: 0
Weight: 0\n", - " Communities: [] --> [20:30]
Local Preference: 0 --> 300\n", + " Communities: [] --> [20:30]
Local Preference: 100 --> 300\n", " \n", " \n", " " @@ -200,8 +200,8 @@ " Node Policy_Name \\\n", "0 border2 from_customer \n", "\n", - " Input_Route \\\n", - "0 BgpRoute(network='192.168.0.0/32', originatorIp='0.0.0.0', originType='igp', protocol='bgp', asPath=[], communities=[], localPreference=0, metric=0, nextHopIp='0.0.0.1', sourceProtocol=None, tag=0, weight=0) \n", + " Input_Route \\\n", + "0 BgpRoute(network='192.168.0.0/32', originatorIp='0.0.0.0', originType='igp', protocol='bgp', asPath=[], communities=[], localPreference=100, metric=0, nextHopIp='0.0.0.1', sourceProtocol=None, tag=0, weight=0) \n", "\n", " Action \\\n", "0 PERMIT \n", @@ -209,8 +209,8 @@ " Output_Route \\\n", "0 BgpRoute(network='192.168.0.0/32', originatorIp='0.0.0.0', originType='igp', protocol='bgp', asPath=[], communities=['20:30'], localPreference=300, metric=0, nextHopIp='0.0.0.1', sourceProtocol=None, tag=0, weight=0) \n", "\n", - " Difference \\\n", - "0 BgpRouteDiffs(diffs=[BgpRouteDiff(fieldName='communities', oldValue='[]', newValue='[20:30]'), BgpRouteDiff(fieldName='localPreference', oldValue='0', newValue='300')]) \n", + " Difference \\\n", + "0 BgpRouteDiffs(diffs=[BgpRouteDiff(fieldName='communities', oldValue='[]', newValue='[20:30]'), BgpRouteDiff(fieldName='localPreference', oldValue='100', newValue='300')]) \n", "\n", " Trace \n", "0 - Matched route-map from_customer clause 400 " @@ -704,7 +704,7 @@ " 0\n", " border2\n", " to_provider\n", - " Network: 0.0.0.0/0
AS Path: []
Communities: [20:30]
Local Preference: 0
Metric: 0
Next Hop IP: 0.0.0.1
Originator IP: 0.0.0.0
Origin Type: igp
Protocol: bgp
Source Protocol: None
Tag: 0
Weight: 0\n", + " Network: 10.0.0.0/8
AS Path: []
Communities: [20:30]
Local Preference: 100
Metric: 0
Next Hop IP: 0.0.0.1
Originator IP: 0.0.0.0
Origin Type: igp
Protocol: bgp
Source Protocol: None
Tag: 0
Weight: 0\n", " DENY\n", " None\n", " None\n", @@ -716,8 +716,8 @@ " Node Policy_Name \\\n", "0 border2 to_provider \n", "\n", - " Input_Route \\\n", - "0 BgpRoute(network='0.0.0.0/0', originatorIp='0.0.0.0', originType='igp', protocol='bgp', asPath=[], communities=['20:30'], localPreference=0, metric=0, nextHopIp='0.0.0.1', sourceProtocol=None, tag=0, weight=0) \n", + " Input_Route \\\n", + "0 BgpRoute(network='10.0.0.0/8', originatorIp='0.0.0.0', originType='igp', protocol='bgp', asPath=[], communities=['20:30'], localPreference=100, metric=0, nextHopIp='0.0.0.1', sourceProtocol=None, tag=0, weight=0) \n", "\n", " Action Output_Route Difference Trace \n", "0 DENY None None " @@ -783,9 +783,9 @@ " 0\n", " border2\n", " to_provider\n", - " Network: 0.0.0.0/0
AS Path: []
Communities: [2:30]
Local Preference: 0
Metric: 0
Next Hop IP: 0.0.0.1
Originator IP: 0.0.0.0
Origin Type: igp
Protocol: bgp
Source Protocol: None
Tag: 0
Weight: 0\n", + " Network: 10.0.0.0/8
AS Path: []
Communities: [2:30]
Local Preference: 100
Metric: 0
Next Hop IP: 0.0.0.1
Originator IP: 0.0.0.0
Origin Type: igp
Protocol: bgp
Source Protocol: None
Tag: 0
Weight: 0\n", " PERMIT\n", - " Network: 0.0.0.0/0
AS Path: []
Communities: [2:30]
Local Preference: 0
Metric: 0
Next Hop IP: 0.0.0.1
Originator IP: 0.0.0.0
Origin Type: igp
Protocol: bgp
Source Protocol: None
Tag: 0
Weight: 0\n", + " Network: 10.0.0.0/8
AS Path: []
Communities: [2:30]
Local Preference: 100
Metric: 0
Next Hop IP: 0.0.0.1
Originator IP: 0.0.0.0
Origin Type: igp
Protocol: bgp
Source Protocol: None
Tag: 0
Weight: 0\n", " \n", " \n", " \n", @@ -795,14 +795,14 @@ " Node Policy_Name \\\n", "0 border2 to_provider \n", "\n", - " Input_Route \\\n", - "0 BgpRoute(network='0.0.0.0/0', originatorIp='0.0.0.0', originType='igp', protocol='bgp', asPath=[], communities=['2:30'], localPreference=0, metric=0, nextHopIp='0.0.0.1', sourceProtocol=None, tag=0, weight=0) \n", + " Input_Route \\\n", + "0 BgpRoute(network='10.0.0.0/8', originatorIp='0.0.0.0', originType='igp', protocol='bgp', asPath=[], communities=['2:30'], localPreference=100, metric=0, nextHopIp='0.0.0.1', sourceProtocol=None, tag=0, weight=0) \n", "\n", " Action \\\n", "0 PERMIT \n", "\n", - " Output_Route \\\n", - "0 BgpRoute(network='0.0.0.0/0', originatorIp='0.0.0.0', originType='igp', protocol='bgp', asPath=[], communities=['2:30'], localPreference=0, metric=0, nextHopIp='0.0.0.1', sourceProtocol=None, tag=0, weight=0) \n", + " Output_Route \\\n", + "0 BgpRoute(network='10.0.0.0/8', originatorIp='0.0.0.0', originType='igp', protocol='bgp', asPath=[], communities=['2:30'], localPreference=100, metric=0, nextHopIp='0.0.0.1', sourceProtocol=None, tag=0, weight=0) \n", "\n", " Difference Trace \n", "0 BgpRouteDiffs(diffs=[]) - Matched route-map to_provider clause 200 " @@ -881,9 +881,9 @@ "metadata": { "hide_input": false, "kernelspec": { - "display_name": "Python 3", + "display_name": "pybf", "language": "python", - "name": "python3" + "name": "pybf" }, "language_info": { "codemirror_mode": { @@ -895,7 +895,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.7" + "version": "3.10.9" } }, "nbformat": 4, From 57fb089b4d7ef25398bf754661dedcc59a90d03a Mon Sep 17 00:00:00 2001 From: Nick Giannarakis Date: Fri, 10 Feb 2023 23:50:32 +0000 Subject: [PATCH 2/2] fix doc tests --- docs/source/notebooks/routingProtocols.ipynb | 26 ++++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/source/notebooks/routingProtocols.ipynb b/docs/source/notebooks/routingProtocols.ipynb index 5a5430fc..0c8b8d7c 100644 --- a/docs/source/notebooks/routingProtocols.ipynb +++ b/docs/source/notebooks/routingProtocols.ipynb @@ -1947,9 +1947,9 @@ " 0\n", " as1border2\n", " as1_to_as4\n", - " BgpRoute(network='10.0.0.0/32', originatorIp='0.0.0.0', originType='igp', protocol='bgp', asPath=[], communities=[], localPreference=0, metric=0, nextHopIp='0.0.0.1', sourceProtocol=None, tag=0, weight=0)\n", + " BgpRoute(network='10.0.0.0/8', originatorIp='0.0.0.0', originType='igp', protocol='bgp', asPath=[], communities=[], localPreference=100, metric=0, nextHopIp='0.0.0.1', sourceProtocol=None, tag=0, weight=0)\n", " PERMIT\n", - " BgpRoute(network='10.0.0.0/32', originatorIp='0.0.0.0', originType='igp', protocol='bgp', asPath=[], communities=['1:4'], localPreference=0, metric=50, nextHopIp='0.0.0.1', sourceProtocol=None, tag=0, weight=0)\n", + " BgpRoute(network='10.0.0.0/8', originatorIp='0.0.0.0', originType='igp', protocol='bgp', asPath=[], communities=['1:4'], localPreference=100, metric=50, nextHopIp='0.0.0.1', sourceProtocol=None, tag=0, weight=0)\n", " BgpRouteDiffs(diffs=[BgpRouteDiff(fieldName='communities', oldValue='[]', newValue='[1:4]'), BgpRouteDiff(fieldName='metric', oldValue='0', newValue='50')])\n", " - Matched route-map as1_to_as4 clause 2\n", " \n", @@ -1958,11 +1958,11 @@ "" ], "text/plain": [ - " Node Policy_Name Input_Route Action \\\n", - "0 as1border2 as1_to_as4 BgpRoute(network='10.0.0.0/32', originatorIp='0.0.0.0', originType='igp', protocol='bgp', asPath=[], communities=[], localPreference=0, metric=0, nextHopIp='0.0.0.1', sourceProtocol=None, tag=0, weight=0) PERMIT \n", + " Node Policy_Name Input_Route Action \\\n", + "0 as1border2 as1_to_as4 BgpRoute(network='10.0.0.0/8', originatorIp='0.0.0.0', originType='igp', protocol='bgp', asPath=[], communities=[], localPreference=100, metric=0, nextHopIp='0.0.0.1', sourceProtocol=None, tag=0, weight=0) PERMIT \n", "\n", - " Output_Route \\\n", - "0 BgpRoute(network='10.0.0.0/32', originatorIp='0.0.0.0', originType='igp', protocol='bgp', asPath=[], communities=['1:4'], localPreference=0, metric=50, nextHopIp='0.0.0.1', sourceProtocol=None, tag=0, weight=0) \n", + " Output_Route \\\n", + "0 BgpRoute(network='10.0.0.0/8', originatorIp='0.0.0.0', originType='igp', protocol='bgp', asPath=[], communities=['1:4'], localPreference=100, metric=50, nextHopIp='0.0.0.1', sourceProtocol=None, tag=0, weight=0) \n", "\n", " Difference Trace \n", "0 BgpRouteDiffs(diffs=[BgpRouteDiff(fieldName='communities', oldValue='[]', newValue='[1:4]'), BgpRouteDiff(fieldName='metric', oldValue='0', newValue='50')]) - Matched route-map as1_to_as4 clause 2 " @@ -1992,13 +1992,13 @@ { "data": { "text/plain": [ - "Node as1border2\n", - "Policy_Name as1_to_as4\n", - "Input_Route BgpRoute(network='10.0.0.0/32', originatorIp='0.0.0.0', originType='igp', protocol='bgp', asPath=[], communities=[], localPreference=0, metric=0, nextHopIp='0.0.0.1', sourceProtocol=None, tag=0, weight=0)\n", - "Action PERMIT\n", - "Output_Route BgpRoute(network='10.0.0.0/32', originatorIp='0.0.0.0', originType='igp', protocol='bgp', asPath=[], communities=['1:4'], localPreference=0, metric=50, nextHopIp='0.0.0.1', sourceProtocol=None, tag=0, weight=0)\n", - "Difference BgpRouteDiffs(diffs=[BgpRouteDiff(fieldName='communities', oldValue='[]', newValue='[1:4]'), BgpRouteDiff(fieldName='metric', oldValue='0', newValue='50')])\n", - "Trace - Matched route-map as1_to_as4 clause 2\n", + "Node as1border2\n", + "Policy_Name as1_to_as4\n", + "Input_Route BgpRoute(network='10.0.0.0/8', originatorIp='0.0.0.0', originType='igp', protocol='bgp', asPath=[], communities=[], localPreference=100, metric=0, nextHopIp='0.0.0.1', sourceProtocol=None, tag=0, weight=0)\n", + "Action PERMIT\n", + "Output_Route BgpRoute(network='10.0.0.0/8', originatorIp='0.0.0.0', originType='igp', protocol='bgp', asPath=[], communities=['1:4'], localPreference=100, metric=50, nextHopIp='0.0.0.1', sourceProtocol=None, tag=0, weight=0)\n", + "Difference BgpRouteDiffs(diffs=[BgpRouteDiff(fieldName='communities', oldValue='[]', newValue='[1:4]'), BgpRouteDiff(fieldName='metric', oldValue='0', newValue='50')])\n", + "Trace - Matched route-map as1_to_as4 clause 2\n", "Name: 0, dtype: object" ] },