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