1 <!-- WSUG Chapter Work -->
4 <chapter id="ChapterWork">
5 <title>Working with captured packets</title>
7 <section id="ChWorkViewPacketsSection">
8 <title>Viewing packets you have captured</title>
10 Once you have captured some packets, or you have opened a previously
11 saved capture file, you can view the packets that are displayed in
12 the packet list pane by simply clicking on a packet in the
13 packet list pane, which will bring up the selected packet in the
14 tree view and byte view panes.
17 You can then expand any part of the tree view by clicking on the
18 <command>plus</command> sign (the symbol itself may vary) to the left of
19 that part of the payload,
20 and you can select individual fields by clicking on them in the tree
21 view pane. An example with a TCP packet selected is shown in
22 <xref linkend="ChWorkSelPack1"/>. It also has the Acknowledgment number
23 in the TCP header selected, which shows up in the byte view as the
25 <figure id="ChWorkSelPack1">
26 <title>Wireshark with a TCP packet selected for viewing</title>
27 <graphic entityref="WiresharkPacketSelected1" format="PNG"/>
31 You can also select and view packets the same way, while Wireshark is
32 capturing, if you selected "Update list of packets in real time" in the
33 Wireshark Capture Preferences dialog box.
36 In addition, you can view individual packets in a separate window as
37 shown in <xref linkend="ChWorkPacketSepView"/>. Do this by selecting the
38 packet in which you are interested in the packet list pane, and then
39 select "Show Packet in New Windows" from the Display menu. This
40 allows you to easily compare two or even more packets.
41 <figure id="ChWorkPacketSepView">
42 <title>Viewing a packet in a separate window</title>
43 <graphic entityref="WiresharkPacketSepView" format="PNG"/>
48 <section id="ChWorkDisplayPopUpSection"><title>Pop-up menus</title>
50 You can bring up a pop-up menu over either the "Packet List", its
52 "Packet Details" pane by clicking your right mouse button at the
56 <section id="ChWorkColumnHeaderPopUpMenuSection">
57 <title>Pop-up menu of the "Packet List" column header</title>
59 <figure id="ChWorkColumnHeaderPopUpMenu">
60 <title>Pop-up menu of the "Packet List" column header</title>
61 <graphic entityref="WiresharkColumnHeaderPopupMenu" format="PNG"/>
65 The following table gives an overview of which functions are available
66 in this header, where to find the corresponding function in the main menu,
67 and a short description of each item.
69 <table id="ColumnHeaderPopupMenuTable">
70 <title>The menu items of the "Packet List" column header pop-up menu</title>
72 <colspec colnum="1" colwidth="80pt"/>
73 <colspec colnum="2" colwidth="80pt"/>
77 <entry>Identical to main menu's item:</entry>
78 <entry>Description</entry>
83 <entry><command>Sort Ascending</command></entry>
87 Sort the packet list in ascending order based on this column.
92 <entry><command>Sort Descending</command></entry>
96 Sort the packet list in descending order based on this column.
101 <entry><command>No Sort</command></entry>
105 Remove sorting order based on this column.
115 <entry><command>Align Left</command></entry>
119 Set left alignment of the values in this column.
124 <entry><command>Align Center</command></entry>
128 Set center alignment of the values in this column.
133 <entry><command>Align Right</command></entry>
137 Set right alignment of the values in this column.
147 <entry><command>Column Preferences...</command></entry>
151 Open the Preferences dialog box on the column tab.
156 <entry><command>Resize Column</command></entry>
160 Resize the column to fit the values.
165 <entry><command>Rename Column Title</command></entry>
169 Allows you to change the title of the column header.
179 <entry><command>Displayed Column</command></entry>
183 This menu items folds out with a list of all configured columns.
184 These columns can now be shown or hidden in the packet list.
189 <entry><command>Hide Column</command></entry>
193 Allows you to hide the column from the packet list.
198 <entry><command>Remove Column</command></entry>
202 Allows you to remove the column from the packet list.
211 <section id="ChWorkPacketListPanePopUpMenuSection">
212 <title>Pop-up menu of the "Packet List" pane</title>
214 <figure id="ChWorkPacketListPanePopUpMenu">
215 <title>Pop-up menu of the "Packet List" pane</title>
216 <graphic entityref="WiresharkPacketPanePopupMenu" format="PNG"/>
220 The following table gives an overview of which functions are available
221 in this pane, where to find the corresponding function in the main menu,
222 and a short description of each item.
224 <table id="PacketListPopupMenuTable">
225 <title>The menu items of the "Packet List" pop-up menu</title>
227 <colspec colnum="1" colwidth="80pt"/>
228 <colspec colnum="2" colwidth="80pt"/>
232 <entry>Identical to main menu's item:</entry>
233 <entry>Description</entry>
238 <entry><command>Mark Packet (toggle)</command></entry>
242 Mark/unmark a packet.
247 <entry><command>Ignore Packet (toggle)</command></entry>
251 Ignore or inspect this packet while dissecting the capture file.
256 <entry><command>Set Time Reference (toggle)</command></entry>
260 Set/reset a time reference.
265 <entry><command>Manually Resolve Address</command></entry>
269 Allows you to enter a name to resolve for the selected address.
279 <entry><command>Apply as Filter</command></entry>
280 <entry>Analyze</entry>
283 Prepare and apply a display filter based on the currently selected
289 <entry><command>Prepare a Filter</command></entry>
290 <entry>Analyze</entry>
293 Prepare a display filter based on the currently selected item.
298 <entry><command>Conversation Filter</command></entry>
302 This menu item applies a display filter with the address information
303 from the selected packet. E.g. the IP menu entry will set a filter
304 to show the traffic between the two IP addresses of the current
306 XXX - add a new section describing this better.
311 <entry><command>Colorize Conversation</command></entry>
315 This menu item uses a display filter with the address information
316 from the selected packet to build a new colorizing rule.
321 <entry><command>SCTP</command></entry>
325 Allows you to analyze and prepare a filter for this SCTP association.
330 <entry><command>Follow TCP Stream</command></entry>
331 <entry>Analyze</entry>
334 Allows you to view all the data on a TCP
335 stream between a pair of nodes.
340 <entry><command>Follow UDP Stream</command></entry>
341 <entry>Analyze</entry>
344 Allows you to view all the data on a UDP datagram
345 stream between a pair of nodes.
350 <entry><command>Follow SSL Stream</command></entry>
351 <entry>Analyze</entry>
354 Same as "Follow TCP Stream" but for SSL.
355 XXX - add a new section describing this better.
365 <entry><command>Copy/ Summary (Text)</command></entry>
369 Copy the summary fields as displayed to the clipboard, as tab-separated text.
374 <entry><command>Copy/ Summary (CSV)</command></entry>
378 Copy the summary fields as displayed to the clipboard, as comma-separated text.
383 <entry><command>Copy/ As Filter</command></entry>
387 Prepare a display filter based on the currently selected item
388 and copy that filter to the clipboard.
393 <entry><command>Copy/ Bytes (Offset Hex Text)</command></entry>
397 Copy the packet bytes to the clipboard in hexdump-like format.
402 <entry><command>Copy/ Bytes (Offset Hex)</command></entry>
406 Copy the packet bytes to the clipboard in hexdump-like format, but without the text portion.
411 <entry><command>Copy/ Bytes (Printable Text Only)</command></entry>
415 Copy the packet bytes to the clipboard as ASCII text, excluding non-printable characters.
420 <entry><command>Copy/ Bytes (Hex Stream)</command></entry>
424 Copy the packet bytes to the clipboard as an unpunctuated list of hex digits.
429 <entry><command>Copy/ Bytes (Binary Stream)</command></entry>
433 Copy the packet bytes to the clipboard as raw binary. The data is stored in the
434 clipboard as MIME-type "application/octet-stream".</para>
443 <entry><command>Decode As...</command></entry>
444 <entry>Analyze</entry>
447 Change or apply a new relation between two dissectors.
452 <entry><command>Print...</command></entry>
461 <entry><command>Show Packet in New Window</command></entry>
465 Display the selected packet in a new window.
474 <section id="ChWorkPacketDetailsPanePopUpMenuSection">
475 <title>Pop-up menu of the "Packet Details" pane</title>
477 <figure id="ChWorkPacketDetailsPanePopUpMenu">
478 <title>Pop-up menu of the "Packet Details" pane</title>
479 <graphic entityref="WiresharkDetailsPanePopupMenu" format="PNG"/>
483 The following table gives an overview of which functions are available
484 in this pane, where to find the corresponding function in the main menu,
485 and a short description of each item.
487 <table id="PacketDetailsPopupMenuTable">
488 <title>The menu items of the "Packet Details" pop-up menu</title>
490 <colspec colnum="1" colwidth="80pt"/>
491 <colspec colnum="2" colwidth="80pt"/>
495 <entry>Identical to main menu's item:</entry>
496 <entry>Description</entry>
501 <entry><command>Expand Subtrees</command></entry>
505 Expand the currently selected subtree.
510 <entry><command>Collapse Subtrees</command></entry>
514 Collapse the currently selected subtree.
519 <entry><command>Expand All</command></entry>
523 Expand all subtrees in all packets in the capture.
528 <entry><command>Collapse All</command></entry>
532 Wireshark keeps a list of all the protocol subtrees that are
533 expanded, and uses it to ensure that the correct subtrees
534 are expanded when you display a packet. This menu item
535 collapses the tree view of all packets in the capture list.
545 <entry><command>Apply as Column</command></entry>
549 Use the selected protocol item to create a new column in the packet list.
559 <entry><command>Apply as Filter</command></entry>
560 <entry>Analyze</entry>
563 Prepare and apply a display filter based on the currently selected
569 <entry><command>Prepare a Filter</command></entry>
570 <entry>Analyze</entry>
573 Prepare a display filter based on the currently selected item.
578 <entry><command>Colorize with Filter</command></entry>
582 This menu item uses a display filter with the information
583 from the selected protocol item to build a new colorizing rule.
588 <entry><command>Follow TCP Stream</command></entry>
589 <entry>Analyze</entry>
592 Allows you to view all the data on a TCP
593 stream between a pair of nodes.
598 <entry><command>Follow UDP Stream</command></entry>
599 <entry>Analyze</entry>
602 Allows you to view all the data on a UDP datagram
603 stream between a pair of nodes.
608 <entry><command>Follow SSL Stream</command></entry>
609 <entry>Analyze</entry>
612 Same as "Follow TCP Stream" but for SSL.
613 XXX - add a new section describing this better.
623 <entry><command>Copy/ Description</command></entry>
627 Copy the displayed text of the selected field to the system
633 <entry><command>Copy/ Fieldname</command></entry>
637 Copy the name of the selected field to the system clipboard.
642 <entry><command>Copy/ Value</command></entry>
646 Copy the value of the selected field to the system clipboard.
651 <entry><command>Copy/ As Filter</command></entry>
655 Prepare a display filter based on the currently selected item
656 and copy it to the clipboard.
661 <entry><command>Copy/ Bytes (Offset Hex Text)</command></entry>
665 Copy the packet bytes to the clipboard in hexdump-like format; similar to the Packet List Pane
666 command, but copies only the bytes relevant to the selected part of the tree (the bytes selected
667 in the Packet Bytes Pane).
672 <entry><command>Copy/ Bytes (Offset Hex)</command></entry>
676 Copy the packet bytes to the clipboard in hexdump-like format, but without the text portion; similar to the Packet List Pane
677 command, but copies only the bytes relevant to the selected part of the tree (the bytes selected
678 in the Packet Bytes Pane).
683 <entry><command>Copy/ Bytes (Printable Text Only)</command></entry>
687 Copy the packet bytes to the clipboard as ASCII text, excluding non-printable characters; similar to the Packet List Pane
688 command, but copies only the bytes relevant to the selected part of the tree (the bytes selected
689 in the Packet Bytes Pane).
694 <entry><command>Copy/ Bytes (Hex Stream)</command></entry>
698 Copy the packet bytes to the clipboard as an unpunctuated list of hex digits; similar to the Packet List Pane
699 command, but copies only the bytes relevant to the selected part of the tree (the bytes selected
700 in the Packet Bytes Pane).
705 <entry><command>Copy/ Bytes (Binary Stream)</command></entry>
709 Copy the packet bytes to the clipboard as raw binary; similar to the Packet List Pane
710 command, but copies only the bytes relevant to the selected part of the tree (the bytes selected
711 in the Packet Bytes Pane). The data is stored in the
712 clipboard as MIME-type "application/octet-stream".</para>
716 <entry><command>Export Selected Packet Bytes...</command></entry>
720 This menu item is the same as the File menu item of the same
721 name. It allows you to export raw packet bytes to a binary file.
731 <entry><command>Wiki Protocol Page</command></entry>
735 Show the wiki page corresponding to the currently selected protocol
741 <entry><command>Filter Field Reference</command></entry>
745 Show the filter field reference web page corresponding to the
746 currently selected protocol in your web browser.
751 <entry><command>Protocol Preferences...</command></entry>
755 The menu item takes you to the properties dialog and selects the
756 page corresponding to the protocol if there are properties
757 associated with the highlighted field.
758 More information on preferences can be found in
759 <xref linkend="ChCustGUIPrefPage"/>.
769 <entry><command>Decode As...</command></entry>
770 <entry>Analyze</entry>
773 Change or apply a new relation between two dissectors.
778 <entry><command>Disable Protocol</command></entry>
782 Allows you to temporarily disable a protocol dissector, which may
783 be blocking the legitimate dissector.
788 <entry><command>Resolve Name</command></entry>
792 Causes a name resolution to be performed for
793 the selected packet, but NOT every packet in the capture.
798 <entry><command>Go to Corresponding Packet</command></entry>
802 If the selected field has a corresponding packet, go to it.
803 Corresponding packets will usually be a request/response packet pair
815 <section id="ChWorkDisplayFilterSection">
816 <title>Filtering packets while viewing</title>
818 Wireshark has two filtering languages: One used when capturing
819 packets, and one used when displaying packets. In this section we
820 explore that second type of filter: Display filters. The first one
821 has already been dealt with in
822 <xref linkend="ChCapCaptureFilterSection"/>.
825 Display filters allow you to concentrate on the packets you are
826 interested in while hiding the currently uninteresting ones. They allow
827 you to select packets by:
829 <listitem><para>Protocol</para></listitem>
830 <listitem><para>The presence of a field</para></listitem>
831 <listitem><para>The values of fields</para></listitem>
832 <listitem><para>A comparison between fields</para></listitem>
833 <listitem><para>... and a lot more!</para></listitem>
837 To select packets based on protocol type, simply type the protocol in which you
838 are interested in the <command>Filter:</command> field in the filter
839 toolbar of the Wireshark window and press enter to initiate
840 the filter. <xref linkend="ChWorkTCPFilter"/> shows an example of what
841 happens when you type <command>tcp</command> in the filter field.
846 All protocol and field names are entered in lowercase. Also, don't
847 forget to press enter after entering the filter expression.
850 <figure id="ChWorkTCPFilter"><title>Filtering on the TCP protocol</title>
851 <graphic entityref="WiresharkFilterTCP" format="JPG"/>
854 As you might have noticed, only packets of the TCP protocol are displayed
855 now (e.g. packets 1-10 are hidden). The packet numbering will remain as
856 before, so the first packet shown is now packet number 11.
861 When using a display filter, all packets remain in the capture file.
862 The display filter only changes the display of the capture file but
867 You can filter on any protocol that Wireshark understands.
868 You can also filter on any field that a dissector adds to the tree
869 view, but only if the dissector has added an abbreviation for the
870 field. A list of such fields is available in Wireshark in the
871 <command>Add Expression...</command> dialog box. You can find more
872 information on the <command>Add Expression...</command> dialog box
873 in <xref linkend="ChWorkFilterAddExpressionSection"/>.
876 For example, to narrow the packet list pane down to only those
877 packets to or from the IP address 192.168.0.1, use
878 <command>ip.addr==192.168.0.1</command>.
883 To remove the filter, click on the <command>Clear</command> button
884 to the right of the filter field.
889 <section id="ChWorkBuildDisplayFilterSection">
890 <title>Building display filter expressions</title>
892 Wireshark provides a simple but powerful display filter language that allows you
893 to build quite complex filter expressions. You can compare
894 values in packets as well as combine expressions into more
895 specific expressions. The following sections provide more
896 information on doing this.
901 You will find a lot of Display Filter examples at the <command>Wireshark
902 Wiki Display Filter page</command> at <ulink
903 url="&WiresharkWikiDisplayFiltersPage;">&WiresharkWikiDisplayFiltersPage;</ulink>.
907 <title>Display filter fields</title>
909 Every field in the packet details pane can be used as a filter
910 string, this will result in showing only the packets where this field
911 exists. For example: the
912 filter string: <command>tcp</command> will show all packets containing the
916 There is a complete list of all filter fields available
917 through the menu item "Help/Supported Protocols" in the page "Display Filter
918 Fields" of the Supported Protocols dialog.
921 XXX - add some more info here and a link to the statusbar info.
925 <title>Comparing values</title>
927 You can build display filters that compare values using a number
928 of different comparison operators. They are shown in
929 <xref linkend="DispCompOps"/>.
931 <tip><title>Tip!</title>
933 You can use English and C-like terms in the same way, they can even be
934 mixed in a filter string!
937 <table id="DispCompOps">
938 <title>Display Filter comparison operators</title>
940 <colspec colnum="1" colwidth="50pt"/>
941 <colspec colnum="2" colwidth="50pt"/>
944 <entry>English</entry>
945 <entry>C-like</entry>
946 <entry>Description and example</entry>
952 <entry><programlisting>==</programlisting></entry>
954 <command>Equal</command></para><para>
955 <programlisting>ip.src==10.0.0.5</programlisting>
960 <entry><programlisting>!=</programlisting></entry>
962 <command>Not equal</command></para><para>
963 <programlisting>ip.src!=10.0.0.5</programlisting>
968 <entry><programlisting>></programlisting></entry>
970 <command>Greater than</command></para><para>
971 <programlisting>frame.len > 10</programlisting>
976 <entry><programlisting><</programlisting></entry>
977 <entry><para><command>Less than</command></para><para>
978 <programlisting>frame.len < 128</programlisting>
983 <entry><programlisting>>=</programlisting></entry>
985 <command>Greater than or equal to</command></para><para>
986 <programlisting>frame.len ge 0x100</programlisting>
991 <entry><programlisting><=</programlisting></entry>
993 <command>Less than or equal to</command></para><para>
994 <programlisting>frame.len <= 0x20</programlisting>
1001 In addition, all protocol fields are typed.
1002 <xref linkend="ChWorkFieldTypes"/> provides a list of the types and
1003 example of how to express them.
1004 <table id="ChWorkFieldTypes">
1005 <title>Display Filter Field Types</title>
1010 <entry>Example</entry>
1016 Unsigned integer (8-bit, 16-bit, 24-bit, 32-bit)
1019 You can express integers in decimal, octal, or
1020 hexadecimal. The following display filters are
1031 Signed integer (8-bit, 16-bit, 24-bit, 32-bit)
1036 <entry>Boolean</entry>
1038 A boolean field is present in the protocol decode
1039 only if its value is true. For example,
1040 <command>tcp.flags.syn</command> is present, and
1041 thus true, only if the SYN flag is present in a
1042 TCP segment header.</para><para>
1043 Thus the filter expression
1044 <command>tcp.flags.syn</command> will select only
1045 those packets for which this flag exists, that is,
1046 TCP segments where the segment header contains the
1047 SYN flag. Similarly, to find source-routed token
1048 ring packets, use a filter expression of
1049 <command>tr.sr</command>.
1053 <entry>Ethernet address (6 bytes)</entry>
1054 <entry><para>Separators can be a colon
1055 (:), dot (.) or dash (-) and can have one or
1056 two bytes between separators:<programlisting>
1057 eth.dst == ff:ff:ff:ff:ff:ff
1058 eth.dst == ff-ff-ff-ff-ff-ff
1059 eth.dst == ffff.ffff.ffff</programlisting></para></entry>
1062 <entry>IPv4 address</entry>
1064 <para>ip.addr == 192.168.0.1</para>
1065 <para>Classless InterDomain Routing (CIDR) notation
1066 can be used to test if an IPv4 address is in a
1067 certain subnet. For example, this display filter
1068 will find all packets in the 129.111 Class-B
1070 </para><para>ip.addr == 129.111.0.0/16</para></entry>
1073 <entry>IPv6 address</entry>
1074 <entry>ipv6.addr == ::1</entry>
1077 <entry>IPX address</entry>
1078 <entry>ipx.addr == 00000000.ffffffffffff</entry>
1081 <entry>String (text)</entry>
1082 <entry>http.request.uri == "http://www.wireshark.org/"</entry>
1090 <title>Combining expressions</title>
1092 You can combine filter expressions in Wireshark using the
1093 logical operators shown in <xref linkend="FiltLogOps"/>
1095 <table id="FiltLogOps">
1096 <title>Display Filter Logical Operations</title>
1098 <colspec colnum="1" colwidth="50pt"/>
1099 <colspec colnum="2" colwidth="50pt"/>
1102 <entry>English</entry>
1103 <entry>C-like</entry>
1104 <entry>Description and example</entry>
1110 <entry>&&</entry>
1112 <command>Logical AND</command></para><para>
1113 <programlisting>ip.src==10.0.0.5 and tcp.flags.fin</programlisting>
1120 <command>Logical OR</command></para><para>
1121 <programlisting>ip.scr==10.0.0.5 or ip.src==192.1.1.1</programlisting>
1128 <command>Logical XOR</command></para><para>
1129 <programlisting>tr.dst[0:3] == 0.6.29 xor tr.src[0:3] == 0.6.29</programlisting>
1136 <command>Logical NOT</command></para><para>
1137 <programlisting>not llc</programlisting>
1141 <entry>[...]</entry>
1144 <command>Substring Operator</command></para><para>
1145 Wireshark allows you to select subsequences of a
1146 sequence in rather elaborate ways. After a label you
1147 can place a pair of brackets [] containing a comma
1148 separated list of range specifiers. </para><para>
1149 <programlisting>eth.src[0:3] == 00:00:83</programlisting></para><para>
1150 The example above uses the n:m format to specify a
1151 single range. In this case n is the beginning offset
1152 and m is the length of the range
1153 being specified.</para><para>
1155 eth.src[1-2] == 00:83
1156 </programlisting></para><para>
1157 The example above uses the n-m format to specify a
1158 single range. In this case n is the beginning offset
1159 and m is the ending offset. </para><para>
1160 <programlisting>eth.src[:4] == 00:00:83:00</programlisting></para><para>
1161 The example above uses the :m format, which takes
1162 everything from the beginning of a sequence to offset m.
1163 It is equivalent to 0:m</para><para>
1164 <programlisting>eth.src[4:] == 20:20</programlisting></para><para>
1165 The example above uses the n: format, which takes
1166 everything from offset n to the end of the
1167 sequence. </para><para>
1168 <programlisting>eth.src[2] == 83</programlisting></para><para>
1169 The example above uses the n format to specify a
1170 single range. In this case the element in the
1171 sequence at offset n is selected. This is equivalent
1172 to n:1.</para><para>
1173 <programlisting>eth.src[0:3,1-2,:4,4:,2] ==
1174 00:00:83:00:83:00:00:83:00:20:20:83</programlisting></para><para>
1175 Wireshark allows you to string together single ranges
1176 in a comma separated list to form compound ranges as
1184 <section id="ChWorkBuildDisplayFilterMistake"><title>A common mistake</title>
1185 <warning><title>Warning!</title>
1187 Using the != operator on combined expressions like: eth.addr, ip.addr,
1188 tcp.port, udp.port and alike will probably not work as expected!
1192 Often people use a filter string to display something like
1193 <command>ip.addr == 1.2.3.4</command> which will display all packets
1194 containing the IP address 1.2.3.4.
1197 Then they use <command>ip.addr != 1.2.3.4</command> to see all packets
1198 not containing the IP address 1.2.3.4 in it. Unfortunately, this does
1199 <command>not</command> do the expected.
1202 Instead, that expression will even be true for packets where either
1203 source or destination IP address equals 1.2.3.4. The reason for this,
1204 is that the expression <command>ip.addr != 1.2.3.4</command> must be read as "the
1205 packet contains a field named ip.addr with a value
1206 different from 1.2.3.4". As an IP datagram contains both a source and
1207 a destination address, the expression will evaluate to true whenever
1208 at least one of the two addresses differs from 1.2.3.4.
1212 filter out all packets containing IP datagrams to or from IP address
1213 1.2.3.4, then the correct filter is <command>!(ip.addr == 1.2.3.4)</command> as it
1214 reads "show me all the packets for which it is not true
1215 that a field named ip.addr exists with a value of 1.2.3.4", or in
1216 other words, "filter out all packets for which there are
1217 no occurrences of a field named ip.addr with the value 1.2.3.4".
1222 <section id="ChWorkFilterAddExpressionSection">
1223 <title>The "Filter Expression" dialog box</title>
1225 When you are accustomed to Wireshark's filtering system and know what
1226 labels you wish to use in your filters it can be very quick to
1227 simply type a filter string. However if you are new to Wireshark or
1228 are working with a slightly unfamiliar protocol it can be very
1229 confusing to try to figure out what to type. The Filter Expression
1230 dialog box helps with this.
1232 <tip><title>Tip!</title>
1234 The "Filter Expression" dialog box is an excellent way to learn how to
1235 write Wireshark display filter strings.
1238 <figure id="ChWorkFilterAddExpression1">
1239 <title>The "Filter Expression" dialog box</title>
1240 <graphic entityref="WiresharkFilterAddExpression" format="PNG"/>
1243 When you first bring up the Filter Expression dialog box you are shown a
1244 tree list of field names, organized by protocol, and a box for
1245 selecting a relation.
1248 <varlistentry><term><command>Field Name</command></term>
1251 Select a protocol field from the protocol field tree.
1252 Every protocol with filterable fields is listed at the
1253 top level. (You can search for a particular protocol
1254 entry by entering the first few letters of the protocol name).
1255 By clicking on the "+" next to a protocol name
1256 you can get a list of the field names available for filtering
1261 <varlistentry><term><command>Relation</command></term>
1264 Select a relation from the list of available relation.
1265 The <command>is present</command> is a unary relation which
1266 is true if the selected field is present in a packet. All
1267 other listed relations are binary relations which require additional
1268 data (e.g. a <command>Value</command> to match) to complete.
1274 When you select a field from the field name list and select a
1275 binary relation (such as the equality relation ==) you will be
1276 given the opportunity to enter a value, and possibly some range
1280 <varlistentry><term><command>Value</command></term>
1283 You may enter an appropriate value in the
1284 <command>Value</command> text box. The <command>Value</command>
1285 will also indicate the type of value for the
1286 <command>field name</command> you have selected (like
1291 <varlistentry><term><command>Predefined values</command></term>
1294 Some of the protocol fields have predefined values available, much like
1295 enum's in C. If the selected protocol field has such values defined, you
1296 can choose one of them here.
1300 <varlistentry><term><command>Range</command></term>
1303 XXX - add an explanation here!
1307 <varlistentry><term><command>OK</command></term>
1310 When you have built a satisfactory expression click
1311 <command>OK</command> and a filter string will be
1316 <varlistentry><term><command>Cancel</command></term>
1319 You can leave the <command>Add Expression...</command> dialog
1320 box without any effect by clicking the <command>Cancel</command>
1328 <section id="ChWorkDefineFilterSection"><title>Defining and saving filters</title>
1330 You can define filters with Wireshark and give them labels for
1331 later use. This can save time in remembering and retyping some of
1332 the more complex filters you use.
1335 To define a new filter or edit an existing one, select the
1336 <command>Capture Filters...</command> menu item from the Capture menu
1337 or the <command>Display Filters...</command> menu item from the Analyze
1338 menu. Wireshark will then pop up the Filters dialog as shown in
1339 <xref linkend="FiltersDialog"/>.
1342 <title>Note!</title>
1344 The mechanisms for defining and saving capture filters and display
1345 filters are almost identical. So both will be described here,
1346 differences between these two will be marked as such.
1349 <warning><title>Warning!</title>
1351 You must use <command>Save</command> to save your filters permanently.
1352 <command>Ok</command> or <command>Apply</command> will not save the filters,
1353 so they will be lost when you close Wireshark.
1356 <figure id="FiltersDialog">
1357 <title>The "Capture Filters" and "Display Filters" dialog boxes</title>
1358 <graphic entityref="WiresharkFilters" format="PNG"/>
1362 <varlistentry><term><command>New</command></term>
1365 This button adds a new filter to the list of filters. The currently
1366 entered values from Filter name and Filter string will be used. If
1367 any of these fields are empty, it will be set to "new".
1371 <varlistentry><term><command>Delete</command></term>
1374 This button deletes the selected filter. It will be greyed out, if no
1379 <varlistentry><term><command>Filter</command></term>
1382 You can select a filter from this list (which will fill in the
1383 filter name and filter string in the fields down at the bottom of the
1388 <varlistentry><term><command>Filter name:</command></term>
1391 You can change the name of the currently selected filter here.
1393 <note><title>Note!</title>
1395 The filter name will only be used in this dialog to identify the
1396 filter for your convenience, it will not be used elsewhere. You can
1397 add multiple filters with the same name, but this is not very useful.
1402 <varlistentry><term><command>Filter string:</command></term>
1405 You can change the filter string of the currently selected filter here.
1406 Display Filter only: the string will be syntax checked while you are
1411 <varlistentry><term><command>Add Expression...</command></term>
1414 Display Filter only: This button brings up the Add Expression
1415 dialog box which assists in building filter strings. You can find
1416 more information about the Add Expression dialog in
1417 <xref linkend="ChWorkFilterAddExpressionSection"/>
1421 <varlistentry><term><command>OK</command></term>
1424 Display Filter only: This button applies the selected filter to the
1425 current display and closes the dialog.
1429 <varlistentry><term><command>Apply</command></term>
1432 Display Filter only: This button applies the selected filter to the
1433 current display, and keeps the dialog open.
1437 <varlistentry><term><command>Save</command></term>
1440 Save the current settings in this dialog. The file location and
1441 format is explained in <xref linkend="AppFiles"/>.
1445 <varlistentry><term><command>Close</command></term>
1448 Close this dialog. This will discard unsaved settings.
1456 <section id="ChWorkDefineFilterMacrosSection"><title>Defining and saving filter macros</title>
1458 You can define filter macros with Wireshark and give them labels for
1459 later use. This can save time in remembering and retyping some of
1460 the more complex filters you use.
1463 XXX - add an explanation of this.
1467 <section id="ChWorkFindPacketSection"><title>Finding packets</title>
1469 You can easily find packets once you have captured some packets or
1470 have read in a previously saved capture file. Simply select the
1471 <command>Find Packet...</command> menu item from the
1472 <command>Edit</command> menu. Wireshark will pop up the dialog box
1473 shown in <xref linkend="ChWorkFindPacketDialog"/>.
1475 <section><title>The "Find Packet" dialog box</title>
1476 <figure id="ChWorkFindPacketDialog">
1477 <title>The "Find Packet" dialog box</title>
1478 <graphic entityref="WiresharkFindPacket" format="PNG"/>
1481 You might first select the kind of thing to search for:
1485 <command>Display filter</command>
1488 Simply enter a display filter string into the
1489 <command>Filter:</command> field, select a direction, and click on OK.
1492 For example, to find the three way handshake for a connection from
1493 host 192.168.0.1, use the following filter string:
1494 <programlisting>ip.src==192.168.0.1 and tcp.flags.syn==1</programlisting>
1495 For more details on display filters, see <xref linkend="ChWorkDisplayFilterSection"/>
1500 <command>Hex Value</command>
1503 Search for a specific byte sequence in the packet data.
1506 For example, use "00:00" to find the next packet including two
1507 null bytes in the packet data.
1512 <command>String</command>
1515 Find a string in the packet data, with various options.
1521 The value to be found will be syntax checked while you type it in. If the
1522 syntax check of your value succeeds, the background of the entry field
1523 will turn green, if it fails, it will turn red.
1526 You can choose the search direction:
1529 <para><command>Up</command></para>
1530 <para>Search upwards in the packet list (decreasing packet numbers).</para>
1535 <para><command>Down</command></para>
1536 <para>Search downwards in the packet list (increasing packet numbers).</para>
1541 <section><title>The "Find Next" command</title>
1543 "Find Next" will continue searching with the same options used in the last
1547 <section><title>The "Find Previous" command</title>
1549 "Find Previous" will do the same thing as "Find Next", but with reverse
1555 <section id="ChWorkGoToPacketSection"><title>Go to a specific packet</title>
1557 You can easily jump to specific packets with one of the menu items in the
1560 <section><title>The "Go Back" command</title>
1562 Go back in the packet history, works much like the page history in current
1566 <section><title>The "Go Forward" command</title>
1568 Go forward in the packet history, works much like the page history in
1569 current web browsers.
1572 <section><title>The "Go to Packet" dialog box</title>
1573 <figure id="ChWorkGoToPacketDialog">
1574 <title>The "Go To Packet" dialog box</title>
1575 <graphic entityref="WiresharkGoToPacket" format="PNG"/>
1578 This dialog box will let you enter a packet number. When you press
1579 <command>OK</command>, Wireshark will jump to that packet.
1582 <section><title>The "Go to Corresponding Packet" command</title>
1584 If a protocol field is selected which points to another packet in the
1585 capture file, this command will jump to that packet.
1587 <note><title>Note!</title>
1589 As these protocol fields now work like links (just as in your
1590 Web browser), it's easier to simply double-click on the field to jump
1591 to the corresponding field.
1595 <section><title>The "Go to First Packet" command</title>
1597 This command will simply jump to the first packet displayed.
1600 <section><title>The "Go to Last Packet" command</title>
1602 This command will simply jump to the last packet displayed.
1607 <section id="ChWorkMarkPacketSection"><title>Marking packets</title>
1609 You can mark packets in the "Packet List" pane. A marked packet will
1610 be shown with black background, regardless of the coloring rules set.
1611 Marking a packet can be useful to find it later while analyzing in a large
1614 <warning><title>Warning!</title>
1616 The packet marks are not stored in the capture file or anywhere else,
1617 so all packet marks will be lost if you close the capture file.
1621 You can use packet marking to control the output of packets when
1622 saving/exporting/printing. To do so, an option in the packet range is
1623 available, see <xref linkend="ChIOPacketRangeSection"/>.
1626 There are three functions to manipulate the marked state of a packet:
1630 <command>Mark packet (toggle)</command> toggles the marked state
1636 <command>Mark all displayed packets</command> set the mark state of all
1642 <command>Unmark all packets</command> reset the mark state of all
1647 These mark functions are available from the "Edit" menu, and the
1648 "Mark packet (toggle)" function is also available from the pop-up menu of
1649 the "Packet List" pane.
1653 <section id="ChWorkIgnorePacketSection"><title>Ignoring packets</title>
1655 You can ignore packets in the "Packet List" pane. Wireshark will then pretend that this
1656 packets does not exist in the capture file.
1657 An ignored packet will be shown with white background and gray foreground, regardless
1658 of the coloring rules set.
1660 <warning><title>Warning!</title>
1662 The packet ignored marks are not stored in the capture file or anywhere else,
1663 so all packet ignored marks will be lost if you close the capture file.
1667 There are three functions to manipulate the ignored state of a packet:
1671 <command>Ignore packet (toggle)</command> toggles the ignored state
1677 <command>Ignore all displayed packets</command> set the ignored state of all
1683 <command>Un-Ignore all packets</command> reset the ignored state of all
1688 These ignore functions are available from the "Edit" menu, and the
1689 "Ignore packet (toggle)" function is also available from the pop-up menu of
1690 the "Packet List" pane.
1694 <section id="ChWorkTimeFormatsSection"><title>Time display formats and time
1697 While packets are captured, each packet is timestamped. These timestamps
1698 will be saved to the capture file, so they will be available for later
1702 A detailed description of timestamps, timezones and alike can be found at: <xref
1703 linkend="ChAdvTimestamps"/>.
1706 The timestamp presentation format and the precision in the packet list can
1707 be chosen using the View menu, see <xref linkend="ChUseWiresharkViewMenu"/>.
1710 The available presentation formats are:
1712 <listitem><para><command>Date and Time of Day: 1970-01-01 01:02:03.123456</command>
1713 The absolute date and time of the day when the packet was captured.</para>
1715 <listitem><para><command>Time of Day: 01:02:03.123456</command>
1716 The absolute time of the day when the packet was captured.</para>
1718 <listitem><para><command>Seconds Since Beginning of Capture: 123.123456</command>
1719 The time relative to the start of the capture file or the first
1720 "Time Reference" before this packet (see <xref
1721 linkend="ChWorkTimeReferencePacketSection"/>).</para>
1723 <listitem><para><command>Seconds Since Previous Captured Packet: 1.123456</command>
1724 The time relative to the previous captured packet.</para>
1726 <listitem><para><command>Seconds Since Previous Displayed Packet: 1.123456</command>
1727 The time relative to the previous displayed packet.</para>
1729 <listitem><para><command>Seconds Since Epoch (1970-01-01): 1234567890.123456</command>
1730 The time relative to epoch (midnight UTC of January 1, 1970).</para>
1735 The available precisions (aka. the number of displayed decimal places) are:
1737 <listitem><para><command>Automatic</command>
1738 The timestamp precision of
1739 the loaded capture file format will be used (the default).</para>
1741 <listitem><para><command>Seconds, Deciseconds, Centiseconds, Milliseconds,
1742 Microseconds or Nanoseconds</command>
1743 The timestamp precision will be forced to the given setting. If the
1745 precision is smaller, zeros will be appended. If the precision is larger,
1746 the remaining decimal places will be cut off.</para>
1751 Precision example: If you have a timestamp and it's displayed using,
1752 "Seconds Since Previous Packet", : the value might be 1.123456. This will
1753 be displayed using the "Automatic" setting for libpcap files (which is
1754 microseconds). If you use Seconds it would show simply 1 and if you use
1755 Nanoseconds it shows 1.123456000.
1757 <section id="ChWorkTimeReferencePacketSection">
1758 <title>Packet time referencing</title>
1760 The user can set time references to packets. A time reference is the
1761 starting point for all subsequent packet time calculations. It will be
1762 useful, if you want to see the time values relative to a special packet,
1763 e.g. the start of a new request. It's possible to set multiple time
1764 references in the capture file.
1766 <warning><title>Warning!</title>
1768 The time references will not be saved permanently and will be lost when
1769 you close the capture file.
1772 <note><title>Note!</title>
1774 Time referencing will only be useful, if the time display format is set to
1775 "Seconds Since Beginning of Capture". If one of the other time display
1776 formats are used, time referencing will have no effect (and will make no
1781 To work with time references, choose one of the "Time Reference" items
1782 in the "Edit" menu , see <xref linkend="ChUseEditMenuSection"/>, or from
1783 the pop-up menu of the "Packet List" pane.
1786 <listitem><para><command>Set Time Reference (toggle)</command>
1787 Toggles the time reference state of the currently selected
1788 packet to on or off.</para>
1790 <listitem><para><command>Find Next</command>
1791 Find the next time referenced packet in the "Packet List" pane.
1794 <listitem><para><command>Find Previous</command>
1795 Find the previous time referenced packet in the "Packet List"
1801 <figure id="ChWorkTimeReference">
1802 <title>Wireshark showing a time referenced packet</title>
1803 <graphic entityref="WiresharkTimeReference" format="PNG"/>
1807 A time referenced packet will be marked with the string *REF* in the Time
1808 column (see packet number 10). All subsequent packets will show the time
1809 since the last time reference.
1815 <!-- End of WSUG Chapter Work -->