Code Monkey home page Code Monkey logo

netcov's People

Contributors

ratulm avatar xieyangxu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

netcov's Issues

Exception when using the `routes` question

Hi, I'm getting the following when trying to look up routes and then looking at the netcov result. Thanks in advance.

>>> bf.q.routes().answer().frame()
           Node      VRF          Network                       Next_Hop     Next_Hop_IP  Next_Hop_Interface   Protocol Metric Admin_Distance   Tag
0   ios-access2  default  0.0.0.0/0        ip 172.29.133.254              172.29.133.254  dynamic             static     0      1              None
1   ios-access2  default  172.29.133.0/24  interface GigabitEthernet0/0   AUTO/NONE(-1l)  GigabitEthernet0/0  connected  0      0              None
2   ios-access2  default  172.29.133.6/32  interface GigabitEthernet0/0   AUTO/NONE(-1l)  GigabitEthernet0/0  local      0      0              None
3   nxos-aggr1   default  10.1.1.0/24      interface Ethernet1/4          AUTO/NONE(-1l)  Ethernet1/4         connected  0      0              0   
4   nxos-aggr1   default  10.1.1.2/32      interface Ethernet1/4          AUTO/NONE(-1l)  Ethernet1/4         local      0      0              0   
..         ...       ...          ...                        ...                     ...          ...           ...     ..     ..             ..   
91  server2      default  10.2.20.0/24     interface eth0                 AUTO/NONE(-1l)  eth0                connected  0      0              None
92  server2      default  10.2.20.1/32     interface eth0                 AUTO/NONE(-1l)  eth0                local      0      0              None
93  server3      default  0.0.0.0/0        interface eth0 ip 10.2.30.254  10.2.30.254     eth0                static     0      1              None
94  server3      default  10.2.30.0/24     interface eth0                 AUTO/NONE(-1l)  eth0                connected  0      0              None
95  server3      default  10.2.30.1/32     interface eth0                 AUTO/NONE(-1l)  eth0                local      0      0              None

[96 rows x 10 columns]
>>> bf.cov.result()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/rick/development/tech-sessions/2022-11-netcov/.venv/lib/python3.8/site-packages/netcov/coverage.py", line 67, in result
    covered_lines = control_plane_coverage(self.model, tested_nodes)
  File "/home/rick/development/tech-sessions/2022-11-netcov/.venv/lib/python3.8/site-packages/netcov/algorithm/coverage.py", line 41, in control_plane_coverage
    dfs(node)
  File "/home/rick/development/tech-sessions/2022-11-netcov/.venv/lib/python3.8/site-packages/netcov/algorithm/coverage.py", line 36, in dfs
    dfs(pred)
  File "/home/rick/development/tech-sessions/2022-11-netcov/.venv/lib/python3.8/site-packages/netcov/algorithm/coverage.py", line 35, in dfs
    for (pred, _) in node.pred:
AttributeError: 'NoneType' object has no attribute 'pred'

`traceroute` issue: NoneType object has no attribute status

Hi, Im hitting an issue when trying to use a traceroute with Batfish. Thanks in advance.

>>> bf.q.traceroute(startLocation='nxos-core1', headers=HeaderConstraints(srcIps='nxos-core1[Ethernet1/2]', dstIps='nxos-core2[Ethernet1/2]'),maxTraces=1).answer().frame()
                                                    Flow  ... TraceCount
0  start=nxos-core1 [10.1.2.1:49152->10.2.2.1:33434 UDP]  ...  2        

[1 rows x 3 columns]
>>> bf.cov.result()
Unsupported protocol ospf with prefix 10.2.2.0/24 at nxos-core1.default main rib
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/rick/development/tech-sessions/2022-11-netcov/.venv/lib/python3.8/site-packages/netcov/coverage.py", line 64, in result
    ifg_lazy_construction(self.model, tested_nodes)
  File "/home/rick/development/tech-sessions/2022-11-netcov/.venv/lib/python3.8/site-packages/netcov/algorithm/construct.py", line 451, in ifg_lazy_construction
    run_to_fixpoint()
  File "/home/rick/development/tech-sessions/2022-11-netcov/.venv/lib/python3.8/site-packages/netcov/algorithm/construct.py", line 420, in run_to_fixpoint
    if len(node.status) == 0:
AttributeError: 'NoneType' object has no attribute 'status'

Exception when using IPs in `traceroute` headercontraints

I'm getting an exception when using IPs in traceroute headercontraints...

>>> bf.q.traceroute(startLocation='nxos-core1', headers=HeaderConstraints(srcIps='10.1.2.1', dstIps='1.1.1.1'),maxTraces=1).answer().frame()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/rick/development/tech-sessions/2022-11-netcov/.venv/lib/python3.8/site-packages/pybatfish/question/question.py", line 192, in answer
    return _bf_answer_obj(
  File "/home/rick/development/tech-sessions/2022-11-netcov/.venv/lib/python3.8/site-packages/pybatfish/client/internal.py", line 66, in _bf_answer_obj
    return session.get_answer(question_name, snapshot, reference_snapshot)
  File "/home/rick/development/tech-sessions/2022-11-netcov/.venv/lib/python3.8/site-packages/netcov/hook.py", line 42, in get_answer
    self.cov.collect_trace(answer)
  File "/home/rick/development/tech-sessions/2022-11-netcov/.venv/lib/python3.8/site-packages/netcov/coverage.py", line 92, in collect_trace
    self.trace.update(convert_traceroute_traces([answer.frame()]))
  File "/home/rick/development/tech-sessions/2022-11-netcov/.venv/lib/python3.8/site-packages/netcov/algorithm/converttrace.py", line 30, in convert_traceroute_traces
    action_stats[path[-1][-1]] += 1
  File "<attrs generated hash pybatfish.datamodel.flow.Step>", line 2, in __hash__
    return hash((
  File "<attrs generated hash pybatfish.datamodel.flow.RoutingStepDetail>", line 2, in __hash__
    return hash((
TypeError: unhashable type: 'list'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.