amlight / ofp_sniffer

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

Error decoding OFPT_MULTIPART OpenFlow 1.3 messages #18

Closed italovalcy closed 3 years ago

italovalcy commented 3 years ago

When I run ofp_sniffer with an existing python-openflow installation, I'm getting the following error:

...
Packet #12 - 2021-05-28 14:13:32.201830 x.x.x.229(sw6):52634 -> 172.17.0.2:6653 Size: 2374 Bytes
OpenFlow Version: 1.3(4) Type: OFPT_MULTIPART_REPLY(19) Length: 2320  XID: 2107580716
Multipart_Reply: Type: OFPMP_PORT_DESC
Error: 'MultipartReply' object has no attribute 'body_multipart'
...
Packet #14 - 2021-05-28 14:13:32.212670 172.17.0.2:6653 -> x.x.x.229(sw6):52634 Size: 70 Bytes
OpenFlow Version: 1.3(4) Type: OFPT_MULTIPART_REQUEST(18) Length: 16  XID: 2641022749
Multipart_Req: Type: OFPMP_DESC
Error: not enough arguments for format string
...
Packet #17 - 2021-05-28 14:13:32.550520 x.x.x.229(sw6):52634 -> 172.17.0.2:6653 Size: 1126 Bytes
OpenFlow Version: 1.3(4) Type: OFPT_MULTIPART_REPLY(19) Length: 1072  XID: 2641022749
Multipart_Reply: Type: OFPMP_DESC
Error: 'MultipartReply' object has no attribute 'mfr_desc'
...
Packet #20 - 2021-05-28 14:13:33.129870 172.17.0.2:6653 -> x.x.x.229(sw6):52634 Size: 110 Bytes
OpenFlow Version: 1.3(4) Type: OFPT_MULTIPART_REQUEST(18) Length: 56  XID: 401506422
Multipart_Req: Type: OFPMP_FLOW
Error: 'MultipartRequest' object has no attribute 'out_port'

Packet #22 - 2021-05-28 14:13:33.139810 172.17.0.2:6653 -> x.x.x.229(sw6):52634 Size: 78 Bytes
OpenFlow Version: 1.3(4) Type: OFPT_MULTIPART_REQUEST(18) Length: 24  XID: 2190440987
Multipart_Req: Type: OFPMP_PORT_STATS
Error: 'MultipartRequest' object has no attribute 'port_no'
..

My version of python-openflow is 2021.1rc1

Steps to reproduce:

  1. Use an existing python-openflow installation (e.g., using version 2021.1rc1)
  2. Install ofp_sniffer:
    git clone https://github.com/amlight/ofp_sniffer
    cd ofp_sniffer/
    apt-get update && apt-get install -y build-essential python3-dev libpcap-dev
    python3 -m pip install -r docs/requirements.txt
  3. Run ofp_sniffer: ./ofp_sniffer.py -i eth0
jab1982 commented 3 years ago

@dgarc330 , there is more:

Packet #1358 - 2021-07-05 17:54:09.230170 67.17.206.252:6653 -> 67.17.206.223:54488 Size: 110 Bytes
OpenFlow Version: 1.3(4) Type: OFPT_MULTIPART_REQUEST(18) Length: 56  XID: 3610753442
Multipart_Req: Type: OFPMP_FLOW
Error: 'MultipartRequest' object has no attribute 'out_port'
dgarc330 commented 3 years ago

Hello team, I solved the errors regarding the multipart_reply action via the following PR that is pending been merged: #20