amlight / ofp_sniffer

An OpenFlow sniffer to help network troubleshooting in production networks.
Apache License 2.0
13 stars 12 forks source link

Using ofp_sniffer with statistics app crashes when converting python-openflow messages #11

Closed italovalcy closed 3 years ago

italovalcy commented 3 years ago

Hi,

When you use ofp_sniffer with -S (statistics app) in a simple OF1.3 scenario, it fails with the following error:

Error on packet XXX: vars() argument must have __dict__ attribute

Steps to reproduce:

  1. Start a simple topology using mininet:
    mn --topo linear,3 --controller=remote,ip=172.17.0.1
  2. Run an openflow 1.3 controller (tested with Kytos), example:
    docker run -p 6653:6653 -it -d italovalcy/kytos /usr/local/bin/kytosd -E -f
  3. run ofp_sniffer with stats app:
    ./ofp_sniffer.py -i eth0 -S

Expected result: ofp_sniffer should run and print out the OF messages, and of course start the apps.rest to display statistics.

Actual result:

root@ef94ac9d9e1a# ./ofp_sniffer.py -i eth0 -S
./ofp_sniffer.py:230: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  logging.config.dictConfig(yaml.load(open('logging.yml', 'r')))
Sniffing device eth0
 * Serving Flask app "apps.rest" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
Packet #1 - 2021-02-10 21:18:08.040350 172.17.0.2:6653 -> 172.17.0.1():47272 Size: 148 Bytes
OpenFlow Version: 1.3(4) Type: OFPT_PACKET_OUT(13) Length: 82  XID: 3680965483

Packet #2 - 2021-02-10 21:18:08.173920 172.17.0.2:6653 -> 172.17.0.1():47272 Size: 148 Bytes
OpenFlow Version: 1.3(4) Type: OFPT_PACKET_OUT(13) Length: 82  XID: 14340918

Error on packet 4: vars() argument must have __dict__ attribute