Add wireshark dissector to extras
[vpp.git] / extras / wireshark / readme.md
1 How to build a vpp dispatch trace aware Wireshark
2 =================================================
3
4 At some point, we will upstream our vpp pcap dispatch trace dissector.
5 It's not finished - contributions welcome - and we have to work through
6 whatever issues will be discovered during the upstreaming process.
7
8 On the other hand, it's ready for some tire-kicking. Here's how to build
9 wireshark
10
11 Download and patch wireshark source code
12 -----------------------------------------
13
14 The wireshark git repo is large, so it takes a while to clone. 
15
16 ```
17      git clone https://code.wireshark.org/review/wireshark
18      cp .../extras/wireshark/packet-vpp.c wireshark/epan/dissectors
19      patch -p1 < .../extras/wireshark/diffs.txt
20 ```
21
22 The small patch adds packet-vpp.c to the dissector list.
23
24 Install prerequisite Debian packages
25 ------------------------------------
26
27 Here is a list of prerequisite packages which must be present in order
28 to compile wireshark, beyond what's typically installed on an Ubuntu
29 18.04 system:
30
31 ```
32         libgcrypt11-dev flex bison qtbase5-dev qttools5-dev-tools qttools5-dev
33         qtmultimedia5-dev libqt5svg5-dev libpcap-dev qt5-default
34 ```
35
36 Compile Wireshark
37 -----------------
38
39 Mercifully, Wireshark uses cmake, so it's relatively easy to build, at
40 least on Ubuntu 18.04. 
41
42
43 ```
44      $ cd wireshark
45      $ cmake -G Ninja
46      $ ninja -j 8
47      $ sudo ninja install
48 ```
49
50 Make a pcap dispatch trace
51 --------------------------
52
53 Configure vpp to pass traffic in some fashion or other, and then:
54
55 ```
56     vpp# pcap dispatch trace on max 10000 file vppcapture buffer-trace dpdk-input 1000
57
58 ```
59
60 or similar. Run traffic for long enough to capture some data. Save the
61 dispatch trace capture like so:
62
63 ```
64     vpp# pcap dispatch trace off
65 ```
66
67 Display in Wireshark
68 --------------------
69
70 Display /tmp/vppcapture in the vpp-enabled version of wireshark. With
71 any luck, normal version of wireshark will refuse to process vpp
72 dispatch trace pcap files because they won't understand the encap type.
73
74 Set wireshark to filter on vpp.bufferindex to watch a single packet
75 traverse the forwarding graph. Otherwise, you'll see a vector of packets
76 in e.g. ip4-lookup, then a vector of packets in ip4-rewrite, etc. 
77
78
79
80
81