Matteo Scandolo | 1f5530b | 2019-12-17 10:12:31 -0800 | [diff] [blame] | 1 | Troubleshooting |
| 2 | =============== |
| 3 | |
| 4 | Here is a collection of useful commands and tools to troubleshoot VOLTHA. |
| 5 | The project is still in a very early phase, so this section of the guide is more focus |
| 6 | on how to collection information and packet dumps than it is on operations. |
| 7 | |
| 8 | Trace Packets across components |
| 9 | ------------------------------- |
| 10 | |
| 11 | Given that ``VOLTHA`` is a collection of microservices we strongly suggest the usage of a log aggregator like |
| 12 | `stern <https://github.com/wercker/stern>`_. installed. You can then aggregate logs from multiple containers in a simple way, |
| 13 | for example to track all the ``packet-ins`` and ``packet-outs``: |
| 14 | |
| 15 | .. code:: bash |
| 16 | |
| 17 | $ stern -n voltha "voltha|adapter" | grep -E "packet-out|packet-in" > packets.trace |
| 18 | |
| 19 | Once you have captured the packets you need, you can see them in wireshark by transforming the logs with: |
| 20 | |
| 21 | .. code:: bash |
| 22 | |
| 23 | sed -n 's/.*packet":"\(.*\)",.*$/\1/p' packets.trace | sed -e 's/.\{2\}/& /g' | sed -e 's/^/000000 /' > packets.hex |
| 24 | |
| 25 | And then in wireshark select ``File -> Import from Hex Dump`` |
| 26 | |
| 27 | Or you can decode a single packet using this online tool: `https://hpd.gasmi.net <https://hpd.gasmi.net>`_ |
| 28 | |
| 29 | To get all the EAPOL packets: ``cat packets.trace | grep 888e`` |
| 30 | |
| 31 | or if you have `hl <https://github.com/mbornet-hl/hl>`__ installed you can highlight with: |
| 32 | |
| 33 | .. code:: bash |
| 34 | |
| 35 | cat packets.trace | grep 888e | hl -m '.*packet-in.*' -g '.*packet-out.*' |
| 36 | |
| 37 | To get all the DHCP packets: ``cat packets.trace | grep 8100`` |
| 38 | |
| 39 | or if you have `hl <https://github.com/mbornet-hl/hl>`__ installed you can highlight with: |
| 40 | |
| 41 | .. code:: bash |
| 42 | |
| 43 | cat packets.trace | grep 8100 | hl -m '.*packet-in.*' -g '.*packet-out.*' |
| 44 | |
| 45 | OMCI Packet Dump |
| 46 | ---------------- |
| 47 | |
| 48 | In order to see OMCI packets in Wireshark you'll need to install ``omci.lua`` and ``BinDecHex.lua`` dissectors |
| 49 | `wiki.wireshark.org/Contrib <https://wiki.wireshark.org/Contrib#Protocol_Dissectors>`_. |
| 50 | |
| 51 | To install them on Ubuntu: |
| 52 | |
| 53 | .. code:: bash |
| 54 | |
| 55 | mkdir -p $(HOME)/.local/lib/wireshark/plugins |
| 56 | cd $(HOME)/.local/lib/wireshark/plugins |
| 57 | wget "https://wiki.wireshark.org/Contrib?action=AttachFile&do=get&target=omci.lua" |
| 58 | wget "https://wiki.wireshark.org/Contrib?action=AttachFile&do=get&target=BinDecHex.lua" |
| 59 | |
| 60 | IMPORTANT - Apply `this <https://ask.wireshark.org/question/4557/bindechexlua-error-bad-argument-to-module-packageseeall/?answer=4573#post-id-4573>`_ fix to BinDecHex.lua. |
| 61 | |
| 62 | To capture the OMCI packets for all ONUs: |
| 63 | |
| 64 | .. code:: bash |
| 65 | |
| 66 | cat openonu.logs | grep -E "receive_message|_send_next" | grep msg > omci.dump |
| 67 | |
| 68 | To capture the OMCI packets for a particular ONU: |
| 69 | |
| 70 | .. code:: bash |
| 71 | |
| 72 | cat openonu.logs | grep -E "receive_message|_send_next" | grep msg | grep [deviceId] > omci.dump |
| 73 | |
| 74 | Once you have the ``omci.dump`` file you need to prepare it to be imported in wireshark with this command: |
| 75 | |
| 76 | .. code:: bash |
| 77 | |
| 78 | sed -n "s/.*[omci_msg|msg]: b'\(.*\)',.*$/\1/p" omci.dump | sed -e 's/.\{2\}/& /g' | sed -e 's/^/000000 /' > omci.hex |
| 79 | |
| 80 | And then in wireshark: |
| 81 | |
| 82 | - select ``File -> Import from Hex Dump`` |
| 83 | - select ``Encapsulation Type -> Ethernet`` |
| 84 | - set ``Ethernet -> Ethertype (hex): 88b5`` |