Available questions

If you setup your Batfish service correctly, the questions outlined below should be available to you.

A note on types

1. You will see types such as javaRegex and nodeSpec. These are aliases for string. Beware that Java regexes differ a bit from standard Python regexes. See here pattern page for details.

2. headerConstraint is a special type that allows you to place constraints on IPv4 packet header for questions that require it (e.g., traceroute) The HeaderConstraints class will help you quickly create such constraints.

List of questions

class pybatfish.question.bfq.aaaAuthenticationLogin(*, nodes, question_name, exclusions)

Return nodes that do not require authentication on all lines.

Parameters:nodes (nodeSpec) –

Required. Examine AAA Authentication on nodes matching this name or regex.

Default value: .*

class pybatfish.question.bfq.bgpPeerConfiguration(*, nodes, properties, question_name, exclusions)

Return BGP peer configuration properties.

Parameters:
  • nodes (nodeSpec) – Include nodes matching this name or regex.
  • properties (bgpPeerPropertySpec) – Include properties matching this regex.
class pybatfish.question.bfq.bgpProcessConfiguration(*, nodes, properties, question_name, exclusions)

Return BGP process configuration properties.

Parameters:
  • nodes (nodeSpec) – Include nodes matching this name or regex.
  • properties (bgpProcessPropertySpec) – Include properties matching this regex.
class pybatfish.question.bfq.bgpSessionCompatibility(*, nodes, remoteNodes, status, type, question_name, exclusions)

Return the status of configured BGP sessions, independent of remote peer configurations.

Parameters:
  • nodes (nodeSpec) – Include sessions whose first node matches this name or regex.
  • remoteNodes (nodeSpec) – Include sessions whose second node matches this name or regex.
  • status (javaRegex) – Only include sessions for which status matches this regex.
  • type (javaRegex) – Only include sessions for which type (ibgp, ebgp_singlehop, ebgp_multihop) matches this regex.
class pybatfish.question.bfq.bgpSessionStatus(*, nodes, remoteNodes, status, type, question_name, exclusions)

Return the status of configured BGP sessions.

Parameters:
  • nodes (nodeSpec) – Include sessions whose first node matches this name or regex.
  • remoteNodes (nodeSpec) – Include sessions whose second node matches this name or regex.
  • status (javaRegex) – Only include sessions for which status matches this regex.
  • type (javaRegex) – Only include sessions for which type (ibgp, ebgp_singlehop, ebgp_multihop) matches this regex.
class pybatfish.question.bfq.definedStructures(*, names, nodes, types, question_name, exclusions)

Lists the structures defined in the network.

Lists the structures defined in the network, along with the files and line numbers in which they are defined.

Parameters:
  • names (javaRegex) –

    Include structures whose name matches this string or regex.

    Default value: .*

  • nodes (nodeSpec) –

    Include files used to generate nodes whose name matches this name or regex.

    Default value: .*

  • types (javaRegex) –

    Include structures whose vendor-specific type matches this string or regex.

    Default value: .*

class pybatfish.question.bfq.detectLoops(*, maxTraces, question_name, exclusions)

Detect forwarding loops.

Finds forwarding loops.

Parameters:maxTraces (integer) – Limit the number of traces returned.
class pybatfish.question.bfq.differentialReachability(*, actions, headers, ignoreFilters, invertSearch, maxTraces, pathConstraints, question_name, exclusions)

Detect differential reachability.

Finds flows that are accepted in one snapshot but dropped in another.

Parameters:
  • actions (dispositionSpec) –

    Only return flows for which the disposition is from this set.

    Default value: success

  • headers (headerConstraint) – Packet header constraints.
  • ignoreFilters (boolean) – Do not apply filters/ACLs during analysis.
  • invertSearch (boolean) – Search for packet headers outside the specified headerspace, rather than inside the space.
  • maxTraces (integer) – Limit the number of traces returned.
  • pathConstraints (pathConstraint) – Constraint the path a flow can take (start/end/transit locations).
class pybatfish.question.bfq.edges(*, edgeType, nodes, remoteNodes, question_name, exclusions)

Lists different types of edges in a snapshot.

Lists neighbor relationships of the specified type (layer3, BGP, ospf, etc. in the form of edges).

Parameters:
  • nodes (nodeSpec) –

    Required. Include edges whose first node matches this name or regex.

    Default value: .*

  • remoteNodes (nodeSpec) –

    Required. Include edges whose second node matches this name or regex.

    Default value: .*

  • edgeType (string) –

    Types of edges to include. Allowed values:

    • bgp
    • eigrp
    • isis
    • layer1
    • layer2
    • layer3
    • ospf
    • rip
class pybatfish.question.bfq.fileParseStatus(*, question_name, exclusions)

Display file parse status.

For each file in a snapshot, returns the host(s) that were produced by the file and the parse status: pass, fail, partially parsed.

class pybatfish.question.bfq.filterLineReachability(*, filters, nodes, question_name, exclusions)

Identify ACLs/filters with unreachable lines.

This question finds all unreachable lines in the specified ACLs/filters.

Parameters:
  • filters (string) – Name or regex identifying the filters to test.
  • nodes (nodeSpec) – Examine filters on nodes matching this name or regex.
class pybatfish.question.bfq.filterTable(*, columns, filter, innerQuestion, question_name, exclusions)

Return subset of answer for a question.

Return a subset of the answer generated by the inner question. The results are trimmed first by row and then by column. Rows where any value matches the filter are returned. The columns returned for each row is restricted by the column specifier.

Parameters:
  • innerQuestion (question) – Required. The inner question whose answer should be filtered.
  • columns (string) – The set of columns to fetch.
  • filter (string) – The filter to use.
class pybatfish.question.bfq.interfaceMtu(*, comparator, interfaces, mtuBytes, nodes, question_name, exclusions)

Find interfaces where the configured MTU matches the specified comparator and mtuBytes.

For example, if comparator is ‘<’ and mtuBytes is 1500, then only interfaces where the configured MTU is less than 1500 bytes will be returned.

Parameters:
  • interfaces (javaRegex) –

    Required. Evaluate interfaces matching this regex.

    Default value: .*

  • mtuBytes (integer) –

    Required. The reference MTU in bytes against which to check the configured MTU.

    Default value: 1500

  • nodes (nodeSpec) –

    Required. Include nodes matching this name or regex.

    Default value: .*

  • comparator (comparator) –

    Returned devices will satisfy <comparator> <mtuBytes>. Use ‘<’ to find devices that do not have MTU smaller than the specified <mtuBytes> MTU.

    Default value: <

class pybatfish.question.bfq.interfaceProperties(*, excludeShutInterfaces, interfaces, nodes, properties, question_name, exclusions)

Returns configuration properties of interfaces.

Parameters:
  • excludeShutInterfaces (boolean) – Exclude interfaces that are shutdown.
  • interfaces (javaRegex) – Include interfaces matching this regex.
  • nodes (nodeSpec) – Include nodes matching this name or regex.
  • properties (interfacePropertySpec) – Include properties matching this regex.
class pybatfish.question.bfq.ipOwners(*, duplicatesOnly, question_name, exclusions)

Returns the mapping of IP address, interface, node and VRF for all devices in the snapshot.

Parameters:duplicatesOnly (boolean) – Required. Restrict output to only IP addresses that are duplicated (configured on a different node or VRF) in the snapshot.
class pybatfish.question.bfq.ipsecSessionStatus(*, nodes, remoteNodes, status, question_name, exclusions)

Returns the status of configured IPSec sessions.

Parameters:
  • nodes (nodeSpec) – Include sessions whose first node matches this name or regex.
  • remoteNodes (nodeSpec) – Include sessions whose second node matches this name or regex.
  • status (javaRegex) – Only include IPSec sessions for which status matches this regex.
class pybatfish.question.bfq.multipathConsistency(*, headers, maxTraces, pathConstraints, question_name, exclusions)

Validate multipath consistency.

Finds flows that are treated differently by different paths in the presence of multipath routing.

Parameters:
  • headers (headerConstraint) – Packet header constraints.
  • maxTraces (integer) – Limit the number of traces returned.
  • pathConstraints (pathConstraint) – Constraint the path a flow can take (start/end/transit locations).
class pybatfish.question.bfq.namedStructures(*, nodes, properties, question_name, exclusions)

Return named structure definitions.

Parameters:
  • nodes (nodeSpec) – Include nodes matching this name or regex.
  • properties (namedStructureSpec) – Include properties matching this regex.
class pybatfish.question.bfq.neighbors(*, neighborTypes, nodes, remoteNodes, roleDimension, style, question_name, exclusions)

Lists neighbor relationships in the snapshot.

Lists neighbor relationships of the specified type (layer3, eBGP, iBGP, ospf, etc.).

Parameters:
  • nodes (nodeSpec) –

    Required. Include neighbors whose first node matches this name or regex.

    Default value: .*

  • remoteNodes (nodeSpec) –

    Required. Include neighbors whose second node matches this name or regex.

    Default value: .*

  • style (string) –

    Required. String indicating the style of information requested about each neighbor. Allowed values:

    • role
    • summary
    • verbose

    Default value: summary

  • neighborTypes (string) –

    Types of neighbor relationships to include. Allowed values:

    • ebgp
    • eigrp
    • ibgp
    • layer1
    • layer2
    • layer3
    • ospf
    • rip
  • roleDimension (string) – Role dimension to run the question on.
class pybatfish.question.bfq.nodeProperties(*, nodes, properties, question_name, exclusions)

Return configuration properties of nodes.

Parameters:
  • nodes (nodeSpec) – Include nodes matching this name or regex.
  • properties (nodePropertySpec) – Include properties matching this regex.
class pybatfish.question.bfq.nodes(*, nodeTypes, nodes, summary, question_name, exclusions)

Lists configuration attributes of nodes in the network.

Returns a JSON dictionary with all (or summary) of the configuration parameters that are stored in the vendor independent data-model.

Parameters:
  • nodes (nodeSpec) –

    Required. Include nodes matching this name or regex.

    Default value: .*

  • summary (boolean) –

    Required. Whether to provide only summary information about each node rather than the full data model.

    Default value: True

  • nodeTypes (string) – Include nodes of the specified types.
class pybatfish.question.bfq.ospfProperties(*, nodes, properties, question_name, exclusions)

Return configuration parameters for OSPF routing processes.

Parameters:
  • nodes (nodeSpec) – Include nodes matching this name or regex.
  • properties (ospfPropertySpec) – Include properties matching this regex.
class pybatfish.question.bfq.parseWarning(*, question_name, exclusions)

Return a table of the Batfish warnings that occurred parsing this snapshot.

class pybatfish.question.bfq.prefixTracer(*, nodes, prefix, question_name, exclusions)

Trace prefix propagation through the network.

Parameters:
  • nodes (nodeSpec) – Include prefix tracing information for nodes matching this name or regex.
  • prefix (prefix) – The prefix to trace. Expected format is A.B.C.D/Y.
class pybatfish.question.bfq.reachability(*, actions, headers, ignoreFilters, maxTraces, pathConstraints, question_name, exclusions)

Find flows that match the ingress and egress location, src and dest ip address and disposition constraints, as described by the input specifiers.

Parameters:
  • actions (dispositionSpec) –

    Only return flows for which the disposition is from this set.

    Default value: success

  • headers (headerConstraint) – Packet header constraints.
  • ignoreFilters (boolean) – Do not apply filters/ACLs during analysis.
  • maxTraces (integer) – Limit the number of traces returned.
  • pathConstraints (pathConstraint) – Constraint the path a flow can take (start/end/transit locations).
class pybatfish.question.bfq.referencedStructures(*, names, nodes, types, question_name, exclusions)

Lists the references in configuration files to vendor-specific structures.

Lists the references in configuration files to vendor-specific structures, along with the line number, the name and the type of the structure referenced, and configuration context in which each reference occurs.

Parameters:
  • names (javaRegex) –

    Include structures whose name matches this string or regex.

    Default value: .*

  • nodes (nodeSpec) –

    Include files used to generate nodes whose name matches this name or regex.

    Default value: .*

  • types (javaRegex) –

    Include structures whose vendor-specific type matches this string or regex.

    Default value: .*

class pybatfish.question.bfq.resolveFilterSpecifier(*, filters, nodes, question_name, exclusions)

Show the resolved values for filter specifier.

Parameters:
  • filters (string) – Input to the FilterSpecifier.
  • nodes (string) – Input to the NodeSpecifier.
class pybatfish.question.bfq.resolveInterfaceSpecifier(*, interfaces, nodes, question_name, exclusions)

Show the resolved values for interface specifier.

Parameters:
  • interfaces (string) – Input to the interfaceSpecifier.
  • nodes (string) – Input to the NodeSpecifier.
class pybatfish.question.bfq.resolveIpSpecifier(*, ips, question_name, exclusions)

Show the resolved values for IP specifier.

Parameters:ips (string) –

Input to the IpSpaceSpecifier.

Default value: 0.0.0.0/0

class pybatfish.question.bfq.resolveIpsOfLocationSpecifier(*, locations, question_name, exclusions)

Show IPs that are auto-assigned to locations.

Parameters:locations (string) – Input to the LocationSpecifier.
class pybatfish.question.bfq.resolveLocationSpecifier(*, locations, question_name, exclusions)

Show the resolved values for location specifier.

Parameters:locations (string) – Input to the LocationSpecifier.
class pybatfish.question.bfq.resolveNodeSpecifier(*, nodes, question_name, exclusions)

Show the resolved values for node specifier.

Parameters:nodes (string) – Input to the NodeSpecifier.
class pybatfish.question.bfq.routes(*, network, nodes, protocols, rib, vrfs, question_name, exclusions)

Show routing tables.

Return routes for the specified RIB for specified VRF for specified node(s).

Parameters:
  • nodes (nodeSpec) –

    Required. Examine routes on nodes matching this name or regex.

    Default value: .*

  • protocols (javaRegex) –

    Required. Examine routes for protocols matching this name or regex.

    Default value: .*

  • vrfs (javaRegex) –

    Required. Examine routes on VRFs matching this name or regex.

    Default value: .*

  • network (prefix) – Examine routes for networks matching this prefix.
  • rib (string) –

    Only return routes from a given protocol RIB. Allowed values:

    • main
    • bgp
    • bgpmp
class pybatfish.question.bfq.searchFilters(*, action, explain, filters, headers, invertSearch, nodes, startLocation, question_name, exclusions)

Find flows for which a filter takes a particular behavior.

This question searches for flows for which a filter (access control list) has a particular behavior. The behaviors can be: that the filter permits the flow (permit), that it denies the flow (deny), or that the flow is matched by a particular line (matchLine <lineNumber>). Filters are selected using node and filter specifiers, which might match multiple filters. In this case, a (possibly different) flow will be found for each filter.

Parameters:
  • action (string) – The behavior that you want evaluated. Options are: permit|deny|matchLine <line number>. Only one option should be selected.
  • explain (boolean) – Include a description of the flow space matching the query.
  • filters (javaRegex) – Only evaluate filters that match this regex.
  • headers (headerConstraint) – Packet header constraints on the flows being searched.
  • invertSearch (boolean) – Search for packet headers outside the specified headerspace, rather than inside the space.
  • nodes (string) – Only evaluate filters present on nodes matching this regex.
  • startLocation (string) – Only consider specified locations as possible sources.
class pybatfish.question.bfq.testFilters(*, filters, headers, nodes, startLocation, question_name, exclusions)

Evaluate the processing of a flow by a given filter/ACL.

Find how the specified flow is processed through the specified filters/ACLs.

Parameters:
  • filters (javaRegex) –

    Required. Only consider filters that match this regular expression.

    Default value: .*

  • headers (headerConstraint) – Required. Packet header constraints.
  • nodes (nodeSpec) –

    Required. Only examine filters on nodes matching this name or regex.

    Default value: .*

  • startLocation (string) – Location to start tracing from.
class pybatfish.question.bfq.traceroute(*, headers, ignoreFilters, maxTraces, startLocation, question_name, exclusions)

Trace the path(s) for the specified flow.

This question performs a virtual traceroute in the network from a starting node. A destination IP and ingress (source) node must be specified. Other IP headers are given default values if unspecified. Unlike a real traceroute, this traceroute is directional. That is, for it to succeed, the reverse connectivity is not needed. This feature can help debug connectivity issues by decoupling the two directions.

Parameters:
  • headers (headerConstraint) – Required. Packet header constraints.
  • startLocation (string) – Required. Location (node and interface combination) to start tracing from.
  • ignoreFilters (boolean) – If set, filters/ACLs encountered along the path are ignored.
  • maxTraces (integer) – Limit the number of traces returned.
class pybatfish.question.bfq.undefinedReferences(*, nodes, question_name, exclusions)

Identify undefined references in configuration.

This question finds configurations that have references to named structures (e.g., ACLs) that are not defined. Such occurrences indicate errors and can have serious consequences in some cases.

Parameters:nodes (nodeSpec) –

Required. Look for undefined references on nodes matching this name or regex.

Default value: .*

class pybatfish.question.bfq.unusedStructures(*, nodes, question_name, exclusions)

Return nodes with structures such as ACLs, routemaps, etc. that are defined but not used.

Return nodes with structures such as ACLs, routes, etc. that are defined but not used. This may represent a bug in the configuration, which may have occurred because a final step in a template or MOP was not completed. Or it could be harmless extra configuration generated from a master template that is not meant to be used on those nodes.

Parameters:nodes (nodeSpec) –

Required. Look for unused structures on nodes matching this name or regex.

Default value: .*

class pybatfish.question.bfq.viModel(*, question_name, exclusions)

Lists configuration attributes of nodes and edges in the network.

Returns a JSON dictionary with all of the configuration parameters and neighbor relations stored in the vendor independent data-model.