<jupyter_start><jupyter_text>Routing and Forwarding Tables This category of questions allows you to query the RIBs and FIBs computedby Batfish. * [Routes](Routes)* [BGP RIB](BGP-RIB)* [EVPN RIB](EVPN-RIB)* [Longest Prefix Match](Longest-Prefix-Match)<jupyter_code>bf.set_network('generate_questions')
bf.set_snapshot('generate_questions')<jupyter_output><empty_output><jupyter_text>Routes Returns routing tables. Shows routes for specified RIB, VRF, and node(s).  **Inputs** Name | Description | Type | Optional | Default Value--- | --- | --- | --- | --- nodes | Return routes on nodes matching this specifier. | [NodeSpec](../specifiers.mdnode-specifier) | True | network | Return routes for networks matching this prefix. | str | True | prefixMatchType | Use this prefix matching criterion: EXACT, LONGEST_PREFIX_MATCH, LONGER_PREFIXES, SHORTER_PREFIXES. | str | True | protocols | Return routes for protocols matching this specifier. | [RoutingProtocolSpec](../specifiers.mdrouting-protocol-specifier) | True | vrfs | Return routes on VRFs matching this name or regex. | str | True | rib | Only return routes from a given protocol RIB. | str | True |   **Invocation**<jupyter_code>result = bf.q.routes().answer().frame()<jupyter_output><empty_output><jupyter_text>**Return Value** Name | Description | Type--- | --- | ---Node | Node | strVRF | VRF name | strNetwork | Network for this route | strNext_Hop | Route's Next Hop | [NextHop](../datamodel.rstpybatfish.datamodel.route.NextHop)Next_Hop_IP | Route's Next Hop IP | strNext_Hop_Interface | Route's Next Hop Interface | strProtocol | Route's Protocol | strMetric | Route's Metric | intAdmin_Distance | Route's Admin distance | intTag | Tag for this route | int Print the first 5 rows of the returned Dataframe<jupyter_code>result.head(5)<jupyter_output><empty_output><jupyter_text>Print the first row of the returned Dataframe<jupyter_code>result.iloc[0]
bf.set_network('generate_questions')
bf.set_snapshot('generate_questions')<jupyter_output><empty_output><jupyter_text>BGP RIB Returns routes in the BGP RIB. Shows BGP routes for specified VRF and node(s). This question is not available in Batfish containers on dockerhub prior to March 29, 2021.  **Inputs** Name | Description | Type | Optional | Default Value--- | --- | --- | --- | --- nodes | Examine routes on nodes matching this specifier. | [NodeSpec](../specifiers.mdnode-specifier) | True | network | Examine routes for networks matching this prefix. | str | True | prefixMatchType | Use this prefix matching criterion: EXACT, LONGEST_PREFIX_MATCH, LONGER_PREFIXES, SHORTER_PREFIXES. | str | True | vrfs | Examine routes on VRFs matching this name or regex. | str | True | status | Examine routes whose status matches this specifier. | [BgpRouteStatusSpec](../specifiers.mdbgp-route-status-specifier) | True |   **Invocation**<jupyter_code>result = bf.q.bgpRib().answer().frame()<jupyter_output><empty_output><jupyter_text>**Return Value** Name | Description | Type--- | --- | ---Node | Node | strVRF | VRF name | strNetwork | Network for this route | strStatus | Route's statuses | List of strNext_Hop | Route's Next Hop | [NextHop](../datamodel.rstpybatfish.datamodel.route.NextHop)Next_Hop_IP | Route's Next Hop IP | strNext_Hop_Interface | Route's Next Hop Interface | strProtocol | Route's Protocol | strAS_Path | Route's AS path | strMetric | Route's Metric | intLocal_Pref | Route's Local Preference | intCommunities | Route's List of communities | List of strOrigin_Protocol | Route's Origin protocol | strOrigin_Type | Route's Origin type | strOriginator_Id | Route's Originator ID | strReceived_From_IP | IP of the neighbor who sent this route | strCluster_List | Route's Cluster List | List of intWeight | Route's BGP Weight | intTag | Tag for this route | int Print the first 5 rows of the returned Dataframe<jupyter_code>result.head(5)<jupyter_output><empty_output><jupyter_text>Print the first row of the returned Dataframe<jupyter_code>result.iloc[0]
bf.set_network('generate_questions')
bf.set_snapshot('aristaevpn')<jupyter_output><empty_output><jupyter_text>EVPN RIB Returns routes in the EVPN RIB. Shows EVPN routes for specified VRF and node(s). This question is not available in Batfish containers on dockerhub prior to March 29, 2021.  **Inputs** Name | Description | Type | Optional | Default Value--- | --- | --- | --- | --- nodes | Examine routes on nodes matching this specifier. | [NodeSpec](../specifiers.mdnode-specifier) | True | network | Examine routes for networks matching this prefix. | str | True | prefixMatchType | Use this prefix matching criterion: EXACT, LONGEST_PREFIX_MATCH, LONGER_PREFIXES, SHORTER_PREFIXES. | str | True | vrfs | Examine routes on VRFs matching this name or regex. | str | True |   **Invocation**<jupyter_code>result = bf.q.evpnRib().answer().frame()<jupyter_output><empty_output><jupyter_text>**Return Value** Name | Description | Type--- | --- | ---Node | Node | strVRF | VRF name | strNetwork | Network for this route | strStatus | Route's statuses | List of strRoute_Distinguisher | Route distinguisher | strNext_Hop | Route's Next Hop | [NextHop](../datamodel.rstpybatfish.datamodel.route.NextHop)Next_Hop_IP | Route's Next Hop IP | strNext_Hop_Interface | Route's Next Hop Interface | strProtocol | Route's Protocol | strAS_Path | Route's AS path | strMetric | Route's Metric | intLocal_Pref | Route's Local Preference | intCommunities | Route's List of communities | List of strOrigin_Protocol | Route's Origin protocol | strOrigin_Type | Route's Origin type | strOriginator_Id | Route's Originator ID | strCluster_List | Route's Cluster List | List of intWeight | Route's BGP Weight | intTag | Tag for this route | int Print the first 5 rows of the returned Dataframe<jupyter_code>result.head(5)<jupyter_output><empty_output><jupyter_text>Print the first row of the returned Dataframe<jupyter_code>result.iloc[0]
bf.set_network('generate_questions')
bf.set_snapshot('generate_questions')<jupyter_output><empty_output><jupyter_text>Longest Prefix Match Returns routes that are longest prefix match for a given IP address. Return longest prefix match routes for a given IP in the RIBs of specified nodes and VRFs.  **Inputs** Name | Description | Type | Optional | Default Value--- | --- | --- | --- | --- ip | IP address to run LPM on. | str | False | nodes | Examine routes on nodes matching this specifier. | [NodeSpec](../specifiers.mdnode-specifier) | True | .*vrfs | Examine routes on VRFs matching this name or regex. | str | True | .*  **Invocation**<jupyter_code>result = bf.q.lpmRoutes(ip='172.16.58.3').answer().frame()<jupyter_output><empty_output><jupyter_text>**Return Value** Name | Description | Type--- | --- | ---Node | Node where the route is present | strVRF | VRF where the route is present | strIp | IP that was being matched on | strNetwork | The longest-prefix network that matched | strNum_Routes | Number of routes that matched (in case of ECMP) | int Print the first 5 rows of the returned Dataframe<jupyter_code>result.head(5)<jupyter_output><empty_output><jupyter_text>Print the first row of the returned Dataframe<jupyter_code>result.iloc[0]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11070931849791377, 'fraction_numerical': 0.004450625869262865, 'mean_word_length': 5.12, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '13', 'dir': 'jupyter-structured-clean-dedup', 'id': '197447', 'license': 'Apache-2.0', 'n_tokens_mistral': 2223, 'n_tokens_neox': 2118, 'n_words': 691, 'path': 'docs/source/notebooks/routingTables.ipynb', 'repo_name': 'batfish/pybatfish', 'size': '7190'}